MIPI CSI Virtual Channel Configuration Issue for Multiple Cameras on Nvidia Jetson Orin Nano
Issue Overview
Users are experiencing difficulties when attempting to capture video data from multiple cameras (up to 4) using MIPI CSI virtual channels on the Nvidia Jetson Orin Nano platform. The system works correctly with one or two cameras, but fails when three or four cameras are connected. The specific symptoms include:
- Successful operation with one or two cameras
- Failure to obtain video data from two cameras when three or four are connected
- Error messages indicating a channel selection mismatch (CHANSEL_NOMATCH)
- Initial suspicion of pixel clock and data format mismatches
Possible Causes
-
Insufficient System Resources: The platform may struggle to handle the bandwidth required for multiple high-resolution cameras simultaneously.
-
MIPI CSI Configuration Errors: Incorrect settings in the device tree for virtual channels, port indices, or other MIPI CSI parameters.
-
Clock Rate Limitations: Inadequate clock rates for VI, NVCSI, or ISP components when handling multiple camera streams.
-
Data Format Mismatch: Discrepancies between the expected and actual data formats being transmitted by the cameras.
-
MIPI Clock Speed Issues: Excessively high MIPI clock speeds leading to signal integrity problems.
Troubleshooting Steps, Solutions & Fixes
-
Adjust MIPI Clock Speed:
- Reduce the MIPI clock speed from 2.5G to 2.4G. This solution has been reported to resolve the issue for some users.
-
Increase System Clocks:
- Boost the VI, NVCSI, and ISP clocks to their maximum rates:
sudo su echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked echo 1 > /sys/kernel/debug/bpmp/debug/clk/isp/mrq_rate_locked echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/vi/rate cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/isp/rate cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
-
Verify Data Format:
- Ensure that the cameras are configured to send RAW12 format as expected by the system. Check the camera configuration and the device tree settings.
-
Adjust Pixel Clock:
- If increasing system clocks doesn’t help, try modifying the
pix_clk_hz
value in the device tree. For example, increase it from 300000000 to 400000000.
- If increasing system clocks doesn’t help, try modifying the
-
Review Device Tree Configuration:
- Double-check the device tree configuration for each camera, ensuring that:
- Virtual channel IDs (
vc-id
) are correctly assigned - Port indices are unique and properly set
- CSI lanes and bus widths are accurately configured
- Virtual channel IDs (
- Double-check the device tree configuration for each camera, ensuring that:
-
Gradual Testing:
- Test the system incrementally, adding one camera at a time to isolate the point of failure.
-
Monitor System Resources:
- Use system monitoring tools to check CPU, memory, and I/O usage when running multiple cameras to identify potential bottlenecks.
-
Update Firmware and Drivers:
- Ensure that you are using the latest firmware for the Jetson Orin Nano and the most recent camera drivers.
-
Check Physical Connections:
- Verify that all MIPI CSI connections are secure and that the cables are not damaged or too long, which could cause signal degradation.
If the issue persists after trying these solutions, consider reaching out to Nvidia support or consulting with the camera manufacturer for further assistance. Additionally, sharing detailed logs and the complete device tree configuration may help in identifying more specific issues.