X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FComponents%2FNimManager.py;h=65f56e71657f4fcf9111107a7d8502c1c50342f1;hp=7f7dd5c4d91b40f81fc5647ccb82cbe9a9e2f967;hb=5a4813a68dab2715a684fdf1f278f48ec86e6a05;hpb=16c07b98245e94a162685803acd4ba4b5d4298a3 diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py old mode 100644 new mode 100755 index 7f7dd5c..65f56e7 --- a/lib/python/Components/NimManager.py +++ b/lib/python/Components/NimManager.py @@ -118,8 +118,11 @@ class SecConfigure: def linkNIMs(self, sec, nim1, nim2): print "link tuner", nim1, "to tuner", nim2 - if nim2 == (nim1 - 1): - self.linkInternally(nim1) +# if nim2 == (nim1 - 1): +# self.linkInternally(nim1) +# +# for internally connect tuner A to B + self.linkInternally(nim1) sec.setTunerLinked(nim1, nim2) def getRoot(self, slotid, connto): @@ -1361,25 +1364,32 @@ def InitNimManager(nimmgr): slot_id = configElement.slot_id if nimmgr.nim_slots[slot_id].description == 'Alps BSBE2': open("/proc/stb/frontend/%d/tone_amplitude" %(fe_id), "w").write(configElement.value) - + def tunerTypeChanged(nimmgr, configElement): fe_id = configElement.fe_id - print "tunerTypeChanged feid %d to mode %s" % (fe_id, 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() - + + cur_type = int(open("/proc/stb/frontend/%d/mode" % (fe_id), "r").read()) + if cur_type != int(configElement.value): + print "tunerTypeChanged feid %d from %d to mode %d" % (fe_id, cur_type, int(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() + else: + print "tuner type is already already %d" %cur_type + empty_slots = 0 for slot in nimmgr.nim_slots: x = slot.slot