ALVR icon indicating copy to clipboard operation
ALVR copied to clipboard

libavcodec.so.58 on Ubuntu 20.04 LTS can't be found

Open ilovecherries opened this issue 2 years ago • 18 comments

Please follow the general troubleshooting steps first:

  • [x] I carefully followed the instructions in the README and completed successfully the setup wizard.
  • [x] I read the ALVR Wikis here and here

If your issue is about games not working, please open an issue for every game and list the game in the title.

Bug reports:

When trying to figure out why I couldn't connect my headset when it paused on "The stream will begin soon", I looked into vrserver.txt to find that the following message jumped out at me.

Fri Nov 26 2021 16:43:49.058711 - alvr_server: error in encoder thread: failed to load libavcodec.so.58

As a result, I tried to do several things to try and remedy this.

  1. I tried to install the appropriate libavcodec packages to see if that would solve this. It still couldn't find the library.
  2. I tried to use the ALVR dashboard to register the drivers and saw that /usr/lib64/alvr was added. It still couldn't find the library
  3. As a last resort, I added the folder /usr/lib64/alvr to path and ran ldconfig and that still didn't work.

I can't seem to figure out why it can't find it and I don't really know anything about how plugins interact with Steam.

Environement

What hardware do you have: CPU, GPU, Audio

  • AMD® Ryzen 5 2600
  • NVIDIA Corporation TU116 [GeForce GTX 1660]
  • (The audio isn't relevant)

What version of ALVR and SteamVR have you tried.

  • SteamVR 1.20.4
  • ALVR server v16.0.0

Do you have the latest Windows updates? Run "winver" in Windows 10 to get the version number

  • I'm running Ubuntu 20.04 LTS

Features:

Please note by far the quickest way to get a new feature is to file a Pull Request.

We will consider your request but it may be closed if it's something we're not actively planning to work on.

ilovecherries avatar Nov 26 '21 21:11 ilovecherries

Same here. Good report, not sure what else to add. I installed by

. /etc/os-release wget -qO- 'https://repo.trae32566.org/repository/alvr_static/RPM-GPG-KEY-alvr' | gpg --dearmor | sudo tee '/usr/share/keyrings/alvr-archive-keyring.gpg' > /dev/null wget -qO- "https://repo.trae32566.org/repository/alvr_static/alvr-${UBUNTU_CODENAME:-${ID}}.sources" | sudo tee "/etc/apt/sources.list.d/alvr-${UBUNTU_CODENAME:-${ID}}.sources" > /dev/null sudo chmod +r '/usr/share/keyrings/alvr-archive-keyring.gpg' "/etc/apt/sources.list.d/alvr-${UBUNTU_CODENAME:-${ID}}.sources" sudo apt-get install alvr

I might try the portable version and report back.

EDIT: (note: these are my first hours with SteamVR, alvr etc.)

I skipped the portable version and built from source following https://github.com/alvr-org/ALVR/wiki/Building-From-Source#Linux -removed the old apk and installed the newly generated apk => new device to be trusted -deb (and rpm) empty However, SteamVR->VR view shows the home with tracking. Oculus still shows "The stream will begin soon" though" => SUCESS? I'll keep fiddling to ensure the rebuilt server is installed

EDIT2: Still won't load libavcodec.so.58. BUT: SteamVR home is now visible on the Oculus Go, in 3D - choppy and somewhat distorted.

tl;dr Apparently failing to load libavcodec.so.58 is not essential to visit the SteamVR Home.

Dear devs: Cool project! I'd love to see this mature further.

nokolade avatar Nov 28 '21 15:11 nokolade

libavcodec.so.58 should be part of the bundled ffmpeg I believe.. I'll take a look and see if perhaps I forgot to put the compiled bundled ffmpeg into the ~package control file~ packaging script.

Dear devs: Cool project! I'd love to see this mature further.

Thanks! We're working on it.

Trae32566 avatar Nov 29 '21 09:11 Trae32566

libavcodec.so.58 should be part of the bundled ffmpeg I believe.. I'll take a look and see if perhaps I forgot to put the compiled bundled ffmpeg into the ~package control file~ packaging script.

Thanks. What I found (but ffmpeg possibly didn't):

$ dpkg --listfiles alvr | grep libavc /usr/lib64/alvr/libavcodec.so.58 Hope this helps.

nokolade avatar Nov 29 '21 12:11 nokolade

3. As a last resort, I added the folder /usr/lib64/alvr to path and ran ldconfig and that still didn't work.

Can you try this directly before running ALVR from the same command prompt? This creates or appends /usr/lib64/alvr to $LD_LIBRARY_PATH:

export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}/usr/lib64/alvr"

If this fixes the error, we can set this on startup or something

Trae32566 avatar Nov 30 '21 04:11 Trae32566

You should not alter any system configuration, when using bundled ffmpeg, ALVR provides a full path of libavcodec to dlopen. Adding bundled ffmpeg to system path will break other applications.

About EDIT2, it is not possible for ALVR to work if libavcodec fails to load, there must be some log mixup.

Can you make sure that ALVR installed from the package is the only one in your steamVR configuration? It should be in ~/.config/openvr/openvrpaths.vrpath and contain

"external_drivers": [
    "/usr/lib64/alvr"
  ]

xytovl avatar Nov 30 '21 08:11 xytovl

Hello @xytovl , same issue here, this is the content of ~/.config/openvr/openvrpaths.vrpath

{
	"config" : 
	[
		"/home/nebo/.steam/steam/config"
	],
	"external_drivers" : 
	[
		"/usr/lib64/alvr"
	],
	"jsonid" : "vrpathreg",
	"log" : 
	[
		"/home/nebo/.steam/steam/logs"
	],
	"runtime" : 
	[
		"/home/nebo/.local/share/Steam/steamapps/common/SteamVR"
	],
	"version" : 1
}

n3bojs4 avatar Nov 30 '21 16:11 n3bojs4

You should not alter any system configuration, when using bundled ffmpeg, ALVR provides a full path of libavcodec to dlopen. Adding bundled ffmpeg to system path will break other applications.

  1. This was just a test to see if manually forcing the library path works since it still appears unable to find it. I maintain it is a valid and useful test.
  2. This exports only to the environment it's in .... It will NOT cause system issues unless you intentionally run something else specifically that uses ffmpeg in the exact same bash session. This makes no changes outside the bash session it is running in.

Trae32566 avatar Nov 30 '21 16:11 Trae32566

Running Ubuntu 20.04 LTS, with Oculus Quest 1, NVidia RTX 2060. I found the same error "failed to load libavcodec.so.58". Digging a bit deeper, I ran: ldd /usr/lib64/alvr/libavcodec.so.58 and noticed libx264.so.160 => not found libx265.so.192 => not found

The libraries included with this Ubuntu release are: libx264.so.155 => /lib/x86_64-linux-gnu/libx264.so.155 (0x00007f1776581000) libx265.so.179 => /lib/x86_64-linux-gnu/libx265.so.179 (0x00007f1775613000)

So that tells me I need newer libraries to work with the libavcodec alvr bundles.

I manually downloaded: http://archive.ubuntu.com/ubuntu/pool/universe/x/x265/libx265-192_3.4-2_amd64.deb http://archive.ubuntu.com/ubuntu/pool/universe/x/x264/libx264-160_0.160.3011+gitcde9a93-2build1_amd64.deb Extracted them with ar x [file.deb] and then tar xvf data.tar.xz Copied libx264.so.160 and libx265.so.192 to /usr/lib/x86_64-linux-gnu Ran ldconfig. Looking back I suppose I could have just used dpkg and installed the packages, but I first tried placing just the library files into /usr/lib64/alvr with the others. That didn't work so I copied them to the system-wide directory.

Restarted alvr and it worked. Sort of. The h265 codec just looks like smeared blocks of random grey. Using h264 is functional, especially once I switched to a wired USB connection. And I had to turn off foveated rendering because the outside areas were all stretched incorrectly.

vclayton avatar Dec 10 '21 21:12 vclayton

@vclayton 's suggestion solved my libavcodec.so.58 can't be found issue. Thank you! However the next problem occurs with [INFO] | failed to create VAAPI encoder.

Anyone any suggestions there?

AnsonArgyris avatar Dec 10 '21 21:12 AnsonArgyris

@vclayton 's suggestion solved my libavcodec.so.58 can't be found issue. Thank you! However the next problem occurs with [INFO] | failed to create VAAPI encoder.

Anyone any suggestions there?

Guessing you have a Nvidia gpu if so clone the v16 release and follow the build and run instructions, as rn Nvidia GPUs can only use software encoding which is broken on the git / nightly releases. Also that normal again if you have a Nvidia gpu

ColdIce1605 avatar Dec 10 '21 22:12 ColdIce1605

@ColdIce1605 thanks i have indeed a Nvidia GPU. That sucks, will there be support for Nvidia someday, or is the only way getting an AMD card? (Which i'm planning to get anyway.)

AnsonArgyris avatar Dec 10 '21 22:12 AnsonArgyris

Just got my Quest today and had the same issue as described here; first the libraries missing and then the VAAPI failing because of NVidia.

Hope the software encoding can be fixed in the build as well as full support for Nvidia

jeee avatar Dec 20 '21 16:12 jeee

I compiled the latest release but when connecting I only see some lines and on the dashboard it shows the stats and then after some time jumps back to the Connection page and the to stats page again and keeps doing that

jeee avatar Dec 20 '21 16:12 jeee

I have the same issue as the OP. The headset just says "stream will begin soon" and SteamVR totally works flawlessly on my computer but i can't see it on the headset. I just want to say thank you very much to the devs, this project is very cool and the support for Linux is greatly appreciated.

skulldsp avatar Jan 06 '22 07:01 skulldsp

Running Ubuntu 20.04 LTS, with Oculus Quest 1, NVidia RTX 2060. I found the same error "failed to load libavcodec.so.58". Digging a bit deeper, I ran: ldd /usr/lib64/alvr/libavcodec.so.58 and noticed libx264.so.160 => not found libx265.so.192 => not found

The libraries included with this Ubuntu release are: libx264.so.155 => /lib/x86_64-linux-gnu/libx264.so.155 (0x00007f1776581000) libx265.so.179 => /lib/x86_64-linux-gnu/libx265.so.179 (0x00007f1775613000)

So that tells me I need newer libraries to work with the libavcodec alvr bundles.

I manually downloaded: http://archive.ubuntu.com/ubuntu/pool/universe/x/x265/libx265-192_3.4-2_amd64.deb http://archive.ubuntu.com/ubuntu/pool/universe/x/x264/libx264-160_0.160.3011+gitcde9a93-2build1_amd64.deb Extracted them with ar x [file.deb] and then tar xvf data.tar.xz Copied libx264.so.160 and libx265.so.192 to /usr/lib/x86_64-linux-gnu Ran ldconfig. Looking back I suppose I could have just used dpkg and installed the packages, but I first tried placing just the library files into /usr/lib64/alvr with the others. That didn't work so I copied them to the system-wide directory.

Restarted alvr and it worked. Sort of. The h265 codec just looks like smeared blocks of random grey. Using h264 is functional, especially once I switched to a wired USB connection. And I had to turn off foveated rendering because the outside areas were all stretched incorrectly.

Thank you @vclayton, Im using Pop! OS 20.04 over here. Had the same problem, executed the same commands and it worked just fine! Thank you again :heart:

ezequielramos avatar Feb 03 '22 01:02 ezequielramos

Same issue, the solution didn't work for me. I'm on pop_os

Gcat101 avatar Mar 10 '22 15:03 Gcat101

ok so i might know a temporary fix. so i am not 100% sure i still have to do some other testing once i can.

note:this is with the deb in the documents dir and a folder called alvr ok so first i took the deb pagage (nighty 18.0.0) and i extracted it to the alvr dir with dpkg-deb -x /home/USER/Documents/alvr_18.0.0-dev00_amd64.deb alvr after that i tryed to run it but failed so i put chromium in as well (source from the site and ran the script to install) and moved all the files in (VERNUBER)/chrome-linux/ to /home/USER/Documents/alvr/usr/bin/ then did the run alrvr (like before) with (pushd alvr && ~/Documents/alvr/usr/bin/alvr_launcher; popd) after that I ran it and it seemed to get into the steam vr home (never did before) and i dont see the failed to load libavcodec.so.58 anymore

on popos 20.10

nagaisa avatar Apr 23 '22 17:04 nagaisa

On openSUSE Tumbleweed it seems to work after doing this

sudo ln -s /usr/lib/libavcodec.so.58.134 /usr/lib/libavcodec.so.58

chapmanjacobd avatar May 11 '22 23:05 chapmanjacobd

FFmpeg is now statically linked.

zarik5 avatar Feb 05 '23 22:02 zarik5