Bug #3356
Streaming priority settings is disregarded
0%
Description
Despite a tuner has higher streaming priority it is disregarded if epggrab is ongoing on that tuner.
I expect that a new program streaming request is served by the pool of tuners not used for actual media streaming i.e. free tuners, idle scannig tuners and epg grabbing tuners. The request should be served by the tuner having the highest streaming priority in this pool. If epggrab is ongoing it shopuld be kicked out. Epggrab kick out is a standard action when no free tuner is availabe. The same procedure shall be applied when a free tuner is available but its streaming priority is lower.
Reproduction
- Set the following tuner priorities: A-1, B-100
- Initiate epg grabbing. Make sure it uses tuner B.
- Open any channel.
The request will be served by tuner A instead of tuner B.
The behavior is legacy. Same on 4.0.x
History
Updated by Jaroslav Kysela almost 9 years ago
- Status changed from New to Invalid
No, you mix priority, weight and unused tuner. The "use free tuner" is perfect behaviour and has the precedence over the priority settings.
Updated by Jaroslav Kysela almost 9 years ago
Also, TVH tries to open all available adapters for OTA EPG grabbing so the priorities do not change anything. You may disable OTA EPG for some tuners - 'Over-the-air EPG' checkbox.
Updated by Akos Sz almost 9 years ago
Hi,
I do not agree. I as a user want Tvheadend to allocate the tuner I prioritized for streaming first regardless of background activities like epggrab and idle scan.
Furthermore the mentioned implementatio "TVH tries to open all available adapters for OTA EPG grabbing" makes the tuner selection behavior unpredictable and makes this priority settings completely useless.
Updated by Jaroslav Kysela almost 9 years ago
The actual implementation for tuner allocation is:
1) get all enabled tuners based on priorities, sort them
2) pick the first unused tuner based on priority (exit if found)
3) sort all tuners based on subscription weight (if same - take in account the tuner priority)
4) pick the tuner with the lowest weight (exit if found, or if the weight for new subscription is lower than lowest found - reject new subscription)
There is no difference between subscriptions, all follow the same rules (no background tasks like you noted - everything is weight based - the scan and epggrab subscriptions has just very low weight values - you may see them in the status tab).
As you see, the difference between priority and weight is that priority is only for "tuner decision" at the start time, but weight describes the actual subscription value. The weight might be also overriden by user (DVR importance, weight HTTP argument etc.).
For EPG and scanning you may just set tuners to be disabled for these operations (in the tuner settings). Or keep them on, and because the weight of regular subscriptions (streaming, DVR) are highter - they'll be overriden.
So, everything is predicable and customizable. You just think in one "simple priority" way which is not the TVH implementation case.
Updated by Jaroslav Kysela almost 9 years ago
Forgot to note that the tuner allocation priorities can be defined for DVR and streaming separately.
Updated by Akos Sz almost 9 years ago
I see your point and accept that the current behavior is intended.
On the other hand I am still convinced that the current priority setting does not make sense for users unless strong limitation in epg settings applied.
Updated by Akos Sz almost 9 years ago
My goal was to allow any scanning activity when no streaming subscription is present. (Allow epggrab and idle scan on tuner A only and force streaming on this tuner first.) Is there other way to implement this?
Updated by Jaroslav Kysela almost 9 years ago
I added 'Free weight' to the tuner settings, so you may set the weight which will be handled as 'free tuner'. Set it to 10 for scans and EPG grabber subscriptions. v4.1-1084-ga4b2cf3
Updated by Akos Sz almost 9 years ago
Hi Jaroslav,
I tested your solution. It is very promising but something is wrong. When I set the free weight to 10 the subsequent streaming subscription kicks out the epgrab. It is fine, exactly what I expect.
However,
- free weight set to 4 will not consider the tuner as free if the actual streaming weight is 4 also (very minor thing)
- after unsubcribing tvheadend GUI gets slow, the client cannot connect backend anymore
- Tvheadend cannot be started with free weight configured higher than 4 on a tuner with enabled for EPG grabbing. GUI is not accessible, client cannot connect, the log is full with short epggrabbing sessions.
I assume that further epggrab requests are always served because the tuner always considered as free. An additional check would be needed for service request with lower weight than the free weight settings. But you know much better.
Thanks for your support!
Updated by Jaroslav Kysela almost 9 years ago
I believe that the epggrab issue was already resolved.
Updated by Jaroslav Kysela almost 9 years ago
It was not. The version v4.1-1189-ge46cde6 definitely fixes the "dead loop" behaviour.
Updated by Akos Sz almost 9 years ago
Jaroslav Kysela wrote:
It was not.
Yes. I realized it yesterday but wanted to doublecheck before report it.
I will test the new release as soon as the OE addon is available.