Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live TV HEVC streams not playing-Ubuntu 22.04 lts Kodi Nexus #619

Closed
mralapete opened this issue May 10, 2023 · 22 comments
Closed

Live TV HEVC streams not playing-Ubuntu 22.04 lts Kodi Nexus #619

mralapete opened this issue May 10, 2023 · 22 comments

Comments

@mralapete
Copy link

I’m using Kodi Nexus on a Kaby Lake generation processor with Intel HD630 iGPU. As the title suggests the HECV Live TV streams will not play with hardware acceleration enabled. They play fine with hardware acceleration disabled. I’m using TVH backend latest with PVR-TVH 20.6.2

What I’ve tried so far. Rather than play the stream I recorded it in Kodi. The recorded stream will play with hardware acceleration enabled. It’s important to note that I’m passing a raw transport stream directly from TVH to Kodi via the PVR-HTS Kodi addon. There’s no transcoding involved here.

What I tried next just to rule out any hardware was to install Next PVR and run it under the same conditions. Live TV plays no problem in Kodi via the PVR-Next PVR addon.

Maybe you might have some pointers as to what is happening here.

@hagaygo
Copy link

hagaygo commented May 10, 2023

Try enabling the Http Streaming in addon settings , It disables the HTSP protocol but uses the pass profile on TVH so it should act more like playing a recording show on the addon.

@mralapete
Copy link
Author

mralapete commented May 10, 2023

Try enabling the Http Streaming in addon settings , It disables the HTSP protocol but uses the pass profile on TVH so it should act more like playing a recording show on the addon.

Thanks for responding. As soon as I enable http in the addon and try to play a TV channel I get the error message “one or more items fail to play. I did come across this from 6 years ago but not sure how relevant it is today.

#175

@mralapete
Copy link
Author

Also found this. https://forum.kodi.tv/showthread.php?tid=265729

It’s difficult to know from research if the problem lies with TVH or Kodi Live TV.

@hagaygo
Copy link

hagaygo commented May 11, 2023

Make sure you enabled this option in the addon settings

image

Its relatively new and surly was not available on 2016.

Anyhow , Try to play same channel using VLC (download the m3u from tvh web UI) , if it plays , it should be playable using kodi.

And if you still have errors , check TVH's log on the web gui, might help to debug the issue.

@mralapete
Copy link
Author

Make sure you enabled this option in the addon settings

image

Its relatively new and surly was not available on 2016.

Anyhow , Try to play same channel using VLC (download the m3u from tvh web UI) , if it plays , it should be playable using kodi.

And if you still have errors , check TVH's log on the web gui, might help to debug the issue.

Thanks again for taking the time with this.

As I mentioned above I did indeed enable HTTP as you outlined above. This returns the error “one or more items failed to play. Check the log for further details”

I’ve already tried to play the stream directly in VLC with hardware acceleration enabled and this stream played successfully.

I’ve also managed to record this stream in Kodi and the recording will play successively in Kodi with hardware acceleration enabled.

I’m convinced the problem lies with the Kodi TVH HTSP Client and Kodi and how they are communicating.

I have LibreELEC installed on a different setup and experience none of these problems.

I did install Kodi from the recommended XBMC PPA so I assume that when I installed the Kodi-pvr-hts addon v 20.6.2 it installed the correct version.

I will check the logs again to see if it shows any further detail on this problem.

@ksooo
Copy link
Member

ksooo commented May 11, 2023

I’m convinced the problem lies with the Kodi TVH HTSP Client and Kodi and how they are communicating.

I'm not convinced at all. This add-on here only takes what it gets from tvheadend and delivers it to Kodi, without any modifications. So, it is more likely that the problem is either in tvheadend or kodi, not this add-on. Not saying that I KNOW that the add-on cannot be the cause of the problem, but those two other components are far more suspicious.

I have LibreELEC installed on a different setup and experience none of these problems.

LE also uses Kodi and this add-on here. So, it's not LE, it could be different Kodi/tvheadeend versions making the difference. As you did not say which LE version, i cannot say anything about this.

@mralapete
Copy link
Author

I’m convinced the problem lies with the Kodi TVH HTSP Client and Kodi and how they are communicating.

I'm not convinced at all. This add-on here only takes what it gets from tvheadend and delivers it to Kodi, without any modifications. So, it is more likely that the problem is either in tvheadend or kodi, not this add-on. Not saying that I KNOW that the add-on cannot be the cause of the problem, but those two other components are far more suspicious.

I have LibreELEC installed on a different setup and experience none of these problems.

