(OLD) Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Kodi Community Development

Moderator: TVJunkie198

Locked
djp952
Posts: 940
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 Aug 04, 2018 3:15 pm

NYPlayer wrote:
Sat Aug 04, 2018 12:43 pm
djp952 wrote:
Sat Aug 04, 2018 11:03 am
NYPlayer wrote:
Sat Aug 04, 2018 9:34 am
I have quite a large amount of recordings... over 1500. I will try again and see what happens.
Good to know! I have nowhere near that amount, but I can simulate it. I'll try loading up those queries with a ton of fake data and see what happens.

edit: I have 743 recordings, the JSON for which is a little under 700K. Should be easy enough to create a dummy file with a few thousand recordings and load it up to test.
I reloaded the newest release again appears to be working so far ... BTW the only other addon I have is Plexkodiconnect on my kodi installation.
Great! Keep me in the loop. I haven't gotten to faking a massive amount of recordings yet.

I think I need some kind of formal unit testing checklist for this thing. Maybe after I get Leia working again that would be a good plan - a list of the things I tested and what device(s) I tested them on. Especially now that I finally have an ARM64 android device!

tloughr
Posts: 49
Joined: Mon Sep 12, 2011 7:05 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by tloughr » Sat Aug 04, 2018 3:43 pm

djp952 wrote:
Fri Aug 03, 2018 6:12 pm
tloughr wrote:
Fri Aug 03, 2018 3:09 pm
Please don't apologize. I absolutely love your plugin and appreciate your efforts. I'm not sure how to answer your question. I am a PVR subscriber with HD Homerun if that is what you mean?
Eh, I can't help myself on the apologies, I take it rather personally when things don't work for you guys. Character flaw I suppose :) It could be worse, I could throw out the ol' "you get what you pay for" schtick :mrgreen: (PSA: I'd never do that).

Let's find out if you have an HDHomeRun RECORD device running … this is the DVR engine that lets you record stuff. I assume you do have one set up if you are a subscriber and can record programs, but it takes like 5 seconds to be certain and my code has had past problems detecting them properly. Go into the Kodi Settings / PVR & Live TV area. Make sure the little gear at the bottom says "Standard", "Advanced", or "Expert". If not, click on it until it does. Then you should see "Client Specific" as an option. Highlight that and choose "Client specific settings" from the right-hand pane. You should see a menu pop up, the first entry being "List Discovered Devices". Select that guy.

I just want to be sure that you see an "HDHomeRun RECORD" device in the list. If not, the PVR is going to default to hitting your tuner(s) directly. That should usually be fine, but I screwed up a couple things somewhere in the recent past that break it.

You should see something like this:

Image

I am prepping v1.3.0 (not v1.2.11 anymore - because #reasons) this weekend, hopefully if you have the time available to help figure the problem out we can nail it down and get you back in business here. I still haven't found the root cause of NYPlayer's crash issue either, that one really bothers me since it seems like an unhandled exception; but I do want to get the tuner-direct fixes pushed out.
Yep, I see my two tuners and a HDHomeRun RECORD device. I should also point out that in the previous version, 2.9, I do get live stream drop outs every now and then. The difference is that the stream just stops with 2.9, but with 2.10 it locks up and requires a kodi restart to mitigate.

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by jhford » Sat Aug 04, 2018 4:10 pm

tloughr wrote:
Sat Aug 04, 2018 3:43 pm
djp952 wrote:
Fri Aug 03, 2018 6:12 pm
tloughr wrote:
Fri Aug 03, 2018 3:09 pm
Please don't apologize. I absolutely love your plugin and appreciate your efforts. I'm not sure how to answer your question. I am a PVR subscriber with HD Homerun if that is what you mean?
Eh, I can't help myself on the apologies, I take it rather personally when things don't work for you guys. Character flaw I suppose :) It could be worse, I could throw out the ol' "you get what you pay for" schtick :mrgreen: (PSA: I'd never do that).

Let's find out if you have an HDHomeRun RECORD device running … this is the DVR engine that lets you record stuff. I assume you do have one set up if you are a subscriber and can record programs, but it takes like 5 seconds to be certain and my code has had past problems detecting them properly. Go into the Kodi Settings / PVR & Live TV area. Make sure the little gear at the bottom says "Standard", "Advanced", or "Expert". If not, click on it until it does. Then you should see "Client Specific" as an option. Highlight that and choose "Client specific settings" from the right-hand pane. You should see a menu pop up, the first entry being "List Discovered Devices". Select that guy.

I just want to be sure that you see an "HDHomeRun RECORD" device in the list. If not, the PVR is going to default to hitting your tuner(s) directly. That should usually be fine, but I screwed up a couple things somewhere in the recent past that break it.

You should see something like this:

Image

I am prepping v1.3.0 (not v1.2.11 anymore - because #reasons) this weekend, hopefully if you have the time available to help figure the problem out we can nail it down and get you back in business here. I still haven't found the root cause of NYPlayer's crash issue either, that one really bothers me since it seems like an unhandled exception; but I do want to get the tuner-direct fixes pushed out.
Yep, I see my two tuners and a HDHomeRun RECORD device. I should also point out that in the previous version, 2.9, I do get live stream drop outs every now and then. The difference is that the stream just stops with 2.9, but with 2.10 it locks up and requires a kodi restart to mitigate.
Sorry to butt into this conversation, I'm using kodi-17.6-zuki.pvr.hdhomerundvr-arm-1.2.10.6782.apk.
Last night my DVR stopped recording the stuff in my Timers and hasn't recorded anything today, either. My "Discovered Devices" shows:
HDHomeRun Prime 13100203A
HDHomeRun Record + [long hyphen separated hex value]
Does that seem correct?
Any clue as to why my Timers aren't working or how to fix the problem?
Thanks

NYPlayer
Posts: 3538
Joined: Fri Apr 17, 2009 11:45 am
Device ID: 104112F4,104162C4,10438DAD,10438DF5,10701381,13147C7B,131A192A
Location: Portland OR, 97217

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by NYPlayer » Sat Aug 04, 2018 4:40 pm

@jhford,


This plugin does not control what is recorded … You have to look at the HDHomeRun DVR logs … You can post this in the regular DVR forum along with your device ID and they can look at the logs.

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by jhford » Sat Aug 04, 2018 5:20 pm

NYPlayer wrote:
Sat Aug 04, 2018 4:40 pm
@jhford,


This plugin does not control what is recorded … You have to look at the HDHomeRun DVR logs … You can post this in the regular DVR forum along with your device ID and they can look at the logs.
Thanks. Where do I find the DVR logs and where is the DVR forum, I've never been there. I'm relatively new to HDHomeRun.
Thanks again

NYPlayer
Posts: 3538
Joined: Fri Apr 17, 2009 11:45 am
Device ID: 104112F4,104162C4,10438DAD,10438DF5,10701381,13147C7B,131A192A
Location: Portland OR, 97217

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by NYPlayer » Sat Aug 04, 2018 5:25 pm

jhford wrote:
Sat Aug 04, 2018 5:20 pm
NYPlayer wrote:
Sat Aug 04, 2018 4:40 pm
@jhford,


This plugin does not control what is recorded … You have to look at the HDHomeRun DVR logs … You can post this in the regular DVR forum along with your device ID and they can look at the logs.
Thanks. Where do I find the DVR logs and where is the DVR forum, I've never been there. I'm relatively new to HDHomeRun.
Thanks again
Your logs are where you setup the Recordings to go to and where the DVR is running. Where are you storing your recordings.?


Post your problem here and your device ID...
viewforum.php?f=119

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by jhford » Sat Aug 04, 2018 6:17 pm

NYPlayer wrote:
Sat Aug 04, 2018 5:25 pm
jhford wrote:
Sat Aug 04, 2018 5:20 pm
NYPlayer wrote:
Sat Aug 04, 2018 4:40 pm
@jhford,


This plugin does not control what is recorded … You have to look at the HDHomeRun DVR logs … You can post this in the regular DVR forum along with your device ID and they can look at the logs.
Thanks. Where do I find the DVR logs and where is the DVR forum, I've never been there. I'm relatively new to HDHomeRun.
Thanks again
Your logs are where you setup the Recordings to go to and where the DVR is running. Where are you storing your recordings.?


Post your problem here and your device ID...
viewforum.php?f=119
They are being recorded to my WD MY Cloud NAS.

djp952
Posts: 940
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 Aug 04, 2018 6:33 pm

Whaaaaaaatttt … an actual version number bump? Patented djp952 extremely lengthy release notes diatribe to follow...

Version 1.3.0 (2018.08.04)
  • Change internal channel identifier encoding to indicate tuner-direct only streams that cannot be accessed via an HDHomeRun RECORD engine
  • Fix bug causing "DVR stream read operation minimum size" to default to 1KiB instead of 4KiB if not explicitly set
  • Fix bug causing tuner-direct streams to improperly be reported to Kodi as zero length and not real-time
  • Display notification when a live stream seek operation fails and attempt to recover the stream at the last known position
  • Disable stream packet filtering when misalignment of MPEG-TS packets has been detected
  • Add support for Kodi Timeshifting display indicators when playing Live TV streams using first detected MPEG-TS stream with PCR values
  • (Krypton) Remove "Disable reporting of real-time MPEG-TS streams" advanced setting (performance concern)
  • Trigger a Kodi error notification when a Live TV or Recorded TV stream cannot be created successfully
Downloads:
https://github.com/djp952/pvr.hdhomerun ... /Downloads

>> PLEASE UPDATE THE FIRMWARE ON ALL YOUR HDHOMERUN DEVICES <<

There is an important fix in here for tuner-direct streams and some new bullet-proofing/reporting for when bad things happen, but the main feature here is (as requested) finally enabling the Kodi "timeshift" UI elements.

This is a ".0" release, so as always while I do my best to give you guys and gals a quality product, weird things might happen. The version number got bumped due to a change in the way the internal PVR channel identifiers are encoded, which invalidates the existing channel identifiers. When you install this a new PVR database will be created and everything will be re-loaded from scratch. I was careful to not allow any overlap with existing settings and user data, so if you have to roll back to 1.2.x the old PVR database should pick up where it left off. "should™".

Enabling the requested timeshifting UI elements is, as mentioned, the main new thing here. It's a bit of a hack internally -- to really do this properly the main audio/video streams need to be examined (demuxed) so you can keep track of all the timestamps. I still have no desire to write a demuxer or think I could do any better than ffmpeg/Kodi does, so I came upon a compromise: I find the first program in the stream that has any timestamps and assume they will be valid for all eternity. Clearly this assumption will not be valid in all cases, so I added things to detect that and cease reporting the timeshifting data to Kodi for the duration of the stream. In practice, the assumption seems pretty valid -- I only actually ran into problems with ATSC streams that dropped out on me.

An inability to report the timeshifting data to Kodi is currently a silent failure, you won't see anything in the logs or get any messages from the PVR. It will simply stop working and suddenly behave like 1.2.x did. Kodi asks for this information A LOT, like really really A LOT, and I decided that it was better to just fail than to take the time to report what happened - every millisecond counts when a Live stream is playing over Wifi :D For the same performance reasons I didn't add an option to turn this whole new feature off, Kodi asks so frequently the act of checking the setting was a detectable performance impact.

I also added a 1-second amount of 'wiggle room' on the determination of when a live stream is being timeshifted. For the same performance reasons as above with settings I didn't make this configurable, but if you run into live streams showing up as "Timeshifting" when you are sure you are back to live, let me know and we can bump this value up to account for stream latency.

There are also a couple new notifications in this release. If the PVR can't start a stream for some reason you will get a notification with the basic message, and you will also get a notification if a seek operation fails. When a seek fails, the new behavior is to try and recover it from the last known position so you can at least keep watching it. In Kodi 17 "Krypton" only (does not affect Jarvis/Leia) the PVR will allow you to try and seek a tuner-direct stream because of a Kodi bug that prevents you from pausing (remember this one?) so that should cause an error message yet keep going, and in testing I found a concern with seeking streams that are already playing on another device, you get an HTTP 503 error. SiliconDust knows about this one and is fixing it for us, but for now you will get an error notification and it will restart the stream from the last known position. Decent workaround?

What else is in here … good gracious I type a lot … I added a flag to completely stop the packet filtering and timestamp reads/checks if a stream becomes misaligned. While perhaps impossible or at least extremely rare, a corrupt or misaligned stream that happened to have the proper sync byte in the right place (0x47) would still try to remove the problematic SCTE PIM table(s) from the PMT packets. This would just screw up the stream even more on you if it succeeded. I really don't think this could ever happen, but now it's prevented. Along the same lines if a misalignment is detected the checks for the timestamps to deal with the timeshifting UI are also turned off.

I removed the Krypton-specific "Disable reporting of real-time MPEG-TS streams" advanced setting for performance reasons. This was a very specialized setting to begin with to deal with an audio sync issue in the past. The audio sync issue can be corrected with Kodi settings instead of this option, so I finally killed it. At some point I will update the wiki with what we collectively learned there and the proper Kodi-based solution.

Update all of your HDHomeRun devices, give this version a try, let me know what you think or any problems you run into. It's officially the "best release ever" .. until the next one :)

PS: A Leia build is still MIA/DOA ... I'll do what I can to get something for the new "Beta 1" working ASAP.

Thank you!!

NYPlayer
Posts: 3538
Joined: Fri Apr 17, 2009 11:45 am
Device ID: 104112F4,104162C4,10438DAD,10438DF5,10701381,13147C7B,131A192A
Location: Portland OR, 97217

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by NYPlayer » Sat Aug 04, 2018 7:11 pm

Seems to be working … but what is the use of that extra bar in timeline ? I might have missed something ? Is that an option that can be disabled ?

djp952
Posts: 940
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 Aug 04, 2018 8:17 pm

NYPlayer wrote:
Sat Aug 04, 2018 7:11 pm
Seems to be working … but what is the use of that extra bar in timeline ? I might have missed something ? Is that an option that can be disabled ?
The top bar is a Kodi feature that indicates the position where you are in a time-shifted live stream. It was a request from the community to enable that, and this release does the best I could to handle it. Is it behaving wonky for you or showing up when you are actually live?

Right now I didn't provide a way to disable it since Kodi asks the PVR so often it was a detectable performance impact. How much I can't be sure, I have a really fast network here so it didn't hurt me even over Wifi, I've been trying to be cautious for you guys.

If it's wonky please try to describe how so. If it's saying you are Timeshifting when you are actually "live" that can be adjusted … I only built in 1 second of wiggle room there, but again my network is really fast so 1 second may not be enough for general use.

edit: PS - thanks as always for being willing to go 'bleeding edge'; I really appreciate it and the feedback that is generated helps everyone (even me - I use this too!)

NYPlayer
Posts: 3538
Joined: Fri Apr 17, 2009 11:45 am
Device ID: 104112F4,104162C4,10438DAD,10438DF5,10701381,13147C7B,131A192A
Location: Portland OR, 97217

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by NYPlayer » Sat Aug 04, 2018 8:21 pm

djp952 wrote:
Sat Aug 04, 2018 8:17 pm
NYPlayer wrote:
Sat Aug 04, 2018 7:11 pm
Seems to be working … but what is the use of that extra bar in timeline ? I might have missed something ? Is that an option that can be disabled ?
The top bar is a Kodi feature that indicates the position where you are in a time-shifted live stream. It was a request from the community to enable that, and this release does the best I could to handle it. Is it behaving wonky for you or showing up when you are actually live?

Right now I didn't provide a way to disable it since Kodi asks the PVR so often it was a detectable performance impact. How much I can't be sure, I have a really fast network here so it didn't hurt me even over Wifi, I've been trying to be cautious for you guys.

If it's wonky please try to describe how so. If it's saying you are Timeshifting when you are actually "live" that can be adjusted … I only built in 1 second of wiggle room there, but again my network is really fast so 1 second may not be enough for general use.
That is all right I will just use another skin … I guess I can easily tell if I am time shifting by the onscreen clocks. I think it was the constant motion of the bar that I don't like but no big deal.

Ken.F
Posts: 2148
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 » Sun Aug 05, 2018 5:02 am

I tried Win32 Krypton 1.3.0 on my Win7 PC but timeshifting isn't working. There is no buffer file being created in the Live TV folder and I can't skip backwards from live TV. I tried to reset discovery database in client specific actions and I stopped and started the record engine on the NAS but neither seemed to help. It finds my recordings, timers and rules. I can play back recordings. I can't timeshift.

Record engine and tuner firmware are all on version 20180802beta1. Everything is working fine with SD's HDHomeRun Android app on my Mi Box so I think that rules out a record engine or tuner hardware problem.

tloughr
Posts: 49
Joined: Mon Sep 12, 2011 7:05 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by tloughr » Sun Aug 05, 2018 5:38 am

Ken.F wrote:
Sun Aug 05, 2018 5:02 am
I tried Win32 Krypton 1.3.0 on my Win7 PC but timeshifting isn't working. There is no buffer file being created in the Live TV folder and I can't skip backwards from live TV. I tried to reset discovery database in client specific actions and I stopped and started the record engine on the NAS but neither seemed to help. It finds my recordings, timers and rules. I can play back recordings. I can't timeshift.

Record engine and tuner firmware are all on version 20180802beta1. Everything is working fine with SD's HDHomeRun Android app on my Mi Box so I think that rules out a record engine or tuner hardware problem.
Same problem with my Win 10 PCs.

djp952
Posts: 940
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 Aug 05, 2018 6:08 am

Ken.F wrote:
Sun Aug 05, 2018 5:02 am
I tried Win32 Krypton 1.3.0 on my Win7 PC but timeshifting isn't working. There is no buffer file being created in the Live TV folder and I can't skip backwards from live TV. I tried to reset discovery database in client specific actions and I stopped and started the record engine on the NAS but neither seemed to help. It finds my recordings, timers and rules. I can play back recordings. I can't timeshift.

Record engine and tuner firmware are all on version 20180802beta1. Everything is working fine with SD's HDHomeRun Android app on my Mi Box so I think that rules out a record engine or tuner hardware problem.
Sounds like it's going directly to the tuner instead of the RECORD engine. Can you verify that you do not have "Stream Live TV channels directly from tuner device(s)" enabled, and can you check the Kodi log for a message like this:

unable to generate storage engine stream URL for channel {number} - falling back to a tuner-direct stream

The channel number encoding changed in 1.3.0, something must have gone awry that I didn't exercise. Drat! It works fine on everything here :(

djp952
Posts: 940
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 Aug 05, 2018 6:32 am

tloughr wrote:
Sun Aug 05, 2018 5:38 am
Ken.F wrote:
Sun Aug 05, 2018 5:02 am
I tried Win32 Krypton 1.3.0 on my Win7 PC but timeshifting isn't working. There is no buffer file being created in the Live TV folder and I can't skip backwards from live TV. I tried to reset discovery database in client specific actions and I stopped and started the record engine on the NAS but neither seemed to help. It finds my recordings, timers and rules. I can play back recordings. I can't timeshift.

Record engine and tuner firmware are all on version 20180802beta1. Everything is working fine with SD's HDHomeRun Android app on my Mi Box so I think that rules out a record engine or tuner hardware problem.
Same problem with my Win 10 PCs.
If you guys could send me a copy of your PVR database, that would help too. I can run the queries against it offline and see if this is a channel number being too big now or something. On Windows, it will be in the Kodi userdata\addon_data\pvr.hdhomerundvr folder and is called "hdhomerundvr-v1.3.db" (Not the v1.2.db if present).

The file is typically under 2MB and doesn't contain any identifiable information other than your HDHomeRun device authorization codes, which change regularly. I'll PM you both an e-mail address you can use I think gmail will boink the attachment.

Locked