(OLD) Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Kodi Community Development

Moderator: TVJunkie198

Locked
jasonl
Silicondust
Posts: 14600
Joined: Sun Oct 28, 2007 9:23 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by jasonl » Tue Oct 02, 2018 3:33 pm

djp952 wrote:
Thu Sep 27, 2018 4:09 pm
The HTTP discovery not listing a RECORD engine has been such a problem all along for many people (still unsure why that would be), so my idea here is to finally just deal with it. It wouldn't be hard to just execute a test broadcast discovery and see if that found a RECORD engine, and switch you over to that mechanism automatically.
Usually happens if the record engine is running on a Windows PC and the StorageID doesn't get set. Uninstalling and reinstalling the HDHomeRun software will fix it.

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by djp952 » Tue Oct 02, 2018 5:41 pm

jasonl wrote:
Tue Oct 02, 2018 3:33 pm
djp952 wrote:
Thu Sep 27, 2018 4:09 pm
The HTTP discovery not listing a RECORD engine has been such a problem all along for many people (still unsure why that would be), so my idea here is to finally just deal with it. It wouldn't be hard to just execute a test broadcast discovery and see if that found a RECORD engine, and switch you over to that mechanism automatically.
Usually happens if the record engine is running on a Windows PC and the StorageID doesn't get set. Uninstalling and reinstalling the HDHomeRun software will fix it.
Thank you Jason! I will be sure to suggest this as the proper remedy rather than switching over to UDP discovery. I'll hold off on making any changes in this regard, I assume SD would prefer the modern HTTP API be used whenever possible.

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by djp952 » Tue Oct 02, 2018 5:50 pm

Minor news for Leia for you guys, I submitted a small PR for Kodi that looks like it will be approved for inclusion soon. This is a minor tweak that will assist with making the Record Series and Record Once Timer Rules behave the same way.

Today, if you want to delete a "Record Once" rule, you have to go into Timers (not Timer Rules), find the timer, right-click and select "Delete Timer Rule". I made it so regular "Delete" also works there, but that's irrelevant :) Moving forward, both the Record Once and Record Series rules will be the same, you go into Timer Rules and delete it from there. It's a tiny thing, but having both rule types behave the same way definitely helps.

signcarver
Expert
Posts: 8469
Joined: Wed Jan 24, 2007 1:04 am
Device ID: 131B34B7 13231F92 1070A18E 1073ED6F 15300C36

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by signcarver » Tue Oct 02, 2018 6:09 pm

djp952 wrote:
Tue Oct 02, 2018 5:41 pm
jasonl wrote:
Tue Oct 02, 2018 3:33 pm
djp952 wrote:
Thu Sep 27, 2018 4:09 pm
The HTTP discovery not listing a RECORD engine has been such a problem all along for many people (still unsure why that would be), so my idea here is to finally just deal with it. It wouldn't be hard to just execute a test broadcast discovery and see if that found a RECORD engine, and switch you over to that mechanism automatically.
Usually happens if the record engine is running on a Windows PC and the StorageID doesn't get set. Uninstalling and reinstalling the HDHomeRun software will fix it.
Thank you Jason! I will be sure to suggest this as the proper remedy rather than switching over to UDP discovery. I'll hold off on making any changes in this regard, I assume SD would prefer the modern HTTP API be used whenever possible.
I would not consider that the proper remedy considering all else that can go wrong with http discovery (such as running a vpn or anonymizer on the system hosting the engine). ANY APP that is on the local Network should use BROADCAST DISCOVERY PERIOD not ever http discovery. That is for use only when needed by a "browser"

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by djp952 » Tue Oct 02, 2018 8:25 pm

signcarver wrote:
Tue Oct 02, 2018 6:09 pm
djp952 wrote:
Tue Oct 02, 2018 5:41 pm
jasonl wrote:
Tue Oct 02, 2018 3:33 pm

