Difference between revisions of "NVIDIA Jetson Orin Nano/Camera Sensors Support/IMX219"

From RidgeRun Developer Connection
Jump to: navigation, search
(Created page with "The IMX219 sensor over the Raspberry Pi Camera V2.1 board is compatible with the Jetson Orin Nano and the official developer kit from NVIDIA, using a cable adapter to convert...")
 
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The IMX219 sensor over the Raspberry Pi Camera V2.1 board is compatible with the Jetson Orin Nano and the official developer kit from NVIDIA, using a cable adapter to convert the 22-pin MIPI CSI output of the camera module to the 15-pin MIPI CSI camera input of the Orin Nano. The converter can, at least, look like these ones:
+
<noinclude>
 +
{{NVIDIA Jetson Orin Nano/Head|next=|metakeywords=|metadescription=}}
 +
</noinclude>
 +
 
 +
This wiki provides information about enabling the Raspberry Pi Camera V2.1 (IMX219) driver on the Jetson Orin Nano developer kit. The information provided was tested on:
 +
<pre>
 +
* JetPack: 5.1.1
 +
* Jetson Linux: 35.3.1
 +
* One IMX219 Rapsberry Pi camera module V2.1
 +
</pre>
 +
 
 +
The Raspberry Pi Camera V2.1 camera module (IMX219) is compatible with the Jetson Orin Nano developer kit from NVIDIA. The camera module can be attached to the Orin Nano developer kit using an adapter to convert the 15-pin MIPI CSI output of the camera module to the 22-pin MIPI CSI camera input of the Orin Nano. The converter can look like the following images:
  
 
{| class="wikitable" style="margin: auto;"
 
{| class="wikitable" style="margin: auto;"
Line 6: Line 17:
 
|}
 
|}
  
There’s the possibility of this wiki will no longer apply in further JetPack releases. This wiki was made during this release of NVIDIA software for Jetson Orin Nano:
+
In order to enable the driver support, you need to run a Python script that comes with JetPack 5.1.1 under release L4T 35.3.1. The script can be executed with the following command:  
 
 
* JetPack: 5.1.1
 
* Jetson LInux: 35.3.1
 
 
 
Kind of out of the box, with a minor change, you can start capturing with one or both sensors. You may find out that if you connect the camera to the development board, the camera will be recognized by the kernel. You can check it by running the dmesg command and grepping the keyword “imx219”. You are gonna find the “bound” message for both ports (in case you have connected both cameras at the same time). But if you try to capture with any of the sensors, you will fall into an error. For example, to check the video capabilities, you can run v4l2 command:
 
 
 
<pre>
 
v4l2-ctl --all
 
</pre>
 
 
 
After running the command, the process will be stuck without showing you any kind of information. You can stop this command using ctrl+c. And for further investigation, you can check the dmesg command using:
 
 
 
<pre>
 
sudo dmesg -w
 
</pre>
 
 
 
What will you see next is the following error while you tried to capture:
 
 
 
<pre>
 
[  394.042165] bwmgr API not supported                                                                   
 
[  396.722887] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms                   
 
[  396.735648] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel             
 
[  396.745787] (NULL device *): vi_capture_control_message: NULL VI channel received                                   
 
[  396.753540] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0 
 
[  396.764228] (NULL device *): vi_capture_control_message: NULL VI channel received                                   
 
[  396.771968] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 0   
 
[  396.782756] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
 
</pre>
 
 
 
This is due to an error in the way how the device tree is being assigned for capturing purposes using the MIPI CSI lanes. The error falls into not being able to establish a connection through MIPI lanes, which is different from to established connection with the i2c which is the reason why you will not find any kind of error related to i2c during the "probe" stage while registering the driver.
 
 
 
To fix this error, you must run a Python script that comes with JetPack 5.1.1 under release L4T 35.3.1. The script can be executed using:  
 
 
 
 
<pre>
 
<pre>
 
sudo /opt/nvidia/jetson-io/jetson-io.py
 
sudo /opt/nvidia/jetson-io/jetson-io.py
 
</pre>
 
</pre>
  
Then, a menu will appear, follow these instructions to reconfigure the ports in order to let the camera start streaming data:
+
Then, a menu will appear. Follow the options below in order to enable the IMX219 support for two cameras:
  
 
<pre>
 
<pre>
Line 54: Line 32:
 
</pre>
 
</pre>
  
After the board is rebooted, try to run the v4l2 command that we give you below attached. This command will start streaming from camera port 0 (cam0). If you want to check the camera port 1 (cam1), change the video source to video1 at the end of the command. After running the command you must see the next output in your terminal window:
+
After the board is rebooted, you can try to run the following command:
 +
 
 +
<pre>
 +
v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --stream-mmap --stream-count=300 -d /dev/video0
 +
</pre>
 +
 
 +
This command will start streaming from camera port 0 (cam0). If you want to check the camera port 1 (cam1), change the video device to video1. After running the command you must see the next output in your terminal window:
 +
 
 
<pre>
 
<pre>
nvidia@ubuntu:~$ v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --stream-mmap --stream-count=300 -d /dev/video0
 
 
<<<<<<<<<<<<<<<<<<<<<<< 21.19 fps
 
<<<<<<<<<<<<<<<<<<<<<<< 21.19 fps
 
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
 
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
Line 73: Line 57:
 
</pre>
 
</pre>
  
If that's the case, congratulations! You have fixed the connection issue to the sensor board!
+
At this point you should be able to capture successfully.
 +
 
 +
 
 +
=Known issues=
 +
Before enabling the IMX219 support with the jetson-io.py tool, you may find out that if you connect the camera to the development board it will be recognized by the kernel and the driver loaded. You can verify this by running the dmesg command and grepping the keyword “imx219”. You will find the “bound” message for both ports (in case you have connected both cameras at the same time).
 +
 
 +
<pre>
 +
[  694.226388] imx708 9-001a: tegracam sensor driver:imx708_v2.0.6
 +
[  694.527906] tegra-camrtc-capture-vi tegra-capture-vi: subdev imx708 9-001a bound
 +
[  694.529755] imx708 10-001a: tegracam sensor driver:imx708_v2.0.6
 +
[  694.834263] tegra-camrtc-capture-vi tegra-capture-vi: subdev imx708 10-001a bound
 +
</pre>
 +
 
 +
Even though the driver is bound, if you try to check the video capabilities by running:
 +
 
 +
<pre>
 +
v4l2-ctl --all
 +
</pre>
 +
 
 +
The process will get stuck without showing you any kind of information (you can stop this command using ctrl+c). You will see the following error if you try to capture:
 +
 
 +
<pre>
 +
[  394.042165] bwmgr API not supported                                                                   
 +
[  396.722887] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms                   
 +
[  396.735648] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel             
 +
[  396.745787] (NULL device *): vi_capture_control_message: NULL VI channel received                                   
 +
[  396.753540] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0 
 +
[  396.764228] (NULL device *): vi_capture_control_message: NULL VI channel received                                   
 +
[  396.771968] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 0   
 +
[  396.782756] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
 +
</pre>
 +
 
 +
This is due to an error in the way the device tree is being configured. To fix this, you will need to run the jetson-io.py tool and enable the IMX219 camera support.
 +
 
 +
 
 +
<noinclude>
 +
{{NVIDIA Jetson Orin Nano/Foot||}}
 +
</noinclude>

Latest revision as of 14:47, 30 June 2023



  Index  


Nvidia-preferred-partner-badge-rgb-for-screen.png




This wiki provides information about enabling the Raspberry Pi Camera V2.1 (IMX219) driver on the Jetson Orin Nano developer kit. The information provided was tested on:

* JetPack: 5.1.1
* Jetson Linux: 35.3.1
* One IMX219 Rapsberry Pi camera module V2.1

The Raspberry Pi Camera V2.1 camera module (IMX219) is compatible with the Jetson Orin Nano developer kit from NVIDIA. The camera module can be attached to the Orin Nano developer kit using an adapter to convert the 15-pin MIPI CSI output of the camera module to the 22-pin MIPI CSI camera input of the Orin Nano. The converter can look like the following images:

Figure 1: Adapter cable Arducam 38mm 15 to 22 pin
Error creating thumbnail: Unable to save thumbnail to destination
Figure 2: Adapter module Compute Module camera adapter

In order to enable the driver support, you need to run a Python script that comes with JetPack 5.1.1 under release L4T 35.3.1. The script can be executed with the following command:

sudo /opt/nvidia/jetson-io/jetson-io.py

Then, a menu will appear. Follow the options below in order to enable the IMX219 support for two cameras:

-> Configure Jetson 24pin CSI Connector 
-> Configure for compatible hardware 
-> Camera IMX219 Dual 
-> Save pin changes 
-> Save and reboot to reconfigure pins

After the board is rebooted, you can try to run the following command:

v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --stream-mmap --stream-count=300 -d /dev/video0

This command will start streaming from camera port 0 (cam0). If you want to check the camera port 1 (cam1), change the video device to video1. After running the command you must see the next output in your terminal window:

<<<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<< 21.19 fps
<<<<<<<<<<<<<<<<<<<<< 21.19 fps

At this point you should be able to capture successfully.


Known issues

Before enabling the IMX219 support with the jetson-io.py tool, you may find out that if you connect the camera to the development board it will be recognized by the kernel and the driver loaded. You can verify this by running the dmesg command and grepping the keyword “imx219”. You will find the “bound” message for both ports (in case you have connected both cameras at the same time).

[  694.226388] imx708 9-001a: tegracam sensor driver:imx708_v2.0.6
[  694.527906] tegra-camrtc-capture-vi tegra-capture-vi: subdev imx708 9-001a bound
[  694.529755] imx708 10-001a: tegracam sensor driver:imx708_v2.0.6
[  694.834263] tegra-camrtc-capture-vi tegra-capture-vi: subdev imx708 10-001a bound

Even though the driver is bound, if you try to check the video capabilities by running:

v4l2-ctl --all

The process will get stuck without showing you any kind of information (you can stop this command using ctrl+c). You will see the following error if you try to capture:

[  394.042165] bwmgr API not supported                                                                    
[  396.722887] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms                    
[  396.735648] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel               
[  396.745787] (NULL device *): vi_capture_control_message: NULL VI channel received                                    
[  396.753540] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0   
[  396.764228] (NULL device *): vi_capture_control_message: NULL VI channel received                                    
[  396.771968] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 0    
[  396.782756] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel 

This is due to an error in the way the device tree is being configured. To fix this, you will need to run the jetson-io.py tool and enable the IMX219 camera support.



  Index