Stuttering playback and high CPU usage while playing h265 video + stuck on vaap-copy

Server Version#: 1.32.5.7349

Player Version#: 1.44.1 (plex-htpc snap)

Hi all! I’m currently unable to get hardware acceleration working properly for (H265) video playback using the Plex-HTPC linux snap app on my system. When starting up the snap via the terminal, it spits out an Mesa related error. Playing the same file with MPV works just fine and uses hardware decoding, which tells me that the system should be capable of hardware decoding video in ubuntu

About the system
My system is an NUC with a 13th gen Intel Core i5 1340P, running is Ubuntu 22.04.3 LTS, 32GB of RAM, and only using the integrated graphics.

What I’ve found
I’ve turned on logging via mpv.conf and attached the output below. I’ve tried starting plex-htpc with QT_XCB_GL_INTEGRATION=xcb_egl snap run plex-htpc, which resulted in the app erroring out as “non responsive” requiring a force quit. Pressing ctrl-shift-D shows Hardware Decoding: vaapi-copy (?)

Error when issuing the snap run plex-htpc command:

max@max-NUC13ANHi5:~$ snap run plex-htpc
MESA: warning: Driver does not support the 0xa7a0 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
Cannot load libcuda.so.1
[6959:7030:0804/170510.446962:ERROR:context_group.cc(146)] ContextResult::kFatalFailure: WebGL1 blocklisted
[6959:7030:0804/170510.451842:ERROR:context_group.cc(146)] ContextResult::kFatalFailure: WebGL1 blocklisted

Errors I found in the mpv log

[   0.254][v][libmpv_render] No advanced processing required. Enabling dumb mode.
[   0.254][v][libmpv_render] Loading hwdec driver 'vaapi-egl'
[   0.254][v][libmpv_render/vaapi-egl] VAAPI hwdec only works with OpenGL or Vulkan backends.
[   0.254][v][libmpv_render] Loading failed.
[   0.254][v][libmpv_render] Loading hwdec driver 'cuda-nvdec'
[   0.254][v][libmpv_render/cuda-nvdec] Failed to load CUDA symbols
[   0.254][v][libmpv_render] Loading failed.
[   0.254][v][libmpv_render] Loading hwdec driver 'drmprime-drm'
[   0.254][v][libmpv_render/drmprime-drm] Failed to retrieve DRM fd from native display.
[   0.254][v][libmpv_render] Loading failed.

I’ve uploaded the complete log of mpv below:
mpv_log.log (32.6 KB)

Does anyone know what I’m doing wrong here?

Are you using wayland? I’m not sure but I think the EGL no-copy for video doesn’t work with wayland. FWIW, I have an older NUC running 22.04 and I get vaapi-egl on video playback but I use X and not wayland (primarily because X supports refresh rate switching).

Also, the application logs include MPV’s logging as well as logs from the application.

I think I am indeed using Wayland. It’s the default when running 22.04 right? I used this guide to disable it, but this didn’t resolve my issues with hardware decoding…

Please find the whole log attached below:
Plex HTPC.log (244.8 KB)

Your OpenGL appears to be software only and not hardware. The logs contained:

