Jump to content


Photo

Channel numbers among different bouquets


  • Please log in to reply
101 replies to this topic

Re: Channel numbers among different bouquets #61 macnuts

  • Senior Member
  • 420 posts

+14
Neutral

Posted 29 July 2012 - 16:30

The bug http://openpli.git.s...4f7d26f86eef225 was a stopper for me, I thought it was fault in my new code in RecordTimer.py. I was going to report it, but it is fixed already.

Anyway, below are changes to RecordTimer.py to allow zip timer to use history.
--- old/lib/python/RecordTimer.py
+++ new/lib/python/RecordTimer.py
@@ -19,6 +19,8 @@
from time import localtime, strftime, ctime, time
from bisect import insort
+import Screens.InfoBar
+
# ok, for descriptions etc we have:
# service reference  (to get the service name)
# name			   (title)
@@ -307,6 +309,17 @@
										Screens.Standby.inStandby.Power()
								else:
										self.log(11, "zapping")
+									   try:
+											   # Screens.InfoBar.instance  may not exist here yet
+											   InfoBarInstance = Screens.InfoBar.InfoBar.instance
+											   if InfoBarInstance is not None:
+													   CurServiceList = InfoBarInstance.servicelist
+													   if CurServiceList is not None:
+															   CurServiceList.setCurrentSelection(self.service_ref.ref)
+															   CurServiceList.zap()
+															   return True
+									   except:
+											   self.log(11, "zap error, revert to legacy")
										NavigationInstance.instance.playService(self.service_ref.ref)
								return True
						else:

Enclosed are the above diff file & my new RecordTimer.py.

Hope you like it and can add to the git.

Regards.

Attached File  RecordTimer_zap_timer_patch.zip   8.84KB   2 downloads

Re: Channel numbers among different bouquets #62 littlesat

  • PLi® Core member
  • 57,181 posts

+698
Excellent

Posted 29 July 2012 - 17:10

I see, this is required to add the service to this history when the RecordTimer does zap...
And why do you need the try: / except: as we should avoid it....?

Edited by littlesat, 29 July 2012 - 17:16.

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


Re: Channel numbers among different bouquets #63 littlesat

  • PLi® Core member
  • 57,181 posts

+698
Excellent

Posted 29 July 2012 - 17:23

This was indeed one of my toDo's... but could you try if the try/except is really required?

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


Re: Channel numbers among different bouquets #64 littlesat

  • PLi® Core member
  • 57,181 posts

+698
Excellent

Posted 29 July 2012 - 17:32

Isn't this an idea... (sorry I cannot test now...)

	  self.log(11, "zapping")
	 # Screens.InfoBar.instance  may not exist here yet
	 InfoBarInstance = Screens.InfoBar.InfoBar.instance
	 if InfoBarInstance is not None:
	  CurServiceList = InfoBarInstance.servicelist
	  if CurServiceList is not None:
	   CurServiceList.setCurrentSelection(self.service_ref.ref)
	   CurServiceList.zap()
	   return True
	 self.log(11, "zap error, revert to legacy")
	  NavigationInstance.instance.playService(self.service_ref.ref)

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


Re: Channel numbers among different bouquets #65 macnuts

  • Senior Member
  • 420 posts

+14
Neutral

Posted 29 July 2012 - 18:02

Yes, I think you can remove the the exception range safely. I added it to be on the safe side during debugging (I put some debbuging messages into except: handler, now removed). You can use the code from your last post.

Regards.

Re: Channel numbers among different bouquets #66 littlesat

  • PLi® Core member
  • 57,181 posts

+698
Excellent

Posted 29 July 2012 - 18:17

You really did check it.... It might be I commit it tomorrow... due to lack of time... ;) -or- please give me a new .diff file..... (I think you are able to create this easily now).

I added it to be on the safe side during debugging

Actually I try to avoid try/excepts and use them only when really required.... just to see the bugs and not ignore them. I understand that a risk is taken (see what I had to fix today)... I think it is better to add good normal checks....

Edited by littlesat, 29 July 2012 - 18:20.

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


Re: Channel numbers among different bouquets #67 macnuts

  • Senior Member
  • 420 posts

+14
Neutral

Posted 29 July 2012 - 19:12

It works well on my DM8000, with or without permanent timeshift plugin (that plugin replaces the standard InfoBar with its own implementation).

Below is the diff file. Note that this diff file was not created from git, I do not know how to do that yet. Instead, it was created within the box, I've just changed the paths in the top two lines. BTW, could it be rar-ed as well?

Regards.

Attached File  RecordTimer_zap_timer_patch_v0_2.zip   587bytes   3 downloads

