Unofficial Kodi HDHomeRun DVR PVR Client

Kodi Community Development

Moderator: TVJunkie198

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

CLorox wrote: Sun Jan 12, 2020 7:21 pm I appreciate the detailed and insightful reply. That is a shame about UWP support waning. Regardless, your addon is fantastic. Thank you for your contribution!
You're quite welcome, thank you for using it! I never tried this (don't have an XBox), but is it possible to enable certificate installation and side-loading temporarily to install something and then turn it back off, or does that then prevent the application from running again? It's certainly not ideal, but might be a reasonable compromise?

I think, but am not sure, that even I didn't self-sign the .APPX it would still have to come down via the Microsoft Store, right? I wouldn't be against acquiring a legitimate trusted signing key to use if it would help, let me know if you think it's worth pursuing. If there is a way to side-load properly trusted apps (no .CER needed) without enabling Developer Mode, it just might do the trick for you.

starslayer74
Posts: 20
Joined: Thu Jul 06, 2017 2:50 pm
Device ID: 15300503, 1325D5CE
Location: Parkville, MD

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by starslayer74 »

I discovered recently that my recordings aren't auto deleting...I was away for a bit and I expected to come home to fresh recordings, but my servio was full so nothing actually recorded.

Is this just a general HDHomerun issue or could it be something that is handled by the PVR client?

I manually deleted a bunch of stuff inside of Kodi and then programs recorded as expected.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

That's an HDHomeRun thing, not sure if they have an auto-delete if full feature or not, thankfully I've never come close to filling mine up yet :)

I would never add something like that anyway, too dangerous for my tastes. I can only imagine what could happen if I had some little logic error (like the decimal point in Office Space) that ended up deleting everyone's recordings on them! I'd have to move to a country without an extradition treaty. I think ksooo from Kodi might be OK with that, though. I cause him a lot of grief :mrgreen:

The PVR does have a feature to automatically delete old Date/Time timers that were set to more then 24 hours in the past. I haven't checked to see if the backend does this on it's own now, but at the time it was keeping all the expired rules. I should add that as something to check, even that makes me a little uncomfortable but it should be harmless in practice.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

OK gang, I spent some time over with Kodi working to get some changes to how "Original Air Date" will work for Matrix, and they seem to be moving into the "merge" phase. Since my proposed changes will break every single Kodi PVR addon I think I'm on the hook to do what I can to update them, but here's what has been proposed:

- Add "First Aired" (Original Air Date) support for Recorded TV
- Change how "First Aired" (Original Air Date) works for EPG

The first change adds a data element to track the Original Air Date. When/if this gets mainlined, my intention is to crawl out on the proverbial limb and propose a way to use that date instead of Recorded Date for display/sort purposes in the Kodi UI. That is iffy at best, I think, but having the field separate gives me more flexibility with what I could to in the addon to manipulate things to get the "use original air date for recording date" setting back. If the Kodi UI doesn't support it, we'll still be stuck with a fake timestamp (12:00AM, probably), but I think it still work out better.

The second change is in regard to something I noticed while working on the first change. In Kodi Matrix, the new "First Aired" information and "New" indicator in the EPG rely on the same type of date -- the "First Aired" (or Original Air) Date. The problem is that we only have a date, not a date/time value to work with here. In the as-is implementation, Kodi tries to localize that value for the user's timezone for both purposes, but if you can't provide a specific UTC timestamp bad things happen. This is why "use original air date for recording date" was showing everything at (if you are in EST) 7:00PM on the prior day -- a date value was being shifting +/- GMT for display as if it was a time value. The proposed change makes "First Aired" a simple non-adjustable date so whatever the addon says to show Kodi will show. It also forces the addon to decide if a program is "New" or not instead of Kodi trying to figure it out on it's own. Without a specific time of day, the logic is essentially impossible.

So, where does that leave "use original air date for recording date"? Since any Kodi changes will be exclusive to Matrix, I do intend to reinstate this option for Leia at a minimum. It will be slightly different, in that I will now take the timestamp from HDHomeRun and adjust it so it displays as 12:00AM on the proper date, and I will have to make a trip into the PVR database to get the real information, but it should work again and I seriously doubt the performance hit from executing a quick database query will be noticeable.

