Feature #343
Be able to prioritize tuners that open the same channel
0%
Description
I record a channel called rte. I can watch it through my dvb-s tuner or dvb-t tuner. I want tvheadend to try and use the dvb-s tuner first and only use the dvb-t tuner if all the dvb-s tuners are in use already. Unfortunately the dvb-t tuner is always the one that is used first in my case.
Files
History
Updated by Martin Mrvka over 13 years ago
If more services per channel are configured (usually on different tuners), there is already some priority logic applied, in which order the services are tried.
The method service_get_prio (https://github.com/andoma/tvheadend/blob/master/src/service.c#L241) could be changed to add some configurable weight per adapter.
I guess there needs to be some thinking about when trying to steal a transponder. For the moment, the simple solution would be to apply this adapter priority only on idle adapters.
I'm gonna try this within the next days.
Updated by Martin Mrvka over 13 years ago
Well, an initial version for proof of concept is ready, working but not really final.
The issue I'm running into is that when deciding the order of the services (and therefore the tuners) which are tested, the quality of the services is the first criteria.
For now, I'm disabling quality mechanism if an extra weight is configured on the adapters, since may mean that the user doesn't want to have automatic behavior but give the order manually.
Updated by Andy Brown over 13 years ago
Sorry to drag an older feature request up, but I've now hit the same problem.
I too have DVB-T (Terrestrial) and DVB-S (Satellite), and both carry the same channels. However the input from DVB-T is lower quality (not sure if this is the decoder I have, bad aerial, etc), BUT the Multiplexes always show 100% quality. The DVB-S is currently also showing quality at 100%, but it seems the DVB-T card is being preferred over the DVB-S cards. I think your weight technique may well help this out, but if not can you advise on best options here?
I'm currently using the git head master, so I believe I'm on 2.12.99 but happy to test, etc, if you can advise?
Updated by Martin Mrvka over 13 years ago
- File extrapriority.patch extrapriority.patch added
Since working with my git repo is currently not possible, I've create the attached patch which compiles against git master (https://github.com/andoma/tvheadend/commit/9d775da00e1f86a4159f242301816b61e6ea7f81).
By applying this on the root level of your git clone with
patch -p1 < extrapriority.patchit adds on the "Adapter configuration" panel inside the "Configuration"->"TV Adapters" section an additional parameter, which allows you to raise the priority per adapter.
Be aware, due to the current priority implementation, adapters with the lowest priority come first.
This is a very quick implementation, but I'm happy about feedback.
Updated by Andy Brown over 13 years ago
Thanks Martin. I've patched and got that running now.
Just to note what I've done, I've added 50 to the DVB-T card and left the rest with a 0 "Extra Priority".
Will do some further testing the next couple of days. Thanks for the patch!
Updated by Spencer Roff over 12 years ago
Applied the patch above last night and everything works perfectly, assigned the DVB-S a weight of 50 and the DVB-T a weight of 0 and tested the channels that are available in HD via the DVB-T and SD via the DVB-S and the DVB-T HD channel was selected. Exactly what i wanted.
Updated by Andy Brown over 12 years ago
Can this be merged into the current 2.13 git? This is working fine here and have tested various functions and all appears fine.
Updated by Martin Mrvka over 12 years ago
I'll update my repo and place a pull request within the next couple of hours.
Updated by Martin Mrvka over 12 years ago
Martin Mrvka wrote:
I'll update my repo and place a pull request within the next couple of hours.
Pull request added: https://github.com/andoma/tvheadend/pull/94
Updated by Bianco Veigel over 12 years ago
After updating to the latest revision (4ef72fb276), I get a SEGFAULT when tuning to a channel, which contains two DVB-S and an IPTV configuration.
Jun 22 11:07:08 localhost tvheadend[12235]: CRASH: Signal: 11 in PRG: /usr/local/bin/tvheadend (2.99.44.g4ef72) [a1249437a3332ce32b816b661495fd11be08bbf6] CWD: / Jun 22 11:07:08 localhost tvheadend[12235]: CRASH: Fault address 0x118 (Address not mapped) Jun 22 11:07:08 localhost tvheadend[12235]: CRASH: Loaded libraries: /lib/x86_64-linux-gnu/librt.so.1 /lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libavahi-common.so.3 /usr/lib/x86_64-linux-gnu/libavahi-client.so.3 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /lib/x86_64-linux-gnu/libpthread.so.0 /lib/x86_64-linux-gnu/libc.so.6 /lib64/ld-linux-x86-64.so.2 /lib/x86_64-linux-gnu/libdbus-1.so.3 /lib/x86_64-linux-gnu/libz.so.1 Jun 22 11:07:08 localhost tvheadend[12235]: CRASH: Register dump [23]: 0000000000000000 00000000020f4f10 0000000000000001 0000000000000000 00007f09c97f9110 0000000000000001 00007f09c97f9070 0000000000000000 0000000000000007 0000000000455c95 00007f09c97f90f0 0000000001d1d4f0 000000000044f3c0 0000000000000000 00007f09c97f9110 00007f09c97f9060 0000000000412a5b 0000000000010202 0000000000000033 0000000000000004 000000000000000e fffffffe7ffbfa17 0000000000000118 Jun 22 11:07:08 localhost tvheadend[12235]: CRASH: STACKTRACE Jun 22 11:07:08 localhost tvheadend[12235]: CRASH: /usr/src/tvheadend/src/trap.c:139 0x420b9b Jun 22 11:07:08 localhost tvheadend[12235]: CRASH: ??:0 0x7f09db186cb0 Jun 22 11:07:08 localhost tvheadend[12235]: CRASH: /usr/src/tvheadend/src/service.c:346 0x412a5b Jun 22 11:07:08 localhost tvheadend[12235]: CRASH: /usr/src/tvheadend/src/subscriptions.c:173 0x411b98 Jun 22 11:07:08 localhost tvheadend[12235]: CRASH: /usr/src/tvheadend/src/subscriptions.c:326 0x411d87 Jun 22 11:07:08 localhost tvheadend[12235]: CRASH: /usr/src/tvheadend/src/webui/webui.c:411 0x434574 Jun 22 11:07:08 localhost tvheadend[12235]: CRASH: /usr/src/tvheadend/src/http.c:344 0x407e7d Jun 22 11:07:09 localhost tvheadend[12235]: CRASH: /usr/src/tvheadend/src/http.c:375 0x408243 Jun 22 11:07:09 localhost tvheadend[12235]: CRASH: /usr/src/tvheadend/src/http.c:455 0x4083e2 Jun 22 11:07:09 localhost tvheadend[12235]: CRASH: /usr/src/tvheadend/src/http.c:749 0x4087c0 Jun 22 11:07:09 localhost tvheadend[12235]: CRASH: /usr/src/tvheadend/src/tcp.c:397 0x406c6d Jun 22 11:07:09 localhost tvheadend[12235]: CRASH: ??:0 0x7f09db17ee9a Jun 22 11:07:09 localhost tvheadend[12235]: CRASH: clone+0x6d (/lib/x86_64-linux-gnu/libc.so.6) Jun 22 11:07:09 localhost kernel: [2231907.860406] tvheadend[13904]: segfault at 118 ip 0000000000412a5b sp 00007f09c97f9060 error 4 in tvheadend[400000+90000]
Updated by Martin Mrvka over 12 years ago
Thanks for the bugreport. I'll look at it asap! I may have put DVB code where it shouldn't be....
Updated by Martin Mrvka over 12 years ago
I've replaced DVB dependend code, however I didn't get any working IPTV stream (tried hard with mumudvb) in order to test.
@Bianco
Would you mind to checkout my branch https://github.com/mmrvka/tvheadend/tree/dvb_adapter_priority and try if it works for you?
Updated by Bianco Veigel over 12 years ago
I will try this tomorrow. Thanks for your fast response.
Updated by Martin Mrvka over 12 years ago
Finally I got IPTV working and was able to test. BTW it wasn't the setup of mumudvb which caused problems - it was simply that I didn't knew how to add a multicast address in tvheadend (forgot the @ infront of @239.255.0.0).
My test with two DVB adapters and one IPTV stream associated to the same channel have been successful.
Pull request opened: https://github.com/andoma/tvheadend/pull/102
Updated by Bianco Veigel over 12 years ago
Finally I've been able to test yout patch, and it works as expected. Thanks again.
Updated by Adam Sutton over 12 years ago
- Status changed from New to Fixed
This basically exists, I have some thoughts on more general prioritisation changes. But they're for later.