Re: Channel numbers among different bouquets #68 littlesat

  • PLi® Core member
  • 57,181 posts

+698
Excellent

Posted 30 July 2012 - 17:56

I tried your patch but is does not work properly... When I go back with 0 then it zapped bat 1 service post the previous servers here...???

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


Re: Channel numbers among different bouquets #69 macnuts

  • Senior Member
  • 420 posts

+14
Neutral

Posted 31 July 2012 - 10:40

I've tested with the [0], [<<] and [>>] keys after the zap timer and it's worked for me.... :o :blink:

Re: Channel numbers among different bouquets #70 macnuts

  • Senior Member
  • 420 posts

+14
Neutral

Posted 1 August 2012 - 13:49

My box just got crazy...

Channel numbering is not working any more! I got #1 for alternative channels, no matter their place in bouquet..

Edited by macnuts, 1 August 2012 - 13:49.


Re: Channel numbers among different bouquets #71 littlesat

  • PLi® Core member
  • 57,181 posts

+698
Excellent

Posted 1 August 2012 - 21:22

But it was working???

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


Re: Channel numbers among different bouquets #72 macnuts

  • Senior Member
  • 420 posts

+14
Neutral

Posted 2 August 2012 - 09:44

At this point http://openpli.org/f...790#entry289790 it was working very well, I am sure of that. I noticed yesterday that it stopped working for alternative channels (alt channels are always reported as #1). In between I did not updated the system except the ChannelNumber.py & Navigation.py fixes issued by you (I did it by hand, modifying the .py files from enigma2-src package).

I tried to opkg update && opkg upgrade yesterday evening but now my box does not boot (see http://openpli.org/f...652#entry290652). I have to resolve this one before I can proceed with zapping.

Regards.

Edited by macnuts, 2 August 2012 - 09:44.


Re: Channel numbers among different bouquets #73 littlesat

  • PLi® Core member
  • 57,181 posts

+698
Excellent

Posted 2 August 2012 - 10:36

From that point nothing did really change in the code. Could it be that a settings editor or so breaks the alternatives and make them userbouquet?

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


Re: Channel numbers among different bouquets #74 macnuts

  • Senior Member
  • 420 posts

+14
Neutral

Posted 2 August 2012 - 16:22

I cannot see any braking change in the code either.

Indeed, I change ONE setting:
the alternative tuner prefernce, from DVB-T/DVB-S/DVB-C to DVB-S/DVB-T/DVB-C. Reverting back did not help. I am now flashing a new image, will see how it will behave.

Regards.

Re: Channel numbers among different bouquets #75 littlesat

  • PLi® Core member
  • 57,181 posts

+698
Excellent

Posted 2 August 2012 - 16:32

I'm thinking that the alternative list is recognised as userbouquet due to a settings editor which could clarify this behavior. The alternatives list is not anymore an alternative list, but userbouquet... That is what I think what could happen....

debug around here... I suggest this (----->) is somehow getting True....
  service = self.source.service
  if service and service.info():
   CurrentServiceList = InfoBar.instance.servicelist
   root = CurrentServiceList.servicelist.getRoot()
------>   if 'userbouquet.' in root.toCompareString():
	services = eServiceCenter.getInstance().list(root)
	channels = services and services.getContent("SN", True)
	channelIndex = CurrentServiceList.servicelist.l.lookupService(CurrentServiceList.servicelist.getCurrent())
	markersCounter = 0
	for i in range(channelIndex):

Edited by littlesat, 2 August 2012 - 16:36.

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


Re: Channel numbers among different bouquets #76 macnuts

  • Senior Member
  • 420 posts

+14
Neutral

Posted 2 August 2012 - 16:38

I will do debug later today....

BTW,
Can I debug anything to check why OpenWebIf does not play alternatives channels at all?

Edited by macnuts, 2 August 2012 - 16:38.


Re: Channel numbers among different bouquets #77 macnuts

  • Senior Member
  • 420 posts

+14
Neutral

Posted 2 August 2012 - 21:35

I'm thinking that the alternative list is recognised as userbouquet due to a settings editor which could clarify this behavior. The alternatives list is not anymore an alternative list, but userbouquet... That is what I think what could happen....


In the following code:
service = self.source.service
if service and service.info():
		CurrentServiceList = InfoBar.instance.servicelist
		root = CurrentServiceList.servicelist.getRoot()
		if 'userbouquet.' in root.toCompareString():
				services = eServiceCenter.getInstance().list(root)
				channels = services and services.getContent("SN", True)
				channelIndex = CurrentServiceList.servicelist.l.lookupService(CurrentServiceList.servicelist.getCurrent())
				markersCounter = 0
				for i in range(channelIndex):
						if channels[i][0].startswith("1:64:"):
								markersCounter = markersCounter + 1
				self.text = str(CurrentServiceList.getBouquetNumOffset(root)+channelIndex+1-markersCounter)
.l.lookupService cannot find proper alternative entry.

Top 3 channels elements (first elements of the tuples, to be exact):
1:134:1:0:0:0:0:0:0:0:FROM BOUQUET "alternatives.tvp1_hd.tv" ORDER BY bouquet
1:134:1:0:0:0:0:0:0:0:FROM BOUQUET "alternatives.tvp2_hd.tv" ORDER BY bouquet
1:0:16:9:1:2268:EEEE0000:0:0:0:

...and there are more, with alt channels on different positions...

Standard channel zapping (#3, ok):
CurrentServiceList.servicelist.getCurrent:
1:0:16:9:1:2268:EEEE0000:0:0:0:

When trying zap to #2:
CurrentServiceList.servicelist.getCurrent:
1:0:1:0:0:0:0:0:0:0:FROM BOUQUET "alternatives.tvp1_hd.tv" ORDER BY bouquet

Note, that CurrentServiceList.servicelist.getCurrent ALWAYS is
1:0:1:0:0:0:0:0:0:0:FROM BOUQUET "alternatives.tvp1_hd.tv" ORDER BY bouquet
no matter which alt channel I am zipping to.

Regards.

Re: Channel numbers among different bouquets #78 littlesat

  • PLi® Core member
  • 57,181 posts

+698
Excellent

Posted 2 August 2012 - 21:55

The lookup dos not find the service when it has alternatives and then always 0 is returned in the lockup function...

In addition I discovered while zapping to a list with alternatives you also go to the first service when you zap forward as soon as you zap and with.... wierd behavior with alternatives.... something that is not good implemented at all in E2...

I created this part of code that fix it... but I do not like to commit this fix as alternatives are in fact not working as it should be at all... and I do not like the fallback to the service name in case of alternatives...

def changed(self, what):
  global text
  if what[0] != self.CHANGED_SPECIFIC:
   return
  if what[1] != iPlayableService.evStart:
   return
  if not self.firstChannelNumberClass:
   self.text = text
   return
  self.text = "---"
  service = self.source.service
  info = service and service.info()
  if info:
   CurrentServiceList = InfoBar.instance.servicelist
   root = CurrentServiceList.servicelist.getRoot()
   if 'userbouquet.' in root.toCompareString():
	services = eServiceCenter.getInstance().list(root)
	channels = services and services.getContent("SN", True)
	currentServiceRef = info.getInfoString(iServiceInformation.sServiceref)
	channelIndex = 0
	for channel in channels:
	 if channel[0] == currentServiceRef or (channel[0].startswith("1:134:") and info.getName().replace('\xc2\x86', '').replace('\xc2\x87', '') in channel[1]):
	  break;
	 if not channel[0].startswith("1:64:"):
	  channelIndex = channelIndex + 1
	self.text = str(CurrentServiceList.getBouquetNumOffset(root)+channelIndex+1)
  text = self.text

Probably we have to find a better way to get the number :(

Edited by littlesat, 2 August 2012 - 21:58.

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


Re: Channel numbers among different bouquets #79 macnuts

  • Senior Member
  • 420 posts

+14
Neutral

Posted 2 August 2012 - 22:59

I found a some kind of solution.

There is a some code in Navigation::playService which changes the input group service (ref parameter) into the group member to be played (playref variable). When the input ref parameter is not a group, then the playref is set to ref directly. It is all OK, but then the playref is used to set current element in the service list, but the service list contains the group reference, not the group member. So one change to the body of the playService and alternative channels are numbered correctly again.

if self.pnav:
		self.pnav.stopService()
		self.currentlyPlayingServiceReference = playref
		InfoBarInstance = InfoBar.instance
		if InfoBarInstance is not None:
-			    InfoBarInstance.servicelist.servicelist.setCurrent(playref)
+			    InfoBarInstance.servicelist.servicelist.setCurrent(ref)
		if self.pnav.playService(playref):
				 print "Failed to start", playref
				 self.currentlyPlayingServiceReference = None
		return 0


Regards.

Re: Channel numbers among different bouquets #80 littlesat

  • PLi® Core member
  • 57,181 posts

+698
Excellent

Posted 2 August 2012 - 23:20

Thanks... crasy this was exactly were we were looking for,,,, And indeed introcuded by me.... :)

Edited by littlesat, 2 August 2012 - 23:25.

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



2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users