OLD: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Kodi Community Development

Moderator: TVJunkie198

Locked
djp952
Posts: 897
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 » Wed Feb 22, 2017 9:26 pm

stickly wrote:
Wed Feb 22, 2017 3:34 pm
Great to hear! I am using a mix of Krypton 17.0 and Jarvis 16.1 currently across 1 Nvidia Shield and 3 Amazon Fire TVs. If it would only work on Krypton, it would not be a big deal to update all my devices.
I think Jarvis will be fine, I haven't had to make any code changes at all for Android so the Jarvis baseline should be able to inherit the same configuration/build process changes without hassle. We'll find out :)

djp952
Posts: 897
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 Feb 25, 2017 10:46 am

I have good news (and some bad) for you guys, I got the PVR Client working on Android. Only tested Krypton 17.0 ARM on Lollipop so far, but I'll be darned it actually works. It looks like I can ultimately support:

Jarvis 16.1 ARM (ARM-v7a)
Jarvis 16.1 x86
Krypton 17.x ARM (ARM-v7a)
Krypton 17.x AARCH64 (ARM64-v8a)
Krypton 17.x x86

Now for the bad news. Side-loaded binary add-ons don't really work in Kodi on Android. The addon gets installed into the user data area, which does not allow code execution for obvious reasons. So Python add-ons like the official HDHomeRun one work, binary ones like PVR Clients don't.

The workaround I came up with for now of requires root access (of course it does -- because Android :) ). If you manually copy the .so file into the Kodi app's lib folder, it will use it instead of the one installed with the add-on. This is a pretty ugly hack, but it may suffice for the time being. If this is the best I can come up with while I clean up the Android build(s) for you, I'll document it.

The ultimate solution is likely to be becoming an official Kodi PVR Client and be included with the application, which honestly I was trying to avoid. We'll see. I'll post something for you guys when I have clean builds you can try if you're willing to deal with the root access installation hack.

clarkss12
Posts: 1198
Joined: Sat May 11, 2013 11:51 am
Device ID: 104CBEA5 ;1055A951
Location: Michigan, USA
Contact:

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by clarkss12 » Sat Feb 25, 2017 12:17 pm

I don't see the download for your Jarvis 16.1 ARM (ARM-v7a) for Android? I will be testing it on one of my Android boxes, running different versions of Android and LibreELEC.

djp952
Posts: 897
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 Feb 25, 2017 12:59 pm

clarkss12 wrote:
Sat Feb 25, 2017 12:17 pm
I don't see the download for your Jarvis 16.1 ARM (ARM-v7a) for Android? I will be testing it on one of my Android boxes, running different versions of Android and LibreELEC.
Haven't published it quite yet. Hoping to tonight as time allows -- still need to test at least once on Jarvis :)

clarkss12
Posts: 1198
Joined: Sat May 11, 2013 11:51 am
Device ID: 104CBEA5 ;1055A951
Location: Michigan, USA
Contact:

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by clarkss12 » Sat Feb 25, 2017 3:07 pm

Ok, thanks, will be looking for it.

djp952
Posts: 897
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 » Sun Feb 26, 2017 11:36 am

Updated version for Jarvis has been published that includes the experimental Android device support. Please keep in mind you will need root access to the device to make a manual file copy as a workaround (really sorry about that). I will definitely be looking into ways that this might be able to work as a side-load into Kodi without this step. I've seen some promising things I might be able to leverage later on.

You definitely need to read my awful hack installation steps to get it working: https://github.com/djp952/pvr.hdhomerun ... erimental). I also updated the other bits and pieces of the Wiki as appropriate.

Krypton packages expected later today after I test them a little. Will edit this post when that's done, or just check the GitHub!

Good luck, please let me know how it goes on Android, if you run into something specific you can open an Issue on GitHub to track progress on a fix :)

edit: Krypton packages for version 1.0.2 are now posted less the ARM64 package -- SSL is not working on ARM64
Last edited by djp952 on Sun Feb 26, 2017 10:49 pm, edited 1 time in total.

clarkss12
Posts: 1198
Joined: Sat May 11, 2013 11:51 am
Device ID: 104CBEA5 ;1055A951
Location: Michigan, USA
Contact:

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by clarkss12 » Sun Feb 26, 2017 7:12 pm

