Plex-htpc snap failing to hardware decode - Alder Lake N

Server Version#: 1.41.3.9314
Player Version#: Plex HTPC version: 1.70.1.303-5bbf114f

I’m running a GMKtec Nuc with the N97 Intel Processor and Intel UHD graphics.
Running a video via the mpv snap by default will use hardware decoding just fine as per the log file from mpv, with the CPU running between 15-30% on one core:

mpv_standalone.log (68.0 KB)

[   0.026][v][vo/gpu] Probing for best GPU context.
[   0.026][v][vo/gpu/opengl] Initializing GPU context 'wayland'
[   0.026][v][vo/gpu/opengl] Initializing GPU context 'x11egl'
[   0.026][v][vo/gpu/x11] X11 opening display: :0
~~~
[   0.051][v][vo/gpu/opengl] EGL_VERSION=1.5
[   0.051][v][vo/gpu/opengl] EGL_VENDOR=Mesa Project
[   0.051][v][vo/gpu/opengl] EGL_CLIENT_APIS=OpenGL OpenGL_ES 
[   0.051][v][vo/gpu/opengl] Trying to create Desktop OpenGL context.
~~~
[   0.055][v][vo/gpu/opengl] Choosing visual EGL config 0x15, visual ID 0x21
[   0.056][v][vo/gpu/x11] The XPresent extension was found.
[   0.056][v][vo/gpu/x11] XPresent enabled.
[   0.059][v][vo/gpu/opengl] GL_VERSION='4.6 (Core Profile) Mesa 24.2.8-1ubuntu1~24.04.1'
[   0.059][v][vo/gpu/opengl] Detected desktop OpenGL 4.6.
[   0.059][v][vo/gpu/opengl] GL_VENDOR='Intel'
[   0.059][v][vo/gpu/opengl] GL_RENDERER='Mesa Intel(R) Graphics (ADL-N)'
[   0.059][v][vo/gpu/opengl] GL_SHADING_LANGUAGE_VERSION='4.60'
~~~
[   0.062][v][vd] Container reported FPS: 23.976024
[   0.062][v][vd] Codec list:
[   0.062][v][vd]     hevc - HEVC (High Efficiency Video Coding)
[   0.062][v][vd]     hevc_v4l2m2m (hevc) - V4L2 mem2mem HEVC decoder wrapper
[   0.062][v][vd] Opening decoder hevc
[   0.062][v][vd] Looking at hwdec hevc-vaapi...
[   0.062][v][vo/gpu] Loading hwdec drivers for format: 'vaapi'
[   0.062][v][vo/gpu] Loading hwdec driver 'vaapi'
[   0.062][v][vo/gpu/vaapi] Using EGL dmabuf interop via GL_EXT_EGL_image_storage
[   0.062][v][vo/gpu/vaapi] Trying to open a x11 VA display...
[   0.062][v][vo/gpu/vaapi/vaapi] libva: VA-API version 1.20.0
[   0.062][v][vo/gpu/vaapi/vaapi] libva: Trying to open /snap/mpv/203/gpu-2404/usr/lib/x86_64-linux-gnu/dri//iHD_drv_video.so
[   0.064][v][vo/gpu/vaapi/vaapi] libva: Found init function __vaDriverInit_1_20
[   0.067][v][vo/gpu/vaapi/vaapi] libva: va_openDriver() returns 0
[   0.067][v][vo/gpu/vaapi/vaapi] Initialized VAAPI: version 1.20
[   0.067][d][ffmpeg] AVHWDeviceContext: VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 24.1.0 ().
~~~
[   0.068][v][vd] Trying hardware decoding via hevc-vaapi.
[   0.069][v][vd] Selected codec: HEVC (High Efficiency Video Coding)
~~~
[   0.070][v][vd] Pixel formats supported by decoder: vaapi vdpau yuv420p10le
[   0.070][v][vd] Codec profile: Main 10 (0x2)
[   0.070][v][vd] Requesting pixfmt 'vaapi' from decoder.
[   0.082][i][vd] Using hardware decoding (vaapi).
[   0.082][v][vd] Decoder format: 1920x1080 vaapi[p010] bt.709/bt.709/bt.1886/limited/auto CL=mpeg2/4/h264 crop=1920x1080+0+0
[   0.082][v][vd] Using container aspect ratio.

~~~
[   0.082][v][vo/gpu] Loading hwdec drivers for format: 'vaapi'

