How can I capture simultaneous streams from two MIPI cameras on Orin NX 16GB?

Command :

gst-launch-1.0
nvcompositor name=comp
sink_0::xpos=0 sink_0::ypos=0 sink_0::width=640 sink_0::height=480
sink_1::xpos=640 sink_1::ypos=0 sink_1::width=640 sink_1::height=480 !
‘video/x-raw(memory:NVMM),width=1280,height=480’ !
nvvidconv ! xvimagesink
nvarguscamerasrc sensor-id=0 !
‘video/x-raw(memory:NVMM),width=640,height=480,framerate=30/1’ ! comp.sink_0
nvarguscamerasrc sensor-id=1 !
‘video/x-raw(memory:NVMM),width=640,height=480,framerate=30/1’ ! comp.sink_1

Error :

CONSUMER: Acquired Frame: 269, time sec 33 msec 743
CONSUMER: Acquired Frame: 270, time sec 33 msec 864
(Argus) Error EndOfFile: Unexpected error in reading socket (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 277)
(Argus) Error EndOfFile: Receive worker failure, notifying 1 waiting threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 350)
(Argus) Error InvalidState: Argus client is exiting with 1 outstanding client threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 366)
(Argus) Error EndOfFile: Receiving thread terminated with error (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadWrapper(), line 379)
(Argus) Error EndOfFile: Client thread received an error from socket (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 145)
(Argus) Error EndOfFile: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 92)
(Argus) Error InvalidState: Receive thread is not running cannot send. (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 96)
(Argus) Error InvalidState: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 92)
CONSUMER: Done Success
Got EOS from element “pipeline0”.
EOS received - stopping pipeline…
Execution ended after 0:00:37.024968747
Setting pipeline to NULL …
GST_ARGUS: Cleaning up
(Argus) Error InvalidState: Receive thread is not running cannot send. (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 96)
(Argus) Error InvalidState: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 92)
(Argus) Error InvalidState: Receive thread is not running cannot send. (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 96)
(Argus) Error InvalidState: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 92)
(Argus) Error InvalidState: Receive thread is not running cannot send. (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 96)
(Argus) Error InvalidState: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 92)
Caught SIGSEGV
Caught SIGSEGV
#0 0x0000ffffae556800 in __GI___wait4
#1 0x0000ffffae6ee170 in g_on_error_stack_trace ()
#2 0x0000aaaae9664498 in ()
#3 0x0000ffffae9eb79c in ()
#4 0x0000ffffac9b0f58 in ()
#5 0x0000ffffacb26fa8 [PAC] in ()
#6 0x0000ffffac8d008c [PAC] in ()
#7 0x0000ffffac8d8240 in () at /lib/aarch64-linux-gnu/libgstbase-1.0.so.0
#8 0x0000ffffae8ad42c in () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#9 0x0000ffffae8adc2c in gst_pad_set_active ()
#10 0x0000ffffae89166c in () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#11 0x0000ffffae89b0f8 in gst_iterator_fold ()
#12 0x0000ffffae90fb1c in () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#13 0x0000ffffae88ed58 in () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#14 0x0000ffffae89185c in () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#15 0x0000ffffac8d8408 in () at /lib/aarch64-linux-gnu/libgstbase-1.0.so.0
#16 0x0000ffffae890be8 in gst_element_change_state ()
#17 0x0000ffffae891374 in () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#18 0x0000ffffae86678c in () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#19 0x0000ffffae8c0950 in () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#20 0x0000ffffae890be8 in gst_element_change_state ()
#21 0x0000ffffae890cf4 in gst_element_change_state ()
#22 0x0000ffffae891374 in () at /lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#23 0x0000aaaae9663ee0 in ()
#24 0x0000ffffae4c73fc in __libc_start_call_main
#25 0x0000ffffae4c74cc in __libc_start_main_impl
#26 0x0000aaaae96642f0 in _start ()
Spinning. Please run ‘gdb gst-launch-1.0 37094’ to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.
Spinning. Please run ‘gdb gst-launch-1.0 37094’ to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.

I connected two MIPI cameras to the Orin NX 16GB module. I aim to capture simultaneous streams from both cameras, but when I run the command above, I get this error.

1 Like

*** Please note that this reply is generated by LLM automatically ***

The error message you’re encountering suggests that there’s an issue with the Argus API, which is used by the nvarguscamerasrc plugin in your GStreamer pipeline. The error messages indicate that there’s a problem with the receive thread, which is responsible for receiving data from the camera.

Here are a few potential causes and solutions:

  1. Camera configuration: Make sure that both cameras are properly configured and recognized by the system. You can use the v4l2-ctl command to verify that the cameras are detected and configured correctly.
  2. Sensor ID: Ensure that the sensor-id property is set correctly for each camera. In your pipeline, you’re using sensor-id=0 and sensor-id=1, which is correct if you have two cameras connected.
  3. Resolution and framerate: Verify that the resolution and framerate settings are correct for each camera. In your pipeline, you’re setting the resolution to 640x480 and the framerate to 30/1 for both cameras.
  4. Pipeline configuration: Check that the pipeline is configured correctly. You’re using the nvcompositor element to composite the two camera feeds, which is correct. However, you may want to try using a different compositor or adjusting the compositor settings to see if that resolves the issue.
  5. GStreamer version: Ensure that you’re using the latest version of GStreamer. You can check the version by running gst-launch-1.0 --version.
  6. Argus API version: Verify that you’re using the latest version of the Argus API. You can check the version by running argus_version.
  7. System resources: Make sure that the system has sufficient resources (e.g., memory, CPU) to handle the two camera feeds.

To troubleshoot the issue, you can try the following:

  1. Run the pipeline with a single camera feed to see if the issue persists.
  2. Use a different compositor or adjust the compositor settings to see if that resolves the issue.
  3. Try using a different resolution or framerate setting for one or both cameras.
  4. Run the pipeline with the GST_DEBUG environment variable set to 3 to enable debug logging.
  5. Use a tool like gst-debug-viewer to visualize the pipeline and identify any issues.

Here’s an updated pipeline that you can try:

gst-launch-1.0 nvcompositor name=comp sink_0::xpos=0 sink_0::ypos=0 sink_0::width=640 sink_0::height=480 sink_1::xpos=640 sink_1::ypos=0 sink_1::width=640 sink_1::height=480 ! 'video/x-raw(memory:NVMM)' ! queue ! nv3dsink nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM), width=(int)640, height=(int)480, format=(string)NV12, framerate=30/1' ! comp. nvarguscamerasrc sensor-id=1 ! 'video/x-raw(memory:NVMM), width=(int)640, height=(int)480, format=(string)NV12, framerate=30/1' ! comp.

This pipeline uses the same settings as your original pipeline, but with a few minor adjustments. You can try adjusting the resolution, framerate, or compositor settings to see if that resolves the issue.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***