Gstreamer 1.16 on Jetson AGX Xavier

Hi,

I have installed GStreamer 1.16 from source on Jetson AGX Xavier running Ubuntu 18.04. The install prefix was in ~/home/gst_1.16.2/

I followed the instructions from the NVIDIA Gstreamer Accelerated User Guide (https://developer.download.nvidia.com/embedded/L4T/r32_Release_v1.0/Docs/Accelerated_GStreamer_User_Guide.pdf?4NHDxqmGbifDrDO0NNSgXf-_o4NR3tms5egIbmrrGr8MX_Ku-KOV8C51QrCyzZyla9xd4jv1NMhO4xL8K-fqyTa1AA7JXhNY-LNPS0bp4ryutDZiDMClDwQooMDu0a40KL5NfaKtL6xbB-H8-tahuXdDpyjQiEb4qZldHozVkEDHF6gG20Q)

The build is successful (no errors).

I have a native installation of Gstreamer 1.14.5 that comes with the Jetpack installation.

I sourced all my Gstreamer environment variables to the 1.16 version (LD_LIBRARY_PATH, PATH, GST_PLUGIN_PATH etc.).

However when I run gst-inspect-1.0 I get the following error:

$ gst-inspect-1.0 --version

(gst-plugin-scanner:18471): GLib-GObject-WARNING **: 20:38:23.791: cannot register existing type 'GstInterpolationMethod'

(gst-plugin-scanner:18471): GLib-GObject-CRITICAL **: 20:38:23.791: g_param_spec_enum: assertion 'G_TYPE_IS_ENUM (enum_type)' failed

(gst-plugin-scanner:18471): GLib-GObject-CRITICAL **: 20:38:23.791: validate_pspec_to_install: assertion 'G_IS_PARAM_SPEC (pspec)' failed

(gst-plugin-scanner:18471): GLib-GObject-WARNING **: 20:38:23.822: cannot register existing type 'GstVideoAggregator'

(gst-plugin-scanner:18471): GLib-GObject-WARNING **: 20:38:23.822: cannot add private field to invalid (non-instantiatable) type '<invalid>'

(gst-plugin-scanner:18471): GLib-CRITICAL **: 20:38:23.822: g_once_init_leave: assertion 'result != 0' failed

(gst-plugin-scanner:18471): GLib-GObject-CRITICAL **: 20:38:23.822: g_type_register_static: assertion 'parent_type > 0' failed

(gst-plugin-scanner:18471): GLib-GObject-WARNING **: 20:38:23.822: cannot add private field to invalid (non-instantiatable) type '<invalid>'

(gst-plugin-scanner:18471): GLib-CRITICAL **: 20:38:23.822: g_once_init_leave: assertion 'result != 0' failed

(gst-plugin-scanner:18471): GLib-GObject-CRITICAL **: 20:38:23.822: g_type_register_static: assertion 'parent_type > 0' failed

(gst-plugin-scanner:18471): GLib-GObject-WARNING **: 20:38:23.823: cannot add private field to invalid (non-instantiatable) type '<invalid>'

(gst-plugin-scanner:18471): GLib-CRITICAL **: 20:38:23.823: g_once_init_leave: assertion 'result != 0' failed

(gst-plugin-scanner:18471): GLib-GObject-CRITICAL **: 20:38:23.823: g_type_register_static: assertion 'parent_type > 0' failed

(gst-plugin-scanner:18471): GLib-GObject-CRITICAL **: 20:38:23.823: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(gst-plugin-scanner:18471): GLib-CRITICAL **: 20:38:23.823: g_once_init_leave: assertion 'result != 0' failed

(gst-plugin-scanner:18471): GStreamer-CRITICAL **: 20:38:23.823: gst_element_register: assertion 'g_type_is_a (type, GST_TYPE_ELEMENT)' failed

This is clearly an issue with the linker not finding the correct libs for GstInterpolationMethod and GstVideoAggregator. However when I check the paths of the linked libraries, using:

ldd /home/ubuntu/gst_1.16.2/out/bin/gst-inspect-1.0

I get the correct paths:

linux-vdso.so.1 (0x0000007f7c5d0000)
	libgtk3-nocsd.so.0 => /usr/lib/aarch64-linux-gnu/libgtk3-nocsd.so.0 (0x0000007f7c526000)
	libgstreamer-1.0.so.0 => /home/ubuntu/gst_1.16.2/out/lib/libgstreamer-1.0.so.0 (0x0000007f7c3f1000)
	libgobject-2.0.so.0 => /usr/lib/aarch64-linux-gnu/libgobject-2.0.so.0 (0x0000007f7c393000)
	libglib-2.0.so.0 => /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0 (0x0000007f7c285000)
	libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000007f7c259000)
	libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000007f7c100000)
	/lib/ld-linux-aarch64.so.1 (0x0000007f7c5a5000)
	libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000007f7c0eb000)
	libgmodule-2.0.so.0 => /usr/lib/aarch64-linux-gnu/libgmodule-2.0.so.0 (0x0000007f7c0d7000)
	libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000007f7c01d000)
	libffi.so.6 => /usr/lib/aarch64-linux-gnu/libffi.so.6 (0x0000007f7c005000)
	libpcre.so.3 => /lib/aarch64-linux-gnu/libpcre.so.3 (0x0000007f7bf93000)

What am I missing here? Any help is much appreciated.

Hi,
Please clean the cache and check if the issue is still there:

$ rm .cache/gstreamer-1.0/registry.aarch64.bin

We develop certain plugins to enable hardware acceleration. The plugins are built with ver1.14.5. If there is significant deviation between 1.14.5 and 1.16.2, it is possible to hit the issue. One thin we can try is to clean the cache, which is stored for 1.14.5 and also possibly triggers this issue.

Thanks for your reply. I tried this command earlier and it gives the same issue.

Is there something else I can try?

I also am getting the same issue on a fresh flash of TX2 using 4.2.3, I was previously able to build and use gst-1.16.2 on 4.2.1-2.

By default the gstreamer version is 1.14.5 and we have performed tests on this release. Would suggest use default version for better stability.

Hi drewqm96r,
I have seen your sharing:

but the comment seems to be removed. Do the steps resolve the issue?

No, I spoke too soon. After further investigation, the issue seems to be with the gst_plugin_scanner that runs during the first execution of gst-inspect-1.0. So here’s my workaround for this issue until I have more time for more exploration:
Run in Terminal:

gst-inspect-1.0

This will hang as per usual. Go to the System Monitor app -> find the gst_plugin_scanner process -> end/kill the process.

This will allow gstreamer to run normally.

As to the cause, it seems to be a couple plugins that didn’t install properly.

gst-inspect-1.0 -b

The flag -b will list only blacklisted plugins. In my case the blacklisted plugins are specific to Vulkan and OpenGL. I will continue to try to figure out how to build these properly or remove them as they are not necessary for my use cases.

After some research, I found 2 blacklisted plugins in my gstreamer registry cache by running gst-inspect-1.0 -b. I removed the .so and .la files for these plugins from the 1.16.2 library and now i no longer have the hanging issue.

DaneLL:
The gst-install script seems to think OpenGL and Vulkan are both available and enabled as buildable plugins (libgstopengl and libgstvulkan). I found the following file in the gst-1.16.2 output directory, it appears to be the configuration file for GST_GL.

~/gst-1.16.2/lib/aarch64-linux-gnu/gstreamer-1.0/include/gst/gl$ cat gstglconfig.h 
/* gstglconfig.h
 *
 * This is a generated file.  Please modify `configure.ac'
 */

#ifndef __GST_GL_CONFIG_H__
#define __GST_GL_CONFIG_H__

#include <gst/gst.h>

G_BEGIN_DECLS


#define GST_GL_HAVE_OPENGL 1
#define GST_GL_HAVE_GLES2 1
#define GST_GL_HAVE_GLES3 1
#define GST_GL_HAVE_GLES3EXT3_H 1

#define GST_GL_HAVE_WINDOW_X11 1
#define GST_GL_HAVE_WINDOW_COCOA 0
#define GST_GL_HAVE_WINDOW_WIN32 0
#define GST_GL_HAVE_WINDOW_WAYLAND 0
#define GST_GL_HAVE_WINDOW_ANDROID 0
#define GST_GL_HAVE_WINDOW_DISPMANX 0
#define GST_GL_HAVE_WINDOW_EAGL 0
#define GST_GL_HAVE_WINDOW_VIV_FB 0
#define GST_GL_HAVE_WINDOW_GBM 0

#define GST_GL_HAVE_PLATFORM_EGL 1
#define GST_GL_HAVE_PLATFORM_GLX 1
#define GST_GL_HAVE_PLATFORM_WGL 0
#define GST_GL_HAVE_PLATFORM_CGL 0
#define GST_GL_HAVE_PLATFORM_EAGL 0

