Index: libs/libmythtv/diseqc.cpp
===================================================================
--- libs/libmythtv/diseqc.cpp	(revision 10949)
+++ libs/libmythtv/diseqc.cpp	(working copy)
@@ -1106,7 +1106,7 @@
     // populate switch parameters from db
     MSqlQuery query(MSqlQuery::InitCon());
     query.prepare(
-        "SELECT subtype, switch_ports "
+        "SELECT subtype, switch_ports, cmd_repeat "
         "FROM diseqc_tree "
         "WHERE diseqcid = :DEVID");
     query.bindValue(":DEVID", GetDeviceID());
@@ -1120,6 +1120,7 @@
     {
         m_type = SwitchTypeFromString(query.value(0).toString());
         m_num_ports = query.value(1).toUInt();
+        m_repeat = query.value(2).toUInt();
         m_children.resize(m_num_ports);
         for (uint i = 0; i < m_num_ports; i++)
             m_children[i] = NULL;
@@ -1169,7 +1170,8 @@
             "    type         = 'switch', "
             "    description  = :DESC, "
             "    subtype      = :TYPE, "
-            "    switch_ports = :PORTS "
+            "    switch_ports = :PORTS, "
+            "    cmd_repeat   = :REPEAT "
             "WHERE diseqcid = :DEVID");
     }
     else
@@ -1177,10 +1179,12 @@
         query.prepare(
             "INSERT INTO diseqc_tree"
             " ( parentid,      ordinal,         type, "
-            "   description,   subtype,         switch_ports) "
+            "   description,   subtype,         switch_ports, "
+            "   cmd_repeat )"
             "VALUES "
             " (:PARENT,       :ORDINAL,         'switch', "
-            "  :DESC,         :TYPE,            :PORTS)");
+            "  :DESC,         :TYPE,            :PORTS, "
+            "  :REPEAT )");
     }
 
     if (m_parent)
@@ -1190,6 +1194,7 @@
     query.bindValue(":DESC",    GetDescription());
     query.bindValue(":TYPE",    type);
     query.bindValue(":PORTS",   m_num_ports);
+    query.bindValue(":REPEAT",  m_repeat);
     query.bindValue(":DEVID",   GetDeviceID());
 
     if (!query.exec())
@@ -1555,7 +1560,8 @@
     MSqlQuery query(MSqlQuery::InitCon());
     query.prepare(
         "SELECT subtype,         rotor_positions, "
-        "       rotor_hi_speed,  rotor_lo_speed "
+        "       rotor_hi_speed,  rotor_lo_speed, "
+        "       cmd_repeat " 
         "FROM diseqc_tree "
         "WHERE diseqcid = :DEVID");
     query.bindValue(":DEVID", GetDeviceID());
@@ -1570,6 +1576,7 @@
         m_type     = RotorTypeFromString(query.value(0).toString());
         m_speed_hi = query.value(2).toDouble();
         m_speed_lo = query.value(3).toDouble();
+        m_repeat   = query.value(4).toUInt();
 
         // form of "angle1=index1:angle2=index2:..."
         QString positions = query.value(1).toString();
@@ -1639,7 +1646,8 @@
             "    subtype         = :TYPE,    "
             "    rotor_hi_speed  = :HISPEED, "
             "    rotor_lo_speed  = :LOSPEED, "
-            "    rotor_positions = :POSMAP   "
+            "    rotor_positions = :POSMAP,  "
+            "    cmd_repeat      = :REPEAT   "
             "WHERE diseqcid = :DEVID");
     }
     else
@@ -1648,11 +1656,11 @@
             "INSERT INTO diseqc_tree "
             " ( parentid,       ordinal,         type,   "
             "   description,    subtype,         rotor_hi_speed, "
-            "   rotor_lo_speed, rotor_positions ) "
+            "   rotor_lo_speed, rotor_positions, cmd_repeat ) "
             "VALUES "
             " (:PARENT,         :ORDINAL,        'rotor',  "
             "  :DESC,           :TYPE,           :HISPEED, "
-            "  :LOSPEED,        :POSMAP )");
+            "  :LOSPEED,        :POSMAP,         :REPEAT )");
     }
 
     if (m_parent)
@@ -1664,6 +1672,7 @@
     query.bindValue(":HISPEED", m_speed_hi);
     query.bindValue(":LOSPEED", m_speed_lo);
     query.bindValue(":POSMAP",  posmap);
+    query.bindValue(":REPEAT",  m_repeat);
     query.bindValue(":DEVID",   GetDeviceID());
 
     if (!query.exec())
@@ -1883,7 +1892,8 @@
     MSqlQuery query(MSqlQuery::InitCon());
     query.prepare(
         "SELECT subtype,         lnb_lof_switch, "
-        "       lnb_lof_hi,      lnb_lof_lo "
+        "       lnb_lof_hi,      lnb_lof_lo, "
+        "       cmd_repeat "
         "FROM diseqc_tree "
         "WHERE diseqcid = :DEVID");
     query.bindValue(":DEVID", GetDeviceID());
