Project

General

Profile

Bug #4386

Network scan status is stuck at PEND

Added by Evren Yurtesen almost 4 years ago. Updated almost 4 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
Configuration
Target version:
Start date:
2017-05-25
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Found in version:
3.9 and 4.2
Affected Versions:

Description

I had this problem now twice on two different boxes so I thought I should try to report it. Unfortunately, I couldn't find anything in the logs but it is a very annoying problem when it happens. I am sorry about the lack of information. If there is any way you can suggest me to collect more information, I can try to replicate the issue.

Problem: Sometimes when I add a mux, it gets stuck at PEND scan status and it will never switch to ACTIVE. Sometimes this stops scanning of other muxes also. Once the offending mux is removed, scan starts for others (which are not stuck). Sometimes a mux which works becomes stuck at PEND after deleting and re-adding with exact same configuration.

Workarounds: In the past I could fix the issue by editing the channel text files and setting mux to IDLE manually, after that restaring tvheadend and then force scan in the network did the trick. But nowadays apparently the information is stored as binary, I managed to work around it by setting 'Enabled' to 'Ignore'. This change causes scan status to become IDLE and after that I need to restart tvheadend and then set 'Enabled' to 'Enabled' and then if I set scan status to PEND, it turns to ACTIVE right away.

I am sorry about the lack of information, as I mentioned, there is nothing in the logs which indicate any kind of error.


Files

tvheadend.log (10.9 KB) tvheadend.log mpegts trace Evren Yurtesen, 2017-05-24 11:12
muxes.png (23.1 KB) muxes.png muxes on web interface Evren Yurtesen, 2017-05-24 11:13
tvheadend.log (26.2 KB) tvheadend.log latest log with mpegts trace Evren Yurtesen, 2017-05-24 11:28
trace_settings.png (11.4 KB) trace_settings.png Evren Yurtesen, 2017-05-24 16:40
tvheadend.log (146 KB) tvheadend.log Evren Yurtesen, 2017-05-24 16:40
tvh.log (139 KB) tvh.log trace mpegts Petar Ivanov, 2017-05-24 16:55
tvheadend.log (153 KB) tvheadend.log with trace mpegts,linuxdvb,service,subscription Evren Yurtesen, 2017-05-24 21:41
tvh1.log (293 KB) tvh1.log --trace mpegts,linuxdvb,service,subscription Petar Ivanov, 2017-05-25 00:33
tvheadend.log (155 KB) tvheadend.log Evren Yurtesen, 2017-05-25 12:57
tvheadend.log (155 KB) tvheadend.log Evren Yurtesen, 2017-05-25 23:27

Subtasks

Bug #4393: Network scan stuckFixedJohn Törnblom

Actions

Associated revisions

Revision 8802233c (diff)
Added by Jaroslav Kysela almost 4 years ago

mpegts network scan: do not disable inputs for user scan + init scan combos, fixes #4386

Revision a28861f1 (diff)
Added by Jaroslav Kysela almost 4 years ago

mpegts network scan: do not disable inputs for user scan + init scan combos, fixes #4386

Revision 17996c35 (diff)
Added by Jaroslav Kysela almost 4 years ago

mpegts init scan: rename 'Skip initial scan' to 'Skip startup scan' for comprehence, fixes #4386

Revision ac46c82a (diff)
Added by Jaroslav Kysela almost 4 years ago

mpegts init scan: rename 'Skip initial scan' to 'Skip startup scan' for comprehence, fixes #4386

History

#1

Updated by Petar Ivanov almost 4 years ago

yep, i have same bug when add new mux not start to scan and stay "PEND" i need force to play mux to start scan.

#2

Updated by Jaroslav Kysela almost 4 years ago

Attach output from '--trace mpegts' : https://tvheadend.org/projects/tvheadend/wiki/Traces

#3

Updated by Evren Yurtesen almost 4 years ago

Jaroslav Kysela wrote:

Attach output from '--trace mpegts' : https://tvheadend.org/projects/tvheadend/wiki/Traces

Thanks. This is what I did:

