how to handle plugin error on different kernel/docker host

Marc Marc at f1-outsourcing.eu
Sun Sep 5 22:13:22 UTC 2021


Hmmm, that is not to nice. I these are even xeons only v1-v2 difference. Thanks for the help :)

On 5 Sep 2021 23:55, Reinis <reinis at xpresshd.com> wrote:

Ok I checked a bit more and it seems everything could be set up correctly but `NDIlib_initialize` just returns false. Did you just change the machine where you run the docker? People on forums talk about CPU incompatibility https://forums.newtek.com/threads/linux-ndi-sdk-examples-broken-on-amd-machine.164762/

You could google more about issues around that call and try to find some documentation around that call from newtek. What checks exactly do they do.

If you really need to solve this and it seems that NDI is proprietary software you could try to reverse that function in library (Ghidra) and debug it to see where it fails.


On 9/6/21 12:53 AM, Marc wrote:


Yes but the same docker image works on centos7 host, and the binaries from the sdk seem to work. This ldd shows it finds the libndi.so.5 => /usr/local/lib/libndi.so.5


     10 pub fn initialize() -> bool {
     11     unsafe { NDIlib_initialize() }
     12 }
     13


     38
     39 fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
     40     if !ndi::initialize() {
     41         return Err(glib::glib_bool_error!("Cannot initialize NDI"));
     42     }
     43
     44     device_provider::register(plugin)?;
     45




Seems like you got your next hint `

Cannot initialize NDI

`

Check source code
https://github.com/teltek/gst-plugin-ndi/blob/master/src/lib.rs#L41

https://github.com/teltek/gst-plugin-ndi/blob/master/src/ndi.rs#L10

Seems like you are missing ndi libs in docker.
https://github.com/teltek/gst-plugin-ndi#compilation-of-the-ndi-element
Follow to set up NDI libraries


On 9/6/21 12:37 AM, Marc wrote:


That generates 13000 lines, this a tail