Tried to install on my X9 (Amlogic S905x) running rooted Android 6.0, using both Kodi 17 and SPMC 16, neither worked. Kodi 17 gave me the error "failed to install Add-on from Z, the dependency on xbmc.pvr version 4.10. could not be satifisfied.

SPMC version 16.5-5 lets me install the zip file, and creates the folder to place the .so file into, which I did. Problem, when I enable you PVR add-on, and enable the TV option, it says no PVR client enabled, and your PVR client disappears from the list of PVR clients.

clarkss12
Posts: 1198
Joined: Sat May 11, 2013 11:51 am
Device ID: 104CBEA5 ;1055A951
Location: Michigan, USA
Contact:

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by clarkss12 » Sun Feb 26, 2017 7:53 pm

In order to connect my Android box to my computer and TV, I have to do some moving of items. I can however use ESfile explorer to create the new folder called org.xbmc.kodi-1/lib/, however I have no idea what the {arch} means.

adb shell
cd /sdcard/Android/data/org.xbmc.kodi/files/.kodi/addons/pvr.hdhomerundvr
cp libhdhomerundvr.so /data/app/org.xbmc.kodi-1/lib/{arch}/
cd /data/app.org.xbmc.kodi-1/lib/{arch}/
chown libhdhomerundvr.so system:system
chmod 0755 libhdhomerundvr.so

djp952
Posts: 897
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 » Sun Feb 26, 2017 9:51 pm

clarkss12 wrote:
Sun Feb 26, 2017 7:12 pm
Tried to install on my X9 (Amlogic S905x) running rooted Android 6.0, using both Kodi 17 and SPMC 16, neither worked. Kodi 17 gave me the error "failed to install Add-on from Z, the dependency on xbmc.pvr version 4.10. could not be satifisfied.

SPMC version 16.5-5 lets me install the zip file, and creates the folder to place the .so file into, which I did. Problem, when I enable you PVR add-on, and enable the TV option, it says no PVR client enabled, and your PVR client disappears from the list of PVR clients.
Kodi 17 is "Krypton"; still working on releasing that one. The only Android builds out there right this minute are for Kodi 16.1 "Jarvis", which has a different API (the xbmc.pvr version error you ran into). Hold tight, while the ARM64 build failed miserably, regular ARM and x86 have passed. I'm just trying to determine if the problem with ARM64 was due to ARM64 or due to Android 7.x. I have the files all queued up, trying to know if I should post the ARM64 one or not.

edit: Kodi 17.x "Krypton" packages for version 1.0.2 (Android: ARMv7a and x86 only) are now posted less the ARM64 package due to a failure accessing backend resources via an SSL connection that blocks retrieval of guide and timer (recording rule) data
Last edited by djp952 on Sun Feb 26, 2017 10:52 pm, edited 2 times in total.

djp952
Posts: 897
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 » Sun Feb 26, 2017 9:57 pm

clarkss12 wrote:
Sun Feb 26, 2017 7:53 pm
In order to connect my Android box to my computer and TV, I have to do some moving of items. I can however use ESfile explorer to create the new folder called org.xbmc.kodi-1/lib/, however I have no idea what the {arch} means.

adb shell
cd /sdcard/Android/data/org.xbmc.kodi/files/.kodi/addons/pvr.hdhomerundvr
cp libhdhomerundvr.so /data/app/org.xbmc.kodi-1/lib/{arch}/
cd /data/app.org.xbmc.kodi-1/lib/{arch}/
chown libhdhomerundvr.so system:system
chmod 0755 libhdhomerundvr.so
Hmmm.. you shouldn't have to create any folders at all. The only Android "devices" I can test on here are the emulators, the paths I posted were based on that. There should be a folder named /data/app/org.xbmc.kodi* (* meaning something, perhaps -1 or -2 or something else?).

{arch} is going to be either "arm" or "x86", it differs based on the CPU the android box is running. I'm going to guess it's "arm".

As an example, an ARM device that has only had one version of Kodi on it should have this directory:

/data/app/org.xbmc.kodi-1/lib/arm

I'm afraid you have to find the right directory on your own, since I can't do much for Android right now outside of running their emulators. Do you have a directory /data/app/org.xbmc.kodi{something}? If not, I'll have to figure out a way to find it for you :(

Ugh Android!

edit: Krypton packages for version 1.0.2 are now posted less the ARM64 package -- SSL is not working on ARM64