Developer may giveth and then taketh away, but developer also bendeth over backwards to re-giveth it! :)

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

In other news ... my current intention is to retire support for the original Kodi 17 "Krypton" baseline on it's upcoming third anniversary (February 10, 2020). There appears to be less than 20 users still on Krypton, which is well under 0.5% of the assumed installed base.

I don't have any "phone home" or tracking mechanisms in place as part of this work, so I am relying solely upon download counts. With the disclaimer that the numbers also include my "test clicks" -- Krypton-v3.0.0 was downloaded 19 times. Krypton-v3.1.0 was downloaded 33 times, and as of today Krypton-v3.1.1 was downloaded 4 times. All of these fall below the 1% threshold for Leia, which is currently peaking at just under 4,000 downloads.

I hate leaving people in a lurch, so if you are on Krypton and are having any problems, please let me know ASAP. As with Jarvis support, I can't guarantee that breaking changes will never happen that may cripple the addon, but I also have to be realistic about dragging along a defunct Kodi baseline. 2/10/2020 is not a hard date if there is still work to be done!

ddejager
Posts: 131
Joined: Tue May 06, 2014 2:26 pm
Location: Glen Arbor, MI

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by ddejager »

Like:
Developer may giveth and then taketh away, but developer also bendeth over backwards to re-giveth it! :)

Swindmiller
Posts: 10
Joined: Mon Nov 07, 2016 6:43 am
Location: Glen Burnie, Maryland

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Swindmiller »

First off thanks for the great add-on! I am migrating from WMC (Win7) to Kodi with my HDHomerun (with DVR subscription), Emby server and Harmony remote. I setup my Harmony hub w/remote via bluetooth and the Kodi specific mappings. Sorry about the back story I just didn't want to leave anything out that would be needed to answer.

I have everything working and it works well but have just a few small questions just to make sure I understand how everything works:

1) If I am watching a show, should I be able to just hit record on my remote to start recording the show currently being watched, like in WMC. Maybe I have the wrong key mapped.....

2) If I am recording a show, and say its 15 minutes in, and I tune to that channel (not open the recording), am I using another tuner or the same one that is recording? In WMC, if I do this I am on the same tuner and able to rewind back to the beginning of the recording and start watching from there. In Kodi, the buffer only shows from when I tuned into it, not from when it started recording.

None of these are necessarily bad, just need to understand how it works so I can explain to my wife :)

Thanks!
Scott

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

Hi Swindmiller!
1) If I am watching a show, should I be able to just hit record on my remote to start recording the show currently being watched, like in WMC. Maybe I have the wrong key mapped.....
Yes. It may be a remote mapping thing, you can try using the mouse to press the big ol' red circle button in the Kodi player to see if that's the case. What this should do is schedule a date/time timer for that program behind the scenes and the DVR engine will pick it up fairly quickly and start recording it for you.

My old MCE remotes and the Harmony seem to work for this. IIRC you have to add two command sets to the Harmony to get all the available mappings? It's been a while. The instructions here might help:

https://support.myharmony.com/en-us/har ... -with-kodi

If using the red button on-screen doesn't work, then I think something is wrong, please let me know so I can see if it can be corrected for ya :)
2) If I am recording a show, and say its 15 minutes in, and I tune to that channel (not open the recording), am I using another tuner or the same one that is recording? In WMC, if I do this I am on the same tuner and able to rewind back to the beginning of the recording and start watching from there. In Kodi, the buffer only shows from when I tuned into it, not from when it started recording.
It should use just the one tuner, but there may be variables that could cause it to use more. SD would know the full answer on this one, and what condition(s) might cause it to use more than one tuner. Here I did a quick test and confirmed just one tuner was used for any given channel, even if it's being recorded and played back live separately.

The two methods (Live TV and Recorded TV) behave a bit different from each other. When you open a channel via Channels or the EPG, you'll always get a "Live TV" stream. These are reported back in such a way that you can only seek backwards to the point you first opened it, and they (theoretically) can play forever. When you open via Recordings, you get a "Recorded TV" stream. These guys are reported based on the start and end time of the recording, so you can seek back to 00:00 and as far ahead as either the current clock time OR the duration of the program, whichever is less. This allows you to fire up a recording that's actually in-progress and not try to seek beyond realtime. Recordings also stop when you've hit the end.

When coming from WMC, this can be a bit new/weird. Since there are two distinct paths to get to the stream, the rules are applied at the time you open it. So even though the DVR engine may have data buffered for a channel that you're recording, you can't get to it since it was asked to stream it "Live". It doesn't expose any back-buffer information that it might have, and it always starts at position zero, so even with knowing how much is there you can't go negative! (don't be so negative, right? LOL).

Simplified Rules:

- Live TV (Channels / EPG) programs "start" at the time you opened it, you cannot seek backwards beyond "start" time. Will play indefinitely.
- Recorded TV programs "start" when they started recording. You cannot seek forward beyond the current clock time OR the end of the recording. Will stop at the end of the recording.

One other small thing, if Kodi knows the channel is being recorded actively it will prompt you if you want to watch the recording instead. This helps a bit, but there is some time delays involved and I find in practice I almost never get prompted. If you do get prompted and say YES, this only opens the Recorded TV program as if you did that on your own. It doesn't alter any of the rules.

I hope this wasn't toooo much information as I do tend to ramble on. Please LMK if this didn't explain it well enough or if you are running into any other problems!! I'm here to (try) to help!

Swindmiller
Posts: 10
Joined: Mon Nov 07, 2016 6:43 am
Location: Glen Burnie, Maryland

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Swindmiller »

Wow!!! I was not expecting that detailed of a response. I love it, thank you so much!

It does look like the record button onscreen does work, honestly I was looking for a red record button and must have passed by it.
Also looks like my Harmony remote has all the keys mapped but the record button. Looks like I need to map CTRL + r to that button but I don’t see that as an option for the Microsoft Media Player device I have setup on the Harmony, I will keep looking.

Thanks for the explanation on the live tv vs recorded, that makes perfect sense. To be honest, I didn’t check to see if it was using 2 tuners but thought it might based on the behavior, glad it does not. Yeah, that’s different than how WMC treated it but we will get use to it now that I know exactly how it works.

Should have made the jump from WMC earlier but it just worked and we never had many issues with it. Glad to see such an involved community for this.
Thanks again and I am sure I will have more questions.
Also looks like we live in the same state 😁

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

I haven't been idle in my pursuit of a proper replacement for the "Use Original Air Date for Recordings" setting. The PR I intend to issue depends on Kodi accepting and merging my existing one to add Original Air Date to recordings, but I thought you'd like to see how I'm proposing to deal with the request(s) when they become viable. I intend to add two new "Sort By" options to Recorded TV -- "First aired" and "Episode".

Here is what sort by "First aired" looks like (NOTE: displayed date is incorrect and requires existing PR to be accepted first) ...

ImageImage

... and here is what sort by "Episode" looks like:

ImageImage

My hope is that these changes will eliminate the need for two PVR-specific options: the currently defunct/missing option to use the "Original Air Date" as the recording date/time, and also the "Use season/episode number as title for recordings". The latter of which only existed because Kodi had no ability to sort by Episode.

Note that these proposed changes will be intended for Kodi 19 "Matrix" only; no backport to Kodi 18 "Leia" is expected to be viable.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

Shout out to jaytaylor@gmail.com, and anyone that has the jarring stream stops momentarily, buffers, and then whizzes by for a second or two. I've found another way this can happen -- if the input stream is missing any TS packets (continuity errors), this will also happen. I'm currently experiencing this on TNT-HD here.

For me, it's weird, it happens at precisely on an hour marker. It's like clockwork, if I'm on TNT I can count down to the glitch in 5, 4, 3, 2, 1, boom. I posted an inquiry in the hardware forum since I'm not sure why this is happening, if it's my tuner, or if it's the RECORD engine, but I think I can rule out the source stream itself.

Regardless, I have a job for y'all, if you're game :) I now know it's definitely not the PVR that glitches, it's the audio sink in Kodi that freaks out and tries to catch up. This is why there are never any logs or anything from the PVR saying it had a problem, it didn't. So, here's what I would request from those so inclined to play around since my pool of bad channels is very small.

- Record some stuff on the channels causing you the problem
- Install "TSDuck" somewhere (it's safe) - https://tsduck.io/
- Run the command-line tsfixcc application against some of the recorded .mpg files. IMPORTANT: Use the "-n" option. E.g. -- "C:\Program Files\TSDuck\bin\tsfixcc.exe -n {path to .mpg file}"
- Let me know if you find these files frequently have errors in them.

Here is a full example of me running tsfixcc against a program I recorded on TNT-HD, and what I saw. This recording will glitch very briefly when viewed after the fact, but when I watch TNT-HD live Kodi freaks out:

Code: Select all

C:\Program Files\TSDuck\bin>tsfixcc -n "\\xxxxxxxxxx\hdhomerun\movies\The Mummy Returns 20010504 [20200129-2230].mpg"
packet index: 26,216,352, PID: 0x177B, missing 1 packets
packet index: 26,216,353, PID: 0x177B, missing 9 packets
packet index: 26,216,354, PID: 0x177B, missing 8 packets
packet index: 26,216,356, PID: 0x177B, missing 4 packets
packet index: 26,216,357, PID: 0x177B, missing 3 packets
packet index: 26,216,359, PID: 0x177C, missing 7 packets
packet index: 26,216,360, PID: 0x177B, missing 11 packets
packet index: 26,216,362, PID: 0x177B, missing 3 packets
packet index: 26,216,364, PID: 0x177B, missing 1 packets
packet index: 26,216,376, PID: 0x177C, missing 7 packets
packet index: 26,216,423, PID: 0x177D, missing 1 packets
packet index: 26,216,425, PID: 0x177F, missing 1 packets
packet index: 26,216,522, PID: 0x177A, missing 4 packets
packet index: 26,291,441, PID: 0x1780, missing 5 packets
packet index: 61,720,304, PID: 0x177B, missing 6 packets
packet index: 61,720,306, PID: 0x177B, missing 2 packets
packet index: 61,720,308, PID: 0x177B, missing 11 packets
packet index: 61,720,310, PID: 0x177B, missing 5 packets
packet index: 61,720,320, PID: 0x177A, missing 1 packets
packet index: 61,720,327, PID: 0x177F, missing 15 packets
packet index: 61,720,752, PID: 0x0000, missing 7 packets
Note there are two "instances" of missing packets here, it's not 20+ individual errors. In this particular case I think the first instance is because I was spinning up more tests, but the latter instance may have occurred at exactly 7:00PM my time.

Optional stuff, of course, and only if you're comfortable with it. If this is what is happening for jaytaylor, there is nothing I will be able to do to fix it, missing packets are missing packets, but I can still try to find where in Kodi this causes it to completely flip out instead of just glitching a bit like I think it should. But, if others are having the same problem on different sources, perhaps there is something SD may be able to do to help us make the problem go away, which would also solve it :)

Thanks gang!!!

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F »

djp952 wrote: Wed Jan 29, 2020 6:55 pm For me, it's weird, it happens at precisely on an hour marker. It's like clockwork, if I'm on TNT I can count down to the glitch in 5, 4, 3, 2, 1, boom.
That is weird. I had a similar issue with WMC several years ago. Every day at exactly 12:00 noon any recordings in progress would fail. It took me several weeks to figure out what was going on. It turned out to be caused by a diagnostic utility that Dell pre-installed on the computer. It was doing daily hardware tests in the background and when it tested the onboard ethernet it would disconnect from the network for a few seconds.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F »

I've been having trouble lately with timeshifting. Live TV bypasses the record engine and streams directly from the tuners occasionally. I think it's being caused by running a second record engine for storage only. I only have trouble if the storage only device has RecordStreamsMax=0 in the hdhomerun.conf file. If I shut down the storage engine or change the RecordStreamsMax setting to greater than 0 timeshifting always works correctly.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

I know why that would happen but I'm not sure what to do about it. I've had that scenario on the backlog for a long time.

I suppose I could add something to try another storage device if one fails instead of going to a tuner? Do the logs indicate any specific HTTP error code? If it's unique enough maybe that could be the trigger.

Let me play around, this is a great thing to work on, and may let me get rid of that backlog item. Thank you for letting me know!

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F »

djp952 wrote: Thu Jan 30, 2020 8:52 am Do the logs indicate any specific HTTP error code?
I tried to reproduce it so I could check the logs and now it won't do it. :roll: I'll leave the storage engine at RecordStreamsMax=0 for a few days and see what happens.

Post Reply