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

  1. Resource contention: The DPHY may not be able to handle two cameras simultaneously due to bandwidth limitations or hardware constraints.

  2. Driver issues: There could be a bug in the camera driver or the V4L2 subsystem when handling multiple cameras on the same DPHY.

  3. Firmware limitations: The current firmware may not properly support dual camera operation on a single DPHY.

  4. Configuration errors: The device tree or other system configurations may not be set up correctly for dual camera operation.

  5. Timing issues: There could be synchronization problems when initializing two cameras in quick succession.

Troubleshooting Steps, Solutions & Fixes

  1. Verify hardware setup:

    • Ensure both cameras are properly connected and powered
    • Check that the cameras are compatible with simultaneous operation on the same DPHY
  2. 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
  3. Modify device tree:

    • Review the device tree configuration to ensure it properly supports dual camera operation
    • Adjust MIPI CSI lane assignments if necessary
  4. Adjust camera initialization sequence:

    • Try adding a delay between initializing the first and second camera
    • Experiment with different ordering of camera initialization
  5. 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
  6. 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
      
  7. Investigate NVCSI configuration:

    • Check NVCSI stream configuration in the logs
    • Verify that both cameras are assigned unique stream IDs and CSI ports
  8. Adjust capture timeout:

    • If possible, increase the capture timeout value (currently 2500ms) in the driver to see if it resolves the issue
  9. Check for IRQ conflicts:

    • Review system logs for any IRQ-related errors that might indicate conflicts between the two camera devices
  10. 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.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *