Issue Title: Gstreamer and v4l2 do not work when running two cameras concurrently at the same DPHY
Issue Overview
Users are experiencing issues when attempting to run two cameras simultaneously on the Nvidia Jetson Orin Nano Dev board. Specifically, the problem occurs when trying to use Gstreamer or v4l2 to capture video from two cameras connected to the same DPHY (Digital Physical Layer). The second camera fails to initialize properly, resulting in no video output from that device.
Key observations:
- The issue occurs with both Gstreamer and v4l2 capture methods
- The first camera initializes and streams video successfully
- The second camera fails to produce any video output
- Error messages indicate a timeout in the capture process for the second camera
Possible Causes
-
Resource contention: The DPHY may not be able to handle two cameras simultaneously due to bandwidth limitations or hardware constraints.
-
Driver issues: There could be a bug in the camera driver or the V4L2 subsystem when handling multiple cameras on the same DPHY.
-
Firmware limitations: The current firmware may not properly support dual camera operation on a single DPHY.
-
Configuration errors: The device tree or other system configurations may not be set up correctly for dual camera operation.
-
Timing issues: There could be synchronization problems when initializing two cameras in quick succession.
Troubleshooting Steps, Solutions & Fixes
-
Verify hardware setup:
- Ensure both cameras are properly connected and powered
- Check that the cameras are compatible with simultaneous operation on the same DPHY
-
Update software and firmware:
- Update the Jetson Linux package to the latest version
- Check for and apply any available firmware updates for the camera modules
-
Modify device tree:
- Review the device tree configuration to ensure it properly supports dual camera operation
- Adjust MIPI CSI lane assignments if necessary
-
Adjust camera initialization sequence:
- Try adding a delay between initializing the first and second camera
- Experiment with different ordering of camera initialization
-
Enable verbose logging:
- Enable debug logging for the V4L2 subsystem:
echo 0x1f > /sys/class/video4linux/video0/dev_debug echo 0x1f > /sys/class/video4linux/video1/dev_debug
- Enable additional kernel logging for the VI (Video Input) driver:
cd /sys/kernel/debug/dynamic_debug/ echo file vi.c +p > control echo file capture-vi.c +p > control echo file vi5_fops.c +p > control echo file vi4_fops.c +p > control
- Analyze logs for specific error messages or timing issues
- Enable debug logging for the V4L2 subsystem:
-
Test with different capture methods:
- Try using nvarguscamerasrc instead of v4l2src in Gstreamer pipelines
- Test with simple v4l2-ctl commands to isolate the issue:
v4l2-ctl -d /dev/video0 --set-ctrl bypass_mode=0 --stream-mmap --set-fmt-video=width=1920,height=1200,pixelformat=BA10 --verbose v4l2-ctl -d /dev/video1 --set-ctrl bypass_mode=0 --stream-mmap --set-fmt-video=width=1920,height=1200,pixelformat=BA10 --verbose
-
Investigate NVCSI configuration:
- Check NVCSI stream configuration in the logs
- Verify that both cameras are assigned unique stream IDs and CSI ports
-
Adjust capture timeout:
- If possible, increase the capture timeout value (currently 2500ms) in the driver to see if it resolves the issue
-
Check for IRQ conflicts:
- Review system logs for any IRQ-related errors that might indicate conflicts between the two camera devices
-
Consult Nvidia developer resources:
- Search the Nvidia developer forums for similar issues
- Consider reaching out to Nvidia support for guidance on dual camera configurations
If the issue persists after trying these steps, it may be necessary to involve Nvidia support or consider alternative hardware configurations that don’t require two cameras on the same DPHY.