Bug #3948

Service priority does not work

Added by Luis Alves about 1 year ago. Updated about 1 year ago.

Status:FixedStart date:2016-08-19
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:-
Target version:-
Found in version:latest git Affected Versions:

Description

Test environment:

3 different services assigned to same channel.
The 3 services have different priorities (set between -10 to 10)

When HTTP streaming the channel, the priority seems to be ignored - the highest priority service is NOT selected.

Am I doing something wrong?

Associated revisions

Revision c53ee12b
Added by Jaroslav Kysela about 1 year ago

service: handle tuner/service priority settings also for free input instances, fixes #3948

History

#1 Updated by Jaroslav Kysela about 1 year ago

This value is added to the tuner (input) priority value. So if you have set the tuner priorities, it will influence the service selection, too.

Anyway, turn on debugging and you should see lines like:

:service: 7: FANDA HD si 0x61000002fa40 SAT>IP DVB-S Tuner #3 (192.168.100.237) weight 0 prio 11 error 0
:service: 6: FANDA HD si 0x61000002fb40 SAT>IP DVB-S Tuner #2 (192.168.100.237) weight 0 prio 11 error 0
:service: 5: FANDA HD si 0x61000002fc40 SAT>IP DVB-S Tuner #1 (192.168.100.237) weight 0 prio 16 error 0
:service: 8: FANDA HD si 0x61000002f940 SAT>IP DVB-S Tuner #4 (192.168.100.237) weight 0 prio 21 error 0

The last instance is used when others are idle.

#2 Updated by Jaroslav Kysela about 1 year ago

  • Priority changed from High to Normal

#3 Updated by Luis Alves about 1 year ago

What subsystems do I have to enable debugging for?
Can you paste the cmd line switches?

Thanks!

#4 Updated by Luis Alves about 1 year ago

Got it to work. This is the output:


2016-08-20 20:00:41.996 [ DEBUG]:service: 31: SIC Radical si 0x7feac43fe020 SAT>IP DVB-C Tuner #6 (192.168.0.190) weight -1 prio -1 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 32: SIC Radical si 0x7feac43fe0e0 SAT>IP DVB-C Tuner #7 (192.168.0.190) weight 101 prio 5 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 33: SIC Radical si 0x7feac430e320 SAT>IP DVB-C Tuner #8 (192.168.0.190) weight 102 prio 5 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 30: SIC Radical si 0x7feac401c260 SAT>IP DVB-C Tuner #5 (192.168.0.190) weight 104 prio 5 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 29: SIC Radical si 0x7feac401c1a0 SAT>IP DVB-C Tuner #4 (192.168.0.190) weight 105 prio 5 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 28: SIC Radical si 0x7feac4380c10 SAT>IP DVB-C Tuner #3 (192.168.0.190) weight 105 prio 5 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 26: SIC Radical si 0x7feac4492480 SAT>IP DVB-C Tuner #1 (192.168.0.190) weight 105 prio 5 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 27: SIC Radical si 0x7feac46136c0 SAT>IP DVB-C Tuner #2 (192.168.0.190) weight 106 prio 5 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 17: SIC Radical si 0x7feac40253e0 Silicon Labs Si2168 : DVB-C #0 weight 101 prio 6 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 11: SIC Radical si 0x7feac406b430 Silicon Labs Si2168 : DVB-C #3 weight 102 prio 6 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 15: SIC Radical si 0x7feac4248e20 Silicon Labs Si2168 : DVB-C #1 weight 103 prio 6 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 9: SIC Radical si 0x7feac425fe50 Silicon Labs Si2168 : DVB-C #4 weight 104 prio 6 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 7: SIC Radical si 0x7feac46ef450 Silicon Labs Si2168 : DVB-C #5 weight 104 prio 6 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 13: SIC Radical si 0x7feac46b4ef0 Silicon Labs Si2168 : DVB-C #2 weight 105 prio 6 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 5: SIC Radical si 0x7feac43808f0 Silicon Labs Si2168 : DVB-C #6 weight 105 prio 6 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 3: SIC Radical si 0x7feac40273e0 Silicon Labs Si2168 : DVB-C #7 weight 105 prio 6 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 20: SIC Radical si 0x7feac4122870 STV0910 : DVB-S #1 weight -1 prio 10 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 20: SIC Radical si 0x7feac41d3600 STV0910 : DVB-S #1 weight -1 prio 10 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 25: SIC Radical si 0x7feac463d430 SAT>IP DVB-S Tuner #4 (213.58.164.212) weight 0 prio 21 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 25: SIC Radical si 0x7feac448e940 SAT>IP DVB-S Tuner #4 (213.58.164.212) weight 0 prio 21 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 24: SIC Radical si 0x7feac40163e0 SAT>IP DVB-S Tuner #3 (213.58.164.212) weight 101 prio 21 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 24: SIC Radical si 0x7feac40251f0 SAT>IP DVB-S Tuner #3 (213.58.164.212) weight 101 prio 21 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 22: SIC Radical si 0x7feac46f9090 SAT>IP DVB-S Tuner #1 (213.58.164.212) weight 104 prio 21 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 22: SIC Radical si 0x7feac455e370 SAT>IP DVB-S Tuner #1 (213.58.164.212) weight 104 prio 21 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 23: SIC Radical si 0x7feac43ff400 SAT>IP DVB-S Tuner #2 (213.58.164.212) weight 105 prio 21 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 23: SIC Radical si 0x7feac46b5470 SAT>IP DVB-S Tuner #2 (213.58.164.212) weight 105 prio 21 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 21: SIC Radical si 0x7feac43ea8b0 STV0910 : DVB-S #0 weight 106 prio 21 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 21: SIC Radical si 0x7feac424d390 STV0910 : DVB-S #0 weight 106 prio 21 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 19: SIC Radical si 0x7feac45b7e90 STV0910 : DVB-S #2 weight 108 prio 21 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 18: SIC Radical si 0x7feac4331e50 STV0910 : DVB-S #3 weight 108 prio 21 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 19: SIC Radical si 0x7feac4305ba0 STV0910 : DVB-S #2 weight 108 prio 21 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 18: SIC Radical si 0x7feac44a5750 STV0910 : DVB-S #3 weight 108 prio 21 error 0
2016-08-20 20:00:41.996 [ TRACE]:service: will start new instance 31
2016-08-20 20:00:41.996 [ TRACE]:service: starting nos-cabo/626MHz/SIC Radical
2016-08-20 20:00:41.997 [ INFO]:subscription: 0147: "HTTP" subscribing on channel "SIC Radical", weight: 100, adapter: "SAT>IP DVB-C Tuner #6 (192.168.0.190)", network: "nos-cabo", mux: "626MHz", provider: "SIC R", service: "SIC Radical", profile="pass", hostname="213.58.180.187", client="Xtream-Codes IPTV Panel Pro"
2016-08-20 20:00:42.008 [ DEBUG]:service: nos-cabo/626MHz/SIC Radical: Status changed to [Hardware input]
2016-08-20 20:00:42.008 [ DEBUG]:service: nos-cabo/626MHz/SIC Radical: Status changed to [Hardware input] [Input on service]
2016-08-20 20:00:42.008 [ DEBUG]:service: nos-cabo/626MHz/SIC Radical: Status changed to [Hardware input] [Input on service] [Demuxed packets]
2016-08-20 20:00:42.008 [ DEBUG]:service: nos-cabo/626MHz/SIC Radical: Status changed to [Hardware input] [Input on service] [Demuxed packets] [Reassembled packets]
2016-08-20 20:00:42.050 [ DEBUG]:service: nos-cabo/626MHz/SIC Radical: Status changed to [Hardware input] [Input on service] [Demuxed packets] [Reassembled packets] [No access]
2016-08-20 20:00:42.957 [ DEBUG]:service: 32: 386MHz in nos-cabo si 0x7feac4273100 SAT>IP DVB-C Tuner #7 (192.168.0.190) weight 101 prio 15 error 0
2016-08-20 20:00:42.957 [ DEBUG]:service: 31: 386MHz in nos-cabo si 0x7feac4273040 SAT>IP DVB-C Tuner #6 (192.168.0.190) weight 101 prio 15 error 0
2016-08-20 20:00:42.957 [ DEBUG]:service: 33: 386MHz in nos-cabo si 0x7feac42731c0 SAT>IP DVB-C Tuner #8 (192.168.0.190) weight 102 prio 15 error 0
2016-08-20 20:00:42.957 [ DEBUG]:service: 30: 386MHz in nos-cabo si 0x7feac46f8670 SAT>IP DVB-C Tuner #5 (192.168.0.190) weight 104 prio 15 error 0
2016-08-20 20:00:42.957 [ DEBUG]:service: 29: 386MHz in nos-cabo si 0x7feac41f07f0 SAT>IP DVB-C Tuner #4 (192.168.0.190) weight 105 prio 15 error 0
2016-08-20 20:00:42.957 [ DEBUG]:service: 28: 386MHz in nos-cabo si 0x7feac44678a0 SAT>IP DVB-C Tuner #3 (192.168.0.190) weight 105 prio 15 error 0
2016-08-20 20:00:42.957 [ DEBUG]:service: 26: 386MHz in nos-cabo si 0x7feac43aa0f0 SAT>IP DVB-C Tuner #1 (192.168.0.190) weight 105 prio 15 error 0
2016-08-20 20:00:42.957 [ DEBUG]:service: 27: 386MHz in nos-cabo si 0x7feac44baec0 SAT>IP DVB-C Tuner #2 (192.168.0.190) weight 106 prio 15 error 0
2016-08-20 20:00:42.957 [ DEBUG]:service: 17: 386MHz in nos-cabo si 0x7feac455dca0 Silicon Labs Si2168 : DVB-C #0 weight 101 prio 16 error 0
2016-08-20 20:00:42.957 [ DEBUG]:service: 11: 386MHz in nos-cabo si 0x7feac43807c0 Silicon Labs Si2168 : DVB-C #3 weight 102 prio 16 error 0
2016-08-20 20:00:42.957 [ DEBUG]:service: 15: 386MHz in nos-cabo si 0x7feac46137f0 Silicon Labs Si2168 : DVB-C #1 weight 103 prio 16 error 0
2016-08-20 20:00:42.957 [ DEBUG]:service: 9: 386MHz in nos-cabo si 0x7feac401def0 Silicon Labs Si2168 : DVB-C #4 weight 104 prio 16 error 0
2016-08-20 20:00:42.957 [ DEBUG]:service: 7: 386MHz in nos-cabo si 0x7feac4273400 Silicon Labs Si2168 : DVB-C #5 weight 104 prio 16 error 0
2016-08-20 20:00:42.957 [ DEBUG]:service: 13: 386MHz in nos-cabo si 0x7feac44d0740 Silicon Labs Si2168 : DVB-C #2 weight 105 prio 16 error 0
2016-08-20 20:00:42.957 [ DEBUG]:service: 5: 386MHz in nos-cabo si 0x7feac4273340 Silicon Labs Si2168 : DVB-C #6 weight 105 prio 16 error 0
2016-08-20 20:00:42.957 [ DEBUG]:service: 3: 386MHz in nos-cabo si 0x7feac4273280 Silicon Labs Si2168 : DVB-C #7 weight 105 prio 16 error 0
2016-08-20 20:00:44.014 [ DEBUG]:service: nos-cabo/626MHz/SIC Radical: Status changed to [Hardware input] [Input on service] [Demuxed packets] [Reassembled packets]

