Unofficial Kodi HDHomeRun DVR PVR Client

Kodi Community Development

Moderator: TVJunkie198

Post Reply
djp952
Posts: 1016
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 » Wed Jun 26, 2019 4:21 pm

jasonl wrote:
Wed Jun 26, 2019 11:32 am
The old Kodi support specified a tuner in the URL. There was no auto support. It was very rudimentary because it was just loading strm files generated by HDHomeRun Setup and feeding them to libhdhomerun. Now that Kodi has binary add-on support it ought to be possible to build libhdhomerun in to an add-on and use its tuner pooling API to let it automatically pick a device/tuner to use. If someone actually wants to take the time to do that, more power to them :D.
Already in there! It's like Prego sauce. Lol. I use libhdhomerun for tuner selection and UDP discovery (when enabled). The only catch is I have a race condition since I can't transfer the lock to the HTTP interface, so there is a chance that it could be locked by another device in the few milliseconds of gap. I don't think many people turn on my "Stream directly from tuner" option anyway, timeshifting support is half the fun!

For the UDP streaming (experimental) I'm keeping the lock after selection as you would expect. I'm not sure there will be any benefit here over HTTP but I try to satisfy as many requests as are reasonable!

djp952
Posts: 1016
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 » Wed Jun 26, 2019 7:53 pm

signcarver wrote:
Wed Jun 26, 2019 9:56 am
Djp952: If you wish to support older devices for live streaming, what you will probably need is someone with an old device to give you their lineup.json (and possibly discover.json as it provides a base url though you may have obtained that through broadcast) which should have the tuning parameters... it might be difficult to test with a prime if one doesn't have clear qam.

As I recall, it gives GuideNumber, GuideName, and URL with the url being hdhomerun://{ip or deviceid}/chxxx000000-yyyy where the xxx after the ch was in MHz (thus why also having the 6 0s after)... i believe very old versions of kodi may have supported this hdhomerun protocol but thought they took it out shortly after the connect's release though i thought they used channel=xxx000000&program=yyyy when such was in xbmc and I don't recall if there was an auto for tuner number as i only recall specifying tuner... its been too long since i have used the legacy methods.


edit: if you wish to work towards that goal prior to getting a lineup from a legacy device, you can add ?tuning at the end of the lineup.json url to get the tuning parameters (won't work on a prime with TA... may still need to use virtual channel for encrypted content from prime) so you can experiment on using frequency/program id rather than virtual channel number.
Great tip, thank you so much. I didn't know about the ?tuning parameter at all, that's quite nice. Especially since tuning via the virtual channel number stopped working on me - lol. I have 2 old first-gen ATSC/QAM tuners in a box 'round here I fire up from time to time, I think it's cool how SD provides the JSON via the backend since the tuners can't support it. I'm shying away from actually including legacy tuner support at this point, just streaming via libhdhomerun is proving to be more difficult than I expected :)

mrfrankmrfrank
Posts: 29
Joined: Fri Jul 01, 2011 7:02 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by mrfrankmrfrank » Thu Jun 27, 2019 8:22 am

I just want to say that this addon is everything the hdhomerun dvr needed. I couldn't be more impressed with the speed and responsiveness of it. I am very new to this plugin as i've only just recently switched off of wmc. I am trying to get edl working. I am using the hdhomerun dvr on a windows box recording to the following folder structure. d:\hdhomerundvr\recorded tv \nameofshow Commercial skipping is not currently working. I check the logs and see that whether or not I choose the flattened file hierarchy the addon is looking for the file in \hdhomerundvr\recordedtv\show.edl instead of \nameofshow\show.edl.

example my edls are as follows d:\hdhomerundvr\recorded tv\masterchef\masterchefs01e01.mpg / .edl
logs show the addon looking for d:\hdhomerundvr\recordedtv\masterchefs01e01.edl

I'm currently testing this on kodi on mac. The dvr is a separate windows box.

Thank you for your time.

djp952
Posts: 1016
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 Jun 27, 2019 11:18 am

Thanks! I'm glad you enjoy using it!

As for the EDL problem, what happened here is that the latest RECORD (DVR) engine removed an attribute from the data that I was using to figure out what directory the file(s) will be in. As a result, the directory name disappears. Unfortunately I have no workaround for you, it requires a code change. This also affects the breakout of "Movies" and "Sports" (soon to be called "Sporting Events") in the Kodi Recordings list too. Everything there will appear based on the title of the series/movie/etc.

The good news is that I've already fixed it. I was hoping to wait for an answer to my question about the change here: viewtopic.php?f=125&t=71757, but I think what I have is fine. My only holdup was knowing what "Category" attributes might exist that I wasn't able to find on my own.

I don't think the current changeset I'm working on (UDP streaming) is ready for prime time, so let me go over what's in the next version this evening and make a decision on if I should release that as v2.1.0, or just backport the change you need into a quick-fix v2.0.5. v2.1.0 has a handful of non-trivial things in it, I always worry that I haven't tested it enough, I hate making people turn around and re-install a quick-fix like a day or two later because I missed something :)

If you throw a watch on this thread, I always post when a new release is available. Be it 2.0.5 or 2.1.0 it should fix this for you!

mrfrankmrfrank
Posts: 29
Joined: Fri Jul 01, 2011 7:02 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by mrfrankmrfrank » Thu Jun 27, 2019 11:48 am

I don't know who you are djp952, but I couldn't be more impressed with your attitude and dedication. Realistically your work might be the ONLY route I personally would choose to walk away from wmc. I've been heavily involved with diy dvr/pvr/media center for over 10 years. I've been running windows media center and various accompanying software since at least 2008. Recently my windows 7 box that I planned on running indefinitely with WMC / serverwmc / kodi clients has been acting up. 3 times in the past year i've had to completely reset wmc and start over. It's been a long haul for that box and I think recording through over 50 series across 9 tuners for no less than 6 years has taken its toll on stability.

I've been looking for a replacement for some time. If you google "best pvr backends" you see numerous posts on reddit about nextpvr, tvheadend, argus tv, etc etc. I have been in varying stages of evaluating these for the past couple of weeks. Argus tv hasn't had an update in years, nextpvr looks promising but cannot do commercial skipping through kodi using the native pvr setup. tvheadend has taken me 3 days to get it working with my prime devices.... but then i have to configure comskip to run in linux etc.

hdhomerun dvr has had potential in my eyes... i figure they could potentially handle tuner priority better than anyone. However the lack of edl support in their apps (i understand priorities) has again lead me searching for that perfect "kodi with edl support backend"

The reason I bring this all up is because after months and months of searching for something to replace wmc after a decade of use, YOUR kodi addon with the hdhomerun dvr backend seems to be the ONLY option. I have sent donations to various coders over the years. krusty from serverwmc, the author of epg123, even dragonglobal who wrote dvrmstoolbox so many years ago. Money is extremely tight for me right now but I assure you I will happily contribute to your efforts going forward when I can.

Thank you!
ps, some people may read this long rant and think.... wow this guy has an addiction to diy dvr / pvr... You know what... its a hobby, one of a few that I have. I've invested thousands of dollars over the years, hundreds of hours to perfect my setup. My wife and I enjoy watching tv together and it's what we're into. So yes, in short, I'm very excited to know that there is a path for me to continue recording television my way.

djp952
Posts: 1016
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 Jun 27, 2019 2:39 pm

Thank you for the kind words :) As a rule I don't accept any donations, monetary or otherwise. Having people use it and be generally happy with it is all I need. I can't remember the last time I paid for software. OK, not true, I did pay for Paint.NET from the Windows Store at some point in the recent past - lol.

Looking at your post again, and considering I have never actually taken the time to document how EDL works here, there are some notes about it.

- EDL in Kodi Leia has at least one bug you should probably review: https://github.com/xbmc/xbmc/issues/15186. To help with this problem, the PVR has a setting "Report CUT indicators as COMBREAK indicators". What this does is tell Kodi that a CUT is actually a COMBREAK, which works a bit better.

edit: I just tested this, CUT is still pretty broken in Kodi, you'll want to enable this option.

- Only the ComSkip .EDL file format is supported right now

- The .EDL file names have to exactly match the file name of the HDHomeRun .MPG files. As an example, if I have this recording (don't judge the program, I have a 5yr old girl):
\\{mynas}\HDHomeRun\Tangled The Series\Tangled The Series S01E01 20170324 [20170324-2330].mpg
The .EDL file has to be named:
\\{mynas}\HDHomeRun\Tangled The Series\Tangled The Series S01E01 20170324 [20170324-2330].edl
I'm going to re-test the flattened hierarchy option before sending anything out, but that particular rule also applies there. All your .EDL files can be in one directory, but the name has to match what I can reconstruct from the recording metadata. The metadata doesn't always include things like the Season and Episode number, so the original feature requester and I came up with this as the most reliable way to find the .EDL files.

Otherwise, it seems like you figured the rest out without the missing documentation (cool!). I just want to be sure that you are aware of the limitations/restrictions so you don't run into disappointment. If I think of any other SNAFUs you might hit, I'll let you know.

mrfrankmrfrank
Posts: 29
Joined: Fri Jul 01, 2011 7:02 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by mrfrankmrfrank » Thu Jun 27, 2019 3:26 pm

Thank you again for your time on this. With regards to limitations on edl with Kodi, I have been mostly used to the functionality as currently present within it... ie I've been enjoying commercial skip with edl files for years now through serverwmc which is a kodi addon and backend that communicates with wmc. As far as I understand serverwmc isn't doing ANYTHING with edl files other than telling kodi where they are located on an smb share. Since serverwmc has a windows "serverish" counterpart to it's kodi addon, the "server" side has the ability to push the smb credentials for the recorded tv / edl file paths to the kodi addon whereas with your addon you need to specify the smb path via the addon. This actually was the more difficult part to getting your addon working as smb browsing seems to be broken in kodi... ie.. i couldn't go to your addon config and browse smb to my recorded tv path. I had to go and add the path as a video source elsewhere in kodi and then I was able to browse that path from your addon config.

Lastly I was able to copy my masterchef edl and put it in the root recorded tv path without the /masterchef/ subfolder and using your addon, commercial skip worked as expected. This was a manual test as since I use dirmon to create the edl files using comskip, I am unable to tell dirmon to dump all edls from various show subfolders into a root recorded tv folder. It simply generates them into the respective show subfolder so flattened hierarchy wont likely work for me.

happy to help continue testing / advancing your addon. Thanks again

djp952
Posts: 1016
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 Jun 27, 2019 4:11 pm

We have auto-update for Linux! Well ... kinda/sorta ... see notes below :(

Version 2.1.0 (2019.06.27)
  • Update cURL library to version 7.65.1
  • Update libhdhomerun library to version 20190607
  • Switch default device discovery method to network broadcast from HTTP
  • Change default discovery interval from 1 hour to 10 minutes
  • Remove "Use network broadcast for device discovery" setting
  • Add "Use HTTP cloud-based device discovery" advanced setting
  • Fix bug causing multi-homed HDHomeRun devices from being detected during broadcast device discovery
  • (Jarvis/Krypton) Fix bug introduced in v2.0.0 preventing the "Delete episode" string from appearing in context menu(s)
  • Use HTTP POST method when modifying backend recording rules
  • Adapt to HDHomeRun RECORD engine 20190621 breaking changes
Downloads:
Kodi 16 "Jarvis" : https://github.com/djp952/pvr.hdhomerun ... odi-Jarvis
Kodi 17 "Krypton" : https://github.com/djp952/pvr.hdhomerun ... di-Krypton
Kodi 18 "Leia" : https://github.com/djp952/pvr.hdhomerun ... -Kodi-Leia


The big change in this release isn't actually in the changelog ... I re-worked all of the auto-update stuff so that it would work on Linux systems (after this release, of course)! Yeah! Unfortunately my success here is partial, at a minimum OSMC didn't work. This had to "go live" to really be tested, hopefully it's something I can fix in the repository but the log file on OSMC looked ugly like it was using a bad pointer internally. So far Intel-based Linux systems are working great. I'm hopeful it's an OSMC specific concern, but will start breaking out all the various hardware and going through each platform to see what's what. You still need to manually install this version and there are no newer versions, so no harm done (yet).

Note: Windows, Android and OS/X users will still get an auto-update from 2.0.4 to 2.1.0 using the existing mechanism. Once 2.1.0 is installed it will start looking at the new repository layout without any action required on your part.

The highlighted items in the changelog are the other notable externally facing changes:

- Switching from HTTP to broadcast discovery by default was a very often requested change, and I caved in due to the new ability to have multiple HDHomeRun RECORD engines available. HTTP discovery caches your devices for up to 24 hours, so turning off an existing device would cause some annoying problems. I think typically most people don't turn off their tuners, but playing with secondary and even tertiary RECORD engines on the network got annoying real fast since the PVR tries to use what it knows about. Related to this annoyance, the default discovery interval has been dialed back down to 10 minutes from 1 hour.

- There was a change in the new 20190621 HDHomeRun RECORD (DVR) engine that removed a metadata attribute I was using for a couple things. This would manifest as recordings previously listed in a "Movies" or "Sports" folder being in the top-level with all the other recordings, and a failure to find any EDL files. The adjustment changes a couple things in the Recordings view as well -- "Movies" are still "Movies", "Sports" will now be "Sporting Events", and there will be a new folder named "Specials", if you have any of those. So if you can't find something, see if you have a "Specials" folder now, it's probably in there.

Sorry that Linux auto-update isn't quite the resounding success I was looking for. It shouldn't hurt anything other than not working, but folks using OSMC and perhaps other Linux-based platforms may have to wait for v2.1.1 for me to get this right.

Did I break anything this time around? Let me know!

otaku
Posts: 337
Joined: Thu Sep 24, 2015 7:30 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by otaku » Thu Jun 27, 2019 6:11 pm

I have a really silly question about the guide.

We use your client on 3 shields in the house and 2 of them display the guide in multiple colors and 1 displays the guide only in gray.

Can you point me to where I can change my gray guide to a multi color guide?

Thank You!

djp952
Posts: 1016
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 Jun 27, 2019 6:42 pm

otaku wrote:
Thu Jun 27, 2019 6:11 pm
I have a really silly question about the guide.

We use your client on 3 shields in the house and 2 of them display the guide in multiple colors and 1 displays the guide only in gray.

Can you point me to where I can change my gray guide to a multi color guide?

Thank You!
Good question I thought there used to be a setting for that in Kodi, but I don't see anything.

There is a PVR setting "Use back end genre strings" under General that if enabled will remove the colors since Kodi thinks everything is unknown. Could it be that?

otaku
Posts: 337
Joined: Thu Sep 24, 2015 7:30 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by otaku » Thu Jun 27, 2019 6:59 pm

Weird

I drop into Leia / PVR / General and I don't see "Use back end genre strings."

Hmm...

otaku
Posts: 337
Joined: Thu Sep 24, 2015 7:30 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by otaku » Thu Jun 27, 2019 7:08 pm

Okay I found the "Use back end genre strings" and it does not impact the guide colors.

I think I'll go eat a chocolate chip cookie and see if that helps. :D

otaku
Posts: 337
Joined: Thu Sep 24, 2015 7:30 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by otaku » Thu Jun 27, 2019 7:35 pm

I stand corrected!

You were right! It was the "Use back end genre strings."

It just needed a bit to kick in. So in the time it took to restart Kodi and me eat a chocolate chip cookie my guide now has wonderful colors.

Thank you for pointing me to the precise spot that solved the issue.

jasonl
Silicondust
Posts: 14749
Joined: Sun Oct 28, 2007 9:23 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by jasonl » Thu Jun 27, 2019 7:43 pm

Did you bring enough cookies to share with the whole class?

djp952
Posts: 1016
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 Jun 27, 2019 8:13 pm

otaku wrote:
Thu Jun 27, 2019 7:35 pm
I stand corrected!

You were right! It was the "Use back end genre strings."

It just needed a bit to kick in. So in the time it took to restart Kodi and me eat a chocolate chip cookie my guide now has wonderful colors.

Thank you for pointing me to the precise spot that solved the issue.
Oops, I didn't mention that the setting only applies to NEW guide data. It can't retroactively go back into data Kodi already has and change it :)
jasonl wrote:
Thu Jun 27, 2019 7:43 pm
Did you bring enough cookies to share with the whole class?
LOL! I hope they are chocolate chip.

Post Reply