Two cameras are on TX2 and we created two scripts to run the cameras.
- 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
- 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:
- 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 ...
- 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.