Unofficial Kodi HDHomeRun DVR PVR Client

Kodi Community Development

Moderator: TVJunkie198

Post Reply
Online
djp952
Posts: 1259
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD USA
x 4

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

Ken.F wrote: Tue Dec 10, 2019 1:04 pm Is there any way to manually clear the device cache? I shut down one of my record engines that I was using for extra storage and it not being online is causing issues when trying to add a recording timer from the guide. It gives me a popup error that says something like timer recordings require an active DVR subscription. If I start that record engine again I can add a timer without any issues. Triggering device discovery in the PVR & Live TV client specific settings it does not remove the record engine that isn't running.
If you have HTTP device discovery enabled it will stay in the list for about 24 hours. This was the primary motivation for making broadcast the default now.

If you have broadcast enabled it should drop off when you refresh manually like that or restart Kodi.

Ken.F
Posts: 2305
Joined: Fri Apr 05, 2013 9:20 am
Device ID: 1041A706, 1043EB32, 104BAD9E, 13168DC5, 1322A7AC
Location: West Rockhill, PA

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F »

djp952 wrote: Tue Dec 10, 2019 1:20 pm If you have broadcast enabled it should drop off when you refresh manually like that or restart Kodi.
Switching it to broadcast fixed it. Thanks.

Online
djp952
Posts: 1259
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD USA
x 4

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

Update on a test version of 3.0.0 (new EPG). Everything is functional, I'm working through all the various triggers for Kodi (when to update things), and it looks like I need to refactor how the lineups are stored so I can tell the difference between "the channels changed" and "new channels were added" in order to kick off a backend XMLTV load to get those new channels.

I'm hoping for late today to make something available to play with. There will be some limitations :)

edit: I detected a pretty big performance problem with loading the listings into Kodi that I had to address, haven't done the channel part yet. Still hoping for sometime today!

14 days of guide data, from empty Kodi and PVR databases, fully loaded into Kodi using a laptop on Wifi --> 5 seconds! (It became more than 30 seconds due to the problem I found and subsequently fixed; curse you LEFT OUTER JOIN)

Code: Select all

2019-12-11 16:06:41.597 T:2432  NOTICE: AddOnLog: HDHomeRun DVR PVR Client: update_listings_task: elapsed time is 5 seconds
edit 2: nope, not today. Too many problems with Kodi channels. It appears to be "existing", but it still needs to be fixed. Ugh.

Online
djp952
Posts: 1259
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD USA
x 4

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

Turns out the major problem with the channels was a Kodi issue (figures - lol). Here goes nothing ....

v3.0.0~beta1 - December 12, 2019
  • Add dependency on libxml2 library v2.9.10
  • Switch to incremental database schema versioning rather than tying to the addon version number
  • Change "Append repeat indicators to applicable episode names" setting to apply only to programs of type EP/SH
  • Remove "Electronic Program Guide (EPG) Metadata" discovery intervals setting
  • Remove "Trigger guide metadata discovery" PVR Client Specific setting
  • Add "Trigger guide listing discovery" PVR Client Specific setting
  • Fix bug in task scheduler that would allow pending tasks to execute after stop signal has been sent
  • + NEW EPG IMPLEMENTATION
This is a beta release (hopefully the only one) for the new EPG implementation based on the XMLTV API provided by SiliconDust. SD contacted me and pointed out that this addon has been responsible for a very high load on their existing EPG API, and we really shouldn't have been using it anyway. They made a whole new API for third-party applications to use and the switchover will become mandatory. Access to the existing API will be blocked at some point.

IMPORTANT NOTE: Moving forward clients with no DVR authorized tuners will NOT be able to access EPG data via this addon.

That said, when the dust settles I intend to see what can be done here, perhaps a guide/FAQ on how to use a different EPG service via Kodi. This addon will not directly support EPG sources outside of the HDHomeRun ecosystem. The beta is currently for LEIA only. Even if there are no problems, it's going to take me a couple/few days to test all the platforms and backport these changes to Krypton.

DVR subscribers will ALWAYS get 14 days of data from the new XMLTV API. There is no reason you can't crank Kodi up to 14 days if you want, but as with all things the more you ask for the longer it takes to load. The download times for the EPG data will always be the same no matter how many days you set in Kodi.

There are some other benefits to the new data and methodology as well. The biggest one is that ALL the guide data will be reprocessed every 24 (or so) hours, so if EPG listings have changed since they were first loaded, they will be updated. This was a major limitation of the old method, once the EPG was loaded it was pretty much fixed in place.

Link (OneDrive): https://1drv.ms/u/s!AgEGEEVzGNq-jIgphYi ... Q?e=6Sfpo2

KNOWN ISSUES:

- Executing a "Clear Data" in the Kodi PVR & Live TV / Guide settings does not trigger an EPG update afterwards. Go into the Client Specific / Client specific settings and choose "Trigger guide listing discovery" to force a re-download and processing of the XMLTV data. EPG will repopulate soon after.