@@ -1899,6 +1909,7 @@
         m_lof_switch = query.value(1).toInt();
         m_lof_hi     = query.value(2).toInt();
         m_lof_lo     = query.value(3).toInt();
+        m_repeat     = query.value(4).toUInt();
     }
 
     return true;
@@ -1921,7 +1932,8 @@
             "    subtype         = :TYPE,    "
             "    lnb_lof_switch  = :LOFSW,   "
             "    lnb_lof_lo      = :LOFLO,   "
-            "    lnb_lof_hi      = :LOFHI    "
+            "    lnb_lof_hi      = :LOFHI,   "
+            "    cmd_repeat      = :REPEAT   "
             "WHERE diseqcid = :DEVID");
     }
     else
@@ -1930,11 +1942,11 @@
             "INSERT INTO diseqc_tree"
             " ( parentid,      ordinal,         type, "
             "   description,   subtype,         lnb_lof_switch, "
-            "   lnb_lof_lo,    lnb_lof_hi ) "
+            "   lnb_lof_lo,    lnb_lof_hi,      cmd_repeat ) "
             "VALUES "
             " (:PARENT,       :ORDINAL,         'lnb', "
             "  :DESC,         :TYPE,            :LOFSW, "
-            "  :LOFLO,        :LOFHI ) ");
+            "  :LOFLO,        :LOFHI,           :REPEAT ) ");
     }
 
     if (m_parent)
@@ -1946,6 +1958,7 @@
     query.bindValue(":LOFSW",   m_lof_switch);
     query.bindValue(":LOFLO",   m_lof_lo);
     query.bindValue(":LOFHI",   m_lof_hi);
+    query.bindValue(":REPEAT",  m_repeat);
     query.bindValue(":DEVID",   GetDeviceID());
 
     // update dev_id
Index: libs/libmythtv/diseqc.h
===================================================================
--- libs/libmythtv/diseqc.h	(revision 10949)
+++ libs/libmythtv/diseqc.h	(working copy)
@@ -147,6 +147,7 @@
     void SetParent(DiSEqCDevDevice* parent)  { m_parent   = parent;  }
     void SetOrdinal(uint ordinal)            { m_ordinal  = ordinal; }
     void SetDescription(const QString &desc) { m_desc     = desc;    }
+    void SetRepeatCount(uint repeat)         { m_repeat   = repeat;  }
     virtual bool SetChild(uint, DiSEqCDevDevice*){return false;      }
 
     // Gets
@@ -157,6 +158,7 @@
     DiSEqCDevDevice *GetParent(void)   const { return m_parent;      }
     uint          GetOrdinal(void)     const { return m_ordinal;     }
     QString       GetDescription(void) const { return m_desc;        }
+    uint          GetRepeatCount(void) const { return m_repeat;      }
     virtual uint  GetChildCount(void)  const { return 0;             }
     virtual bool  IsCommandNeeded(
         const DiSEqCDevSettings&)      const { return false;         }
Index: libs/libmythtv/diseqcsettings.cpp
===================================================================
--- libs/libmythtv/diseqcsettings.cpp	(revision 10949)
+++ libs/libmythtv/diseqcsettings.cpp	(working copy)
@@ -96,6 +96,35 @@
     DiSEqCDevDevice &m_device;
 };
 
+
+//////////////////////////////////////// DeviceRepeatSetting
+
+class DeviceRepeatSetting : public LineEditSetting
+{
+  public:
+    DeviceRepeatSetting(DiSEqCDevDevice &device) : m_device(device)
+    {
+        setLabel(DeviceTree::tr("Repeat Count"));
+        QString help = DeviceTree::tr(
+            "Number of times to repeat DiSEqC commands sent to this device. "
+            "Larger values may help with less reliable devices.");
+        setHelpText(help);
+    }
+    
+    virtual void load(void)
+    {
+        setValue(QString::number(m_device.GetRepeatCount()));
+    }
+
+    virtual void save(void)
+    {
+        m_device.SetRepeatCount(getValue().toUInt());
+    }
+
+  private:
+    DiSEqCDevDevice &m_device;
+};
+
 //////////////////////////////////////// SwitchTypeSetting
 
 class SwitchTypeSetting : public ComboBoxSetting
@@ -171,6 +200,7 @@
     group->setLabel(DeviceTree::tr("Switch Configuration"));
 
     group->addChild(new DeviceDescrSetting(switch_dev));
+    group->addChild(new DeviceRepeatSetting(switch_dev));
     m_type = new SwitchTypeSetting(switch_dev);
     group->addChild(m_type);
     m_ports = new SwitchPortsSetting(switch_dev);
@@ -408,6 +438,7 @@
     group->setLabel(DeviceTree::tr("Rotor Configuration"));
 
     group->addChild(new DeviceDescrSetting(rotor));
+    group->addChild(new DeviceRepeatSetting(rotor));
 
     ConfigurationGroup *tgroup =
         new HorizontalConfigurationGroup(false, false, true, true);
