(OLD) Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Kodi Community Development

Moderator: TVJunkie198

Locked
djp952
Posts: 898
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 Feb 03, 2019 1:02 pm

Ken.F wrote:
Sun Feb 03, 2019 4:56 am
djp952 wrote:
Sat Feb 02, 2019 7:14 pm
YMMV, but I would appreciate your feedback on this if you're on Windows, Android, or OS/X and have the PVR set to auto-update.
I have add-on updates set to manual but I did get a PVR update notification on my HTPC last night (Win7 64, Kodi 18.0). I went to add-ons and updated the PVR from 1.3.10 to 1.3.12. The update completed successfully but while the new PVR version was starting up Kodi froze. I had to get my keyboard out so I could hit ctrl+alt+del to bring up task manager and kill Kodi. When I started Kodi again the PVR started normally and everything was working correctly.
I had a similar experience as well on a Windows 10 system late last night. I think what's happening is that the addon manager in Kodi is on a different thread and isn't waiting for the PVR manager to actually shut down. The PVR is in the middle of something and is being unloaded/destroyed. I opened an issue for myself on GitHub to breakpoint Kodi and see what it's doing so I can work around it. It may take a while. For now the evidence is mounting against allowing auto-update :(

RocketGuy3
Posts: 1
Joined: Sun Feb 03, 2019 6:42 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by RocketGuy3 » Sun Feb 03, 2019 8:13 pm

So I [unkowingly] had Kodi auto-update enabled, and Kodi just updated itself to 18.0... And it broke everything with the HDHR PVR. I tried using the link posted a few posts up to update my PVR client version. The install seemed to be successful, but after restarting my PC and Kodi (for some other updates), I can no longer access my TV recordings or the program guide.

I get an infinite spinner of death from those screens with "PVR manager is starting up: 0%". I'm wondering if it has something to do with the fact that I didn't delete the previous version of the HDHomeRun DVR PVR Client (think I had 1.2.2 or something before).

Anyone have any ideas? Thanks in advance...

EDIT: And if anyone can point me to where I can find app data for Kodi 18, that would be much appreciated as well. Unless I'm losing my mind, it doesn't appear to be in the same place as it was for 17.X. I'm trying to find logs and add-on folders.

EDIT 2: SUCCESS! I got it working. Apparently I just needed to re-open the HDHomeRun setup application and set things up on there... I guess it didn't start properly upon boot up for some reason?

djp952
Posts: 898
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 » Mon Feb 04, 2019 8:19 pm

RocketGuy3 wrote:
Sun Feb 03, 2019 8:13 pm
So I [unkowingly] had Kodi auto-update enabled, and Kodi just updated itself to 18.0... And it broke everything with the HDHR PVR. I tried using the link posted a few posts up to update my PVR client version. The install seemed to be successful, but after restarting my PC and Kodi (for some other updates), I can no longer access my TV recordings or the program guide.

I get an infinite spinner of death from those screens with "PVR manager is starting up: 0%". I'm wondering if it has something to do with the fact that I didn't delete the previous version of the HDHomeRun DVR PVR Client (think I had 1.2.2 or something before).

Anyone have any ideas? Thanks in advance...

EDIT: And if anyone can point me to where I can find app data for Kodi 18, that would be much appreciated as well. Unless I'm losing my mind, it doesn't appear to be in the same place as it was for 17.X. I'm trying to find logs and add-on folders.

EDIT 2: SUCCESS! I got it working. Apparently I just needed to re-open the HDHomeRun setup application and set things up on there... I guess it didn't start properly upon boot up for some reason?
Glad you got it working! The Krypton add-on shouldn't even be able to load on Leia since the versions are all wrong, but the inner workings of Kodi's self-upgrade process can be a little mysterious. Wait until this PVR auto-updates itself (a rather new feature) to see the hell that might bring. That feature may not be long-lived without a deep dive into the aforementioned Kodi update processes, it upgrades at inopportune moments. Nothing unrecoverable so far, but frustrating since this was an oft-requested feature and it's falling on it's face :(

In my experience, the Kodi files should be in the same place Krypton vs. Leia. You didn't mention what platform you are on, but it's possible that the Windows Store version may have switched from Win32 to UWP, which would move everything (I don't use the store version for the very reason of not allowing unwanted updates). I'm pretty sure Android and Linux haven't moved anything, at least not that I've seen.

If you still need help finding the Kodi files, let us know what OS/platform you're on and we can point you in the right direction!

djp952
Posts: 898
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 » Mon Feb 04, 2019 8:40 pm

So far it seems other than the quickly fixed issue with OTA channels, the pipelined EPG updates are working well. I think that leaves the following 3 main issues to look at/address:

- Invalid times being reported by the UI for some users (the more screenshots the merrier here, please!)
- Lacking ability to detect and attempt to overcome network issues
- Audio-only streams die after around 5 seconds (could be a Kodi systemic issue -- happening to many PVR clients)

Interestingly enough, there is a gentleman in the UK that has all three of these issues at the same time, and he has been very helpful and forthcoming with details. Not much progress made yet, but he's given me a ton of information to work through. He's also found a handful of reports on Kodi.tv regarding the 5-second issue, so that may not be the PVR at all.

I'm going to try and knock out some improvements on less-than-perfect network connections first. I found a bug in my code yesterday wherein if a stream has died unexpectedly, I'm still sitting in an endless loop trying to read from it and not returning control to Kodi. I also found that the HTTP library (cURL) is pretty Jason Nesmith in it's "Never give up, never surrender" mentality, you can pretty much set your network on fire and it won't disconnect :D My plan is to come up with a reasonable way to detect when the stream is just gone or has become too unreliable to continue using it, and make at least one attempt to fully disconnect and reconnect it.

Anyway, that's where my head is at right now if anyone was wondering. If you are experiencing pain/difficulty for any different reason please don't hesitate to let me know, ok?

gibxxi
Posts: 4
Joined: Thu May 28, 2015 5:07 am

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by gibxxi » Thu Feb 07, 2019 4:18 pm

djp952 wrote:
Mon Feb 04, 2019 8:40 pm
So far it seems other than the quickly fixed issue with OTA channels, the pipelined EPG updates are working well. I think that leaves the following 3 main issues to look at/address:

- Invalid times being reported by the UI for some users (the more screenshots the merrier here, please!)
- Lacking ability to detect and attempt to overcome network issues
- Audio-only streams die after around 5 seconds (could be a Kodi systemic issue -- happening to many PVR clients)

Interestingly enough, there is a gentleman in the UK that has all three of these issues at the same time, and he has been very helpful and forthcoming with details. Not much progress made yet, but he's given me a ton of information to work through. He's also found a handful of reports on Kodi.tv regarding the 5-second issue, so that may not be the PVR at all.

I'm going to try and knock out some improvements on less-than-perfect network connections first. I found a bug in my code yesterday wherein if a stream has died unexpectedly, I'm still sitting in an endless loop trying to read from it and not returning control to Kodi. I also found that the HTTP library (cURL) is pretty Jason Nesmith in it's "Never give up, never surrender" mentality, you can pretty much set your network on fire and it won't disconnect :D My plan is to come up with a reasonable way to detect when the stream is just gone or has become too unreliable to continue using it, and make at least one attempt to fully disconnect and reconnect it.

Anyway, that's where my head is at right now if anyone was wondering. If you are experiencing pain/difficulty for any different reason please don't hesitate to let me know, ok?
...and I would be said Gentleman.

If there's any users on here, from the UK (or indeed, any EuroZone / DVB-T / DAB country) that is able to test this specific add-on with their OTA service and Kodi 18, and report their experiences, both djp952 and myself would welcome your input, to possibly identify the root cause of the above issue(s).

timecutter
Posts: 15
Joined: Mon Aug 20, 2018 5:12 am

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by timecutter » Sat Feb 09, 2019 8:24 am

Finally looked into the issue with rewind/ff on recordings on CoreElec that cropped up after 1.3.9 Refactor GetStreamTimes(). I pulled down the latest code again this morning and you added a couple of debugging lines that were helpful. It appears that canseek was set to true however the start and end time were the same. On a WAG, I added this line to pvr.cpp on line number 3814 right below where you had set it to: g_stream_endtime = recording.recordingTime + recording.iDuration;

g_stream_endtime = g_stream_starttime + g_dvrstream->length();

built it and now it works but you already know what the issue is now right? It says the stream ends in 2035. Rewind/ff work on live and recordings now. NOTE: Rew/FF on live tv always worked, just recordings had this issue on coreelec.

HDHomeRun DVR PVR Client: OpenRecordedStream: canseek = true
HDHomeRun DVR PVR Client: OpenRecordedStream: length = 4797747968
HDHomeRun DVR PVR Client: OpenRecordedStream: realtime = false
HDHomeRun DVR PVR Client: OpenRecordedStream: starttime = 1549677571 (epoch) = Fri Feb 8 19:59:31 2019 (local)
HDHomeRun DVR PVR Client: OpenRecordedStream: endtime = 2052458243 (epoch) = Mon Jan 15 01:17:23 2035 (local)

I'll keep looking at it some more this morning. *should* be able to get a new working coreelec version out today with the latest code.

UPDATE: added debug output for recording duration log_notice(__func__, ": recordingDuration = ", recording.iDuration); below your existing debug lines and it reports back 0 which would explain why the starttime and endtime matched.

timecutter
Posts: 15
Joined: Mon Aug 20, 2018 5:12 am

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by timecutter » Sat Feb 09, 2019 10:31 am

Working version for CoreElec Kodi 18 users on ARM devices.

zuki.pvr.hdhomerundvr-linux-armhf-leia-1.3.13.6979.zip
https://drive.google.com/file/d/19g54-G ... sp=sharing

Please let me know if you run into any trouble. This is compiled from the latest code so it includes everything that he has been working on. The one minor note is that I made one change to allow rewind/ff to work on recordings that didn't provide their correct duration. If it notices that a recordings duration is set to 0 then it will now falsely tell kodi that it is a 4 hour recording which enables rew/ff. If you pause one of the recordings with the incorrect time (4 hours) then it will show you false time remaining.

I'll keep digging into it later and hopefully djp952 has a better idea on handling this.

djp952
Posts: 898
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 Feb 09, 2019 1:23 pm

timecutter wrote:
Sat Feb 09, 2019 8:24 am
Finally looked into the issue with rewind/ff on recordings on CoreElec that cropped up after 1.3.9 Refactor GetStreamTimes(). I pulled down the latest code again this morning and you added a couple of debugging lines that were helpful. It appears that canseek was set to true however the start and end time were the same. On a WAG, I added this line to pvr.cpp on line number 3814 right below where you had set it to: g_stream_endtime = recording.recordingTime + recording.iDuration;

g_stream_endtime = g_stream_starttime + g_dvrstream->length();

built it and now it works but you already know what the issue is now right? It says the stream ends in 2035. Rewind/ff work on live and recordings now. NOTE: Rew/FF on live tv always worked, just recordings had this issue on coreelec.

HDHomeRun DVR PVR Client: OpenRecordedStream: canseek = true
HDHomeRun DVR PVR Client: OpenRecordedStream: length = 4797747968
HDHomeRun DVR PVR Client: OpenRecordedStream: realtime = false
HDHomeRun DVR PVR Client: OpenRecordedStream: starttime = 1549677571 (epoch) = Fri Feb 8 19:59:31 2019 (local)
HDHomeRun DVR PVR Client: OpenRecordedStream: endtime = 2052458243 (epoch) = Mon Jan 15 01:17:23 2035 (local)

I'll keep looking at it some more this morning. *should* be able to get a new working coreelec version out today with the latest code.

UPDATE: added debug output for recording duration log_notice(__func__, ": recordingDuration = ", recording.iDuration); below your existing debug lines and it reports back 0 which would explain why the starttime and endtime matched.
Nice! Thanks! I would be interested to know why iDuration is zero, that comes from the DVR engine data. I also got your PM - thank you!

One thing to watch out for is that the g_stream_starttime and g_stream_endtime are specified in seconds (time_t - Unix epoch). The length of a recorded stream is specified in bytes.

I'm going to hard-code my iDurations to zero to see this in action. I *think* a slightly better method may be to return PVR_ERROR_NOT_IMPLEMENTED for GetStreamTimes() when this happens and it's a complete recorded stream (has a length() that isn't -1, and realtime() that returns false). I used to just return that for Recorded streams, Kodi can figure it out on it's own as long as the stream is finite. I think if you make ptsEnd too far Kodi will let you try and seek that far into the future. The end result should be benign either way, the stream only goes as far as it goes, but in Leia they seem to have tried to make sure the UI only allows you to try things that will work.

I'm very happy that you have our backs here timecutter! It's greatly appreciated!

There are all kinds of little unreleased goodies in the Leia branch - some from this morning you didn't grab :) Working diligently on figuring out why gibxxi has so many problems, and fixing some things I never even knew were broken. Latest code can even play an MP3 stream if that's what it's been sent. That checkin is less impressive than the amount of work it took to figure out why it couldn't do that to begin with :)

gibxxi
Posts: 4
Joined: Thu May 28, 2015 5:07 am

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by gibxxi » Sat Feb 09, 2019 1:27 pm

It's because I'm cursed m8, aside from being the unluckiest guy in the world.

;)

Dan / Gib.

clarkss12
Posts: 1198
Joined: Sat May 11, 2013 11:51 am
Device ID: 104CBEA5 ;1055A951
Location: Michigan, USA
Contact:

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by clarkss12 » Sat Feb 09, 2019 2:00 pm

Thanks as usual, Timecutter. Installed on Amlogic S912 and S905X boxes running CoreELEC, without a hitch. FF and RW works in recorded and LIVE streams.......... Thanks.

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by Ken.F » Mon Feb 11, 2019 11:04 am

I noticed when I partially watch a recording on my Win7 PC (Leia) it doesn't keep track of where I was in the recording when I stopped playback. If I partially watch a recording on my RPi (Krypton) it does. If go back to to the Leia PC I can resume from where I stopped on Krypton.

djp952
Posts: 898
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 » Mon Feb 11, 2019 5:57 pm

Ken.F wrote:
Mon Feb 11, 2019 11:04 am
I noticed when I partially watch a recording on my Win7 PC (Leia) it doesn't keep track of where I was in the recording when I stopped playback. If I partially watch a recording on my RPi (Krypton) it does. If go back to to the Leia PC I can resume from where I stopped on Krypton.
If you close and reopen Leia, does the resume indicator show up then? The PVR code for this is identical among all versions, but Leia and Krypton handle it differently in the UI. I have no issues here on Windows, but I only typically use the x64 version. I'll try Win32 (x86) and see if that has any issues.

There may need to be a "crazy log" version of this thing for Leia, it's like everyone has different and unique problems :(

FWIW I currently recommend Krypton unless there is a pressing need for something in Leia. If Kodi is just being used for TV and movies, Leia honestly seems like it's more trouble than it's worth right now. Maybe 18.1 will be different.

djp952
Posts: 898
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 » Mon Feb 11, 2019 9:01 pm

Ken.F wrote:
Mon Feb 11, 2019 11:04 am
I noticed when I partially watch a recording on my Win7 PC (Leia) it doesn't keep track of where I was in the recording when I stopped playback. If I partially watch a recording on my RPi (Krypton) it does. If go back to to the Leia PC I can resume from where I stopped on Krypton.
Bug confirmed. Kodi is not calling the function to set the last played position on Leia. I will see what I can do for us, but be advised Kodi 18.1 appears to be "closed" so the fix may have to wait until Kodi 18.2. Depends on how long it takes me to find it and if they accept whatever change I propose to solve it.

edit: It's that new GetStreamTimes() function again, my fault. Will fix.

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by Ken.F » Tue Feb 12, 2019 6:20 am

djp952 wrote:
Mon Feb 11, 2019 9:01 pm
Bug confirmed. Kodi is not calling the function to set the last played position on Leia. I will see what I can do for us, but be advised Kodi 18.1 appears to be "closed" so the fix may have to wait until Kodi 18.2.
No rush. It took this long to notice the bug so apparently we don't stop watching recordings in the middle of the show very often.

djp952
Posts: 898
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 Feb 12, 2019 8:45 am

Ken.F wrote:
Tue Feb 12, 2019 6:20 am
djp952 wrote:
Mon Feb 11, 2019 9:01 pm
Bug confirmed. Kodi is not calling the function to set the last played position on Leia. I will see what I can do for us, but be advised Kodi 18.1 appears to be "closed" so the fix may have to wait until Kodi 18.2.
No rush. It took this long to notice the bug so apparently we don't stop watching recordings in the middle of the show very often.
I got it fixed for the next version, but it does introduce a minor limitation -- in-progress recordings won't be asked to save this value anymore. I'll add that to "Known Issues and Limitations" whenever 1.3.13 is ready. This has been broken since 1/4/19 and you were the first to notice :)

The next version is about ready anyway, I'm waiting on am Amlogic board to see if there is something wrong causing recording durations to be reported as zero there. CoreELEC uses a 64-bit kernel with 32-bit Kodi, I'm worried that it may be causing a structure size mismatch. There is also an update to cURL to include :)

Locked