ssyspro
Posts: 20
Joined: Thu Sep 29, 2016 3:14 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by ssyspro » Mon Feb 27, 2017 1:17 pm

Jarvis Android seems to be working on mine. I have come across the guide being blank a few times and will adjust some settings to see if I am causing it with an add-on or setting.



For those having trouble I used root explorer to copy the file and change the permissions but any file browser that supports root should work.

On my devices the location was /data/apps/org.xbmc.kodi-1/lib/arm/ (<- this directory should already exist and have files inside)

djp952
Posts: 897
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 » Mon Feb 27, 2017 5:51 pm

ssyspro wrote:
Mon Feb 27, 2017 1:17 pm
Jarvis Android seems to be working on mine. I have come across the guide being blank a few times and will adjust some settings to see if I am causing it with an add-on or setting.



For those having trouble I used root explorer to copy the file and change the permissions but any file browser that supports root should work.

On my devices the location was /data/apps/org.xbmc.kodi-1/lib/arm/ (<- this directory should already exist and have files inside)
AWESOME!

I've seen a couple errors in the logs about the database being locked, which shouldn't ever happen. That could cause something like the guide to go blank for a while; it should auto-recover at some point. I think there is a configuration problem with the database on Android.

If you want, you can do this with the device attached over ADB: adb logcat -s "zuki.pvr.hdhomerundvr". This will spit out any errors logged by just the addon itself. Errors should be in the Kodi log as well. I'm betting the "database locked" is what you're running into.

For what it's worth, I've managed to fix the ARM64 Kodi Krypton Android build as well. Silly dumb mistake :) It's linked up on the wiki now for anybody that has been waiting for it.

ssyspro
Posts: 20
Joined: Thu Sep 29, 2016 3:14 pm

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by ssyspro » Tue Feb 28, 2017 11:14 am

Okay, after testing for several hours on linux clients and several android clients I have found them all doing the same or similar things but with different errors in the log between the linux and android.

The Android devices repeat the following errors when an issue occurs.

Code: Select all

02-27 21:03:46.111 25870 25944 E zuki.pvr.hdhomerundvr: ERROR: void discover_episodes_task() failed due to an unhandled exception: disk I/O error: disk I/O error
02-27 22:52:48.724 25870 25944 E zuki.pvr.hdhomerundvr: ERROR: void discover_guide_task() failed due to an unhandled exception: non-query failed or returned an unexpected result set
02-27 23:03:48.380 25870 25944 E zuki.pvr.hdhomerundvr: ERROR: void discover_recordingrules_task() failed due to an unhandled exception: disk I/O error: disk I/O error
02-27 23:04:31.700 25870 25944 E zuki.pvr.hdhomerundvr: ERROR: void discover_episodes_task() failed due to an unhandled exception: disk I/O error: disk I/O error
02-27 23:42:44.343 25870   795 E zuki.pvr.hdhomerundvr: ERROR: bool OpenLiveStream(const PVR_CHANNEL&) failed due to an unhandled exception: unable to determine the URL for specified channel
02-27 23:43:12.662 25870   877 E zuki.pvr.hdhomerundvr: ERROR: bool OpenLiveStream(const PVR_CHANNEL&) failed due to an unhandled exception: unable to determine the URL for specified channel
02-28 12:42:16.905 12383 13311 E zuki.pvr.hdhomerundvr: ERROR: zero-length read at position 0
02-28 12:42:24.460 12383 14035 E zuki.pvr.hdhomerundvr: ERROR: bool OpenLiveStream(const PVR_CHANNEL&) failed due to an unhandled exception: unable to determine the URL for specified channel
02-28 12:44:24.300 12383 14041 E zuki.pvr.hdhomerundvr: ERROR: void discover_episodes_task() failed due to an unhandled exception: disk I/O error: disk I/O error
The Linux client repeats the following.

Code: Select all