1- I had 3 muxes only. 538, 634, 682 Mhz.
2- In 'Networks' I set 'Network discovery' to 'New muxes + changed muxes'
3- I clicked on 'Force scan'

It added 3 more muxes, 514, 562, 674 Mhz. But it won't start scanning them... Every 2 minutes it prints:

[ DEBUG]:mpegts: 562MHz in Turku - add raw service

and nothing happens...

#4

Updated by Evren Yurtesen almost 4 years ago

Then I set 'Enabled' option to 'Ignore' and these lines are logged:

2017-05-24 12:15:10.286 [ DEBUG]:mpegts: Turku - removing mux 562MHz in Turku from scan queue
2017-05-24 12:15:10.286 [ DEBUG]:mpegts: Turku - removing mux 674MHz in Turku from scan queue
2017-05-24 12:15:10.286 [ DEBUG]:mpegts: Turku - removing mux 514MHz in Turku from scan queue

When I restart I see the following:

2017-05-24 12:16:47.340 [ INFO]:epgdb: snapshot start
2017-05-24 12:16:47.372 [ INFO]:epgdb: queued to save (size 3612759)
2017-05-24 12:16:47.372 [ INFO]:epgdb: brands 0
2017-05-24 12:16:47.372 [ INFO]:epgdb: seasons 0
2017-05-24 12:16:47.372 [ INFO]:epgdb: episodes 3445
2017-05-24 12:16:47.372 [ INFO]:epgdb: broadcasts 3445
2017-05-24 12:16:47.437 [ INFO]:mpegts: 514MHz in Turku (0x7f088c125310) - deleting
2017-05-24 12:16:47.437 [ DEBUG]:mpegts: Turku - removing mux 514MHz in Turku from scan queue
2017-05-24 12:16:47.437 [ INFO]:mpegts: 674MHz in Turku (0x7f088c0a9410) - deleting
2017-05-24 12:16:47.437 [ DEBUG]:mpegts: Turku - removing mux 674MHz in Turku from scan queue
2017-05-24 12:16:47.437 [ INFO]:mpegts: 562MHz in Turku (0x7f088c0ad1b0) - deleting
2017-05-24 12:16:47.437 [ DEBUG]:mpegts: Turku - removing mux 562MHz in Turku from scan queue
2017-05-24 12:16:47.437 [ INFO]:mpegts: 538MHz in Turku (0x55e30d724450) - deleting
2017-05-24 12:16:47.437 [ DEBUG]:mpegts: Turku - removing mux 538MHz in Turku from scan queue
2017-05-24 12:16:47.437 [ INFO]:mpegts: 634MHz in Turku (0x55e30d721010) - deleting
2017-05-24 12:16:47.437 [ DEBUG]:mpegts: Turku - removing mux 634MHz in Turku from scan queue
2017-05-24 12:16:47.437 [ INFO]:mpegts: 682MHz in Turku (0x55e30d700a00) - deleting
2017-05-24 12:16:47.437 [ DEBUG]:mpegts: Turku - removing mux 682MHz in Turku from scan queue
2017-05-24 12:16:47.613 [ INFO]:epgdb: save start
2017-05-24 12:16:47.692 [ INFO]:epgdb: stored (size 790675)
2017-05-24 12:16:47.776 [ NOTICE]:STOP: Exiting HTS Tvheadend

Then when I set 'Enabled' to 'Enable' and 'Scan status' to 'PEND', then tvheadend starts scanning them as you can see the tuning log entry...(in this case the scan fails because these muxes did not have anything useful and thats why I didnt have them setup originally, but this happens on perfectly fine muxes also!)

2017-05-24 12:20:48.390 [ DEBUG]:mpegts: Turku - adding mux 514MHz in Turku to scan queue weight 6 flags 4000
2017-05-24 12:20:48.390 [ DEBUG]:mpegts: Turku - adding mux 674MHz in Turku to scan queue weight 6 flags 4000
2017-05-24 12:20:48.390 [ DEBUG]:mpegts: Turku - adding mux 562MHz in Turku to scan queue weight 6 flags 4000
2017-05-24 12:20:48.390 [ DEBUG]:mpegts: 562MHz in Turku - add raw service
2017-05-24 12:20:48.390 [ INFO]:mpegts: 562MHz in Turku - tuning on Realtek RTL2832 (DVB-T) : DVB-T #0
...
...
...

I attached the complete log from the beginning of this experiment also. It is not enough to just restart tvheadend. I need to set them to ignore/idle first then restart, then set enabled/pend again to start scanning.

#5

Updated by Jaroslav Kysela almost 4 years ago

TRACE lines are missing. Please, follow all instructions in the link in comment 2.

#6

Updated by Evren Yurtesen almost 4 years ago

Jaroslav Kysela wrote:

TRACE lines are missing. Please, follow all instructions in the link in comment 2.

Sorry, I assumed it would automatically put the trace lines when I put something to trace subsystems section at the web interface. Now I selected everything just to be sure.

1- I set at network discovery to 'New muxes + changed muxes' and started force scan at 2017-05-24 17:32:08.060
2- I set the offending muxes to IGNORE at 2017-05-24 17:37:13.502
3- I restarted tvheadend at 2017-05-24 17:37:40.453
4- Re-enabled debugging and enabled muxes and set offending muxes to PEND status again (from IDLE) at 2017-05-24 17:38:54.651

#7

Updated by Evren Yurtesen almost 4 years ago

Again, those muxes fail to scan anyway. But exactly same thing happens on perfectly fine muxes also. It just gets stuck at PEND status and does not try to scan at all. I didnt want to mess up my existing muxes by deleting them and then setting the up again. But if you need me to do that, I can do it also :)

#8

Updated by Petar Ivanov almost 4 years ago

Here is my log, how see not start scan and saty PEND, at i play mux in 17:46:18.956 to force to scan, see log.

#9

Updated by Jaroslav Kysela almost 4 years ago

Add more traces,pls: '--trace mpegts,linuxdvb,service'.

#10

Updated by Jaroslav Kysela almost 4 years ago

And subscription: '--trace mpegts,linuxdvb,service,subscription' .

#11

Updated by Evren Yurtesen almost 4 years ago

Jaroslav Kysela wrote:

And subscription: '--trace mpegts,linuxdvb,service,subscription' .

1- I press force scan at 2017-05-24 22:25:45.410 it finds the 3 muxes I deleted earlier.
2- It gets stuck at 2017-05-24 22:25:58.651 (then repeats same last 3 messages every 2 minutes)
3- I set PEND muxes to IGNORE at 2017-05-24 22:30:10.665
4- I restart tvheadend at 2017-05-24 22:30:48.518. Waited for epggrabber to finish and then started debugging again.
5- I set muxes to enabled and status as PEND at 2017-05-24 22:40:14.067

It scans those muxes...

#12

Updated by Petar Ivanov almost 4 years ago

Here is my log, i add mux 11015 H and wait one minute and scan not start stay "PEND" never go ACTIVE, after one minute i force to play mux and go ACTIVE to scan mux.

#13

Updated by Jaroslav Kysela almost 4 years ago

Please, create new trace logs with latest v4.3-147-g5f27a4b .

#14

Updated by Evren Yurtesen almost 4 years ago

Jaroslav Kysela wrote:

Please, create new trace logs with latest v4.3-147-g5f27a4b .

[email protected]:/tmp# tvheadend -v
tvheadend: version 4.3-147~g5f27a4b
[email protected]:/tmp#

It is exactly the same:
1- Started force scan at 2017-05-25 13:47:41.813
2- Got stuck at 2017-05-25 13:47:52.318 and printed same message every 2 minutes
3- I set offending muxes to ignore at 2017-05-25 13:50:47.376 (it scanned 634Mhz then which was waiting because of stuck muxes).
4- Restart at 2017-05-25 13:51:54.826
5- Enabled muxes and set them to pend at 2017-05-25 13:52:40.999
Then it scanned them...

By the way, apparently I dont have to restart tvheadend, it scans the problem muxes when I set them IGNORE then back to ENABLE and PEND manually.

#15

Updated by Evren Yurtesen almost 4 years ago

Forgot to add the file....
By the way, can I downgrade to 4.2 safely?

#16

Updated by cilin dro almost 4 years ago