LE also uses Kodi and this add-on here. So, it's not LE, it could be different Kodi/tvheadeend versions making the difference. As you did not say which LE version, i cannot say anything about this.

Unlike LE, which I also use here on a separate machine, this is not a bundled package I’m using. LE would be tested across all its different components for compatibility and workability and packaged and yes it does work here too perfectly. I’m interested in hearing from anyone using Kodi on Ubuntu 22.04.

The four components here to consider are Ubuntu 22.04 lts, TVH, Kodi and Kodi-PVR-HTS. Each are installed independently of each other and to further complicate matters Kodi-PVR-HTS is independently installed as a binary blob from an external source.

Of course each of the component producers will blame the other. That’s natural. To rule out Ubuntu and Kodi I installed Next PVR server for Linux which has its own external Next PVR Kodi client. Both work perfectly together and happily play HEVC UHD Live TV channels with hardware acceleration enabled.

Next in TVH on the the web ui I played the HEVC UHD Live TV via VLC with hardware acceleration enabled. Once again this played perfectly.

Finally in Kodi via TVH I recorded the HEVC UHD Live TV channel. This recording played back in Kodi perfectly with hardware acceleration enabled.

I am double checking logs In Ubuntu, TVH, and Kodi to see if I can isolate this problem

@mralapete
Copy link
Author

I think after reading this unresolved issue I won’t be holding my breath for a solution #350

@hagaygo
Copy link

hagaygo commented May 12, 2023

I think after reading this unresolved issue I won’t be holding my breath for a solution #350

I'll just say it one more time.
When http streaming is enabled htsp is not used by the addon and "pass" profile should be used.
Check the logs to verify rhis.

@mralapete
Copy link
Author

I think after reading this unresolved issue I won’t be holding my breath for a solution #350

I'll just say it one more time. When http streaming is enabled htsp is not used by the addon and "pass" profile should be used. Check the logs to verify rhis.

And I’ve already explained the outcome when I enable HTSP in the Kodi addon.

What OS are you running your setup on. Where did you install TVH from. Did you compile it yourself or install it from a PPA. What source did you install Kodi from or did you compile it from source code.

@ksooo
Copy link
Member

ksooo commented May 12, 2023

Why can’t you post Kodi logfiles? That would help a lot!

@mralapete
Copy link
Author

Logs are enormous and everywhere I go I get the same response. Logs are too big. I’ve enough logs here to fill the Amazon rainforest. Anyway the majority of people here probably couldn’t decipher the logs and I wasn’t sure if you were still active on this project. TVH development has fallen off the cliff and interest has practically vanished.

I was going around in circles here so I decided to compile TVH, Kodi and the Kodi TVH client myself instead of relying on 3rd party packaged sources.

I have now resolved the issue and have a fully functioning system but thanks for getting back to me as the addon maintainer.

@FernetMenta
Copy link
Contributor

If you enable http streaming in the addon settings, the addon is not involved in playing the stream. Kodi connects directly to TVH. The error you are observing "one or more items failed to play. Check the log for further details" most likely is caused by Kodi's file cache. This cache struggles with realtime streams. At the time I was using this, I disabled caching for PVR streams. You can test this by disabling caching in advanced settings.
@ksooo PVR live streams should be excluded from caching in general.

@lrusak
Copy link

lrusak commented May 12, 2023

Logs are enormous and everywhere I go I get the same response. Logs are too big. I’ve enough logs here to fill the Amazon rainforest. Anyway the majority of people here probably couldn’t decipher the logs and I wasn’t sure if you were still active on this project. TVH development has fallen off the cliff and interest has practically vanished.

This isn't a good excuse really. Start Kodi with debug logging, reproduce the issue, close kodi. Post log. It will be minimal.

I was going around in circles here so I decided to compile TVH, Kodi and the Kodi TVH client myself instead of relying on 3rd party packaged sources.

I have now resolved the issue and have a fully functioning system but thanks for getting back to me as the addon maintainer.

This doesn't really help anyone actually figure out what the issue is or what needs fixing.

@ksooo
Copy link
Member

ksooo commented May 12, 2023

@ksooo PVR live streams should be excluded from caching in general.

@FernetMenta do you know where in Kodi code base this can be done? And what is the correct way to determine a PVR live stream?

@mralapete
Copy link
Author

mralapete commented May 12, 2023

Logs are enormous and everywhere I go I get the same response. Logs are too big. I’ve enough logs here to fill the Amazon rainforest. Anyway the majority of people here probably couldn’t decipher the logs and I wasn’t sure if you were still active on this project. TVH development has fallen off the cliff and interest has practically vanished.

