Unofficial Kodi HDHomeRun DVR PVR Client

Kodi Community Development

Moderator: TVJunkie198

Post Reply
djp952
Posts: 1514
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD USA
x 36

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

otaku wrote: Sat Aug 14, 2021 6:57 pm Tried the "android-arm" and BINGO!

Thank You!
Anytime, my friend, anytime. Very glad it was that simple :)

theb0b0
Posts: 5
Joined: Thu Aug 19, 2021 3:17 pm
Device ID: 107503AA
x 1

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by theb0b0 »

Love this addon - I have been using it on all of my Kodi devices for a few years now - thanks djp952 for all of your hard work!

I had a question on a non-critical feature. I've never been able to get signal quality or SNR displaying in Kodi's PVR interface or PVR info screen. I have enabled the "Show Signal Quality" Setting within Kodi itself but it always just shows 0% for both.

Everything else works great but it would be nice to be able to check the signal strength of a channel from within Kodi.

Is this something that works for others and I am just missing a configuration somewhere? Or is this a known issue that the data is just not available for display?

I'm using the HDHomerun Quattro with a RECORD instance running on a linux VM.

Thanks!

Image

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

theb0b0 wrote: Thu Aug 19, 2021 3:45 pm Love this addon - I have been using it on all of my Kodi devices for a few years now - thanks djp952 for all of your hard work!

I had a question on a non-critical feature. I've never been able to get signal quality or SNR displaying in Kodi's PVR interface or PVR info screen. I have enabled the "Show Signal Quality" Setting within Kodi itself but it always just shows 0% for both.

Everything else works great but it would be nice to be able to check the signal strength of a channel from within Kodi.

Is this something that works for others and I am just missing a configuration somewhere? Or is this a known issue that the data is just not available for display?

I'm using the HDHomerun Quattro with a RECORD instance running on a linux VM.

Thanks!

Image
Hi! Actually, it's not implemented, you're not missing anything on your end.

My (perhaps perceived?) problem with this functionality is that it's expensive to go get, and Kodi asks for it constantly. It doesn't matter if you have the window up or not, Kodi will keep asking and asking and asking. When you put the DVR engine (RECORD) in the mix, the addon would also need to go look at all the tuner(s) you have and try to match up what the DVR engine is using with a tuner that's active and tuned to the proper channel. My impression to date is that this would be far too much work to add onto a lower-power device (like an Amazon stick or an older Pi) that can already become CPU-bound by Kodi.

That said, there is likely no harm in making something like that optional? Something like "Report signal status and quality metrics"? If you have more than one tuner tuned to the same channel and you're going through the DVR engine, it may not be able to pick the right one, but it can find one of them :)

The good news is that I've implemented this on another project and learned that Kodi does this on an alternate thread so I can do it in response to Kodi asking and don't need any extreme new plumbing. The bad news is that Kodi does this on an alternate thread so I do need to add some locking that isn't there today to prevent race conditions with the stream/playback state.

If this would have value for you, I'm game to queue it up and see how it goes?

theb0b0
Posts: 5
Joined: Thu Aug 19, 2021 3:17 pm
Device ID: 107503AA
x 1

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by theb0b0 »

djp952 wrote: Thu Aug 19, 2021 6:10 pm Hi! Actually, it's not implemented, you're not missing anything on your end.

My (perhaps perceived?) problem with this functionality is that it's expensive to go get, and Kodi asks for it constantly. It doesn't matter if you have the window up or not, Kodi will keep asking and asking and asking. When you put the DVR engine (RECORD) in the mix, the addon would also need to go look at all the tuner(s) you have and try to match up what the DVR engine is using with a tuner that's active and tuned to the proper channel. My impression to date is that this would be far too much work to add onto a lower-power device (like an Amazon stick or an older Pi) that can already become CPU-bound by Kodi.

That said, there is likely no harm in making something like that optional? Something like "Report signal status and quality metrics"? If you have more than one tuner tuned to the same channel and you're going through the DVR engine, it may not be able to pick the right one, but it can find one of them :)

The good news is that I've implemented this on another project and learned that Kodi does this on an alternate thread so I can do it in response to Kodi asking and don't need any extreme new plumbing. The bad news is that Kodi does this on an alternate thread so I do need to add some locking that isn't there today to prevent race conditions with the stream/playback state.

If this would have value for you, I'm game to queue it up and see how it goes?
Wow thanks for the quick and thorough reply.

If it's constantly asking even in the BG then I can see why it's not really worth implementing. I had seen it work some years ago in either the mythTV and TVHeadend apps I was trying so was curious if it could be done here. HDHR with your addon is just so much simpler and easier to setup this was just one feature that I noticed stopped working when I switched over.

