HW decoding in Kodi 19 with x11
#1
Video 
@popcornmix

I would like to know if Kodi 19 with hw acceleration in a x11 session would be possible. I explain myself :
Until recently i used Raspberry OS with Pixel as DE (with a rpi 4). I installed Kodi on it, the last version is 18.7. I do have hw acceleration for h264 and h265 content, no problem.

Now, i recently tried other distro : Manjaro ARM and a vanilla Arch ARM with mainline kernel, both with xfce DE. Then i installed Kodi 19 on it, from Arch ARM repository.

Well, what i have is :
- When i run Kodi 19 inside a x11 session, i do not have hw acceleration.
- When i run Kodi 19 outside a x11 session, in a tty session, i have hw acceleration with DRM Prime, and i have more options within Kodi (in Player section).

I surely do not understand everything. But, basically, i would like to know how it would be possible to have hw acceleration with Kodi 19 as i had in Raspberry OS in a x11 session. The main difference is that rpi OS is 32 bits, uses MMAL and it was Kodi 18.7
Did i miss something or is there any technical limitation now with Kodi 19 ?
Thanks in advance
Reply
#2
You are of course free to use whatever Linux distro you like on the Raspberry Pi, but there will be limited to no support from Kodi.

Currently the focus has shifted to overall GBM/V4L2 development, so that various types of hardware can run Kodi with hardware acceleration as well as things like HDR.
X11 was never really an option for Kodi with developers of, for example, LibreELEC or Raspberri Pi OS.
Got a Kodi problem? Provide us with a full Debug log (wiki) || Usefull pages: First time user (wiki) || Troubleshooting (wiki) || Free content (wiki) || Forum rules (wiki) || VPN policy (wiki)
Reply
#3
(2021-02-22, 11:21)Klojum Wrote: are of course free to use whatever Linux distro you like on the Raspberry Pi, but there will be limited to no support from Kodi

Thanks for your answer. But honestly, i do have hw acceleration in a x11 session within Raspberry Pi OS with Kodi 18.7. It's a Raspberry pi OS from stable branch without any modifications related to video.
That is why i am surprised not to have the same with Kodi 19, even if it's another distro. But I understand what you mean.
Do you know any distro for rpi4, 32 bits or 64 bits on which i could have hw acceleration in a x11 session, whatever DE is. This is how i use Kodi (in a x11 session), because i use both Kodi and the Desktop Environment on the same machine.
Reply
#4
(2021-02-22, 10:08)barracuda Wrote: ...
Now, i recently tried other distro : Manjaro ARM and a vanilla Arch ARM with mainline kernel, both with xfce DE. Then i installed Kodi 19 on it, from Arch ARM repository.
...

For context, Arch ARM ships @popcornmix gbm branch of Matrix provided by the kodi-rpi package.  HW decoding works as expected with the linux-raspberrypi4 kernel (uses rpi-5.10.y branch not mainline) in standalone mode, ie started with a systemd service. When started under an X11 session (tested under LXQT), only SW decoding is used.  I think that is to be expected but please correct me if I am wrong.
Need help programming a Streamzap remote?
Reply
#5
There is no specific code to handle hardware video decode when running under X on Leia or Matrix.

If it works on Leia I'm going to guess that is accidental - I assume it doesn't decode into the kodi window, but grabs the full screen
(possibly without blanking the black bars when video is letterboxed)?

With gbm build you can only have one drm master, so if X has the screen, then kodi can't render video fullscreen.
Reply
#6
(2021-02-22, 14:07)popcornmix Wrote: There is no specific code to handle hardware video decode when running under X on Leia or Matrix.

If it works on Leia I'm going to guess that is accidental - I assume it doesn't decode into the kodi window, but grabs the full screen
(possibly without blanking the black bars when video is letterboxed)?

With gbm build you can only have one drm master, so if X has the screen, then kodi can't render video fullscreen.

@popcornmix
I understand that was accidental now Smile That is why i was confusing. Nevertheless, i only used Kodi 18.x with Raspberry pi OS, maybe there is hw decoding with x11 only with that OS, i do not know.
Well, to answer your question, that is true that when i run Kodi within Pixel desktop environment, it's in fullscreen, then, there is no issue with movies in any aspect ratio, you have black borders as with any 2.35:1 or 16:9 movies, you can zoom in if you want to reduce those black borders, as usual.

By the way, in Kodi 19 run into a tty console, now there is flickering when i zoom in a movie (to reduce the mattes - black bars) to 1,10 for instance, but there is no when i zoom out (to something like 0,98). Is that something that happens only to me or are you aware about that ?
Reply
#7
(2021-02-22, 21:47)barracuda Wrote: By the way, in Kodi 19 run into a tty console, now there is flickering when i zoom in a movie (to reduce the mattes - black bars) to 1,10 for instance, but there is no when i zoom out (to something like 0,98). Is that something that happens only to me or are you aware about that ?

The flickering is also present if you hit the 'Z' key during playback but it is hit-or-miss. Some media triggers it while others are fine. I described it in this thread.
Need help programming a Streamzap remote?
Reply
#8
(2021-02-22, 21:47)barracuda Wrote:
(2021-02-22, 14:07)popcornmix Wrote: There is no specific code to handle hardware video decode when running under X on Leia or Matrix.

