Unofficial Kodi HDHomeRun DVR PVR Client

Kodi Community Development

Moderator: TVJunkie198

Post Reply
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 »

Ken.F wrote:
Thu Jan 30, 2020 9:33 am
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.
No worries, I can set up a second RECORD instance and check it out. Whether or not it happens will depend on which storage engine the PVR database decided to return first. It's not ordered by anything specific. Design flaw :)

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 Jan 30, 2020 9:48 am
Whether or not it happens will depend on which storage engine the PVR database decided to return first. It's not ordered by anything specific. Design flaw :)
I started up a second storage engine so my odds of it picking the wrong one would be better.

Code: Select all

2020-01-30 12:09:00.715 T:140226799471296  NOTICE: VideoPlayer::OpenFile: pvr://channels/tv/All channels/pvr.hdhomerundvr_12289.pvr
2020-01-30 12:09:00.716 T:140224957712128  NOTICE: Creating InputStream
2020-01-30 12:09:00.721 T:140224957712128   ERROR: AddOnLog: HDHomeRun DVR PVR Client: openlivestream_storage_http: unable to stream channel 3.1 via storage engine url http://192.168.1.3:43214/auto/v3.1?ClientID=d51e8f31-57ca-46cf-958a-853ba0a1a7ba&SessionID=0xE02DCE4C: HTTP 503: Service Unavailable
2020-01-30 12:09:00.941 T:140224957712128  NOTICE: AddOnLog: HDHomeRun DVR PVR Client: openlivestream_tuner_http: streaming channel 3.1 via tuner device url http://192.168.1.42:5004/tuner1/v3.1
2020-01-30 12:09:00.941 T:140224957712128  NOTICE: AddOnLog: HDHomeRun DVR PVR Client: OpenLiveStream: mediatype = video/mpeg
2020-01-30 12:09:00.941 T:140224957712128  NOTICE: AddOnLog: HDHomeRun DVR PVR Client: OpenLiveStream: canseek   = false
2020-01-30 12:09:00.941 T:140224957712128  NOTICE: AddOnLog: HDHomeRun DVR PVR Client: OpenLiveStream: length    = -1
2020-01-30 12:09:00.941 T:140224957712128  NOTICE: AddOnLog: HDHomeRun DVR PVR Client: OpenLiveStream: realtime  = true
2020-01-30 12:09:00.941 T:140224957712128  NOTICE: AddOnLog: HDHomeRun DVR PVR Client: OpenLiveStream: starttime = 1580404140 (epoch) = Thu Jan 30 12:09:00 2020 (local)
2020-01-30 12:09:00.941 T:140224957712128  NOTICE: Creating Demuxer
2020-01-30 12:09:01.019 T:140224957712128  NOTICE: Opening stream: 0 source: 256
2020-01-30 12:09:01.019 T:140224957712128 WARNING: OpenStream - Unsupported stream 0. Stream disabled.
2020-01-30 12:09:01.019 T:140224957712128  NOTICE: Opening stream: 1 source: 256
2020-01-30 12:09:01.019 T:140224957712128  NOTICE: Finding audio codec for: 86019
2020-01-30 12:09:01.020 T:140224957712128  NOTICE: CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder ac3
2020-01-30 12:09:01.020 T:140224957712128  NOTICE: Creating audio thread
2020-01-30 12:09:01.020 T:140224768239360  NOTICE: running thread: CVideoPlayerAudio::Process()
2020-01-30 12:09:01.079 T:140224957712128  NOTICE: CDVDDemuxFFmpeg::Read() stream change
2020-01-30 12:09:01.079 T:140224957712128  NOTICE: Opening stream: 0 source: 256
2020-01-30 12:09:01.079 T:140224957712128 WARNING: OpenStream - Unsupported stream 0. Stream disabled.
2020-01-30 12:09:01.079 T:140224957712128  NOTICE: Opening stream: 1 source: 256
2020-01-30 12:09:01.591 T:140224957712128  NOTICE: CDVDDemuxFFmpeg::Read() stream change
2020-01-30 12:09:01.591 T:140224957712128  NOTICE: Opening stream: 0 source: 256
2020-01-30 12:09:01.591 T:140224957712128  NOTICE: Creating video codec with codec id: 2
2020-01-30 12:09:01.591 T:140224957712128  NOTICE: CDVDVideoCodecFFmpeg::Open() Using codec: MPEG-2 video
2020-01-30 12:09:01.591 T:140224957712128  NOTICE: Creating video thread
2020-01-30 12:09:01.591 T:140224957712128  NOTICE: Opening stream: 1 source: 256
2020-01-30 12:09:01.591 T:140224957712128  NOTICE: Finding audio codec for: 86019
2020-01-30 12:09:01.591 T:140224957712128  NOTICE: CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder ac3
2020-01-30 12:09:01.595 T:140224566912768  NOTICE: running thread: video_thread
2020-01-30 12:09:01.600 T:140224743061248  NOTICE: COutput::OnStartup: Output Thread created
2020-01-30 12:09:01.684 T:140224726275840  NOTICE: AddOnLog: HDHomeRun DVR PVR Client: update_listings_task: triggering timer update
2020-01-30 12:09:01.684 T:140224726275840  NOTICE: AddOnLog: HDHomeRun DVR PVR Client: update_listings_task: scheduling next listing update to initiate in 91097 seconds
2020-01-30 12:09:01.789 T:140224768239360  NOTICE: Creating audio stream (codec id: 86019, channels: 6, sample rate: 48000, no pass-through)
2020-01-30 12:09:02.019 T:140226799471296  NOTICE: GL: Selecting YUV 2 RGB shader
2020-01-30 12:09:02.019 T:140226799471296  NOTICE: GL: NPOT texture support detected
2020-01-30 12:09:02.020 T:140226799471296  NOTICE: GL: Using GL_ARB_pixel_buffer_object
2020-01-30 12:09:02.020 T:140226799471296  NOTICE: Using GL_TEXTURE_2D
2020-01-30 12:09:02.021 T:140226799471296  NOTICE: GL: Selecting YUV 2 RGB shader
2020-01-30 12:09:02.021 T:140226799471296  NOTICE: GL: NPOT texture support detected
2020-01-30 12:09:02.021 T:140226799471296  NOTICE: GL: Using GL_ARB_pixel_buffer_object
2020-01-30 12:09:02.599 T:140224566912768 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer
2020-01-30 12:09:03.538 T:140224566912768 WARNING: Previous line repeats 1 times.
2020-01-30 12:09:03.538 T:140224566912768  NOTICE: CDVDVideoCodecFFmpeg::CDropControl: calculated diff time: 33366
2020-01-30 12:09:04.877 T:140224566912768 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer

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 »

