Pipeline error running two csi cameras on TX2

Two cameras are on TX2 and we created two scripts to run the cameras.

  1. In “test0.run” which enables camera0:
gst-launch-1.0 nvcamerasrc fpsRange="30.0 30.0" sensor-id=0 ! 'video/x-raw(memory:NVMM), width=(int)640, height=(int)480, format=(string)I420, framerate=(fraction)30/1' ! nvegltransform ! nveglglessink -e
  1. In “test1.run” which enables camera1: (exactly the same as the one above, except for the “sensor-id”)
gst-launch-1.0 nvcamerasrc fpsRange="30.0 30.0" sensor-id=1 ! 'video/x-raw(memory:NVMM), width=(int)640, height=(int)480, format=(string)I420, framerate=(fraction)30/1' ! nvegltransform ! nveglglessink -e

After running “test0.run”, we got a gst-launch window showing the video from the camera0 and everything went right. Until we ran “test1.run”, the gst-launch window was shutted down and some info was shown in the terminals:

  1. In the terminal running “test0.run”:
Received error from camera daemon....exiting....
Socket read error. Camera Daemon stopped functioning.....
Got EOS from element "pipeline0".
Execution ended after 0:00:06.411822332
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
  1. In the terminal running “test1.run”:
nvidia@tegra-ubuntu:~/Downloads$ ./test1.run 
Setting pipeline to PAUSED ...
Socket read error. Camera Daemon stopped functioning.....
gst_nvcamera_open() failed ret=0
ERROR: Pipeline doesn't want to pause.
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
ERROR: from element /GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.
Additional debug info:
gstbasesrc.c(3354): gst_base_src_start (): /GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0:
Failed to start
Setting pipeline to NULL ...
Caught SIGSEGV
#0  0x0000007fb4d66130 in pthread_join (threadid=548441383424, 
#1  0x0000007fb4e1ce40 in ?? () from /lib/aarch64-linux-gnu/libglib-2.0.so.0
#2  0x0000000000000011 in ?? ()
Spinning.  Please run 'gdb gst-launch-1.0 10978' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.

However, if we run the two scripts seperately (run test1.run after manually shutting down test0.run), camera1 can work just like camera0. So there’s nothing wrong with the value of “sensor-id”. And it seems that it’s not about the other following parameters since we’ve tried adding and changing the other parameters.

In addition, if we change the “sensor-id” to 2 which is not actually exist, the info is pretty much like the info above:

nvidia@tegra-ubuntu:~/Downloads$ ./test2.run 
Setting pipeline to PAUSED ...
Socket read error. Camera Daemon stopped functioning.....
gst_nvcamera_open() failed ret=0
ERROR: Pipeline doesn't want to pause.
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
ERROR: from element /GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.
Additional debug info:
gstbasesrc.c(3354): gst_base_src_start (): /GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0:
Failed to start
Setting pipeline to NULL ...
Caught SIGSEGV
#0  0x0000007f8c1f1130 in pthread_join (threadid=547758281216, 
#1  0x0000007f8c2a7e40 in ?? () from /lib/aarch64-linux-gnu/libglib-2.0.so.0
#2  0x0000000000000011 in ?? ()
Spinning.  Please run 'gdb gst-launch-1.0 11783' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.

But like I said, the two cameras can work seperately. So the causes of this error shouldn’t be the same (though they look like the same).

It’s strange cuz we’ve seen other people openning multiple cameras in this forum, but we cannot make them work using the same code. We just cannot figure it out. Does someone know where the problem is?

Thanks so much.

Please try the v4l2-ctl by two console at the same time to clarify the problem.

Hello!

Maybe you can try the capture only to check if there is something bad with your driver enabling 2 cameras at the same time:

In one terminal run:

gst-launch-1.0 nvcamerasrc fpsRange="30.0 30.0" sensor-id=0 ! 'video/x-raw(memory:NVMM), width=(int)640, height=(int)480, format=(string)I420, framerate=(fraction)30/1' ! fakesink

And in the second terminal run:

gst-launch-1.0 nvcamerasrc fpsRange="30.0 30.0" sensor-id=1 ! 'video/x-raw(memory:NVMM), width=(int)640, height=(int)480, format=(string)I420, framerate=(fraction)30/1' ! fakesink

If it works, so it means your driver and your configuration is able to enable both cameras at the same time, if not, you will need to check what’s going on. We have seen similar behaviors and the problems are related to some timing misconfiguration in the driver.

May be you can provide more information about the problem and I can help you:

  1. Are you using the EVM or a custom carrier board?
  2. What sensor are you using?
  3. What Jetpack version are you using?
  • Carlos R

Hi,
you can use the cmd as bellow to run 2 cameras
gst-launch-1.0 nvcamerasrc sensor-id=0 ! ‘video/x-raw(memory:NVMM),width=640, height=480, framerate=30/1,format=NV12’ ! nvvidconv ! ‘video/x-raw’ ! xvimagesink nvcamerasrc sensor-id=1 ! ‘video/x-raw(memory:NVMM),width=640, height=480, framerate=30/1,format=NV12’ ! nvoverlaysink overlay-w=640 overlay-h=480 overlay-x=640