Unofficial Kodi HDHomeRun DVR PVR Client

Kodi Community Development

Moderator: TVJunkie198

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

I was expecting to take December "off" since things were slow and generally stable, but ... mitigating circumstances :)

Version 2.4.2 (2019.12.05)
  • Add dependency on zlib library v1.2.11
  • Add "Use Original Air Date timestamp for Recorded TV programs" setting
  • Enable DEFLATE and GZIP encoding support for backend HTTP data requests
  • Adapt to backend EPG change allowing for more data to be returned per web request
  • Limit EPG data requests to no more than 23.5 hours into the future if no devices with DVR authorization where discovered
Downloads: The main point behind this release is to provide some immediate relief to SiliconDust's EPG data stream. This PVR addon has been accounting for around 90% (!!!) of all the web requests that data stream is serving -- this is clearly a problem. I am actively working on a refactor of the EPG code to use a new data stream SD made available for applications like this, but it will take some time to fully implement (bonus: it will be so much faster that 14 days of guide data loads in a few seconds -- no joke). The EPG specific changes here are to enable GZIP compression on the source data stream (thanks for that feature SD!), which uses a lot less bandwidth, and the existing data stream now returns more data at a time than it used to, so I can reduce the number of web requests needed to load the Kodi EPG. Not ideal yet, but I hope this helps with the pain I'm causing SD. You should see little to no difference other than maybe EPG loads are a smidge faster.

The change "Limit EPG data requests to no more than 23.5 hours" only applies to non-DVR subscribers. This was previously set to 24 hours, dialing it back to 23.5 limits EPG web requests to just one per channel. Doubt you'll notice, a minor tweak that has a big impact on the number of web requests being sent out.

The other thing in here is the new "Use Original Air Date timestamp for Recorded TV programs" setting, as requested. This is a pretty cool option, you should try it out. Based on feedback from the beta release it now only applies to recordings with a category of "series", "movie", and "special". Things like "sports", "news", and "audio" will still be set as the Recording Time. My thanks for the suggestion - I'm turning this one on myself! LOVE IT.

Auto-update for Leia and Matrix platforms that support it will be live later tonight.

Let me know if you run into any problems, and as always many many many thanks to our gracious host, SiliconDust!

starslayer74
Posts: 20
Joined: Thu Jul 06, 2017 2:50 pm
Device ID: 15300503, 1325D5CE
Location: Parkville, MD

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by starslayer74 »

djp952 wrote: Wed Dec 04, 2019 8:12 pm
starslayer74 wrote: Wed Dec 04, 2019 8:00 pm
Ken.F wrote: Tue Dec 03, 2019 11:40 am I've been playing around with Matrix and Comskip the past couple of days. I like how it puts red marks over the commercial breaks on the seek-bar when using EDL files. EDL seems to be hit or miss for me. They work for some recordings but not all of them. It seems to help on some of them if I add "always_keep_first_seconds=5" to the comskip.ini file. That makes it so there's at least 5 seconds of video to play at the beginning of the recording before it tries to skip a commercial.

Image
I would love to play around with this but I don't fully understand where EDL files come from or how you generate them....any tips?
I'm not a big user myself, but I just used the comskip application from their web site. I believe MCEBuddy is still a thing for generating them as well.

Basically, you run a tool against the .MPG file and it scans it for commercial breaks and spits out an .EDL file, which is really nothing more than a set of start/end timestamps (in seconds) and a flag indicating what to do. Here is a sample:

Code: Select all

172.06	306.82	0
686.57	911.48	0
1386.30	1566.98	0
1952.18	2012.94	0
If you set something up to periodically scan your HDHomeRun RecordedTV share and generate the .EDL files for it, either in the same directory or lump them all into a single directory, the PVR addon can be configured to look for them and report the information back to Kodi. Getting something set up to do that automatically is out of my pervue, I've only done it manually to date to test the functionality in the PVR.

The tricky part with this PVR, at least, is that the HDHomeRun directory on your NAS needs to be accessible to Kodi via a normal share. That way the PVR can go out and get the .EDL files. Normally Recorded TV is just streamed from the RECORD engine over HTTP, no shares required.
Ahh, so it seems like a lot of work for me then. I'm running on Android (ShieldTV) and my PVR storage is the HDHomerun Servio...so for me to run it I'd have to do it from my PC....and I'm not sure if its worth it to access the Servio remotely and do it.

Might play around with it when I get some time off work for the holidays though.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F »

