djp952 / pvr.hdhomerundvr

Unofficial Kodi HDHomeRun DVR PVR Client
https://github.com/djp952/pvr.hdhomerundvr/wiki
Other
60 stars 9 forks source link

EPG blank after Raspberry Pi reboot or power off #64

Closed tomhardy closed 5 years ago

tomhardy commented 5 years ago

The guide data are blank after Raspberry Pi is rebooted or powered off. Running LibreELEC 9.1.501 (Kodi 18.4). Occasionally a the RPi requires a reboot or power-in this case the guide is unpopulated, but the channels are listed. The only way to restore the guide is updating the add-on from the Kodi settings. After a reboot the screen doesn't show any data being downloaded. This is different behavior than the previous version where the guide data were reloaded after a reboot. Thank you.

djp952 commented 5 years ago

Hi! I'll be out of town for another day so I can't try this on my RPi right now, but I have a couple thoughts. First, with "previous version" do you mean the previous version of LibreELEC or this PVR addon?

If the concern is with the addon version, you can manually install a prior version if you want to see if it clears it up. You should turn off auto-update in the Addon settings first, otherwise it will just move itself forward to the latest version on you. The page here: https://github.com/djp952/pvr.hdhomerundvr/wiki/Release-History, has links to all versions of the PVR addon.

I'm guessing that you actually mean the previous version of LibreELEC, though. Last I used LibreELEC it was still the Kodi 18.3 version, so I will have to try it out to see what might be going on.

Until then, would it be possible to get the Kodi log from the system? There should be an indication in there from the PVR why it didn't do something. If that's OK, you can e-mail it to me at djp952 AT gmail DOT com, or michael DOT brehm AT verizon DOT net, I can have a look anytime.

My guess is that the network isn't quite ready yet, the latest PVR had some performance enhancements in it that would have reduced the amount of time to get to tasks like loading channels (more likely the problem than the EPG itself) by a second or more, which is kind of an eternity to a CPU :) I have prototyped changes to discovery to have it happen more on-demand to combat this, but they aren't ready yet.

So, let's start with the log file if available, then if the concern was the PVR version, try going back a version or two. I promise I will hook up an RPi and get the latest LibreELEC on it and try to see what you see as soon as I get back from this trip.

djp952 commented 5 years ago

Hi! First off thank you for the additional information you sent to me. I wasn't even aware of that Kodi setting, but it's kinda cool to have it jump into Live TV like that, makes it more like a set-top box :)

I found that starting in Live TV does change the general behavior of how Kodi interacts with the addon. What I found here was that as soon as I stopped playback it would then jump in and populate the EPG. Not exactly the same symptom you described, but it's a start.

I'm going to play around with debugging what exactly happens differently in this scenario to see if there is something I can specifically do, or worst case something I can ask for from the Kodi team.

For the time being, if you want to turn that option back on I had better success if I allowed LibreELEC to cache the EPG data. By default it dumps it and starts from scratch every time, thus keeping the EPG blank. In the Kodi "PVR & Live TV" settings, if you scroll down to Guide, turn off "Don't cache in local database" and bounce Kodi. Now any EPG data it loads will be maintained between restarts instead of summarily deleted.

Let's keep this open even though you found a viable workaround, I'm hopeful that there is something I will be able to do to combat it for moving forward.

tomhardy commented 5 years ago

Thank you for looking at the this and your work on the add-on. Perhaps the behavior I'm experiencing is setup dependent. I'm on a RPi 4, with a Synology 718+ and HDHomeRun recording on an attached external SSD, all commands to the Pi are via a Samsung TV using the HDMI-CEC with the Samsung remote. It works really well as a point and click set-top box. Just one problem I haven't been able to work around-often the Pi hangs after turning TV power on using the remote. A laptop SSL link to Pi reboot fixes the problem as does a power off and manual power on. There is no Kodi interface setting to reboot.

On Wed, Oct 9, 2019 at 9:15 PM Michael Brehm notifications@github.com wrote:

Hi! First off thank you for the additional information you sent to me. I wasn't even aware of that Kodi setting, but it's kinda cool to have it jump into Live TV like that, makes it more like a set-top box :)

I found that starting in Live TV does change the general behavior of how Kodi interacts with the addon. What I found here was that as soon as I stopped playback it would then jump in and populate the EPG. Not exactly the same symptom you described, but it's a start.

I'm going to play around with debugging what exactly happens differently in this scenario to see if there is something I can specifically do, or worst case something I can ask for from the Kodi team.

For the time being, if you want to turn that option back on I had better success if I allowed LibreELEC to cache the EPG data. By default it dumps it and starts from scratch every time, thus keeping the EPG blank. In the Kodi "PVR & Live TV" settings, if you scroll down to Guide, turn off "Don't cache in local database" and bounce Kodi. Now any EPG data it loads will be maintained between restarts instead of summarily deleted.

Let's keep this open even though you found a viable workaround, I'm hopeful that there is something I will be able to do to combat it for moving forward.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/djp952/pvr.hdhomerundvr/issues/64?email_source=notifications&email_token=ABTAH72XTDJD5ZV6YVYFK3LQNZ6ZNA5CNFSM4I6J6Z4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAZ77AA#issuecomment-540278656, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTAH77AFKARPZFYDQUOKETQNZ6ZNANCNFSM4I6J6Z4A .

djp952 commented 5 years ago

No problem. Unfortunately I wasn't able to find anything specifically wrong with Kodi or the Addon, at least not with a RPi 3B+ (I don't have a 4 yet). I think figuring out a way to make sure the IPv4 network is fully available before discovery will help, but I don't have anything workable for that on Linux yet.

I suggest turning off the following two options in LibreELEC:

PVR & Live TV / Guide / Prevent updates during playback PVR & Live TV / Guide / Don't cache in local database

"Don't cache in local database" I already mentioned above, but here is why I suggest turning off "Prevent updates during playback" -- if this is ON in conjunction with setting LibreELEC to start in Live TV, the EPG load won't take place until you stop playback. So, if you are going straight into Live TV and then switching channels without ever fully stopping, the EPG will never load. This seems to be working as Kodi intended it to, but it's usually defaulted to OFF, LibreELEC changes that default.

There could be some differences with the Pi 4 implementation as you surmised as well, on a Pi 3 I definitely have the option to reboot from within LibreELEC, so some things are definitely slightly changed between the two.

I'd like to leave this Issue open for a bit if you don't mind, even if it just serves as a reminder to me that I really want to get something viable in place to make sure the network is up before trying to use it. You'd think that would be a typical thing, and it was easy on Windows, but Linux and Android are a bit elusive :)

tomhardy commented 5 years ago

Those settings seem to work-time will tell. Under Settings-Libreelec-Network-Advanced there is "Wait for network before starting Kodi"-wait time can be set up to 10 seconds. I was unclear on the reset setting-it is in the main Kodi menu-I was referring to HDMI-CEC settings under Settings-System-Input-Peripherals-CEC Adapter. There is no reboot option for the Pi only Shutdown and some irrelevant choices. Shutdown turns off the Pi and there is no remote way to turn it on-hence the desire for reboot.

On Sat, Oct 12, 2019 at 5:47 PM Michael Brehm notifications@github.com wrote:

No problem. Unfortunately I wasn't able to find anything specifically wrong with Kodi or the Addon, at least not with a RPi 3B+ (I don't have a 4 yet). I think figuring out a way to make sure the IPv4 network is fully available before discovery will help, but I don't have anything workable for that on Linux yet.

I suggest turning off the following two options in LibreELEC:

PVR & Live TV / Guide / Prevent updates during playback PVR & Live TV / Guide / Don't cache in local database

"Don't cache in local database" I already mentioned above, but here is why I suggest turning off "Prevent updates during playback" -- if this is ON in conjunction with setting LibreELEC to start in Live TV, the EPG load won't take place until you stop playback. So, if you are going straight into Live TV and then switching channels without ever fully stopping, the EPG will never load. This seems to be working as Kodi intended it to, but it's usually defaulted to OFF, LibreELEC changes that default.

There could be some differences with the Pi 4 implementation as you surmised as well, on a Pi 3 I definitely have the option to reboot from within LibreELEC, so some things are definitely slightly changed between the two.

I'd like to leave this Issue open for a bit if you don't mind, even if it just serves as a reminder to me that I really want to get something viable in place to make sure the network is up before trying to use it. You'd think that would be a typical thing, and it was easy on Windows, but Linux and Android are a bit elusive :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/djp952/pvr.hdhomerundvr/issues/64?email_source=notifications&email_token=ABTAH7ZMBLTBEZWPDRHXJJTQOJAXTA5CNFSM4I6J6Z4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBCI63Y#issuecomment-541364079, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTAH77JZTTM5EWNZZKZFIDQOJAXTANCNFSM4I6J6Z4A .

gibxxi commented 5 years ago

I've been having a similar issue on Windows since the last update.

All 3 of my Kodi installs aren't getting any EPG data from the HDHomeRun tuner (HDHR4-Connect) either on start, or when using the two "Clear Data" options within Kodi itself.

I am using UseNetServer's VPN app on each of the PCs in question, which will alter the (external) IP being reported, but by the time Kodi is started on any of these systems, the connection has been established and is active.

Obviously, this is not true of the HDHomeRun itself. Since my router does not allow for a global VPN "Client" configurations, and neither does it support (and never will, due to being a VDSL-Router) VPN "Client" access via third-party firmware like DD-WRT, I cannot mitigate this at this end.

I would however of thought (aside from the HDHomeRun configuration sofftware itself), that the only device to be actively needing to connect to SiliconDust's servers for guide data, is the HDHomeRun itself, so in that regard there shouldn't be a problem.

I have an active HDHomeRun DVR subscription, and there are no issues with it (I checked it today). And bizarrely enough, pre-set recording rules and timers are still progressing on the HDHomeRun as expected, and the recordings still making it to the NAS. It's just that all the EPG info in Kodi is missing, irrespective of session being run.

I don't think it's covered by the entry in the wiki on this site about "new channels" either, as i've neither added nor deleted any channels from the HDHomeRun for months. I did attempt an update of the HDHomeRun software and associated firmware today (20190815 - beta1 from 20190621) but that has not changed anything for the better. Am running on Kodi 18.4 on all systems.

EDIT: Disregard the above diatribe. I reset all the settings for each category in the addon to defaults, and magically it's working now. Should of tried that before posting.

djp952 commented 5 years ago

Hmmm ... problems that come and magically disappear are the worst kind, it's usually not a coincidence.

There was a change in 2.3.1 with how the EPG is loaded, but it didn't really alter the logic involved, I took how EPG was being done and generalized that so it could be used for other things too to speed up stuff like enumerating all the Timers, which was a performance issue for a while.

There were some small deficiencies that I found after the fact, none of which should be very impactful, though. Let me cut a build of where I am right now just in case I underestimated the severity of these deficiencies. The "formal" change log doesn't include items like that (the commit log does), but here is where v2.3.2 is right now:

v2.3.2 (2019.10.xx)

  • Update SQLite database engine to version 3.30.1
  • Enforce previously relaxed rules regarding invalid JSON data retrieved from the backend and/or local devices
  • Limit EPG data requests to no more than 24 hours into the future if no devices with DVR authorization where discovered

https://1drv.ms/u/s!AgEGEEVzGNq-i_5-e3sHqUQiyCjtJw?e=p1pPJH

This build also refactors pretty much all the web-based JSON requests, so there is a chance for new instability; I've been cleaning things up in preparation for reworking the discovery in the next major version. So definitely a "beta" build. I've only been testing the individual changes as I go, I haven't done any level of regression on this yet.

gibxxi commented 5 years ago

I did initially think (after resetting the addon settings to defaults) that the changes you made to cater for channel names from the backend might mean that the EPG data wasn't being matched to the altered channel names with that option having been on.

However, since resetting, I've enabled it again, and it still seems to be working, so I guess it's not that.

The option "Get Genres from the backend" does not seem to work. I only get genre colours on the EPG with this disabled, and on some startups I still don't get genre colours in the EPG even with the option disabled, but this isn't consistently.

Also, somewhat off-topic, but the Milkdrop issue has reared it's head again. But again, unlike before, it is somewhat random. I think, for me, it's probably a combination of running on Powerline AV and also having enforced QoS on those adapters (which I can't disable), and then periodically having Acronis do backups to the NAS(es) that even at it's lowest priority / bandwidth settings, still causes the Powerline adapters to freak out and shut down all other traffic, possibly. The audio stream seems to get through, but the video is delayed (we're talking mere ms in difference here, but it's big enough to cause an issue).

Kodi will try to play whatever is given to it, immediately, so it sees audio and invokes the Visualizer, which then means the graphics card is deemed "in-use". When the video then makes it through, there's nothing available to play it back with in the eyes of Kodi, so the whole thing freezes, deadlocked. At least that's the way it looks, and the only explanation that makes sense to me, not being a developer.

Anyway, all this is for another thread / time, as I don't want to hijack this one with my "issues". It's all intermittant at the moment, and can be somewhat "worked-around". It's just slightly annoying, that's all.

Appreciate your efforts Mike, as always. Will give your new build a test, regardless.

Regards,

Dan / Gib.

djp952 commented 5 years ago

Just a couple notes for Dan ... (unrelated as he indicated)

gibxxi commented 5 years ago

I think I do Mike. I may be way off base in my assumptions, but this is the only thing that makes sense. So as not to pollute / hijack this thread, i've created a new issue:

https://github.com/djp952/pvr.hdhomerundvr/issues/65

Dan / Gib.

djp952 commented 5 years ago

@tomhardy, how are we doing on the EPG issues on your Pi? I still don't have anything viable for a network test on Linux, and may not unless I want to go the route of choosing a known URL (like api.silicondust.com) and making sure it can be resolved successfully. If that URL changes nothing will work so it seems like a logical choice :)

Anyway, let me know if there are still EPG issues going on. On the SiliconDust forum I linked to the "v2.4.0~beta1" release I built which has an absolute ton of things in (probably too much), one of which ensures that Kodi is fully up and running before I do discovery OR allow an EPG operation to occur. This may help greatly with any timing issues that are/were involved.

tomhardy commented 5 years ago

I have not had any issues with the EPG for quite a while.

On Tue, Oct 29, 2019 at 2:38 PM Michael Brehm notifications@github.com wrote:

@tomhardy https://github.com/tomhardy, how are we doing on the EPG issues on your Pi? I still don't have anything viable for a network test on Linux, and may not unless I want to go the route of choosing a known URL (like api.silicondust.com) and making sure it can be resolved successfully. If that URL changes nothing will work so it seems like a logical choice :)

Anyway, let me know if there are still EPG issues going on. On the SiliconDust forum I linked to the "v2.4.0~beta1" release I built which has an absolute ton of things in (probably too much), one of which ensures that Kodi is fully up and running before I do discovery OR allow an EPG operation to occur. This may help greatly with any timing issues that are/were involved.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/djp952/pvr.hdhomerundvr/issues/64?email_source=notifications&email_token=ABTAH7ZXGIQEFQNA4ARQYDTQRB7LHA5CNFSM4I6J6Z4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECRUFZA#issuecomment-547570404, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTAH75YHSWEOA7LJLVLTSDQRB7LHANCNFSM4I6J6Z4A .

djp952 commented 5 years ago

Great! I'm tracking the desire for a clean and simple way to check for network on Linux separately, so I'll go ahead and mark this one as closed. Sorry if we got a little off-topic on you there for a bit.

Please don't hesitate to open a new issue at any time, or otherwise contact me with any issues you experience!

Have a great evening!

tomhardy commented 5 years ago

Thank you.

On Fri, Nov 1, 2019, 9:45 PM Michael Brehm notifications@github.com wrote:

Great! I'm tracking the desire for a clean and simple way to check for network on Linux separately, so I'll go ahead and mark this one as closed. Sorry if we got a little off-topic on you there for a bit.

Please don't hesitate to open a new issue at any time, or otherwise contact me with any issues you experience!

Have a great evening!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/djp952/pvr.hdhomerundvr/issues/64?email_source=notifications&email_token=ABTAH76AP6IQ5FE4VUNSEKDQRTLTJA5CNFSM4I6J6Z4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC4Q4YQ#issuecomment-548998754, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTAH773G6M5WEMNMXUW6NDQRTLTJANCNFSM4I6J6Z4A .