Jetson nano second camera not working

Hi,

I have a Jetson Nano B01 and it has two CSI camera ports and the first one is working, but when I try to use the second one I am getting an error. The error is “Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:729 Invalid camera device specified 1 specified, 0 max index”. Please help. Thank you.

Best,
Arjun Bhatia

What’s your command?
What’s the v4l2-ctl --list-devices shows?

My command is
gst-launch-1.0 nvarguscamerasrc sensor_id=1 ! nvoverlaysink.

The output for v4l2-ctl --list-devices is bellow.

arjun@arjun-desktop:~/CSI-Camera$ v4l2-ctl --list-devices
vi-output, imx219 7-0010 (platform:54080000.vi:0):
/dev/video0

arjun@arjun-desktop:~/CSI-Camera$

You can’t set sensor_id=1 when your system have only one camera.

I have two cameras connected to the Jetson nano. Why would the Jetson not be able to see the second camera?

You can check the dmesg to check why the second camera driver didn’t load.

dmesg | grep -i imx219

When I did dmesg | grep -i imx219 I got no output.

When I did dmesg | grep -i imx477 it worked. Here is the output.

arjun@arjun-desktop:~$ dmesg | grep -i imx477
[ 1.320299] imx477 7-001a: tegracam sensor driver:imx477_v2.0.6
[ 1.620679] imx477 7-001a: imx477_board_setup: error during i2c read probe (-121)
[ 1.628278] imx477 7-001a: board setup failed
[ 1.632749] imx477: probe of 7-001a failed with error -121
[ 1.633111] imx477 8-001a: tegracam sensor driver:imx477_v2.0.6
[ 2.220585] vi 54080000.vi: subdev imx477 8-001a bound
arjun@arjun-desktop:~$

That’s weird! Did you use jetson-io to enable dual IMX219?

I haven’t done anything other than plug the camera in.

You need to use jetson-io to configure the cameras.

https://docs.nvidia.com/jetson/archives/r35.3.1/DeveloperGuide/text/HR/ConfiguringTheJetsonExpansionHeaders.html?highlight=jetson%20io

Hi,

I tried that but the second one isn’t showing up still. The first one is giving an error now. The error is bellow.

ERROR on bus: by /GstPipeline:capture_native_pipeline/GstBin:cap_bin/GstNvArgusCameraSrc:nvarguscamerasrc0: CANCELLED
debug info:
Argus Error Status
nvbuf_utils: Can not get HW buffer from FD… Exiting…
CONSUMER: ERROR OCCURRED
GST_ARGUS: Cleaning up
(Argus) Error EndOfFile: Unexpected error in reading socket (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 266)
(Argus) Error EndOfFile: Receive worker failure, notifying 1 waiting threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 340)
(Argus) Error InvalidState: Argus client is exiting with 1 outstanding client threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 357)
(Argus) Error EndOfFile: Receiving thread terminated with error (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadWrapper(), line 368)
(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 91)
** Message: 16:48:35.120: main:4680 Capture completed
** Message: 16:48:35.122: main:4729 Camera application will now exit
(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 91)

Please check the dmesg to confirm the driver.

Here is the output
arjun@arjun-desktop:~$ dmesg | grep -i imx477
[ 1.312143] imx477 7-001a: tegracam sensor driver:imx477_v2.0.6
[ 1.612527] imx477 7-001a: imx477_board_setup: error during i2c read probe (-121)
[ 1.620114] imx477 7-001a: board setup failed
[ 1.624583] imx477: probe of 7-001a failed with error -121
[ 1.624904] imx477 8-001a: tegracam sensor driver:imx477_v2.0.6
[ 2.212814] vi 54080000.vi: subdev imx477 8-001a bound
arjun@arjun-desktop:~$ dmesg | grep -i imx219
arjun@arjun-desktop:~$

What’s your sensors? What do you configure by jetson-io?

The cameras I have are Waveshare IMX219-160IR Camera for Jetson Nano Infrared Night Vision 3280 × 2464 Resolution 8 Megapixels 160° FOV IMX219 Sensor Suit for Face Recognition Road Mark Detection License Plate Recognition and Arducam IMX477 Autofocus and Software-Controlled Focus HQ Camera, 12MP 100° FOV Camera Module Compatible with Nvidia Jetson Nano/Xavier NX and NVIDIA Orin NX/AGX Orin, M12 Lens. The IMX219 is working but the IMX477 isn’t. In jetson-io I configured it to IMX219 and IMX477 but it still didn’t work.

Here are the product links.

Could remove imx219 and configure by dul-imx477 by jetson-io to check both camera port form imx477 only.

Also confirm if R8 was removed or not.

I think R8 was removed. I don’t see the R8 anywhere. I am still getting the error if I go dual imx477. The error is below.


arjun@arjun-desktop:~/CSI-Camera$ python3 simple_camera.py
nvarguscamerasrc sensor-id=0 !video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1 ! nvvidconv flip-method=0 ! video/x-raw, width=(int)960, height=(int)540, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink
nvbuf_utils: Could not get EGL display connection
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected…
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3840 x 2160 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 22.250000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 22.250000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 1
Output Stream W = 1920 H = 1080
seconds to Run = 0
Frame Rate = 59.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
nvbuf_utils: Can not get HW buffer from FD… Exiting…
CONSUMER: ERROR OCCURRED
[ WARN:0] global /home/arjun/opencv/modules/videoio/src/cap_gstreamer.cpp (1825) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module nvarguscamerasrc0 reported: CANCELLED
GST_ARGUS: Cleaning up
(Argus) Error EndOfFile: Unexpected error in reading socket (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 266)
(Argus) Error EndOfFile: Receive worker failure, notifying 1 waiting threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 340)
(Argus) Error InvalidState: Argus client is exiting with 1 outstanding client threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 357)
(Argus) Error EndOfFile: Receiving thread terminated with error (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadWrapper(), line 368)
(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 91)
(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 91)
[ WARN:0] global /home/arjun/opencv/modules/videoio/src/cap_gstreamer.cpp (914) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /home/arjun/opencv/modules/videoio/src/cap_gstreamer.cpp (501) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Error: Unable to open camera
(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 91)
arjun@arjun-desktop:~/CSI-Camera$


Not sure if it really helps, but it seems your pipeline lacks a space:

nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM),...