NextPVR Forums

Full Version: Wake after Suspend issue with dvbt devices (LE12 Kodi 21)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
Just try 2 then -INT
(2024-02-05, 08:25 AM)mvallevand Wrote: [ -> ]Just try 2 then -INT

Ok,
I've done the same test:

Started up
Played a channel - ok
suspend system
played a channel - fail
ran pkill - DeviceHostLinux
played a channel - fail
ran pkill -l (wasn't sure if INT is always 2)
ran pkill -s 2 
played a channel - fail

logs attached, thank you
It looks like BusyBox wants pkill -INT I don't see the sessions ending without restarting the service. You do need to wait after resume for the device to reinitiate. Dmesg will tell you how long
(2024-02-05, 12:14 PM)mvallevand Wrote: [ -> ]It looks like BusyBox wants pkill -INT I don't see the sessions ending without restarting the service.  You do need to wait after resume for the device to reinitiate.  Dmesg will tell you how long

I tried 
pkill -INT 
and 
pkill -x INT

Just to test, still no luck playing any channel after the system is suspended.

I've also tried waiting 10 seconds + after wake before trying playback or running any commands, but still get the same results.

Also tried VDR in LE to compare with TVH and NPVR and that works pretty much the same as TVH - I think both services were written by the LE team? They have interesting similarities, at least on my system:
  • TVH & VDR both suspend and wake without issue
  • TVH & VDR both have corruption in VAAPI MPEG2 on certain channels - particularly E4 and ITV2 in the UK. These channels play fine with VAAPI MPEG2 disabled
  • TVH & VDR both change channel fast and never have the buffer ring
  • NPVR does not work after suspend at all for me
  • NPVR has no issue playing VAAPI MPEG2 on any channel
  • NPVR always has the buffer running briefly when switching channels in live, particularly if switching between SD/HD and vice versa. You can eliminate this by using timeshift mode, but then it's a lot slower to change channels

I think it's interesting that both TVH & VDR have exactly the same VAAPI issues, it seems like they're both doing something similar in the way they interact with kodi player and suspend the system, but it's beyond me to know what.

Apologies, I know I type too much, but I'm ASD so these things eat away at me and I start to look for reasons and solutions.

Thank you for all of your help.
Try systemctl restart in the LE power on script as I said there is no Linux power management built in. This should be like a startup

The buffer continues but will immediately stop when the client reconnects or after 15 seconds Keeping tuners primed can be faster or slower depending on tuners.

Custom streaming is faster for TvHeadend and VDR buty http is more versatile
(2024-02-07, 08:23 AM)mvallevand Wrote: [ -> ]Try systemctl restart in the LE power on script as I said there is no Linux power management built in.  This should be like a startup

I realised I didn't have "keep tuners primed" selected, so I ticked that but it's still the same.

I'm not sure what you mean by LE power on script, is that autostart.sh? I didn't think that ran after suspend, but I'm not sure?

Anyway, to test I did a suspend, woke, failed to play a channel then tried the following:

systemctl restart service.nextpvr
That didn't work but I assume this would only be like disabling/enabling the service from within kodi anyway?

So I tried:
systemctl restart kodi
And that didn't do anything either, to me its like the tuners just aren't working correctly after the suspend, but they do work if I suspend before playing or recording anything with nextpvr, or suspend when using TVH or VDR, so I'm at a loss as to how I can recover them at the moment.

Thank you for explaining the differences in how npvr works compared to VDR and TVH, that makes things a lot clearer to me. I do prefer npvr for the playback quality and the working MPEG2 VAAPI as a lot of my TV is still only SD.

*EDIT*

After trying several things, I have found a way to get nextpvr working with suspend:

what doesn't work:
Start system
Play a channel - ok
suspend
wake
Play a channel - fails

Also doesn't work:
Start system
Play a channel - ok
suspend
wake
Disable nextpvr service in myaddons
enable nextpvr service in myaddons
wait
Play a channel - fails

what does work:
Start system
Play a channel - ok
Disable nextpvr service in myaddons
suspend
wake
enable nextpvr service in myaddons
Play a channel - ok
repeat

Note: The above also works after a failed playback, as long as I disable npvr service before shutdown and enable afer wake the system recovers
Note2: I tried doing the same thing with the npvr client, but that doesn't work, it only works again if the server is diabled before suspend and enabled after wake, the cliet then reconnects and everything works

It looks to me like it's a timing issue: If LE suspends too close to npvr finishing playback or recording and presumably not releasing the tuners then I get this broken tuners issue when the system wakes?

I'm not sure how I could get npvr to shutdown prior to suspend and awaken after using scripts in LE, but I'm pretty sure I can write a python service to do this in kodi, do you have any suggestions on a better way of doing this?

Thanks

*EDIT2*

I have got this working now by writing a kodi python service that disables nextpvr when System.OnSleep and enables it when System.OnWake.

I'll test over a period of time and check that it can now wake and record reliably

Thank you
So basically it sounds like NextPVR can't release the tuners correctly after resume. In this thread you can try the restart in pre before sleep https://forum.libreelec.tv/thread/26904-...t-at-wake/ and see if that helps.

Martin
(2024-02-07, 11:40 AM)mvallevand Wrote: [ -> ]So basically it sounds like NextPVR can't release the tuners correctly after resume.  In this thread you can try the restart in pre before sleep https://forum.libreelec.tv/thread/26904-...t-at-wake/ and see if that helps. 

Martin

Ah nice, thanks Martin.

I have solved it now with a kodi service addon, but I'll look into that as well and see which works better.

Thank you
I notice you are using Ubuntu 22.04. Is that the LTS HWE version. The reason I ask is that a major kernel 6.5 upgrade was dropped on that version quite recently which appears to be affecting certain hardware and its ability to function correctly.

I’m having a similar problem with an Hauppauge WinTV Nova HD S2 PCI internal tuner. Problem seemed to start after the kernel upgrade. Both Kaffeine and TVHeadend are functioning correctly but not NPVR.

Is your tuner an internal PCI/e one or a USB one. Sub you might want to have a closer look at the possibility this 6.5 kernel upgrade has broken something.
This thread is about LE and a lot of the power management scripts require root. A new thread would be better

Martin
Pages: 1 2 3 4 5