12

My VLC player crashes every time I'm trying to open any video file. Removing/purging vlc, and reinstalling it does not change anything.

I recently upgraded my distro to 20.04 from 19.10. I never had this problem on any other operating system before. I also tried to reinstall the whole operating system from scratch (because I also had some other minor issues). Then VLC worked fine on a fresh installation, but at some point it started to crash again, and now again it always crashes.

Running vlc from terminal gives the following output when I try opening a file.

[00005586d4e98290] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[00005586d4f6d1c0] main audio output error: too low audio sample frequency (0)
[00007fa264ccaa20] main decoder error: failed to create audio output
[00005586d4f6d1c0] vlcpulse audio output error: digital pass-through stream connection failure: Not supported
[00005586d4f6d1c0] main audio output error: module not functional
[00007fa264ccaa20] main decoder error: failed to create audio output
libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
Segmentation fault (core dumped)

And this is the log about that shown in the gnome-logs:

vlc[602364]: segfault at 24 ip 00007fe5731011d4 sp 00007fe546ff6c50 error 6 in iris_dri.so[7fe5726d0000+d48000]
Parsa Mousavi
  • 3,197
  • 15
  • 35
Iras
  • 171
  • 1
  • 1
  • 7
  • Looks like the problem is with the audio output module.Try using a different one in Tools->Preferences->Audio->Output module. – Parsa Mousavi Jun 28 '20 at 16:57
  • Does not help. Although if I disable audio in the settings then the first few lines disappear from the error message. But the rest remains, and vlc still crashes. – Iras Jun 28 '20 at 17:19
  • Now I tried some audio files (mp3, wav), and vlc plays them fine. So there is only a problem with videos, it looks like. – Iras Jun 28 '20 at 17:23
  • Mere ```segmentation fault``` makes no sense when it comes to debugging.You have to gather more information about it.Can you please search through your system logs about VLC via something like **gnome-logs** ? – Parsa Mousavi Jun 28 '20 at 17:35
  • This is what I found in **gnome-logs**. `vlc[602364]: segfault at 24 ip 00007fe5731011d4 sp 00007fe546ff6c50 error 6 in iris_dri.so[7fe5726d0000+d48000]` This was added the first time vlc crashed. Since then a similar log is added every time I try to open something with vlc. – Iras Jun 28 '20 at 21:20
  • 1
    There's a bug report about that [here](https://www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com/msg5774260.html).Does exporting ```MESA_LOADER_DRIVER_OVERRIDE=i965``` work for you? I mean try running VLC after that. – Parsa Mousavi Jun 28 '20 at 21:29
  • It does, but only if I run the command before launching vlc (in the same terminal for instance). So this is half a solution. Can you help me what to do so that it runs correctly every time? – Iras Jun 28 '20 at 21:55
  • 1
    Open the file ```/usr/share/applications/vlc.desktop```(with root access of course), search for ```Exec```.There should be something like this : ```Exec=/usr/bin/vlc --started-from-file %U```.Add the aforementioned variable before it.It should now looks like this : ```Exec=MESA_LOADER_DRIVER_OVERRIDE=i965 /usr/bin/vlc --started-from-file %U```.But if you want to open it in terminal for whatever reason , you have to also add that variable to your ```~/.bashrc``` file. – Parsa Mousavi Jun 28 '20 at 22:28
  • 1
    This doesn't work, it either doesn't launch or still launches incorrectly. But I can run it fine from terminal by adding the command to the `~/.bashrc` file. For the time being this is fine by me, I guess I will wait until the aforementioned bug gets fixed. Thanks for the help. – Iras Jun 28 '20 at 23:45
  • 1
    Oh my bad.You have to add ```env``` before the variable.Now it should look like this : ```Exec= env MESA_LOADER_DRIVER_OVERRIDE=i965 /usr/bin/vlc --started-from-file %U``` – Parsa Mousavi Jun 29 '20 at 08:11
  • @Iras, may I ask, how did you find `gnome-logs`? – Life5ign Dec 26 '22 at 20:37

2 Answers2

21

There's a bug report about that here.In fact VLC is not to blame.There's a bug in the intel driver iris_dri which is a linux Direct Rendering Infrastructure driver for the intel IRIS graphics cards.

Whenever a program tries to bypass the X server and renders directly using OpenGL on the underlying GPU , it has to use that driver indirectly.And a bug causes segmentation fault when someone issues OpenGL calls.

As suggested in the bug report , you have to use the intel driver i965 instead.In order to do that you have to define the environment variable

env MESA_LOADER_DRIVER_OVERRIDE=i965

So if you want to open VLC in the terminal , you have to add that line to your ~/.bashrc file or if you want to open it from the application menu or by clicking on a media file , you have to tamper the line beginning with Exec= in the .desktop file /usr/share/applications/vlc.desktop :

Exec=env MESA_LOADER_DRIVER_OVERRIDE=i965 /usr/bin/vlc --started-from-file %U

And if you want to set that globally for all of your applications , add this line to the file /etc/environment:

MESA_LOADER_DRIVER_OVERRIDE=i965
Parsa Mousavi
  • 3,197
  • 15
  • 35
  • 1
    The same problem seems to be affecting many other applications as well, and the same solution works. But still this is really annoying. Is there a way to solve this problem globally? – Iras Jul 17 '20 at 00:12
  • 1
    @Iras Thanks to [this answer](https://stackoverflow.com/a/36838530/11970791) , I found that you can edit the file ```/etc/environment``` and add that env variable there until a fix arrives. – Parsa Mousavi Jul 17 '20 at 05:46
  • Strange. I was under the impression that 20.04.01 would fix this. Sadly, it hasn't. I believe [this bug](https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1876219) is of relevance. – J. Mini Nov 04 '20 at 14:13
  • @ParsaMousavi There are two .confg files in /etc/environment. In which of the file do I need to add MESA..... line? – praveen pathak Jul 02 '21 at 03:36
5

For those like me who had no luck with Parsa Mousavi's answer, there is still one possibility: delete the ~/.config/vlc/ folder, and retry to use VLC as usual. That worked for me, at least!

Polosson
  • 242
  • 3
  • 9