Unofficial Kodi HDHomeRun DVR PVR Client

Kodi Community Development

Moderator: TVJunkie198

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by ddejager » Thu Sep 26, 2019 5:51 am

Thanks for looking into it.
Right-click on the entry, choose "Add Timer". It should default to "Record Series", if not the very first line item is the timer type, you can choose between "Record Series" and "Record Once". The "Record" right-click option in the EPG will always create a date/time only (once) timer, similar to pressing the red RECORD button if you are watching a program in the player. Kodi actually calls the same function for both operations.
Here is a suggestion (if it is under your control and not Kodi): change the name "Add Timer" on the bottom to "Record Series". Change the name "Record" to Record Once". Seem more obvious than "Record" and "Add Timer", at least to me.

djp952
Posts: 985
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 » Thu Sep 26, 2019 3:21 pm

I can add menu options but they would appear in every timer related context menu. Changing a built in one like "Add Timer" would require a Kodi fork.

It's a great idea, though. I appreciate the suggestion!

djp952
Posts: 985
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 » Mon Sep 30, 2019 9:05 pm

Version 2.3.1 (2019.09.30)
  • Fix potential for a race condition in background task scheduler when synchronously executing a task
  • Improve performance of backend series episode (timers) discovery
  • (Windows) Wait for IPv4 network connectivity to become available before executing wakeup discovery tasks
Downloads: Because I promised another release in September, and I like to keep my word. The change log is a bit underwhelming, but a bit more than what you see there has gone on behind the scenes. As you are likely aware I've been working on updating the discovery mechanisms that have been in place since v1.0.0 to work a bit better and more efficiently, but the new stuff is still pretty far removed from what I would call "production ready". It will come, but it does need more work. As I've been working on that stuff I back-ported useful things learned/changed along the way that fit into the current baselines.

Improve performance of backend series episode (timers) discovery
This was a long-standing backlog item that was finally resolved. Getting the series episode (Kodi: Timers) information was always expensive and performed worse and worse with the more series you have set to record. I generalized the method used to speed up the EPG load into something more reusable and ended up gaining the performance improvement I was looking for. It's unlikely you will actually notice this right now, it will be more significant when I finalize the new discovery changes. It worked out well enough that I also ported the EPG load to use this new generalized method; it's measurably faster if you can count in milliseconds. If you are human like me you probably won't see any appreciable difference with EPG either :)

(Windows) Wait for IPv4 network connectivity to become available before executing wakeup discovery tasks
This is a pretty cool change put in place to resolve bds3151's concern on Windows. A couple/few releases ago I took out some code that would trigger when Kodi said the system is going to sleep or waking up. It didn't seem like it was useful due to (what I think is) a defect in Kodi Windows for these operations in that the "sleep" function is called after the system wakes up so there was little point to it. bds3151 discovered a problem with Windows systems that use sleep/wake in that if the IPv4 network isn't immediately available the PVR won't find any devices on the network and temporarily commit data suicide. This change adds a step to wait until the IPv4 network becomes active after a sleep/wake cycle before executing a new discovery. This will be of no use on non-Windows platforms right now, but I am trying to find a way to do the same thing for *nix, Android, and OS/X. Also, for what it's worth, this change is effective on both regular (Win32) Windows platforms as well as UWP (Windows 10 .APPX / Xbox One) platforms.

I'm getting ready for a business trip to Missouri later this week and will be away from Friday 10/4 until Wednesday 10/9. I pushed this release out now to try and head-off/correct any issues that may come from it before I go. Please don't hesitate to inquire about anything ... if it's known and can be resolved by 10/3 I will do my best!

Thanks as always for using the addon and all the feedback, but more importantly thanks to SiliconDust for continuing to let us use their forum!

njc
Posts: 5
Joined: Thu Oct 03, 2019 7:30 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by njc » Thu Oct 03, 2019 7:42 am

Hi.
Thank you for taking the time to write and publish this add-on, I set it up yesterday and it's pretty much seamless in setting up and running.

One question though, maybe I'm being thick... the "Recordings" in Kodi remains empty, even after recordings have been made. I can't see anywhere to configure this so that it points to the Windows share that my HDHomerun is recording to. What I am missing?

My setup:
HDHomerun Connect Quatro with subscription
Kodi on a RPi3 running LibreELEC
Windows 10, with HDHomerun recording to "C:\Users\Public\Recorded TV\HDHomeRun" which is shared as \\IP\Users\Public\Videos

There's a video on Youtube showing the same thing, from 2 minutes in.

https://www.youtube.com/watch?v=Qk4_QXj7rCs

Thanks

djp952
Posts: 985
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 » Thu Oct 03, 2019 8:43 am

njc wrote:
Thu Oct 03, 2019 7:42 am
Hi.
Thank you for taking the time to write and publish this add-on, I set it up yesterday and it's pretty much seamless in setting up and running.

One question though, maybe I'm being thick... the "Recordings" in Kodi remains empty, even after recordings have been made. I can't see anywhere to configure this so that it points to the Windows share that my HDHomerun is recording to. What I am missing?

My setup:
HDHomerun Connect Quatro with subscription
Kodi on a RPi3 running LibreELEC
Windows 10, with HDHomerun recording to "C:\Users\Public\Recorded TV\HDHomeRun" which is shared as \\IP\Users\Public\Videos

There's a video on Youtube showing the same thing, from 2 minutes in.

https://www.youtube.com/watch?v=Qk4_QXj7rCs

Thanks
Hi back! The Recordings area in Kodi gets populated with the Recordings reported by the HDHomeRun DVR engine back to the addon. You have the DVR installed and running on the Windows 10 box, or are you creating the recordings with another piece of software?

Assuming the DVR is on the Windows 10 machine, it's probably having problems being discovered by the RPi. By default the PVR will send out a UDP broadcast request on your network to try and find everything. There is an option to instead use an HTTP cloud-based discovery against the SiliconDust servers. Before we turn that on, you can see if everything is Kosher with a web browser. Navigate to http://ipv4-api.hdhomerun.com/discover, you should get back a list of all your tuners and DVR engines. Do you see an entry that says "StorageID"? If yes, let's turn on HTTP discovery and see if that solves it for you:

Kodi > Addons > Enter Addon Browser -> My Addons > PVR Clients > HDHomeRun DVR PVR Client > Configure > Advanced > Use HTTP cloud-based device discovery

You can restart Kodi if you want or just wait a few seconds to see if that populates the Recordings.

If still no dice, please send me a copy of the Kodi log, the addon lists out what it has discovered and any errors it encountered in there. I'll PM you an e-mail address you can use. The solution is probably hiding in there for us :)

The other consideration here is if you are using something else to record from the tuner. In that case, the Recordings area will never populate and you would have to set up a Video library in Kodi to see that shared folder on the Windows 10 machine.

njc
Posts: 5
Joined: Thu Oct 03, 2019 7:30 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by njc » Thu Oct 03, 2019 11:06 am

djp952 wrote:
Thu Oct 03, 2019 8:43 am
Hi back! The Recordings area in Kodi gets populated with the Recordings reported by the HDHomeRun DVR engine back to the addon. You have the DVR installed and running on the Windows 10 box, or are you creating the recordings with another piece of software?

Assuming the DVR is on the Windows 10 machine, it's probably having problems being discovered by the RPi. By default the PVR will send out a UDP broadcast request on your network to try and find everything. There is an option to instead use an HTTP cloud-based discovery against the SiliconDust servers. Before we turn that on, you can see if everything is Kosher with a web browser. Navigate to http://ipv4-api.hdhomerun.com/discover, you should get back a list of all your tuners and DVR engines. Do you see an entry that says "StorageID"? If yes, let's turn on HTTP discovery and see if that solves it for you:

Kodi > Addons > Enter Addon Browser -> My Addons > PVR Clients > HDHomeRun DVR PVR Client > Configure > Advanced > Use HTTP cloud-based device discovery

You can restart Kodi if you want or just wait a few seconds to see if that populates the Recordings.

If still no dice, please send me a copy of the Kodi log, the addon lists out what it has discovered and any errors it encountered in there. I'll PM you an e-mail address you can use. The solution is probably hiding in there for us :)

The other consideration here is if you are using something else to record from the tuner. In that case, the Recordings area will never populate and you would have to set up a Video library in Kodi to see that shared folder on the Windows 10 machine.
That's great, thank you for your response. I've just tried again with an Android phone running Kodi and the recordings are populated - so that's something! Also there are entries for StorageID too in the URL you posted.

I'll have a tinker over the weekend, will post back once I've had chance to figure it all out/desperately need more help. Hopefully the former.
Cheers.

djp952
Posts: 985
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 » Thu Oct 03, 2019 11:41 am

njc wrote:
Thu Oct 03, 2019 11:06 am
That's great, thank you for your response. I've just tried again with an Android phone running Kodi and the recordings are populated - so that's something! Also there are entries for StorageID too in the URL you posted.

I'll have a tinker over the weekend, will post back once I've had chance to figure it all out/desperately need more help. Hopefully the former.
Cheers.
Sounds good! I'll be out of town from tomorrow until next Wednesday, but I'll have my laptop and can help in the evenings; just don't think I'm ignoring ya if you don't get a prompt response :)

njc
Posts: 5
Joined: Thu Oct 03, 2019 7:30 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by njc » Mon Oct 07, 2019 12:25 am

djp952 wrote:
Thu Oct 03, 2019 11:41 am
Sounds good! I'll be out of town from tomorrow until next Wednesday, but I'll have my laptop and can help in the evenings; just don't think I'm ignoring ya if you don't get a prompt response :)
This is working as it should do, thanks.

I've realised that the programme that's recording isn't shown in "Recordings" until it has completed recording. When I originally posted about this, I'd only just installed your add-on and had one programme recording, so it wouldn't show up anyway.

Many thanks for your help, a great add-on which is a big step towards getting full wife-approval-factor as I try to move us away from Windows Media Centre.

Thanks again.

Griffo
Posts: 14
Joined: Thu May 28, 2015 6:15 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Griffo » Mon Oct 07, 2019 3:27 am

Apologies if this has been asked before (wow this is a long thread).

Is there a way to align the channel numbers in the HDHR with the channel numbers in Kodi? The Argus client let us to that, so the wife is use to channel 9 being at channel 9, not 13.

BTW - what an awesome add-on, so much better than the official one.

djp952
Posts: 985
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 » Mon Oct 07, 2019 4:28 am

Griffo wrote:
Mon Oct 07, 2019 3:27 am
Apologies if this has been asked before (wow this is a long thread).

Is there a way to align the channel numbers in the HDHR with the channel numbers in Kodi? The Argus client let us to that, so the wife is use to channel 9 being at channel 9, not 13.

BTW - what an awesome add-on, so much better than the official one.
There is! Go into the Kodi PVR & Live TV settings. Switch to Advanced or Expert view on the bottom left. Now there should be a 'Use channel numbers from the backend' setting you can toggle on.

This option only works if you have one PVR add-on enabled, but that will typically be the case. If you have more than one I also have an option in the PVR add-on settings to prepend the channel number to the channel name which could be used.

njc
Posts: 5
Joined: Thu Oct 03, 2019 7:30 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by njc » Mon Oct 21, 2019 11:22 am

Hi
I've now been able to move away competely from Windows Media Centre after umpteen years of using it - so thank you again for your work.

I've tried to install this on my Xbox One, but after Kodi has installed the UWP add-on (from here https://github.com/djp952/pvr.hdhomerundvr/releases) it responds that "Add-on couldn't be loaded. An unknown error has occured."

Any ideas how I can troubleshoot would be much appreciated.

Thanks

djp952
Posts: 985
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 » Mon Oct 21, 2019 7:38 pm

njc wrote:
Mon Oct 21, 2019 11:22 am
Hi
I've now been able to move away competely from Windows Media Centre after umpteen years of using it - so thank you again for your work.

I've tried to install this on my Xbox One, but after Kodi has installed the UWP add-on (from here https://github.com/djp952/pvr.hdhomerundvr/releases) it responds that "Add-on couldn't be loaded. An unknown error has occured."

Any ideas how I can troubleshoot would be much appreciated.

Thanks
You're welcome, glad it's been useful!

Universal Windows (XBox) is like Android used to be, you can't install or update binary addons. It has to do with how Microsoft has sandboxed everything to the nth degree. BUT never fear, there is a solution!

Use the .APPX and .CER files as opposed to the .zip file

The .APPX is a repacked copy of the Kodi .APPX with the binary addon included. Since it has been dissected and put back together again I had to re-sign the .APPX with my own certificate file, hence the need for the .CER file as well. The .ZIP file is generally pointless, it's there for completeness and for any developers/modders that might want it to do the same thing I do with their own fork of Kodi UWP.

I am unaware of if the Kodi UWP install is coming through the store now or not, if it is you probably didn't need to install a Kodi .CER file. You will also have to enable 'side loading' on the XBox One as well. There should be guides on the Internet somewhere for how to add a "Trusted Root Certificate" using a .CER file -- do this with my .CER (if you trust me of course). Once that is in place, and side-loading is enabled, you should be able to install the .APPX by just running it. It's an otherwise unmodified version of Kodi 18.4 UWP, I change nothing except adding my addon files.

I wish Kodi UWP was available for Windows 10 from the store so I could give you guys better directions here. I know a few people have done it, but my wiki still says something like "TBD" for XBox One. Maybe I can borrow one from somebody at work and get the steps documented for you.

I apologize for the difficulties you will have in advance, and the inherent limitations involved with you now needing to rely on me to provide a timely new .APPX when new versions of Kodi are released. Hopefully they will figure out a way to deal with binary addons on UWP like they did with Android, but UWP is a tougher nut to crack overall and doesn't have nearly as many Kodi users out there :(

njc
Posts: 5
Joined: Thu Oct 03, 2019 7:30 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by njc » Tue Oct 22, 2019 12:10 am

Thanks for this, I'll do some digging and see if I can get it installed.

TBH, I'm only adding it to the Xbox for completeness and on the off chance I needed to use it once in a while.

Thanks again for your help.

djp952
Posts: 985
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 Oct 22, 2019 9:55 am

njc wrote:
Tue Oct 22, 2019 12:10 am
Thanks for this, I'll do some digging and see if I can get it installed.

TBH, I'm only adding it to the Xbox for completeness and on the off chance I needed to use it once in a while.

Thanks again for your help.
If you happen to jot down the steps you need to take and would be OK to share I can post those and of course provide proper credit for the work :)

djp952
Posts: 985
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 » Mon Oct 28, 2019 8:49 pm

It took longer than I expected to get things the way I wanted them to be, but I have a new (and very large) beta for you guys to try ...

Version 2.4.0~beta1
  • Update SQLite database engine to version 3.30.1
  • Enforce previously relaxed rules regarding invalid JSON data retrieved from the backend and/or local devices
  • Limit EPG data requests to no more than 24 hours into the future if no devices with DVR authorization where discovered
  • Refactor recordings database table to key on auto-generated recording identifier(s) and improve query performance
  • Improve performance of Recorded TV last played (resume) position operations
  • Display prompt indicating that an individual episode timer cannot be removed from a series recording rule
  • Trigger an automatic recording discovery to occur 15 seconds after a new recording rule has been added
  • Trigger initial discovery operations to occur after PVR Manager has been fully initialized and is requesting data
  • Wait for initial discoveries to complete before responding to individual PVR Manager data requests (channels, timers, recordings)
  • (Windows) Limit wait for IPv4 network connectivity during wakeup to one minute
  • Trigger a timer update when notified that the Kodi EPG "days to display" setting(s) have been changed
  • Remove "Startup discovery task delay" advanced setting
  • Remove "Reset discovery database" PVR Client Specific setting
This particular beta is available for both Krypton and Leia ....

Downloads for Krypton (OneDrive): https://1drv.ms/u/s!AgEGEEVzGNq-i_8T3h4 ... w?e=oU48Bo
Downloads for Leia (OneDrive): https://1drv.ms/u/s!AgEGEEVzGNq-i_8Umet ... w?e=j924Ib

The main intent behind v2.4.0 was to get rid of a bunch of cruft that has accumulated over the past 2.5 years, primarily in regard to how discovery works. I've been adding support for this grand scheme of mine for a while now, I'm hoping this brings it full circle. I am realistic, however, and don't expect that this many changes will be perfect out of the box and would like your help, doubly so on Krypton, to make sure I got this right. I'm not in a good position to test Krypton anymore for non-Windows platforms.

Even with a change log this extensive, I only want to call out a few things right now, and will leave the rest as a surprise ...
  • Trigger initial discovery operations to occur after PVR Manager has been fully initialized and is requesting data
  • Wait for initial discoveries to complete before responding to individual PVR Manager data requests (channels, timers, recordings)
This are the most significant changes, and they will be noticeable. There has been a race condition in the addon since Day 1 in regard to how I discover the HDHomeRun information that has been mitigated for some time by adding a "Startup discovery task delay" setting (3 seconds). Rather than adding a delay, this change waits to start the discovery operations to the point where Kodi first asks for something (channels), which ensures that the PVR Manager is started and running. Discovery still executes asynchronously and as fast as it can, but there are now blocks in place to make sure that the necessary discoveries have occurred before returning any data to Kodi.

You're going to notice this since it will appear that Kodi startup is taking longer now. There will be a pause when you see the "Loading channels", "Loading timers", and "Loading recordings" banners. This is the PVR waiting for the required initial discoveries to finish. The end result is actually measurably faster startup than before, even if it doesn't seem like it, and all the information Kodi will display will be accurate and up-to-date. The old way would trigger updates after discovery if things have changed, so the information you see at first would be stale yet updated fairly quickly.

If you really don't like this behavior, I can make the Timer and Recording discovery operations happen after the fact like they were and push updates to Kodi if things have changed, but I can't make the Device/Channel/Guide Metadata this way anymore -- too many issues are solved by ensuring those have been completed before giving any data back to Kodi.
  • Trigger an automatic recording discovery to occur 15 seconds after a new recording rule has been added
This is a neat little change -- anytime you add a new Recording Rule (Timer), it will trigger a recordings update in 15 seconds to better catch a recording that has been started as a result instead of making you wait for the next full refresh for it to show up.
  • Remove "Reset discovery database" PVR Client Specific setting
This was a bit of a "lightsaber" option all along -- it was powerful, but also made it really easy to sever one of your own limbs in the process. There are so many things that could go wrong by ripping the database out from under the PVR while it's running, and it really wasn't hard to prove that. As a result, I opted to get rid of it entirely. To be successful, this would have to have been guaranteed to be executed while nothing else of importance was happening; the prime example was during an EPG load. Unexpectedly having a lack of device authorization strings since the device table was nuked screws everything up.


I think I'll leave this at that for now, I don't want to unnecessary influence public testing by over explaining things like I usually do. If you are game for a beta release that may need to be rolled back, please go for it and let me know what your experience was like. I have no intention of releasing v2.4.0 in October to allow for a lot more testing, this is at best an early November target. Plenty of time to correct whatever egregious mistakes I've made :)

THANK YOU!!!

Post Reply