"Next PVR Client Connection Lost" notification after resume
#1
I am getting this notification after resuming from sleep on a Windows 10 machine. The plugin works fine even after sleep it just seems that the NextPVR service doesn't wake up quick enough for the plugin. The NextPVR service and Kodi are on the same machine and are up to date.

Is there a work around to fix this?
Reply
#2
There should be a 30 second time out on the reconnect after wake and I have never experienced this so I am surprised that the service resume is that also.   I am looking at that area right now because of a bug on connect using the C++ API Matrix so I would be happy to look at your logs.     To do this

- turn on Kodi debug logging
- let your PC sleep and resume
- confirm the problem

Then post your logs, and since it would be best to include the zipped NextPVR logs could you include those on a post on the NextPVR forum.

Martin
Reply
#3
(2020-06-17, 05:29)emveepee Wrote: There should be a 30 second time out on the reconnect after wake and I have never experienced this so I am surprised that the service resume is that also.   I am looking at that area right now because of a bug on connect using the C++ API Matrix so I would be happy to look at your logs.     To do this

- turn on Kodi debug logging
- let your PC sleep and resume
- confirm the problem

Then post your logs, and since it would be best to include the zipped NextPVR logs could you include those on a post on the NextPVR forum.

Martin

Thanks Martin...here are the logs.

https://paste.kodi.tv/tamuhigugo.kodi

PC wakes up around 16:56. I'm wondering whether the VPN running on the system is causing the problem with the loopback while it is reestablishing connection?
Reply
#4
What is happening is Kodi has its own wake logic and you will start to get errors when the addon gets new credentials after wake.   I know this problem because users typically tell me that they lose their channels and groups which is often true the deletes work, but the reload fails.  I think things eventually start working when the guide gets reloaded by a new PVR Manager thread.  I suspect the real issue is just the popup error notifications and not functionality right?

Perhaps @ksooo  or @phunkyfish  can tell me if the addon can tell PVR Manager not to run these tasks https://github.com/xbmc/xbmc/blob/master...r.cpp#L604  on wake.  I do tell Kodi that that it is disconnected https://github.com/kodi-pvr/pvr.nextpvr/...r.cpp#L295 but that doesn't stop the backend from trying these on wake.  The addon can't block requests because it doesn't know what PVR Manager thread is making the request.

Martin
Reply
#5
Can you explain why you would want to block the requests?
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply
#6
(2020-06-17, 19:47)phunkyfish Wrote: Can you explain why you would want to block the requests?

The main reason is the authentication may have lapsed.  This logic needs to wait for the client system wake to flow from

PVR_CONNECTION_STATE_DISCONNECTED
PVR_CONNECTION_STATE_CONNECTING
PVR_CONNECTION_STATE_CONNECTED

However there is more to it then this because those triggers are happening  while the original PVR Manager is stopping which I suspect causes the notifications the user doesn't  want and causes channels and groups to be deleted

2020-06-17 16:56:35.650 T:8928  NOTICE: PVR Manager: Stopping
...
2020-06-17 16:56:35.698 T:1048   ERROR: PVR::CPVRClients::GetChannels: PVR client 'NextPVR  (127.0.0.1):connected' returned an error: server error
2020-06-17 16:56:35.711 T:1048   ERROR: PVR::CPVRClients::GetChannelGroups: PVR client 'NextPVR  (127.0.0.1):connected' returned an error: server error
2020-06-17 16:56:35.711 T:1048   ERROR: PVR::CPVRClients::GetChannels: PVR client 'NextPVR  (127.0.0.1):connected' returned an error: server error
2020-06-17 16:56:35.725 T:1048   ERROR: PVR::CPVRClients::GetChannels: PVR client 'NextPVR  (127.0.0.1):connected' returned an error: server error
2020-06-17 16:56:35.731 T:1048   ERROR: PVR::CPVRClients::GetChannels: PVR client 'NextPVR  (127.0.0.1):connected' returned an error: server error
2020-06-17 16:56:35.735 T:1048   ERROR: PVR::CPVRClients::GetRecordings: PVR client 'NextPVR  (127.0.0.1):connected' returned an error: server error
2020-06-17 16:56:35.735 T:1048   ERROR: PVR::CPVRClients::GetTimers: PVR client 'NextPVR  (127.0.0.1):connected' returned an error: server error

until eventually

2020-06-17 16:56:35.735 T:1048   DEBUG: Thread PVRManager 1048 terminating
2020-06-17 16:56:37.605 T:9264   DEBUG: Thread EPGUpdater 9264 terminating
2020-06-17 16:56:37.770 T:9836   DEBUG: Thread PVRGUIInfo 9836 terminating
2020-06-17 16:56:37.793 T:8928  NOTICE: PVR Manager: Stopped
2020-06-17 16:56:37.793 T:8928  NOTICE: PVR Manager: Starting

when things go back to normal.

Martin
Reply
#7
But OnSystemWake is called on the addons in PVRManager before any update functions are called. I’m a bit confused how the connection has not been reestablished beforehand.
Maintainer of Enigma2 PVR addon: repo, docschangelog
How to create a full debug: here
Reply
#8
It is called but in a parallel thread T:6632

2020-06-17 16:56:35.502 T:6632 DEBUG: CurlFile::Open(0x28078b7f6f0) http://127.0.0.1:8866/service?method=ses...2020-06-17 16:56:35.502 T:6632 DEBUG: CurlFile::Open(0x28078b7f6f0) http://127.0.0.1:8866/service?method=ses...evice=xbmc

finishing here

2020-06-17 16:56:35.628 T:6632 INFO: AddOnLog: NextPVR PVR Client: On NextPVR Wake 1 0

Well before that after wake  Kodi started getting listings on T:9264 after wake

2020-06-17 16:56:34.930 T:9264 DEBUG: CurlFile::Open(0x28078b7f070) http://127.0.0.1:8866/service?method=cha...a6b2bf7c56

PVR Manager doesn't seem to care about the DISCONNECTED state.

In this case because it is on localhost the authentication wasn't really the issue, eventually T:9264 got the proper credentials.   All the failures really occur while PVR Manager was restarting, the addon wasn't returning PVR_ERROR_SERVER_ERROR so I assume that is internal while it was shutting.

Martin
Reply
#9
(2020-06-17, 16:05)emveepee Wrote: I suspect the real issue is just the popup error notifications and not functionality right?
I only use NextPVR to record and Kodi to playback recordings and this works well. Saying that, I have on occasion tried to look at my recordings and found none listed but this resolves if I close and reopen Kodi
Reply

Logout Mark Read Team Forum Stats Members Help
"Next PVR Client Connection Lost" notification after resume0