Might be nice to have as an advanced setting for debug purposes if it's not too hard to implement, but I won't lose any sleep over it not being an option:)

Thanks again!

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

theb0b0 wrote: Thu Aug 19, 2021 8:02 pm
djp952 wrote: Thu Aug 19, 2021 6:10 pm Hi! Actually, it's not implemented, you're not missing anything on your end.

My (perhaps perceived?) problem with this functionality is that it's expensive to go get, and Kodi asks for it constantly. It doesn't matter if you have the window up or not, Kodi will keep asking and asking and asking. When you put the DVR engine (RECORD) in the mix, the addon would also need to go look at all the tuner(s) you have and try to match up what the DVR engine is using with a tuner that's active and tuned to the proper channel. My impression to date is that this would be far too much work to add onto a lower-power device (like an Amazon stick or an older Pi) that can already become CPU-bound by Kodi.

That said, there is likely no harm in making something like that optional? Something like "Report signal status and quality metrics"? If you have more than one tuner tuned to the same channel and you're going through the DVR engine, it may not be able to pick the right one, but it can find one of them :)

The good news is that I've implemented this on another project and learned that Kodi does this on an alternate thread so I can do it in response to Kodi asking and don't need any extreme new plumbing. The bad news is that Kodi does this on an alternate thread so I do need to add some locking that isn't there today to prevent race conditions with the stream/playback state.

If this would have value for you, I'm game to queue it up and see how it goes?
Wow thanks for the quick and thorough reply.

If it's constantly asking even in the BG then I can see why it's not really worth implementing. I had seen it work some years ago in either the mythTV and TVHeadend apps I was trying so was curious if it could be done here. HDHR with your addon is just so much simpler and easier to setup this was just one feature that I noticed stopped working when I switched over.

Might be nice to have as an advanced setting for debug purposes if it's not too hard to implement, but I won't lose any sleep over it not being an option:)

Thanks again!
It can be done; I shall endeavor to make it so (optionally).

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F »

djp952 wrote: Thu Aug 19, 2021 6:10 pm My impression to date is that this would be far too much work to add onto a lower-power device (like an Amazon stick or an older Pi) that can already become CPU-bound by Kodi.
Tvheadend has the tuner status in the PVR info OSD and my RPi2 client seems to run that OK. The backend keeps track of the tuner SNR and Signal Strength all the time so maybe that's doing all the heavy lifting?

Image

Image

Image

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

TVHeadEnd is accessing the tuner(s) directly, I assume, so it already knows what tuner to ask :)

This isn't a problem to do, really, it's just a matter of finding what tuner is serving the stream to the DVR engine. Basically just need to marry the virtual channel with the tuner status reports and pick one. If the addon is in "tuner direct" mode it's even easier!

The DVR engine won't tell me enough to work back to a specific tuner, for example:

Code: Select all

[{"Resource":"live","Name":"Live channel 551","TargetIP":"192.168.0.192"}]
So I'll need to interrogate all the tuners and find one that's serving virtual channel 551 to get the signal stats:

Code: Select all

[{"Resource":"tuner0","VctNumber":"551","VctName":"TNT HD","Frequency":717000000,"SignalStrengthPercent":100,"SignalQualityPercent":100,"SymbolQualityPercent":100,"TargetIP":"192.168.0.220"},{"Resource":"tuner1"},{"Resource":"tuner2"}]

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F »

djp952 wrote: Fri Aug 20, 2021 10:39 am The DVR engine won't tell me enough to work back to a specific tuner, for example:

Code: Select all

[{"Resource":"live","Name":"Live channel 551","TargetIP":"192.168.0.192"}]
Maybe Nick would be willing to add the device and tuner to the record engine status.json. I'm surprised it's not already there.

signcarver
Expert
Posts: 9947
Joined: Wed Jan 24, 2007 1:04 am
Device ID: 10A05954 10802091 131B34B7 13231F92 1070A18E 1073ED6F 15300C36
x 26

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by signcarver »

I seem to recall an issue long ago that many things starting to report 0 as they weren't reporting integers from 0-100 indicating percent and what I recall a "solution" for tvheadend (when many different types/brands of tuners were present) was to assign a hot key to bring up an overlay that showed the stats of all tuners from the tvheadend server and that various devices that were indicating dB, dBV, dBmV, etc. could have plugins to provide the numerical values in a consistent manner and I seem to recall those numbers only being polled when asked and every second or two while the overlay was up. but that particualr solution have values for all tuners not just the one you were watching.

