NextPVR Forums

Full Version: Linux dvb/atsc devices not shutting down cleanly
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm using NPVR v5.0.7.200726 on an Intel NUC running Linux Mint 19.3 and using a Win-TV DualHD atsc usb tuner.  It works well, but if the machine sleeps, live tv or recording no longer work after wake.  If I click Rescan on the web interface Device settings page, the status of all the tuners changes to Unavailable.  Only a reboot will restore tuner availability.


This problem seems to be related to the tuners not shutting down completely or properly after use.  If I don't let the computer sleep, recording and live tv work fine all the time.  I also discovered that TVHeadend worked properly after sleep using the same hardware and OS, so I don't think the tuner or drivers are a factor.

The release notes for NPVR v5.0.7.200726 referred to the removal OnSleep/OnResume logic that was affecting many users.  I was hoping this change would correct my Linux sleep issue, but it did not.

In a Linux forum post from January, 2020, it was mentioned that there was a known issue with Linux dvb/atsc devices not shutting down cleanly.  Has that issue been resolved, and if not, could it be the cause of my problem?


Any information regarding this matter is greatly appreciated.

Cheers
NextPVR doesn't support any power management on linux it is left to the user. Out of curiosity if you don't use a device and wake from sleep is the device available?

Martin
Thanks for your response, Martin.

I was aware that NPVR doesn't provide or support any power management functions in Linux, but it seems like it should still be possible to access devices after a wake from sleep. When NPVR is done recording, the tuner activity light does turn off, which would suggest that at least some level of device release has been attained. And if no sleep periods occur, the tuner will become active again when called upon. But it appears that a sleep cycle destabilizes some part of the tuner, but only with NPVR -- not with TVHeadend.

I've used a number of methods to manage sleep/wake, e.g., Kodi, shell scripts I've written or found, and manually putting the box to sleep with the power switch, remote, or OS. All methods cause subsequent tuner use to fail.

In response to your question, if I don't access a device, then suspend the computer, and finally wake it, the device functions normally and continues to do so until the next suspend. That would suggest the sleep state itself is not disrupting the device, but rather the combination of NPVR device usage followed by sleep.

I should also add that, in addition to the DualHD tuner, I've also tried a WinTV HVR-955Q, HVR-950Q, and HVR-850. All achieved the same result.
I wanted the confirmation that if you didn't access the device that things was be ok. I know that sub hooks the DeviceHostLinux process to NextPVRServer (which I would prefer he didn't do) and I suspect that might be part of problem.

It might be worth it if you set up a test after a resume that had tuners failing and tried

sudo kill -9 `pidof DeviceHostLinux`

To see if that gives access to the tuners.

Martin
Thanks for that great test suggestion, Martin.

I'll give it a try ASAP and let you know the results.
(2020-08-20, 10:20 PM)mvallevand Wrote: [ -> ]It might be worth it if you set up a test after a resume that had tuners failing and tried

sudo kill -9 `pidof DeviceHostLinux`
Yeah, that's what I'd suggest checking.
I tried the suggested command several times in different situations and always got the following result:

kill: failed to parse argument: 'pidof DeviceHostLinux'

To further deepen the mystery, I discovered that if you try to play a live show after wake from sleep, if you leave the player in a play state for about one minute and 45 seconds, it will start playing the live stream and the usual live.ts file will appear in the temp folder. If you click player stop before 1:45, no live.ts file is created, but a 4k .fuse_hidden file is created instead.

In one test, I waited over three minutes, but no live stream appeared. However, after clicking stop, there was now a 47k .fuse_hidden file in the temp folder. Dropping that file into VLC played three minutes of the program I was trying to test (though the audio seemed slightly out of sync). The 4k files in VLC did nothing.

Very strange.
(2020-08-21, 04:33 PM)Gazavant Wrote: [ -> ]I tried the suggested command several times in different situations and always got the following result:

    kill: failed to parse argument: 'pidof DeviceHostLinux'

"pid" is a number ... https://www.linux.com/training-tutorials...mand-line/
Those are quote marks they are back ticks `` I was expecting you to copy and paste from my message.

Martin
Sorry about that, Martin. I've been burned so many times by curly quotes and back quotes in pasted code, I automatically replace everything with straight quotes.

I tried the proper command before attempting to view a live stream (no error message this time), but it was not effective. But I did discover though that if I launch the web player to view a live program, then run the command, the tuner lights up and the stream starts playing. You need to run it every time a new stream is started. This leads me to think I might be able to automate running the command when a recording starts and thus solve my issue. I'll let you know how that goes.

Graham, thanks for the link for Linux processes. I found the top command to be very helpful with giving me some visibility as to what was going on under the hood.

And of course, my thanks to Martin and Sub for all their patience and help.
Pages: 1 2