On it. This one will take a bit of time but I think the end result will benefit everyone that has multiple RECORD engines available :) My target for this is 2/10; the 3-year anniversary of the addon (with other stuff, of course!)

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 Jan 30, 2020 9:17 pm
My target for this is 2/10; the 3-year anniversary of the addon (with other stuff, of course!)
Sounds good.

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 »

Hi Ken.F, this turned out to me MUCH easier than I expected, I wanted to run the solution past you to see what you think. I can probably cut you a beta release tonight or tomorrow to try as well.

> Existing behavior is to create one and only one stream URL to try from storage and if it doesn't work fall back to a tuner, as you know.
> New behavior is to create candidate stream URLs from all available storage engines and try them each until one works or none have worked.

I'm embarrassed I didn't already do this. It literally took about 4 minutes to implement and test :)

There is a small problem with priority, in that I don't have any way to know if a storage device is going to work or not, but they fail very quickly. I couldn't notice any difference failing to start on a RecordStreamsMax=0/PlaybackStreamsMax=0 instance and then hitting the good one. The only difference is in the log:

Code: Select all

ERROR: AddOnLog: HDHomeRun DVR PVR Client: openlivestream_storage_http: unable to stream channel 781 via storage engine url http://192.168.0.174:55799/auto/v781?ClientID=035c35ef-942b-4e83-8a32-55619044bd87&SessionID=0x95604477: HTTP 503: Service Unavailable
NOTICE: AddOnLog: HDHomeRun DVR PVR Client: openlivestream_storage_http: streaming channel 781 via storage engine url http://192.168.0.220:39476/auto/v781?ClientID=035c35ef-942b-4e83-8a32-55619044bd87&SessionID=0xF3E4C3A9
NOTICE: AddOnLog: HDHomeRun DVR PVR Client: OpenLiveStream: mediatype = video/mpeg
NOTICE: AddOnLog: HDHomeRun DVR PVR Client: OpenLiveStream: canseek   = true
NOTICE: AddOnLog: HDHomeRun DVR PVR Client: OpenLiveStream: length    = -1
NOTICE: AddOnLog: HDHomeRun DVR PVR Client: OpenLiveStream: realtime  = true
NOTICE: AddOnLog: HDHomeRun DVR PVR Client: OpenLiveStream: starttime = 1580525682 (epoch) = Fri Jan 31 21:54:42 2020 (local)
You can see it first tried a storage engine that wouldn't play ball, but hit the next one and it was happy.