djp952 wrote: Thu Dec 05, 2019 5:21 pm You should see little to no difference other than maybe EPG loads are a smidge faster.
A smidge? I just got the update on my RPi2 and the EPG loads in about two seconds now. It was taking minutes to load before.

Thanks for the awesome PVR addon. It just keeps getting better!

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

Ken.F wrote: Thu Dec 05, 2019 7:58 pm
djp952 wrote: Thu Dec 05, 2019 5:21 pm You should see little to no difference other than maybe EPG loads are a smidge faster.
A smidge? I just got the update on my RPi2 and the EPG loads in about two seconds now. It was taking minutes to load before.

Thanks for the awesome PVR addon. It just keeps getting better!
I didn't see THAT much difference here but I'm glad - bonus! That has to be the data compression at work, I wish I knew that was an option earlier!

Big changes to EPG coming as soon as I can make them, should be even faster when it's ready. Will definitely use a heck of lot less Internet than it does today.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F »

djp952 wrote: Thu Dec 05, 2019 8:15 pm I didn't see THAT much difference here but I'm glad - bonus! That has to be the data compression at work, I wish I knew that was an option earlier!
Now that I think about it I was comparing the load time of the new method with only 3 days of data to the old method with 14 days.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

Ken.F wrote: Fri Dec 06, 2019 4:47 am
djp952 wrote: Thu Dec 05, 2019 8:15 pm I didn't see THAT much difference here but I'm glad - bonus! That has to be the data compression at work, I wish I knew that was an option earlier!
Now that I think about it I was comparing the load time of the new method with only 3 days of data to the old method with 14 days.
I'll get you back to 14 as soon as possible. Don't think it will beat 2 seconds but here I'm seeing 4 seconds for 14 days with the new method. That may go up a bit, but should never approach anything near a minute :)

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F »

djp952 wrote: Fri Dec 06, 2019 6:14 am Don't think it will beat 2 seconds but here I'm seeing 4 seconds for 14 days with the new method. That may go up a bit, but should never approach anything near a minute :)
It's a Raspberry Pi 2 caching data to a slow SD card so the actual data download still takes some time. The loading channels/timers/recordings from clients part seems to go much faster now.

jaytaylor@gmail.com
Posts: 5
Joined: Sun Dec 08, 2019 6:23 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by jaytaylor@gmail.com »

Hello! LOVE this add-on! Thank you so much for the time and effort you've put into this!
I've been using it for years, but I have a small problem I was hoping I could get help with --and I've just gotten around to creating a log file if that helps... the file is almost a MB and too big for pastebin, so I'm not sure where to send it? I turned on verbose logging in Kodi for PVR and now I'm not so sure I should have!

The problem:
Live TV starts off fine, but after several minutes the audio hangs, then it happens again every few minutes, then the whole stream seems to halt for a split second before resuming, then that happens again every few minutes, and eventually some pixelation starts to occur as well... we only really use live TV to watch sports (mostly hockey), so it's fast moving and incredibly jarring. Curiously to me, it does not seem to happen when watching live TV through the Kodi repository's HDHomerun Simple add-on... but I would SO RATHER use yours for the timeshifting functionality!

I feel like it's an overpowered PC for what I'm trying to do, Windows 10 -fresh install, Kodi 18.5 -fresh install, wired ethernet connection... I dunno. I'm at a loss!

If the big log I created is helpful, let me know and I can get it to you, if a new (smaller) log is better I can do that too... Would really appreciate any input.

Thanks again for your time on this project!!!

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

jaytaylor@gmail.com wrote: Sun Dec 08, 2019 6:57 am Hello! LOVE this add-on! Thank you so much for the time and effort you've put into this!
I've been using it for years, but I have a small problem I was hoping I could get help with --and I've just gotten around to creating a log file if that helps... the file is almost a MB and too big for pastebin, so I'm not sure where to send it? I turned on verbose logging in Kodi for PVR and now I'm not so sure I should have!

The problem:
Live TV starts off fine, but after several minutes the audio hangs, then it happens again every few minutes, then the whole stream seems to halt for a split second before resuming, then that happens again every few minutes, and eventually some pixelation starts to occur as well... we only really use live TV to watch sports (mostly hockey), so it's fast moving and incredibly jarring. Curiously to me, it does not seem to happen when watching live TV through the Kodi repository's HDHomerun Simple add-on... but I would SO RATHER use yours for the timeshifting functionality!

