Segmentation fault trying to start hardware decode
Trying to play any video results in VLC crashing with a segmentation fault.
[~] $ vlc somevideo.mp4
VLC media player 3.0.18 Vetinari (revision 3.0.13-8-g41878ff4f2)
[00005565201df5e0] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[00007f1ae8007a60] gl gl: Initialized libplacebo v5.229.0 (API v229)
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[00007f1ae8007a60] glconv_vaapi_x11 gl error: vaInitialize: unknown libva error
Segmentation fault (core dumped)
I assume the 'libva error' has something to do with it. This laptop should use VDPAU for hardware acceleration, the internal graphics of the Intel CPU are disabled in BIOS by the vendor (and can not be enabled), and no Intel graphics driver is installed. I've also tried setting the hardware acceleration method in Tools->Preferences->Input/Codecs, but no setting (Automatic, VDPAU, or even disabled) seems to have any effect.
Workaround: Setting LIBVA_DRIVER_NAME makes it work correctly:
[~] $ LIBVA_DRIVER_NAME=vdpau vlc somevideo.mp4
VLC media player 3.0.18 Vetinari (revision 3.0.13-8-g41878ff4f2)
[00005625938475e0] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[00007f8934007e80] gl gl: Initialized libplacebo v5.229.0 (API v229)
[00007f8934007e80] glconv_vaapi_x11 gl error: vaCreateSurfaces: attribute not supported
[00007f8944049610] main video output error: video output creation failed
[00007f8960cbf3f0] main decoder error: failed to create video output
[00007f893409fb60] gl gl: Initialized libplacebo v5.229.0 (API v229)
[00007f8960cbf3f0] avcodec decoder: Using NVIDIA VDPAU Driver Shared Library 525.60.11 Wed Nov 23 22:48:12 UTC 2022 for hardware decoding
(normal playback here...)
Could there be some package I'm missing, or do I have one installed I shouldn't have? I basically removed anything libva-related I could find and installed all vdpau packages I could. Is it normal that the user has to manually set LIBVA_DRIVER_NAME?
Either way, I think VLC should either
- try vdpau initially (given the graphics driver in use)
- try vdpau when libva fails
- exit cleanly with an (informative) error when libva fails
But at least not just segfault.
Some information that may be relevant:
- CPU: quad core Intel Core i7-7700HQ (with internal graphics disabled)
- GPU: GeForce GTX 1060 Mobile 6GB] driver: nvidia
packages (on Arch Linux):
- extra/vlc 3.0.18-6 [installed]
- extra/libva-vdpau-driver 0.7.4-6 [installed]
- extra/libvdpau 1.5-1 [installed]
- extra/mesa-vdpau 22.3.2-3 [installed]
- community/vdpauinfo 1.5-1 [installed]
- extra/libva 2.17.0-1 [installed]
- community/libva-utils 2.17.0-1 [installed]
This problem, by the way, has been present for a while, just haven't gotten around to creating an issue. Please let me know if I can provide any more info.
Thanks!