You are not logged in.

#1 2023-01-08 08:16:22

Otis Delarge
Member
Registered: 2023-01-07
Posts: 2

[SOLVED] VLC crashes when trying to play videos

Hi there.  I'm hoping someone might be able to help with this.
I've been using arch for a few months.  This is my first forum post so please forgive me if I missed something.

Issue: Every time I try to play a video with VLC, the program crashes after about 1 second.

Behaviour:  I open the video with VLC (via gui or terminal) then the VLC window resizes to the resolution of the video and closes about 1 second later.

Output:

VLC media player 3.0.18 Vetinari (revision 3.0.13-8-g41878ff4f2)
[000055f495410550] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[000055f495497590] main playlist: playlist is empty
uint DBusMenuExporterDBus::GetLayout(int, int, const QStringList&, DBusMenuLayoutItem&): Condition failed: menu
uint DBusMenuExporterDBus::GetLayout(int, int, const QStringList&, DBusMenuLayoutItem&): Condition failed: menu
[00007fa430007a60] gl gl: Initialized libplacebo v5.229.0 (API v229)
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[00007fa430007a60] glconv_vaapi_x11 gl error: vaInitialize: unknown libva error
[1]    188880 segmentation fault (core dumped)  vlc

^ This is with hardware acceleration disabled in VLC's settings.

Music files present the same 'DBusMenuExporterDBus::GetLayout' error but they play fine and I wouldn't know there was any error if not looking at the terminal output.  So I've been ignoring that error for the most part.

The issue started on or around new year's day.  Before that I never had an issue with VLC on this system.  It was the only media player I'd been using aside from RhythmBox.

This may not be relevant but I did notice the issue for the first time after installing snapd and flatpak the day before.  I have tried removing those in case that was the culprit but it made no difference.  It's the only change I made to the system (aside from updates) in between VLC working and not working so I thought I'd mention it.

I've tried:
- rebooting
- uninstalling & re-installing VLC
- disabling hardware acceleration
- enabling hardware acceleration and changing the decoder to each option available
- updating libva-vdpau-driver & libva
- removing ~/.config/vlc
- following the Arch wiki's troubleshooting suggestions
- (more that I will add if I remember)

No change.  The issue persists with the same output.

VLC can still play music files without any issue.

Videos play without any issue when using other media players (MPV, kodi).

It may be relevant that I'm using an old nvidia GPU (GTX 660 2GB) with the legacy DKMS drivers (470xx).

System specs:

                 `ooo/                   OS: Arch Linux x86_64 
                `+oooo:                  Host: B450 AORUS PRO 
               `+oooooo:                 Kernel: 6.1.2-arch1-1 
               -+oooooo+:                Uptime: 1 min 
             `/:-:++oooo+:               Packages: 962 (pacman) 
            `/++++/+++++++:              Shell: zsh 5.9 
           `/++++++++++++++:             Resolution: 1920x1080, 1920x1080 
          `/+++ooooooooooooo/`           DE: Plasma 5.26.5 
         ./ooosssso++osssssso+`          WM: KWin 
        .oossssso-````/ossssss+`         WM Theme: Dracula 
       -osssssso.      :ssssssso.        Theme: [Plasma], Breeze [GTK2/3] 
      :osssssss/        osssso+++.       Icons: dracula-icons-main [Plasma], dracula-icons-main [GTK2/3] 
     /ossssssss/        +ssssooo/-       Terminal: guake 
   `/ossssso+/:-        -:/+osssso+-     CPU: AMD Ryzen 5 2600 (12) @ 3.400GHz 
  `+sso+:-`                 `.-/+oso:    GPU: NVIDIA GeForce GTX 660 
 `++:.                           `-/+/   Memory: 2505MiB / 15918MiB 
 .`                                 `/

I'm pretty much out of ideas at this point and I've tried every suggestion I've found while searching for a solution.

Any help would be greatly appreciated.

Last edited by Otis Delarge (2023-01-08 08:41:32)

Offline

#2 2023-01-08 08:22:35

dtbaumann
Member
Registered: 2015-07-03
Posts: 28

Re: [SOLVED] VLC crashes when trying to play videos

seems to be caused by the recent update of libva to 2.17.0-1. Downgrading to libva 2.16.0-1 helped here.

Offline

#3 2023-01-08 08:34:56

Otis Delarge
Member
Registered: 2023-01-07
Posts: 2

Re: [SOLVED] VLC crashes when trying to play videos

dtbaumann wrote:

seems to be caused by the recent update of libva to 2.17.0-1. Downgrading to libva 2.16.0-1 helped here.

That seems to have solved the issue.

Thank you very much!

Offline

#4 2023-01-09 20:20:54

benjarobin
Member
Registered: 2009-09-04
Posts: 17

Re: [SOLVED] VLC crashes when trying to play videos

Same problem, fix it by downgrade :

pacman -U https://archive.archlinux.org/repos/2023/01/02/extra/os/x86_64/libva-2.16.0-1-x86_64.pkg.tar.zst https://archive.archlinux.org/repos/2023/01/02/community/os/x86_64/libva-utils-2.16.0-1-x86_64.pkg.tar.zst

For reference :

pacman -Qs "libva|vdpau|nvidia"
local/egl-wayland 2:1.1.11-2
    EGLStream-based Wayland external platform
local/lib32-nvidia-470xx-utils 470.161.03-1
    NVIDIA drivers utilities (32-bit)
local/lib32-opencl-nvidia-470xx 470.161.03-1
    OpenCL implemention for NVIDIA (32-bit)
local/libva 2.16.0-1
    Video Acceleration (VA) API for Linux
local/libva-utils 2.16.0-1
    Intel VA-API Media Applications and Scripts for libva
local/libva-vdpau-driver 0.7.4-6
    VDPAU backend for VA API
local/libvdpau 1.5-1
    Nvidia VDPAU library
local/libvdpau-va-gl 0.4.2-3
    VDPAU driver with OpenGL/VAAPI backend
local/libxnvctrl 525.78.01-1
    NVIDIA NV-CONTROL X extension
local/mesa-vdpau 22.3.2-3
    VDPAU drivers
local/nvidia-470xx-dkms 470.161.03-2
    NVIDIA drivers - module sources
local/nvidia-470xx-utils 470.161.03-2
    NVIDIA drivers utilities
local/nvidia-settings 525.78.01-1
    Tool for configuring the NVIDIA graphics driver
local/opencl-nvidia-470xx 470.161.03-2
    OpenCL implemention for NVIDIA
local/vamp-plugin-sdk 2.10.0-1 (pro-audio)
    The Vamp audio analysis plug-in system
local/vdpauinfo 1.5-1
    Command line utility for querying the capabilities of a VDPAU device
05:00.0 VGA compatible controller: NVIDIA Corporation GK106 [GeForce GTX 660] (rev a1)

This bug report seems related : https://bugs.archlinux.org/task/77059

With libva 2.17.0-1 :

$ vainfo 
Trying display: wayland
Trying display: x11
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
vaInitialize failed with error code -1 (unknown libva error),exit

With libva 2.16.0-1 :

$ vainfo 
Trying display: wayland
Trying display: x11
vainfo: VA-API version: 1.16 (libva 2.16.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

Maybe related :
- https://code.videolan.org/videolan/vlc/-/issues/27707
- https://forum.manjaro.org/t/vlc-self-closing/130885/5
- https://github.com/intel/libva/issues/675

===> So as a workaround define this environment variable (and everything works with libva 2.17.0-1, vlc included) :

export LIBVA_DRIVER_NAME=nvidia

And to make it "permanent" :

echo "setenv LIBVA_DRIVER_NAME nvidia" > /etc/profile.d/libva.csh
echo "export LIBVA_DRIVER_NAME=nvidia" > /etc/profile.d/libva.sh

With a fully up to date Arch (with the env variable) :

LIBVA_DRIVER_NAME=nvidia vainfo
Trying display: wayland
Trying display: x11
vainfo: VA-API version: 1.17 (libva 2.17.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

Last edited by benjarobin (2023-01-09 21:47:42)

Offline

#5 2023-01-09 22:34:02

benjarobin
Member
Registered: 2009-09-04
Posts: 17

Re: [SOLVED] VLC crashes when trying to play videos

To properly fix it, I have to build libva with

arch-meson libva build -Dwith_legacy=nvctrl

instead of

arch-meson libva build

See https://github.com/intel/libva/issues/6 … 1376409157

Offline

#6 2023-01-09 23:28:01

benjarobin
Member
Registered: 2009-09-04
Posts: 17

Re: [SOLVED] VLC crashes when trying to play videos

I also tried to debug VLC to understand the crash.
First VLC try to load libva using X11 display

Thread 46 "vlc" hit Breakpoint 1, vaInitialize (dpy=dpy@entry=0x7fff903a3040, major_version=major_version@entry=0x7fffc0af84d4, minor_version=minor_version@entry=0x7fffc0af84d8) at ../libva/va/va.c:724
724     ../libva/va/va.c: Mauvais descripteur de fichier.
(gdb) bt
#0  vaInitialize (dpy=dpy@entry=0x7fff903a3040, major_version=major_version@entry=0x7fffc0af84d4, minor_version=minor_version@entry=0x7fffc0af84d8) at ../libva/va/va.c:724
#1  0x00007fffc003b84e in vlc_vaapi_InitializeInstance (native_destroy_cb=0x7fffc003b580 <x11_native_destroy_cb>, native=0x7fff903a16a0, dpy=0x7fff903a3040, o=0x7fff90007400) at hw/vaapi/vlc_vaapi.c:95
#2  x11_init_vaapi_instance (priv=0x7fff903a1490, tc=0x7fff9039f3c0) at video_output/opengl/converter_vaapi.c:438
#3  Open (obj=0x7fff9039f3c0) at video_output/opengl/converter_vaapi.c:521
#4  0x00007ffff7c9c69f in module_load (obj=obj@entry=0x7fff9039f3c0, m=m@entry=0x555555584f50, init=init@entry=0x7ffff7c97a70 <generic_start>, args=args@entry=0x7fffc0af85f0) at modules/modules.c:183
#5  0x00007ffff7c9f5f4 in vlc_module_load (obj=obj@entry=0x7fff9039f3c0, capability=capability@entry=0x7fffc09f3295 "glconv", name=0x7ffff7d3d1cb "", name@entry=0x7fffc09f3294 "$glconv", strict=strict@entry=true, probe=probe@entry=0x7ffff7c97a70 <generic_start>)
    at modules/modules.c:280
#6  0x00007ffff7c9f8a9 in module_need (obj=obj@entry=0x7fff9039f3c0, cap=cap@entry=0x7fffc09f3295 "glconv", name=name@entry=0x7fffc09f3294 "$glconv", strict=strict@entry=true) at modules/modules.c:372
#7  0x00007fffc09ec054 in opengl_init_program
    (vgl=vgl@entry=0x7fff9039d310, prgm=prgm@entry=0x7fff9039d618, glexts=glexts@entry=0x7fff9035f990 "GL_AMD_multi_draw_indirect GL_AMD_seamless_cubemap_per_texture GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_bindless_texture GL_ARB_blend_func_extended GL_ARB_buffer_storage GL_ARB_clear_buffer"..., fmt=fmt@entry=0x7fff90001528, subpics=subpics@entry=false, b_dump_shaders=b_dump_shaders@entry=false) at video_output/opengl/vout_helper.c:670
#8  0x00007fffc09f021d in vout_display_opengl_New (viewpoint=0x7fff900011dc, gl=0x7fff90007400, subpicture_chromas=<synthetic pointer>, fmt=0x7fff90001528) at video_output/opengl/vout_helper.c:901
#9  Open (obj=0x7fff90001440) at video_output/opengl/display.c:145
#10 0x00007ffff7c9c69f in module_load (obj=obj@entry=0x7fff90001440, m=m@entry=0x555555583a70, init=init@entry=0x7ffff7c97a70 <generic_start>, args=args@entry=0x7fffc0af8950) at modules/modules.c:183
#11 0x00007ffff7c9f5f4 in vlc_module_load (obj=0x7fff90001440, capability=0x7ffff7d3c6f6 "vout display", name=0x7fff900010f3 "", strict=<optimized out>, probe=0x7ffff7c97a70 <generic_start>) at modules/modules.c:280
#12 0x00007ffff7d371b1 in vout_display_New (owner=<synthetic pointer>, cfg=0x7fff900011b0, fmt=0x7fffd80010e0, load_module=<optimized out>, module=0x7ffff7d4e616 "$vout", obj=<optimized out>) at video_output/display.c:109
#13 DisplayNew.constprop.0 (vout=<optimized out>, source=0x7fffd80010e0, state=<optimized out>, module=0x7ffff7d4e616 "$vout", is_splitter=<optimized out>, hide_timeout=<optimized out>, owner_ptr=0x0, double_click_timeout=300000) at video_output/display.c:1198
#14 0x00007ffff7cf210b in vout_NewDisplay (module=0x7ffff7d4e616 "$vout", double_click_timeout=300000, hide_timeout=<optimized out>, state=0x7fffc0af8b90, source=<optimized out>, vout=0x7fffd80010a0) at video_output/display.c:1248

It failed because the driver name cannot be retrieved (except if LIBVA_DRIVER_NAME=nvidia is defined)

Then VLC try to load libva using DRM display (https://code.videolan.org/videolan/vlc/ … api.c#L124)

Thread 40 "vlc" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffc67ff6c0 (LWP 16597)]
XDisplayString (dpy=0x0) at /usr/src/debug/libx11/libX11-1.8.3/src/Macros.c:119
Downloading 0.01 MB source file /usr/src/debug/libx11/libX11-1.8.3/src/Macros.c
119     char *XDisplayString(Display *dpy) { return (DisplayString(dpy)); }                                                                                                                                                                                                  
(gdb) bt
#0  XDisplayString (dpy=0x0) at /usr/src/debug/libx11/libX11-1.8.3/src/Macros.c:119
#1  0x00007fff9583ca1d in __vaDriverInit_1_13 () at /usr/lib/dri/nvidia_drv_video.so
#2  0x00007fffd5caf9c3 in va_openDriver (dpy=dpy@entry=0x7fff903a3ec0, driver_name=<optimized out>) at ../libva/va/va.c:533
#3  0x00007fffd5cb2cd0 in vaInitialize (dpy=dpy@entry=0x7fff903a3ec0, major_version=major_version@entry=0x7fffc67fe4d8, minor_version=minor_version@entry=0x7fffc67fe4dc) at ../libva/va/va.c:751
#4  0x00007fff958477d3 in vlc_vaapi_InitializeInstance (native_destroy_cb=0x7fff95847580 <native_drm_destroy_cb>, native=0x3e, dpy=0x7fff903a3ec0, o=<optimized out>) at hw/vaapi/vlc_vaapi.c:95
#5  vlc_vaapi_InitializeInstanceDRM (pf_getDisplayDRM=<optimized out>, device=0x0, pdpy=0x7fff903a3c88, o=0x7fff900073f0) at hw/vaapi/vlc_vaapi.c:155
#6  drm_init_vaapi_instance (priv=0x7fff903a3c80, tc=0x7fff9039f370) at video_output/opengl/converter_vaapi.c:449
#7  Open (obj=0x7fff9039f370) at video_output/opengl/converter_vaapi.c:526
#8  0x00007ffff7c9c69f in module_load (obj=obj@entry=0x7fff9039f370, m=m@entry=0x555555582ee0, init=init@entry=0x7ffff7c97a70 <generic_start>, args=args@entry=0x7fffc67fe5f0) at modules/modules.c:183
#9  0x00007ffff7c9f5f4 in vlc_module_load (obj=obj@entry=0x7fff9039f370, capability=capability@entry=0x7fffb00de295 "glconv", name=0x7ffff7d3d1cb "", name@entry=0x7fffb00de294 "$glconv", strict=strict@entry=true, probe=probe@entry=0x7ffff7c97a70 <generic_start>)
    at modules/modules.c:280
#10 0x00007ffff7c9f8a9 in module_need (obj=obj@entry=0x7fff9039f370, cap=cap@entry=0x7fffb00de295 "glconv", name=name@entry=0x7fffb00de294 "$glconv", strict=strict@entry=true) at modules/modules.c:372
#11 0x00007fffb00d7054 in opengl_init_program
    (vgl=vgl@entry=0x7fff9039d2c0, prgm=prgm@entry=0x7fff9039d5c8, glexts=glexts@entry=0x7fff9035f940 "GL_AMD_multi_draw_indirect GL_AMD_seamless_cubemap_per_texture GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_bindless_texture GL_ARB_blend_func_extended GL_ARB_buffer_storage GL_ARB_clear_buffer"..., fmt=fmt@entry=0x7fff900014a8, subpics=subpics@entry=false, b_dump_shaders=b_dump_shaders@entry=false) at video_output/opengl/vout_helper.c:670
#12 0x00007fffb00db21d in vout_display_opengl_New (viewpoint=0x7fff9000115c, gl=0x7fff900073f0, subpicture_chromas=<synthetic pointer>, fmt=0x7fff900014a8) at video_output/opengl/vout_helper.c:901
#13 Open (obj=0x7fff900013c0) at video_output/opengl/display.c:145
#14 0x00007ffff7c9c69f in module_load (obj=obj@entry=0x7fff900013c0, m=m@entry=0x555555583a70, init=init@entry=0x7ffff7c97a70 <generic_start>, args=args@entry=0x7fffc67fe950) at modules/modules.c:183
#15 0x00007ffff7c9f5f4 in vlc_module_load (obj=0x7fff900013c0, capability=0x7ffff7d3c6f6 "vout display", name=0x7fff90001073 "", strict=<optimized out>, probe=0x7ffff7c97a70 <generic_start>) at modules/modules.c:280
#16 0x00007ffff7d371b1 in vout_display_New (owner=<synthetic pointer>, cfg=0x7fff90001130, fmt=0x7fffa805ca90, load_module=<optimized out>, module=0x7ffff7d4e616 "$vout", obj=<optimized out>) at video_output/display.c:109
#17 DisplayNew.constprop.0 (vout=<optimized out>, source=0x7fffa805ca90, state=<optimized out>, module=0x7ffff7d4e616 "$vout", is_splitter=<optimized out>, hide_timeout=<optimized out>, owner_ptr=0x0, double_click_timeout=300000) at video_output/display.c:1198
#18 0x00007ffff7cf210b in vout_NewDisplay (module=0x7ffff7d4e616 "$vout", double_click_timeout=300000, hide_timeout=<optimized out>, state=0x7fffc67feb90, source=<optimized out>, vout=0x7fffa805ca50) at video_output/display.c:1248
#19 vout_OpenWrapper (state=0x7fffc67feb90, splitter_name=0x0, vout=0x7fffa805ca50) at video_output/vout_wrapper.c:67

It crash...

This crash can also be reproduced by calling:

vainfo --display drm --device /dev/dri/renderD128
Trying display: drm
===> vaInitialize 0x564255213770
===> candidate_index=0, driver_name = nvidia, vaStatus = 0
[1]    18116 segmentation fault (core dumped)  vainfo --display drm --device /dev/dri/renderD128
Program received signal SIGSEGV, Segmentation fault.
XDisplayString (dpy=0x0) at /usr/src/debug/libx11/libX11-1.8.3/src/Macros.c:119
119     char *XDisplayString(Display *dpy) { return (DisplayString(dpy)); }
(gdb) bt
#0  XDisplayString (dpy=0x0) at /usr/src/debug/libx11/libX11-1.8.3/src/Macros.c:119
#1  0x00007ffff7f89a1d in __vaDriverInit_1_13 () from /usr/lib/dri/nvidia_drv_video.so
#2  0x00007ffff7f959c3 in va_openDriver (dpy=dpy@entry=0x55555555d770, driver_name=<optimized out>) at ../libva/va/va.c:533
#3  0x00007ffff7f98d0a in vaInitialize (dpy=0x55555555d770, major_version=0x7fffffffdaf4, minor_version=0x7fffffffdaf0) at ../libva/va/va.c:754
#4  0x00005555555562a3 in ?? ()

Last edited by benjarobin (2023-01-10 00:18:20)

Offline

#7 2023-06-03 10:14:42

Alko89
Member
Registered: 2012-09-16
Posts: 16

Re: [SOLVED] VLC crashes when trying to play videos

Why is this marked as solved? It still requires a workaround to work (exporting LIBVA_DRIVER_NAME)

Offline

Board footer

Powered by FluxBB