[Jetpac-5.1.5] Error launching dual cameras with Gstreamer

Dear Forum,

I have been able to stream dual IMX296 cameras in Jetpack-5.1.2 with 100% stability. However, I migrated to Jetpack-5.1.5 and facing the following error when trying to show dual cameras in a single Gstreamer windows as below :

$ gst-launch-1.0 nvcompositor name=nvcomp sink_0::xpos=0 sink_0::ypos=0 sink_0::width=1280 sink_0::height=720 sink_1::xpos=1280 sink_1::ypos=0 sink_1::width=1280 ! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)I420', width=2560, height=720 ! nv3dsink nvarguscamerasrc sensor_id=1 sensor-mode=1 ! 'video/x-raw(memory:NVMM), width=1280, height=720, format=(string)NV12, framerate=(fraction)30/1' ! nvvidconv flip-method=2 ! nvcomp.sink_0 nvarguscamerasrc sensor_id=0 sensor-mode=1 ! 'video/x-raw(memory:NVMM), width=1280, height=720, format=(string)NV12, framerate=(fraction)30/1' ! nvvidconv flip-method=2 ! nvcomp.sink_1
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
GST_ARGUS: Creating output stream
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 1456 x 1088 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 251.188705; Exposure Range min 28000, max 660000000;

GST_ARGUS: 1280 x 720 FR = 90.000001 fps Duration = 11111111 ; Analog Gain range min 1.000000, max 251.188705; Exposure Range min 28000, max 660000000;

GST_ARGUS: 728 x 544 FR = 120.999997 fps Duration = 8264463 ; Analog Gain range min 1.000000, max 251.188705; Exposure Range min 28000, max 660000000;

GST_ARGUS: Running with following settings:
   Camera index = 0 
   Camera mode  = 1 
   Output Stream W = 1280 H = 720 
   seconds to Run    = 0 
   Frame Rate = 90.000001 
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 1456 x 1088 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 251.188705; Exposure Range min 28000, max 660000000;

GST_ARGUS: 1280 x 720 FR = 90.000001 fps Duration = 11111111 ; Analog Gain range min 1.000000, max 251.188705; Exposure Range min 28000, max 660000000;

CONSUMER: Producer has connected; continuing.
GST_ARGUS: 728 x 544 FR = 120.999997 fps Duration = 8264463 ; Analog Gain range min 1.000000, max 251.188705; Exposure Range min 28000, max 660000000;

GST_ARGUS: Running with following settings:
   Camera index = 1 
   Camera mode  = 1 
   Output Stream W = 1280 H = 720 
   seconds to Run    = 0 
   Frame Rate = 90.000001 
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
Redistribute latency...
WARNING: from element /GstPipeline:pipeline0/GstNv3dSink:nv3dsink0: Pipeline construction is invalid, please add queues.
Additional debug info:
gstbasesink.c(1209): gst_base_sink_query_latency (): /GstPipeline:pipeline0/GstNv3dSink:nv3dsink0:
Not enough buffering available for  the processing deadline of 0:00:00.015000000, add enough queues to buffer  0:00:00.015000000 additional data. Shortening processing latency to 0:00:00.000000000.
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadExecute:723 NvBufSurfaceFromFd Failed.
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadFunction:242 (propagating)
CONSUMER: ERROR OCCURRED
ERROR: from element /GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc1: UNAVAILABLE
Additional debug info:
Argus Error Status
Execution ended after 0:00:16.070009165
Setting pipeline to NULL ...
GST_ARGUS: Cleaning up
GST_ARGUS: Done Success

The issue also happens while streaming dual cameras over network after a couple of retries, especially if there was a delayabout > 3 seconds btw re-launching Gstreamer command :

