Support turbo2. vuplus_experimental
authorhschang <chang@dev3>
Thu, 21 Jan 2021 06:33:42 +0000 (15:33 +0900)
committerhschang <chang@dev3>
Thu, 21 Jan 2021 06:33:55 +0000 (15:33 +0900)
RecordTimer.py
lib/python/Components/SystemInfo.py
lib/python/Plugins/SystemPlugins/RemoteControlCode/plugin.py
lib/python/Plugins/SystemPlugins/TransCodingSetup/plugin.py
lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py
lib/python/Screens/ScanSetup.py

index 7fe7805..4803ef6 100755 (executable)
@@ -161,7 +161,7 @@ class RecordTimerEntry(timer.TimerEntry, object):
                print "[TIMER]", msg
 
        def calculateFilename(self):
                print "[TIMER]", msg
 
        def calculateFilename(self):
-               if self.Filename:
+               if self.pvrConvert and self.Filename:
                        self.log(0, "Filename calculated as: '%s'" % self.Filename)
                        return self.Filename
 
                        self.log(0, "Filename calculated as: '%s'" % self.Filename)
                        return self.Filename
 
index d66437e..de9bbe2 100755 (executable)
@@ -29,14 +29,14 @@ SystemInfo["NumFrontpanelLEDs"] = countFrontpanelLEDs()
 SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists("/dev/dbox/lcd0")
 SystemInfo["FrontpanelDisplayGrayscale"] = fileExists("/dev/dbox/oled0")
 SystemInfo["DeepstandbySupport"] = HardwareInfo().get_device_name() != "dm800"
 SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists("/dev/dbox/lcd0")
 SystemInfo["FrontpanelDisplayGrayscale"] = fileExists("/dev/dbox/oled0")
 SystemInfo["DeepstandbySupport"] = HardwareInfo().get_device_name() != "dm800"
-SystemInfo["HdmiInSupport"] = HardwareInfo().get_vu_device_name() in ("ultimo4k", "uno4kse", "duo4k")
+SystemInfo["HdmiInSupport"] = HardwareInfo().get_vu_device_name() in ("ultimo4k", "uno4kse", "duo4k", "duo4kse")
 SystemInfo["WOWLSupport"] = HardwareInfo().get_vu_device_name() in ("ultimo4k", "duo4k")
 SystemInfo["ScrambledPlayback"] = "PVR" in open("/proc/stb/tsmux/ci0_input_choices").read()
 SystemInfo["FastChannelChange"] =  fileExists("/proc/stb/frontend/fbc/fcc")
 SystemInfo["MiniTV"] = fileExists("/proc/stb/lcd/live_enable")
 SystemInfo["WOWLSupport"] = HardwareInfo().get_vu_device_name() in ("ultimo4k", "duo4k")
 SystemInfo["ScrambledPlayback"] = "PVR" in open("/proc/stb/tsmux/ci0_input_choices").read()
 SystemInfo["FastChannelChange"] =  fileExists("/proc/stb/frontend/fbc/fcc")
 SystemInfo["MiniTV"] = fileExists("/proc/stb/lcd/live_enable")
-SystemInfo["DisableUsbRecord"] = HardwareInfo().get_vu_device_name() in ("solo4k", "uno4kse", "zero4k", "duo4k")
+SystemInfo["DisableUsbRecord"] = HardwareInfo().get_vu_device_name() in ("solo4k", "uno4kse", "zero4k", "duo4k", "duo4kse")
 SystemInfo["DefaultAniSpeed"] = HardwareInfo().get_vu_device_name() in ("uno4k", "uno4kse", "zero4k", "duo4k") and 25 or 20
 SystemInfo["DefaultAniSpeed"] = HardwareInfo().get_vu_device_name() in ("uno4k", "uno4kse", "zero4k", "duo4k") and 25 or 20
-SystemInfo["DefaultFullHDSkin"] = HardwareInfo().get_vu_device_name() in ("solo4k", "ultimo4k", "uno4k", "uno4kse", "zero4k", "duo4k")
+SystemInfo["DefaultFullHDSkin"] = HardwareInfo().get_vu_device_name() in ("solo4k", "ultimo4k", "uno4k", "uno4kse", "zero4k", "duo4k", "duo4kse")
 SystemInfo["PVRSupport"] = HardwareInfo().get_vu_device_name() not in ["solose", "zero", "uno4k"]
 
 SystemInfo["CommonInterface"] = eDVBCIInterfaces.getInstance().getNumOfSlots()
 SystemInfo["PVRSupport"] = HardwareInfo().get_vu_device_name() not in ["solose", "zero", "uno4k"]
 
 SystemInfo["CommonInterface"] = eDVBCIInterfaces.getInstance().getNumOfSlots()
index 3f2bb99..a583331 100755 (executable)
@@ -19,7 +19,7 @@ def getModel():
        return ret
 
 def getRcuDefaultType():
        return ret
 
 def getRcuDefaultType():
-       if getModel() in ["uno4kse", "zero4k", "duo4k"]:
+       if getModel() in ["uno4kse", "zero4k", "duo4k", "duo4kse"]:
                return "new"
        return "legacy"
 
                return "new"
        return "legacy"
 
index dc34490..c65dfa2 100755 (executable)
@@ -53,6 +53,14 @@ def getProcPath(encoder, configName):
                "profile"               :       "profile",
                "width"                 :       "width",
                "height"                :       "height",
                "profile"               :       "profile",
                "width"                 :       "width",
                "height"                :       "height",
+               "framerate_choices"             :       "framerate_choices",
+               "resolution_choices"    :       "resolution_choices",
+               "aspectratio_choices"   :       "aspectratio_choices",
+               "resolution_choices"    :       "display_format_choices",
+               "audiocodec_choices"    :       "audio_codec_choices",
+               "videocodec_choices"    :       "video_codec_choices",
+               "level_choices"         :       "level_choices",
+               "profile_choices"       :       "profile_choices",
        }.get(configName)
        return "/proc/stb/encoder/%s/%s" % (encoder, _configName)
 
        }.get(configName)
        return "/proc/stb/encoder/%s/%s" % (encoder, _configName)
 
@@ -61,6 +69,36 @@ def checkSupportAdvanced():
                return True
        return False
 
                return True
        return False
 
+def getChoices(configName):
+       choices = []
+       proc_path = getProcPath(encoder, configName)
+       if fileExists(proc_path):
+               data = getProcValue(proc_path)
+               if data is not None:
+                       for choice in data.split(' '):
+                               choices.append( (choice, _(choice)) )
+       return choices
+
+def getDefault(choices, value):
+       for choice in choices:
+               if choice[0] == value:
+                       return value
+       return choices[0][0]
+
+def getAspectratioChoices():
+       choices = []
+       proc_path = getProcPath(encoder, "aspectratio_choices")
+       if fileExists(proc_path):
+               data = getProcValue(proc_path)
+               if data is not None:
+                       for choice in data.split(' '):
+                               try:
+                                       k,v = choice.split(':')
+                                       choices.append( (k, _(v)) )
+                               except:
+                                       continue
+       return choices
+
 config.plugins.transcodingsetup = ConfigSubsection()
 config.plugins.transcodingsetup.transcoding = ConfigSelection(default = "enable", choices = [ ("enable", _("enable")), ("disable", _("disable"))] )
 config.plugins.transcodingsetup.port = ConfigSelection(default = "8002", choices = [ ("8001", "8001"), ("8002", "8002")] )
 config.plugins.transcodingsetup = ConfigSubsection()
 config.plugins.transcodingsetup.transcoding = ConfigSelection(default = "enable", choices = [ ("enable", _("enable")), ("disable", _("disable"))] )
 config.plugins.transcodingsetup.port = ConfigSelection(default = "8002", choices = [ ("8001", "8001"), ("8002", "8002")] )
@@ -84,7 +122,10 @@ def createTransCodingConfig(encoder):
                setAttr("bitrate", encoder, choice)
 
        if fileExists( getProcPath(encoder ,"framerate") ):
                setAttr("bitrate", encoder, choice)
 
        if fileExists( getProcPath(encoder ,"framerate") ):
-               choice = TconfigSelection(encoder, default = "30000", choices = [ ("23976", _("23976")), ("24000", _("24000")), ("25000", _("25000")), ("29970", _("29970")), ("30000", _("30000")), ("50000", _("50000")), ("59940", _("59940")), ("60000", _("60000"))] )
+               framerate_choices = getChoices("framerate_choices")
+               if (len(framerate_choices) == 0):
+                       framerate_choices = [ ("23976", _("23976")), ("24000", _("24000")), ("25000", _("25000")), ("29970", _("29970")), ("30000", _("30000")), ("50000", _("50000")), ("59940", _("59940")), ("60000", _("60000"))]
+               choice = TconfigSelection(encoder, default = getDefault(framerate_choices, "30000"), choices = framerate_choices )
                setAttr("framerate", encoder, choice)
 
        if checkSupportAdvanced() and (hasAttr("bitrate", encoder) or hasAttr("framerate", encoder)):
                setAttr("framerate", encoder, choice)
 
        if checkSupportAdvanced() and (hasAttr("bitrate", encoder) or hasAttr("framerate", encoder)):
@@ -92,23 +133,31 @@ def createTransCodingConfig(encoder):
                setAttr("automode", encoder, choice)
 
        if fileExists( getProcPath(encoder, "resolution") ):
                setAttr("automode", encoder, choice)
 
        if fileExists( getProcPath(encoder, "resolution") ):
-               resolutaion_choices = [ ("480p", _("480p")), ("576p", _("576p")), ("720p", _("720p")), ("320x240", _("320x240")), ("160x120", _("160x120")) ]
-               if vumodel in ("solo4k"):
-                       resolutaion_choices.insert(3, ("1080p", _("1080p")))
-
-               choice = TconfigSelection(encoder, default = "480p", choices = resolutaion_choices )
+               resolutaion_choices = getChoices("resolution_choices")
+               if (len(resolutaion_choices) == 0):
+                       resolutaion_choices = [ ("480p", _("480p")), ("576p", _("576p")), ("720p", _("720p")), ("320x240", _("320x240")), ("160x120", _("160x120")) ]
+               choice = TconfigSelection(encoder, default = getDefault(resolutaion_choices, "480p"), choices = resolutaion_choices )
                setAttr("resolution", encoder, choice)
 
        if fileExists( getProcPath(encoder, "aspectratio") ):
                setAttr("resolution", encoder, choice)
 
        if fileExists( getProcPath(encoder, "aspectratio") ):
-               choice = TconfigSelection(encoder, default = "1", choices = [ ("0", _("auto")), ("1", _("4x3")), ("2", _("16x9")) ] )
+               aspectratio_choices = getAspectratioChoices()
+               if len(aspectratio_choices) == 0:
+                       aspectratio_choices = [ ("0", _("auto")), ("1", _("4x3")), ("2", _("16x9")) ]
+               choice = TconfigSelection(encoder, default = "1", choices = aspectratio_choices )
                setAttr("aspectratio", encoder, choice)
 
        if fileExists( getProcPath(encoder, "audiocodec") ):
                setAttr("aspectratio", encoder, choice)
 
        if fileExists( getProcPath(encoder, "audiocodec") ):
-               choice = TconfigSelection(encoder, default = "aac", choices = [("mpg", _("mpg")), ("mp3", _("mp3")), ("aac", _("aac")), ("aac+", _("aac+")), ("aac+loas", _("aac+loas")), ("aac+adts", _("aac+adts")), ("ac3", _("ac3"))] )
+               audiocodec_choices = getChoices("audiocodec_choices")
+               if len(audiocodec_choices) == 0:
+                       audiocodec_choices = [("mpg", _("mpg")), ("mp3", _("mp3")), ("aac", _("aac")), ("aac+", _("aac+")), ("aac+loas", _("aac+loas")), ("aac+adts", _("aac+adts")), ("ac3", _("ac3"))]
+               choice = TconfigSelection(encoder, default = getDefault(audiocodec_choices, "aac"), choices = audiocodec_choices )
                setAttr("audiocodec", encoder, choice)
 
        if fileExists( getProcPath(encoder, "videocodec") ):
                setAttr("audiocodec", encoder, choice)
 
        if fileExists( getProcPath(encoder, "videocodec") ):
-               choice = TconfigSelection(encoder, default = "h264", choices = [ ("h264", _("h264")) ] )
+               videocodec_choices = getChoices("videocodec_choices")
+               if len(videocodec_choices) == 0:
+                       _choices = [ ("h264", _("h264")) ]
+               choice = TconfigSelection(encoder, default = getDefault(videocodec_choices, "h264"), choices = videocodec_choices )
                setAttr("videocodec", encoder, choice)
 
        if fileExists( getProcPath(encoder, "gopframeb") ):
                setAttr("videocodec", encoder, choice)
 
        if fileExists( getProcPath(encoder, "gopframeb") ):
@@ -120,14 +169,20 @@ def createTransCodingConfig(encoder):
                setAttr("gopframep", encoder, choice)
 
        if fileExists( getProcPath(encoder, "level") ):
                setAttr("gopframep", encoder, choice)
 
        if fileExists( getProcPath(encoder, "level") ):
-               choice = TconfigSelection(encoder, default = "3.1", choices = [("1.0", _("1.0")), ("2.0", _("2.0")),
-                       ("2.1", _("2.1")), ("2.2", _("2.2")), ("3.0", _("3.0")), ("3.1", _("3.1")),
-                       ("3.2", _("3.2")), ("4.0", _("4.0")), ("4.1", _("4.1")), ("4.2", _("4.2")),
-                       ("5.0", _("5.0")), ("low", _("low")), ("main", _("main")), ("high", _("high"))] )
+               level_choices = getChoices("level_choices")
+               if (len(level_choices) == 0):
+                       level_choices = [("1.0", _("1.0")), ("2.0", _("2.0")),
+                               ("2.1", _("2.1")), ("2.2", _("2.2")), ("3.0", _("3.0")), ("3.1", _("3.1")),
+                               ("3.2", _("3.2")), ("4.0", _("4.0")), ("4.1", _("4.1")), ("4.2", _("4.2")),
+                               ("5.0", _("5.0")), ("low", _("low")), ("main", _("main")), ("high", _("high"))]
+               choice = TconfigSelection(encoder, default = getDefault(level_choices, "3.1"), choices = level_choices )
                setAttr("level", encoder, choice)
 
        if fileExists( getProcPath(encoder, "profile") ):
                setAttr("level", encoder, choice)
 
        if fileExists( getProcPath(encoder, "profile") ):
-               choice = TconfigSelection(encoder, default = "baseline", choices = [("baseline", _("baseline")), ("simple", _("simple")), ("main", _("main")), ("high", _("high")), ("advanced simple", _("advancedsimple"))] )
+               profile_choices = getChoices("profile_choices")
+               if (len(profile_choices) == 0):
+                       profile_choices = [("baseline", _("baseline")), ("simple", _("simple")), ("main", _("main")), ("high", _("high")), ("advanced simple", _("advancedsimple"))]
+               choice = TconfigSelection(encoder, default = getDefault(profile_choices, "baseline"), choices = profile_choices )
                setAttr("profile", encoder, choice)
 
 # check encoders
                setAttr("profile", encoder, choice)
 
 # check encoders
index 8425f42..52b9f17 100644 (file)
@@ -62,10 +62,10 @@ class VideoHardware:
        }
 
        widescreen_modes = set(["720p", "1080i", "1080p", "2160p"])
        }
 
        widescreen_modes = set(["720p", "1080i", "1080p", "2160p"])
-       hdmi_hw_types = set(["dm500", "dm800se", "dm7020hd", "bm750", "solo", "uno", "ultimo", "solo2", "duo2", "solose", "zero", "solo4k", "ultimo4k", "uno4k", "uno4kse", "zero4k", "duo4k"])
-       hdmi_pc_hw_types = set(["dm500", "dm800se", "dm7020hd", "bm750", "solo", "uno", "ultimo", "solo2", "duo2", "solose", "zero", "solo4k", "ultimo4k", "uno4k", "uno4kse", "zero4k", "duo4k"])
-       noscart_hw_types = set(["zero", "solo4k", "ultimo4k", "uno4k", "uno4kse", "zero4k", "duo4k"])
-       noypbpr_hw_types = set(["solose", "zero", "solo4k", "ultimo4k", "uno4k", "uno4kse", "zero4k", "duo4k"])
+       hdmi_hw_types = set(["dm500", "dm800se", "dm7020hd", "bm750", "solo", "uno", "ultimo", "solo2", "duo2", "solose", "zero", "solo4k", "ultimo4k", "uno4k", "uno4kse", "zero4k", "duo4k", "duo4kse"])
+       hdmi_pc_hw_types = set(["dm500", "dm800se", "dm7020hd", "bm750", "solo", "uno", "ultimo", "solo2", "duo2", "solose", "zero", "solo4k", "ultimo4k", "uno4k", "uno4kse", "zero4k", "duo4k", "duo4kse"])
+       noscart_hw_types = set(["zero", "solo4k", "ultimo4k", "uno4k", "uno4kse", "zero4k", "duo4k", "duo4kse"])
+       noypbpr_hw_types = set(["solose", "zero", "solo4k", "ultimo4k", "uno4k", "uno4kse", "zero4k", "duo4k", "duo4kse"])
 
        def getDeviceName(self):
                device_name = "unknown"
 
        def getDeviceName(self):
                device_name = "unknown"
@@ -80,10 +80,10 @@ class VideoHardware:
                return device_name
 
        def isVumodel(self, hw_type):
                return device_name
 
        def isVumodel(self, hw_type):
-               return hw_type in set(["bm750", "solo", "uno", "ultimo", "solo2", "duo2", "solose", "zero", "solo4k", "ultimo4k", "uno4k", "uno4kse", "zero4k", "duo4k"])
+               return hw_type in set(["bm750", "solo", "uno", "ultimo", "solo2", "duo2", "solose", "zero", "solo4k", "ultimo4k", "uno4k", "uno4kse", "zero4k", "duo4k", "duo4kse"])
 
        def isVumodel4K(self, hw_type):
 
        def isVumodel4K(self, hw_type):
-               return hw_type in set(["solo4k", "ultimo4k", "uno4k", "uno4kse", "zero4k", "duo4k"])
+               return hw_type in set(["solo4k", "ultimo4k", "uno4k", "uno4kse", "zero4k", "duo4k", "duo4kse"])
 
        # re-define AVSwitch.getOutputAspect
        def getOutputAspect(self):
 
        # re-define AVSwitch.getOutputAspect
        def getOutputAspect(self):
index 7465fde..87a58f7 100644 (file)
@@ -106,6 +106,7 @@ cable_autoscan_nimtype = {
 'SSH108' : 'ssh108',
 'TT3L10' : 'tt3l10',
 'TURBO' : 'vuplus_turbo_c',
 'SSH108' : 'ssh108',
 'TT3L10' : 'tt3l10',
 'TURBO' : 'vuplus_turbo_c',
+'TURBO2' : 'vuplus_turbo2_c',
 'TT2L08' : 'tt2l08',
 'BCM3148' : 'bcm3148',
 'BCM3158' : 'bcm3148',
 'TT2L08' : 'tt2l08',
 'BCM3148' : 'bcm3148',
 'BCM3158' : 'bcm3148',
@@ -115,11 +116,13 @@ terrestrial_autoscan_nimtype = {
 'SSH108' : 'ssh108_t2_scan',
 'TT3L10' : 'tt3l10_t2_scan',
 'TURBO' : 'vuplus_turbo_t',
 'SSH108' : 'ssh108_t2_scan',
 'TT3L10' : 'tt3l10_t2_scan',
 'TURBO' : 'vuplus_turbo_t',
+'TURBO2' : 'vuplus_turbo2_t',
 'TT2L08' : 'tt2l08_t2_scan',
 'BCM3466' : 'bcm3466'
 }
 
 dual_tuner_list = ('TT3L10', 'BCM3466')
 'TT2L08' : 'tt2l08_t2_scan',
 'BCM3466' : 'bcm3466'
 }
 
 dual_tuner_list = ('TT3L10', 'BCM3466')
+vtuner_need_idx_list = ('TURBO2')
 
 def GetDeviceId(filter, nim_idx):
        tuners={}
 
 def GetDeviceId(filter, nim_idx):
        tuners={}
@@ -137,6 +140,17 @@ def GetDeviceId(filter, nim_idx):
                socket_id += 1
        return device_id
 
                socket_id += 1
        return device_id
 
+def getVtunerId(filter, nim_idx):
+       idx_count = 1
+       for slot in nimmanager.nim_slots:
+               slot_idx = slot.slot
+               if filter in slot.description:
+                       if slot_idx == nim_idx :
+                               return "--idx " + str(idx_count)
+                       else:
+                               idx_count += 1
+       return ""
+
 def GetTerrestrial5VEnable(nim_idx):
        nim = nimmanager.nim_slots[nim_idx]
        return int(nim.config.terrestrial_5V.value)
 def GetTerrestrial5VEnable(nim_idx):
        nim = nimmanager.nim_slots[nim_idx]
        return int(nim.config.terrestrial_5V.value)
@@ -231,6 +245,8 @@ class CableTransponderSearchSupport:
                                                        print "GetCommand ->", err
                                                        device_id = "--device=0"
 #                                              print nim_idx, nim_name, cable_autoscan_nimtype[nim_name], device_id
                                                        print "GetCommand ->", err
                                                        device_id = "--device=0"
 #                                              print nim_idx, nim_name, cable_autoscan_nimtype[nim_name], device_id
+                                       elif nim_name in vtuner_need_idx_list:
+                                               device_id = getVtunerId(nim_name, nim_idx)
                                        command = "%s %s" % (cable_autoscan_nimtype[nim_name], device_id)
                                        return command
                        except Exception, err:
                                        command = "%s %s" % (cable_autoscan_nimtype[nim_name], device_id)
                                        return command
                        except Exception, err:
@@ -462,6 +478,8 @@ class TerrestrialTransponderSearchSupport:
                                                print "terrestrialTransponderGetCmd ->", err
                                                device_id = "--device 0"
 #                                      print nim_idx, nim_name, terrestrial_autoscan_nimtype[nim_name], device_id
                                                print "terrestrialTransponderGetCmd ->", err
                                                device_id = "--device 0"
 #                                      print nim_idx, nim_name, terrestrial_autoscan_nimtype[nim_name], device_id
+                               elif nim_name in vtuner_need_idx_list:
+                                       device_id = getVtunerId(nim_name, nim_idx)
                                command = "%s %s" % (terrestrial_autoscan_nimtype[nim_name], device_id)
                                return command
                except Exception, err:
                                command = "%s %s" % (terrestrial_autoscan_nimtype[nim_name], device_id)
                                return command
                except Exception, err: