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 » Tue Oct 29, 2019 5:49 am

Thanks for your continued work on this.

My memory could be incorrect since I've had a DVR for a few years, but I thought that without a DVR you were allowed to get 3 days worth of guide data. Do you know how much guide data HDHomeRun app can view without a DVR? What was the reason for reducing this to 24 hours in the beta? I have friends (without a DVR) for whom I've installed this client who want to see what sports events are coming up on the weekend on Friday.

Thanks.

signcarver
Expert
Posts: 8529
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 » Tue Oct 29, 2019 6:22 am

Without a dvr subscription It used to be 4 hours... they increased it to 24 hours.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by ddejager » Tue Oct 29, 2019 6:43 am

signcarver wrote:
Tue Oct 29, 2019 6:22 am
Without a dvr subscription It used to be 4 hours... they increased it to 24 hours.
Thanks for the facts!

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 29, 2019 7:53 am

I have a tuner that isn't associated with the DVR service so I was able to confirm the 24 hours as well. The idea behind the change itself was to limit asking the backend for data that won't exist.

The way EPG is loaded was refactored to use a new 'aggregate' loader I made for the recording rule episodes, but that didn't allow for a way to stop the queries if nothing came back like the previous EPG specific loader could.

I hope it's a good balance of better performance and simplified code, but that's why we test! Lol.

I appreciate your willingness to always review and play with my crazy schemes ;)

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 29, 2019 8:41 pm

timecutter wrote:
Wed Sep 25, 2019 3:56 pm
EDL - multiple record engines

If we have multiple record engines, current EDL implementation only allows for one EDL location. Haven't looked at the code due to laziness, would it be possible to add multiple locations for it to look for the EDL files in. Like check location 1, if no then check 2 and then punt if not in either.

EDL works well for us here otherwise.

thanks
Hi timecutter, I have this this working on Leia/Matrix, but need to figure out how to make it work on Krypton before adding it formally. I can still add it to Leia/Matrix even if Krypton is a no-go, but I wanted to let you know I didn't forget about this one. The main problem I have with it is that EDL is completely and totally broken in Leia 18.4, and you will need to use a nightly on that platform to get anything EDL related to work.

My plan is to include this in v2.4.0 of the PVR, but it will take me another day or two to figure out Krypton :)

edit: Krypton is go. Figured out how to make the settings work generally the same as Leia/Matrix!
Last edited by djp952 on Wed Oct 30, 2019 5:10 pm, edited 1 time in total.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by ddejager » Wed Oct 30, 2019 4:02 pm

The primary channel that I use to watch/record CBS in my area is [temporarily I hope] unavailable to me due to interference after the most recent set of FCC frequency changes. I am able to receive CBS on a second channel, although the channel is weaker and less reliable. So I wanted to change the recordings of the shows I watch from WWTV-HD to WFUP-CB. I was able to do this by changing the timer rules.

In doing so I noticed two strange issues:
1) I initially tried to set the channel to "Any channel". When I do this no timers appear to be set. If I change it to WWTV-HD or WFUP-CB it finds the show(s) and timer rules show up. Why is this?
2) I've also noticed that all of the new episodes of shows appear to be treated as reruns (Marked with [R] in the listings). Why might this be? If I set the timer rule to record "only new episodes" it does appear to find only the new ones, but I seem to recall that I've sometimes missed shows set this way, so I have been using "only recent episodes".

I did upgrade to the 2.4.0~beta1. No problems observed so far.

Separate but related question: Is there a way to tell the DVR to record the same show from two different channels at the same time? I know, this seems silly on the surface, but when the primary channel is down and the secondary channel is weak, it would be nice to get a clean copy if the primary comes back up....or for some people if both channels are flaky from time-to-time, one might be good and one might be bad at any given time. I'm not asking for an enhancement, just wondering how it works...

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 » Wed Oct 30, 2019 5:23 pm

ddejager wrote:
Wed Oct 30, 2019 4:02 pm
1) I initially tried to set the channel to "Any channel". When I do this no timers appear to be set. If I change it to WWTV-HD or WFUP-CB it finds the show(s) and timer rules show up. Why is this?
2) I've also noticed that all of the new episodes of shows appear to be treated as reruns (Marked with [R] in the listings). Why might this be? If I set the timer rule to record "only new episodes" it does appear to find only the new ones, but I seem to recall that I've sometimes missed shows set this way, so I have been using "only recent episodes".
I'll try all of these tonight make sure these didn't break due to recent changes ...

