Unofficial Kodi HDHomeRun DVR PVR Client

Kodi Community Development

Moderator: TVJunkie198

Post Reply
jrpatx
Posts: 54
Joined: Mon Sep 04, 2017 12:46 pm
Device ID: 1056BDB2, 10727095

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by jrpatx »

Hi djp952, thanks for the quick reply! First off let me make sure this issue is at the bottom of your priority list. It's more of a convenience issue for me, allowing me to skim through some recorded programs while multi-tasking on the Ubuntu machine. If I'm watching something I really want to pay attention to, I'll be in the living room using an generic Andriod-based box to watch on the big screen. Interesting point there though, v 3.2.2 of the PVR add-on works fine on Kodi Leia 18.6 running on one of those Android boxes. Issue is isolated to the Ubuntu machine.

I'll pm the log file to you, but this looks like the problem to me:
2020-04-29 22:23:55.819 T:140092326524672 ERROR: AddOnLog: HDHomeRun DVR PVR Client: scheduled task failed due to an exception: json_get_aggregate_final: no response from host (1)

Yes, I can seek forward and back during live TV viewing in the PVR add-on.

Thanks again for looking into this! Remember to keep it on the back burner!

John

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

No worries! Thanks for the log, but I think you nailed it.

The most recent version of the PVR, 3.2.2 had a quick-fix in it for an Android DVR engine specific issue. In my haste to resolve it, I failed to remember that the RECORD engine's HTTP server isn't able to handle a technique I used to speed up some of the backend requests. I'm not sure why it actually fails for you specifically, it could be a lot of things probably not worth digging into, like client/server patch levels, etc.

Just yesterday I finished up reworking the recordings internally again to take advantage of data exposed by what I had to switch to for 3.2.2, and as part of the rework that function that is failing isn't used anymore. I tried it first, since it should speed things up a lot, but it actually made it 7-8x slower, which is when I remembered it's bad to use that against RECORD :)

Hang tight for a bit, I'm building a beta version of the next release now and will post. Given the scope of the recordings changes I could use some help making sure it works too!

Sorry for any trouble, I think this one was an issue of haste on my part.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

I was planning on testing this more here, but I think it's good enough to at least call it a Beta ...

v3.3.0~beta1 - April 30, 2020
  • Update cURL library to version 7.70.0
  • Refactor recordings database table to utilize HDHomeRun RECORD engine series update identifiers
  • Add "Preferred channel name format" interface setting
  • Remove "Use channel names from tuner device(s) in channel lineups" interface setting
  • Fix bug that could cause HTTP 416 when seeking on a Recorded TV stream that has switched from in-progress to fully recorded
Refactor recordings database table to utilize HDHomeRun RECORD engine series update identifiers

In version 3.2.2 I put in a 'quick-fix' of sorts to handle HDHomeRun RECORD 20200318 (Android), knowing that it needed more extensive rework that would involve changing the PVR database so I held off on it. This refactors how Recordings work to take advantage of an UpdateID value that RECORD provides, which allows me to significantly limit the amount of data that needs to be retrieved from RECORD. After the first run (needs to reload everything), only recorded series that have changes will be refreshed. This will significantly improve startup performance, significantly reduce the load on RECORD, and cause significantly less updates between the PVR and Kodi. I tested with multiple RECORD engines running and having series spread out across RECORD instances, etc., but it is a high impact change so please watch for problems here.

I think this will also fix jrpatx's issue, since the function that is failing for him isn't used. It was a mistake on my part to use that against RECORD, while it seems to work for most everyone the HTTP server RECORD exposes doesn't really support what that function is trying to do.

Add "Preferred channel name format" interface setting

Not sure anyone will like this or not, but the XMLTV data gives us more options for channel names, this exposes them. The default "XMLTV station" is what you get today, i.e. "WRCDT2". "XMLTV channel" uses the alternate name provided in the XMLTV, i.e. "WRC COZI TV". "XMLTV network" is the network name, i.e. "COZITV". "Tuner channel" is whatever the HDHomeRun tuner says to use, i.e. "WRC Cozi TV". For me, "XMLTV channel" and "Tuner channel" are identical other than the XMLTV version being all uppercase. I was hoping they wouldn't be truncated like they are on my tuners, but alas they are. Each XMLTV option has fallbacks so if the data isn't available you'll get something. If you choose "XMLTV network", for example, you're probably going to have a lot of regular channel names since that information isn't provided for many channels (for me, at least).

Side effect of this is that the old "Use channel names from tuner device(s) in channel lineups" setting is gone. The equivalent is setting this to "Tuner channel", but the old setting won't carry over; you will have to go change it.

Fix bug that could cause HTTP 416 when seeking on a Recorded TV stream that has switched from in-progress to fully recorded

Fix for cncb's issue, also tracked as Issue 66 on GitHub: https://github.com/djp952/pvr.hdhomerundvr/issues/66. When you are watching an in-progress recording the stream may switch from infinite (live) to finite (recorded), which changes the way RECORD will respond to a seek request. Live streams can be seeked past the end without error, you just end up at the point where live is truly live. Recorded streams, however, cannot be seeked past the end and if you try you get HTTP 416. Kodi is attempting to seek relative from the end of the stream, which is set to (effectively) infinity. This change traps HTTP 416 and uses the new length provided to adjust Kodi's request and try again. Seems to work!

Too many words like always ... give it a shot and let me know if you run into problems. My target for this is this weekend, especially since I'm now worried that json_get_aggregate error is going to pop up on more systems than just the one I know about.

Oh right, Matrix. The PVR API for Matrix changed again, and there is another change in the queue. I am all set for the current changes that will match the nightlies, trying to hold off for the next wave if possible. LMK if you need a Matrix build, happy to do it.

Link to Leia .zip/.appx files (OneDrive):
https://1drv.ms/u/s!AgEGEEVzGNq-jJICEPr ... w?e=mlFtBk

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F »

djp952 wrote:
Thu Apr 30, 2020 8:34 am
v3.3.0~beta1 - April 30, 2020
I did a quick run-through and everything seems to be working fine on Linux x86-64. I chase-played a recording in progress and had no issues skipping forward to live. I skipped back to about 2 minutes behind live and it kept playing normally right through to the end of the recording.

I like the XML Network setting for the channels that do have the network name.

jrpatx
Posts: 54
Joined: Mon Sep 04, 2017 12:46 pm
Device ID: 1056BDB2, 10727095

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by jrpatx »

djp952 wrote:
Thu Apr 30, 2020 8:34 am

I think this will also fix jrpatx's issue, since the function that is failing for him isn't used. It was a mistake on my part to use that against RECORD, while it seems to work for most everyone the HTTP server RECORD exposes doesn't really support what that function is trying to do.
Yep, that did it. I can see all of my recordings now. I can skip forward/back while playing an existing recording as well as when chase-playing a live program.

Thanks very much for looking into this so quickly. I don't check the forum that often, so if you want me to beta test any future updates against my evidently "picky" install of Ubuntu 20.04, drop me an email.

Thanks again!
John

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

jrpatx wrote:
Thu Apr 30, 2020 12:16 pm
Yep, that did it. I can see all of my recordings now. I can skip forward/back while playing an existing recording as well as when chase-playing a live program.

Thanks very much for looking into this so quickly. I don't check the forum that often, so if you want me to beta test any future updates against my evidently "picky" install of Ubuntu 20.04, drop me an email.

Thanks again!
John
Glad to hear it! Sorry for the SNAFU in the first place.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

As an FYI, 3.3.0~beta1 looks fine to me here, I can't find anything wrong with it, so will likely release it formally tomorrow (5/1), provided today's Kodi Matrix nightly baseline becomes available. They merged the next round of PVR API (v6.5.0) changes and I made the necessary adjustments earlier today. Since there were no logic changes necessary on my part, and the next Matrix nightly also finally provides a critical fix for the 1080i content seek issues, I'd like to coordinate this as best I can to satisfy everyone's needs at once. I also think I'll list the json_get_aggregate() function error as a bugfix in the changelog as well in case anyone else was having that problem, even though it was more of an "OBE" (overcome by events) type of change.

Sincere shout out to my awesome userbase that installs whatever garbage I send out to help me make sure it's actually not garbage ... :)

jasonl
Expert
Posts: 15270
Joined: Sun Oct 28, 2007 9:23 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by jasonl »

Windows Updates I wait a week on, but your updates I get as soon as they come out :lol:.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

Because I literally have nothing better to do ....

Version 3.3.0 (2020.05.01)
  • Update cURL library to version 7.70.0
  • Refactor recordings database table to utilize HDHomeRun RECORD engine series update identifiers
  • Add "Preferred channel name format" interface setting
  • Remove "Use channel names from tuner device(s) in channel lineups" interface setting
  • Fix bug that could cause HTTP 416 when seeking on a Recorded TV stream that has switched from in-progress to fully recorded
Downloads:
NOTE: Matrix version requires Kodi nightly version 1b3ddf99 (2020.05.01) or later, as the PVR API has been changed. There are no more API changes pending that I see, so hopefully it will be stable for a while.

You can scroll up a couple posts to see some verbose explanation of the inside changes, the only thing that should be visible is the new Preferred channel name format setting. There are four options here:

XMLTV station (default) - The same default channel format from before, typically will be the station name, for example "WBALDT"
XMLTV channel - Provides the channel name, if available, for example "DISNEY JUNIOR"
XMLTV network - Provides the network name, if available, for example "PBS"
Tuner channel - Provides the channel name from the tuner, this is the same as the old "Use channel names from tuner..." option.

Each option has fallback methods since the information isn't always available for every channel. Here is the mapping for that:

XMLTV station -> Tuner channel
XMLTV channel -> XMLTV station -> Tuner channel
XMLTV network -> XMLTV station -> Tuner channel
Tuner channel -> XMLTV station