20:21:50 T:140673726539520  NOTICE: AddOnLog: HDHomeRun DVR PVR Client: discover_devices_task: scheduling next device discovery to initiate in 300 seconds
20:21:50 T:140674531845888   ERROR: PVR - Process - invalid channel or channel doesn't have an EPG
20:26:15 T:140673726539520   ERROR: Previous line repeats 108 times.
20:26:15 T:140673726539520  NOTICE: AddOnLog: HDHomeRun DVR PVR Client: discover_lineups_task: initiated local tuner device lineup discovery
20:11:14 T:140673726539520  NOTICE: AddOnLog: HDHomeRun DVR PVR Client: discover_devices_task: scheduling next device discovery to initiate in 300 seconds
20:11:53 T:140673709754112   ERROR: CPVRTimerType::CreateFromAttributes unable to resolve timer type (0x1, 0xa, 11640)
20:13:42 T:140675513300736   ERROR: Previous line repeats 52 times.
After streaming for over an hour up to several hours guide is blank on all clients recordings list is also blank and not always but most of the time channel also can not be changed. Guide can be recovered by going to settings / tv / general and selecting clear data at that point a rediscovery is triggered and guide has data again. Most cases this also corrects channel tuning and recordings list however if the only thing missing is recordings list simply leaving the screen active for about 5 min. the list will eventually populate.

So issue does seem to be database related in some way but I also wonder if the network maybe contributing since issue is occurring on more than one platform and because I run a dual stack ipv4 and ipv6 network.

Just in case and for network compatibility can you change the connection url from my.hdhomerun.com to ipv4.my.hdhomerun.com


Please let me know if you would like anything else.

clarkss12
Posts: 1198
Joined: Sat May 11, 2013 11:51 am
Device ID: 104CBEA5 ;1055A951
Location: Michigan, USA
Contact:

Re: Unofficial Kodi PVR Client for HDHomeRun DVR subscribers

Post by clarkss12 » Tue Feb 28, 2017 4:45 pm

Since I struggled needlessly on installing this great Kodi add-on, I thought I would make a quick video on how to install it. It was very easy, I was just not reading the instructions very carefully. No need to adb, or chmod, just copy and paste, but Android has to be rooted.

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

djp952
Posts: 897
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 » Tue Feb 28, 2017 6:59 pm

ssyspro wrote:
Tue Feb 28, 2017 11:14 am
Okay, after testing for several hours on linux clients and several android clients I have found them all doing the same or similar things but with different errors in the log between the linux and android.
.....
So issue does seem to be database related in some way but I also wonder if the network maybe contributing since issue is occurring on more than one platform and because I run a dual stack ipv4 and ipv6 network.

Just in case and for network compatibility can you change the connection url from my.hdhomerun.com to ipv4.my.hdhomerun.com

Please let me know if you would like anything else.
This is fantastic, I appreciate the logs and the help. I can duplicate the disk I/O errors on Android in the emulator; it's what I'm looking at tonight. The Interwebs claim that it happens on Android quite a bit in multithreaded code (this is). I seem to be doing everything right in regard to the database so I have to add a bunch of log messages and nonsense to see if Android isn't behaving the way I'm expecting it to. Pretty sure there will be an "aha" moment on this one and it will be a small tweak in the end.

The errors on the full Linux box are expected based on the symptoms you're describing. The "invalid channel or channel doesn't have an EPG" occurs when channels are added to Kodi (in this case because they were removed erroneously from the network problem) after startup. Kodi doesn't currently have a mechanism to (re)create the EPG structures so you end up with ... an empty guide ... and all of these error logs. Closing and reopening Kodi will resolve that, as will going into the PVR settings and hitting "clear data". But: that shouldn't be happening to you in the first place, and I believe you are absolutely right -- a loss of connectivity to my.hdhomerun.com is likely. Switching to ipv4.my.hdhomerun.com is an excellentsuggestion, I think you're definitely onto something there. Will definitely change that. I'm also going to look at the code to make sure it won't delete stuff if discovery fails; that's not a good behavior at all.

The PVR Timer Type errors are benign; they always happen. Kodi is trying to tell you that I didn't implement "Manual" (Specific Date/Time) timers in the code. All timers need a series ID on the backend here, so there was no way to do those. This error message and the "invalid channel or channel doesn't have an EPG" are on the wiki as well, but again, lots of good new information here to work with and I appreciate it!!
clarkss12 wrote:
Tue Feb 28, 2017 4:45 pm
Since I struggled needlessly on installing this great Kodi add-on, I thought I would make a quick video on how to install it. It was very easy, I was just not reading the instructions very carefully. No need to adb, or chmod, just copy and paste, but Android has to be rooted.

https://www.youtube.com/watch?v=SeXjJIsxPNQ
Awesome! Thank you clarkss12!

Locked