1) No clue! LOL. The "Any Channel" vs. a specific channel doesn't alter how I display anything, I get it from the backend. The data will give me a "RecordingRule:1" flag in the episode data that I use to create the Kodi Timer object (not the Timer Rule). These are kinda flaky anyway (sorry SD), I interpret this as "it might record, unless your DVR engine decides not to". Best guess might be a timing issue? As in maybe the backend needs a few seconds to adjust when you change a rule and I'm asking for updated information immediately.

2) I forget the exact user that requested this feature, but we negotiated what seems like a reasonable rule to follow, since the backend doesn't specifically tell me if something is a rerun or not. The current rule is as follows:

Code: Select all

// Determine if the episode is a repeat -- unlike recordings there is no firstairing field to key on, 
// so if the start time of the program is within 24 hours of the originalairdate, consider it as a first airing
bool isrepeat = !((item.originalairdate + 86400) >= item.starttime);
The "Recent Episodes" flag is also something that just gets passed onto the backend, I don't use that for anything specific. The backend seems to have improved a lot in that it applies at least some of the rules and flags to the series episodes data and removes a lot of "RecordingRule:1" flags, so these days we are seeing less Timers in Kodi than we used to, which is good. I think to be super accurate it would be something SD should implement on the DVR engine, if it could be interrogated to see what it will REALLY record, that would be awesome.

If you play with the Any Channel vs. channel again, and the Timers look wrong to you, try bouncing Kodi. This will give the backend plenty of time to make any updates it wants to it's database (or whatever it uses) and will reload everything when Kodi restarts. If the information is identical, we can dig into the data itself and ask SD for help. If the data looks more accurate, perhaps I can just add a little delay after changing a recording rule to refresh the timers. Right now it's basically "do it NOW", a delay wouldn't hurt.
ddejager wrote:
Wed Oct 30, 2019 4:02 pm
Separate but related question: Is there a way to tell the DVR to record the same show from two different channels at the same time? I know, this seems silly on the surface, but when the primary channel is down and the secondary channel is weak, it would be nice to get a clean copy if the primary comes back up....or for some people if both channels are flaky from time-to-time, one might be good and one might be bad at any given time. I'm not asking for an enhancement, just wondering how it works...
Not insofar as I know with a single rule, but you should be able to add a Date/Time rule that overlaps a Series rule, I've done similar things before. So let's say you have, I dunno, "Madam Secretary" recording on CBS #1 with the Series Rule, you should be able to do a right-click/record operation in the EPG on CBS #2 to get two recordings. I've found Date/Time rules tend to record regardless of if the DVR has already recorded that episode in the past.

Worth a try?

apazrjon
Posts: 3
Joined: Wed Aug 16, 2017 2:18 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by apazrjon » Wed Oct 30, 2019 5:51 pm

Hey man! Been using your program for the last few years like a champ! Best damn thing ever! Having an issue I was hoping u might she'd some light on though. I have a pretty simple setup, nothing fancy. I've got a shield tv with the hdhomerun DVR record engine on the same shield. I am Using Leia 18.4 with ur pvr client. Never had this issue before, but when I try to record anything thru Kodi, I get pop up saying something like "timer functions require DVR subscription". I have a subscription. If I use just the hdhomerun app without Kodi, it will record. Nothing I know of changed in my set up. Any thoughts?

Really appreciate ur work on this app. It is a staple on my shield tv/Kodi all in one streamer. :D

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 » Wed Oct 30, 2019 6:33 pm

apazrjon wrote:
Wed Oct 30, 2019 5:51 pm
Hey man! Been using your program for the last few years like a champ! Best damn thing ever! Having an issue I was hoping u might she'd some light on though. I have a pretty simple setup, nothing fancy. I've got a shield tv with the hdhomerun DVR record engine on the same shield. I am Using Leia 18.4 with ur pvr client. Never had this issue before, but when I try to record anything thru Kodi, I get pop up saying something like "timer functions require DVR subscription". I have a subscription. If I use just the hdhomerun app without Kodi, it will record. Nothing I know of changed in my set up. Any thoughts?

Really appreciate ur work on this app. It is a staple on my shield tv/Kodi all in one streamer. :D
Howdy! Hmm.. I just tried this out, it worked here so it's not something weird going on with the backend. I intentionally don't log things like your Device Authorization strings, but if you want to play in the web browser a bit we can do this manually, if you're game (it looks harder than it is). I thought "my.hdhomerun.com" used to display the status, but it doesn't look like it does anymore. The harder way ...
You should get back a text document similar to this:

Code: Select all

{
    "AccountEmail": "nobody@notmyrealemail.com",
    "AccountDeviceIDs": [
        "XXXXXXXX",
        "XXXXXXXX"
    ],
    "DvrActive": 1,
    "AccountState": "Active"
}
If you get back just the word 'null', make sure you got the URL right and the DeviceAuth string right.

