linuxdeploy / linuxdeploy-plugin-gstreamer

Bundles GStreamer plugins into AppDirs. Experimental code, please expect issues! Help welcome!
3 stars 11 forks source link

App with gstreamer built on Ubuntu 20.04 does not run #15

Open farindk opened 2 years ago

farindk commented 2 years ago

I am trying to package a software on Ubuntu 20.04. So far, building the AppImage worked fine, but the new software release now depends on gstreamer and I cannot make it work.

I'm using a supposedly standard linux-deploy command:

EXTRA_QT_PLUGINS=xcb linuxdeploy-x86_64.AppImage --appdir AppDir/ -e ... --icon-file=... --desktop-file=... --plugin qt --plugin gstreamer --output=appimage

When I try to run this AppImage on anything (Ubuntu 22.04, Mint 20.03), I get this output (list is actually much longer, probably for all plugins):

(gst-plugin-scanner:97177): GStreamer-WARNING **: 16:09:05.572: Failed to load plugin '/tmp/.mount_imagemvUlwpv/usr/lib/gstreamer-1.0/libgstcamerabin.so': /tmp/.mount_imagemvUlwpv/usr/lib/gstreamer-1.0/libgstcamerabin.so: undefined symbol: gst_encoding_container_profile_get_profiles

(gst-plugin-scanner:97178): GStreamer-WARNING **: 16:09:05.585: Failed to load plugin '/tmp/.mount_imagemvUlwpv/usr/lib/gstreamer-1.0/libgstcdparanoia.so': /tmp/.mount_imagemvUlwpv/usr/lib/gstreamer-1.0/libgstcdparanoia.so: undefined symbol: gst_audio_cd_src_get_type

(gst-plugin-scanner:97179): GStreamer-WARNING **: 16:09:05.598: Failed to load plugin '/tmp/.mount_imagemvUlwpv/usr/lib/gstreamer-1.0/libgstchromaprint.so': /tmp/.mount_imagemvUlwpv/usr/lib/libchromaprint.so.1: undefined symbol: av_rdft_calc, version LIBAVCODEC_58

(gst-plugin-scanner:97180): GStreamer-WARNING **: 16:09:05.615: Failed to load plugin '/tmp/.mount_imagemvUlwpv/usr/lib/gstreamer-1.0/libgstclosedcaption.so': /lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined symbol: g_module_open_full

(gst-plugin-scanner:97181): GStreamer-WARNING **: 16:09:05.626: Failed to load plugin '/tmp/.mount_imagemvUlwpv/usr/lib/gstreamer-1.0/libgstcoloreffects.so': /tmp/.mount_imagemvUlwpv/usr/lib/gstreamer-1.0/libgstcoloreffects.so: undefined symbol: gst_video_filter_get_type

In order to trace this error, I extracted the AppImage. "usr/lib/gstreamer-1.0" contains lots of .so files for plugins and there are gst libraries in "usr/lib":

squashfs-root/usr/lib$ ls libgst*
libgstadaptivedemux-1.0.so.0  libgstaudio-1.0.so.0     libgstbasecamerabinsrc-1.0.so.0  libgstfft-1.0.so.0    libgstmpegts-1.0.so.0   libgstphotography-1.0.so.0  libgstrtp-1.0.so.0   libgstsdp-1.0.so.0            libgstvideo-1.0.so.0
libgstallocators-1.0.so.0     libgstbadaudio-1.0.so.0  libgstcodecparsers-1.0.so.0      libgstgl-1.0.so.0     libgstnet-1.0.so.0      libgstreamer-1.0.so.0       libgstrtsp-1.0.so.0  libgsttag-1.0.so.0            libgstwayland-1.0.so.0
libgstapp-1.0.so.0            libgstbase-1.0.so.0      libgstcontroller-1.0.so.0        libgstisoff-1.0.so.0  libgstpbutils-1.0.so.0  libgstriff-1.0.so.0         libgstsctp-1.0.so.0  libgsturidownloader-1.0.so.0  libgstwebrtc-1.0.so.0

As the first error said that it was missing the symbol gst_encoding_container_profile_get_profiles, I searched for that and found it here:

squashfs-root/usr/lib$ nm -gD libgstpbutils-1.0.so.0 |grep gst_encoding_container_profile_get_profiles
00000000000189c0 T gst_encoding_container_profile_get_profiles

Thus, it looks like it should be there.

If I build the same AppImage on "Ubuntu 22.04", everything works (I cannot test on Mint20.03 because of the older libc). I compared the directory trees of both AppImages, but there were no suspicious differences.

Any idea what I could try next? I'm completely stuck.

PS: list of installed gstreamer packages on Ubuntu 20.04:

$ apt list --installed | grep gstreamer

gir1.2-gstreamer-1.0/focal,now 1.16.2-2 amd64 [installed,automatic]
gstreamer1.0-alsa/focal-updates,focal-security,now 1.16.2-4ubuntu0.1 amd64 [installed,automatic]
gstreamer1.0-clutter-3.0/focal,now 3.0.27-1 amd64 [installed,automatic]
gstreamer1.0-gl/focal-updates,focal-security,now 1.16.2-4ubuntu0.1 amd64 [installed,automatic]
gstreamer1.0-gtk3/focal-updates,focal-security,now 1.16.2-1ubuntu2.1 amd64 [installed,automatic]
gstreamer1.0-packagekit/focal-updates,focal-security,now 1.1.13-2ubuntu1.1 amd64 [installed,automatic]
gstreamer1.0-plugins-bad/focal,now 1.16.2-2.1ubuntu1 amd64 [installed]
gstreamer1.0-plugins-base-apps/focal-updates,focal-security,now 1.16.2-4ubuntu0.1 amd64 [installed,automatic]
gstreamer1.0-plugins-base/focal-updates,focal-security,now 1.16.2-4ubuntu0.1 amd64 [installed]
gstreamer1.0-plugins-good/focal-updates,focal-security,now 1.16.2-1ubuntu2.1 amd64 [installed]
gstreamer1.0-pulseaudio/focal-updates,focal-security,now 1.16.2-1ubuntu2.1 amd64 [installed,automatic]
gstreamer1.0-tools/focal,now 1.16.2-2 amd64 [installed,automatic]
gstreamer1.0-x/focal-updates,focal-security,now 1.16.2-4ubuntu0.1 amd64 [installed,automatic]
libgstreamer-gl1.0-0/focal-updates,focal-security,now 1.16.2-4ubuntu0.1 amd64 [installed,automatic]
libgstreamer-opencv1.0-0/focal,now 1.16.2-2.1ubuntu1 amd64 [installed,auto-removable]
libgstreamer-plugins-bad1.0-0/focal,now 1.16.2-2.1ubuntu1 amd64 [installed]
libgstreamer-plugins-base1.0-0/focal-updates,focal-security,now 1.16.2-4ubuntu0.1 amd64 [installed]
libgstreamer-plugins-base1.0-dev/focal-updates,focal-security,now 1.16.2-4ubuntu0.1 amd64 [installed]
libgstreamer-plugins-good1.0-0/focal-updates,focal-security,now 1.16.2-1ubuntu2.1 amd64 [installed]
libgstreamer-plugins-good1.0-dev/focal-updates,focal-security,now 1.16.2-1ubuntu2.1 amd64 [installed]
libgstreamer1.0-0/focal,now 1.16.2-2 amd64 [installed,automatic]
libgstreamer1.0-dev/focal,now 1.16.2-2 amd64 [installed,automatic]
TheAssassin commented 2 years ago

Way more relevant than your package versions would be the versions of this plugin (check the Git commit hash of the time you downloaded it) and linuxdeploy (./linuxdeploy*.AppImage --version).

(gst-plugin-scanner:97180): GStreamer-WARNING **: 16:09:05.615: Failed to load plugin '/tmp/.mount_imagemvUlwpv/usr/lib/gstreamer-1.0/libgstclosedcaption.so': /lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined symbol: g_module_open_full

Probably not an issue of this plugin, but linuxdeploy. The inclusion of GLib was changed recently. Should be fixed by updating linuxdeploy.

farindk commented 2 years ago

I first tried with an old version of the linuxdeploy tools (main tool and plugins) from about Nov. 2021 and as that did not work (same error as now), I just downloaded new versions of linuxdeploy and this plugin today. The error did not change.

Everything except the gstreamer plugins works fine.

farindk commented 2 years ago
-rwxrwxr-x 1 farindk farindk  3323072 Jun 14 16:24 linuxdeploy-plugin-appimage-x86_64.AppImage
-rwxrwxr-x 1 farindk farindk     4719 Jun 14 16:25 linuxdeploy-plugin-gstreamer.sh
-rwxrwxr-x 1 farindk farindk 14079168 Jun 14 16:23 linuxdeploy-plugin-qt-x86_64.AppImage
-rwxrwxr-x 1 farindk farindk  6149312 Jun 14 16:22 linuxdeploy-x86_64.AppImage
TheAssassin commented 2 years ago

This ls doesn't tell me anything. I provided instructions how to gather a proper version number for linuxdeploy itself above.

This plugin calls back into linuxdeploy, therefire the version of linuxdeploy is the most relevant information right now.

farindk commented 2 years ago
./linuxdeploy-x86_64.AppImage --version
linuxdeploy version 1-alpha (git commit ID 56760df), GitHub actions build 85 built on 2022-06-14 00:36:51 UTC

linuxdeploy-plugin-gstreamer commit: 12e0e983f9e

TheAssassin commented 2 years ago

libgio-2.0 should be contained in the AppImage, but it is not for some reason... see https://github.com/AppImage/pkg2appimage/blob/master/excludelist#L91-L99.

