Unofficial Kodi HDHomeRun DVR PVR Client

Kodi Community Development

Moderator: TVJunkie198

Post Reply
djp952
Posts: 958
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 » Wed Aug 28, 2019 4:09 pm

All good information, thank you. Based on your logs it still appears that Kodi isn't sending the proper data. I didn't really hammer it, I was expecting a quick failure.

Therefore I shall break out my hammer and hit it much harder! Dead blow hammers are especially good at breaking things lol

djp952
Posts: 958
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 » Wed Aug 28, 2019 8:50 pm

ddejager wrote:
Wed Aug 28, 2019 7:57 am
edit: I couldn't duplicate this on Windows or Android (nVidia Shield) -- which version of Firestick are you using? I want to try to compare apples to apples for you.
I'm using a Firestick 4K. Today when I tried it with the identical recording, it did restart successfully twice and then failed. I'm wondering if there is some timing problem or an issue with retries: I recently moved my WD NAS (where recording takes place) to be co-located with my tuner (on the other end of a long wireless link on a hill where I can get OTA reception). I did this because I wanted recordings to not be affected by wireless drop-outs. It definitely works better for me since I can backup the playback if there is a dropout, rather than have the recording corrupted.

I don't think the problem is related to the Firestick. I also have a Raspberry Pi running OSMC that has the same problem.

I've also discovered that if I wait longer before the restart attempt and retry it will sometimes work without restarting Kodi (but not always, that is, sometimes the only way to get it to play again is to restart Kodi (or OSMC). Another tidbit....if I switch to a different recording I can start it, but going back to the original it still will not start....it is almost as if either in the HDHomeRun recording software or in the Kodi software the state has somehow been corrupted for that recording. Since restarting Kodi "solves" the problem, I suspect the problem is in Kodi or the PVR Client.

edit: More info play from the beginning also fails once a recording gets into this state and the state seems to be on a recording basis. I can get multiple recordings in the state at the same time on the same device. When "stuck" on one device, I can still play it on another device...further indication that the problem is not in the HDHomeRun recording software.
Thank you again for all of the additional details; based on that information I have located the problem and it's something I can fix in the PVR, perhaps as early as tomorrow.

At some point during execution (that I ultimately didn't find, nor do I need to find now) Kodi reprocesses the "FileItem" URL it gets from the UI and strips off any query strings that happen to be present in that URL. What I have always done to date is hand off the complete "Command URL" for a recording back to Kodi as the Recording ID, which exists as part of the HTTP GET query string (id=xxxxxxxx). When this Recording ID is reprocessed by Kodi (again, I don't know exactly where), the query string portion of the URL is being stripped off at the point where it begins (string ("?")), and this ultimately leads to the defect you have found.

I need to make some non-trivial modifications to the routine that sets the "last played position", but everything seems to work as expected again, I can start/stop and resume Recorded TV just fine without running into this issue.

I will target tomorrow for a formal build to resolve this concern, but "s*** happens", it may be more like 48-72 hours :)

jbinkley60
Posts: 21
Joined: Wed Aug 22, 2018 11:29 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by jbinkley60 » Thu Aug 29, 2019 1:33 am

I believe this is a Kodi bug which started with v18. I am seeing similar behavior on another Kodi addon. It's the same behavior where things are being lost when you start / stop a video. They include the last play position indicator, watch flag etc... I believe it is related to this bug report https://github.com/xbmc/xbmc/issues/16206. On the Kodi addon I was seeing the issue I added a container refresh command to resolve. You can see them in the last line below when playback is stopped or the end of the video is reached:

def onPlayBackEnded(self):
xbmc.log("Playback ended - LED OFF")
xbmc.executebuiltin('Container.Refresh()')

def onPlayBackStopped(self):
contenturl = settings('contenturl')
xbmc.log("contenturl " + contenturl)
end = file.rfind('/') + 1
objectID = file[end:]
xbmc.log("Playback stopped at " + str(pos) + " in " + objectID)
bookmark.SetBookmark(contenturl, objectID, str(pos))
xbmc.executebuiltin('Container.Refresh()')

Not sure if this will help but thought I'd share. If I roll back to Kodi 17.6 the problem does not exist.

djp952
Posts: 958
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 Aug 30, 2019 2:14 pm

That looks like the place to me! The value I have been using for a "Recording ID" is actually a URL from the recording metadata. It's being passed around as part of another URL internally within Kodi and the query string portion of my URL is getting stripped out, so it stops matching anything.

I'm now pre-processing that URL to generate the recording id, so it's just a small hex number now. It appears to have resolved the problem for this addon, at least :)

I have to port the change to Krypton and test a few things, but it will be out tonight for you guys if I can get a spare hour to do it! There should be no concerns with compatibility so it will be v2.2.2. Kodi always reloads the recordings at startup and when it updates a PVR addon, so everything will just magically use the new identifiers even if the recording data itself is stale for any reason. I think. lol.

djp952
Posts: 958
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 Aug 30, 2019 3:25 pm

It's not a big one by any means, but it should help a few folks out ...

Version 2.2.2 (2019.08.30)
  • Restore shortened channel group names "HD channels, "SD channels", "Favorite channels", and "Demo channels"
  • Treat "News" Recorded TV category mapping as "Series"; avoids creation of "News" folder in Recorded TV
  • Change recording identifier values to work around Kodi issue where attempting to play a recording multiple times may fail
Downloads: Auto-update manifests for Leia have been pushed to the repository, as always it may take your Kodi a day or two to go find it on it's own.

I was annoyed by my ill-conceived change to the Channel Group names, they were too long for the EPG UI, so those were put back. By popular request you won't see any "News" category in Recorded TV anymore, "News" programs will be treated like a normal series and appear in a folder based on the series name. And the most recent issue being discussed -- I changed how the recording identifiers work so that Kodi Leia won't eat them and cause an inability to play a recording multiple times without restarting Kodi.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by ddejager » Sun Sep 01, 2019 1:30 pm

Thanks for 2.2.2! Restarting a paused recording seems to always work now.

djp952
Posts: 958
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 » Sun Sep 01, 2019 3:58 pm

ddejager wrote:
Sun Sep 01, 2019 1:30 pm
Thanks for 2.2.2! Restarting a paused recording seems to always work now.
No problem -- thank you for reporting the problem and providing just the right amount of bread crumbs to track it down!

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by jhford » Tue Sep 03, 2019 4:28 pm

djp952 wrote:
Fri Aug 30, 2019 3:25 pm
It's not a big one by any means, but it should help a few folks out ...

Version 2.2.2 (2019.08.30)
  • Restore shortened channel group names "HD channels, "SD channels", "Favorite channels", and "Demo channels"
  • Treat "News" Recorded TV category mapping as "Series"; avoids creation of "News" folder in Recorded TV
  • Change recording identifier values to work around Kodi issue where attempting to play a recording multiple times may fail
Downloads: Auto-update manifests for Leia have been pushed to the repository, as always it may take your Kodi a day or two to go find it on it's own.

I was annoyed by my ill-conceived change to the Channel Group names, they were too long for the EPG UI, so those were put back. By popular request you won't see any "News" category in Recorded TV anymore, "News" programs will be treated like a normal series and appear in a folder based on the series name. And the most recent issue being discussed -- I changed how the recording identifiers work so that Kodi Leia won't eat them and cause an inability to play a recording multiple times without restarting Kodi.
The Android Krypton Arm version link has an error making downloading impossible.

djp952
Posts: 958
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 » Tue Sep 03, 2019 5:49 pm

OK. It looks like the ARM APK didn't upload. I have to rebuild that and will post it using the same version number.

edit: I still had the file locally, it's been uploaded. It was weird, actually, the file was technically there but there was some error with it. Deleting and re-adding it seems to have worked.

https://github.com/djp952/pvr.hdhomerun ... 2.7181.apk

starslayer74
Posts: 11
Joined: Thu Jul 06, 2017 2:50 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by starslayer74 » Sat Sep 07, 2019 12:47 pm

I'm having an issue, I read through the forum but I can't figure out why it isn't working.

I have version 2.2.2, ARM64 version, I'm running on my Nvidia Shield TV. I have a Servio that I just added and I can record and schedule recordings from the official app but when I try to record from the Kodi PVR addon, I'm getting the following error: "Timer operations require an active HDHomerun DVR Service subscription"

Any thoughts on what I'm doing wrong? Do I not have the latest version?


Edit: I also installed the windows version on my laptop to see if I could get it working there, and I'm getitng the same error message, that is a fresh clean Kodi install running on the laptop with literally nothing else added on to it.

djp952
Posts: 958
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 » Sat Sep 07, 2019 2:01 pm

Are you able to schedule recordings via the official HDHomeRun app? I'm not in front of a PC right now but if the PVR can't verify that you have a subscription it won't allow you to modify timers.

It could be a backend change/temporary issue or there could legitimately be something wrong with your DVR subscription.

Trying the official app should help, I can verify everything is working right when I get home.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by signcarver » Sat Sep 07, 2019 2:18 pm

One thing I can think of is a Servio also has a DeviceAuth even though it is a Storage engine and does not have tuners so perhaps the tuner isn't returning the DvrActive.

For troubleshooting I would also try to switch discover methods.

Edit: also what model is your tuner as legacy models aren't supported by the DVR (you said you can record so this shoudn't be an issue)
Last edited by signcarver on Sat Sep 07, 2019 2:23 pm, edited 1 time in total.

starslayer74
Posts: 11
Joined: Thu Jul 06, 2017 2:50 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by starslayer74 » Sat Sep 07, 2019 2:22 pm

djp952 wrote:
Sat Sep 07, 2019 2:01 pm
Are you able to schedule recordings via the official HDHomeRun app? I'm not in front of a PC right now but if the PVR can't verify that you have a subscription it won't allow you to modify timers.

It could be a backend change/temporary issue or there could legitimately be something wrong with your DVR subscription.

Trying the official app should help, I can verify everything is working right when I get home.
Yes, I can record things properly with the official app, both scheduled and recorded live.

starslayer74
Posts: 11
Joined: Thu Jul 06, 2017 2:50 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by starslayer74 » Sat Sep 07, 2019 2:32 pm

signcarver wrote:
Sat Sep 07, 2019 2:18 pm
One thing I can think of is a Servio also has a DeviceAuth even though it is a Storage engine and does not have tuners so perhaps the tuner isn't returning the DvrActive.

For troubleshooting I would also try to switch discover methods.

Edit: also what model is your tuner as legacy models aren't supported by the DVR (you said you can record so this shoudn't be an issue)
I have the HDHomerun Prime.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by signcarver » Sat Sep 07, 2019 2:47 pm

To test my theory what i would do is get the DeviceAuth of the prime by retrieving it's discover.json

If there are any special characters it can become tricky as they should be url encoded (i.e. lately I have been getting a / in my auths and that would need to be changed to %2F (many characters don't need to be changed but I usually change anything that isn't a letter or number)

Then go to https://api.hdhomerun.com/api/account?DeviceAuth=xxx
where xxx is your DeviceAuth.

It should return something like your email address and registered devices as well as DvrActive

Post Reply