I feel like it's an overpowered PC for what I'm trying to do, Windows 10 -fresh install, Kodi 18.5 -fresh install, wired ethernet connection... I dunno. I'm at a loss!

If the big log I created is helpful, let me know and I can get it to you, if a new (smaller) log is better I can do that too... Would really appreciate any input.

Thanks again for your time on this project!!!
Glad you like it! Based on the symptoms, my best guess would be that the system running the RECORD engine is having difficulty keeping up with the stream's bitrate and isn't able to send the data quickly enough. That causes the PVR to run out of data to give Kodi, so Kodi will stop for a bit to catch up. It may be something that a restart of the RECORD engine could resolve, or maybe check it's network connection and/or the disk performance. If you are recording things while playing things back that's a consideration as well, RECORD will potentially be writing lots of data to the disk while reading from it to serve the playback function. I think it's an unlikely possibility that the disk(s) can't keep up compared with a possible sneaky network bottleneck, though.

The Kodi log is probably just going to have some "stream stalled" messages in it, but I am of course happy to take a look. Since it's a Kodi log you can legitimately use paste.kodi.tv, and I will PM you an e-mail address as well. Either way should be fine.

You probably also want to have a look at the YYYYMMDD.log file that the RECORD engine generates in the HDHomeRun share on the device. It has some details about what it was doing, what channel(s) it was streaming, etc. If there is any indication that the RECORD engine isn't able to keep up SiliconDust would likely need to help out, and they'll want to see that log file.

The built-in Kodi addon (pvr.hdhomerun) always hits the TV tuners directly, it doesn't try to use the RECORD engine like this addon does, that would explain the performance difference fairly neatly and start pointing to RECORD being the trouble spot, but let's see what we can find out! For what it's worth, I've run into this a number of times myself and bouncing my NAS where RECORD lives solves the problem for me :)

jaytaylor@gmail.com
Posts: 5
Joined: Sun Dec 08, 2019 6:23 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by jaytaylor@gmail.com »

djp952 wrote: Sun Dec 08, 2019 9:12 am but let's see what we can find out!
Thanks so much for responding! :P
I've emailed you copies of the above-referenced Kodi and YYYYMMDD.log files.
Thanks for offering to take a look.

So just some more information addressing the operating environment and potential issues you raised in your reply...
--The RECORD engine and the Kodi install are on the same PC (Windows 10 PC/8 core I7/GTX1080), I recently formatted the drives and started fresh, don't even have sources in Kodi yet, your add-on is the first install! So the system's pretty clean.
--The PC where all this resides is completely powered down each night and rebooted whenever it's needed. So I believe the RECORD engine is restarted regularly.
--The RECORD engine is set to save recordings to a HDD, so presumably it's writing there while watching live TV? I've never thought to point it to a SSD, but I could...
--I am NOT a network guru, all I know is that the HDHomeRun Prime is plugged into the network in the server cabinet on the other end of the house, and I don't have trouble streaming HD MKVs from that server, so I've always felt like the network itself is sufficient? But I dunno!
--The Kodi log is huge. I think because I enabled verbose logging for PVR in the settings? It wouldn't let me attach it on paste.kodi.tv either! :?
--Haven't tried the "official" SiliconDust HDHomeRun add-on this go around. I was never able to adjust to the interface, just too different after being used to Kodi... so the add-on I mentioned that has no problem viewing Live TV is Team Kodi member Lunatixz' https://forum.kodi.tv/showthread.php?tid=327117. It's just a way to access your HDHomerun streams and recordings --no timeshifting or timers. So maybe it functions the same way as the official SiliconDust app and that explains why it works without the hang-ups?

Again, thank you SO MUCH for taking your time with this project and all the support you provide!!!

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

Update on what is now going to be called "v3.0.0" -- the EPG replacement project :)

While I was hoping to be far enough along to have a beta out for you by tonight, I missed that target. I'm still a day or two (or three) away from that. It turns out that all the little tweaks and settings added over the years made this a smidge more difficult :) But, I'm happy to report that with SiliconDust's help and support I seem to have everything we need in place, it's down to figuring out how to make Kodi behave in the best possible way while still meeting the new goals in regard to this data, and of course testing it all out well enough to let it loose.

Back-porting to Krypton will be difficult and take additional time, but I now feel it's feasible. I'm on the fence about what to do about Jarvis. I don't want to leave what few users are still using Jarvis "out to pasture", per-se, but porting these changes to a baseline that hasn't been updated in months might end up being prohibitive. I can't make any promises about Jarvis right now.

