# Missing shared library (libffmpeg.so) while running Electron App (LBRY-Desktop) on Linuxulator



## xliiv (Sep 6, 2021)

I'm working on running an Electron Linux App on FreeBSD, namly lbry-desktop,








						GitHub - lbryio/lbry-desktop: A browser and wallet for LBRY, the decentralized, user-controlled content marketplace.
					

A browser and wallet for LBRY, the decentralized, user-controlled content marketplace. - GitHub - lbryio/lbry-desktop: A browser and wallet for LBRY, the decentralized, user-controlled content mark...




					github.com
				





I did this

1. download https://github.com/mrclksr/linux-browser-installer

2. run from FreeBSD

```
> sudo ./linux-browser-installer chroot create
> sudo chroot /compat/ubuntu/ /bin/bash
```

3. run from chroot/ubuntu

```
apt install --yes wget
cd /root
wget https://github.com/lbryio/lbry-desktop/releases/download/v0.51.2/LBRY_0.51.2.deb
apt install --yes ./LBRY_0.51.2.deb
rm /var/lib/dpkg/info/libfprint-2-2\:amd64.postinst
apt install --yes ./LBRY_0.51.2.deb
```
4. back to FreeBSD

```
> /compat/ubuntu/opt/LBRY/lbry
```

I'm getting this

```
> /compat/ubuntu/opt/LBRY/lbry
/compat/ubuntu/opt/LBRY/lbry: error while loading shared libraries: libffmpeg.so: cannot open shared object file: No such file or directory
fish: Job 1, '/compat/ubuntu/opt/LBRY/lbry' terminated by signal SIGTRAP (Trace or breakpoint trap)
```

I did some debugging, but can't get it thru.

My conclusion is, it should work, since

1. `ffmpeg.so` is present

```
> ll /compat/ubuntu/opt/LBRY/
total 195691
-rw-r--r--  1 root  wheel   1.0K Aug 20 16:22 LICENSE.electron.txt
-rw-r--r--  1 root  wheel   4.5M Aug 20 16:22 LICENSES.chromium.html
-rwsr-xr-x  1 root  wheel   6.0M Aug 20 16:22 chrome-sandbox
-rw-r--r--  1 root  wheel   176K Aug 20 16:22 chrome_100_percent.pak
-rw-r--r--  1 root  wheel   314K Aug 20 16:22 chrome_200_percent.pak
-rw-r--r--  1 root  wheel    10M Aug 20 16:22 icudtl.dat
-rwxr-xr-x  1 root  wheel   122M Aug 20 16:22 lbry
-rwxr-xr-x  1 root  wheel   238K Aug 20 16:22 libEGL.so
-rwxr-xr-x  1 root  wheel   8.5M Aug 20 16:22 libGLESv2.so
-rwxr-xr-x  1 root  wheel   3.0M Aug 20 16:22 libffmpeg.so
-rwxr-xr-x  1 root  wheel   4.3M Aug 20 16:22 libvk_swiftshader.so
-rwxr-xr-x  1 root  wheel   8.1M Aug 20 16:22 libvulkan.so
drwxr-xr-x  2 root  wheel    55B Sep  6 13:04 locales
drwxr-xr-x  4 root  wheel     5B Sep  6 13:04 resources
-rw-r--r--  1 root  wheel   4.6M Aug 20 16:22 resources.pak
-rw-r--r--  1 root  wheel    49K Aug 20 16:22 snapshot_blob.bin
drwxr-xr-x  2 root  wheel     4B Sep  6 13:04 swiftshader
-rw-r--r--  1 root  wheel   167K Aug 20 16:22 v8_context_snapshot.bin
-rw-r--r--  1 root  wheel   107B Aug 20 16:22 vk_swiftshader_icd.json
> strings /compat/ubuntu/opt/LBRY/lbry|rg libffmpeg\.so
libffmpeg.so
```

From chroot

```
root@alef14:~# ldd /opt/LBRY/lbry |grep ffmpeg
        libffmpeg.so => /opt/LBRY/libffmpeg.so (0x0000000808e00000)
```


So I'm missing something, but can't find it.


How can I debug/solve it?


----------



## Alexander88207 (Sep 12, 2021)

Hello xliiv,

unfortunately I know very little about the linux emu and have tried wine instead and works flawlessly.

In this testcase i have used emulators/wine-proton with a prefix that have the arial fonts installed. (Arial fonts are needed or the browser will not work).

I know this is maybe not the perfect solution but you have revived no answers yet.

Here at is also surprising how well it works because videos in the browser over wine actually do not run very well, but here in the case it does.


----------



## xliiv (Sep 12, 2021)

Hey Alexander88207,

Thanks for your answer. Could you provide necessary steps from installation to running the app?
I have installed https://www.freshports.org/emulators/wine-proton


```
sudo pkg install wine-proton
```

But can't run it.


```
> ./LBRY_0.51.2.exe
Failed to execute process './LBRY_0.51.2.exe'. Reason:
exec: Exec format error
The file './LBRY_0.51.2.exe' is marked as an executable but could not be run by the operating system.
> lsu-wine-env ./LBRY_0.51.2.exe
./LBRY_0.51.2.exe: MZ@: not found
./LBRY_0.51.2.exe: 1: Syntax error: ")" unexpected
./LBRY_0.51.2.exe: 2: Syntax error: Error in command substitution
> lsu-wine-env LBRY_0.51.2.exe
Traceback (most recent call last):
        2: from /usr/local/bin/lsu-wine-env:37:in `<main>'
        1: from /usr/local/bin/lsu-wine-env:29:in `exec_with_wine_env'
/usr/local/bin/lsu-wine-env:29:in `exec': No such file or directory - LBRY_0.51.2.exe (Errno::ENOENT)
> lsu-wine-env LBRY_0.51.2.exe -h
Traceback (most recent call last):
        2: from /usr/local/bin/lsu-wine-env:37:in `<main>'
        1: from /usr/local/bin/lsu-wine-env:29:in `exec_with_wine_env'
/usr/local/bin/lsu-wine-env:29:in `exec': No such file or directory - LBRY_0.51.2.exe (Errno::ENOENT)
> lsu-wine-env ./LBRY_0.51.2.exe -h
./LBRY_0.51.2.exe: MZ@: not found
./LBRY_0.51.2.exe: 1: Syntax error: ")" unexpected
./LBRY_0.51.2.exe: 2: Syntax error: Error in command substitution
```


----------



## Alexander88207 (Sep 12, 2021)

Sure.

If you never have used wine proton then first setup lib32 with: `/usr/local/wine-proton/bin/pkg32.sh install -y wine-proton mesa-dri`

To install the Arial fonts to the prefix you also need to install emulators/winetricks.

Now to setup the prefix for your application:

1. `WINEPREFIX=$HOME/LBRY WINE=/usr/local/wine-proton/bin/wine winetricks arial`
2. `WINEPREFIX=$HOME/LBRY /usr/local/wine-proton/bin/wine LBRY_0.51.2.exe`
3. Done.

For the later usage of LBRY use: `WINEPREFIX=$HOME/LBRY /usr/local/wine-proton/bin/wine "$HOME/LBRY/drive_c/Program Files/LBRY/LBRY.exe"`


----------



## xliiv (Sep 13, 2021)

Hey Alexander88207,

Good news, we have two working solution.

1. Your step-by-step solution works for me as well, so BIG THANKS to you Alexander88207
2. The original problem is solved, thanks to this article. So, the complete commands are

```
pkg install git  # or git-lite if you prefer
git clone git@github.com:mrclksr/linux-browser-installer.git
cd linux-browser-installer

doas ./linux-browser-installer chroot create
doas chroot /compat/ubuntu bash
apt install --yes wget
cd /root
wget https://github.com/lbryio/lbry-desktop/releases/download/v0.51.2/LBRY_0.51.2.deb
apt install --yes ./LBRY_0.51.2.deb

apt remove --yes libpam-fprintd:amd64 libfprint-2-2:amd64
apt --yes autoremove

apt install --yes ./LBRY_0.51.2.deb
```

Now, it can be run

```
/compat/ubuntu/opt/LBRY/lbry --no-sandbox
```

One issue I found, so far is that sound is missing, but I can live with that. That's because in Lbry you can watch a video in external program (like VLC) and this is what I do anyway.

UPDATE:
Sound works if you run LBRY with the following script


```
#!/bin/sh

# Ensure having working sound, independently of the DE/WM in use:
get_pa_sock_path()
{
        PA_SOCK_PATH=$(sockstat | awk -v me=$(whoami) -F'[ \t]+' '
                $1 == me && $2 == "pulseaudio" && $6 ~ /native/ {
                        print $6;
                        exit 0
                }'
        )
}

get_pa_sock_path
if [ ! -S "$PA_SOCK_PATH" ]; then
        while killall pulseaudio; do
                sleep 0.5
        done
        pulseaudio --start
        get_pa_sock_path
fi
[ -S "$PA_SOCK_PATH" ] && export PULSE_SERVER=unix:$PA_SOCK_PATH

# Let the wrapped binary know that it has been run through the wrapper:
export CHROME_WRAPPER="`readlink -f "$0"`"

# for Brave it's
# Launch Brave through our custom brave-wrapper script:
#/compat/ubuntu/opt/brave.com/brave/brave-wrapper "$@"
/compat/ubuntu/opt/LBRY/lbry --no-sandbox "$@"
```

The script is taken from








						[Linuxulator] How to install Brave (Linux app) on FreeBSD 13.0+
					

Important notes: 1) This guide is for FreeBSD 13.0 and newer only!! For FreeBSD 12, please see: https://forums.freebsd.org/threads/linuxulator-how-to-run-google-chrome-linux-binary-on-freebsd.77559/ 2) This method should be valid for installing any other Chromium-based web browser (Google...




					forums.freebsd.org


----------