I Scan in network 30 muxes and add 42 more muxes repeated with same configuration exept delivery system dvb-s change for dvb-s2. If i do a force scan with new muxes + changed muxes in the middle of the scan get stuck.

#17

Updated by cilin dro almost 4 years ago

Jaroslav Kysela delete my issue because is very similar to this issue.

#18

Updated by cilin dro almost 4 years ago

Evren Yurtesen

i have same problem like you

When I try to scan the muxes from scan status putting idle to active manual, it gets stuck because it tries to scan the muxes added with different configuration and maybe tvh or dvbs card not recognizing the configuration and get stuck in idle.

#19

Updated by Jaroslav Kysela almost 4 years ago

@cilin dro: which issue? number?

#20

Updated by Jaroslav Kysela almost 4 years ago

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

Updated by Jaroslav Kysela almost 4 years ago

Fixed in v4.3-149-g8802233 .

#22

Updated by Jaroslav Kysela almost 4 years ago

And in v4.2.2-23-ga28861f .

#23

Updated by Jaroslav Kysela almost 4 years ago

  • Subject changed from Scan status is stuck at PEND to Network scan status is stuck at PEND
  • Target version set to 4.2
#24

Updated by Evren Yurtesen almost 4 years ago

Jaroslav Kysela wrote:

And in v4.2.2-23-ga28861f .

Are you sure? Because I installed v4.2.2-29~g80e1fdf and still having the same issue?

#25

Updated by Jaroslav Kysela almost 4 years ago

I was almost sure, but I've not tried the code. Provide the logs again.

#26

Updated by Evren Yurtesen almost 4 years ago

Jaroslav Kysela wrote:

I was almost sure, but I've not tried the code. Provide the logs again.

[email protected]:~# tvheadend -v
tvheadend: version 4.2.2-29~g80e1fdf
[email protected]:~#

OK I deleted the offending muxes and set 'New muxes + changed muxes' in 'Network discovery'

1- Clicked on 'Force scan' at 2017-05-26 00:14:36.237 after scanning first 3 muxes, it gets stuck at 514Mhz and puts repeating messages at 2017-05-26 00:14:49.266
2- At 2017-05-26 00:21:15.506 I put them as IGNORE
3- At 2017-05-26 00:22:14.364 I enable them back and set them as PEND

It scans them...

What is the problem? It seems like it can't start scan when it says 'adding mux Multiplex' instead of the MHz value?

2017-05-26 00:14:36.237 [  DEBUG]:mpegts: adding mux 538MHz in Turku to scan queue weight 6 flags 4000
2017-05-26 00:14:36.237 [  DEBUG]:mpegts: adding mux 634MHz in Turku to scan queue weight 6 flags 4000
2017-05-26 00:14:36.237 [  DEBUG]:mpegts: adding mux 682MHz in Turku to scan queue weight 6 flags 4000
2017-05-26 00:14:38.724 [  DEBUG]:mpegts: adding mux Multiplex [onid:20F6 tsid:1001] in Turku to scan queue weight 5 flags 1000
2017-05-26 00:14:38.724 [  DEBUG]:mpegts: adding mux Multiplex [onid:20F6 tsid:3001] in Turku to scan queue weight 5 flags 1000
2017-05-26 00:14:38.724 [  DEBUG]:mpegts: adding mux Multiplex [onid:20F6 tsid:5001] in Turku to scan queue weight 5 flags 1000
2017-05-26 00:14:42.724 [  DEBUG]:mpegts: removing mux 538MHz in Turku from scan queue
2017-05-26 00:14:45.363 [  DEBUG]:mpegts: removing mux 634MHz in Turku from scan queue
2017-05-26 00:14:49.266 [  DEBUG]:mpegts: removing mux 682MHz in Turku from scan queue
2017-05-26 00:21:15.506 [  DEBUG]:mpegts: removing mux 514MHz in Turku from scan queue
2017-05-26 00:21:15.506 [  DEBUG]:mpegts: removing mux 674MHz in Turku from scan queue
2017-05-26 00:21:15.506 [  DEBUG]:mpegts: removing mux 562MHz in Turku from scan queue
2017-05-26 00:22:14.364 [  DEBUG]:mpegts: adding mux 514MHz in Turku to scan queue weight 6 flags 4000
2017-05-26 00:22:14.364 [  DEBUG]:mpegts: adding mux 674MHz in Turku to scan queue weight 6 flags 4000
2017-05-26 00:22:14.364 [  DEBUG]:mpegts: adding mux 562MHz in Turku to scan queue weight 6 flags 4000
2017-05-26 00:22:19.885 [  DEBUG]:mpegts: removing mux 674MHz in Turku from scan queue
2017-05-26 00:22:19.885 [  DEBUG]:mpegts: removing mux 514MHz in Turku from scan queue
2017-05-26 00:22:25.357 [  DEBUG]:mpegts: removing mux 562MHz in Turku from scan queue
#27

Updated by Evren Yurtesen almost 4 years ago

Sorry, I forgot to add the log file again. Here it is :)

#28

Updated by Jaroslav Kysela almost 4 years ago

This is your fault. Enable "init scan" for at least one tuner. The discovered muxes are added with the init flag not with the force user flag.

#29

Updated by Evren Yurtesen almost 4 years ago

Jaroslav Kysela wrote:

This is your fault. Enable "init scan" for at least one tuner. The discovered muxes are added with the init flag not with the force user flag.

Hi Jaroslav,

Thank you for all the help and you are right, it scans when I enable initial scan in dvb settings. But I think this feature is somewhat confusing and difficult to understand what it does. I might be wrong, but I will try to explain my reasoning and well you get some free user input, no need to agree... :) Tvheadend is great and I think you are doing a great job solving these bug reports. I have enjoyed sending debugging info and helping tvheadend become better.

In DVB settings help it says "Allow the initial scan tuning on this device (scan when Tvheadend starts). See 'Skip Initial Scan' in the network settings for further details." and in network settings it says "Skip scanning known muxes when Tvheadend starts. If "initial scan" is allowed and new muxes are found then they will still be scanned. See Help for more details."

In reality now I understood that in DVB settings 'Initial scan' means:
1- It will scan known muxes in attached networks if 'skip initial scan' is not selected in network settings
2- It will allow scan of new muxes automatically if they are discovered at any point. If this option is not selected, new muxes will be stuck at PEND state.

In network settings 'Skip initial scan' means:
1- Do not scan known muxes at startup.
2- This does NOT effect initial scan of new muxes. That is controlled by DVB initial scan setting. (confusing or what?)

In my opinion these options should not have the same name. In network options it should be renamed to 'Skip startup scan' because it is what it simply does.

I can't really understand why DVB settings need initial scan option. Because you would either want to allow DVB input for scans or do not allow at all. Maybe that particular DVB hardware has a scanning problem. OK I would want to disable scans completely on it. But I can't do it... because even if initial scan is disabled for a DVB input, I can set the mux 'active' manually and that DVB input may be used for scanning. So what is the purpose of not allowing/disallowing a particular dvb input only for initial/startup scan? In DVB settings the option should be something like 'Allow scan'. Startup scans should be only controlled from network settings.

I don't know if my reasoning is incorrect but I think:
1- I would want either to use dvb input for scans or NOT use.
2- I would want either to scan a network at startup or NOT scan.
So one clear option for dvb input settings and one clear option for network settings.

Furthermore, if DVB initial scan is not allowed, but in network settings 'skip initial scan' is not selected, then tvheadend puts all muxes to PEND at startup but can't scan them. (I can see how this could be confusing for users). There should be perhaps a message saying 'no available adapters for scan' or something in that line. It is difficult to tell why muxes are sometimes in PEND state and sometimes they change to ACTIVE automatically.

Thank you!

#30

Updated by Petar Ivanov almost 4 years ago

I test last code and problem with "PEND" is fixed here, but will be good when add new mux automatically change to "ACTIVE" ,not to "PEND" how is now and manually to set to "ACTIVE", because when i add new mux i want to scan. This is slow when i add 5 muxes and after that one by one to go to set manually "ACTIVE".

#31

Updated by Evren Yurtesen almost 4 years ago

Petar Ivanov wrote:

I test last code and problem with "PEND" is fixed here, but will be good when add new mux automatically change to "ACTIVE" ,not to "PEND" how is now and manually to set to "ACTIVE", because when i add new mux i want to scan. This is slow when i add 5 muxes and after that one by one to go to set manually "ACTIVE".

You need to go to DVB settings and enable 'Initial scan' option. That was what I was missing also. I tried to explain it in my previous reply, seemingly unrelated option is causing that.

#32

Updated by Jaroslav Kysela almost 4 years ago

I added these texts based on suggestions: https://tvheadend.org/projects/tvheadend/repository/revisions/17996c35a5e2d92af3f65c204ee7e66a5501ede5/diff/

I can't really understand why DVB settings need initial scan option. Because you would either want to allow DVB input for scans or do not allow at all. Maybe that particular DVB hardware has a scanning problem. OK I would want to disable scans completely on it. But I can't do it... because even if initial scan is disabled for a DVB input, I can set the mux 'active' manually and that DVB input may be used for scanning. So what is the purpose of not allowing/disallowing a particular dvb input only for initial/startup scan? In DVB settings the option should be something like 'Allow scan'. Startup scans should be only controlled from network settings.

These "limiters" were added mostly for setups where your have 8 or more tuners and the scanning might use a lot of CPU, so it would be good to reduce the tuners which are doing the scan task. Anyway, users should keep the defaults in normal configs.

#33

Updated by Evren Yurtesen almost 4 years ago

Jaroslav Kysela wrote:

These "limiters" were added mostly for setups where your have 8 or more tuners and the scanning might use a lot of CPU, so it would be good to reduce the tuners which are doing the scan task. Anyway, users should keep the defaults in normal configs.

Yes, but I had to modify that because it kept finding muxes and getting stuck due to the bug. Also, this is not the best solution to CPU load problem. I can go to muxes and set 8+ muxes ACTIVE and all the cards would be used regardless of the setting. The best solution would be a limit on maximum simultaneous scan processes. You could have a general setting 'Maximum allowed simultaneous network/mux scans = X'

What you may also want is a setting to enable/disable possibility of scanning on a specific card. Like an on/off switch. It would be a more clear, easy to understand feature. If this feature is even needed (I dont know?). This would be useful if scanning is broken on a specific card/driver.

At the very least, please update the help text for 'DVB Initial scan' to include 'Automatic scans from PEND state will not be performed if none of the adapters assigned to a network has initial scan option enabled.' This way users can know that it also causes this being stuck at PEND state problem.

Anyway, thank you for your time.

#34

Updated by Jaroslav Kysela almost 4 years ago

Evren Yurtesen wrote:

Jaroslav Kysela wrote:

These "limiters" were added mostly for setups where your have 8 or more tuners and the scanning might use a lot of CPU, so it would be good to reduce the tuners which are doing the scan task. Anyway, users should keep the defaults in normal configs.

Yes, but I had to modify that because it kept finding muxes and getting stuck due to the bug.

The default settings is to allow all type of scanning on all tuners. So you modified the settings to one which resulted with 'no available tuners' for the operation. I don't plan to add any other modifications for this issue. This settings is marked as advanced, so users should know what they're doing.

#35

Updated by Evren Yurtesen almost 4 years ago

Jaroslav Kysela wrote:

Evren Yurtesen wrote:

Jaroslav Kysela wrote:

These "limiters" were added mostly for setups where your have 8 or more tuners and the scanning might use a lot of CPU, so it would be good to reduce the tuners which are doing the scan task. Anyway, users should keep the defaults in normal configs.

Yes, but I had to modify that because it kept finding muxes and getting stuck due to the bug.

The default settings is to allow all type of scanning on all tuners. So you modified the settings to one which resulted with 'no available tuners' for the operation. I don't plan to add any other modifications for this issue. This settings is marked as advanced, so users should know what they're doing.

You could at least make the help entry more clear by adding 'Automatic scans from PEND state will not be performed if none of the dvb adapters assigned to a network has initial scan option enabled.' This was not clear to me by reading the help.

Also available in: Atom PDF