As for the priority problem, what I think I will do is have it order by storage ID. So if you want the PVR to normally hit a specific storage device, give it an (alphabetically) LOWER storage ID. I think that's the best I can really do. Folks with multiple RECORD engines running and have been setting things like RecordMaxStreams are probably going to comfortable enough with changing a UUID.

LMK what you think, sir!

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:
Fri Jan 31, 2020 8:06 pm
As for the priority problem, what I think I will do is have it order by storage ID. So if you want the PVR to normally hit a specific storage device, give it an (alphabetically) LOWER storage ID. I think that's the best I can really do. Folks with multiple RECORD engines running and have been setting things like RecordMaxStreams are probably going to comfortable enough with changing a UUID.
Sounds good. I'll give it a try.

ctviggen
Posts: 176
Joined: Sun Dec 12, 2010 5:29 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by ctviggen »

I have installed this, and it seems to work well with "normal" Kodi (I'm going to try to install with Emby and an Emby skin; I'm not sure how that will go).

My only issue is that the channel mapping is totally messed up. Channel 727 (in the HD Homerun Prime) comes in at a completely different channel. Any idea why that might be?

Online
NedS
Silicondust
Posts: 1230
Joined: Mon Dec 10, 2018 12:38 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by NedS »

ctviggen wrote:
Sat Feb 01, 2020 4:26 pm
I have installed this, and it seems to work well with "normal" Kodi (I'm going to try to install with Emby and an Emby skin; I'm not sure how that will go).

My only issue is that the channel mapping is totally messed up. Channel 727 (in the HD Homerun Prime) comes in at a completely different channel. Any idea why that might be?
Kodi -> Settings -> PVR & Live TV -> General -> Use channel order from backends (you might need to turn the settings on "Advanced" to expose this setting)

Then select "Clear data" to force it to reload the channel list.

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 »

NedS wrote:
Sat Feb 01, 2020 4:29 pm
ctviggen wrote:
Sat Feb 01, 2020 4:26 pm
I have installed this, and it seems to work well with "normal" Kodi (I'm going to try to install with Emby and an Emby skin; I'm not sure how that will go).

My only issue is that the channel mapping is totally messed up. Channel 727 (in the HD Homerun Prime) comes in at a completely different channel. Any idea why that might be?
Kodi -> Settings -> PVR & Live TV -> General -> Use channel order from backends (you might need to turn the settings on "Advanced" to expose this setting)

Then select "Clear data" to force it to reload the channel list.
Thanks NedS!

ctviggen , also set "Use channel numbers from backend" while you're in there :)

Note that if you have multiple PVR addons installed, that setting won't work and you will still see "1, 2, 3, ...". To combat this there is a PVR addon setting under General called "Prepend channel numbers to channel names". What this does is modify the channel name to include the number, for example "WBAL-DT" would become "511 WBAL-DT". Could come in handy!

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 »

New Beta for you guys!

Version - v3.2.0~beta1 (February 1, 2020)
  • Update SQLite database engine to version 3.31.1
  • Update cURL library to version 7.68.0
  • Use "Filename" attribute provided by HDHomeRun RECORD instead of manually generating EDL file name(s) when available
  • Exclude episodes marked as "DeletedDontRerecord" from the list of reported timer instances
  • Exclude episodes marked as "RecordIfNotRecorded" from the list of reported timer instances when a completed recording exists
  • Prevent missing channel(s) in the Electronic Program Guide (EPG) listings from causing unncessary XMLTV reload operations
  • Fix bug preventing calculation of original air date values for programs that aired prior to 1970.01.01
  • Limit reporting of program year to programs of type MV (Movies) in Electronic Program Guide (EPG) and Recorded TV
  • Limit reporting of program original air date to programs of type EP (Series Episode) and SH (Show) in Electronic Program Guide (EPG)
  • Allow for Live TV to be streamed from any available storage engine before falling back to using a tuner device directly
Most of the items are just clean ups here and there now that Krypton is out of the loop. I would like to call out a couple, though:

Exclude episodes marked as "DeletedDontRerecord" from the list of reported timer instances
Exclude episodes marked as "RecordIfNotRecorded" from the list of reported timer instances when a completed recording exists

These help to significantly filter out the "Timers" list to the point where it will be pretty darn accurate now. These data points have been available for a while, not sure why I hadn't hooked this up yet. It's still not GUARANTEED that Timers will only show things that will actually be recorded by the DVR, I have an open question about a recording attribute on the Dev forum, but for me it's much much better. Remember, "Timers" are just a convenience view for this PVR, they have never been truly accurate. Trust the DVR.

Allow for Live TV to be streamed from any available storage engine before falling back to using a tuner device directly

This should solve Ken.F's problem, and takes a long-standing item off the backlog (post 3 or 4 of this thread). If you have multiple RECORD instances running, the PVR will only try the first one in it's list to stream Live TV, and if that fails it will fall back to a tuner. This change takes all RECORD instances into account, so if one fails to stream it will try the remaining one(s) until it finds one that will cooperate.

As always thank you for trying things out for me, and you can always roll it back via the built-in "Update" function in Kodi.

Link to both Leia and Matrix builds (OneDrive):
https://1drv.ms/u/s!AgEGEEVzGNq-jIpTd-q ... Q?e=efqYpo

Let me know if you run into anything weird, concerning, or you just plain don't like!

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:
Sat Feb 01, 2020 5:05 pm
[*]Use "Filename" attribute provided by HDHomeRun RECORD instead of manually generating EDL file name(s) when available
Does this mean we can rename recording files and .edl files and it will still skip commercials?

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 »

Sadly no. The new RECORD beta provides the file name now so I don't have to figure it out on my own. No fun changes to functionality :(

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:
Sat Feb 01, 2020 5:19 pm
Sadly no. The new RECORD beta provides the file name now so I don't have to figure it out on my own. No fun changes to functionality :(
I just tried re-naming a recording file and it's .edl file and it does work. :D

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 »

Ken.F wrote:
Sat Feb 01, 2020 5:26 pm
djp952 wrote:
Sat Feb 01, 2020 5:19 pm
Sadly no. The new RECORD beta provides the file name now so I don't have to figure it out on my own. No fun changes to functionality :(
I just tried re-naming a recording file and it's .edl file and it does work. :D
Bonus feature!

ctviggen
Posts: 176
Joined: Sun Dec 12, 2010 5:29 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by ctviggen »

djp952 wrote:
Sat Feb 01, 2020 4:54 pm
NedS wrote:
Sat Feb 01, 2020 4:29 pm
ctviggen wrote:
Sat Feb 01, 2020 4:26 pm
I have installed this, and it seems to work well with "normal" Kodi (I'm going to try to install with Emby and an Emby skin; I'm not sure how that will go).

My only issue is that the channel mapping is totally messed up. Channel 727 (in the HD Homerun Prime) comes in at a completely different channel. Any idea why that might be?
Kodi -> Settings -> PVR & Live TV -> General -> Use channel order from backends (you might need to turn the settings on "Advanced" to expose this setting)

Then select "Clear data" to force it to reload the channel list.
Thanks NedS!

ctviggen , also set "Use channel numbers from backend" while you're in there :)

Note that if you have multiple PVR addons installed, that setting won't work and you will still see "1, 2, 3, ...". To combat this there is a PVR addon setting under General called "Prepend channel numbers to channel names". What this does is modify the channel name to include the number, for example "WBAL-DT" would become "511 WBAL-DT". Could come in handy!
Thanks to both of you. I installed so many things yesterday, I can't remember what was being done when. (When I tried to upgrade my previous HT computer from Win7 -> Win10, it ceased to want to boot; I finished buying parts for a HT case I had been thinking of using, and of course did not have time to install the OS until Friday night. My kids were putting tons of pressure on my to get TV working again before the Super Bowl!)

Yes, I first thought that I just got a list that was cut off, and only ended around 520 or so. I then realized (after searching for "Super Bowl") that all the channels were there, just remapped to 1, 2, ..., 520.

I assume I'll have to redo my scheduled recordings? I'll report back.

Post Reply