0:00:00.216604350 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1341:gst_registry_scan_path_level:<registry0>^[[00m
marking plugin 0x1514190 as registered as /usr/local/lib64/gstreamer-
1.0/libgstrawparse.so


0:00:00.216623956 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1300:gst_registry_scan_path_level:<registry0>^[[00m file
/usr/local/lib64/gstreamer-1.0/libgstsubparse.so looks like a possible
module


0:00:00.216637331 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1338:gst_registry_scan_path_level:<registry0>^[[00m file
/usr/local/lib64/gstreamer-1.0/libgstsubparse.so cached


0:00:00.216649791 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1341:gst_registry_scan_path_level:<registry0>^[[00m
marking plugin 0x15142c0 as registered as /usr/local/lib64/gstreamer-
1.0/libgstsubparse.so


0:00:00.216669474 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1300:gst_registry_scan_path_level:<registry0>^[[00m file
/usr/local/lib64/gstreamer-1.0/libgsttcp.so looks like a possible module


0:00:00.216682674 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1338:gst_registry_scan_path_level:<registry0>^[[00m file
/usr/local/lib64/gstreamer-1.0/libgsttcp.so cached


0:00:00.216695410 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1341:gst_registry_scan_path_level:<registry0>^[[00m
marking plugin 0x15143f0 as registered as /usr/local/lib64/gstreamer-
1.0/libgsttcp.so


0:00:00.216715182 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1300:gst_registry_scan_path_level:<registry0>^[[00m file
/usr/local/lib64/gstreamer-1.0/libgsttypefindfunctions.so looks like a
possible module


0:00:00.216728744 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1338:gst_registry_scan_path_level:<registry0>^[[00m file
/usr/local/lib64/gstreamer-1.0/libgsttypefindfunctions.so cached


0:00:00.216741522 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1341:gst_registry_scan_path_level:<registry0>^[[00m
marking plugin 0x1514520 as registered as /usr/local/lib64/gstreamer-
1.0/libgsttypefindfunctions.so


0:00:00.216760554 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1300:gst_registry_scan_path_level:<registry0>^[[00m file
/usr/local/lib64/gstreamer-1.0/libgstvideoconvert.so looks like a
possible module


0:00:00.216773828 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1338:gst_registry_scan_path_level:<registry0>^[[00m file
/usr/local/lib64/gstreamer-1.0/libgstvideoconvert.so cached


0:00:00.216802924 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1341:gst_registry_scan_path_level:<registry0>^[[00m
marking plugin 0x1514650 as registered as /usr/local/lib64/gstreamer-
1.0/libgstvideoconvert.so


0:00:00.216824867 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1300:gst_registry_scan_path_level:<registry0>^[[00m file
/usr/local/lib64/gstreamer-1.0/libgstvideorate.so looks like a possible
module


0:00:00.216838682 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1338:gst_registry_scan_path_level:<registry0>^[[00m file
/usr/local/lib64/gstreamer-1.0/libgstvideorate.so cached


0:00:00.216851378 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1341:gst_registry_scan_path_level:<registry0>^[[00m
marking plugin 0x1514780 as registered as /usr/local/lib64/gstreamer-
1.0/libgstvideorate.so


0:00:00.216871213 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1300:gst_registry_scan_path_level:<registry0>^[[00m file
/usr/local/lib64/gstreamer-1.0/libgstvideoscale.so looks like a possible
module


0:00:00.216884784 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1338:gst_registry_scan_path_level:<registry0>^[[00m file
/usr/local/lib64/gstreamer-1.0/libgstvideoscale.so cached


0:00:00.216897419 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1341:gst_registry_scan_path_level:<registry0>^[[00m
marking plugin 0x15148b0 as registered as /usr/local/lib64/gstreamer-
1.0/libgstvideoscale.so


0:00:00.216917130 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1300:gst_registry_scan_path_level:<registry0>^[[00m file
/usr/local/lib64/gstreamer-1.0/libgstvideotestsrc.so looks like a
possible module


0:00:00.216930491 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1338:gst_registry_scan_path_level:<registry0>^[[00m file
/usr/local/lib64/gstreamer-1.0/libgstvideotestsrc.so cached


0:00:00.216943011 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1341:gst_registry_scan_path_level:<registry0>^[[00m
marking plugin 0x15149e0 as registered as /usr/local/lib64/gstreamer-
1.0/libgstvideotestsrc.so


0:00:00.216962390 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1300:gst_registry_scan_path_level:<registry0>^[[00m file
/usr/local/lib64/gstreamer-1.0/libgstvolume.so looks like a possible
module


0:00:00.216975813 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1338:gst_registry_scan_path_level:<registry0>^[[00m file
/usr/local/lib64/gstreamer-1.0/libgstvolume.so cached


0:00:00.216988384 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1341:gst_registry_scan_path_level:<registry0>^[[00m
marking plugin 0x1514b10 as registered as /usr/local/lib64/gstreamer-
1.0/libgstvolume.so


0:00:00.217015893 ^[[33m11480^[[00m      0x1467e00 ^[[37mDEBUG  ^[[00m


^[[00m        GST_REGISTRY
gstregistry.c:1384:gst_registry_scan_path_internal:<registry0>^[[00m
registry changed in path /usr/local/lib64/gstreamer-1.0: 0


0:00:00.217028402 ^[[33m11480^[[00m      0x1467e00 ^[[37mDEBUG  ^[[00m


^[[00m        GST_REGISTRY
gstregistry.c:1561:gst_registry_remove_cache_plugins:<registry0>^[[00m
removing cached plugins


0:00:00.217043136 ^[[33m11480^[[00m      0x1467e00 ^[[36mINFO   ^[[00m


^[[00m        GST_REGISTRY
gstregistry.c:1713:scan_and_update_registry:^[[00m Registry cache has
not changed


0:00:00.217055278 ^[[33m11480^[[00m      0x1467e00 ^[[36mINFO   ^[[00m


^[[00m        GST_REGISTRY
gstregistry.c:1790:ensure_current_registry:^[[00m registry reading and
updating done, result = 1


0:00:00.217064973 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00m        GST_REGISTRY
gstregistry.c:1866:gst_update_registry:^[[00m registry update succeeded


0:00:00.217089693 ^[[33m11480^[[00m      0x1467e00 ^[[36mINFO   ^[[00m


^[[00;01;31m            GST_INIT gst.c:807:init_post:^[[00m GLib runtime
version: 2.56.4


0:00:00.217103781 ^[[33m11480^[[00m      0x1467e00 ^[[36mINFO   ^[[00m


^[[00;01;31m            GST_INIT gst.c:809:init_post:^[[00m GLib headers
version: 2.56.4


0:00:00.217126633 ^[[33m11480^[[00m      0x1467e00 ^[[36mINFO   ^[[00m


^[[00;01;31m            GST_INIT gst.c:810:init_post:^[[00m initialized
GStreamer successfully


0:00:00.217163021 ^[[33m11480^[[00m      0x1467e00 ^[[37mDEBUG  ^[[00m


^[[00;04m             default
gsttracerutils.c:77:_priv_gst_tracing_init:^[[00m Initializing GstTracer


0:00:00.218765476 ^[[33m11480^[[00m      0x1467e00 ^[[37mDEBUG  ^[[00m


^[[00;01;36m  GST_PLUGIN_LOADING
gstplugin.c:768:_priv_gst_plugin_load_file_for_registry:^[[00m attempt
to load plugin "/usr/local/lib64/gstreamer-1.0/libgstndi.so"


0:00:00.226931198 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00;01;36m  GST_PLUGIN_LOADING
gstplugin.c:890:_priv_gst_plugin_load_file_for_registry:^[[00m Plugin
0x148a3f0 for file "/usr/local/lib64/gstreamer-1.0/libgstndi.so"
prepared, calling entry function...


0:00:00.226962382 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00;01;36m  GST_PLUGIN_LOADING
gstplugin.c:897:_priv_gst_plugin_load_file_for_registry:^[[00m Plugin
0x148a3f0 for file "/usr/local/lib64/gstreamer-1.0/libgstndi.so"
prepared, registering...


0:00:00.226995587 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mLOG


^[[00m ^[[00;01;36m  GST_PLUGIN_LOADING
gstplugin.c:514:gst_plugin_register_func:^[[00m plugin
"/usr/local/lib64/gstreamer-1.0/libgstndi.so" looks good


0:00:00.227200084 ^[[33m11480^[[00m      0x1467e00 ^[[31;01mERROR


^[[00m ^[[00;01;36m  GST_PLUGIN_LOADING
src/lib.rs:71:gstndi::plugin_desc:^[[00m Failed to register plugin:
Cannot initialize NDI


0:00:00.227229169 ^[[33m11480^[[00m      0x1467e00 ^[[33;01mWARN


^[[00m ^[[00;01;36m  GST_PLUGIN_LOADING
gstplugin.c:535:gst_plugin_register_func:^[[00m plugin
"/usr/local/lib64/gstreamer-1.0/libgstndi.so" failed to initialise


0:00:00.227243930 ^[[33m11480^[[00m      0x1467e00 ^[[37mDEBUG  ^[[00m


^[[00;01;36m  GST_PLUGIN_LOADING
gstplugin.c:902:_priv_gst_plugin_load_file_for_registry:^[[00m
gst_plugin_register_func failed for plugin "/usr/local/lib64/gstreamer-
1.0/libgstndi.so"


Could not load plugin file: File "/usr/local/lib64/gstreamer-


1.0/libgstndi.so" appears to be a GStreamer plugin, but it failed to
initialize





Ok run `GST_DEBUG=*:6 gst-inspect-1.0
/usr/local/lib64/gstreamer-1.0/libgstndi.so` that should show more


info



On 9/5/21 11:40 PM, Marc wrote:


Ok the ldd I did already, that seems fine.

[@ bin]# ldd /usr/local/lib64/gstreamer-1.0/libgstndi.so
          linux-vdso.so.1 (0x00007ffe8b1b4000)
          libndi.so.5 => /usr/local/lib/libndi.so.5


(0x00007f07b9e2c000)


          libgstaudio-1.0.so.0 => /usr/local/lib64/libgstaudio-


1.0.so.0


(0x00007f07b9bbb000)


          libgstbase-1.0.so.0 => /usr/local/lib64/libgstbase-


1.0.so.0


(0x00007f07b993d000)


          libgstreamer-1.0.so.0 => /usr/local/lib64/libgstreamer-


1.0.so.0 (0x00007f07b95fb000)


          libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0


(0x00007f07b93a8000)


          libglib-2.0.so.0 => /lib64/libglib-2.0.so.0


(0x00007f07b908f000)


          libgstvideo-1.0.so.0 => /usr/local/lib64/libgstvideo-


1.0.so.0


(0x00007f07b8dec000)


          libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f07b8bd4000)
          libpthread.so.0 => /lib64/libpthread.so.0


(0x00007f07b89b4000)


          libm.so.6 => /lib64/libm.so.6 (0x00007f07b8632000)
          libdl.so.2 => /lib64/libdl.so.2 (0x00007f07b842e000)
          libc.so.6 => /lib64/libc.so.6 (0x00007f07b8069000)
          /lib64/ld-linux-x86-64.so.2 (0x00007f07bbd48000)
          libavahi-common.so.3 => /lib64/libavahi-common.so.3


(0x00007f07b7e5c000)


          libavahi-client.so.3 => /lib64/libavahi-client.so.3


(0x00007f07b7c4a000)


          libgsttag-1.0.so.0 => /usr/local/lib64/libgsttag-1.0.so.0


(0x00007f07b7a0f000)


          libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0


(0x00007f07b780b000)


          libgnutls.so.30 => /lib64/libgnutls.so.30


(0x00007f07b741a000)


          libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f07b71a9000)
          libffi.so.6 => /lib64/libffi.so.6 (0x00007f07b6fa0000)
          libdbus-1.so.3 => /lib64/libdbus-1.so.3


(0x00007f07b6d4c000)


          libz.so.1 => /lib64/libz.so.1 (0x00007f07b6b35000)
          libp11-kit.so.0 => /lib64/libp11-kit.so.0


(0x00007f07b680b000)


          libidn2.so.0 => /lib64/libidn2.so.0 (0x00007f07b65ed000)
          libunistring.so.2 => /lib64/libunistring.so.2


(0x00007f07b626c000)


          libtasn1.so.6 => /lib64/libtasn1.so.6 (0x00007f07b6059000)
          libnettle.so.6 => /lib64/libnettle.so.6


(0x00007f07b5e1f000)


          libhogweed.so.4 => /lib64/libhogweed.so.4


(0x00007f07b5bef000)


          libgmp.so.10 => /lib64/libgmp.so.10 (0x00007f07b5957000)
          libsystemd.so.0 => /lib64/libsystemd.so.0


(0x00007f07b5612000)


          librt.so.1 => /lib64/librt.so.1 (0x00007f07b540a000)
          liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f07b51e3000)
          liblz4.so.1 => /lib64/liblz4.so.1 (0x00007f07b4fc6000)
          libcap.so.2 => /lib64/libcap.so.2 (0x00007f07b4dc0000)
          libmount.so.1 => /lib64/libmount.so.1 (0x00007f07b4b66000)
          libgcrypt.so.20 => /lib64/libgcrypt.so.20


(0x00007f07b4848000)


          libblkid.so.1 => /lib64/libblkid.so.1 (0x00007f07b45f5000)
          libuuid.so.1 => /lib64/libuuid.so.1 (0x00007f07b43ed000)
          libselinux.so.1 => /lib64/libselinux.so.1


(0x00007f07b41c3000)


          libgpg-error.so.0 => /lib64/libgpg-error.so.0


(0x00007f07b3fa2000)


          libpcre2-8.so.0 => /lib64/libpcre2-8.so.0


(0x00007f07b3d1e000)





Sorry I mistyped. You should use `ldd` command `ldd
/usr/local/lib64/gstreamer-1.0/libgstndi.so`


On 9/5/21 11:34 PM, Marc wrote:


Yes, looks like something is not ok. But I guess this is then


related


to compiler flag, that builds specific to the host cpu/kernel?


[@bin]# ld /usr/local/lib64/gstreamer-1.0/libgstndi.so
ld: warning: cannot find entry symbol _start; not setting start


address





How did you install those plugins?

Check that all dependencies for `libgstndi.so` are in place (`ld
/usr/local/lib64/gstreamer-1.0/libgstndi.so`)

On 9/5/21 8:52 PM, Marc via gstreamer-devel wrote:


I have centos8 docker image that builds gstreamer,base,good,bad


from


source plus the gstreamer-ndi plugin. Strange thing is, that if I


run


the docker image on a centos7 host with a 3.10 kernel gst-inspect


is


fine:


[/]# gst-inspect-1.0 /usr/local/lib64/gstreamer-1.0/libgstndi.so
Plugin Details:
      Name                     ndi
      Description              NewTek NDI Plugin
      Filename                 /usr/local/lib64/gstreamer-


1.0/libgstndi.so


      Version                  1.0.0-160571e
      License                  LGPL
      Source module            gst-plugin-ndi
      Source release date      2021-08-17
      Binary package           gst-plugin-ndi
      Origin URL               https://github.com/teltek/gst-


plugin-


ndi


      ndisink: NDI Sink
      ndisinkcombiner: NDI Sink Combiner
      ndiaudiosrc: NewTek NDI Audio Source
      ndivideosrc: NewTek NDI Video Source
      ndideviceprovider: NewTek NDI Device Provider

      5 features:
      +-- 4 elements
      +-- 1 device providers

But when I move the centos8 docker image to a centos8 host, and


execute the same I am getting this error


[]# ldconfig
[]# gst-inspect-1.0 /usr/local/lib64/gstreamer-1.0/libgstndi.so
0:00:00.033940037  1886      0x21fa960 ERROR


GST_PLUGIN_LOADING


src/lib.rs:71:gstndi::plugin_desc: Failed to register plugin:


Cannot


initialize NDI


Could not load plugin file: File "/usr/local/lib64/gstreamer-


1.0/libgstndi.so" appears to be a GStreamer plugin, but it failed


to


initialize


How should I debug this?

Rebuilding a new image on the centos8 host does not resolve


this.


starting the container with --cap-add SYS_ADMIN does not resolve


this.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210905/3018e8e3/attachment-0001.htm>


More information about the gstreamer-devel mailing list