If it works on Leia I'm going to guess that is accidental - I assume it doesn't decode into the kodi window, but grabs the full screen
(possibly without blanking the black bars when video is letterboxed)?

With gbm build you can only have one drm master, so if X has the screen, then kodi can't render video fullscreen.

@popcornmix
I understand that was accidental now Smile That is why i was confusing. Nevertheless, i only used Kodi 18.x with Raspberry pi OS, maybe there is hw decoding with x11 only with that OS, i do not know.
Well, to answer your question, that is true that when i run Kodi within Pixel desktop environment, it's in fullscreen, then, there is no issue with movies in any aspect ratio, you have black borders as with any 2.35:1 or 16:9 movies, you can zoom in if you want to reduce those black borders, as usual.

By the way, in Kodi 19 run into a tty console, now there is flickering when i zoom in a movie (to reduce the mattes - black bars) to 1,10 for instance, but there is no when i zoom out (to something like 0,98). Is that something that happens only to me or are you aware about that ?

I am the guy who provides the Kodi packages available on Raspberry Pi OS, and I can tell you that isn't accidental, it couldn't be. Kodi 18.x on the Raspberry Pi OS and RPi 4 is the Kodi GBM version, it is the only one that supports hw video decode on the RPi 4. The reason that it works on X11/DE is that we made a hack for that it, changes vt at start, and it returns to the vt the DE was running when you exit.
Reply
#9
(2021-02-23, 11:30)rascas Wrote: I am the guy who provides the Kodi packages available on Raspberry Pi OS, and I can tell you that isn't accidental, it couldn't be. Kodi 18.x on the Raspberry Pi OS and RPi 4 is the Kodi GBM version, it is the only one that supports hw video decode on the RPi 4. The reason that it works on X11/DE is that we made a hack for that it, changes vt at start, and it returns to the vt the DE was running when you exit.

Yes, I know that supporting kodi 18 being built launched from X11 and running the gui fullscreen is a deliberate action. And that is possible with kodi 19 using the same mechanism.

I thought barracuda was saying that an X11 build of kodi 18 (presumably with the raspberry pi defines) runs as a windowed X11 app and also has hardware acceleration for video decode.
That is something that I am not aware of working, and if it does, it is by accident (in a way that won't be possible on kodi 19). But looking back I may have been misinterpreting baracuda's description of running kodi in an X11 session.
Reply
#10
(2021-02-23, 12:09)popcornmix Wrote: But looking back I may have been misinterpreting baracuda's description of running kodi in an X11 session.

I believe you were correct. He would like to run Kodi in an X11 session with HW accel.
Need help programming a Streamzap remote?
Reply
#11
(2021-02-23, 12:34)graysky Wrote:
(2021-02-23, 12:09)popcornmix Wrote: But looking back I may have been misinterpreting baracuda's description of running kodi in an X11 session.

I believe you were correct. He would like to run Kodi in an X11 session with HW accel.

That's what I thought too. It just depends in what someone understands by that, and what I tried to explain, since he talked on the differences in the Raspberry Pi OS.
Reply
#12
(2021-02-23, 12:34)graysky Wrote:
(2021-02-23, 12:09)popcornmix Wrote: But looking back I may have been misinterpreting baracuda's description of running kodi in an X11 session.

I believe you were correct. He would like to run Kodi in an X11 session with HW accel.

I got it now !
I was referring, certainly with confusion, to run Kodi inside a x11 session, whatever happens underneath.
The hack @rascas talked about is perfect for me, no more, no less.

Once again, i did not know nothing about this hack. On RPI OS and Kodi 18.7, i run Kodi from Pixel.
Now Kodi 19 is stable and also because i wanted to switch to Arch ARM, i noticed that i could not launch Kodi from my DE.

That is why i asked help to Arch ARM forum.
Then, @graysky made a new kodi-rpi package in order to be able to launch Kodi inside a DE.

I understand now why there is no hw decoding in that case and why there is hw decoding with RPI OS. One has true x11 support and the other has a hack allowing us to run Kodi from x11.
So, this is not related to Kodi 18 nor Kodi 19.

My god ! I confused everybody...sorry guys
Reply
#13
If kodi is built for x11 it can run in a window but it has no acceleration. It's not a recommended configuration on a pi as getting pixels on the screen through an X11 window is expensive and makes 4K and 1080p60 playback impossible. You will also get tearing with lower resolutions.

If kodi is built for gbm it can only run fullscreen (both gui and video layers) but it can have acceleration and good performance.
A gbm app can only be launched from X11 by switching to a different virtual console (it needs a wrapper script that calls chvt).

All of this is true on Kodi 18 and 19.
Reply
#14
@popcornmix : Thanks a lot for the clarification, this is crystal clear now.

I think what you said and how you said it is very important, and would help people to understand.
Reply



Logout Mark Read Team Forum Stats Members Help
HW decoding in Kodi 19 with x110
This forum uses Lukasz Tkacz MyBB addons.