fixes bug #436 (again)
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Wed, 31 Mar 2010 21:24:18 +0000 (23:24 +0200)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Wed, 31 Mar 2010 21:24:18 +0000 (23:24 +0200)
multi tuner support:
add a magic sleep(1) to workaround strange behaviour
write a magic 0 into /sys/module/dvb_core/parameters/dvb_shutdown_timeout

lib/dvb/frontend.cpp
lib/dvb/idvb.h
lib/python/Components/NimManager.py

index 8216eea0761840001d668eec379c82a9d05ad586..bc3a88da3c00827fe167ddad414d71f29986ae9a 100644 (file)
@@ -485,7 +485,7 @@ eDVBFrontend::eDVBFrontend(int adap, int fe, int &ok, bool simulate)
 
 void eDVBFrontend::reopenFrontend()
 {
 
 void eDVBFrontend::reopenFrontend()
 {
-       closeFrontend();
+       sleep(1);
        m_type = -1;
        openFrontend();
 }
        m_type = -1;
        openFrontend();
 }
index a3e87e35cecff678ffa2fd74facdb087f0fd504e..d20829bf311b6f7748e924902ea3958c55b74189 100644 (file)
@@ -459,6 +459,7 @@ class iDVBFrontend: public iDVBFrontend_ENUMS, public iObject
 public:
        virtual RESULT getFrontendType(int &SWIG_OUTPUT)=0;
        virtual RESULT tune(const iDVBFrontendParameters &where)=0;
 public:
        virtual RESULT getFrontendType(int &SWIG_OUTPUT)=0;
        virtual RESULT tune(const iDVBFrontendParameters &where)=0;
+       virtual int closeFrontend(bool force = false)=0;
        virtual void reopenFrontend()=0;
 #ifndef SWIG
        virtual RESULT connectStateChange(const Slot1<void,iDVBFrontend*> &stateChange, ePtr<eConnection> &connection)=0;
        virtual void reopenFrontend()=0;
 #ifndef SWIG
        virtual RESULT connectStateChange(const Slot1<void,iDVBFrontend*> &stateChange, ePtr<eConnection> &connection)=0;
index 6af4c52c6f29f98b0734d9156ba4bd8e9fabfebb..c68e9404d8d1bf83ec26a3a44e93f6d69dce1431 100644 (file)
@@ -1257,9 +1257,19 @@ def InitNimManager(nimmgr):
        def tunerTypeChanged(nimmgr, configElement):
                fe_id = configElement.fe_id
                print "tunerTypeChanged feid %d to mode %s" % (fe_id, configElement.value)
        def tunerTypeChanged(nimmgr, configElement):
                fe_id = configElement.fe_id
                print "tunerTypeChanged feid %d to mode %s" % (fe_id, configElement.value)
-               open("/proc/stb/frontend/%d/mode" % (fe_id), "w").write(configElement.value)
+               try:
+                       oldvalue = open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "r").readline()
+                       open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "w").write("0")
+               except:
+                       print "[info] no /sys/module/dvb_core/parameters/dvb_shutdown_timeout available"
                frontend = eDVBResourceManager.getInstance().allocateRawChannel(fe_id).getFrontend()
                frontend = eDVBResourceManager.getInstance().allocateRawChannel(fe_id).getFrontend()
+               frontend.closeFrontend()
+               open("/proc/stb/frontend/%d/mode" % (fe_id), "w").write(configElement.value)
                frontend.reopenFrontend()
                frontend.reopenFrontend()
+               try:
+                       open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "w").write(oldvalue)
+               except:
+                       print "[info] no /sys/module/dvb_core/parameters/dvb_shutdown_timeout available"
                nimmgr.enumerateNIMs()
        
        empty_slots = 0
                nimmgr.enumerateNIMs()
        
        empty_slots = 0