Jump to content


Photo

Preferred tuner for recording


  • Please log in to reply
61 replies to this topic

Re: Preferred tuner for recording #21 Huevos

  • PLi® Contributor
  • 4,247 posts

+158
Excellent

Posted 18 February 2014 - 02:31

What I'm really getting at is just because a tuner has the least amount of options, this doesn't always make it the best option, and sometimes only the user can know what the best option is.



Re: Preferred tuner for recording #22 Dimitrij

  • PLi® Core member
  • 10,021 posts

+338
Excellent

Posted 18 February 2014 - 06:33

Almost done.
I added this option("Preferred tuner for recording") to the plugin
RecInfobar.


GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: Preferred tuner for recording #23 littlesat

  • PLi® Core member
  • 56,274 posts

+691
Excellent

Posted 18 February 2014 - 08:07

So soon we see a patch?

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


Re: Preferred tuner for recording #24 Huevos

  • PLi® Contributor
  • 4,247 posts

+158
Excellent

Posted 18 February 2014 - 09:57

Thanks Dima, looking forward to testing.



Re: Preferred tuner for recording #25 Dimitrij

  • PLi® Core member
  • 10,021 posts

+338
Excellent

Posted 19 February 2014 - 22:42

Thanks Dima, looking forward to testing.

http://openpli.org/f...ndpost&p=407268

Please test the new option.


GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: Preferred tuner for recording #26 littlesat

  • PLi® Core member
  • 56,274 posts

+691
Excellent

Posted 19 February 2014 - 23:51

In a plugin for rec infobar... Why not try to make the change in e2 itself?

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


Re: Preferred tuner for recording #27 Dimitrij

  • PLi® Core member
  • 10,021 posts

+338
Excellent

Posted 20 February 2014 - 06:29

In a plugin for rec infobar... Why not try to make the change in e2 itself?

Ок.


GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: Preferred tuner for recording #28 Dimitrij

  • PLi® Core member
  • 10,021 posts

+338
Excellent

Posted 22 February 2014 - 16:25

In a plugin for rec infobar... Why not try to make the change in e2 itself?

Done.

--- a/RecordTimer.py
+++ b/RecordTimer.py
@@ -1,6 +1,6 @@
 import os
 from enigma import eEPGCache, getBestPlayableServiceReference, \
-	eServiceReference, iRecordableService, quitMainloop, eActionMap
+	eServiceReference, iRecordableService, quitMainloop, eActionMap, setPreferredTuner
 
 from Components.config import config
 from Components.UsageConfig import defaultMoviePath
@@ -167,7 +167,8 @@
 		self.tags = tags or []
 		self.descramble = descramble
 		self.record_ecm = record_ecm
-
+		self.needChangePriorityFrontend = config.usage.recording_frontend_priority.value != "-2" and config.usage.recording_frontend_priority.value != config.usage.frontend_priority.value
+		self.change_frontend = False
 		self.log_entries = []
 		self.resetState()
 
@@ -227,11 +228,12 @@
 				if not rec_ref:
 					self.log(1, "'get best playable service for group... record' failed")
 					return False
-				
+			self.setRecordingPreferredTuner()
 			self.record_service = rec_ref and NavigationInstance.instance.recordService(rec_ref)
 
 			if not self.record_service:
 				self.log(1, "'record service' failed")
+				self.setRecordingPreferredTuner(setdefault=True)
 				return False
 
 			if self.repeated:
@@ -264,6 +266,7 @@
 
 				NavigationInstance.instance.stopRecordService(self.record_service)
 				self.record_service = None
+				self.setRecordingPreferredTuner(setdefault=True)
 				return False
 			return True
 
@@ -296,6 +299,7 @@
 					cur_zap_ref = NavigationInstance.instance.getCurrentlyPlayingServiceReference()
 					if cur_zap_ref and not cur_zap_ref.getPath():# we do not zap away if it is no live service
 						Notifications.AddNotification(MessageBox, _("In order to record a timer, the TV was switched to the recording service!\n"), type=MessageBox.TYPE_INFO, timeout=20)
+						self.setRecordingPreferredTuner()
 						self.failureCB(True)
 						self.log(5, "zap to recording service")
 
