HW accel broken for flatpak

Hi, flatpak support for newer hardware is currently broken resulting in non hardware accelerated videos which draws battery on a notebook and has issues with 4k videos. I am plagued by this issue since I moved from an older intel CPU to a 13th Gen Intel.

The logs show this:

Aug 29, 2024 19:51:07.892 [140701004203712] DEBUG - [MPVEngine/mpv] libmpv_render: Loading hwdec driver 'vaapi-egl'
Aug 29, 2024 19:51:07.892 [140701004203712] DEBUG - [MPVEngine/mpv] libmpv_render/vaapi-egl: using VAAPI EGL interop
Aug 29, 2024 19:51:07.892 [140701004203712] DEBUG - [MPVEngine/mpv] libmpv_render/vaapi-egl: Trying to open a x11 VA display...
Aug 29, 2024 19:51:07.892 [140701004203712] DEBUG - [MPVEngine/mpv] libmpv_render/vaapi-egl: Trying to open a drm VA display...
Aug 29, 2024 19:51:07.892 [140701004203712] DEBUG - [MPVEngine/mpv] libmpv_render/vaapi-egl: Could not create a VA display.
Aug 29, 2024 19:51:07.892 [140701004203712] DEBUG - [MPVEngine/mpv] libmpv_render: Loading failed.
1 Like

This is still not working with the latest release, neither for the flatppak nor the snap version.

Wild guess but are you running wayland as your windows manager ? If so as a test try x11 and see if that helps.

No, this does not make a difference. No hardware acceleration, neither with wayland, nor with X.

Just curious, but what linux distro are you using, what drivers are installed for your video card/intel igpu and what kernel are you running ?

This is most likely a hardware support related issue. I have a 13th gen intel and neither flatpak nor snap are able to use it. The complete same disk image works fine on my 7th generation intel integrated GPU. VLC and mpv also work fine.

snap (and flatpak?) packages include drivers, they are probably out of date. That’s why vaapi decoding with such new hardware probably fails.

Well, that might be true, but the hardware is about a year old now, so it is not THAT new any more. Furthermore I am also using the snap version of VLC and hardware acceleration is working fine there.

That’s pretty interesting, because it doesn’t work on 8th gen.

If the “bundled drivers” really are too old they must be REALLY old to make the cut-off between 7th and 8th gen Intel Core…

-edit- Still broken in case that wasn’t clear.

Correct. This is known and intended behavior. Hardware access to GPU is blocked by flat/snap sandboxing. Stop using flat/snap.

Use APT or Docker if you want full features and control.

This is not really true, both support hardware acceleration and it works just fine for other applications. As for using docker or deb packages, I think your are talking about the server side. To my knowledge there are no deb packages for the client side.

Installed 1.106.0 this morning and HW acceleration still not working on 8th gen intel. Can we just get a native .deb package so we can troubleshoot without the sandboxing. MPV works just fine playing back my 4K movies but Plex on the same machine brings the system to it’s knees.

…? It’s available in all the normal places. On the website: https://www.plex.tv/media-server-downloads

Or via plex repository: https://support.plex.tv/articles/235974187-enable-repository-updating-for-supported-linux-server-distributions/

Or via docker from plexinc: https://hub.docker.com/r/plexinc/pms-docker/

Not the server. The client.

I am seeing the same thing. Additionally, I see more cpu utilization in flatpak by comparison to the snap, but not so much to indicate that HW acceleration is functional in one but not the other.

Ok, I found the issue why hardware decoding is not working with flatpaks. The culprit is that the startup shell script in the flatpak sets the LIBVA_DRIVERS_PATH to something which ONLY exists in a snap. As a result the drivers are not being found.
To fix this issue you can do the following.

  • Install the flatpak for your user and not system, this makes it easier to change the files
  • Open “~/.local/share/flatpak/app/tv.plex.PlexDesktop/current/active/files/bin/Plex” with an editor and comment line 40 which sets the LIBVA_DRIVERS_PATH

If you then start the plex flatpak, hardware decoding will work again. Please note, this change needs to be done again once the application is updated.

I do hope that someone from plex reads this and makes the change in the file so editing it manually is not required.

1 Like

@mike9868

Thank you for the report and the investigation.

I’ve taken your findings and submitted to Engineering as written :slight_smile:

The Triage meeting will review and assign to the project team.

Thanks,

I guess the most straight forward fix is to only set it, if the snap variable is set in the first place, but deleting the line in the flatpak was the quick way to test it

@mike9868

There’s internal discussion on this already.
I expect, based on the discussion, in conjunction with your findings, for a prompt fix.

1 Like

I just installed the latest update made the change again but HW decoding is not being used.

Update: A reboot fixed this issue, but even with HW decoding working watching 4K movies is impossible