Jump to content


Photo

Multituner: First commits - but they need a lot of improvements


  • Please log in to reply
318 replies to this topic

Re: Multituner: First commits - but they need a lot of improvements #201 Abu Baniaz

  • PLi® Contributor
  • 2,435 posts

+62
Good

Posted 19 March 2019 - 22:12

I am afraid it got rejected

diff a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py	(rejected hunks)
@@ -1539,14 +1546,14 @@ def InitNimManager(nimmgr, update_slots = []):
 
 	def hotswitchableConfigChanged(nim, slot, fe_id, configElement=None):
 		if slot.isHotSwitchable():
-			tunerTypesEnabled = [x for x in slot.multi_type.values() if nim.configModeDVBS.value and x.startswith("DVB-S") or
-				nim.configModeDVBC.value and x.startswith("DVB-C") or
-				nim.configModeDVBT.value and x.startswith("DVB-T") or
-				nim.configModeATSC.value and x.startswith("ATSC")]
-			if tunerTypesEnabled:
-				print "[InitNimManager] enable hotswitchable tuner type(s) %s" %  ",".join(tunerTypesEnabled)
-				eDVBResourceManager.getInstance().setFrontendType(nimmgr.nim_slots[fe_id].frontend_id, ",".join(tunerTypesEnabled))
-				createConfig(nim, slot)
+			tunersEnabled = slot.getHotswitchableTunersEnabled()
+			if tunersEnabled:
+				tunersEnabled = ",".join(tunerTypesEnabled)
+				print "[InitNimManager] enable hotswitchable tuner type(s) %s" % tunersEnabled
+				eDVBResourceManager.getInstance().setFrontendType(nimmgr.nim_slots[fe_id].frontend_id, tunersEnabled)
+				if "DVB-S" not in tunersEnabled:
+					nim.configMode.value = nim.configMode.default = "enabled"
+					nim.configModeDVBS.value = False
 			else:
 				print "[InitNimManager] disable hotswitchable tuner"
 				eDVBResourceManager.getInstance().setFrontendType(nimmgr.nim_slots[fe_id].frontend_id, "UNDEFINED")


Re: Multituner: First commits - but they need a lot of improvements #202 Huevos

  • PLi® Contributor
  • 4,244 posts

+158
Excellent

Posted 19 March 2019 - 23:26

Yes the scan function is work in progress... The scan stuff still needs to 'learn' the new stuff...

 

Attached an untested/drafted diff... Help is always appreciated... 

def getHotswitchableTunersEnabled(self):

In your diff file you are missing the ":".

 

https://github.com/H...4d003a39c1f20d9


Edited by Huevos, 19 March 2019 - 23:28.


Re: Multituner: First commits - but they need a lot of improvements #203 Huevos

  • PLi® Contributor
  • 4,244 posts

+158
Excellent

Posted 20 March 2019 - 00:10

BTW, as far as I know the only receivers that use these tuners are discontinued.



Re: Multituner: First commits - but they need a lot of improvements #204 Huevos

  • PLi® Contributor
  • 4,244 posts

+158
Excellent

Posted 20 March 2019 - 09:41

@Littlesat,

 

The patch is wrong.

modes = [x[:5] for x in n.getHotswitchableTunersEnabled()]

"modes" must always contain at least 1 active tuner type. This is nothing to do with being hot switchable.

+	def getHotswitchableTunersEnabled(self)
+			return [x for x in slot.multi_type.values() if
+				nim.configModeDVBS.value and x.startswith("DVB-S") or
+				nim.configModeDVBC.value and x.startswith("DVB-C") or
+				nim.configModeDVBT.value and x.startswith("DVB-T") or
+				nim.configModeATSC.value and x.startswith("ATSC")] if self.hotswitchable else []
+

None of the arguments have been forwarded. And also returning an empty list is no good.

 

You need a function called "getEnabledTunerTypes". That could then be called from the scan code. Needs to return what tuner types are available.



Re: Multituner: First commits - but they need a lot of improvements #205 littlesat

  • PLi® Core member
  • 56,262 posts

+691
Excellent

Posted 20 March 2019 - 09:49

Huevos,

 

I already was notified on the ":"... this is a 'standard' mistake when I made python code... the same issue I have with ";" in c++.

 

Please be aware I created this diff while it was totally not tested on any box... I'm travelling for work and I did code it 'dry'. Thanks for testing it for me 'ahead' ;)...

 

The way these kind of tuners were solved by us was a tricky tricky work-a-round in c++. Now it also works as intended with the white lists correctly forwarded to c++.

 

The alternative was the 'open-atv's' let's create more code to fix it method.That was why I choose for the 'do more with less -spaghetti- code' method. It also did not work regarding fallback tuners.

 

In addition a number of combined DVB-C/T tuners are now 'real' combined DVB-C/T tuners (sounds it makes no sense, but we have a provider in the Netherlands that do or did have DVB-T transponders on their cable network). And as far I'm informed in the future we might expect more combined DVB-S2X/T2/C 'fixed' tuners. So for this 'near?' we need to adapt this anyway. Maybe the combined tuners are getting cheaper than the plug-in modules...


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Multituner: First commits - but they need a lot of improvements #206 littlesat

  • PLi® Core member
  • 56,262 posts

+691
Excellent

Posted 20 March 2019 - 09:50


The patch is wrong.

 

Again... the code was UNTESTED!!!

But the function is good. It returns the tuners enabled for an hotswitchable tuner (as the name clarifies). For a normal tuners this should be an empty string.

 

It only returns value's (one or more) to build up a list of tuners.... In case they are switchable...

I think it might be needed to add something in ScanSetup in case we have a non Hotswitchable tuner.


Edited by littlesat, 20 March 2019 - 09:53.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Multituner: First commits - but they need a lot of improvements #207 littlesat

  • PLi® Core member
  • 56,262 posts

+691
Excellent

Posted 20 March 2019 - 10:01

In indeed change getHotswitchableTunersEnabled to getTunerTypesEnabled...

 

and there the last row...

 

nim.configModeATSC.value and x.startswith("ATSC")] if self.hotswitchable else [self.getType()]

 

I'm think this is indeed better.... ;) Than we have also a function that gives a list of enabled types on a nim slot.


Edited by littlesat, 20 March 2019 - 10:09.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Multituner: First commits - but they need a lot of improvements #208 littlesat

  • PLi® Core member
  • 56,262 posts

+691
Excellent

Posted 20 March 2019 - 10:04

Nice also for..

And for now no change in ScanSetup.py

def isCompatible(self, what):
    return self.isSupported() and bool([x for x in self.getTunerTypesEnabled() if what in self.compatible[x]])

Edited by littlesat, 20 March 2019 - 10:06.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Multituner: First commits - but they need a lot of improvements #209 littlesat

  • PLi® Core member
  • 56,262 posts

+691
Excellent

Posted 20 March 2019 - 10:07

And a gain thanks for testing... as I'm afraid the earliest time I can play with a live E2 box is Friday late or Saturday...

Now maybe you understand why I did not push it (yet).


Edited by littlesat, 20 March 2019 - 10:10.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Multituner: First commits - but they need a lot of improvements #210 Huevos

  • PLi® Contributor
  • 4,244 posts

+158
Excellent

Posted 21 March 2019 - 16:23

In indeed change getHotswitchableTunersEnabled to getTunerTypesEnabled...

 

and there the last row...

nim.configModeATSC.value and x.startswith("ATSC")] if self.hotswitchable else [self.getType()]

I'm think this is indeed better.... ;) Than we have also a function that gives a list of enabled types on a nim slot.

Yes, this is what the scan code needs. But the arguments need to be fed to the function for it to work, or something like that.

 

When you have time to update the patch I'm happy testing for you on various hardware.



Re: Multituner: First commits - but they need a lot of improvements #211 littlesat

  • PLi® Core member
  • 56,262 posts

+691
Excellent

Posted 21 March 2019 - 16:27

Attached my latest diff... again fully untested... 0% was executed on a box...

I strive to finish it next Saturday... All help is welcome... Nice to do it as kind of 'team'.

 

B.t.w. I know this was a 'big' project...but unless I know it I underestimated it... At this moment I'm busy with it for 2 months...

 

For the multituner stuff which has not really added value, it 'gives' us back a 'bit' less spaghetti code.

Attached Files


Edited by littlesat, 21 March 2019 - 16:32.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Multituner: First commits - but they need a lot of improvements #212 Huevos

  • PLi® Contributor
  • 4,244 posts

+158
Excellent

Posted 21 March 2019 - 16:34

Thanks Littlesat,