If you see "DvrActive":1, then your account is all good and something wonky is happening with the PVR. If this is the case, can you send me a Kodi log? Perhaps it's having trouble getting to the API for some reason, such a condition should be logged. At a minimum we should see zero devices with a "DVR Authorized" note next to them :)

If you don't see "DvrActive", or it's zero, we will have to ask SiliconDust for help with your account.

If you want to send me a log, let me know, I'll PM you an e-mail address (or just, you know, look at the addon author via Kodi, use that address).

NOTE: It is technically possible for me to use your PVR database file to access this API from here temporarily, but I've avoided that since this new account API was added. I'm worried that something more personally identifying than your e-mail address might pop up, I'd rather stick to the Kodi log and/or ask SD for help with any account related items. I'm kind of a stickler about people's privacy.

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 » Wed Oct 30, 2019 7:26 pm

djp952 wrote:
Wed Oct 30, 2019 5:23 pm
ddejager wrote:
Wed Oct 30, 2019 4:02 pm
1) I initially tried to set the channel to "Any channel". When I do this no timers appear to be set. If I change it to WWTV-HD or WFUP-CB it finds the show(s) and timer rules show up. Why is this?
1) No clue! LOL. The "Any Channel" vs. a specific channel doesn't alter how I display anything, I get it from the backend. The data will give me a "RecordingRule:1" flag in the episode data that I use to create the Kodi Timer object (not the Timer Rule). These are kinda flaky anyway (sorry SD), I interpret this as "it might record, unless your DVR engine decides not to". Best guess might be a timing issue? As in maybe the backend needs a few seconds to adjust when you change a rule and I'm asking for updated information immediately.
ddejager, there is indeed a PVR bug that is causing this behavior, and I apologize -- it seems to have been here for a while! When a recording rule is modified, I am always sending a "ChannelOnly" flag (among others), and if you have it set to "Any Channel" it's blank so no channels will be used. Adding a new recording rule with "Any Channel" is correct and works as expected. Not sure why I did it differently for modify, but it's wrong.

Thank you so much for finding this, I will correct it ASAP and get out a 2.4.0~beta2 once it looks good. beta2 will also have the changes timecutter requested for multiple EDL folders. This release is starting to feel more like a 3.0 :)

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 » Wed Oct 30, 2019 8:22 pm

Perfection is an admirable, if apparently unattainable, goal of software development ...

Version 2.4.0~beta2
  • 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
  • Fix bug preventing selection of a non-writable path as a valid EDL file location
  • Rename "EDL file path" EDL setting to "Primary EDL file path"
  • Add secondary and tertiary "Additional EDL file path" EDL settings
  • Fix bug that caused modification of recording rule back to default value(s) from being properly applied
This particular beta is available for both Krypton and Leia again:

Downloads for Krypton (OneDrive): https://1drv.ms/u/s!AgEGEEVzGNq-jIMMAvQ ... A?e=sft3EV
Downloads for Leia (OneDrive): https://1drv.ms/u/s!AgEGEEVzGNq-jIMNePk ... g?e=xmySxH

2.4.0~beta2 (Note: I'm seriously considering renumbering this as 3.0.0 at this point) adds a recently requested feature from timecutter as well as a fix for a problem reported by ddejager. My thanks to you both.

These three items support the request for multiple EDL file locations by timecutter:
  • Fix bug preventing selection of a non-writable path as a valid EDL file location
  • Rename "EDL file path" EDL setting to "Primary EDL file path"
  • Add secondary and tertiary "Additional EDL file path" EDL settings
These items allow you specify a secondary and tertiary path on which to locate EDL files. On all platforms these new settings will not appear until/unless you set the first path to something other than blank, and they will appear in order. If you set a primary path, the setting for the secondary path setting will now appear, if you set a secondary path the tertiary path will appear. The only note I have here is that on Krypton you need to have to click "Defaults" to clear out these settings -- on Leia/Matrix you can use the DEL key to clear them out.

This item supports the defect/bug reported by ddejager:
  • Fix bug that caused modification of recording rule back to default value(s) from being properly applied
This turned out to be a long-standing defect in which I wasn't properly resetting all of the recording rule (Timer Rule) attributes if you changed them back to a default value. For example, changing a channel-specific rule to be "Any Channel" wouldn't work right.

THANK YOU!!

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by ddejager » Thu Oct 31, 2019 7:33 am

Thank you for fixing the "any channel" bug! I tested the beta2 and it appears to work correctly now. A very minor, related, issue seems to remain: When you change the criteria for a timer rule, the left side of the screen ("2 scheduled", for example) in the timer rule list for that rule updates properly. The right side, listing all the items in the folder does not appear to visually update until you move off that rule and back to it again.

I tried your suggestion of scheduling a single recording for a show on a duplicate channel with the same recording on a series recording on a different channel and it worked as you suggested. Thanks.

Regarding the rerun flag [R]: You can't do better than the data you are given, but I guess that data is pretty bad. Take a look at the upcoming episodes for Madam Secretary [how did you know that was one of our favorites?] or Bull, or NCIS (any version), for example. They are first run, but have the [R] flag set for me on any of my channels that broadcast them. Is there a way to see the "original air date" when looking at guide data? I thought I saw this before, but do not now.

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 31, 2019 11:38 am

ddejager wrote:
Thu Oct 31, 2019 7:33 am
When you change the criteria for a timer rule, the left side of the screen ("2 scheduled", for example) in the timer rule list for that rule updates properly. The right side, listing all the items in the folder does not appear to visually update until you move off that rule and back to it again.
I can confirm this as well. It's a Kodi UI thing, it's not updating. I confirmed that the data update is being triggered and all is well, but you do have to get the Kodi UI to refresh. It may be something they can add to that view, have it watch for changes and update automatically, but nothing I do in the PVR will change that behavior.
ddejager wrote:
Thu Oct 31, 2019 7:33 am
Regarding the rerun flag [R]: You can't do better than the data you are given, but I guess that data is pretty bad. Take a look at the upcoming episodes for Madam Secretary [how did you know that was one of our favorites?] or Bull, or NCIS (any version), for example. They are first run, but have the [R] flag set for me on any of my channels that broadcast them. Is there a way to see the "original air date" when looking at guide data? I thought I saw this before, but do not now.
Here is the problem with the re-run flag. Here is the data for Madam Secretary S06E05 airing on CBS this coming Sunday ...

Code: Select all

    {
        "ProgramID": "EP019222940115",
        "Title": "Madam Secretary",
        "EpisodeNumber": "S06E05",
        "EpisodeTitle": "Daisy",
        "Synopsis": "When Daisy is implicated in the leak of hacked information, Elizabeth must decide what to believe; Henry and Elizabeth host former President Dalton at the White House after his interview with Bob Schieffer.",
        "OriginalAirdate": 1572739200,
        "ImageURL": "http://img.hdhomerun.com/titles/C10779009ENAWT8.jpg",
        "StartTime": 1572838200,
        "EndTime": 1572841800,
        "ChannelNumber": "513",
        "ChannelName": "WJZDT",
        "ChannelImageURL": "http://img.hdhomerun.com/channels/US21232.png",
        "RecordingRule": 1,
        "RecordingRuleExt": "RecordDuplicate"
    },
Per the data, the original air date of this episode (1572739200) is Sunday, November 3, 2019 12:00:00 AM (GMT)
Per the data, the start time of this episode (1572838200) is Monday, November 4, 2019 3:30:00 AM (GMT)

The delta between the start time and the original air date is 27.5 hours, so it's being flagged as a rerun. I wish there was more I can do to make this accurate, but as you can see from the raw data there isn't anything else I can work with. I could increase the allowed delta for the rerun indicator, but there is never going to be a guarantee of accuracy. If the backend added the "FirstAiring" flag like it does with recordings, that would be ideal :)

edit: Forgot to mention that I do pass the Original Air Date value to Kodi, it's up to the skin to decide if/how to show it. The data is there, I've seen Kodi skins that support it. And I agree that at some point in the past Estuary or Confluence did show this somewhere.

Great feedback as always, unfortunately probably both items appear to be due to factors beyond my control ...

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by ddejager » Thu Oct 31, 2019 1:28 pm

The delta between the start time and the original air date is 27.5 hours, so it's being flagged as a rerun. I wish there was more I can do to make this accurate, but as you can see from the raw data there isn't anything else I can work with. I could increase the allowed delta for the rerun indicator, but there is never going to be a guarantee of accuracy. If the backend added the "FirstAiring" flag like it does with recordings, that would be ideal :)
I agree that the data is bad. My suggestion would still, however, be to widen the window. I think is is more useful to have a false positive (no [R]) indicator than to show it as a rerun when it isn't really. Even if the show is shown a second time with the same week (at some early hour), I don't see harm it it In my case I'm currently seeing lots more prime-time shows with an incorrect [R] than without the [R]. Interestingly, nightly news never seems to have this problem. Perhaps you could study the data a bit for new shows and see if a 48 hour window would "fix" it in most cases.

Now that I understand that this is not really used to decide when to record a "new" show, it is probably less important....

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 31, 2019 1:49 pm

I'd be fine with that. Let me scroll back and contact the original requestor to see if he's ok with 48 hours.

It could always be configurable too, but seems like overkill to go that route.

Post Reply