Skip to content

Instantly share code, notes, and snippets.

@c01dc0ffee
Last active July 8, 2023 20:58
Show Gist options
  • Save c01dc0ffee/8acbd11bbd4b5c18ba4c5de288deb423 to your computer and use it in GitHub Desktop.
Save c01dc0ffee/8acbd11bbd4b5c18ba4c5de288deb423 to your computer and use it in GitHub Desktop.
Troubleshooting SysDVR on Linux and MacOS

Troubleshooting SysDVR on Linux and MacOS

This guide assumes you know how to open a terminal and run commands. Text in a code box represents either a command to run, the output of a command, or both.

"You're using the ___ version of dotnet on an ___ ..."

You've installed .NET with the wrong platform architecture.

  1. There is a bug with platform architecture detection affecting Mac users. If this applies to you, either update SysDVR or ignore the warning.
  2. Uninstall each existing .NET installation
  3. Run uname -m
    • x86_64 -> You need to install .NET 6.0 or higher for x64: Linux / Mac
    • Aarch64 -> You need to install .NET 6.0 or higher for ARM64: Linux / Mac
    • i386 or i686 -> You need to install .NET 6.0 or higher for x86: Linux

"Unable to load DLL 'avcodec.59' under ..."

The SysDVR-Client player needs to load this component but it is not installed or is not loading properly.

Note: The file paths given in these steps may not match yours. Substitute your file paths in these commands!

Linux

  1. If you are using Linux on x64, strongly consider installing SysDVR-Client using flatpak.
    • If this works, skip the rest of the steps.
  2. Find where libavcodec is currently installed: whereis libavcodec.so.59
    • If the result is libavcodec.so:
    • If the result is libavcodec.so: /usr/lib/x86_64-linux-gnu/libavcodec.so.58
    • If the result is libavcodec.so: /usr/lib/x86_64-linux-gnu/libavcodec.so.59
       user@pc:~$ ldd /usr/lib/x86_64-linux-gnu/libavcodec.so.59
       	linux-vdso.so.1 (0x00007ffd553cc000)
       	libswresample.so.4 => not found
       	libavutil.so.57 => not found
       	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5213519000)
       	liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f52134ee000)
       	libva.so.2 => /lib/x86_64-linux-gnu/libva.so.2 (0x00007f52134bd000)
       	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f52134a1000)
       	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5213200000)
       	/lib64/ld-linux-x86-64.so.2 (0x00007f52146d8000)
      
      • You are missing: swresample 4 and avutil 57. Try installing ffmpeg 5 or find your own way to install the missing libraries.

Mac

Note: Mac M1 users use /opt/homebrew/ and other Mac users use /usr/local/. Check your error message to find which one you should use.

  1. Make sure you have installed ffmpeg with the right version. ffmpeg 4 or 6 will not work!
  2. Find where ffmpeg is installed: find /opt/homebrew -name "libavcodec.*.dylib"
  3. From the directory given by the previous command, copy these files into /opt/homebrew/lib: libavcodec.59.dylib libavcodec.59.37.100.dylib libavutil.57.dylib libavutil.57.28.100.dylib.
  4. Run SysDVR-Client.dll

Uninstalling .NET

See Microsoft's guide to uninstalling .NET on Linux / Mac

Finding installed .NET versions

See Microsoft's guide to finding installed .NET versions on Linux / Mac

Installing .NET on Linux

There are two ways to install .NET on Linux:

Installing ffmpeg 5

Note: ffmpeg version 5 is required to run SysDVR-Client! ffmpeg 6 will not work!

Note: The SysDVR flatpak install for Linux ships with ffmpeg 5!

  • Linux: There are official packages available for Ubuntu 22.10+, Debian 12+ and Fedora. Please note that ffmpeg 5 builds are not available on versions below these.
  • Mac: brew uninstall ffmpeg && brew update && brew install ffmpeg@5

Confirm that you have the right version:

user@pc:~$ ffmpeg -version
ffmpeg version 5.1.2-0ubuntu1 ...

Advanced users may compile ffmpeg and configure SysDVR to search for libraries in the build output using the --lib-dir flag.

@c01dc0ffee
Copy link
Author

Hi, big thanks to all the Mac users experiencing these problems who helped me troubleshoot and iterate on these fixes along the way. I've never used a Mac before, so the Mac-specific information here is likely incomplete or misunderstood. If you spot any mistakes or inconsistencies, please let me know and I can correct them.

@DG-1337
Copy link

DG-1337 commented May 20, 2023

When I had "Unable to load DLL 'avcodec.59' under ..." I also had to copy libavutil.57.28.100.dylib into /opt/homebrew/lib.

@keef-khan
Copy link

keef-khan commented May 27, 2023

For Intel Mac users (my troubleshooting advice):

dotnet: command not found: type ln -s /usr/local/share/dotnet/x64/dotnet /usr/local/bin/ into Terminal and hit Return. I believe this may be a common issue with the x64 installer.

"Unable to load DLL 'avcodec.59': Open Finder and search for libavcodec.59.dylib, libavutil.57.dylib, and libavcodec.59.37.100.dylib (some of these are aliases!!) under /usr/local/Cellar/ffmpeg@5/5.1.3/lib. Open another Finder window and go to /usr/local/lib. Copy over the files one by one and then test. It likely won't work. Delete the libavutil.57.dylib alias and drag in libavutil.57.28.100.dylib and rename to libavutil.57.dylib. Do this for any other aliases that are not linking properly. Then test again, it fixed it for me. SUGGESTION: Hold Opt when dragging files to copy just so you accidentally don't erase these files from the Cellar.

ffmpeg: command not found: Make sure to add ffmpeg to env variables (because brew is funky) by typing nano ~/.zshrc into Terminal, adding export PATH="/usr/local/opt/ffmpeg@5/bin:$PATH" to a new line and hitting Control + X, press Y and then Return.

Not sure if my brew installation is borked but it was having a lot of trouble creating symlinks. Even now I still haven't managed to get audio working so I'm gonna try fixing SDL2.

@c01dc0ffee
Copy link
Author

@keef-khan Hope you have this fixed by now. Not sure if you have joined the Discord before. The bug with audio not playing also causes video glitches when you resize the window. A few people have run into this and it's believed to be a bug in the latest version of SDL2. Someone had success running an unofficial build of mpv, presumably because it ships with a lower version of libSDL2. You can either try downgrading or using the unofficial build, but be warned that mpv takes a lot of tinkering to work with audio and video in low latency.

@kogetsukenji
Copy link

I cannot get "Unable to load DLL 'avcodec.59'" issue resolved but I managed to have sysDVR to work with MPV on Silicon Mac.

  1. download and install MPV
  2. run dotnet SysDVR-Client.dll usb --mpv '/Applications/mpv.app/Contents/MacOS/mpv'

Please note that since MPV is running in low-latency so there is no audio by default, therefore, connect your blue-tooth ear phone and switch pro controller to enjoy instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment