Unofficial Kodi HDHomeRun DVR PVR Client

Kodi Community Development

Moderator: TVJunkie198

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

Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 » Sun Mar 17, 2019 8:34 pm

(Old thread #2: viewtopic.php?f=88&t=65776)
(Old thread #1: viewtopic.php?f=88&t=64143)

zuki.pvr.hdhomerundvr is an open-source Kodi PVR Client add-on supporting the SiliconDust HDHomeRun DVR services. This is different than the official Kodi HDHomeRun PVR Client -- this client works with the DVR services; you must be a subscriber in order to access all this add-on has to offer.

Requirements (Basic Functionality):
  • Kodi 17 "Krypton" or Kodi 18 "Leia"
Requirements (All Functionality): Supported Kodi Platforms:
  • Microsoft Windows / Windows Store
  • GNU Linux i686 / x86_64 / ARMv7 / ARMv8 (ARM64)
  • Android x86 / ARMv7 / ARMv8 (ARM64)
  • Raspberry Pi
  • Apple OSX x86_64
  • Universal Windows Platform (Xbox One / Windows 10)
Features:
  • Live TV streaming and time-shifting *
  • Full Electronic Program Guide (EPG) data
  • Recorded TV playback and deletion
  • Timers and Timer Rules (Record Series, Record Once)
  • Channel Groups (HD Channels, SD Channels, Favorite Channels)
  • HDHomeRun Demo channels (when available)
* Streaming of DRM channels is not supported and will be filtered out by the PVR Client. Time shifting support requires an active HDHomeRun RECORD engine on your local network.

All documentation and downloads for the PVR client are located on GitHub. Please feel free to leave comments and suggestions regarding documentation, keeping that up to date is far more of a challenge than keeping the code up to date. Here are a few direct links to get you started, I suggest thumbing through the other documentation pages as time allows:

Main Documentation Page:
https://github.com/djp952/pvr.hdhomerundvr/wiki

Download Pages:
Kodi 17 "Krypton" : https://github.com/djp952/pvr.hdhomerun ... di-Krypton
Kodi 18 "Leia" : https://github.com/djp952/pvr.hdhomerun ... -Kodi-Leia

How-To Page:
https://github.com/djp952/pvr.hdhomerundvr/wiki/How-To

Known Issues and Limitations Page:
https://github.com/djp952/pvr.hdhomerun ... imitations

As of March 2019 there have been more than 40 releases of the addon, many of which were driven exclusively by bug reports and feature requests from here on the SiliconDust forums; if there is something not working right or something you think it could do better, please say so! Without feedback, there would be no versions for Android, no access to the full Electronic Program Guide, and there would definitely be a lot more defects in there. All feedback, positive or negative, is always welcome.

I'd also like to thank our host here, SiliconDust, not only for allowing us to use their forums but for creating HDHomeRun and the HDHomeRun DVR solution in the first place. I've been using HDHomeRun devices since 2008 and have never looked back. None of this would be possible without their hard work.

NOTE: As a rule, I do not accept donations. I deeply appreciate the offer, but it's reward enough for me to have so many people getting use out of the project. I've got a day job; this is a hobby :mrgreen:
Last edited by djp952 on Fri Jul 26, 2019 9:11 pm, edited 3 times in total.

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

Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 » Sun Mar 17, 2019 8:35 pm

Version 2.3.0 (2019.09.12)
  • Update cURL library to version 7.66.0
  • Fix bug that caused "DVR Service Subscription Required" errors when a storage engine (HDHomeRun SERVIO) is the only DVR authorized device
  • Remove specific tuner/storage distinction from device discovery to allow for devices that are both types (HDHomeRun SCRIBE)
Downloads: Release History:
Last edited by djp952 on Thu Sep 12, 2019 8:17 pm, edited 12 times in total.

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

Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 » Sun Mar 17, 2019 8:41 pm

Next Version - Version 2.3.1 - September, 2019
  • Fix potential for a race condition in background task scheduler when synchronously executing a task
Development Backlog
  • Rework the PVR startup logic. Don't use the "startup" task anymore, wait for Kodi to actually ask for data (Channels, Recordings, etc) and spin off the periodic discovery for each type at that point
  • Figure out something to deal with live streams when multiple RECORD engines are available to use - especially if one goes offline. Current implementation will fail on first attempt and ultimately fall back to a tuner-direct stream
  • Use a pop-up message if the discovery data indicates that a firmware update is available for any given device to prompt the user to upgrade their component(s).
  • Cache recording last played position for the most recently queried series to limit the amount of round trips to the RECORD engine(s)
Last edited by djp952 on Mon Sep 16, 2019 7:01 pm, edited 59 times in total.

ddejager
Posts: 111
Joined: Tue May 06, 2014 2:26 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by ddejager » Mon Mar 18, 2019 2:57 pm

Regarding your comment in the prior thread:
- Clear all device authorization codes at startup. To help users with transient network issues I don't clear/reset the device information if no devices were found. The problem here is that if it's been more than 24 hours, the stored device authorization code(s) won't work anymore, so accessing the backend will just fail. My idea is that by clearing the codes at startup I can prevent backend queries from occurring until the devices are properly refreshed, but you can still use your Live and Recorded TV based on the cached data. For 99% of everyone there would be no difference at all, it's the 1% of you that I worry about. I think if I do this I need to send device discovery into a tighter loop, like retry every minute or something until it works.

You may have added this for me...my tuner is on the other end of a 3 mile wireless link where I can put an antenna that gets a signal. The link occasionally goes down. My recordings are stored locally, not by the antenna. I have another friend with a similar configuration, but his recordings are stored at the antenna site. Will your new strategy cause a problem? Perhaps you only want to reset the device info if it is more than 20 hours old?

Thanks for all you do!

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 » Mon Mar 18, 2019 7:39 pm

ddejager wrote:
Mon Mar 18, 2019 2:57 pm
Regarding your comment in the prior thread:
- Clear all device authorization codes at startup. To help users with transient network issues I don't clear/reset the device information if no devices were found. The problem here is that if it's been more than 24 hours, the stored device authorization code(s) won't work anymore, so accessing the backend will just fail. My idea is that by clearing the codes at startup I can prevent backend queries from occurring until the devices are properly refreshed, but you can still use your Live and Recorded TV based on the cached data. For 99% of everyone there would be no difference at all, it's the 1% of you that I worry about. I think if I do this I need to send device discovery into a tighter loop, like retry every minute or something until it works.

You may have added this for me...my tuner is on the other end of a 3 mile wireless link where I can put an antenna that gets a signal. The link occasionally goes down. My recordings are stored locally, not by the antenna. I have another friend with a similar configuration, but his recordings are stored at the antenna site. Will your new strategy cause a problem? Perhaps you only want to reset the device info if it is more than 20 hours old?

Thanks for all you do!
Yup! I've been dragging my feet on the next version specifically to not mess you up :) I had thought about adding a timestamp to the device discovery, and I like the proposed 20 hour window as well. Based on how it's been working out so far that should be pretty reasonable to do and would solve the problem I'm trying to solve (don't send bad DeviceAuth codes if possible). Great suggestion!

I think that's about as far as I will go for v1.4, stopping shy of actually blocking 'unauthorized' operations. It will have the necessary groundwork laid for that and the new API call to verify the DVR subscription, so it will be logged now. I'll deal with the rest incrementally. The PVR appears to be really stable right now, trying to avoid change for the sake of change!

Skyecairns
Posts: 38
Joined: Sun Jul 22, 2018 6:58 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Skyecairns » Wed Mar 20, 2019 5:56 am

I'm trying to record the same show on different channels at different times. If I add timer for first channel and "Record Series" all is fine but if I do the same thing on channel 2 Add timer-Record Series then the channel 1 info disappears on the guide. My work around is record the show individually on the second channel. Am I doing something wrong? Thanks for any help.

Ken.F
Posts: 2137
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 » Wed Mar 20, 2019 6:42 am

Skyecairns wrote:
Wed Mar 20, 2019 5:56 am
I'm trying to record the same show on different channels at different times. If I add timer for first channel and "Record Series" all is fine but if I do the same thing on channel 2 Add timer-Record Series then the channel 1 info disappears on the guide. My work around is record the show individually on the second channel. Am I doing something wrong? Thanks for any help.
The DVR engine is designed to do series recordings from all channels or from only one single channel. When you add the timer set it to record series and change the channel number to "any channel" and it should record airings from both channels.

Skyecairns
Posts: 38
Joined: Sun Jul 22, 2018 6:58 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Skyecairns » Wed Mar 20, 2019 10:01 am

Thanks Ken that did the trick. :-))

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 » Thu Mar 28, 2019 4:04 pm

Question for those watching this thread, is anyone seeing missing data here and there (I think EPG would be most noticeable) and/or log messages that state "malformed JSON (1)" coming from the PVR?

I'm getting this on the ODROID C2 with the EPG once every couple days, and have been getting it in the v1.4.0 in-progress version during startup discovery (which doesn't do the EPG) occasionally. I've shored up the logging for the startup discovery to know which part is getting it, and have set a trap for it here so I'll find it eventually. The problem with most discovery tasks is that if they fail they just leave whatever was in the database in there and only log the failure, so I think the lionshare of the time this would go unnoticed.

Just wondering if this is causing anyone any grief since v1.4.0 is still a ways off. If it is indeed problematic I can issue a v1.3.14 if/when I find the cause.

edit: Turns out my main HTPC has a handful of these logged, I think I have an idea of what's happening. I believe an error on the connection used for the pipelined HTTP requests for the EPG data leaves cURL in a temporarily bad place. The connection is probably being reused by cURL for the subsequent device discovery that an EPG error will trigger, and it fails too. After that it works again. If anyone has these errors in their logs and can corroborate, it would be appreciated. I think I just need to be sure to clear out the HTTP connection(s) on any errors like this.

edit 2: Breaking up the pipelined and non-pipelined connections appears to have resolved the issue. I'll keep monitoring. I'm also adding a connection reset if something goes wrong on the pipelined requests, which should help it succeed when it retries if the problem was transient. EPG requests are retried once after refreshing the device authorization code(s) in case stale authorization is the issue.