Aug 04, 2023 21:48:37.744 [140583741945600] DEBUG - [MPVEngine/mpv] libmpv_render: GL_VERSION='3.1 Mesa 21.2.6'
Aug 04, 2023 21:48:37.744 [140583741945600] DEBUG - [MPVEngine/mpv] libmpv_render: Detected desktop OpenGL 3.1.
Aug 04, 2023 21:48:37.744 [140583741945600] DEBUG - [MPVEngine/mpv] libmpv_render: GL_VENDOR='Mesa/X.org'
Aug 04, 2023 21:48:37.744 [140583741945600] DEBUG - [MPVEngine/mpv] libmpv_render: GL_RENDERER='llvmpipe (LLVM 12.0.0, 256 bits)'
Aug 04, 2023 21:48:37.744 [140583741945600] DEBUG - [MPVEngine/mpv] libmpv_render: GL_SHADING_LANGUAGE_VERSION='1.40'
Aug 04, 2023 21:48:37.744 [140583741945600] DEBUG - [MPVEngine/mpv] libmpv_render: Loaded extension GL_ARB_sync.
Aug 04, 2023 21:48:37.744 [140583741945600] DEBUG - [MPVEngine/mpv] libmpv_render: Loaded extension GL_ARB_timer_query.
Aug 04, 2023 21:48:37.744 [140583741945600] DEBUG - [MPVEngine/mpv] libmpv_render: Loaded extension GL_ARB_invalidate_subdata.
Aug 04, 2023 21:48:37.744 [140583741945600] DEBUG - [MPVEngine/mpv] libmpv_render: Loaded extension GL_ARB_get_program_binary.
Aug 04, 2023 21:48:37.744 [140583741945600] DEBUG - [MPVEngine/mpv] libmpv_render: Loaded extension GL_ARB_buffer_storage.
Aug 04, 2023 21:48:37.744 [140583741945600] DEBUG - [MPVEngine/mpv] libmpv_render: Loaded extension GL_ARB_shader_image_load_store.
Aug 04, 2023 21:48:37.744 [140583741945600] DEBUG - [MPVEngine/mpv] libmpv_render: Loaded extension GL_ARB_shader_storage_buffer_object.
Aug 04, 2023 21:48:37.744 [140583741945600] DEBUG - [MPVEngine/mpv] libmpv_render: Loaded extension GL_ARB_compute_shader.
Aug 04, 2023 21:48:37.744 [140583741945600] DEBUG - [MPVEngine/mpv] libmpv_render: Loaded extension GL_ARB_arrays_of_arrays.
Aug 04, 2023 21:48:37.744 [140583741945600] DEBUG - [MPVEngine/mpv] libmpv_render: Loaded extension GL_ARB_debug_output.
Aug 04, 2023 21:48:37.744 [140583741945600] DEBUG - [MPVEngine/mpv] libmpv_render: Loaded extension GL_KHR_debug.
Aug 04, 2023 21:48:37.744 [140583741945600] DEBUG - [MPVEngine/mpv] libmpv_render: Detected suspected software renderer.
Aug 04, 2023 21:48:37.744 [140583741945600] WARN - [MPVEngine/mpv] libmpv_render: Suspected software renderer or indirect context.
Aug 04, 2023 21:48:37.744 [140583741945600] DEBUG - [MPVEngine/mpv] libmpv_render: GL_*_swap_control extension missing.

This is likely the crux of your problem and likely not actually due to Wayland/X.

Do you have any suggestions on how I can force plex-htpc to use hardware based OpenGL?
I’ve tried to install the official Intel drivers following these instructions, which did not change the errors I get when starting the app.
I’ve also tried passing other versions of LIBVA_DRIVER_NAME= (i965 and iHD) and set an alternative path to LIBVA_DRIVERS_PATH= to include the “official” drivers, which did not change the “libGL error: failed to load driver: iris” error

Does the command vainfo give you any information?

Running vainfo provides a ton of info:

ubuntu@ubuntu:~$ vainfo
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.17 (libva 2.12.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.1.2 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileNone                   :	VAEntrypointStats
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSliceLP
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSliceLP
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointEncSliceLP
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointEncSliceLP
      VAProfileVP9Profile1            :	VAEntrypointVLD
      VAProfileVP9Profile1            :	VAEntrypointEncSliceLP
      VAProfileVP9Profile2            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointEncSliceLP
      VAProfileVP9Profile3            :	VAEntrypointVLD
      VAProfileVP9Profile3            :	VAEntrypointEncSliceLP
      VAProfileHEVCMain12             :	VAEntrypointVLD
      VAProfileHEVCMain422_10         :	VAEntrypointVLD
      VAProfileHEVCMain422_12         :	VAEntrypointVLD
      VAProfileHEVCMain444            :	VAEntrypointVLD
      VAProfileHEVCMain444            :	VAEntrypointEncSliceLP
      VAProfileHEVCMain444_10         :	VAEntrypointVLD
      VAProfileHEVCMain444_10         :	VAEntrypointEncSliceLP
      VAProfileHEVCMain444_12         :	VAEntrypointVLD
      VAProfileHEVCSccMain            :	VAEntrypointVLD
      VAProfileHEVCSccMain            :	VAEntrypointEncSliceLP
      VAProfileHEVCSccMain10          :	VAEntrypointVLD
      VAProfileHEVCSccMain10          :	VAEntrypointEncSliceLP
      VAProfileHEVCSccMain444         :	VAEntrypointVLD
      VAProfileHEVCSccMain444         :	VAEntrypointEncSliceLP
      VAProfileAV1Profile0            :	VAEntrypointVLD
      VAProfileHEVCSccMain444_10      :	VAEntrypointVLD
      VAProfileHEVCSccMain444_10      :	VAEntrypointEncSliceLP

moreover, running glxinfo and grepping for OpenGL returns the following:

ubuntu@ubuntu:~$ glxinfo | grep "OpenGL"
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) Graphics (RPL-P)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 23.0.4-0ubuntu1~23.04.1
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 23.0.4-0ubuntu1~23.04.1
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 23.0.4-0ubuntu1~23.04.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

In addition to my previous post, when trying to playback the same H265 encoded MKV via MPV (also installed via snap), hardware decoding is utilized.

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