What is the weight? Where to setup it?

Why isn't it choosing the DVB-S adapters over DVB-C since it has higher priority (prio 21) ?

#5 Updated by Jaroslav Kysela about 1 year ago

Weight -1 prio -1 means that the mux is already used by another subscription. So reuse it. It was done in your sample.

Weight is also increased by count of active subscriptions on a given mux.

Highter weight means a higher probablity to not use this mux/service, because other subscriptions with higher precedence are using it.

#6 Updated by Luis Alves about 1 year ago

Makes sense, but in my case there is also a MUX already being used with the same service where the adapter has higher priority:

2016-08-20 20:00:41.996 [ DEBUG]:service: 20: SIC Radical si 0x7feac4122870 STV0910 : DVB-S #1 weight -1 prio 10 error 0
2016-08-20 20:00:41.996 [ DEBUG]:service: 20: SIC Radical si 0x7feac41d3600 STV0910 : DVB-S #1 weight -1 prio 10 error 0

I was expecting that this one would be used since it has higher prio.

#7 Updated by Luis Alves about 1 year ago

I think the issue is here:
https://github.com/tvheadend/tvheadend/blob/master/src/service.c#L825

It will get the first "used" mux and ignore priorities.

#8 Updated by Luis Alves about 1 year ago

This is my current fix (apply it in case you find it useful):

http://pastebin.com/9pTTSGKQ

#9 Updated by Jaroslav Kysela about 1 year ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

#10 Updated by Jaroslav Kysela about 1 year ago

Thanks, fixed in v4.1-2190-gc53ee12 .

Also available in: Atom PDF