Score:6

VLC won't work on Ubuntu 20.04.3 LTS with NVidia card

de flag

VLC will not work on Ubuntu 20.04.3 LTS.
It randomly freezes the image, but the audio keeps going.
Or it randomly crashes.
Or it randomly freezes the whole PC.

I have first tried the snap version of VLC.
I have then switched to the sudo apt install vlc in order to start it from terminal and log some errors:

$ vlc 4.mp4 

VLC media player 3.0.9.2 Vetinari (revision 3.0.9.2-0-gd4c1aefe4d)
[000055fc808f5670] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
libva info: va_openDriver() returns -1
[00007fbf04003460] glconv_vaapi_x11 gl error: vaInitialize: unknown libva error
libva info: VA-API version 1.7.0
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[00007fbf04003460] glconv_vaapi_drm gl error: vaInitialize: unknown libva error
libva info: VA-API version 1.7.0
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[00007fbf04003460] glconv_vaapi_drm gl error: vaInitialize: unknown libva error
[00007fbf277175a0] avcodec decoder: Using NVIDIA VDPAU Driver Shared Library  470.86  Tue Oct 26 21:45:30 UTC 2021 for hardware decoding
[00007fbf277175a0] main decoder error: Timestamp conversion failed for 185033334: no reference clock
[00007fbf277175a0] main decoder error: Could not convert timestamp 0 for FFmpeg
[00007fbf277175a0] main decoder error: Timestamp conversion failed for 787500001: no reference clock
[00007fbf277175a0] main decoder error: Could not convert timestamp 0 for FFmpeg
[00007fbf1cccee20] main decoder error: Timestamp conversion failed (delay 666000, buffering 66600, bound 3000000)
[00007fbf1cccee20] main decoder error: Could not convert timestamp 7629279603 for faad
[00007fbf1cccee20] main decoder error: Timestamp conversion failed (delay 666000, buffering 66600, bound 3000000)
[00007fbf1cccee20] main decoder error: Could not convert timestamp 7629051597 for faad

I have a GTX 1080 and an Intel i7 7700k.
In Additional Drivers I have selected: Using NVIDIA driver metapackage from nvidia-driver-470(proprietary,tested).

$ sudo lshw -c video
[sudo] password for george: 
  *-display                 
       description: VGA compatible controller
       product: GP104 [GeForce GTX 1080]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:149 memory:de000000-deffffff memory:c0000000-cfffffff memory:d0000000-d1ffffff ioport:e000(size=128) memory:c0000-dffff

For whatever reason Ubuntu doesn't see the Intel drivers, even though I do have them installed:

$ sudo apt-get install xserver-xorg-video-intel

Reading package lists... Done
Building dependency tree       
Reading state information... Done
xserver-xorg-video-intel is already the newest version (2:2.99.917+git20200226-1).
The following packages were automatically installed and are no longer required:
  gyp javascript-common libc-ares2 libjs-inherits libjs-is-typedarray libjs-psl libjs-typedarray-to-buffer libnode-dev libnode64
  libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib libssl-dev libuv1-dev nodejs-doc python-pkg-resources python2
  python2-minimal python2.7 python2.7-minimal
Use 'sudo apt autoremove' to remove them.

0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

I have also deleted ~/.config/vlc/ a bunch of times in order to reset VLC but to no avail.

I think that VLC is just broken on Ubuntu 20.
This has killed productivity because instead of watching hours of tutorials, I have spent hours getting nowhere on figuring out what is wrong with VLC.

I need a media player capable of displaying subtitles, changing the playback speed, being capable of skipping back and forth, holding a playlist of videos and not crash after 2 minutes of playback.
I have tried Totem but it lacks these features.

Edit:

What is the history of this machine? Which version of Ubuntu was installed here for first time?

I've formatted all available drives, installed Ubuntu 20.04.3 LTS on one drive and Windows 10 Pro x64 on another one.
It is the first time I've installed and used Ubuntu.

$ head -n1 /etc/apt/sources.list

# deb cdrom:[Ubuntu 20.04.3 LTS _Focal Fossa_ - Release amd64 (20210819)]/ focal main restricted

$ apt-cache policy vdpau-driver-all mesa-vdpau-drivers libvdpau-va-gl1

vdpau-driver-all:
  Installed: 1.3-1ubuntu2
  Candidate: 1.3-1ubuntu2
  Version table:
 *** 1.3-1ubuntu2 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status
mesa-vdpau-drivers:
  Installed: 21.0.3-0ubuntu0.3~20.04.4
  Candidate: 21.0.3-0ubuntu0.3~20.04.4
  Version table:
 *** 21.0.3-0ubuntu0.3~20.04.4 500
        500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     20.0.4-2ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
libvdpau-va-gl1:
  Installed: (none)
  Candidate: 0.4.2-1build2
  Version table:
     0.4.2-1build2 500
        500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages

$ dpkg -S dri/nvidia_drv_video.so

dpkg-query: no path found matching pattern *dri/nvidia_drv_video.so*

$ vainfo

libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

Organic Marble avatar
us flag
It works for me on 20.04, so hopefully there is a way for you. Running version 3.0.9.2 When I run it from a terminal the 3rd line is `00007f9494c43c20] avcodec decoder: Using NVIDIA VDPAU Driver Shared Library 460.91.03 Fri Jul 2 05:42:23 UTC 2021 for hardware decoding` Yours appears to be complaining about video drivers instead. I would look into that.
N0rbert avatar
zw flag
What is the history of this machine? Which version of Ubuntu was installed here for first time? Please add the following output to the question: `head -n1 /etc/apt/sources.list`, `apt-cache policy vdpau-driver-all mesa-vdpau-drivers libvdpau-va-gl1`, `dpkg -S dri/nvidia_drv_video.so` by [editing](https://askubuntu.com/posts/1378418/edit) it. Also run `sudo apt-get install vainfo` and add output of `vainfo` too.
ChanganAuto avatar
us flag
And you can use Nvidia X Server Settings to switch to the iGPU Intel, reboot is often needed. I suggest you try running VLC with the iGPU just to rule out any weird business that might be happening with the Nvidia.
George Sloata avatar
de flag
@OrganicMarble I did look into it as much as I could and here I am. I could not fix it on my oown, I could not find a proper solution and that's why I've posted here. Thank you.
George Sloata avatar
de flag
@ChanganAuto Why would I do that ? Isn't a proper GPU supposed to be better at anything than the integrated Intel graphics ?
ChanganAuto avatar
us flag
It's irrelevant for multimedia, obviously. And it should also be obvious the reason why I asked: TROUBLESHOOTING.
ChanganAuto avatar
us flag
Please read the answer below. Meanwhile you can and really should use the iGPU to play videos. Using the Nvidia dGPU just for that is an absurd waste of energy. Use Nvidia for games, 3D rendering, etc.
N0rbert avatar
zw flag
@ChanganAuto iGPU is much slower than this great Nvidia card. Moreover it is probably configured as disabled in BIOS/UEFI. Nvidia has a priority on iGPU in this system and it is great. I have just confirmed that my below answer works for me with my GT425M after manual installation of `vdpau-va-driver` package on 22.04 LTS. It should work on 20.04 LTS, as [commenters say](https://bugs.launchpad.net/ubuntu/+source/libva-utils/+bug/1890815/comments/13) at the linked bug.
ChanganAuto avatar
us flag
@N0rbert *iGPU is much slower*... So you're suggesting it's not good for playing videos? That's the only usage in question here with VLC.
Score:6
zw flag

Confirmed with pretty old Nvidia GT425M and Ubuntu MATE 22.04 LTS (development version). Need to note, that I do not have Ubuntu 20.04 LTS on real hardware, so tested the latest version.

You have just discovered well known bug 1890815. Please mark yourself as affected.

It is fixable by manual download and installation of relevant package which contains nvidia_drv_video.so by using commands below:

cd ~/Downloads
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/v/vdpau-video/vdpau-va-driver_0.7.4-6ubuntu1_amd64.deb
sudo apt-get install ./vdpau-va-driver_0.7.4-6ubuntu1_amd64.deb

and reboot.

U.V. avatar
cn flag
on Ubuntu 20.04.4 LTS with TU117M [GeForce GTX 1650 Mobile / Max-Q] and UHD Graphics 630 While trying to follow the workarounds above, the apt system named a replacement for the **vdpau-va-driver** apt install mesa-va-drivers looks like this is missing in the vlc dependencies somehow and but it does not solve the issue in general for apt policy vlc vlc: Installed: 3.0.9.2-1 the vlc still dumps core quickly from bash
U.V. avatar
cn flag
vdpau-driver-all: 1.3-1ubuntu2 mesa-vdpau-drivers: 21.2.6-0ubuntu0.1~20.04.2 libvdpau-va-gl1: 0.4.2-1build2
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.