- The channel names from the tuner(s) may appear in the upper-right hand corner if Kodi asks for one-off EPG data for a single channel. This happens when Timers are updated and it doesn't already have the EPG data for those programs. This is a Kodi limitation, once an EPG entry is created the original name will be used forever. To fix, after the EPG data has been populated once, do a "Clear Data" in PVR & Live TV / Guide, then go into Client Specific / Client specific settings and choose "Trigger guide listing discovery". I intend to look at Kodi and suggest a PR for them to resolve this.

Typical djp952 long-winded post ... give it a go and let me know. I think we need to have this completely finished up and available for everyone in the next week or so.

Thanks!!!

edit: bug #1 - The new genre mapping stopped working. The guide is supposed to have all kinds of new colors (worked a couple days ago - lol). I'll see if the source data changed on me or if I changed something. Sorry!
Last edited by djp952 on Thu Dec 12, 2019 3:45 pm, edited 1 time in total.

ddejager
Posts: 131
Joined: Tue May 06, 2014 2:26 pm
Location: Glen Arbor, MI

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by ddejager »

IMPORTANT NOTE: Moving forward clients with no DVR authorized tuners will NOT be able to access EPG data via this addon.
I know this is not of your doing....but it will be a major issue. I have a number of friends for whom I've installed your add-on and an SD tuner (either OTA or Prime) but who do not need or want a DVR. They need only 24 hours of guide data. They like your interface much better than the SD HDHomeRun app (or HDHomeRun kodi add-on)....primarily because they like the style of the guide data (instead of all the blocks of data that you get with the HDHomeRun app....which is very difficult to look at and find stuff if you have 250 cable channels.) I think that you are saying that they will no longer get any guide data with your add-on, right? I presume this is because SD will block your add-on from guide data unless you have a DVR key.

It would be really nice if there was some way to work with SD on this to get 23 hours of data for non-DVR subscriptions. It certainly will make SD's non-DVR hardware customers happier.

Online
djp952
Posts: 1259
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD USA
x 4

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

ddejager wrote: Thu Dec 12, 2019 3:36 pm
IMPORTANT NOTE: Moving forward clients with no DVR authorized tuners will NOT be able to access EPG data via this addon.
I know this is not of your doing....but it will be a major issue. I have a number of friends for whom I've installed your add-on and an SD tuner (either OTA or Prime) but who do not need or want a DVR. They need only 24 hours of guide data. They like your interface much better than the SD HDHomeRun app (or HDHomeRun kodi add-on)....primarily because they like the style of the guide data (instead of all the blocks of data that you get with the HDHomeRun app....which is very difficult to look at and find stuff if you have 250 cable channels.) I think that you are saying that they will no longer get any guide data with your add-on, right? I presume this is because SD will block your add-on from guide data unless you have a DVR key.

It would be really nice if there was some way to work with SD on this to get 23 hours of data for non-DVR subscriptions. It certainly will make SD's non-DVR hardware customers happier.
In essence, correct. Currently the new XMLTV API is only available to clients that can provide a valid, DVR authorized, device authorization code. I can't speak for SiliconDust on this, of course, and maybe they will add something for non-subscribers in the future. If they do, I will support it.

I think there must be a way to use a third-party EPG with Kodi too, I've just never tried. Since non-DVR clients can't schedule Timers and stuff, the only thing that needs to match is the channel number. That might need some changes on my end to support somebody else's channel IDs, but we'll have to see. I honestly haven't had the time to play with that yet.

Online
djp952
Posts: 1259
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD USA
x 4

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

Self-reporting bug #1 with 3.0.0~beta1:

The new genre mapping stopped working. The guide is supposed to have all kinds of new colors (worked a couple days ago - lol). I'll see if the source data changed on me or if I changed something. Sorry!

The new guide looked much cooler with purple and beige in it - lol. Right now it's boring green and blue everywhere :(

edit: Source data changed. Will need to make adjustments.

Ken.F
Posts: 2305
Joined: Fri Apr 05, 2013 9:20 am
Device ID: 1041A706, 1043EB32, 104BAD9E, 13168DC5, 1322A7AC
Location: West Rockhill, PA

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F »

I tried out the 3.0.0 beta on a RPi2. It works great if you only have 3 days of guide data loaded. With 7 days of data it starts to get a bit glitchy and the disk activity light stays on pretty much all the time. With 14 days of data it is unstable and freezes up frequently. Even with nothing playing trying to navigate the menus is difficult.

Online
djp952
Posts: 1259
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD USA
x 4

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

Ken.F wrote: Thu Dec 12, 2019 8:40 pm I tried out the 3.0.0 beta on a RPi2. It works great if you only have 3 days of guide data loaded. With 7 days of data it starts to get a bit glitchy and the disk activity light stays on pretty much all the time. With 14 days of data it is unstable and freezes up frequently. Even with nothing playing trying to navigate the menus is difficult.
Hmmm... sounds like it's the Kodi part of the equation that's having problems here. The PVR will now always get (and store) 14 days of data, so I'm thinking the bottleneck is either with the read operations or with the Kodi EPG database. I do limit the amount of data sent back to Kodi based on the "future days" setting based on performance profiling here -- it was taking Kodi notably longer to process what I was sending it than it was for me to send it.

Given that all the available EPG data will now be stored in the PVR database, maybe try turning on Kodi / Settings / PVR & Live TV / Guide / Don't cache in local database? That should eliminate the disk I/O from Kodi, albeit at the cost of having to wait a bit longer at startup for Kodi to process all the information being sent in. On a Windows system (admittedly much more powerful than an RPi2) turning that option off had little to no effect on getting 14 days of data into Kodi, and the Kodi EPG database stayed empty.

If the bottleneck ends up being in the PVR addon I will of course do what I can to resolve it. I spent a number of hours yesterday profiling everything and found no bottlenecks not fixed already, but I'll be honest -- I am a Windows guy not a Linux guy. I have already verified Windows and Android, next up is Linux and OS/X. If I see anything I think I can improve I will absolutely do what I can.

My fear at this point is that the amount of data being processed may simply be "too much" for some devices. It's not an ideal situation, but I've always maintained that if SiliconDust asked me to stop doing something I would stop doing it :(

Ken.F
Posts: 2305
Joined: Fri Apr 05, 2013 9:20 am
Device ID: 1041A706, 1043EB32, 104BAD9E, 13168DC5, 1322A7AC
Location: West Rockhill, PA

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F »

I turned off caching and that helped a lot but live TV froze up a little while after doing that. Maybe the sd card is going bad.

Online
djp952
Posts: 1259
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD USA
x 4

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

Ken.F wrote: Thu Dec 12, 2019 9:40 pm I turned off caching and that helped a lot but live TV froze up a little while after doing that. Maybe the sd card is going bad.
Any logs I can look at? The new EPG load is intense; perhaps there is something I can do to pause or cancel it when a stream starts ...

Ken.F
Posts: 2305
Joined: Fri Apr 05, 2013 9:20 am
Device ID: 1041A706, 1043EB32, 104BAD9E, 13168DC5, 1322A7AC
Location: West Rockhill, PA

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F »

djp952 wrote: Thu Dec 12, 2019 10:23 pm Any logs I can look at? The new EPG load is intense; perhaps there is something I can do to pause or cancel it when a stream starts ...
I don't have any logs. It rebooted itself last night so I wiped the SD card and started over. So far everything seems to be working correctly.

Online
djp952
Posts: 1259
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD USA
x 4

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

Ken.F wrote: Fri Dec 13, 2019 6:20 am
djp952 wrote: Thu Dec 12, 2019 10:23 pm Any logs I can look at? The new EPG load is intense; perhaps there is something I can do to pause or cancel it when a stream starts ...
I don't have any logs. It rebooted itself last night so I wiped the SD card and started over. So far everything seems to be working correctly.
All good. I sincerely appreciate the effort that goes into trying out test builds as well, I know it's a pain.

I fixed the EPG grid colors and found a missed impact when new channels are added (needs to force a listings download), but otherwise so far so good. I'm working on Matrix and Krypton now with the intention of a Beta 2 for all platforms today sometime. (Car is in the shop so I'm stuck at home anyway LOL)

Ken.F
Posts: 2305
Joined: Fri Apr 05, 2013 9:20 am
Device ID: 1041A706, 1043EB32, 104BAD9E, 13168DC5, 1322A7AC
Location: West Rockhill, PA

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F »

djp952 wrote: Fri Dec 13, 2019 6:45 am All good. I sincerely appreciate the effort that goes into trying out test builds as well, I know it's a pain.
I appreciate the effort you put into making a PVR add-on for us.

For guide colors is it better to use backend genre strings? It seems Kodi only marks things as Show/Gameshow, Sports or Movie.

Online
djp952
Posts: 1259
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD USA
x 4

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

Ken.F wrote: Fri Dec 13, 2019 6:53 am
djp952 wrote: Fri Dec 13, 2019 6:45 am All good. I sincerely appreciate the effort that goes into trying out test builds as well, I know it's a pain.
I appreciate the effort you put into making a PVR add-on for us.

For guide colors is it better to use backend genre strings? It seems Kodi only marks things as Show/Gameshow, Sports or Movie.
It's broken in Beta 1, the source XML changed a bit and I didn't notice in time. I've got it fixed. But yeah right now you are only getting the three categories which are based on the program type identifier since nothing matched up. The three default categories are Movie (MV), Show (EP/SH) and Sports (SP).

Using the backend genre strings will disable colors completely on you, but the entire set of categories will show up in the EPG tag line at the bottom for the program. To get the colors you have to come up with a mapping of sorts to a limited set of DVB genre identifiers. It's annoying, but I like the colors!!

Post Reply