Gstreamer no element "glstereomix"

Hello,

I’m playing with gstreamer and displaying video from one source as stereoscopic video. I’m trying to do it with this element https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-glstereomix.html but I’m getting error

WARNING: erroneous pipeline: no element "glstereomix"

Pipeline is just edited example:

gst-launch-1.0 nvarguscamerasrc name=left nvarguscamerasrc name=right glstereomix name=mix left. ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' ! glupload ! mix. right. ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' ! glupload ! mix. mix. ! 'video/x-raw(memory:GLMemory), multiview-mode=side-by-side' ! queue ! glimagesink output-multiview-mode=side-by-side

I don’t know what am I missing or what could be wrong because it seems that OpenGL is installed on the devkit and nothing from I found helped. I tried those installations (beside others) but situation is the same:

sudo apt-get install libglew-dev glew-utils
sudo apt-get install git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev
sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev
sudo apt-get install mesa-utils-extra

Output from gst-inspect for “gl”:

$ gst-inspect-1.0 | grep gl
libav:  avmux_singlejpeg: libav JPEG single image muxer
libav:  avdec_vp9: libav Google VP9 decoder
libav:  avdec_jpegls: libav JPEG-LS decoder
libav:  avenc_jpegls: libav JPEG-LS encoder
nvegltransform:  nvegltransform: NvEGLTransform
replaygain:  rglimiter: ReplayGain limiter
nveglstreamsrc:  nveglstreamsrc: nVidia EGL Stream
nveglglessink:  nveglglessink: EGL/GLES vout Sink
taglib:  apev2mux: TagLib-based APEv2 Muxer
taglib:  id3v2mux: TagLib-based ID3v2 Muxer

It seems to me that there aren’t any libraries from OpenGL. What could be missing? Or do I have to use different element for this case? Thank you

Edit: gstreamer was installed exactly as the guide says.

The only suggestion I can make is to be sure the NVIDIA version of libGLX.so is still installed. To see if the NVIDIA drivers are correct run this command:

sha1sum -c /etc/nv_tegra_release

On rare occasions there is an update which might replace one of the two libGLX.so files with an invalid version for this hardware (if it turns out you have one valid version and one invalid version, then simply copy the good one to the bad location and run the sha1sum again to see if it is fixed).

If what @Linuxdev proposed shows all ok, probably you’d just need to install package gstreamer1.0-plugins-bad that embeds this plugin:

sudo apt-get update
sudo apt-get install gstreamer1.0-plugins-bad

This is output, I guess that version is right?

$ sha1sum -c /etc/nv_tegra_release
/usr/lib/aarch64-linux-gnu/tegra/libnvosd.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvgov_camera.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvmmlite_image.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvomx.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvgov_force.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvmedia.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvmmlite_utils.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libglx.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvexif.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvrm_gpu.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvtx_helper.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvargus_socketserver.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvscf.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvfnetstorehdfx.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvmm_parser.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvrm.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvmm_contentpipe.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvdla_utils.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvgov_gpucompute.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvgov_tbc.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvos.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvtnr.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvgov_graphics.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvimp.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvfnet.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvphs.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvavp.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvcapture.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvmmlite_video.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvfnetstoredefog.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvgov_il.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvodm_imager.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvjpeg.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvargus_socketclient.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvtvmr.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvdla_compiler.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvidia-egl-wayland.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvdc.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvgov_boot.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvgov_generic.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libtegrav4l2.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvmm.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvapputil.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvcameratools.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvcam_imageencoder.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnveglstream_camconsumer.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvmm_utils.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvomxilclient.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvwinsys.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvargus.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvgov_spincircle.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvphsd.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnveglstreamproducer.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvdla_runtime.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvll.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvrm_graphics.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvcolorutil.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvddk_2d_v2.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvtestresults.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvcamv4l2.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvcamerautils.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvcamlog.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvparser.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvddk_vic.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvdla_core.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvdla_os.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvgov_ui.so: OK
/usr/lib/aarch64-linux-gnu/tegra/libnvmmlite.so: OK
/usr/lib/aarch64-linux-gnu/libv4l/plugins/libv4l2_nvvidconv.so: OK
/usr/lib/aarch64-linux-gnu/libv4l/plugins/libv4l2_nvvideocodec.so: OK
/usr/lib/xorg/modules/drivers/nvidia_drv.so: OK
/usr/lib/xorg/modules/extensions/libglx.so: OK

I did this many times to be sure…

Ok so after long googling I found that libgstopenglmixers.so (which includes glstereomix) is blacklisted. When I reset cache and run gst-inspect, it outputs this:

(gst-plugin-scanner:25853): GStreamer-WARNING **: 12:49:07.295: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstkms.so': /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstkms.so: undefined symbol: drmModeGetFB

(gst-plugin-scanner:25853): GStreamer-WARNING **: 12:49:07.300: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstopenglmixers.so': /usr/lib/aarch64-linux-gnu/libgbm.so.1: undefined symbol: drmGetDevice2

(gst-plugin-scanner:25853): GStreamer-WARNING **: 12:49:07.322: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstopengl.so': /usr/lib/aarch64-linux-gnu/libgbm.so.1: undefined symbol: drmGetDevice2

(gst-plugin-scanner:25853): GStreamer-WARNING **: 12:49:07.363: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libcluttergst3.so': /usr/lib/aarch64-linux-gnu/libgbm.so.1: undefined symbol: drmGetDevice2

(gst-plugin-scanner:25853): GStreamer-WARNING **: 12:49:07.463: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstqmlgl.so': /usr/lib/aarch64-linux-gnu/libgbm.so.1: undefined symbol: drmGetDevice2

