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 8216eea..bc3a88d 100644 (file)
@@ -485,7 +485,7 @@ eDVBFrontend::eDVBFrontend(int adap, int fe, int &ok, bool simulate)
 
 void eDVBFrontend::reopenFrontend()
 {
-       closeFrontend();
+       sleep(1);
        m_type = -1;
        openFrontend();
 }
index a3e87e3..d20829b 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;
+       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;
index 6af4c52..c68e940 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)
-               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.closeFrontend()
+               open("/proc/stb/frontend/%d/mode" % (fe_id), "w").write(configElement.value)
                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