However when attempting to run via the Plex-HTPC snap the software always fails to start hardware decoding, and ends up using vaapi-copy which then ramps up CPU usage to over 300% according to the application top. The frame rate drops to about 4 fps due to the CPU load if I get an image at all. Other times the screen is blank for the video, but the overlay works. So it appears to be the interaction of the packaged software in the snap that is not working. Here are some of the main logs from the Plex-HTPC snap.

plex-htpc.log (233.8 KB)

Feb 22, 2025 19:36:00.584 [129044465035008] DEBUG - [MPVEngine/mpv] libmpv_render: Loading hwdec driver 'vaapi'
Feb 22, 2025 19:36:00.584 [129044465035008] DEBUG - [MPVEngine/mpv] libmpv_render/vaapi: VAAPI hwdec only works with OpenGL or Vulkan backends.
Feb 22, 2025 19:36:00.584 [129044465035008] DEBUG - [MPVEngine/mpv] libmpv_render: Loading failed.
Feb 22, 2025 19:36:00.584 [129044465035008] DEBUG - [MPVEngine/mpv] libmpv_render: Loading hwdec driver 'drmprime'
Feb 22, 2025 19:36:00.584 [129044465035008] DEBUG - [MPVEngine/mpv] libmpv_render/drmprime: drmprime hwdec requires at least one dmabuf interop backend.
Feb 22, 2025 19:36:00.584 [129044465035008] DEBUG - [MPVEngine/mpv] libmpv_render: Loading failed.
Feb 22, 2025 19:36:00.584 [129044465035008] DEBUG - [MPVEngine/mpv] libmpv_render: Loading hwdec driver 'drmprime-overlay'
Feb 22, 2025 19:36:00.584 [129044465035008] DEBUG - [MPVEngine/mpv] libmpv_render/drmprime-overlay: Failed to retrieve DRM fd from native display.
Feb 22, 2025 19:36:00.584 [129044465035008] DEBUG - [MPVEngine/mpv] libmpv_render: Loading failed.

Feb 22, 2025 19:36:00.579 [129043273860864] DEBUG - Created OpenGL context QSurfaceFormat(version 3.1, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBu
fferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 0, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1,
 colorSpace QColorSpace(), profile  QSurfaceFormat::NoProfile)
Feb 22, 2025 19:36:00.580 [129043273860864] DEBUG - OpenGL VENDOR: Mesa/X.org RENDERER: llvmpipe (LLVM 12.0.0, 256 bits) VERSION: 3.1 Mesa 21.2.6
Feb 22, 2025 19:36:00.582 [129043273860864] DEBUG - MSAA sample count for the swapchain is 1. Alpha channel requested = no.
Feb 22, 2025 19:36:00.582 [129043273860864] DEBUG - rhi texture atlas dimensions: 1024x512
Feb 22, 2025 19:36:00.582 [129044465035008] DEBUG - [MPVEngine/mpv] libmpv_render: GL_VERSION='3.1 Mesa 21.2.6'
Feb 22, 2025 19:36:00.583 [129044465035008] DEBUG - [MPVEngine/mpv] libmpv_render: Detected desktop OpenGL 3.1.
Feb 22, 2025 19:36:00.583 [129044465035008] DEBUG - [MPVEngine/mpv] libmpv_render: GL_VENDOR='Mesa/X.org'
Feb 22, 2025 19:36:00.583 [129044465035008] DEBUG - [MPVEngine/mpv] libmpv_render: GL_RENDERER='llvmpipe (LLVM 12.0.0, 256 bits)'
Feb 22, 2025 19:36:00.583 [129044465035008] DEBUG - [MPVEngine/mpv] libmpv_render: GL_SHADING_LANGUAGE_VERSION='1.40'
~~~
Feb 22, 2025 19:36:16.403 [129044465035008] DEBUG - [MPVEngine/mpv] cplayer: Set property: hwdec="auto" -> 1
Feb 22, 2025 19:36:16.403 [129044465035008] DEBUG - [MPVEngine/mpv] cplayer: Set property: vo="libmpv" -> 1
~~~
Feb 22, 2025 19:36:16.620 [129044465035008] DEBUG - [MPVEngine/mpv] vd: Container reported FPS: 23.976024
Feb 22, 2025 19:36:16.620 [129044465035008] DEBUG - [MPVEngine/mpv] vd: Codec list:
Feb 22, 2025 19:36:16.620 [129044465035008] DEBUG - [MPVEngine/mpv] vd:     hevc - HEVC (High Efficiency Video Coding)
Feb 22, 2025 19:36:16.620 [129044465035008] DEBUG - [MPVEngine/mpv] vd: Opening decoder hevc
Feb 22, 2025 19:36:16.620 [129044465035008] DEBUG - [MPVEngine/mpv] vd: Looking at hwdec hevc-vaapi...
Feb 22, 2025 19:36:16.620 [129044465035008] DEBUG - [MPVEngine/mpv] vd: Could not create device.
Feb 22, 2025 19:36:16.620 [129044465035008] DEBUG - [MPVEngine/mpv] vd: Looking at hwdec hevc-vaapi-copy...
Feb 22, 2025 19:36:16.620 [129044465035008] DEBUG - [MPVEngine/mpv] vaapi: libva: VA-API version 1.21.0
Feb 22, 2025 19:36:16.620 [129044465035008] DEBUG - [MPVEngine/mpv] vaapi: libva: Trying to open /snap/plex-htpc/71/lib/dri/iHD_drv_video.so
Feb 22, 2025 19:36:16.624 [129044465035008] DEBUG - [MPVEngine/mpv] vaapi: libva: Found init function __vaDriverInit_1_21
Feb 22, 2025 19:36:16.630 [129044465035008] DEBUG - [MPVEngine/mpv] vaapi: libva: va_openDriver() returns 0
Feb 22, 2025 19:36:16.630 [129044465035008] DEBUG - [MPVEngine/mpv] vaapi: Initialized VAAPI: version 1.21
Feb 22, 2025 19:36:16.630 [129044465035008] DEBUG - [MPVEngine/mpv] vd: Trying hardware decoding via hevc-vaapi-copy.
Feb 22, 2025 19:36:16.631 [129044465035008] DEBUG - [MPVEngine/mpv] vd: Selected codec: HEVC (High Efficiency Video Coding)

I’ve tried some of the suggestions such as environment variables

QT_XCB_GL_INTEGRATION=xcb_egl

and config in the mpv.conf file

hwdec=vaapi    or    hwdec=vaapi-egl

But nothing seems to trigger the system to use pure hw decoding.

The error seems to be the video decoder is not creating a device:

vd: Looking at hwdec hevc-vaapi...
vd: Could not create device

Additional logs in the console if plex-htpc is launched from the command line:

:~/snap/plex-htpc/common$ plex-htpc
MESA: warning: Driver does not support the 0x46d1 PCI ID.
libGL error: failed to create dri screen
libGL error: failed to load driver: iris
MESA: warning: Driver does not support the 0x46d1 PCI ID.
libGL error: failed to create dri screen
libGL error: failed to load driver: iris
qt.scenegraph.general: Using QRhi with backend OpenGL
  Graphics API debug/validation layers: 0
  QRhi profiling and debug markers: 0
  Shader/pipeline cache collection: 0
qt.scenegraph.general: Using QRhi with backend OpenGL
  Graphics API debug/validation layers: 0
  QRhi profiling and debug markers: 0
  Shader/pipeline cache collection: 0
[104719:104766:0222/223126.869106:ERROR:context_group.cc(146)] ContextResult::kFatalFailure: WebGL1 blocklisted
[104719:104766:0222/223126.880826:ERROR:context_group.cc(146)] ContextResult::kFatalFailure: WebGL1 blocklisted

If I launch the same thing with the env variable: QT_XCB_GL_INTEGRATION=xcb_egl plex-htpc
then the line “failed to load driver: iris” is not seen.

If there is a way to point the Plex-HTPC snap to the external mpv snap that would work. I am not sure what is missing in the Plex-HTPC snap to make this happen, but a stand alone install of mpv snap plays a video file in hw decoding without further config changes. It is just the included software in the Plex-HTPC snap that appears to be not working or is missing components.

Does anyone know what might be the problem here?

I’m in the exact same boat with a N150 that is doing the exact same thing (also an Alder Lake N processor). It appears as thought here is a guide to replace MPV (HTPC Tips and Tricks) but I haven’t tried that. Presently, I’m using Plex HTPC on Windows but am eager to switch it to Linux once HTPC is working on the Alder Lake N processors. If you give the guide a try and get it working, do post back as I may follow the same.

The issue with replacing mpv is that Plex-HTPC is a snap, which has a read only file system.