Please run ldconfig -p | ag libgio-2.0 | awk '{print $4}', then add each of them like -l <path> to the linuxdeploy command and re-run.

Note for self: we should have a way in linuxdeploy to log the current excludelist.

farindk commented 2 years ago

Thanks. I changed it and now the missing libgio-2.0 is gone. However, all the other errors remain:

(gst-plugin-scanner:117030): GStreamer-WARNING **: 18:29:55.546: Failed to load plugin '/tmp/.mount_app36-lKcQKU/usr/lib/gstreamer-1.0/libgstcamerabin.so': /tmp/.mount_app36-lKcQKU/usr/lib/gstreamer-1.0/libgstcamerabin.so: undefined symbol: gst_encoding_container_profile_get_profiles

(gst-plugin-scanner:117031): GStreamer-WARNING **: 18:29:55.558: Failed to load plugin '/tmp/.mount_app36-lKcQKU/usr/lib/gstreamer-1.0/libgstcdparanoia.so': /tmp/.mount_app36-lKcQKU/usr/lib/gstreamer-1.0/libgstcdparanoia.so: undefined symbol: gst_audio_cd_src_get_type

(gst-plugin-scanner:117032): GStreamer-WARNING **: 18:29:55.571: Failed to load plugin '/tmp/.mount_app36-lKcQKU/usr/lib/gstreamer-1.0/libgstchromaprint.so': /tmp/.mount_app36-lKcQKU/usr/lib/libchromaprint.so.1: undefined symbol: av_rdft_calc, version LIBAVCODEC_58

(gst-plugin-scanner:117033): GStreamer-WARNING **: 18:29:55.586: Failed to load plugin '/tmp/.mount_app36-lKcQKU/usr/lib/gstreamer-1.0/libgstclosedcaption.so': /tmp/.mount_app36-lKcQKU/usr/lib/gstreamer-1.0/libgstclosedcaption.so: undefined symbol: gst_aggregator_simple_get_next_time

(gst-plugin-scanner:117034): GStreamer-WARNING **: 18:29:55.596: Failed to load plugin '/tmp/.mount_app36-lKcQKU/usr/lib/gstreamer-1.0/libgstcoloreffects.so': /tmp/.mount_app36-lKcQKU/usr/lib/gstreamer-1.0/libgstcoloreffects.so: undefined symbol: gst_video_filter_get_type

Now, for example libgstclosedcaption.so fails on gst_aggregator_simple_get_next_time which I found in libgstbase-1.0.so.0, which is packaged:

squashfs-root/usr/lib$ nm -gD libgstbase-1.0.so.0 |grep gst_aggregator_simple_get_next_time
000000000001f470 T gst_aggregator_simple_get_next_time

Then, I checked the dependencies of libgstbase-1.0.so.0:

$ ldd libgstbase-1.0.so.0 
    linux-vdso.so.1 (0x00007fff82b70000)
    libgstreamer-1.0.so.0 (0x00007f8412b57000)
    libgobject-2.0.so.0 (0x00007f8412af3000)
    libglib-2.0.so.0 (0x00007f84129c0000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8412772000)
    libgmodule-2.0.so.0 (0x00007f841276b000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8412682000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f841267d000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8412678000)
    libffi.so.7 (0x00007f841266b000)
    libpcre.so.3 (0x00007f84125f7000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f8412d32000)

and libgstreamer, libgobject, libglib, libgmodule, libffi, libpcre are also packaged.

farindk commented 2 years ago

Here is the full error list, but it is not very interesting as it is always the same kind of error: error.txt

farindk commented 2 years ago

I have stripped down the program to the minimum to reproduce the error. The repository is here: https://github.com/farindk/capture There is a script that builds everything: https://github.com/farindk/capture/blob/1137d1aff40f7bcadc851b43ebbea817f3cd2224/scripts/create-appimages.sh

Here is the AppImage built with the script above on Ubuntu 20.04 that gives the gstreamer plugin errors like above: https://github.com/farindk/capture/releases/tag/v1.0

The build log is also attached to the release.

Note: it might be required that a (USB) camera is attached when running the program because only then it tries to load the gstreamer plugins.

Any hint would be very appreciated.

martinrotter commented 2 years ago

Having same problems.

yuriymacdev commented 2 years ago

Same issue. @farindk have you had any success with this?

farindk commented 2 years ago

@yuriymacdev No success so far, but I didn't track whether there were any changes to the AppImage tools since June. I had to switch off camera support for Linux because of this.

@TheAssassin Please don't be confused about the libgio issue above. The libgio problem was another issue that seems unrelated to the gstreamer problem. The problem is easy to produce with the minimal code in the repository mentioned above.

yuriymacdev commented 2 years ago

Thanks @farindk. For what it's worth, when built on Ubuntu 22 there's no such problem (but if done this way, the software wouldn't run on Ubuntu 20 and below), so could be some kind of versioning issue.