Depending how you do yours, I would assume you might use status.json to poll and thought I would share some interesting tidbits from such for tuners you might not have. A Dev unit also now provides dBm, dBmV and dB readings (some earlier firmwares didn't do that from status.json)... a Flex/scribe (since also being an engine) will be streaming to itself (127.0.0.1) but also report live target as an engine would. But I believe you also sometimes use libhdhomerun (or such) going back to the legacy poling.

4K-DEV

Code: Select all

[
{
Resource: "tuner0",
Frequency: 599000000,
SignalStrengthPercent: 91,
SignalQualityPercent: 62,
SymbolQualityPercent: 100,
SignalStrengthDBm: -55,
SignalStrengthDBmV: -6,
SignalQualityDB: 21.5
},
{
Resource: "tuner1"
},
{
Resource: "tuner2"
},
{
Resource: "tuner3"
}
]

Flex-4K

Code: Select all

[
{
Resource: "tuner0",
VctNumber: "112.1",
VctName: "KPNX-NG",
Frequency: 551000000,
SignalStrengthPercent: 100,
SignalQualityPercent: 91,
SymbolQualityPercent: 100,
TargetIP: "127.0.0.1",
NetworkRate: 720128
},
{
Resource: "tuner1"
},
{
Resource: "tuner2",
VctNumber: "10.3",
VctName: "Heroes",
Frequency: 195000000,
SignalStrengthPercent: 100,
SignalQualityPercent: 66,
SymbolQualityPercent: 100,
TargetIP: "127.0.0.1",
NetworkRate: 372992
},
{
Resource: "tuner3"
},
{
Resource: "live",
Name: "Live channel 112.1",
TargetIP: "192.168.0.136"
},
{
Resource: "live",
Name: "Live channel 10.3",
TargetIP: "192.168.0.33"
}
{
Resource: "live",
Name: "Live channel 12",
TargetIP: "192.168.0.133"
},
]
note the 3rd live resource is from my prime through the flex

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

theb0b0, Ken.F, does this work for you:

Image

Image

FoodLioon
Posts: 71
Joined: Wed Feb 12, 2020 9:22 pm
x 3

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by FoodLioon »

Cool addition!
I'm guessing the Signal Quality is what SD calls Signal Strength?

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F »

djp952 wrote: Sat Aug 21, 2021 3:24 pm theb0b0, Ken.F, does this work for you:
Looks good to me!

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

FoodLioon wrote: Sat Aug 21, 2021 4:27 pm Cool addition!
I'm guessing the Signal Quality is what SD calls Signal Strength?
Well ... I wish I could change the labels Kodi shows. "Signal Quality" and "SNR", to me, are pretty analogous for our purposes here, but we get to show 2 values so for right now I picked HDHR Signal Strength as Kodi Signal Quality and HDHR Signal Quality as Kodi SNR. To me, that seems the most natural way to display it, and lines up with how the HDHomeRun Config GUI shows these values (strength above quality).

I can go any way we want here. Per SD (https://info.hdhomerun.com/info/trouble ... th_quality), HDHR Signal Strength isn't really all that important, but I know many, if not all, OTA people are going to want to see that number. HDHR Symbol Quality is usually going to be at or close to 100%, so that seems pretty pointless to show (you'll end up troubleshooting this outside of Kodi anyway).

I'm fine with whatever helps the OTA folks the most. I can keep it as-is, I can swap them around, I can throw Symbol Quality in there instead of one of the others, whatever works!

Heck, I'm pretty impressed with the performance of my old EXTEND to test this, it's currently hooked up to an omnidirectional FM radio antenna in the attic (lol, right?) and I'm getting a ton of UHF channels, some of which are like 50 miles away. Must be a good tropo night? Good night to test this, at least! Sadly my favorite Washington D.C. OTA channel that I can't get on FiOS died during the repack :( I miss you WDCW.
Last edited by djp952 on Sat Aug 21, 2021 8:42 pm, edited 1 time in total.

FoodLioon
Posts: 71
Joined: Wed Feb 12, 2020 9:22 pm
x 3

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by FoodLioon »

What you have with Signal Strength on top and SNR on the bottom makes sense. Symbol quality wouldn't be useful to display, it's either off or on.

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

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

Will be posting a Matrix-only beta for this soon (tomorrow?), I noted that I am behind a version on cURL and that I have a bug to fix regarding OTA tuners that have channels >= 5000 with a name of "Unknown". If detected, this will cause an EPG listings update to occur but since the channel is unknown there is no reason to do that.

I also noted what appears to be a Kodi bug that prevents the "backend host name" from being displayed in the "PVR Info" (O key) tab dialog alongside the signal status. This works on Leia, and I have gotten as far as confirming the proper addon function is called; this will be a PR.

I don't currently think this will be backported to Leia since the PVR API contract is fundamentally different. If this will be a problem for anyone please let me know so I can work something up.

Post Reply