mpv-player / mpv-player/mpv

VAAPI doesn't work with Intel UHD P630; libplacebo dmabuf_interop doesn't initialize

Open
#11,400 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

os:linux
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

system information
  • mpv version 0.35.1
  • xorg 21.1.7
  • mesa 22.2.5
  • libva 2.16.0
  • intel-media-driver 22.5.4
  • libplacebo 5.229.2

Running on Gentoo, all these built from ebuilds

GPU: Intel UHD Graphics P630 (integrated Xeon E-2226G)

I also have an NVIDIA Tesla installed in this machine, so MPV finds a cuvid/nvdec hardware device, and the nvdec-copy hardware decoder works fine. But VAAPI should too. The Intel GPU supports it, and I would prefer not to have to copy the video frames between GPUs.

debugging output
$ mpv --frames=0 --ao=null --msg-level=all=status,cplayer=v,vd=trace,vo=v --hwdec=vaapi /tmp/video.mp4 
[cplayer] Command line options: '--frames=0' '--ao=null' '--msg-level=all=status,cplayer=v,vd=trace,vo=v' '--hwdec=vaapi' '/tmp/video.mp4'                                                                   
[cplayer] mpv 0.35.1 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects                                                   
[cplayer]  built on UNKNOWN                                                                                                
[cplayer] FFmpeg library versions:                                                                                         
[cplayer]    libavutil       56.70.100                                                                                     
[cplayer]    libavcodec      58.134.100                                                                                    
[cplayer]    libavformat     58.76.100                                                                                     
[cplayer]    libswscale      5.9.100                                                                                       
[cplayer]    libavfilter     7.110.100                                                                                     
[cplayer]    libswresample   3.9.100                                                                                       
[cplayer] FFmpeg version: 4.4.3                                                                                            
[cplayer]                                                                                                                  
[cplayer] Configuration: meson configure build -Dprefix=/usr -Dbuildtype=plain -Doptimization=plain                        
[cplayer] List of enabled features: alsa cdda cplayer cplugins dmabuf-interop-pl dvdnav egl egl-helpers egl-x11 ffmpeg ffnvcodec gl glibc-thread-name glob glob-posix gpl html-build iconv jpeg lcms2 libass libavdevice libdl libm libmpv-shared libplacebo libplacebo-next librt linux-fstatfs manpage-build noexecstack plain-gl posix rubberband rubberband-3 shaderc stdatomic threads uchardet vaapi vaapi-egl vaapi-libplacebo vaapi-x-egl vaapi-x11 vector vt.h vulkan x11 zlib                     
[cplayer] Built with NDEBUG.                                                                                               
[cplayer] Reading config file /etc/mpv/encoding-profiles.conf                                                              
[cplayer] Applying profile 'default'...                                                                                    
[cplayer] Reading config file /etc/mpv/mpv.conf                                                                            
[cplayer] Applying profile 'default'...                                                                                    
[cplayer] Setting option 'msg-level' = 'all=fatal,cplayer=status,statusline=status,display-tags=status' (flags = 4)        
[cplayer] Setting option 'hwdec' = 'vaapi' (flags = 4)                                                                     
[cplayer] Setting option 'profile' = 'gpu-hq' (flags = 4)                                                                  
[cplayer] Applying profile 'gpu-hq'...                                                                                     
[cplayer] Setting option 'scale' = 'spline36' (flags = 4)                                                                  
[cplayer] Setting option 'cscale' = 'spline36' (flags = 4)                                                                 
[cplayer] Setting option 'dscale' = 'mitchell' (flags = 4)                                                                 
[cplayer] Setting option 'dither-depth' = 'auto' (flags = 4)                                                               
[cplayer] Setting option 'correct-downscaling' = 'yes' (flags = 4)                                                         
[cplayer] Setting option 'linear-downscaling' = 'yes' (flags = 4)                                                          
[cplayer] Setting option 'sigmoid-upscaling' = 'yes' (flags = 4)                                                           
[cplayer] Setting option 'deband' = 'yes' (flags = 4)                                                                      
[cplayer] Setting option 'audio-display' = 'no' (flags = 4)                                                                
[cplayer] Setting option 'sub-color' = '1.0/1.0/0.95/0.8' (flags = 4)                                                      
[cplayer] Reading config file /home/stharward/.config/mpv/mpv.conf                                                             
[cplayer] Applying profile 'default'...                                                                                    
[cplayer] Setting option 'replaygain' = 'album' (flags = 4)                                                                
[cplayer] Setting option 'osd-font' = 'Droid Sans' (flags = 4)                                                             
[cplayer] Setting option 'osd-font-size' = '24' (flags = 4)                                                                
[cplayer] Setting option 'sub-font' = 'Franklin Gothic Medium' (flags = 4)                                                 
[cplayer] Setting option 'sub-font-size' = '36' (flags = 4)                                                                
[cplayer] Setting option 'sub-ass-override' = 'scale' (flags = 4)                                                          
[cplayer] Setting option 'af' = 'pan="stereo|FL < FC+0.7*FL+0.3*BL|FR < FC+0.7*FR+0.3*BR"' (flags = 4)                     
[cplayer] Setting option 'frames' = '0' (flags = 8)                                                                        
[cplayer] Setting option 'ao' = 'null' (flags = 8)                                                                         
[cplayer] Setting option 'msg-level' = 'all=status,cplayer=v,vd=trace,vo=v' (flags = 8)                                    
[cplayer] Setting option 'hwdec' = 'vaapi' (flags = 8)                                                                     
Auto-loading profile 'extension.mp4'                                                                                       
[cplayer] Applying profile 'extension.mp4'...
[cplayer] Setting option 'volume' = '98' (flags = 52)                                                                      
[cplayer] Opening done: /tmp/video.mp4                                            
 (+) Video --vid=1 (*) (h264 1280x544 23.976fps)                                                                           
 (+) Audio --aid=1 (*) (aac 2ch 48000Hz)
