Nvarguscamerasrc + GMSL - dmabuf_fd

Hello Everyone,

We are facing similar issue to the thread mentioned below. We are getting this issue whenever we use 2 cameras[GMSL] simultaneously using gstreamer with nvarguscamerasrc.

nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
Error generated. gstnvarguscamerasrc.cpp, threadExecute:694 NvBufSurfaceFromFd Failed.
Error generated. gstnvarguscamerasrc.cpp, threadFunction:247 (propagating)

JP 5.1.2
Nvidia AGX Orin

Command that we used:

gst-launch-1.0 nvcompositor name=nvcomp sink_0::xpos=0 sink_0::ypos=0 sink_0::width=1920 sink_0::height=1080 sink_1::xpos=1920 sink_1::ypos=0 sink_1::width=1920 ! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)I420', width=3840, height=1080 ! nv3dsink nvarguscamerasrc sensor_id=0 acquire-wait=10000000000 sensor-mode=3 ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=(string)NV12, framerate=(fraction)30/1' ! nvvidconv ! nvcomp.sink_0 nvarguscamerasrc  acquire-wait=10000000000 sensor_id=1 sensor-mode=1 ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=(string)NV12, framerate=(fraction)30/1' ! nvvidconv ! nvcomp.sink_1

Continuing the discussion from Argus stability on Orin NX:

Did you confirm v4l2-ctl capture two cameras simultaneously?

Yes, it captures two cameras. I checked it using command shown below.

v4l2-ctl --stream-mmap --stream-count=100 --set-ctrl frame_rate=30000000 -d /dev/video0 & \
v4l2-ctl --stream-mmap --stream-count=100 --set-ctrl frame_rate=30000000 -d /dev/video1 &

I spent some time on this, and i figured it out, that the command used below is not working. I got the same error “nvbuf_utils: dmabuf_fd -1 mapped entry NOT found”

gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! queue ! nv3dsink & \
gst-launch-1.0 nvarguscamerasrc sensor_id=1 ! queue ! nv3dsink &

But when I open use these commands separately in different terminals, it is working fine.

#CONSOLE 1
gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! queue ! nv3dsink 
#CONSOLE 2
gst-launch-1.0 nvarguscamerasrc sensor_id=1 ! queue ! nv3dsink 

TEMPORARY SOLUTION:
I added an delay in sources of gst argus plugin (gstnvarguscamerasrc.cpp), and voila la, my first command is working without any error. It seems that there is a problem with some shared resources, which cannot be accessed at the same time.(?)

gst-launch-1.0 nvcompositor name=nvcomp sink_0::xpos=0 sink_0::ypos=0 sink_0::width=1920 sink_0::height=1080 sink_1::xpos=1920 sink_1::ypos=0 sink_1::width=1920 ! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)I420', width=3840, height=1080 ! nv3dsink nvarguscamerasrc sensor_id=0 acquire-wait=10000000000 sensor-mode=3 ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=(string)NV12, framerate=(fraction)30/1' ! nvvidconv ! nvcomp.sink_0 nvarguscamerasrc  acquire-wait=10000000000 sensor_id=1 sensor-mode=1 ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=(string)NV12, framerate=(fraction)30/1' ! nvvidconv ! nvcomp.sink_1

Adding delay here, helps me as well.

gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! queue ! nv3dsink & \
sleep 2 && gst-launch-1.0 nvarguscamerasrc sensor_id=1 ! queue ! nv3dsink &

Suppose you can increase below timeout in gstnvarguscamerasrc.cpp for your case.

static const uint64_t DEFAULT_WAIT_FOR_EVENT_TIMEOUT = 3000000000;
static const uint64_t DEFAULT_ACQUIRE_FRAME_TIMEOUT = 5000000000;

1 Like

It also fixes the issue. Thank you

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.