(gst-plugin-scanner:25853): GStreamer-WARNING **: 12:49:07.855: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstgtk.so': /usr/lib/aarch64-linux-gnu/libgbm.so.1: undefined symbol: drmGetDevice2

but I didn’t found anything helpful on this. Can you please help?

I couldn’t tell you what provides the missing symbols, but it is telling you there is a missing library (one library is trying to load another library). To see what your default linker sees:

ldconfig -p | egrep -i 'drm'

On my R31.1 Xavier there are a couple of candidates, but two candidates show from this:

libdrm_tegra.so.0 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_tegra.so.0
libdrm.so.2 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm.so.2

Note that there are symbolic links involved and so you might need to look at the link to see the full name of the actual hard file during a package search, but I see this when identifying the package for these files:

# dpkg -S /usr/lib/aarch64-linux-gnu/libdrm.so.2.4.0 
libdrm2:arm64: /usr/lib/aarch64-linux-gnu/libdrm.so.2.4.0
# dpkg -S /usr/lib/aarch64-linux-gnu/libdrm_tegra.so.0.0.0 
libdrm-tegra0:arm64: /usr/lib/aarch64-linux-gnu/libdrm_tegra.so.0.0.0

The symbols are stripped for performance, so I can’t verify which has this (if any). Do you have files libdrm.so and libdrm_tegra.so?

Yes, I have both files, my output from the ldconfig is

libva-drm.so.2 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libva-drm.so.2
	libfaad_drm.so.2 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libfaad_drm.so.2
	libdrm_tegra.so.0 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_tegra.so.0
	libdrm_tegra.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_tegra.so
	libdrm_radeon.so.1 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_radeon.so.1
	libdrm_radeon.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_radeon.so
	libdrm_nouveau.so.2 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_nouveau.so.2
	libdrm_nouveau.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_nouveau.so
	libdrm_freedreno.so.1 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_freedreno.so.1
	libdrm_freedreno.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_freedreno.so
	libdrm_amdgpu.so.1 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_amdgpu.so.1
	libdrm_amdgpu.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_amdgpu.so
	libdrm.so.2 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm.so.2
	libdrm.so.2 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/tegra/libdrm.so.2
	libdrm.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm.so

libdrm.so is symbolic link to libdrm.so.2.4.0 and libdrm_tegra.so is pointing to libdrm_tegra.so.0.0.0

I am now completely lost because for me it looks that everything is ok…

This is off topic, but it is interesting that all of these are for competing desktop video cards and could (should) be removed (“nouveau” is actually the competing open source software-only NVIDIA driver…incompatible with loading NVIDIA’s driver at the same time):

libdrm_radeon.so.1 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_radeon.so.1
libdrm_radeon.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_radeon.so
libdrm_nouveau.so.2 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_nouveau.so.2
libdrm_nouveau.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_nouveau.so
libdrm_freedreno.so.1 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_freedreno.so.1
libdrm_freedreno.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_freedreno.so
libdrm_amdgpu.so.1 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_amdgpu.so.1
libdrm_amdgpu.so (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libdrm_amdgpu.so

I couldn’t say which of those remaining files (if any) are intended to contain the missing symbols (once the symbols are stripped you can’t just examine the library to see what it has…it gets a lot more complicated at that point).

One possibility is that libraries are intended to link against particular versions, and even if the libraries you have contain some version of drmGetDevice2, then it is possible they don’t contain the version the program (or library) was compiled against. Since the sha1sum came up ok it is safe to say the software which is purely NVIDIA will be valid.

It is just a wild guess, but perhaps this is missing simply because no stereo version was implemented.

So just of I get it right - that means that it is impossible with this method produce stereoscopic records? If so, do you have idea how could I do this, please? I am asking mainly because it is one of the main features of our product…

I am speculating that stereo was not implemented…if that is the case, then it would be impossible to use stereo (at least using hardware acceleration) without adding this. Perhaps it is nothing more than adding the right version of a library.

Can someone at NVIDIA verify if stereo (and indirectly symbol drmGetDevice2) is implemented or not? If symbol drmGetDevice2 is implemented, can it be verified that the version is valid for library “usr/lib/aarch64-linux-gnu/libgbm.so.1” to link against it?

Really even guys from Nvidia don’t care?

You may try to build gstreamer from source. You may follow RidgeRun’s howto, just adjust VERSION=1.14.1 instead of 1.8.0, and in step 6, change:

cp libgstnv* <s>libnvgst*</s> libgstomx.so ~/gst_$VERSION/out/lib/gstreamer-1.0/

It may take some time for building, so you may also boost your xavier for building (nvpmodel -m0 and jetson_clocks.sh script) before, and add -j8 to make for building on all cores.
I have seen some drm problems, maybe due to some mesa packages installed, but glstereomix seems to be there.

I cannot try it now, but you may try this pipeline:

./gst-launch-1.0 -v videotestsrc pattern=ball name=left     videotestsrc name=right        glstereomix name=mix ! queue ! nveglglessink     left. ! nvvidconv  ! mix.   right. ! nvvidconv  ! mix.

Please try below steps:

nvidia@jetson-0321117079444:~$ cd /usr/lib/aarch64-linux-gnu/
nvidia@jetson-0321117079444:/usr/lib/aarch64-linux-gnu$ sudo ln -sf libdrm.so.2.4.0 libdrm.so.2
nvidia@jetson-0321117079444:~$ cd ~
nvidia@jetson-0321117079444:~$ sudo rm .cache/gstreamer-1.0/registry.aarch64.bin
nvidia@jetson-0321117079444:~$ gst-inspect-1.0 glstereomix