Usually happens if the record engine is running on a Windows PC and the StorageID doesn't get set. Uninstalling and reinstalling the HDHomeRun software will fix it.
Thank you Jason! I will be sure to suggest this as the proper remedy rather than switching over to UDP discovery. I'll hold off on making any changes in this regard, I assume SD would prefer the modern HTTP API be used whenever possible.
I would not consider that the proper remedy considering all else that can go wrong with http discovery (such as running a vpn or anonymizer on the system hosting the engine). ANY APP that is on the local Network should use BROADCAST DISCOVERY PERIOD not ever http discovery. That is for use only when needed by a "browser"
If libhdhomerun provided the same information as the HTTP API I would agree. But it does not. I could cite a couple differences based on just my own hardware, but the main relevant one to me is that libhdhomerun does not provide the StorageID for the RECORD engine, which IIRC in a recent post you indicated should be used to de-deduplicate the user error of installing and running multiple RECORD engines on their network (I don't do that in this PVR, but probably should).

In the specific case of StorageID, this information can be gleaned by a follow-up request to the discovery URL of the provided IP address(es), and that is being done today when the user has enabled UDP. My concern is information that cannot be gleaned with such a follow-up request. Again using my specific hardware as the example, a HDHomeRun EXTEND device will not report the "Transcode" flag via it's discovery URL. If this information was relevant to the client, a UDP discovery will not be sufficient nor will a follow-up to the discovery URL. I actually have intention to use the "Transcode" flag sometime in the future, for what it's worth. I must assume that any other 'new' device attributes added by SiliconDust in the future will also only be accessible via the HTTP API.

I do not own every possible HDHomeRun device available on the market (far from it), and there is no public documentation that I am aware of that would provide a list of the deltas between the HTTP API and UDP broadcast API, and/or how to get those deltas using UDP. Given that libhdhomerun has been generally dormant for quite some time combined with a lack of public direction/documentation from SiliconDust in regard to modern third party application device discovery, my intention is to continue on the path that has worked the best for the majority of users, and take their feedback as the most important reason to make a potentially breaking change.

Besides, do we know if devices on a different subnet are listed and discoverable from the HTTP API? I would imagine they are, and as long as there is a route to that IP from the client they should also be accessible. I haven't tried this myself, but we definitely know that a UDP broadcast isn't going to find such a device :)

I truly appreciate your input and considerations as always, please don't take my contrary response as evidence against that :) In this specific case I just happen to disagree and intend to ignore you - lol! :mrgreen:

Chronoptic
Posts: 11
Joined: Fri Sep 21, 2018 6:53 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by Chronoptic » Thu Oct 04, 2018 6:53 am

djp952 wrote:
Tue Oct 02, 2018 8:25 pm
I truly appreciate your input and considerations as always, please don't take my contrary response as evidence against that :) In this specific case I just happen to disagree and intend to ignore you - lol! :mrgreen:
AH HAHAHAHA! You kill me :lol: So refreshing to see a sense of humor! Now, I have a thought about the stalled stream issue. I posted my log on the kodi forum but haven't had any replies. I was wondering, since a simple click of the "fast forward" button seems to bring the stream back to normal, would it be possible to have kodi do that after every channel change (instead of me actually having to move my thumb an entire centimeter ;) )? I know that's pretty ugly, but it would temporarily fix the issue.

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by djp952 » Fri Oct 05, 2018 7:36 pm

Chronoptic wrote:
Thu Oct 04, 2018 6:53 am
djp952 wrote:
Tue Oct 02, 2018 8:25 pm
I truly appreciate your input and considerations as always, please don't take my contrary response as evidence against that :) In this specific case I just happen to disagree and intend to ignore you - lol! :mrgreen:
AH HAHAHAHA! You kill me :lol: So refreshing to see a sense of humor! Now, I have a thought about the stalled stream issue. I posted my log on the kodi forum but haven't had any replies. I was wondering, since a simple click of the "fast forward" button seems to bring the stream back to normal, would it be possible to have kodi do that after every channel change (instead of me actually having to move my thumb an entire centimeter ;) )? I know that's pretty ugly, but it would temporarily fix the issue.
Unforunately, the PVR addon has zero control over the Kodi UI. Kodi provides a number of callback functions that you have to implement, and it calls you when it wants. There are some things you can do, like say "hey Kodi I've got new Recordings for you", but nothing that comes even close to that. Sorry :(

Funny thing with the Shield, though, I recall a while back there was a problem with the Shield game controller sending random UI navigation events when the batteries were low, one guy put the controller in the trunk of his car to stop it :mrgreen: Perhaps we could try some nearly spent batteries and the Shileld would do this for us automatically!! ha

Seriously, though, I wish there was something I could do for you guys, but it looks like we are stuck until Kodi gets it sorted out. They just shipped Beta 3 and updated the source tags for the next version to "RC1", so they should be buckling down and fixing as many bugs as they can soon.

When I get back from my trip (next post), if no progress has been made I can build Android Kodi from scratch and get a debugger attached to it somehow, maybe I can help them in some way -- this PVR is pretty much feature complete and ready for Leia, there isn't anything pressing to work on that I am aware of.

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by djp952 » Fri Oct 05, 2018 7:42 pm

Status update for you guys, since I will be disappearing for about a week on you again for another business trip.

I've gotten a couple pull requests submitted and accepted for Leia in regard to Timers that helps me clean up some of the weirdness there. I have one more really small one I'm going to try and work up tonight, but it's almost entirely cosmetic so it's no big deal. There is no Leia build out there yet with both PRs in it, so no updated Leia tonight. I can build something next week to catch up from the hotel, a simple rebuild doesn't need much testing, which is good because they don't have HDHomeRuns in the rooms last I checked :)