Again, let me know if this is being a problem for you on v1.3.13, these changes can be made to that version as needed.

jhford
Posts: 80
Joined: Mon May 21, 2018 3:56 pm

DRM

Post by jhford » Sun Mar 31, 2019 9:22 pm

Will DRM content ever be available?

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

Re: DRM

Post by djp952 » Mon Apr 01, 2019 10:10 am

jhford wrote:
Sun Mar 31, 2019 9:22 pm
Will DRM content ever be available?
This is extremely unlikely. It would require a custom, certified, version of everything involved, including Kodi itself. Kodi added some support for decryption in Leia, but not the kind needed here.

It's so unlikely that the answer is probably best left at "no". But you never know what somebody with tens of thousands of dollars to throw at CableLabs might be working on somewhere!

Rickt1962
Posts: 135
Joined: Tue Dec 01, 2015 2:17 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Rickt1962 » Fri Apr 05, 2019 10:41 am

Well I am back LOL I was using Raspberry Pi-3 OSMC 17.6 Zoltan HDhomerun addon and noticed audio is out of sync on channel 247 which is Antenna TV on Comcast so to check if its Comcast I used my WMC to see if it works and on WMC-7 the audio is fine. Next test I used your zuki.pvr.hdhomerundvr-raspbian-armhf-krypton-1.3.13.6982 to see if it works and same thing audio is out of sync so both addons are doing the same. So its not only you Zoltan has the same problem

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 » Fri Apr 05, 2019 6:17 pm

Rickt1962 wrote:
Fri Apr 05, 2019 10:41 am
Well I am back LOL I was using Raspberry Pi-3 OSMC 17.6 Zoltan HDhomerun addon and noticed audio is out of sync on channel 247 which is Antenna TV on Comcast so to check if its Comcast I used my WMC to see if it works and on WMC-7 the audio is fine. Next test I used your zuki.pvr.hdhomerundvr-raspbian-armhf-krypton-1.3.13.6982 to see if it works and same thing audio is out of sync so both addons are doing the same. So its not only you Zoltan has the same problem
Both this PVR and Zoltan's use Kodi (ffmpeg) for all decoding/demuxing of the streams. I've seen a couple Issues on the Kodi GitHub about similar problems (https://github.com/xbmc/xbmc/issues). Unfortunately Krypton development has ceased beyond version 17.6, so it's going to be hard to get any type of resolution to it on that baseline, at least from Kodi. OSMC may be able to help.

Your best bet here is probably the Kodi/OSMC forums, my understanding of ffmpeg is very limited. It's possible without a DVR account to record from the HDHomeRun tuners, having a sample of the raw stream will likely be needed as well for somebody to be able to triage the problem.

Sorry I don't think I can be of much help to you on this one. The PVR addon is a go-between, it takes the data from the tuner and hands it to Kodi/OSMC unmodified. What Kodi/OSMC does with it … above my pay grade :)

Good luck! I wish I had a better answer.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 » Fri Apr 05, 2019 7:20 pm

I swear, one of the hardest things to do is to come up with meaningful error messages.

Version 2.0.0 will be indeed be blocking access to functions that add/delete/remove Timers if you don't have any DVR service authorized tuners. It won't work anyway, I thought it would be better to tell you nicely than make you scour through Kodi logs just to find out why it didn't work.

Below is the message I came up with, you wouldn't believe how much time I spent on this. Is this clear and concise enough? It probably won't translate well for non-English users, but I can only do so much about that, the only other language I can speak is French, and using the word "speak" is a stretch :)

Image

Rickt1962
Posts: 135
Joined: Tue Dec 01, 2015 2:17 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Rickt1962 » Sat Apr 06, 2019 5:19 am

Thank you for the info ! It make sense I will pass it on to OSMC

Post Reply