From 65e19ae2a40a7598987c3e831d4f1ff0e7a673c5 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Wed, 31 Mar 2010 23:24:18 +0200 Subject: [PATCH] fixes bug #436 (again) 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 | 2 +- lib/dvb/idvb.h | 1 + lib/python/Components/NimManager.py | 12 +++++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index 8216eea..bc3a88d 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -485,7 +485,7 @@ eDVBFrontend::eDVBFrontend(int adap, int fe, int &ok, bool simulate) void eDVBFrontend::reopenFrontend() { - closeFrontend(); + sleep(1); m_type = -1; openFrontend(); } diff --git a/lib/dvb/idvb.h b/lib/dvb/idvb.h index a3e87e3..d20829b 100644 --- a/lib/dvb/idvb.h +++ b/lib/dvb/idvb.h @@ -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 &stateChange, ePtr &connection)=0; diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py index 70ed7c4..3c96fbb 100644 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -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 -- 2.7.4