Jetpack 6.0 Video Index Problem
Issue Overview
Users of the Jetson Orin Nano Devkit with Jetpack 6.0 L4T 36.3 are experiencing issues related to the video index numbers assigned to camera nodes in the device tree. The problem arises when multiple cameras are connected through a custom-designed carrier board, which includes two MAX96712 chips connected via I2C at different addresses (i2c@3160000 and i2c@c250000).
The symptoms include:
- Inconsistent Video Indexing: The video index numbers (e.g., video0, video1) assigned to camera nodes do not correspond consistently to their order in the device tree.
- Loading Order Impact: The order in which camera nodes are loaded affects their assigned video indices. For instance, when the camera kernel module (ko) is manually inserted after booting, the first set of cameras is indexed as video0 through video3, while the second set is indexed as video4 through video7.
- Automatic Loading Issues: When a configuration file is added to
/etc/modules-load.d
to automatically load the camera module at boot, the indexing changes unexpectedly, leading to an entirely different mapping of camera nodes to video indices.
This inconsistency complicates backend application development and control over the camera inputs, as developers cannot predictably reference specific cameras by their video indices.
Possible Causes
Several potential reasons could lead to this issue:
-
Driver Loading Order: The order in which drivers are loaded influences the assignment of video indices. If one driver loads before another, it can shift the indexing of subsequent devices.
-
Device Tree Configuration: The way camera nodes are defined in the device tree may not provide sufficient information for consistent indexing.
-
Kernel Module Behavior: The behavior of the
tegra_vi_graph_notify_complete
function may not correctly handle or register video devices based on their device tree definitions. -
Environmental Factors: Variations in power supply or temperature may affect hardware performance but are less likely to be direct causes of this specific issue.
-
User Configuration Errors: Incorrect configurations within the device tree or module loading scripts could lead to unexpected behavior.
Troubleshooting Steps, Solutions & Fixes
To address the issue with inconsistent video indexing on the Jetson Orin Nano Devkit, users can follow these troubleshooting steps and solutions:
-
Manual Module Insertion:
- Instead of using
/etc/modules-load.d
, consider manually inserting the camera kernel module using:sudo insmod <module_name>.ko
- This allows control over the loading order.
- Instead of using
-
Modify Device Tree Entries:
- Ensure that camera nodes are defined in a way that reflects their intended order. Consider reversing the order of entries for i2c@3160000 and i2c@c250000 in your device tree configuration.
-
Edit Kernel Code for Video Registration:
- Modify the
tegra_vi_graph_notify_complete
function in your kernel source code to assign specific video numbers based on device tree properties:ret = video_register_device(chan->video, VFL_TYPE_VIDEO, <desired_video_number>);
- This requires understanding how to pass device tree information into this function.
- Modify the
-
Use Device Node Properties:
- Implement
devnode
properties in your device tree entries to explicitly define expected video indices:ov5693_a@36 { compatible = "ovti,ov5693"; reg = <0x36>; devnode = "video0"; // Assign expected devnode }
- Implement
-
Debugging with dmesg Logs:
- Monitor kernel logs for messages related to driver loading and device registration using:
dmesg | grep tegra
- This can help identify issues during module loading.
- Monitor kernel logs for messages related to driver loading and device registration using:
-
Scripted Module Loading:
- Write a script that manages module insertion and assigns video indices programmatically based on detected devices and their properties.
-
Consult Documentation and Community Resources:
- Refer to Nvidia’s documentation for Jetson platforms regarding driver development and device tree configurations.
- Engage with community forums for additional insights or shared experiences from other users facing similar issues.
-
Testing Different Configurations:
- Experiment with different hardware setups or configurations to isolate whether specific components introduce variability in indexing.
By following these steps, users should be able to diagnose and potentially resolve issues related to inconsistent video indexing on their Jetson Orin Nano Devkit setups. Further investigation may be needed if problems persist despite these efforts.