Libva error: vaGetDriverNames() failed with unknown libva error

Since month i fight this problem. VLC and mpv make problems playing 4k videos as VDPAU does not seem to work since the update. I use nvidia prorietary drivers installed with mhdw.
I searched hours for solutions. Maybe someone has an idea.

Setting VDPAU in vlc does not work, black screen

[marco@marco-pc elemente]$ vainfo 
Trying display: wayland
Trying display: x11
libva error: vaGetDriverNames() failed with unknown libva error
vainfo: VA-API version: 1.20 (libva 2.20.0)
vainfo: Driver version: Splitted-Desktop Systems VDPAU backend for VA-API - 0.7.4
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG4Simple            : VAEntrypointVLD
      VAProfileMPEG4AdvancedSimple    : VAEntrypointVLD
      <unknown profile>               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
[marco@marco-pc elemente]$ printenv LIBVA_DRIVER_NAME
nvidia
[marco@marco-pc elemente]$ printenv VDPAU_DRIVER
nvidia
System:
  Kernel: 6.5.5-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
    clocksource: tsc available: hpet,acpi_pm
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.5-x86_64
    root=UUID=155c60c7-c2e8-4c18-a439-40a2553662bd rw nvidia-drm.modeset=1
    apparmor=1 security=apparmor udev.log_priority=3 amd_iommu=on iommu=pt
  Desktop: KDE Plasma v: 5.27.8 tk: Qt v: 5.15.11 wm: kwin_x11 vt: 2 dm: SDDM
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Desktop Mobo: ASUSTeK model: PRIME X470-PRO v: Rev X.0x
    serial: <superuser required> UEFI: American Megatrends v: 5809
    date: 12/03/2020
CPU:
  Info: model: AMD Ryzen 7 2700X bits: 64 type: MT MCP arch: Zen+ gen: 2
    level: v3 note: check built: 2018-21 process: GF 12nm family: 0x17 (23)
    model-id: 8 stepping: 2 microcode: 0x800820D
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
    L1: 768 KiB desc: d-8x32 KiB; i-8x64 KiB L2: 4 MiB desc: 8x512 KiB L3: 16 MiB
    desc: 2x8 MiB
  Speed (MHz): avg: 3306 high: 4225 min/max: 2200/3700 boost: enabled
    scaling: driver: acpi-cpufreq governor: schedutil cores: 1: 4097 2: 2108
    3: 2108 4: 4196 5: 3681 6: 4175 7: 2098 8: 4225 9: 4215 10: 2108 11: 2107
    12: 4164 13: 3087 14: 4217 15: 2108 16: 4216 bogomips: 118238
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: retbleed mitigation: untrained return thunk; SMT vulnerable
  Type: spec_rstack_overflow mitigation: safe RET
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, STIBP:
    disabled, RSB filling, PBRSB-eIBRS: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA GP104 [GeForce GTX 1070 Ti] vendor: ASUSTeK driver: nvidia
    v: 535.113.01 alternate: nouveau,nvidia_drm non-free: 535.xx+
    status: current (as of 2023-09) arch: Pascal code: GP10x process: TSMC 16nm
    built: 2016-21 pcie: gen: 3 speed: 8 GT/s lanes: 16 ports: active: none
    off: DP-2 empty: DP-1, DVI-D-1, HDMI-A-1, HDMI-A-2 bus-ID: 09:00.0
    chip-ID: 10de:1b82 class-ID: 0300
  Display: x11 server: X.Org v: 21.1.8 with: Xwayland v: 23.2.1
    compositor: kwin_x11 driver: X: loaded: nvidia gpu: nvidia,nvidia-nvswitch
    display-ID: :0 screens: 1
  Screen-1: 0 s-res: 3840x1600 s-dpi: 110 s-size: 887x373mm (34.92x14.69")
    s-diag: 962mm (37.88")
  Monitor-1: DP-2 note: disabled model: LG (GoldStar) 38GN950
    serial: <filter> built: 2021 res: 3840x1600 hz: 120 dpi: 111 gamma: 1.2
    size: 880x370mm (34.65x14.57") diag: 952mm (37.5") modes: max: 3840x1600
    min: 640x480
  API: EGL v: 1.5 hw: drv: nvidia platforms: gbm: drv: nvidia
  API: OpenGL v: 4.6.0 vendor: nvidia v: 535.113.01 glx-v: 1.4
    direct-render: yes renderer: NVIDIA GeForce GTX 1070 Ti/PCIe/SSE2
    memory: 7.81 GiB
  API: Vulkan v: 1.3.264 layers: 12 device: 0 type: discrete-gpu name: NVIDIA
    GeForce GTX 1070 Ti driver: nvidia v: 535.113.01 device-ID: 10de:1b82
    surfaces: xcb,xlib

please format your code.

And provide system info

inxi -Fazy

Try the following:

LIBVA_DRIVER_NAME=nvidia vainfo

Same error :frowning:

An apparent workaround in VLC fails to initialize due to unknown libva error was to remove libva-vdpau-driver:

sudo pacman -R libva-vdpau-driver

However, this might only be a valid option if no other packages are using libva-vdpau-driver.

Have you tried simply changing the Video Output Module in VLC to something other than VDPAU Output?

From the VLC toolbar:- ToolsPreferences;
Under Show Settings select All, and navigate to:
VideoOutput Modules in the left-hand column.

2 Likes

Thank you.
Ok that seems to work. If i deinstall “libva-vdpau-driver” i can set VLC to use VPDAU and it will work now.
I can change it to OpennGL too than is slow and causes broken “gray” frame tearing.

Fun thing is SMPlayer still crashes, setting to auto or vpdau. This vpapi update this year caused so many problems here.

/usr/bin/mpv --no-quiet --terminal --no-msg-color --input-ipc-server=/tmp/smplayer-mpv-3970 --msg-level=ffmpeg/demuxer=error --video-rotate=no --no-config --no-fs --hwdec=auto --sub-auto=fuzzy --no-input-default-bindings --input-vo-keyboard=no --no-input-cursor --cursor-autohide=no --no-keepaspect --wid=102760468 --monitorpixelaspect=1 --osd-level=1 --osd-scale=1 --osd-bar-align-y=0.6 --sub-ass --embeddedfonts --sub-ass-line-spacing=0 --sub-scale=1 --sub-font=Arial --sub-color=#ffffffff --sub-shadow-color=#ff000000 --sub-border-color=#ff000000 --sub-border-size=0.75 --sub-shadow-offset=2.5 --sub-font-size=50 --sub-bold=no --sub-italic=no --sub-margin-y=8 --sub-margin-x=20 --sub-codepage=ISO-8859-1 --sub-forced-only --sub-pos=100 --volume=84 --cache=auto --screenshot-template=cap_%F_%p_%02n --screenshot-format=jpg --screenshot-directory=/home/marco/Bilder/smplayer_screenshots --audio-pitch-correction=yes --volume-max=200 --term-playing-msg=MPV_VERSION=${=mpv-version:}
INFO_VIDEO_WIDTH=${=width}
INFO_VIDEO_HEIGHT=${=height}
INFO_VIDEO_ASPECT=${=video-params/aspect}
INFO_VIDEO_FPS=${=container-fps:${=fps}}
INFO_VIDEO_FORMAT=${=video-format}
INFO_VIDEO_CODEC=${=video-codec}
INFO_DEMUX_ROTATION=${=track-list/0/demux-rotation}
INFO_AUDIO_FORMAT=${=audio-codec-name}
INFO_AUDIO_CODEC=${=audio-codec}
INFO_AUDIO_RATE=${=audio-params/samplerate}
INFO_AUDIO_NCH=${=audio-params/channel-count}
INFO_LENGTH=${=duration:${=length}}
INFO_DEMUXER=${=current-demuxer:${=demuxer}}
INFO_SEEKABLE=${=seekable}
INFO_TITLES=${=disc-titles}
INFO_CHAPTERS=${=chapters}
INFO_TRACKS_COUNT=${=track-list/count}
METADATA_TITLE=${metadata/by-key/title:}
METADATA_ARTIST=${metadata/by-key/artist:}
METADATA_ALBUM=${metadata/by-key/album:}
METADATA_GENRE=${metadata/by-key/genre:}
METADATA_DATE=${metadata/by-key/date:}
METADATA_TRACK=${metadata/by-key/track:}
METADATA_COPYRIGHT=${metadata/by-key/copyright:}
INFO_MEDIA_TITLE=${=media-title:}
INFO_STREAM_PATH=${stream-path}
 --audio-client-name=SMPlayer --term-status-msg=STATUS: ${=time-pos} / ${=duration:${=length:0}} P: ${=pause} B: ${=paused-for-cache} I: ${=core-idle} VB: ${=video-bitrate:0} AB: ${=audio-bitrate:0} /mnt/20TB/TESTS-VIDEOS/1/STUEHLE/CLOUVOU-Stuhl1/clouvou-test.mov

 (+) Video --vid=1 (*) (hevc 3840x2160 24.000fps)
 (+) Audio --aid=1 (*) (pcm_s16le 2ch 48000Hz)
[vo/gpu/x11] X11 error: BadDrawable (invalid Pixmap or Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7f29dc003b10, resourceid: 6200014, serial: 19
[vo/gpu/x11] Error code: 9, request code: e, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7f29dc003b10, resourceid: 6200014, serial: 1a
[vo/gpu/x11] Error code: 3, request code: 28, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7f29dc003b10, resourceid: 6200014, serial: 2c
[vo/gpu/x11] Error code: 3, request code: 2, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7f29dc003b10, resourceid: 6200014, serial: 2e
[vo/gpu/x11] Error code: 3, request code: 1, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7f29dc003b10, resourceid: 6600002, serial: 31
[vo/gpu/x11] Error code: 3, request code: 12, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7f29dc003b10, resourceid: 6600002, serial: 34
[vo/gpu/x11] Error code: 3, request code: 94, minor code: 3
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7f29dc003b10, resourceid: 6600002, serial: 36
[vo/gpu/x11] Error code: 3, request code: 12, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7f29dc003b10, resourceid: 6600002, serial: 37
[vo/gpu/x11] Error code: 3, request code: 12, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7f29dc003b10, resourceid: 6600002, serial: 39
[vo/gpu/x11] Error code: 3, request code: 12, minor code: 0
[vo/gpu/x11] X11 error: BadWindow (invalid Window parameter)
[vo/gpu/x11] Type: 0, display: 0x7f29dc003b10, resourceid: 6600002, serial: 3a
[vo/gpu/x11] Error code: 3, request code: 12, minor code: 0
[vo/gpu/opengl] Could not create EGL surface!
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  10 (X_UnmapWindow)
  Resource id in failed request:  0x6600002
  Serial number of failed request:  63
  Current serial number in output stream:  67

I recall a similar experience with SMPlayer. Setting the Multimedia Engine (in General – General) to /usr/bin/mpv seemed to fix that.

Also, if you use Wayland, make sure Wayland support is enabled (General → Video). It should normally be enabled automatically, but sometimes isn’t.

I’m simply extrapolating here:

If SMPlayer actually uses the libva-vdpau-driver, it might be wise (now that it’s uninstalled) to choose something other than vdpau in Smp settings; and other than auto, as that may still select vdpau.

Cheers.

I had that set already to /usr/bin/mpv
Wayland is not in use, still x11 because a switch to wayland causes many problems here, mainly because lot of programs stop working then.

I’d be interested in knowing whether switching to the 6.1 LTS kernel solves any of the other issues.

Manjaro Kernels

Same error here

Result :

LIBVA_DRIVER_NAME=nvidia 

this is not the Solution

Hi,
no it does not fix it. Btw. Today VLC stopped working again. This is making me insane.

marco@marco-pc DAVINCI_RESOLVE]$ vainfo 
Trying display: wayland
Trying display: x11
libva error: vaGetDriverNames() failed with unknown libva error
vaInitialize failed with error code -1 (unknown libva error),exit

This error is mentioned here:

The relevant section is “VLC crashes when playing a video file”.

As mentioned in the Testing Update article this was an apparent regression introduced to the libva 2.17.0 package. A workaround was to change the Output option in Preferences > Video to VDPAU output instead of Automatic.

The last error you posted smells suspiciously similar to the error described in that link.

This has been true on VLC forever.
Its simply not very good at ‘automatic’, especially when it comes to hardware acceleration.

If you must use VLC, visiting the relevant settings is also a must … even more so if you have anything other than a standard intel iGPU.
(on some old chromebook the only way to get playback was using the X11 output)

Some copied images from an old thread talking about the same thing in 2021, which was repeated from the old forums thread from 2019, etc…

On the other hand … whether using mplayer, mpv, or frontend smplayer seems to work with the automatic settings just fine, though I take care to have that gpu-accelerated as well.

I honestly havent seen vlc as the media player standard for over a decade … at least not on the linux desktop.

So I have taken a look at all this NVIDIA craziness and basically there is a summary:

Don’t use vdpau, uninstall it, use AUR (en) - libva-nvidia-driver, add LIBVA_DRIVER_NAME=nvidia to the environment
and now that should work for most, there is issue with NVIDIA cards built on Pascal architecture with HEVC_NVENC aka h265, new HEVC_NVENC in FFmpeg and most modern um how would you called “implementations” of HEVC_NVENC use default of 2 b_ref_mode that needs to be set to 0 or the program using it will segfault.
After all this - that’s basically it, at least what I found out.
I hope it helps in some form.

Different programs have different way to set the “b_ref_mode” so gotta figure that on your own, for FFmpeg it’s just -b_ref_mode=0, can be used in OBS too with advanced settings without the -.

It will still show the error about vaGetDriverNames but all should work.

I’m not so sure?
ex:

I have only one rig with NVIDIA card, and it seems to work there everything okay, so I worked with the info I have gotten from my experience.

Hardware Acceleration works with Chromium for me with the LIBVA_DRIVER_NAME=nvidia.

I am not using Nouveau but the NVIDIA driver, seems to be relevant? No idea, right now laying in bed.

Since we seem to be diverging into realms of opinion and folklore, here’s some unrelated trivia The State of Video Codecs in 2023.

hmm this works

vainfo --display drm                                                                                                                 INT ✘ 
Trying display: drm
vainfo: VA-API version: 1.20 (libva 2.20.0)
vainfo: Driver version: VA-API NVDEC driver [direct backend]
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain12             : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointVLD

This error, or at least, something similar to it, seems to have been around for an extended amount of time; and with no definitive solution:

This Chromium issue 1491750 also seems to be linked to it.