$ gst-launch-1.0 nvcompositor name=comp sink_0::xpos=0 sink_0::ypos=0 sink_0::width=1280 sink_0::height=720 sink_1::xpos=1280 sink_1::ypos=0 sink_1::width=1280 sink_1::height=720 ! "video/x-raw(memory:NVMM), width=2560, height=720, framerate=30/1" ! nvvidconv ! nvv4l2h264enc bitrate=8000000 insert-sps-pps=true ! rtph264pay mtu=1400 ! udpsink host=192.168.1.5 port=5000 sync=false async=false nvarguscamerasrc name=camsrc0 sensor_id=0 sensor_mode=1 ! "video/x-raw(memory:NVMM),width=1280, height=720, framerate=30/1, format=NV12" ! nvvidconv flip-method=0 ! "video/x-raw(memory:NVMM), width=1280, height=720" ! comp. nvarguscamerasrc name=camsrc1 sensor_id=1 sensor_mode=1 ! "video/x-raw(memory:NVMM),width=1280, height=720, framerate=30/1, format=NV12" ! nvvidconv flip-method=0 ! "video/x-raw(memory:NVMM), width=1280, height=720" ! comp.
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE 
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
GST_ARGUS: Creating output stream
Redistribute latency...
NvMMLiteOpen : Block : BlockType = 4 
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4 
Redistribute latency...
H264: Profile = 66, Level = 0 
NVMEDIA: Need to set EMC bandwidth : 846000 
NvVideo: bBlitMode is set to TRUE 
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 1456 x 1088 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 251.188705; Exposure Range min 28000, max 660000000;

GST_ARGUS: 1280 x 720 FR = 90.000001 fps Duration = 11111111 ; Analog Gain range min 1.000000, max 251.188705; Exposure Range min 28000, max 660000000;

GST_ARGUS: 728 x 544 FR = 120.999997 fps Duration = 8264463 ; Analog Gain range min 1.000000, max 251.188705; Exposure Range min 28000, max 660000000;

GST_ARGUS: Running with following settings:
   Camera index = 0 
   Camera mode  = 1 
   Output Stream W = 1280 H = 720 
   seconds to Run    = 0 
   Frame Rate = 90.000001 
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
GST_ARGUS: Available Sensor modes :
CONSUMER: Producer has connected; continuing.
GST_ARGUS: 1456 x 1088 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 251.188705; Exposure Range min 28000, max 660000000;

GST_ARGUS: 1280 x 720 FR = 90.000001 fps Duration = 11111111 ; Analog Gain range min 1.000000, max 251.188705; Exposure Range min 28000, max 660000000;

GST_ARGUS: 728 x 544 FR = 120.999997 fps Duration = 8264463 ; Analog Gain range min 1.000000, max 251.188705; Exposure Range min 28000, max 660000000;

GST_ARGUS: Running with following settings:
   Camera index = 1 
   Camera mode  = 1 
   Output Stream W = 1280 H = 720 
   seconds to Run    = 0 
   Frame Rate = 90.000001 
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:723 NvBufSurfaceFromFd Failed.
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadFunction:242 (propagating)

If I stopped and started the streaming immediately, the above error seems NOT to happen.

Re-starting the argus daemon did not help. And sometime the system hangs.

Have you ever experienced this?

Best Regards,
Khang

1 Like

Hello @khang.l4es,

A couple of questions:

  1. Do you see any errors on dmesg or over UART while trying camera capture?

  2. Are you able to capture from both cameras independently?

  3. You mentioned that if you restart the camera immediately, the error seems to stop. Does this mean that if you restart camera capture the cameras work as expected over an undetermined period of time ?

best regards,
Andrew
Embedded Software Engineer at ProventusNova

Could you confirm by two session to launch two cameras without nvcompositor.

Thanks

Hi @ShaneCCC ,

I suppose that the driver of IMX296 needs to be updated for being used with the Jetpack-5.1.5 (I was thinking that it should be straight-forward to move from Jetpack-5.1.2 to Jetpack-5.1.5, however) as I could not reproduce the issue with another camera sensor of which driver is more recent (I ported it back to Jetpack-5.1.5 from Jetpack-6.2).