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

vaapi stopped working in latest git build on linux x11 #15719

Closed
6 tasks done
nkalkhof opened this issue Jan 21, 2025 · 6 comments
Closed
6 tasks done

vaapi stopped working in latest git build on linux x11 #15719

nkalkhof opened this issue Jan 21, 2025 · 6 comments
Labels

Comments

@nkalkhof
Copy link

mpv Information

mpv v0.39.0-615-gca211b5b88 Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
 built on Jan 17 2025 15:35:56
libplacebo version: v7.349.0
FFmpeg version: 6.1.2
FFmpeg library versions:
   libavcodec      60.31.102
   libavdevice     60.3.100
   libavfilter     9.12.100
   libavformat     60.16.100
   libavutil       58.29.100
   libswresample   4.12.100
   libswscale      7.5.100

Other Information

- Linux version: Linux version 6.13.0 (root@n350tw) (gcc (Gentoo 14.2.1_p20241221 p6) 14.2.1 20241221, GNU ld (Gentoo 2.43 p3) 2.43.1) #17 SMP Mon Jan 20 06:40:31 CET 2025
- Kernel Version: Linux version 6.13.0 (root@n350tw) (gcc (Gentoo 14.2.1_p20241221 p6) 14.2.1 20241221, GNU ld (Gentoo 2.43 p3) 2.43.1) #17 SMP Mon Jan 20 06:40:31 CET 2025
- GPU Model: Intel UHD630
- Mesa/GPU Driver Version: mesa-24.3.3, VA-API version 1.22.0, glxinfo not availble
- Window Manager and Version: Trinity
- Source of mpv: Official Github
- Latest known working version: 0.39.0
- Issue started after the following happened: Latest Git build

Reproduction Steps

play any H265 video with: mpv --hwdec=vaapi --vo=gpu --msg-level=vd=v,vo=v,vo/gpu/vaapi-egl=trace

Expected Behavior

GPU VAAPI decoding to work properly.

Actual Behavior

mpv falls back so software decoding.
log shows:
[vo/gpu] Loading hwdec drivers for format: 'vaapi'
[vo/gpu] Loading hwdec driver 'vaapi'
[vo/gpu/vaapi] VAAPI hwdec only works with OpenGL or Vulkan backends.
[vo/gpu] Loading failed.

Log File

[vo/gpu] Probing for best GPU context.
[vo/gpu/auto] Initializing GPU context 'auto'
[vo/gpu/opengl] Initializing GPU context 'wayland'
[vo/gpu/opengl] Initializing GPU context 'x11egl'
[vo/gpu/x11] X11 opening display: :0
[vo/gpu/x11] Display 0 (HDMI-2): [0, 0, 1920, 1080] @ 60.000000 FPS
[vo/gpu/x11] Display 1 (HDMI-3): [1920, 0, 3840, 1080] @ 60.000000 FPS
[vo/gpu/x11] Current display FPS: 60.000000
[vo/gpu/opengl] EGL_VERSION=1.5
[vo/gpu/opengl] EGL_VENDOR=Mesa Project
[vo/gpu/opengl] EGL_CLIENT_APIS=OpenGL OpenGL_ES
[vo/gpu/opengl] Trying to create Desktop OpenGL context.
[vo/gpu/opengl] Choosing visual EGL config 0x15, visual ID 0x21
[vo/gpu/x11] The XPresent extension was found.
[vo/gpu/x11] XPresent enabled.
[vo/gpu/opengl] GL_VERSION='4.6 (Core Profile) Mesa 24.3.3'
[vo/gpu/opengl] Detected desktop OpenGL 4.6.
[vo/gpu/opengl] GL_VENDOR='Intel'
[vo/gpu/opengl] GL_RENDERER='Mesa Intel(R) UHD Graphics 630 (CFL GT2)'
[vo/gpu/opengl] GL_SHADING_LANGUAGE_VERSION='4.60'
[vo/gpu/opengl] Loaded extension GL_KHR_debug.
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] Assuming 60.000000 FPS for display sync.
[vd] Container reported FPS: 23.976024
[vd] Codec list:
[vd] hevc - HEVC (High Efficiency Video Coding)
[vd] hevc_v4l2m2m (hevc) - V4L2 mem2mem HEVC decoder wrapper
[vd] Opening decoder hevc
[vd] Looking at hwdec hevc-vaapi...
[vo/gpu] Loading hwdec drivers for format: 'vaapi'
[vo/gpu] Loading hwdec driver 'vaapi'
[vo/gpu/vaapi] VAAPI hwdec only works with OpenGL or Vulkan backends.
[vo/gpu] Loading failed.
[vd] Could not create device.
[vd] Using software decoding.
[vd] Detected 8 logical cores.
[vd] Requesting 9 threads for decoding.
[vd] Selected decoder: hevc - HEVC (High Efficiency Video Coding)
[vo/gpu] DR path suspected slow/uncached, disabling.
[vd] DR failed - disabling.
[vd] Using software decoding.
[vd] Decoder format: 1800x1080 yuv420p10 bt.709/bt.709/bt.1886/limited/auto CL=mpeg2/4/h264 crop=1800x1080+0+0
[vd] Using container aspect ratio.
AO: [alsa] 48000Hz stereo 2ch float
VO: [gpu] 1800x1080 yuv420p10
[vo/gpu] reconfig to 1800x1080 yuv420p10 bt.709/bt.709/bt.1886/limited/display CL=mpeg2/4/h264 crop=1800x1080+0+0
[vo/gpu] Resize: 1719x1031
[vo/gpu] Window size: 1719x1031 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 1800x1080 (1:1)
[vo/gpu] Video display: (0, 0) 1800x1080 -> (0, 0) 1718x1031
[vo/gpu] Video scale: 0.954444/0.954630
[vo/gpu] OSD borders: l=0 t=0 r=1 b=0
[vo/gpu] Video borders: l=0 t=0 r=1 b=0
[vo/gpu] Reported display depth: 8
[vo/gpu] Texture for plane 0: 1800x1080
[vo/gpu] Texture for plane 1: 900x540
[vo/gpu] Texture for plane 2: 900x540
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] Dither to 8.
[vo/gpu] Resize: 1719x1031
[vo/gpu] Window size: 1719x1031 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 1800x1080 (1:1)
[vo/gpu] Video display: (0, 0) 1800x1080 -> (0, 0) 1718x1031
[vo/gpu] Video scale: 0.954444/0.954630
[vo/gpu] OSD borders: l=0 t=0 r=1 b=0
[vo/gpu] Video borders: l=0 t=0 r=1 b=0
[vo/gpu] Reported display depth: 8
[vo/gpu/x11] Disabling screensaver.