[vo/gpu] Probing for best GPU context.
[vo/gpu/opengl] Initializing GPU context 'x11egl'                                                                          
[vo/gpu/x11] X11 opening display: :0                                                                                       
[vo/gpu/x11] Assuming DPI scale 2 for prescaling. This can be disabled with --hidpi-window-scale=no.                       
[vo/gpu/x11] Display 0 (DP-2): [0, 0, 3840, 2160] @ 59.996625 FPS                                                          
[vo/gpu/x11] Display 1 (DP-3): [3840, 0, 7680, 2160] @ 59.996625 FPS                                                       
[vo/gpu/x11] Current display FPS: 59.996625                                                                                
[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 disabled.                                                                                            
[vo/gpu/opengl] GL_VERSION='4.6 (Core Profile) Mesa 22.2.5'                                                                
[vo/gpu/opengl] Detected desktop OpenGL 4.6.                                                                               
[vo/gpu/opengl] GL_VENDOR='Intel'                                                                                          
[vo/gpu/opengl] GL_RENDERER='Mesa Intel(R) UHD Graphics P630 (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 59.996625 FPS for display sync.                                                                          
[vd] Container reported FPS: 23.976024                                                                                     
[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_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] VAAPI hwdec only works with OpenGL or Vulkan backends.                                                      
[vo/gpu] Loading failed.                                                                                                   
[vd] Could not create device.                                                                                              
[vd] No hardware decoding available for this codec.                                                                        
[vd] Using software decoding.                                                                                              
[vd] Detected 6 logical cores.                                                                                             
[vd] Requesting 7 threads for decoding.                                                                                    
[vd] Selected codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)                                                      
[cplayer] Starting playback...                                                                                             
[vd] Uninit decoder.                                                                                                       
[cplayer] finished playback, success (reason 2)                                                                            
                                                                                                                           
Exiting... (End of file)

$ vainfo
Trying display: x11
libva info: VA-API version 1.16.0
libva info: Trying to open /usr/lib64/va/drivers/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_16
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.16 (libva 2.16.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.5.4 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointFEI
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointFEI
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointFEI
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointFEI
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD

So VAAPI is working, but mpv doesn't recognize it. dmabuf_interop_pl_init returns false at dmabuf_interop_pl.c:123. I've tried rebuilding mpv without libplacebo, and with/without vulkan, and the VAAPI-backend connection always fails. It never even tries to fall back to EGL.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the command with --hwdec=vaapi and inspect the VAAPI hwdec loading path, especially where libplacebo dmabuf interop initialization is attempted. Trace the OpenGL/VAAPI setup on the Intel UHD P630; done means VAAPI initializes successfully and hardware decoding is used instead of software decoding.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
backend, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.