Bug #4088
idle mux scan stuck at certain mux
100%
Description
See attached log file. After some time idle mux scanning gets stuck at a certain mux. 100% reproducable on my end with two different tvh installations.
Files
Associated revisions
History
Updated by Kai Sommerfeld over 5 years ago
I analysed this a bit more and think i found the problem:
It seems that initial mux scan works fine, but idle scan does not work at all, because the first mux (according to scan queue sort criteria) is scanned again and again, "forever".
Problem imo is the sorted scan queue. Mux scan works the way that first element of the scan queue is picked, scanned, and after the scan it gets removed from the queue and immediately put back into the queue, then.
For initial scan, all available muxes are inserted into the queue with weight 5 (INIT_SCAN_PRIORITY), which leads to following (simplified) queue content, according to the sort criteria:
(weight, polarization, frequency)
5 H 100000
5 H 100100
...
5 V 120000
After init scanning (5 H 100000), the respected element will be removed from the queue head and reinserted into the queue with weight 2 (IDLE_SCAN_PIORITY). This leads to the following queue content:
(weight, polarization, frequency)
5 H 100100
...
5 V 120000
2 H 100000
Next init scan iteration will pick (5 H 100100) scan, put back with weight 2 at tail of the queue, which is fine, and so on, until the last mux was processed by init scan. Queue content at this stage:
(weight, polarization, frequency)
2 H 100000
2 H 100100
...
2 V 120000
Now, (2 H 100000) will be scanned, removed and reinserted at exactly the same place in queue it was before (because no weight change this time) - at the head of the queue! And this lasts forever - scan (2 H 100000) - remove it - reinsert (2 H 100000) at head.
Due to this, no other mux will ever be idle scanned than the one at the head of the queue.
Updated by Kai Sommerfeld over 5 years ago
BTW, mux idle scan was broken by commit "mpegts scan: sort DVB-S muxes (for slave tuners)" (https://github.com/tvheadend/tvheadend/commit/0cc8b0becc061630510991b7b0e315ff173983db)
Asking, myself whether commit "epggrab: ota - sort muxes to improve scan algorithm" (https://github.com/tvheadend/tvheadend/commit/79c443206c1ad54f843e1be8976e9dda89e12d6e) causes similar problems for epggrab.
Updated by Jaroslav Kysela over 5 years ago
- Status changed from New to Fixed
- % Done changed from 0 to 100
Applied in changeset tvheadend|f30b50495a3045cb72ad61352b6b9fb83cd3da98.
mpegts scan: put tuned muxes to the end-of-queue, fixes #4088