I would like the developers to release an updated snap with the current version of Mesa and associated drivers. Mesa current release is 24, but in the snap is version 21, so I suspect it is just too old.

Have you considered trying the flatpak version? It pulls in Mesa 24 as a dependency when it is installed:

I’m not suggesting it as a permanent solution, just something to allow you to use PlexHTPC on Linux with hardware acceleration until the snap situation is sorted out.

https://www.plex.tv/media-server-downloads/?cat=plex+htpc&plat=linux#plex-app

Unfortunately I can’t confirm it works myself as I don’t have the requisite hardware.

Thanks @pshanew, it looks like the flatpak install solves some of the issue, plex-htpc frame rates seem to be much better and lower CPU. Although the ctrl-shift-D debug screen still shows hardware decoding as “no”, so something still not right. Logs confirm software decoding is happening.

Feb 24, 2025 23:26:21.416 [139700064990912] DEBUG - [MPVEngine/mpv] vd: Container reported FPS: 23.976024
Feb 24, 2025 23:26:21.416 [139700064990912] DEBUG - [MPVEngine/mpv] vd: Codec list:
Feb 24, 2025 23:26:21.416 [139700064990912] DEBUG - [MPVEngine/mpv] vd:     hevc - HEVC (High Efficiency Video Coding)
Feb 24, 2025 23:26:21.416 [139700064990912] DEBUG - [MPVEngine/mpv] vd: Opening decoder hevc
Feb 24, 2025 23:26:21.416 [139700064990912] DEBUG - [MPVEngine/mpv] vd: Looking at hwdec hevc-vaapi...
Feb 24, 2025 23:26:21.416 [139700064990912] DEBUG - [MPVEngine/mpv] vd: Could not create device.
Feb 24, 2025 23:26:21.416 [139700064990912] DEBUG - [MPVEngine/mpv] vd: Looking at hwdec hevc-vaapi-copy...
Feb 24, 2025 23:26:21.417 [139700064990912] DEBUG - [MPVEngine/mpv] vd: Could not create device.
Feb 24, 2025 23:26:21.417 [139700064990912] DEBUG - [MPVEngine/mpv] vd: Using software decoding.
Feb 24, 2025 23:26:21.418 [139700064990912] DEBUG - [MPVEngine/mpv] vd: Detected 4 logical cores.
Feb 24, 2025 23:26:21.418 [139700064990912] DEBUG - [MPVEngine/mpv] vd: Requesting 5 threads for decoding.
Feb 24, 2025 23:26:21.425 [139700064990912] DEBUG - [MPVEngine/mpv] vd: Selected codec: HEVC (High Efficiency Video Coding)
Feb 24, 2025 23:26:21.432 [139700064990912] DEBUG - [MPVEngine/mpv] vd: DR failed - disabling.
Feb 24, 2025 23:26:21.482 [139700064990912] DEBUG - [MPVEngine/mpv] vd: Using software decoding.
Feb 24, 2025 23:26:21.482 [139700064990912] DEBUG - [MPVEngine/mpv] vd: Decoder format: 1920x1080 yuv420p10 bt.709/bt.709/bt.1886/limited/auto CL=mpeg2/4/h264 crop=1920x1080+0+0
Feb 24, 2025 23:26:21.482 [139700064990912] DEBUG - [MPVEngine/mpv] vd: Using container aspect ratio.


Frame rates have also improved and visuals are much smoother. Some of the processes seem to be using a lot of CPU even when idle though. Not sure why.

I hope the developers see this and can update both the snap distribution and flatpak.

I was going to suggest the flatpak version too. I have asked the developers about this almost 2 months ago and thus far nothing has come about so hopefully we’ll get an update to see. One thing that I did notice, however, is that in another thread, someone made mention about seeing something similar due to Wayland and had to switch to using X for it to go away. I’m now actually wondering you need a combination of X Server (needed for frame switching and likely HDR switching) along with the flatpak version (for the newer MPV) to see it work properly. I may bite the bullet and give it a shot on my system. I have been hesitant to since I do have it working on Windows (with the updated MPV for TrueHD passthrough). I prefer it to be on Linux though from a performance perspective overall. But, two things I would need working is HDR switching/Passthrough, Frame Switching, and Audio Passthrough (which that does work correctly on Linux).

I’ve tried both Wayland and X11, no change with either running flatpak. I also had to turn off rate switching due to tearing artefacts.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.