(OLD) Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Kodi Community Development

Moderator: TVJunkie198

Locked
Chronoptic
Posts: 11
Joined: Fri Sep 21, 2018 6:53 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by Chronoptic » Fri Nov 23, 2018 12:12 pm

Chronoptic wrote:
Sun Nov 04, 2018 7:00 am
I've noticed that while watching video, either a movie or live tv, if I go into the tv recordings menu, then click on a particular show's folder, the playback slows down as I scroll through the recorded episodes. As soon as I stop hovering over an episode name (even just going up to the ".."), the video accelerates to catch up with the sound. Is anyone else seeing this?
Bump. Anyone? :?

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by djp952 » Fri Nov 23, 2018 1:52 pm

Chronoptic wrote:
Fri Nov 23, 2018 12:12 pm
Chronoptic wrote:
Sun Nov 04, 2018 7:00 am
I've noticed that while watching video, either a movie or live tv, if I go into the tv recordings menu, then click on a particular show's folder, the playback slows down as I scroll through the recorded episodes. As soon as I stop hovering over an episode name (even just going up to the ".."), the video accelerates to catch up with the sound. Is anyone else seeing this?
Bump. Anyone? :?
I'm guessing you are on a 'lower end' (no offense intended!) system, like a Raspberry Pi or a Fire Stick? This is almost undoubtedly a resource contention issue, probably with the CPU but also possibly with the Graphics subsystem. Kodi is unable to keep up your playback rate while doing other things, and then it uses the timestamps in the stream to see that it's fallen behind and tries to catch the video up.

It could be a problem you have to live with (again, no offense intended), or there may be some Kodi settings or even updated drivers that might help. A lack of Hardware Acceleration support for the video would be a big drain, for example. Some platforms, notably the Fire Stick prior to the new 2018 4K model, or Wintel with older AMD Radeon chipsets, also lack an ability to deinterlace video in hardware so it has to use software and ramps up the CPU pretty badly during playback.

Given some system and OS specs, maybe we can make some suggestions for improving your situation?

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

Re: Can't play audio only channels

Post by djp952 » Fri Nov 23, 2018 1:59 pm

ddejager wrote:
Wed Nov 14, 2018 4:58 pm
I've observed that audio only (music) channels from charter (via a PRIME Tuner) can be played successfully using the HDHOMERUN app on a firestick, but with Kodi using this DVR, the audio starts for a second or two, then stops, then the spinning circle appears, then this repeats over and over again. Any ideas?
Unfortunately the closest thing I have here (FiOS) are audio channels that also happen to display video. Do you have any logs available, maybe Kodi can give us a hint as to what it's problem is here. It may be something we can solve (or is being caused) at the PVR level, but I'm guessing that it has to do with the Kodi player. It expects to get MPEG-TS from the PVR, which if it's starting at all it is, but it also expects to find things like key frames which may not exist in an audio-only stream.

I'm afraid I'm not familiar with how an audio-only channel would present itself, and have no reference point to draw from on this end to be of much help to you.

BUT -- if you want and have time we can actually capture the some raw MPEG-TS data using cURL (or other HTTP utilities) and then I could hack the PVR to read from that file here and maybe see what you see?

(https://www.reddit.com/r/cordcutters/co ... ndust_dvr/)

Recording the channel via the RECORD engine (if it will let you) is also just as good, perhaps better. If you can get me a reasonably sized .MPG file from your DVR I can just plop it on my RECORD engine and hit the Debug button :)

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

Re: Can't play audio only channels

Post by ddejager » Fri Nov 23, 2018 2:29 pm

djp952 wrote:
Fri Nov 23, 2018 1:59 pm
ddejager wrote:
Wed Nov 14, 2018 4:58 pm
I've observed that audio only (music) channels from charter (via a PRIME Tuner) can be played successfully using the HDHOMERUN app on a firestick, but with Kodi using this DVR, the audio starts for a second or two, then stops, then the spinning circle appears, then this repeats over and over again. Any ideas?
Unfortunately the closest thing I have here (FiOS) are audio channels that also happen to display video. Do you have any logs available, maybe Kodi can give us a hint as to what it's problem is here. It may be something we can solve (or is being caused) at the PVR level, but I'm guessing that it has to do with the Kodi player. It expects to get MPEG-TS from the PVR, which if it's starting at all it is, but it also expects to find things like key frames which may not exist in an audio-only stream.

I'm afraid I'm not familiar with how an audio-only channel would present itself, and have no reference point to draw from on this end to be of much help to you.

BUT -- if you want and have time we can actually capture the some raw MPEG-TS data using cURL (or other HTTP utilities) and then I could hack the PVR to read from that file here and maybe see what you see?

(https://www.reddit.com/r/cordcutters/co ... ndust_dvr/)

Recording the channel via the RECORD engine (if it will let you) is also just as good, perhaps better. If you can get me a reasonably sized .MPG file from your DVR I can just plop it on my RECORD engine and hit the Debug button :)
Thanks. I will try to get a recording and send it to you when I'm back home in a few weeks....

Chronoptic
Posts: 11
Joined: Fri Sep 21, 2018 6:53 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by Chronoptic » Fri Nov 23, 2018 5:21 pm

djp952 wrote:
Fri Nov 23, 2018 1:52 pm
Chronoptic wrote:
Fri Nov 23, 2018 12:12 pm
Chronoptic wrote:
Sun Nov 04, 2018 7:00 am
I've noticed that while watching video, either a movie or live tv, if I go into the tv recordings menu, then click on a particular show's folder, the playback slows down as I scroll through the recorded episodes. As soon as I stop hovering over an episode name (even just going up to the ".."), the video accelerates to catch up with the sound. Is anyone else seeing this?
Bump. Anyone? :?
I'm guessing you are on a 'lower end' (no offense intended!) system, like a Raspberry Pi or a Fire Stick? This is almost undoubtedly a resource contention issue, probably with the CPU but also possibly with the Graphics subsystem. Kodi is unable to keep up your playback rate while doing other things, and then it uses the timestamps in the stream to see that it's fallen behind and tries to catch the video up.

It could be a problem you have to live with (again, no offense intended), or there may be some Kodi settings or even updated drivers that might help. A lack of Hardware Acceleration support for the video would be a big drain, for example. Some platforms, notably the Fire Stick prior to the new 2018 4K model, or Wintel with older AMD Radeon chipsets, also lack an ability to deinterlace video in hardware so it has to use software and ramps up the CPU pretty badly during playback.

Given some system and OS specs, maybe we can make some suggestions for improving your situation?
Lower end hardware would've been my first guess too, but it happens on my shield tv and my pc with an i7 and geforce 1070. It does NOT happen with your Jarvis version, or when I use the mythtv pvr (but that thing is so overkill for me, I'd rather not use it). I am, however, running the hdhr record engine on a very meek asus nas. That wouldn't affect playback though, would it? You know, I also tried the tv mosaic backend on my nas with the dvblink pvr frontend on the shield. Had the same issue. Seems like the nas is the common denominator. I'll try running the record engine on my pc and see what happens.

Chronoptic
Posts: 11
Joined: Fri Sep 21, 2018 6:53 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by Chronoptic » Fri Nov 23, 2018 5:51 pm

Yep, the nas is the culprit. When I hover over a show title and its info is displayed, the nas cpu usage jumps from about 0.7% to 36%. This seems very odd. Why would displaying the show info and a little jpg require so much cpu power? Well, I guess this is a question for the sd guys. Thanks for the input though. (Still seems weird that it doesn't happen with your Jarvis build).

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by djp952 » Fri Nov 23, 2018 9:38 pm

Chronoptic wrote:
Fri Nov 23, 2018 5:51 pm
Yep, the nas is the culprit. When I hover over a show title and its info is displayed, the nas cpu usage jumps from about 0.7% to 36%. This seems very odd. Why would displaying the show info and a little jpg require so much cpu power? Well, I guess this is a question for the sd guys. Thanks for the input though. (Still seems weird that it doesn't happen with your Jarvis build).
Hmmm... are you running Kodi itself from the NAS or use a shared Kodi database installed on the NAS? What I think is weird here is that the data Kodi is showing you and the JPGs are stored in the Kodi database, it shouldn't be hitting the HDHomeRun service/daemon at all for that -- it's actually all coming from the SD backend servers and never touches the RECORD engine.

The PVR client does hit the RECORD engine to get the list of recordings, but it's not real-time. It happens when you first start Kodi and then again periodically (every 10 minutes, I think I have as the default). There is also an option to refresh recordings any time playback stops. Everything except the EPG data is cached by the PVR in it's own database as well. Lineups come from the tuners, Recordings come from the RECORD engine, just about everything else is from the "cloud".

I agree it seems weird still. The base code for the PVR is almost identical across Jarvis/Krypton/Leia, there are some things each has that are unique for that platform's API but we're talking probably more than 95% the same code. That it all worked fine on Jarvis is a head-scratcher. So the only thing you needed to change was to move the RECORD engine to the PC from the NAS and it all cleared up?

Chronoptic
Posts: 11
Joined: Fri Sep 21, 2018 6:53 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by Chronoptic » Sat Nov 24, 2018 7:04 am

djp952 wrote:
Fri Nov 23, 2018 9:38 pm
So the only thing you needed to change was to move the RECORD engine to the PC from the NAS and it all cleared up?
Yep, very strange. When running the record engine from the pc, there's no increase in its cpu usage or network activity. But, when running the record engine from the nas, its cpu usage really takes off as well as its network activity. I'm gonna see if I can figure out what all those packets are that it's spewing out. I love a good mystery :)

Chronoptic
Posts: 11
Joined: Fri Sep 21, 2018 6:53 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by Chronoptic » Sat Nov 24, 2018 10:17 am

Okay, forget my last post. I confounded things by testing different clients with different backends. Bottom line: regardless of where the hdrecord engine is being run, the leia pvr client makes constant "GET /record_files.json HTTP/1.1" requests. They just continue in a loop as long an episode title is highlighted. I think the video slows down while the shield is trying to process this constant stream of data? I see no such packets with the jarvis client. The jarvis client on the shield, with hardware acc. disabled and using bob-inverted deinterlacing runs beautifully :)

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by djp952 » Sat Nov 24, 2018 8:18 pm

Chronoptic wrote:
Sat Nov 24, 2018 10:17 am
Okay, forget my last post. I confounded things by testing different clients with different backends. Bottom line: regardless of where the hdrecord engine is being run, the leia pvr client makes constant "GET /record_files.json HTTP/1.1" requests. They just continue in a loop as long an episode title is highlighted. I think the video slows down while the shield is trying to process this constant stream of data? I see no such packets with the jarvis client. The jarvis client on the shield, with hardware acc. disabled and using bob-inverted deinterlacing runs beautifully :)
Oof. That would definitely be a defect/problem squarely in my wheelhouse ... nice detective work (and sorry!) Let me see if I can find out what Kodi is asking for here and why it's not coming from the cache like it should be.

edit: Got it already. It's asking for the last position of the recording, which I don't cache in case it has changed from another Kodi instance or HDHomeRun app instance. Let me see what I can do about it. Could ultimately be a Kodi pull request (code change) but at a minimum I can add something in the PVR to quiet this down for you.

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by djp952 » Sat Nov 24, 2018 9:36 pm

Here you go Chronoptic …

Version 1.3.5b (2018.10.24) LEIA PRE-RELEASE ONLY
  • Temporary workaround for repeated polling of the last played position for Recorded TV files
Download (LEIA PRE-RELEASE ONLY): https://github.com/djp952/pvr.hdhomerun ... eia-1.3.5b

Recent builds of Leia have introduced a problem where the last played position for Recorded TV files are being polled repeatedly, causing a performance problem with the PVR. The problem will be more pronounced for people with a large number of recordings available on their HDHomeRun RECORD engine.

This is a temporary fix/workaround that will be superseded with a more proper fix in a later release, probably v1.3.6, for all platforms. The way the PVR client is dealing with the last played position flag will become increasingly inefficient as the user's RECORD engine has more recordings to iterate.

Also of significant note, there are no longer "Android APK" builds for Leia as of this release. Team Kodi has fixed their Android baseline so that you can install binary addons (like PVRs) without needing a custom APK. To install this update on Android, you should push/download the .zip file to your Android internal/external store and browse to that .zip file from within Kodi. Existing custom "zuki" APK installations should be uninstalled and replaced with the Kodi "Leia" APKs, but they will continue to keep working for the foreseeable future.

Thank you Chronoptic for your detective work here. The fix isn't permanent, but I think it will alleviate your core issue.

Thanks!
djp952

Chronoptic
Posts: 11
Joined: Fri Sep 21, 2018 6:53 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by Chronoptic » Sun Nov 25, 2018 6:19 am

That did the trick, thank you!!

usafle
Posts: 49
Joined: Sun Sep 17, 2017 5:51 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by usafle » Sun Nov 25, 2018 8:32 am

I know this is WAAAAAAY off topic but I've not been paying attention to the Kodi Leia updates / status/ what-not. Any idea where the builds are for LibreELEC + S905/S905X? I used to get the updates for Krypton on https://forum.libreelec.tv/thread/9319- ... 905-s905x/ but it only says "DISCONTINUED: These builds will no longer be updated but you are welcome to use them!" because the author has moved onto Leia builds.. but there is no actual thread with Leia builds there.

Apologies... I know this is way off topic....

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by Ken.F » Sun Nov 25, 2018 9:12 am

usafle wrote:
Sun Nov 25, 2018 8:32 am
I know this is WAAAAAAY off topic but I've not been paying attention to the Kodi Leia updates / status/ what-not. Any idea where the builds are for LibreELEC + S905/S905X?
Is this it? https://forum.libreelec.tv/thread/12330 ... for-s9xxx/

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

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by Ken.F » Sun Nov 25, 2018 9:15 am

djp952 wrote:
Sat Nov 24, 2018 9:36 pm
Version 1.3.5b (2018.10.24) LEIA PRE-RELEASE ONLY
  • Temporary workaround for repeated polling of the last played position for Recorded TV files
What does "LEIA PRE-RELEASE ONLY" mean? Does that mean it isn't supposed to work on the Leia RC releases? I tried it anyway and it works fine on Leia RC1 64 bit on Win7.

Locked