+	def getTunerTypesEnabled(self):
+			return [x for x in slot.multi_type.values() if
+				nim.configModeDVBS.value and x.startswith("DVB-S") or
+				nim.configModeDVBC.value and x.startswith("DVB-C") or
+				nim.configModeDVBT.value and x.startswith("DVB-T") or
+				nim.configModeATSC.value and x.startswith("ATSC")] if self.hotswitchable else [self.getType()]
+

That can't work because "slot" and "nim" are not being sent in to the function.



Re: Multituner: First commits - but they need a lot of improvements #213 littlesat

  • PLi® Core member
  • 56,262 posts

+691
Excellent

Posted 21 March 2019 - 16:44

hihihihihi

 

Indeed...

 

slot should be self there... 

self.slot gives the nim number

def getTunerTypesEnabled(self):
  return [x for x in self.multi_type.values() if
    self.config.configModeDVBS.value and x.startswith("DVB-S") or
    self.config.configModeDVBC.value and x.startswith("DVB-C") or
    self.config.configModeDVBT.value and x.startswith("DVB-T") or
    self.config.configModeATSC.value and x.startswith("ATSC")] if self.hotswitchable else [self.getType()]

Edited by littlesat, 21 March 2019 - 16:47.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Multituner: First commits - but they need a lot of improvements #214 littlesat

  • PLi® Core member
  • 56,262 posts

+691
Excellent

Posted 21 March 2019 - 22:20

I just did Some tests here... but my diff need a lot of fixes ;)

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Multituner: First commits - but they need a lot of improvements #215 littlesat

  • PLi® Core member
  • 56,262 posts

+691
Excellent

Posted 22 March 2019 - 09:21

My latest diff...

 

And I see more cleanups... It is terrible... actually you 'just' need to forward slot... that can derive the slot_id (slot.slot) which is sometimes called fe_id and sometimes x...

 

But for now I focus on finally get it working...

 

In this diff I also tried to remove the two times configMode definition (in NimManager and SatSetup)... This is untested. I see it is needed for FBC tuners.

 

I suggest clean more things in NimManager is something for 7.2/8.0...

Attached Files


Edited by littlesat, 22 March 2019 - 09:24.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Multituner: First commits - but they need a lot of improvements #216 zeros

  • PLi® Contributor
  • 1,635 posts

+61
Good

Posted 22 March 2019 - 15:01

I prepared the Python files from that diff and will test in the weekend :)

Attached Files


DM920UHD DVB-S2X TRIPLE tuner + Triple M.S tuner DVB-S2X, DVB-T2/T, QboxHD, QboxHD Mini, Icecrypt T2300HD,
Qviart Lunix3 4K, Raspberry Pi 4 Model B 4GB & 8GB

Vertex 4K60 4:4:4 600MHz


Re: Multituner: First commits - but they need a lot of improvements #217 littlesat

  • PLi® Core member
  • 56,262 posts

+691
Excellent

Posted 22 March 2019 - 15:07

In between I'm also a bit further ;)

 

I saw Huevos reverted the whole thing on VIX's develop. It seems he has an issue where the LNBs disappear out of the configs... I did not experienced that yet and was not able to verify it. It happened (in Vix?) after several reboots/restarts. Someone else experienced it..? 

Attached Files

  • Attached File  diff.zip   54.73KB   4 downloads

Edited by littlesat, 22 March 2019 - 15:12.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Multituner: First commits - but they need a lot of improvements #218 zeros

  • PLi® Contributor
  • 1,635 posts

+61
Good

Posted 22 March 2019 - 15:37

I still have all so well and FBC/Unicable and similar staff I don't have, so problem with that may be?
Anyway, I will try it, I need just add the py files after backuping other files from the box and restart and I will test fullscan.

DM920UHD DVB-S2X TRIPLE tuner + Triple M.S tuner DVB-S2X, DVB-T2/T, QboxHD, QboxHD Mini, Icecrypt T2300HD,
Qviart Lunix3 4K, Raspberry Pi 4 Model B 4GB & 8GB

Vertex 4K60 4:4:4 600MHz


Re: Multituner: First commits - but they need a lot of improvements #219 littlesat

  • PLi® Core member
  • 56,262 posts

+691
Excellent

Posted 22 March 2019 - 15:58

