fix no more turning positioner after leave positioner setup in some cases
authorghost <andreas.monzner@multimedia-labs.de>
Mon, 1 Mar 2010 18:37:57 +0000 (19:37 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Mon, 1 Mar 2010 18:38:25 +0000 (19:38 +0100)
this fixes bug #321

lib/dvb/frontend.cpp
lib/dvb/frontend.h
lib/dvb/sec.cpp
lib/python/Components/TuneTest.py
lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py

index c0263fb4024daf1b43d5e91e3f0bf7e5b5fbb85e..f85a37fe33580ab507d2c2f94c799a524c4fe76f 100644 (file)
@@ -455,7 +455,7 @@ int eDVBFrontend::PriorityOrder=0;
 
 eDVBFrontend::eDVBFrontend(int adap, int fe, int &ok, bool simulate)
        :m_simulate(simulate), m_enabled(false), m_type(-1), m_dvbid(fe), m_slotid(fe)
-       ,m_fd(-1), m_need_rotor_workaround(false), m_can_handle_dvbs2(false)
+       ,m_fd(-1), m_rotor_mode(false), m_need_rotor_workaround(false), m_can_handle_dvbs2(false)
        ,m_state(stateClosed), m_timeout(0), m_tuneTimer(0)
 #if HAVE_DVB_API_VERSION < 3
        ,m_secfd(-1)
@@ -692,7 +692,8 @@ void eDVBFrontend::feEvent(int w)
                        {
                                eDebug("stateLostLock");
                                state = stateLostLock;
-                               sec_fe->m_data[CSW] = sec_fe->m_data[UCSW] = sec_fe->m_data[TONEBURST] = -1; // reset diseqc
+                               if (!m_rotor_mode)
+                                       sec_fe->m_data[CSW] = sec_fe->m_data[UCSW] = sec_fe->m_data[TONEBURST] = -1; // reset diseqc
                        }
                }
                if (m_state != state)
@@ -2343,6 +2344,20 @@ RESULT eDVBFrontend::tune(const iDVBFrontendParameters &where)
                        res = -EINVAL;
                        goto tune_error;
                }
+               if (m_rotor_mode != feparm.no_rotor_command_on_tune && !feparm.no_rotor_command_on_tune)
+               {
+                       eDVBFrontend *sec_fe = this;
+                       long tmp = m_data[LINKED_PREV_PTR];
+                       while (tmp != -1)
+                       {
+                               eDVBRegisteredFrontend *linked_fe = (eDVBRegisteredFrontend*)tmp;
+                               sec_fe = linked_fe->m_frontend;
+                               sec_fe->getData(LINKED_NEXT_PTR, tmp);
+                       }
+                       eDebug("(fe%d) reset diseqc after leave rotor mode!", m_dvbid);
+                       sec_fe->m_data[CSW] = sec_fe->m_data[UCSW] = sec_fe->m_data[TONEBURST] = sec_fe->m_data[ROTOR_CMD] = sec_fe->m_data[ROTOR_POS] = -1; // reset diseqc
+               }
+               m_rotor_mode = feparm.no_rotor_command_on_tune;
                if (!m_simulate)
                        m_sec->setRotorMoving(m_slotid, false);
                res=prepare_sat(feparm, timeout);
index bac27539a9f56cddb70e9e009b270f5b94dbbf79..4cf050813cf27083b82fd4a916c961ee121b1d76 100644 (file)
@@ -75,6 +75,7 @@ private:
        int m_dvbid;
        int m_slotid;
        int m_fd;
+       bool m_rotor_mode;
        bool m_need_rotor_workaround;
        bool m_can_handle_dvbs2;
        char m_filename[128];
index 9124688950af12d3a2060da4c9e1f72375796ace..44cbe709d4d3cde2a789f49b9f8bf93b5dc76938 100644 (file)
@@ -156,6 +156,11 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite
                                        ret = 15000;
                                }
 
+                               if (sat.no_rotor_command_on_tune && !rotor) {
+                                       eSecDebugNoSimulate("no rotor but no_rotor_command_on_tune is set.. ignore lnb %d", idx);
+                                       continue;
+                               }
+
                                eSecDebugNoSimulate("ret1 %d", ret);
 
                                if (linked_in_use)
index f9ab3edb1651b64e3b4b06d98e3499f1bdfbea40..44b1909174580aebabf1229ed14e85c7b6110fa1 100644 (file)
@@ -1,8 +1,9 @@
 from enigma import eDVBFrontendParametersSatellite, eDVBFrontendParameters, eDVBResourceManager, eTimer
 
 class Tuner:
-       def __init__(self, frontend):
+       def __init__(self, frontend, ignore_rotor=False):
                self.frontend = frontend
+               self.ignore_rotor = ignore_rotor
 
        # transponder = (frequency, symbolrate, polarisation, fec, inversion, orbpos, system, modulation, rolloff, pilot, tsid, onid)
        #                    0         1             2         3       4         5       6        7          8       9      10    11
@@ -21,7 +22,7 @@ class Tuner:
                        parm.rolloff = transponder[8]
                        parm.pilot = transponder[9]
                        feparm = eDVBFrontendParameters()
-                       feparm.setDVBS(parm)
+                       feparm.setDVBS(parm, self.ignore_rotor)
                        self.lastparm = feparm
                        self.frontend.tune(feparm)
 
index fa533c0b4d478aa08a4be245b7f1cf9336e2200d..3cc9e75109b6fc5a041cedd4d10f17139e5542a9 100644 (file)
@@ -77,7 +77,7 @@ class PositionerSetup(Screen):
                
                self.frontendStatus = { }
                self.diseqc = Diseqc(self.frontend)
-               self.tuner = Tuner(self.frontend)
+               self.tuner = Tuner(self.frontend, True) #True means we dont like that the normal sec stuff sends commands to the rotor!
 
                tp = ( cur.get("frequency", 0) / 1000,
                        cur.get("symbol_rate", 0) / 1000,