ReComputer J4011 - Dual Camera Issues - Cannot stream from CAM1/J12

I am working on a project using a J4011 that requires dual cameras to be used at the same time. I intend to use Gstreamer initially.

I have run into a weird issue: To test the connectivity to the cameras, I run the following command:

gst-launch-1.0 nvarguscamerasrc sensor-id=0  ! "video/x-raw(memory:NVMM), width=1640, height=1232, framerate=30/1, format=NV12"  ! nvvidconv flip-method=2  ! "video/x-raw(memory:NVMM), width=640, height=480"  ! nvegltransform  ! nveglglessink

The weird thing is that sensor-id=0 correlates with the CAM1 CSI port on the dev board and sensor-id=1 to the CAM0 CSI port.
But the main problem is that it will NOT stream from CAM1 port. CAM0 works fine with either camera.

Terminal feedback from CAM0 that works just fine with either camera attached:

user@jetson-nx:~$ gst-launch-1.0 nvarguscamerasrc sensor-id=1  ! "video/x-raw(memory:NVMM), width=1640, height=1232, framerate=30/1, format=NV12"  ! nvvidconv flip-method=2  ! "video/x-raw(memory:NVMM), width=640, height=480"  ! nvegltransform  ! nveglglessink
Setting pipeline to PAUSED ...

Using winsys: x11 
Pipeline is live and does not need PREROLL ...
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
Setting pipeline to PLAYING ...
New clock: GstSystemClock
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3280 x 2464 FR = 21.000000 fps Duration = 47619048 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3280 x 1848 FR = 28.000001 fps Duration = 35714284 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1640 x 1232 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
   Camera index = 1 
   Camera mode  = 3 
   Output Stream W = 1640 H = 1232 
   seconds to Run    = 0 
   Frame Rate = 29.999999 
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
WARNING: from element /GstPipeline:pipeline0/GstEglGlesSink:eglglessink0: Pipeline construction is invalid, please add queues.
Additional debug info:
gstbasesink.c(1209): gst_base_sink_query_latency (): /GstPipeline:pipeline0/GstEglGlesSink:eglglessink0:
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.
WARNING: from element /GstPipeline:pipeline0/GstEglGlesSink:eglglessink0: A lot of buffers are being dropped.
Additional debug info:
gstbasesink.c(3003): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstEglGlesSink:eglglessink0:
There may be a timestamping problem, or this computer is too slow.
ERROR: from element /GstPipeline:pipeline0/GstEglGlesSink:eglglessink0: Output window was closed
Additional debug info:
/dvs/git/dirty/git-master_linux/3rdparty/gst/gst-nveglglessink/ext/eglgles/gsteglglessink.c(910): gst_eglglessink_event_thread (): /GstPipeline:pipeline0/GstEglGlesSink:eglglessink0
Execution ended after 0:00:10.248499744
Setting pipeline to NULL ...
GST_ARGUS: Cleaning up
CONSUMER: Done Success
GST_ARGUS: Done Success
Freeing pipeline ...

Terminal feedback from the not-working CAM1 port:

user@jetson-nx:~$ gst-launch-1.0 nvarguscamerasrc sensor-id=0  ! "video/x-raw(memory:NVMM), width=1640, height=1232, framerate=30/1, format=NV12"  ! nvvidconv flip-method=2  ! "video/x-raw(memory:NVMM), width=640, height=480"  ! nvegltransform  ! nveglglessink
Setting pipeline to PAUSED ...

Using winsys: x11 
Pipeline is live and does not need PREROLL ...
Got context from element 'eglglessink0': gst.egl.EGLDisplay=context, display=(GstEGLDisplay)NULL;
Setting pipeline to PLAYING ...
New clock: GstSystemClock
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3280 x 2464 FR = 21.000000 fps Duration = 47619048 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3280 x 1848 FR = 28.000001 fps Duration = 35714284 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1640 x 1232 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
   Camera index = 0 
   Camera mode  = 3 
   Output Stream W = 1640 H = 1232 
   seconds to Run    = 0 
   Frame Rate = 29.999999 
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:694 NvBufSurfaceFromFd Failed.
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadFunction:247 (propagating)
WARNING: from element /GstPipeline:pipeline0/GstEglGlesSink:eglglessink0: Pipeline construction is invalid, please add queues.
Additional debug info:
gstbasesink.c(1209): gst_base_sink_query_latency (): /GstPipeline:pipeline0/GstEglGlesSink:eglglessink0:
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.
Got EOS from element "pipeline0".
Execution ended after 0:00:04.036094304
Setting pipeline to NULL ...
GST_ARGUS: Cleaning up
X connection to :0 broken (explicit kill or server shutdown).
(Argus) Error InvalidState: Argus client is exiting with 2 outstanding client threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 366)
WARNING Argus: 6 client objects still exist during shutdown:
	281473440514656 (0xffff68000f20)
	281473455335360 (0xffff68000cb0)
	281473455335520 (0xffff68001130)
	281473455335712 (0xffff68001020)
	281473455341392 (0xffff68002f80)
	281473455349608 (0xffff68003098)
user@jetson-nx:~$ 

Any help fixing this would be greatly appreciated.
Thanks!

HI,
If you have another session using the same camera (hang or activities) and try again using the same camera, is likely to happen; If this problem happens sometimes. You can close all sessions and reset nvargus-daemon to reset the argus framework and try nvgstcapture-1.0 again.

sudo service nvargus-daemon restart

Thanks for that tip. I was wondering how to reset it instead of having to restart the entire OS.

However this is not the case for me. Even if it is the first time being called, I still cannot use the port. I cannot find any details on the error being thrown.

I have tested different cables and cameras, that port is not working.

Seems to boil down to that nvbuf_utils error, but I haven’t been able to figure it how.

Hi,


After my test, everything is right, Did you flash the device with the included drivers?

I installed v4l-utils and ran the commands as you did:

user@jetson-nx:~$ v4l2-ctl --list-device
NVIDIA Tegra Video Input Device (platform:tegra-camrtc-ca):
	/dev/media0

vi-output, imx219 9-0010 (platform:tegra-capture-vi:1):
	/dev/video0

vi-output, imx219 10-0010 (platform:tegra-capture-vi:2):
	/dev/video1

I see both cameras (both are IMX219-based, a Pi camera v2 and a generic IMX219 off Amazon).

I will try to find anything related to the dmabuf_fd -1 mapped entry NOT found error.

I reflashed Jetpack 5.1.2 onto the board and it is working now. Something is off with the default OS installation coming from the factory.

Status Update:
I flashed the system with the guide provided by Seeed here.

It allowed both CSI ports to work correctly. However, it is missing all the libraries that normally come with JetPack, like Cuda, VPI, TensorRT etc. and they do not appear easy to actually install. So I cannot run or build jetson_inference, which I need.

I flashed again using the nVidia SDK Manager and it now has all the libraries correctly installed, so jetson_inference works. However, the CSI CAM1 stopped working again, with the same error as before.

Ideas to diagnose issue?

I found a solution:

  1. Reflash J4011 with the Seeed guidelines for the J401 board. Apparently the factory flash does not include a hotfix from that guide.
  2. Use the nVidia SDK Manager to install other libraries missing from the guide by using another Ubuntu 20 laptop.