[lunar] missing vaapi hardware acceleration
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mpv (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I have an alder lake gen12 cpu, and mpv is not using hardware acceleration when playing an mp4 h264 4k video I recorded with my cellphone.
I'm on lunar up-do-date, using Xorg.
$ mpv VID_20230522_
(+) Video --vid=1 (*) (h264 3840x2160 29.746fps)
(+) Audio --aid=1 --alang=eng (*) (aac 2ch 48000Hz)
AO: [pipewire] 48000Hz stereo 2ch floatp
VO: [gpu] 3840x2160 yuv420p
AV: 00:00:06 / 00:00:19 (31%) A-V: 0.000
According to intel_gpu_top, no hw acceleration was used during the playback of this video. CPU usage stayed around 60%.
$ vainfo
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/
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 : VAEntrypointVid
VAProfileNone : VAEntrypointStats
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
VAProfile
intel-media-
$ lsgpu
card0 Intel Alderlake_p (Gen12) drm:/dev/dri/card0
└─renderD128 drm:/dev/
$ inxi --gpu
Graphics:
Device-1: Intel Alder Lake-P Integrated Graphics vendor: Lenovo driver: i915
v: kernel arch: Gen-12.2 process: Intel 10nm built: 2021-22+ ports:
active: DP-1,DP-3,eDP-1 empty: DP-2,DP-4,HDMI-A-1 bus-ID: 00:02.0
chip-ID: 8086:46a6 class-ID: 0300
Device-2: Logitech HD Pro Webcam C920 type: USB
driver: snd-usb-
class-ID: 0102 serial: 40BB7A2F
Display: x11 server: X.Org v: 1.21.1.7 with: Xwayland v: 22.1.8
compositor: gnome-shell v: 44.0 driver: X: loaded: modesetting
unloaded: fbdev,vesa dri: iris gpu: i915 display-ID: :0 screens: 1
Screen-1: 0 s-res: 10560x2160 s-dpi: 96 s-size: 2794x571mm (110.00x22.48")
s-diag: 2852mm (112.27")
Monitor-1: DP-1 pos: left model: Dell P2721Q serial: GSLW4C3 built: 2021
res: 3840x2160 hz: 60 dpi: 163 gamma: 1.2 size: 597x336mm (23.5x13.23")
diag: 685mm (27") ratio: 16:9 modes: max: 3840x2160 min: 720x400
Monitor-2: DP-3 pos: primary,center model: Dell P2723QE serial: FNJYLP3
built: 2022 res: 3840x2160 hz: 60 dpi: 163 gamma: 1.2
size: 597x336mm (23.5x13.23") diag: 685mm (27") ratio: 16:9 modes:
max: 3840x2160 min: 720x400
Monitor-3: eDP-1 pos: right model: Samsung 0x4152 built: 2020
res: 2880x1800 hz: 90 dpi: 242 gamma: 1.2 size: 302x189mm (11.89x7.44")
diag: 356mm (14") ratio: 16:10 modes: 2880x1800
API: OpenGL v: 4.6 Mesa 23.0.2 renderer: Mesa Intel Graphics (ADL GT2)
direct-render: Yes
On the same environment, chromium snap from the hwaccel channel uses hardware acceleration with this video.
mpv with verbose flag outputs the following:
$ mpv -v -fs VID_20230522_
[cplayer] Command line options: '-v' '-fs' 'VID_20230522_
[cplayer] mpv 0.35.1 Copyright © 2000-2023 mpv/MPlayer/
[cplayer] built on UNKNOWN
[cplayer] FFmpeg library versions:
[cplayer] libavutil 57.28.100
[cplayer] libavcodec 59.37.100
[cplayer] libavformat 59.27.100
[cplayer] libswscale 6.7.100
[cplayer] libavfilter 8.44.100
[cplayer] libswresample 4.7.100
[cplayer] FFmpeg version: 5.1.2-3ubuntu1
[cplayer]
[cplayer] Configuration: meson configure build -Dprefix=/usr -Dbuildtype=plain -Doptimization=
[cplayer] List of enabled features: alsa av-channel-layout caca cdda cplayer cplugins cuda-hwaccel cuda-interop dmabuf-interop-gl dmabuf-interop-pl dmabuf-wayland drm drm-is-kms dvdnav egl egl-drm egl-helpers egl-x11 ffmpeg ffnvcodec gbm gl gl-wayland glibc-thread-name glob glob-posix gpl iconv jack javascript jpeg jpegxl lcms2 libarchive libass libavdevice libbluray libdl libm libmpv-shared libplacebo libplacebo-next librt linux-fstatfs lua52 manpage-build memfd_create noexecstack pipewire plain-gl posix pulse rubberband rubberband-3 sdl2 sdl2-audio sdl2-gamepad sdl2-video sixel spirv-cross stdatomic threads uchardet vaapi vaapi-drm vaapi-egl vaapi-libplacebo vaapi-wayland vaapi-x-egl vaapi-x11 vdpau vector vt.h vulkan wayland wayland_
[cplayer] Reading config file /etc/mpv/
[cplayer] Applying profile 'default'...
[cplayer] Reading config file /etc/mpv/mpv.conf
[cplayer] Applying profile 'default'...
[cplayer] Setting option 'hwdec' = 'vaapi' (flags = 4)
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Setting option 'fs' = '' (flags = 8)
[cplayer] Waiting for scripts...
[osd/libass] libass API version: 0x1700000
[osd/libass] libass source: tarball: 0.17.0
[osd/libass] Shaper: FriBidi 1.0.8 (SIMPLE) HarfBuzz-ng 6.0.0 (COMPLEX)
[osd/libass] Setting up fonts...
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[cplayer] Set property: shared-
[cplayer] Set property: shared-
[cplayer] Done loading scripts.
[cplayer] Running hook: ytdl_hook/on_load
[ytdl_hook] ytdl:// hook
[ytdl_hook] not a ytdl:// url
[ifo_dvdnav] Opening VID_20230522_
[bdmv/bluray] Opening VID_20230522_
[file] Opening VID_20230522_
[cplayer] Set property: shared-
[demux] Trying demuxers for level=normal.
[osd/libass] libass API version: 0x1700000
[osd/libass] libass source: tarball: 0.17.0
[osd/libass] Shaper: FriBidi 1.0.8 (SIMPLE) HarfBuzz-ng 6.0.0 (COMPLEX)
[osd/libass] Setting up fonts...
[lavf] Found 'mov,mp4,
[file] stream level seek from 131072 to 405303
[demux] Detected file format: mov,mp4,
[cplayer] Opening done: VID_20230522_
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[find_files] Loading external files in .
[cplayer] Running hook: ytdl_hook/
[lavf] select track 0
[lavf] select track 1
[cplayer] (+) Video --vid=1 (*) (h264 3840x2160 29.746fps)
[cplayer] (+) Audio --aid=1 --alang=eng (*) (aac 2ch 48000Hz)
[vo/gpu] Probing for best GPU context.
[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 (eDP-1): [7680, 0, 10560, 1800] @ 90.001438 FPS
[vo/gpu/x11] Display 1 (DP-1): [0, 0, 3840, 2160] @ 59.996625 FPS
[vo/gpu/x11] Display 2 (DP-3): [3840, 0, 7680, 2160] @ 59.996625 FPS
[vo/gpu/x11] Current display FPS: 90.001438
[vo/gpu/opengl] EGL_VERSION=1.5
[vo/gpu/opengl] EGL_VENDOR=Mesa Project
[vo/gpu/opengl] EGL_CLIENT_
[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 disabled.
[vo/gpu/opengl] GL_VERSION='4.6 (Core Profile) Mesa 23.0.2'
[vo/gpu/opengl] Detected desktop OpenGL 4.6.
[vo/gpu/opengl] GL_VENDOR='Intel'
[vo/gpu/opengl] GL_RENDERER='Mesa Intel(R) Graphics (ADL GT2)'
[vo/gpu/opengl] GL_SHADING_
[vo/gpu/opengl] Loaded extension GL_KHR_debug.
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] No advanced processing required. Enabling dumb mode.
[vo/gpu] Assuming 90.001438 FPS for display sync.
[vd] Container reported FPS: 29.746173
[vd] Codec list:
[vd] h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[vd] h264_v4l2m2m (h264) - V4L2 mem2mem H.264 decoder wrapper
[vd] h264_qsv (h264) - H264 video (Intel Quick Sync Video acceleration)
[vd] h264_cuvid (h264) - Nvidia CUVID H264 decoder
[vd] Opening decoder h264
[vd] Looking at hwdec h264-vaapi...
[vo/gpu] Loading hwdec drivers for format: 'vaapi'
[vo/gpu] Loading hwdec driver 'vaapi'
[vo/gpu/vaapi] using EGL dmabuf interop
[vo/gpu/vaapi] Trying to open a x11 VA display...
[vo/gpu/
[vo/gpu/vaapi] Going to probe surface formats (may log bogus errors)...
[vo/gpu/vaapi] Done probing surface formats.
[vd] Trying hardware decoding via h264-vaapi.
[vd] Selected codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)
[vf] User filter list:
[vf] (empty)
[ad] Codec list:
[ad] aac - AAC (Advanced Audio Coding)
[ad] aac_fixed (aac) - AAC (Advanced Audio Coding)
[ad] Opening decoder aac
[ad] Requesting 1 threads for decoding.
[ad] Selected codec: aac (AAC (Advanced Audio Coding))
[af] User filter list:
[af] (empty)
[cplayer] Starting playback...
[cplayer] Set property: shared-
[file] stream level seek from 832193 to 424591
[file] stream level seek from 555663 to 832193
[file] stream level seek from 1022233 to 425382
[file] stream level seek from 556454 to 1022233
[vd] Pixel formats supported by decoder: vdpau cuda vaapi yuvj420p
[vd] Codec profile: Baseline (0x42)
[vd] Hardware decoding of this stream is unsupported?
[vd] Requesting pixfmt 'yuvj420p' from decoder.
[vd] Falling back to software decoding.
[vd] Detected 16 logical cores.
[vd] Requesting 16 threads for decoding.
[vd] DR failed - disabling.
[vd] Using software decoding.
[vd] Decoder format: 3840x2160 [0:1] yuv420p bt.601/
[vf] [in] 3840x2160 yuv420p bt.601/
[vf] [userdeint] 3840x2160 yuv420p bt.601/
[vf] [userdeint] (disabled)
[vf] [autorotate] 3840x2160 yuv420p bt.601/
[vf] [autorotate] (disabled)
[vf] [convert] 3840x2160 yuv420p bt.601/
[vf] [convert] (disabled)
[vf] [out] 3840x2160 yuv420p bt.601/
[af] [in] 48000Hz stereo 2ch floatp
[af] [userspeed] 48000Hz stereo 2ch floatp
[af] [userspeed] (disabled)
[af] [convert] 48000Hz stereo 2ch floatp
[ao] Trying audio driver 'pipewire'
[ao/pipewire] requested format: 48000 Hz, stereo channels, floatp
[ao/pipewire] Headers version: 0.3.65
[ao/pipewire] Library version: 0.3.65
[ao/pipewire] Core user: andreas
[ao/pipewire] Core host: nsnx2
[ao/pipewire] Core version: 0.3.65
[ao/pipewire] Core name: pipewire-0
[ao/pipewire] device buffer: 960 samples.
[ao/pipewire] using soft-buffer of 9600 samples.
[cplayer] AO: [pipewire] 48000Hz stereo 2ch floatp
[cplayer] AO: Description: PipeWire audio output
[af] [convert] (disabled)
[af] [out] 48000Hz stereo 2ch floatp
[cplayer] VO: [gpu] 3840x2160 yuv420p
[cplayer] VO: Description: Shader-based GPU Renderer
[vo/gpu] DR path suspected slow/uncached, disabling..reconfig to 3840x2160 yuv420p bt.601/
[vo/gpu/x11] not waiting for MapNotify
[vo/gpu/x11] Current display FPS: 59.996625
[vo/gpu] Resize: 2160x3840
[vo/gpu] Window size: 2160x3840 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 3840x2160 (1:1)
[vo/gpu] Video display: (0, 0) 2160x3840 -> (0, 0) 2160x3840
[vo/gpu] Video scale: 1.000000/1.000000
[vo/gpu] OSD borders: l=0 t=0 r=0 b=0
[vo/gpu] Video borders: l=0 t=0 r=0 b=0
[vo/gpu] Reported display depth: 8
[vo/gpu] Texture for plane 0: 3840x2160
[vo/gpu] Texture for plane 1: 1920x1080
[vo/gpu] Texture for plane 2: 1920x1080
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] No advanced processing required. Enabling dumb mode.
[vo/gpu] Resize: 2160x3840
[vo/gpu] Window size: 2160x3840 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 3840x2160 (1:1)
[vo/gpu] Video display: (0, 0) 2160x3840 -> (0, 0) 2160x3840
[vo/gpu] Video scale: 1.000000/1.000000
[vo/gpu] OSD borders: l=0 t=0 r=0 b=0
[vo/gpu] Video borders: l=0 t=0 r=0 b=0
[vo/gpu] Reported display depth: 8
[vo/gpu] Assuming 59.996625 FPS for display sync.
[cplayer] first video frame after restart shown
[cplayer] Set property: shared-
[cplayer] audio ready
[cplayer] delaying audio start 0.018792 vs. 0.000000, diff=0.018792
[cplayer] playback restart complete @ 0.000000, audio=ready, video=playing
[statusline] AV: 00:00:00 / 00:00:19 (0%) A-V: 0.000
[cplayer] starting audio playback
[cplayer] Set property: shared-
[vo/gpu/x11] Disabling screensaver.
[statusline] AV: 00:00:00 / 00:00:19 (0%) A-V: 0.000
[vo/gpu] Resize: 3840x2123
[vo/gpu] Window size: 3840x2123 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 3840x2160 (1:1)
[vo/gpu] Video display: (0, 0) 2160x3840 -> (1323, 0) 1194x2123
[vo/gpu] Video scale: 0.552778/0.552865
[vo/gpu] OSD borders: l=1323 t=0 r=1323 b=0
[vo/gpu] Video borders: l=1323 t=0 r=1323 b=0
[vo/gpu] Reported display depth: 8
[vo/gpu] Resize: 3840x2123
[vo/gpu] Window size: 3840x2123 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 3840x2160 (1:1)
[vo/gpu] Video display: (0, 0) 2160x3840 -> (1323, 0) 1194x2123
[vo/gpu] Video scale: 0.552778/0.552865
[vo/gpu] OSD borders: l=1323 t=0 r=1323 b=0
[vo/gpu] Video borders: l=1323 t=0 r=1323 b=0
[vo/gpu] Reported display depth: 8
[statusline] AV: 00:00:00 / 00:00:19 (0%) A-V: 0.019
[cplayer] Set property: shared-
[cplayer] Set property: shared-
[statusline] AV: 00:00:00 / 00:00:19 (0%) A-V: 0.017
[vo/gpu] Resize: 2160x2123
[vo/gpu] Window size: 2160x2123 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 3840x2160 (1:1)
[vo/gpu] Video display: (0, 0) 2160x3840 -> (483, 0) 1194x2123
[vo/gpu] Video scale: 0.552778/0.552865
[vo/gpu] OSD borders: l=483 t=0 r=483 b=0
[vo/gpu] Video borders: l=483 t=0 r=483 b=0
[vo/gpu] Reported display depth: 8
[cplayer] Set property: shared-
[statusline] AV: 00:00:00 / 00:00:19 (2%) A-V: 0.005
[cplayer] Set property: shared-
[statusline] AV: 00:00:00 / 00:00:19 (2%) A-V: 0.005
[osd/libass] fontselect: (sans-serif, 400, 0) -> /usr/share/
[osd/libass] fontselect: (mpv-osd-symbols, 400, 0) -> mpv-osd-
[vo/gpu] Reallocating OSD texture to 4096x512.
[statusline] AV: 00:00:00 / 00:00:19 (4%) A-V: 0.002
[cplayer] Set property: fullscreen -> 1
[cplayer] Set property: shared-
[cplayer] Set property: shared-
[statusline] AV: 00:00:00 / 00:00:19 (4%) A-V: 0.002
[vo/gpu] Resize: 2160x2123
[vo/gpu] Window size: 2160x2123 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 3840x2160 (1:1)
[vo/gpu] Video display: (0, 0) 2160x3840 -> (483, 0) 1194x2123
[vo/gpu] Video scale: 0.552778/0.552865
[vo/gpu] OSD borders: l=483 t=0 r=483 b=0
[vo/gpu] Video borders: l=483 t=0 r=483 b=0
[vo/gpu] Reported display depth: 8
[statusline] AV: 00:00:00 / 00:00:19 (5%) A-V: 0.001
[vo/gpu] Resize: 3840x2160
[vo/gpu] Window size: 3840x2160 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 3840x2160 (1:1)
[vo/gpu] Video display: (0, 0) 2160x3840 -> (1312, 0) 1215x2160
[vo/gpu] Video scale: 0.562500/0.562500
[vo/gpu] OSD borders: l=1312 t=0 r=1313 b=0
[vo/gpu] Video borders: l=1312 t=0 r=1313 b=0
[vo/gpu] Reported display depth: 8
[cplayer] Set property: shared-
[statusline] AV: 00:00:01 / 00:00:19 (7%) A-V: 0.000
[cplayer] Set property: shared-
[statusline] AV: 00:00:02 / 00:00:19 (13%) A-V: 0.000
[cplayer] EOF code: 5
[vo/gpu/x11] Enabling screensaver.
[cplayer] finished playback, success (reason 3)
[cplayer]
[cplayer] Exiting... (Quit)
[cplayer] Set property: shared-
description: | updated |
I'm using Lunar on Alder Lake too, and mpv is using VA-API correctly here. Both Xorg and Wayland.
Can you share a sample video for me to test?