This isn't a good excuse really. Start Kodi with debug logging, reproduce the issue, close kodi. Post log. It will be minimal.

I was going around in circles here so I decided to compile TVH, Kodi and the Kodi TVH client myself instead of relying on 3rd party packaged sources.
I have now resolved the issue and have a fully functioning system but thanks for getting back to me as the addon maintainer.

This doesn't really help anyone actually figure out what the issue is or what needs fixing.

Now that I have spent the last three days trying to resolve this issue and managed to find a solution everybody wants to join in.

I gave you my solution. I compiled everything I needed from source, something I should have done from the start. My TVH/Kodi setup works exactly as I need it on my machine. No logs required for that.

For anyone using VAAPI particularly in Debian it’s important that you use this command to ensure that VAAPI is initialised correctly on Kodi startup.

usermod -a -G cdrom,audio,render,video,plugdev,users,dialout,dip,input kodi

@ksooo
Copy link
Member

ksooo commented May 12, 2023

Now that I have spent the last three days trying to resolve this issue and managed to find a solution everybody wants to join in.

Seriously? We all tried to help from the same day you opened the issue.

My TVH/Kodi setup works exactly as I need it on my machine. No logs required for that.

Sorry, you just suck. Opening an issue, keeping us busy, not providing the information we need to actually be able to help. And once you solved the problem yourself, you're refraining to share your findings so we can learn from that. You take what the world shares with you for free (Kodi, pvr.hts, tvheadend, Ubuntu, ...) but don't give a shit on contributing back. Or do you just don't know why it now works for you?

@ksooo ksooo closed this as completed May 12, 2023
@fritsch
Copy link

fritsch commented May 12, 2023

While someone else might read this: "Initialize correctly" -> when using the iHD driver for vaapi and not the older i965 vaapi driver, additional permission for /dev/dri/renderD128 is needed so that vaapi works properly. This device is owned by the render group.

Other using i965-va-driver don't need that.

Has zero to do with kodi ... and would be directly visible from the log or even when running vainfo.

@FernetMenta
Copy link
Contributor

@ksooo PVR live streams should be excluded from caching in general.

@FernetMenta do you know where in Kodi code base this can be done? And what is the correct way to determine a PVR live stream?

@ksooo unfortunately the logic when caching should be enabled/disabled is a bit ugly and my solution is not a generic one. Check out https://github.com/xbmc/xbmc/blob/2f793e7f9ed32dbc63a6790bebebd58109c19d6d/xbmc/filesystem/File.cpp#L284

Filecache has issues with real time streams. Apart from not working correctly it makes no sense trying to cache them. Currently TVH http(s) streams are considered internet streams. Same is true for the Spotify addon which creates a temporary local http server. With file cache enabled this fails playing.

There are definitaly cases where file cache does not work. IMO the decision to enable it as default was wrong.

@mralapete
Copy link
Author

@ksooo PVR live streams should be excluded from caching in general.

@FernetMenta do you know where in Kodi code base this can be done? And what is the correct way to determine a PVR live stream?

@ksooo unfortunately the logic when caching should be enabled/disabled is a bit ugly and my solution is not a generic one. Check out https://github.com/xbmc/xbmc/blob/2f793e7f9ed32dbc63a6790bebebd58109c19d6d/xbmc/filesystem/File.cpp#L284

Filecache has issues with real time streams. Apart from not working correctly it makes no sense trying to cache them. Currently TVH http(s) streams are considered internet streams. Same is true for the Spotify addon which creates a temporary local http server. With file cache enabled this fails playing.

There are definitaly cases where file cache does not work. IMO the decision to enable it as default was wrong.

Might be worth opening a new issue with your findings. This issue was closed by the maintainer.

@malvinas2
Copy link

@ksooo unfortunately the logic when caching should be enabled/disabled is a bit ugly and my solution is not a generic one. Check out https://github.com/xbmc/xbmc/blob/2f793e7f9ed32dbc63a6790bebebd58109c19d6d/xbmc/filesystem/File.cpp#L284

@FernetMenta Why is it ugly? As mentioned in File.cpp Line 277 it should be configurable in the as.xml. No need to compile the source.

@FernetMenta
Copy link
Contributor

The options that can be configured are not sufficient for what is required in some cases. You might want to buffer a real internet stream but not a http stream coming from TVH hosted on your local network. And you definitely don't want to buffer a http stream coming from localhost.
It is ugly because it judges a stream/remote location by its protocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants