# MIPI Camera port 1 of Xavier NX does not work

Hi,
I use Arducam IMX219 autofocus cameras on Xavier NX. When I connect one camera to MIPI camera port 0, it works fine. I can use following command to view live image:

$gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! nvoverlaysink I can also use “Focuser(10).set(Focuser.OPT_FOCUS, value)” to adjust its focus. But when I connect this camera to MIPI camera port 1 (leave MIPI camera port 0 empty), this command do not work:$ gst-launch-1.0 nvarguscamerasrc sensor_id=1 ! nvoverlaysink

There is no image display, and got errors as below:

Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:561 Invalid camera device specified 1 specified, 0 max index
Got EOS from element “pipeline0”.

While I tried to change the sensor_id to 0, with this command:

$gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! nvoverlaysink It shows up live image (actually this sensor id does not match with the camera port number), but I cannot change camera focus by this command “Focuser(9).set(Focuser.OPT_FOCUS, value)”: When I connect 2 cameras to both MIPI camera ports, I can only view live image of camera 0, and cannot adjust the focus of both cameras. Can anybody help on this issue? Thanks. hello cydu, had you apply kernel patches from Arducam team? please also confirm with them you’re working with device tree binary with dual IMX219 camera support. thanks Hi Jerry: I check with Arducam team. Below is their response: My questions to Arducam: When I connect one IMX219 autofocus camera to Jetson Xavier NX, whether to camera port 0 or camera port 1, the supplied sensor_id must C:\Users\wong\AppData\Roaming\Foxmail7\Temp-7652-20210210103828\be 0. Namely, if connecting camera to Port 0, I can use “$ gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! nvoverlaysink” to get it work (this is correct); but if connecting camera to Port 1, this command “$gst-launch-1.0 nvarguscamerasrc sensor_id=1 ! nvoverlaysink” does not work, I have to use “$ gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! nvoverlaysink” again to get the camera work.

When I connect two cameras to NX, this command “$gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! nvoverlaysink” makes camera of Port 1 working, while “$ gst-launch-1.0 nvarguscamerasrc sensor_id=1 ! nvoverlaysink” makes camera of Port 0 working.

Where one or two cameras are used, in order to adjust the camera focus, the I2C bus # must be 10 for the camera of Port 0 and 9 for the camera of Port 1.

Above situations make us confused, and also make the programming very complex.

Response from Arducam:
“When I connect an IMX219 autofocus camera to Jetson Xavier NX, whether it is camera port 0 or camera port 1, the sensor_id provided must be 0. That is, if the camera is connected to port 0, I can use " gst- launch-1.0 nvarguscamerasrc sensor_id = 0! Nvoverlaysink" to make it work (this is correct); but if the camera is connected to port 1, this command " gst-launch-1.0 nvarguscamerasrc sensor_id = 1! Nvoverlaysink” does not work, I have to use “$gst-launch- 1.0 nvarguscamerasrc sensor_id = 0! nvoverlaysink” to make the camera work normally again. " This is a problem with the NVIDIA driver. Sensor_id=1 is only useful when both interfaces have cameras. Otherwise, no matter which interface is connected, sensor_id=0, but the I2C channel will not change. When I connect two cameras to NX, this command “$ gst-launch-1.0 nvarguscamerasrc sensor_id=0! Nvoverlaysink” makes camera of Port 1 working, while “$gst-launch-1.0 nvarguscamerasrc sensor_id=1! Nvoverlaysink” makes camera of Port 0 working." On NX, the label on the interface is the opposite of the actual one. This is also a problem with NVIDIA, because we did not modify the IMX219 driver and device tree. When programming, you can follow the following principles: 1. The I2C bus of the interface is determined and it will not be changed. 2. You can use sensor_id=1 to identify the camera on the second camera interface only when two cameras exist at the same time. Jerry, can you please help clarify if Arducam’s response is correct? Sorry, something wrong with my question. It should be: My questions to Arducam: When I connect one IMX219 autofocus camera to Jetson Xavier NX, whether to camera port 0 or camera port 1, the supplied sensor_id must be 0. Namely, if connecting camera to Port 0, I can use “$ gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! nvoverlaysink” to get it work (this is correct); but if connecting camera to Port 1, this command “$gst-launch-1.0 nvarguscamerasrc sensor_id=1 ! nvoverlaysink” does not work, I have to use “$ gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! nvoverlaysink” again to get the camera work.

hello cydu,

yes, it’s the position property in the DT to register the orders of camera modules; when you specify sensor_id=0 , it’ll load the 1st driver registered camera for streaming.
for example, in the dual camera system, the 1st defined as rear, and 2nd camera defined as front

please also refer to Sensor Software Driver Programming Guide, you may check the position property description for reference,
thanks