JetPack 6.1 + (IMX219) + Jetson Orin NX + nvcompositor segfaults

We are unable to get nvcompositor working on jetpack 6.1.

gst-launch-1.0   nvcompositor name=comp !   'video/x-raw(memory:NVMM),width=(int)1280,height=(int)720,framerate=60/1,format=(string)RGBA' !   fakesink   nvarguscamerasrc sensor-id=0 !   'video/x-raw(memory:NVMM),width=(int)1280,height=(int)720,framerate=60/1,format=(string)NV12' !   nvvidconv !   'video/x-raw(memory:NVMM),width=(int)1280,height=(int)720,framerate=60/1,format=(string)RGBA' !   comp.sink_0


Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
GST_ARGUS: Creating output stream
Redistribute latency...
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3280 x 2464 FR = 21.000000 fps Duration = 47619048 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3280 x 1848 FR = 28.000001 fps Duration = 35714284 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1640 x 1232 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
   Camera index = 0
   Camera mode  = 4
   Output Stream W = 1280 H = 720
   seconds to Run    = 0
   Frame Rate = 59.999999
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadExecute:734 NvBufSurfaceFromFd Failed.
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadFunction:245 (propagating)
Got EOS from element "pipeline0".
Execution ended after 0:00:04.078024553
Setting pipeline to NULL ...
GST_ARGUS: Cleaning up
GST_ARGUS: Done Success
Freeing pipeline ...

Additionally running:

 gst-launch-1.0 nvarguscamerasrc sensor-id=1 ! nvcompositor ! nvvidconv ! fakesink

results in a segfault somewhere in nvcompositor:

(gdb) backtrace
#0  0x0000fffff59163d4 in  () at /usr/lib/aarch64-linux-gnu/nvidia/libnvbufsurftransform.so.1.0.0
#1  0x0000fffff591bcb0 [PAC] in  () at /usr/lib/aarch64-linux-gnu/nvidia/libnvbufsurftransform.so.1.0.0
#2  0x0000ffffed7e50e0 [PAC] in  () at /home/otiv-host/nvidia/libs/libgstnvcompositor.so
#3  0x0000fffff6fd722c [PAC] in gst_video_aggregator_aggregate () at /home/otiv-host/github/gstreamer/builddir/subprojects/gst-plugins-base/gst-libs/gst/video/libgstvideo-1.0.so.0
#4  0x0000fffff70cf21c in gst_aggregator_aggregate_func () at /home/otiv-host/github/gstreamer/builddir/subprojects/gstreamer/libs/gst/base/libgstbase-1.0.so.0
#5  0x0000fffff7f169ec in gst_task_func () at /home/otiv-host/github/gstreamer/builddir/subprojects/gstreamer/gst/libgstreamer-1.0.so.0
#6  0x0000fffff7d57668 in  () at /lib/aarch64-linux-gnu/libglib-2.0.so.0
#7  0x0000fffff7d54990 in  () at /lib/aarch64-linux-gnu/libglib-2.0.so.0
#8  0x0000fffff7b1d5c8 in start_thread (arg=0x0) at ./nptl/pthread_create.c:442
#9  0x0000fffff7b85edc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:79

Additionally running our actual production pipeline throws the following error:

0:00:00.851260960  1770 0xaaaad5492d20 WARN         videoaggregator gstvideoaggregator.c:1150:gst_video_aggregator_find_best_format:<nvcompositor0> Nothing compatible with video/x-raw(memory:NVMM), format=(string)RGBA, width=(int)1280, height=(int)1080, framerate=(fraction)15/1, pixel-aspect-ratio=(fraction)[ 1/2147483647, 2147483647/1 ]; video/x-raw(memory:NVMM), format=(string)RGBA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)15/1, pixel-aspect-ratio=(fraction)[ 1/2147483647, 2147483647/1 ]
0:00:00.851346112  1770 0xaaaad5492d20 WARN            nvcompositor gstnvcompositor.c:826:gst_nvcompositor_fixate_caps:<nvcompositor0> This pad is invalid
0:00:00.851363040  1770 0xaaaad5492d20 WARN            nvcompositor gstnvcompositor.c:826:gst_nvcompositor_fixate_caps:<nvcompositor0> This pad is invalid
0:00:00.851371712  1770 0xaaaad5492d20 WARN            nvcompositor gstnvcompositor.c:826:gst_nvcompositor_fixate_caps:<nvcompositor0> This pad is invalid
0:00:00.851510144  1770 0xaaaad5492c00 FIXME               basesink gstbasesink.c:3399:gst_base_sink_default_event:<appsink0> stream-start event without group-id. Consider implementing group-id handling in the upstream elements

There seems to be something going wrong with the conversion from NV12 to RGBA? But I’m not able to pinpoint it.
The following works just fine:

 GST_DEBUG=3 gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! nvvidconv ! fakesink

Does below command working?

gst-launch-1.0 -v nvarguscamerasrc ! 'video/x-raw(memory:NVMM),width=2592,height=1944' ! nvvidconv ! fakesink -v

Yes it does

Replace the attached libs to try.

libnvargus.so.36.4 (1.3 MB)
libnvargus_socketserver.so.36.4 (2.6 MB)

 gst-launch-1.0 nvarguscamerasrc sensor-id=1 ! nvcompositor ! nvvidconv ! fakesink

results in the same segfault

I run below command without problem.

Sorry for my late response, That gst-launch pipeline works, but nvcompositor should be able to handle nv12 as an input format? The gst-launch is only a basic representation of what we’re using in production. After more investigation we we’re able to get at least a basic version working, but it is still very unstable. E.g. The pipeline periodically fails on incorrect caps, sometimes one of the connected cameras is not connecting at all, changing the framerate requires a restart of the device (also for your gst-launch example).
Are there any plans to address these issues?

Hi, as this has been unresponsive for a while now. Is Are there any plans to improve the jp6.1/36.4 release?

Looks like nvcompositor don’t support NV12.
You may need have nvvidconv to convert in the pipeline before the nvcompositor like below.

gst-launch-1.0 nvarguscamerasrc sensor-id=1 ! nvvidconv ! nvcompositor ! fakesink

Do you mean the capabilities of the nvcompositor element are incorrect?

I mean need pixel format convert before send the buffer to nvcompositor.

Thanks