Rest assured that it's looking "pretty good" already, and I'm sure with your help and feedback it will be even better than it was. Stay tuned, I'm going as quickly as I can ...

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

jaytaylor@gmail.com wrote: Sun Dec 08, 2019 3:06 pm
djp952 wrote: Sun Dec 08, 2019 9:12 am but let's see what we can find out!
Thanks so much for responding! :P
I've emailed you copies of the above-referenced Kodi and YYYYMMDD.log files.
Thanks for offering to take a look.

So just some more information addressing the operating environment and potential issues you raised in your reply...
--The RECORD engine and the Kodi install are on the same PC (Windows 10 PC/8 core I7/GTX1080), I recently formatted the drives and started fresh, don't even have sources in Kodi yet, your add-on is the first install! So the system's pretty clean.
--The PC where all this resides is completely powered down each night and rebooted whenever it's needed. So I believe the RECORD engine is restarted regularly.
--The RECORD engine is set to save recordings to a HDD, so presumably it's writing there while watching live TV? I've never thought to point it to a SSD, but I could...
--I am NOT a network guru, all I know is that the HDHomeRun Prime is plugged into the network in the server cabinet on the other end of the house, and I don't have trouble streaming HD MKVs from that server, so I've always felt like the network itself is sufficient? But I dunno!
--The Kodi log is huge. I think because I enabled verbose logging for PVR in the settings? It wouldn't let me attach it on paste.kodi.tv either! :?
--Haven't tried the "official" SiliconDust HDHomeRun add-on this go around. I was never able to adjust to the interface, just too different after being used to Kodi... so the add-on I mentioned that has no problem viewing Live TV is Team Kodi member Lunatixz' https://forum.kodi.tv/showthread.php?tid=327117. It's just a way to access your HDHomerun streams and recordings --no timeshifting or timers. So maybe it functions the same way as the official SiliconDust app and that explains why it works without the hang-ups?

Again, thank you SO MUCH for taking your time with this project and all the support you provide!!!
No worries my friend. Unfortunately nothing in the logs helped. I can correlate the "stream stalled" and correction attempt by Kodi with the streaming event on the HDHomeRun, but HDHomeRun didn't complain about anything on it's end.

I have a weird thought, though. I wonder if there is something goofy going on if the data comes in TOO fast, which is a real possibility with the RECORD engine on the same computer as Kodi. There is a big ol' buffer I use to store data, and if it fills up it pauses the stream until some space bleeds off. I've never really tested that with something local to the computer like this, I can speculate a couple places where that might be problematic -- if the stream is paused (in my code, not Kodi), I try to restart it on every read, with the assumption being that Kodi will still be reading data faster than RECORD can deliver it. If the opposite were true ... hmmm... the overhead involved may be extreme and potentially cause enough of a delay to return no bytes once or twice and hence: "stream stalled".

Unfortunately I don't have a resolution for you right now, but I will do my best to replicate your environment (local RECORD engine on Windows) and see if I can screw the PVR up. Based on the logs and all the great information you've provided I'm thinking the problem is more likely mine than anything else :(

I really need to finish up the v3.0.0 "alpha" and get that out for some real-world testing by you guys, but I also need to do some testing with multiple RECORD engines again, so I'll try to combine the two efforts a bit.

Hang tight, I won't forget about ya!

jaytaylor@gmail.com
Posts: 5
Joined: Sun Dec 08, 2019 6:23 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by jaytaylor@gmail.com »

Awesome. Thank you so much for continuing to look into it! :D
In the meantime, what do you think about me uninstalling the record engine from the local computer that's currently running everything and installing it on the server across the house? If you're on the right track, maybe that would build in the latency or slow things down just enough? That seems to be the more common setup, right? A server or NAS running the RECORD engine...

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

jaytaylor@gmail.com wrote: Mon Dec 09, 2019 8:11 pm Awesome. Thank you so much for continuing to look into it! :D
In the meantime, what do you think about me uninstalling the record engine from the local computer that's currently running everything and installing it on the server across the house? If you're on the right track, maybe that would build in the latency or slow things down just enough? That seems to be the more common setup, right? A server or NAS running the RECORD engine...
It's worth a try if you're game, plus bonus the local computer doesn't need to be on 24/7 :)

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F »

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.

Post Reply