Thanks... all pre-tests will save time tomorrow ;) Tomorrow I can test it on a box... now I'm just entering some code...


Edited by littlesat, 22 March 2019 - 15:58.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Multituner: First commits - but they need a lot of improvements #220 Abu Baniaz

  • PLi® Contributor
  • 2,435 posts

+62
Good

Posted 22 March 2019 - 19:53

What am I doing wrong? My branch is level with Develop, but patch file keeps getting rejected

https://github.com/A.../scanning_test2
 
diff a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py	(rejected hunks)
@@ -1537,30 +1547,36 @@ def InitNimManager(nimmgr, update_slots = []):
 		except Exception as e:
 			print "[InitNimManager] tunerTypeChanged error: ", e
 
-	def hotswitchableConfigChanged(nim, slot, fe_id, configElement=None):
-		if slot.isHotSwitchable():
-			tunerTypesEnabled = [x for x in slot.multi_type.values() if nim.configModeDVBS.value and x.startswith("DVB-S") or
-				nim.configModeDVBC.value and x.startswith("DVB-C") or
-				nim.configModeDVBT.value and x.startswith("DVB-T") or
-				nim.configModeATSC.value and x.startswith("ATSC")]
-			if tunerTypesEnabled:
-				print "[InitNimManager] enable hotswitchable tuner type(s) %s" %  ",".join(tunerTypesEnabled)
-				eDVBResourceManager.getInstance().setFrontendType(nimmgr.nim_slots[fe_id].frontend_id, ",".join(tunerTypesEnabled))
-				createConfig(nim, slot)
-			else:
-				print "[InitNimManager] disable hotswitchable tuner"
-				eDVBResourceManager.getInstance().setFrontendType(nimmgr.nim_slots[fe_id].frontend_id, "UNDEFINED")
-				nim.configMode.value = nim.configMode.default = "nothing"
+	def hotswitchableConfigChanged(nim, slot, slot_id, configElement=None):
+		tunersEnabled = slot.getTunerTypesEnabled()
+		if tunersEnabled:
+			tunersEnabled = ",".join(tunerTypesEnabled)
+			print "[InitNimManager] enable hotswitchable tuner type(s) %s" % tunersEnabled
+			eDVBResourceManager.getInstance().setFrontendType(nimmgr.nim_slots[slot_id].frontend_id, tunersEnabled)
+			if "DVB-S" not in tunersEnabled:
+				nim.configMode.value = nim.configMode.default = "enabled"
+				nim.configModeDVBS.value = False
+		else:
+			print "[InitNimManager] disable hotswitchable tuner"
+			eDVBResourceManager.getInstance().setFrontendType(nimmgr.nim_slots[slot_id].frontend_id, "UNDEFINED")
+			nim.configMode.choices.choices.update({ "nothing": _("disabled")})
+			nim.configMode.value = nim.configMode.default = "nothing"
 
 	def createConfig(nim, slot):
+		nim.configModeDVBS = ConfigYesNo()
+		nim.configModeDVBC = ConfigYesNo()
+		nim.configModeDVBT = ConfigYesNo()
+		nim.configModeATSC = ConfigYesNo()
 		slot_id = slot.slot
-		if slot.isCompatible("DVB-S"):
+		if slot.isHotSwitchable() and slot.canBeCompatible("DVB-S") or slot.isCompatible("DVB-S"):
 			config_mode_choices = {"nothing": _("Disabled"), "simple": _("Simple"), "advanced": _("Advanced")}
 			if len(nimmgr.getNimListOfType(slot.type, exception=slot_id)) > 0:
 				config_mode_choices["equal"] = _("Equal to")
 				config_mode_choices["satposdepends"] = _("Second cable of motorized LNB")
 			if len(nimmgr.canConnectTo(slot_id)) > 0:
 				config_mode_choices["loopthrough"] = _("Loop through from")
+			if slot.isFBCLink():
+				choices = { "nothing": _("FBC automatic"), "advanced": _("FBC SCR (Unicable/JESS)")}
 			nim.configMode = ConfigSelection(config_mode_choices, slot.isFBCLink() and "nothing" or "simple")
 			nim.configMode.slot_id = slot_id
 		elif slot.canBeCompatible("DVB-C") or slot.canBeCompatible("DVB-T") or slot.canBeCompatible("ATSC"):

Edited by Abu Baniaz, 22 March 2019 - 19:55.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users