I think this option will be hit and miss for most people based on what's coming in with the XMLTV data for your region/provider. As an example, my "XMLTV channel" names are identical to my "Tuner channel" names with the exception they are in UPPERCASE. Many of my "Tuner channel" names are truncated, I was hoping the XMLTV ones wouldn't be :(

People that had previously enabled "Use channel names from tuner device(s) in channel lineups" will have to go in and change this new setting manually to get back to the same names, sorry about that.

As always, let me know of any problems/concerns that arise. My dance card is quite empty at the moment! Have a happy and safe May!

rdoac
Posts: 35
Joined: Sun Feb 20, 2011 1:46 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by rdoac »

I seem to have lost access to recordings since my android (Nvidia shield 17.6) and fire TVs updated to 3.3.0. They still work in the hdhomerun app.

Anything I missed? (Running firmware from Feb).

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

rdoac wrote:
Sat May 02, 2020 7:29 pm
I seem to have lost access to recordings since my android (Nvidia shield 17.6) and fire TVs updated to 3.3.0. They still work in the hdhomerun app.

Anything I missed? (Running firmware from Feb).
Uh oh. I didn't run into any issues on either the Shield or a FireStick 4K, can I get a copy of the Kodi log file? It's probably not a coincidence, Recordings were significantly changed. You can use paste.kodi.tv (as long as it's a Kodi log file), and I'll PM you my e-mail address.

I apologize for any problem that I may have caused. Hopefully it's something that can be fixed easily!

edited: I linked you to an hors d'oeuvre :) Thanks signcarver for letting me know!

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

NOTE: Edited, original assessment was incorrect

PSA: It looks like v3.3.0 does have a situation that I didn't account for properly so please watch out for this. The RECORD engine is apparently capable of sending back series identifiers of "UNKNOWN". If you have more than one series like this, the new code will fail, as each series can still have unique update identifiers. I think I can account for this, and I apologize that I didn't know this was even possible. The old method just got a list of "all recordings", it didn't care that much about the series identifier in and of itself. The new code relies on it to differentiate things.

Update fatigue is a real thing and I try to avoid it, 3 releases in 9-10 days in this case, so if there is anything else out there going wrong please let me know :) I won't be adding anything new for 3.3.1, just this and any other fixes that need to be made.

If you are also having this problem, and you don't mind me seeing a list of your recordings, please let me know, I would like to see your recorded_files.json?DisplayGroupID=root data. I'll be reaching out to SD on the development forum later to ask what they think an application should do in this case. It's possible it's a bug with RECORD as well. I'll get a fix out to you guys ASAP, I have what I need on this end to test a change.

signcarver
Expert
Posts: 8980
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 »

That is probably something i should look at as i used to frequently copy recordings to other directories monitored by the same engine and even occasionally to places monitored by more than one engine... at one time i had 10 copies of the same show around. One reason for doing so was to test various deletes. From what i recall, it never had the same play/cmd id and would get multiple listings but it has been a long time (many years) since i looked at such and since official support of multiple engines I don't even know if i have one currently set to use multiple directories.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

In the effort of moving the ongoing pursuit of unattainable perfection forward ...

Version 3.3.1~beta1 (May 3, 2020)
  • Fix bug preventing recordings from being loaded when duplicate series identifiers exist
  • Report HDHomeRun device version information in device discovery logs
This one isn't going to be super useful for the bulk of users, but it does fix a bug that some folks may be hit by from the Recordings changes in v3.3.0. If after installing v3.3.0 you have no recordings at all, and more specifically find an error in the Kodi log that states "UNIQUE constraint failed: recording.deviceid, recording.seriesid, recording.recordingid (1555)", this build is for you!

Fix bug preventing recordings from being loaded when duplicate series identifiers exist
There are possible use cases that I was previously unaware of that could cause the RECORD engine to return legitimate duplicate series identifiers. v3.3.0 added a PVR database constraint that makes that impossible; this change alters how the source data from RECORD is parsed to avoid the constraint issue, but there is a limitation as well. In the event truly duplicate series identifiers are present, when the PVR asks for the recordings of that series only the first set of them will be returned. There is currently nothing I can do to overcome this limitation other than reverting the entire changeset and being incompatible with upcoming RECORD engines v20200318 and newer.

Many thanks to rdoac for reporting this problem and for his assistance in not only gathering the necessary data but also for testing it and helping me understand the inherant limitation :)

Report HDHomeRun device version information in device discovery logs
Pretty self-explanatory here; the Kodi log will now list the version of your device(s) during discovery; the hope being to avoid a repeat of the RECORD v20200318 thing again. If the version is in the log it will be more clear that a breaking change may have happened and gone unnoticed by me.

My impression is that the bugfix will not benefit more than a very small number of users, so I'm going to hold off on a general release for a while. If you run into it and this fixes it, please do let me know so I can change my mind!

Link to addon .zip files (Kodi 18 "Leia" only):
https://1drv.ms/u/s!AgEGEEVzGNq-jJIaDKv ... g?e=FoXbub

FoodLioon
Posts: 7
Joined: Wed Feb 12, 2020 9:22 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by FoodLioon »

How can I force a recording to stop?

I recorded racing today and padded 2 hours to the recording. I wanted to stop the recording when it was in the padded time but couldn't find any way to do it.

Post Reply