#define GST_GL_HAVE_DMABUF 1
#define GST_GL_HAVE_VIV_DIRECTVIV 0

#define GST_GL_HAVE_GLEGLIMAGEOES 1
#define GST_GL_HAVE_GLCHAR 1
#define GST_GL_HAVE_GLSIZEIPTR 1
#define GST_GL_HAVE_GLINTPTR 1
#define GST_GL_HAVE_GLSYNC 1
#define GST_GL_HAVE_GLUINT64 1
#define GST_GL_HAVE_GLINT64 1
#define GST_GL_HAVE_EGLATTRIB 1
#define GST_GL_HAVE_EGLUINT64KHR 1


G_END_DECLS

#endif  /* __GST_GL_CONFIG_H__ */

I found the same file in /usr/lib/aarch64-linux-gnu/gstreamer-1.0/include/gst/gl, it seems to be different than the other one, any thoughts why these 2 files would be different for the same hardware?? (Notice OPEN_GL value is 0 in this file…)

/usr/lib/aarch64-linux-gnu/gstreamer-1.0/include/gst/gl$ cat gstglconfig.h 
/* gstglconfig.h
 *
 * This is a generated file.  Please modify `configure.ac'
 */

#ifndef __GST_GL_CONFIG_H__
#define __GST_GL_CONFIG_H__

#include <gst/gst.h>

G_BEGIN_DECLS


#define GST_GL_HAVE_OPENGL 0
#define GST_GL_HAVE_GLES2 1
#define GST_GL_HAVE_GLES3 1
#define GST_GL_HAVE_GLES3EXT3_H 1

#define GST_GL_HAVE_WINDOW_X11 1
#define GST_GL_HAVE_WINDOW_COCOA 0
#define GST_GL_HAVE_WINDOW_WIN32 0
#define GST_GL_HAVE_WINDOW_WAYLAND 1
#define GST_GL_HAVE_WINDOW_ANDROID 0
#define GST_GL_HAVE_WINDOW_DISPMANX 0
#define GST_GL_HAVE_WINDOW_EAGL 0
#define GST_GL_HAVE_WINDOW_VIV_FB 0
#define GST_GL_HAVE_WINDOW_GBM 1

#define GST_GL_HAVE_PLATFORM_EGL 1
#define GST_GL_HAVE_PLATFORM_GLX 0
#define GST_GL_HAVE_PLATFORM_WGL 0
#define GST_GL_HAVE_PLATFORM_CGL 0
#define GST_GL_HAVE_PLATFORM_EAGL 0

#define GST_GL_HAVE_DMABUF 1
#define GST_GL_HAVE_VIV_DIRECTVIV 0

#define GST_GL_HAVE_GLEGLIMAGEOES 1
#define GST_GL_HAVE_GLCHAR 1
#define GST_GL_HAVE_GLSIZEIPTR 1
#define GST_GL_HAVE_GLINTPTR 1
#define GST_GL_HAVE_GLSYNC 1
#define GST_GL_HAVE_GLUINT64 1
#define GST_GL_HAVE_GLINT64 1
#define GST_GL_HAVE_EGLATTRIB 1
#define GST_GL_HAVE_EGLUINT64KHR 1


G_END_DECLS

#endif  /* __GST_GL_CONFIG_H__ */

Hi,
The logic in gst-plugins-base\1.14.0\m4\gst-gl.m4

(skip...)
GST_GL_HAVE_OPENGL=0
GST_GL_HAVE_GLES2=0
GST_GL_HAVE_GLES3=0
GST_GL_HAVE_GLES3EXT3_H=0

if test "x$USE_OPENGL" = "xyes"; then
  GL_APIS="gl $GL_APIS"
  GST_GL_HAVE_OPENGL=1
fi
if test "x$USE_GLES2" = "xyes"; then
  GL_APIS="gles2 $GL_APIS"
  GST_GL_HAVE_GLES2=1
  if test "x$HAVE_GLES3_H" = "xyes"; then
    GST_GL_HAVE_GLES3=1
    if test "x$HAVE_GLES3EXT3_H" = "xyes"; then
      GST_GL_HAVE_GLES3EXT3_H=1
    fi
  fi
fi
(...skip)

You probably enable it whiling building 1.16.2