Bug #4088

idle mux scan stuck at certain mux

Added by Kai Sommerfeld over 5 years ago. Updated over 5 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Found in version:
Affected Versions:


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.


service.log (116 KB) service.log log file Kai Sommerfeld, 2016-11-19 16:55

Associated revisions

Revision f30b5049 (diff)
Added by Jaroslav Kysela over 5 years ago

mpegts scan: put tuned muxes to the end-of-queue, fixes #4088



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)" (

Asking, myself whether commit "epggrab: ota - sort muxes to improve scan algorithm" ( 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

Also available in: Atom PDF