Sample Files

No response

I carefully read all instruction and confirm that I did the following:

  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.
@llyyr
Copy link
Contributor

llyyr commented Jan 21, 2025

You need to provide a full log file, this can depend on your build options (HAVE_DMABUF_INTEROP_GL) or whether mpv ended up using opengl/vulkan or not.

Or bisect which change caused it since you know the regression range.

@nkalkhof
Copy link
Author

nkalkhof commented Jan 21, 2025

You need to provide a full log file, this can depend on your build options (HAVE_DMABUF_INTEROP_GL) or whether mpv ended up using opengl/vulkan or not.

Or bisect which change caused it since you know the regression range.

Thank you for getting back to me.

I don't know how to bisect so I hope that the logs will do. I don't know what HAVE_DMABUF_INTEROP_GL is but the config.h shows: #define HAVE_DMABUF_INTEROP_GL 0

Interesting thing when I configure the 0.39.0 release with the same command "meson setup build -Ddebug=true --optimization=0" the the config.h shows: #define HAVE_DMABUF_INTEROP_GL 1

Stupid question: Do I need to pass a extra mesa config flag to enable this option?

The full log can be found here:
https://pastebin.com/raw/KEdRNhN9

Hope this helps.

@llyyr
Copy link
Contributor

llyyr commented Jan 21, 2025

Probably broken by 32d103c, either that or you explicitly disabled drm/don't have libdrm at all. for opengl interop with vo_gpu, you need libdrm >= 2.4.109.

You can either use gpu-api=vulkan or vo=gpu-next to use libplacebo interop which is available unconditionally.

@nkalkhof
Copy link
Author

Probably broken by 32d103c, either that or you explicitly disabled drm/don't have libdrm at all. for opengl interop with vo_gpu, you need libdrm >= 2.4.109.

You can either use gpu-api=vulkan or vo=gpu-next to use libplacebo interop which is available unconditionally.

Hmmm....not sure about that. Installed libdrm is x11-libs/libdrm-2.4.124::gentoo and configure says:
Dependency libdrm found: YES 2.4.124 (cached)

BUT vaapi-drm is not detected:
Dependency libva-drm skipped: feature vaapi-drm disabled

Running configure on the official 0.39.0 release in the same environment I see this:
Run-time dependency libdrm found: YES 2.4.124
Run-time dependency libva-drm found: YES 1.22.0

So I guess something screwed up the libva-drm detection?

gpu-api=vulkan or vo=gpu-next don't work at all because vulkan support is not detected:
mpv 0.39.0-UNKNOWN
d3d11 : NO
javascript : YES
libmpv : NO
lua : YES
opengl : YES
vulkan : NO
wayland : YES
x11 : YES

Interesting thing: --hwdec=vaapi-copy works but at the cost of higher system load even though hardware decoding seems to work according to intel_gpu_top. Is vaapi-copy supposed to be more costly then the vaapi option?

HTH

@llyyr
Copy link
Contributor

llyyr commented Jan 21, 2025

BUT vaapi-drm is not detected:

We don't care about vaapi-drm or libva-drm, we care about dmabuf-interop-gl here. dmabuf-interop-gl requires you build with egl (which you are) and libdrm (which you aren't).

gpu-api=vulkan or vo=gpu-next don't work at all because vulkan support is not detected:

What does vulkan support have to do with gpu-next? You can't build mpv without gpu-next at all.

@nkalkhof
Copy link
Author

nkalkhof commented Jan 21, 2025

BUT vaapi-drm is not detected:

We don't care about vaapi-drm or libva-drm, we care about dmabuf-interop-gl here. dmabuf-interop-gl requires you build with egl (which you are) and libdrm (which you aren't).

gpu-api=vulkan or vo=gpu-next don't work at all because vulkan support is not detected:

What does vulkan support have to do with gpu-next? You can't build mpv without gpu-next at all.

You're right. After taking a closer look at the meson.build changes I realized that it didn't build against libdrm because a new dependency "libdisplay and libdisplay-info" was introduced and without it there will be no build against libdrm. After pulling both dependencies mpv correctly builds against libdrm.

drm = dependency('libdrm', version: '>= 2.4.109', required: get_option('drm')) libdisplay_info = dependency('libdisplay-info', version: '>= 0.1.1', required: get_option('drm')) features += {'drm': drm.found() and libdisplay_info.found() and (features['vt.h'] or features['consio.h'] or features['wsdisplay-usl-io.h'])} if features['drm'] dependencies += [drm, libdisplay_info] sources += files('video/drmprime.c',

Thank you for the great support.

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

No branches or pull requests

2 participants