@@ -325,6 +329,7 @@
 				cur_ref = NavigationInstance.instance.getCurrentlyPlayingServiceReference()
 				if cur_ref and not cur_ref.getPath():
 					if Screens.Standby.inStandby:
+						self.setRecordingPreferredTuner()
 						self.failureCB(True)
 					elif not config.recording.asktozap.value:
 						self.log(8, "asking user to zap away")
@@ -332,6 +337,7 @@
 					else: # zap without asking
 						self.log(9, "zap without asking")
 						Notifications.AddNotification(MessageBox, _("In order to record a timer, the TV was switched to the recording service!\n"), type=MessageBox.TYPE_INFO, timeout=20)
+						self.setRecordingPreferredTuner()
 						self.failureCB(True)
 				elif cur_ref:
 					self.log(8, "currently running service is not a live service.. so stop it makes no sense")
@@ -369,7 +375,7 @@
 					else:
 						Notifications.AddNotification(Screens.Standby.Standby, StandbyCounterIncrease=False)
 				record_res = self.record_service.start()
-				
+				self.setRecordingPreferredTuner(setdefault=True)
 				if record_res:
 					self.log(13, "start record returned %d" % record_res)
 					self.do_backoff()
@@ -427,6 +433,18 @@
 			return False
 		self.end = new_end
 		return True
+
+	def setRecordingPreferredTuner(self, setdefault=False):
+		if self.needChangePriorityFrontend:
+			elem = None
+			if not self.change_frontend and not setdefault:
+				elem = config.usage.recording_frontend_priority.value
+				self.change_frontend = True
+			elif self.change_frontend and setdefault:
+				elem = config.usage.frontend_priority.value
+				self.change_frontend = False
+			if elem is not None:
+				setPreferredTuner(int(elem))
 
 	def sendStandbyNotification(self, answer):
 		RecordTimerEntry.keypress()
--- a/lib/python/Components/UsageConfig.py
+++ b/lib/python/Components/UsageConfig.py
@@ -172,6 +172,8 @@
 	for x in nimmanager.nim_slots:
 		nims.append((str(x.slot), x.getSlotName()))
 	config.usage.frontend_priority = ConfigSelection(default = "-1", choices = nims)
+	nims.append(("-2", _("Disabled")))
+	config.usage.recording_frontend_priority = ConfigSelection(default = "-2", choices = nims)
 	config.misc.disable_background_scan = ConfigYesNo(default = False)
 
 	config.usage.show_event_progress_in_servicelist = ConfigSelection(default = 'barright', choices = [
--- a/data/setup.xml
+++ b/data/setup.xml
@@ -103,6 +103,7 @@
 		<item level="1" text="EPG language selection 2" description="Configure the secondary EPG language.">config.autolanguage.audio_epglanguage_alternative</item>
 	</setup>
 	<setup key="recording" title="Record">
+		<item level="2" text="Preferred tuner for recordings" description="Configure which tuner for recordings will be preferred, when more than one tuner is available.">config.usage.recording_frontend_priority</item>
 		<item level="1" text="Recordings always have priority" description="When enabled, a recording is allowed to interrupt live tv, when there are no free tuners.">config.recording.asktozap</item>
 		<item level="0" text="Margin before recording (minutes)" description="When nonzero, a recording will start earlier than the starting time indicated by the EPG.">config.recording.margin_before</item>
 		<item level="0" text="Margin after recording (minutes)" description="When nonzero, a recording will stop later than the ending time indicated by the EPG.">config.recording.margin_after</item>


GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: Preferred tuner for recording #29 Huevos

  • PLi® Contributor
  • 4,247 posts

+158
Excellent

Posted 23 February 2014 - 00:00

Thanks Dima. Working fine for me so far.



Re: Preferred tuner for recording #30 Dimitrij

  • PLi® Core member
  • 10,021 posts

+338
Excellent

Posted 23 February 2014 - 11:29

Thanks Dima. Working fine for me so far.

Now a request for you :) .
Please make a version of the plugin Blindscan for openPli.

https://github.com/o...aster/Blindscan


GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: Preferred tuner for recording #31 Huevos

  • PLi® Contributor
  • 4,247 posts

+158
Excellent

Posted 23 February 2014 - 13:09

Thanks Dima. Working fine for me so far.

Now a request for you :) .
Please make a version of the plugin Blindscan for openPli.

https://github.com/o...aster/Blindscan

I posted it here a long time ago and it was added to the third party feeds. Was fully working at the time and someone tested it on the ET9x00. Not sure what happened next or if it is still there.


Edited by Huevos, 23 February 2014 - 13:10.


Re: Preferred tuner for recording #32 Dimitrij

  • PLi® Core member
  • 10,021 posts

+338
Excellent

Posted 23 February 2014 - 13:57

 

Thanks Dima. Working fine for me so far.

Now a request for you :) .
Please make a version of the plugin Blindscan for openPli.

https://github.com/o...aster/Blindscan

I posted it here a long time ago and it was added to the third party feeds. Was fully working at the time and someone tested it on the ET9x00. Not sure what happened next or if it is still there.

Plugin is no longer on the feed.
I can adapt it for openPli, if you do not mind.


Edited by Dima73, 23 February 2014 - 13:57.

GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: Preferred tuner for recording #33 Robinson

  • Senior Member
  • 2,616 posts

+30
Good

Posted 23 February 2014 - 16:27

Huevos, Dima73, if you manage to improve Blindscan, I would appreciate some information in a more suited thread: http://openpli.org/f...ndpost&p=408070

Thanks.


ET9000, OpenPLi 4.0, 13E, 19E

HD51, OpenPLi 6.2, 75E - 30W


Re: Preferred tuner for recording #34 Huevos

  • PLi® Contributor
  • 4,247 posts

+158
Excellent

Posted 23 February 2014 - 18:31

 

 

Thanks Dima. Working fine for me so far.

Now a request for you :) .
Please make a version of the plugin Blindscan for openPli.

https://github.com/o...aster/Blindscan

I posted it here a long time ago and it was added to the third party feeds. Was fully working at the time and someone tested it on the ET9x00. Not sure what happened next or if it is still there.

Plugin is no longer on the feed.
I can adapt it for openPli, if you do not mind.

Plugin is open source, so I can't see why anyone would mind as long as it is obvious it came from OE-A.



Re: Preferred tuner for recording #35 Dimitrij

  • PLi® Core member
  • 10,021 posts

+338
Excellent

Posted 23 February 2014 - 18:34

Huevos

Thank you.
Later, I'll send you the change log.


GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: Preferred tuner for recording #36 Huevos

  • PLi® Contributor
  • 4,247 posts

+158
Excellent

Posted 2 March 2014 - 14:51

Dima, in the preferred tuner setup what is the difference between "auto" and "disabled"?



Re: Preferred tuner for recording #37 Dimitrij

  • PLi® Core member
  • 10,021 posts

+338
Excellent

Posted 2 March 2014 - 15:36

Dima, in the preferred tuner setup what is the difference between "auto" and "disabled"?

Options "Preferred tuner for recordings":

"disabled" same as "Preferred tuner" option.

If set to 'auto' the system will give priority to the tuner having the lowest number of channels/satellites.


GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: Preferred tuner for recording #38 Huevos

  • PLi® Contributor
  • 4,247 posts

+158
Excellent

Posted 2 March 2014 - 22:39

Ok, so what about the difference between disabled and auto in customise?



Re: Preferred tuner for recording #39 Dimitrij

  • PLi® Core member
  • 10,021 posts

+338
Excellent

Posted 3 March 2014 - 06:37

Yep,understood.
This is a bug in my code :( .
Patch:

UsageConfig.py

	nims = [("-1", _("auto"))]
	for x in nimmanager.nim_slots:
		nims.append((str(x.slot), x.getSlotName()))
	config.usage.frontend_priority = ConfigSelection(default = "-1", choices = nims)
+	rec_nims = nims
-	nims.append(("-2", _("Disabled")))
+	rec_nims.append(("-2", _("Disabled")))
-	config.usage.recording_frontend_priority = ConfigSelection(default = "-2", choices = nims)
+	config.usage.recording_frontend_priority = ConfigSelection(default = "-2", choices = rec_nims)
	config.misc.disable_background_scan = ConfigYesNo(default = False)

GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: Preferred tuner for recording #40 macnuts

  • Senior Member
  • 420 posts

+14
Neutral

Posted 3 March 2014 - 08:12

As I understand it, enigma2 behaved like "auto" before your patch. I think the default should be "auto" then.

 

Regards.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users