So have a great weekend everyone! I'll check in with ya soon!

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by djp952 » Fri Oct 12, 2018 8:27 pm

ringerlin wrote:
Fri Sep 28, 2018 10:32 pm
First, thank you again for working so hard improving this addon.
Recently, I've been trying to figure out a way to remotely manage the recording tasks while I'm away. I found Yatse remote app on Android seems to be a good tool. It does work fine for recording a live program. However, if I try to add a timer, it always pick the wrong channel. After contacting Yatse customer service, they gave me the following answer:
"Yes it appears there's a know bug / limitation in Kodi about that. API does not allow to select channels only program ID and they are not unique :( Won't be fixed before v19 so you need to ask your PVR addon author to ensure IDs are unique until they fix it."

So is this something that can be improved in the future? I don't have to remotely manage the recording very often. But this is going to be a very handy feature for folks who need to travel a lot.
Thank you.
Hi ringerlin! I have an update on this issue for you. It turns out that until Kodi 19, the JSON RPC interface isn't required to specify a channel identifier, it only specifies a field called a Broadcast ID. In this PVR, I am using the start time of the program as the Broadcast ID, so it would appear that Kodi is going to select an arbitrary program to record that has the same start time as the one you ask for.

I could in theory change the Broadcast ID field to be unique for each entry in the EPG, but it's not quite that simple. This is a 32-bit value and it so happens I already use a 32-bit value just to encode a channel identifier to give us a range from channel 0.0 through channel 4095.1048575. While that may seem excessive, trimming off a little still isn't going to enough to allow me to embed both the channel ID and the start time in a single 32-bit value.

What I'm thinking here is that I could use a hash of the channel id and the start time instead. I need to do some playing around with it, and it would cause a bump to version 1.4 (no big deal), but if it works out I think it will solve your problem with Yatse.

More info as I have it!

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by djp952 » Sat Oct 13, 2018 9:17 pm

Because it's a slow night ...

Version 1.3.5 (2018.10.13)
  • Update SQLite database engine to version 3.25.2
  • Automatically delete and recreate the PVR database if any exceptions occur opening it during startup
  • Fix bug causing internal exception when trying to poke the HDHomeRun RECORD engine after deleting a recording rule
  • Change EPG broadcast identifier values to be based on a hash of the channel and program start/end times
Downloads:
https://github.com/djp952/pvr.hdhomerun ... /Downloads

(Leia pre-release is here: https://github.com/djp952/pvr.hdhomerun ... leia-1.3.5) **
** Requires a recent Leia nightly build that supports PVR API 5.10.3 - Beta 3 will not work!!

The main change here is the alteration to how the "Broadcast ID" is generated for Kodi. To support a known limitation in the Kodi JSON RPC interface that causes problems with external remote control programs like "Yatse". The JSON RPC interface won't require sending in the channel number until Kodi 19 for things like timer requests, so Kodi would often pick the wrong thing based on this "Broadcast ID". What I did was change to using a hash of the channel number and the start/end times to give a much more unique identifier for "Broadcast ID" across the entire EPG, so external programs are almost certain to get the exact thing they are looking for. I don't anticipate or detected any problems with existing EPG data already in Kodi, but if you want to be absolutely certain you should clear Guide Data in Kodi after installing this.

There are also a handful of non-listed Leia changes that coordinate the PVR with the pull requests I made to Kodi. In essence all they do is make "Record Once" and "Record Series" timers and timer rules behave the same. Explaining the differences is more of a wiki documentation thing, but if you aren't sure what's going on here now let me know and I'll explain here. Updating the wiki for Leia is still premature IMO since it's a pre-release, but it has to be done at some point.

Pretty unremarkable release overall, just wanted to get it out to "fix" the remote control apps since the solution seems solid enough for prime-time. Have fun, watch lots of TV!!

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

Slow import of guide data

Post by ddejager » Sun Oct 14, 2018 4:19 pm

Importing guide data seems to have gotten much slower in the past few days with either 1.3.4 or 1.3.5. It does import but seems to take almost 5x as long. Any ideas why? It happens with either firestick or RPi on multiple networks (different locations).

cjwalkeriii
Posts: 7
Joined: Sun Oct 14, 2018 6:14 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by cjwalkeriii » Sun Oct 14, 2018 6:20 pm

Question.. and sorry if this has been covered, I glanced through and didn't see anything.
I am using this add-on on all of raspberry pi's with a paid subscription to the dvr service through SD. I like everything about it.
Now I want to get away from paid cable through Verizon using my prime. If I use SD's premium package with a Quattro, will this add-on still work?
I don't want to go back to using the standard hd app.
Btw - using Libreelec 8.2.5. Tried using 9.x but it doesn't appear this is supported yet.
thanks

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

Re: Slow import of guide data

Post by djp952 » Sun Oct 14, 2018 7:50 pm

ddejager wrote:
Sun Oct 14, 2018 4:19 pm
Importing guide data seems to have gotten much slower in the past few days with either 1.3.4 or 1.3.5. It does import but seems to take almost 5x as long. Any ideas why? It happens with either firestick or RPi on multiple networks (different locations).
Nothing I can think of other than the backend service may be running a little slower. You could try clearing the Guide data in the Kodi PVR settings, but then of course you have to sit through it at least one more time :) I might wait until tomorrow when SD is back in the office, they may notice the problem and correct it.

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by djp952 » Sun Oct 14, 2018 7:55 pm

cjwalkeriii wrote:
Sun Oct 14, 2018 6:20 pm
Question.. and sorry if this has been covered, I glanced through and didn't see anything.
I am using this add-on on all of raspberry pi's with a paid subscription to the dvr service through SD. I like everything about it.
Now I want to get away from paid cable through Verizon using my prime. If I use SD's premium package with a Quattro, will this add-on still work?
I don't want to go back to using the standard hd app.
Btw - using Libreelec 8.2.5. Tried using 9.x but it doesn't appear this is supported yet.
thanks
It should. I don't have a Quattro so I can't guarantee it, but this PVR is known to work with the Premium TV channels from SD on other tuners. My only OTA device I can test with is an older EXTEND unit. However, I've seen no specific complaints or issues with Premium TV through this PVR.

For what it's worth, Libreelec 9 should work unless it's on a funky architecture that might need a different build. What type of error did you run into? If you got something about the PVR API version being wrong, the latest Leia build from me requires a very recent Kodi build, within the last week or so. You could try a back-level version of the PVR like 1.3.4 for Leia (I don't recommend going back farther than 1.3.4 on Linux, there was a long standing bug that you don't want to run into!)

All builds from 1.0.0 through 1.3.5 are available here: https://github.com/djp952/pvr.hdhomerundvr/releases. Just scroll down to find Leia 1.3.4 if you need/want it!

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by ddejager » Mon Oct 15, 2018 6:54 am

cjwalkeriii wrote:
Sun Oct 14, 2018 6:20 pm
Question.. and sorry if this has been covered, I glanced through and didn't see anything.
I am using this add-on on all of raspberry pi's with a paid subscription to the dvr service through SD. I like everything about it.
Now I want to get away from paid cable through Verizon using my prime. If I use SD's premium package with a Quattro, will this add-on still work?
I don't want to go back to using the standard hd app.
Btw - using Libreelec 8.2.5. Tried using 9.x but it doesn't appear this is supported yet.
thanks
You should be able to see the demo channels without paying to verify. I use this addon on RPi using OSMC with a Quattro and it works. I've not tried with Libreelec, but in the past Libreelec functioned just as OSMC on RPi for me.

Locked