Can’t stream with V4L2 without overriding nvcsi clock

Issue Overview

Users are experiencing issues with streaming images from the VD16GZ sensor on the Nvidia Jetson Orin Nano Developer Kit. The primary symptoms include:

  • Error Messages: Users receive logs indicating various errors such as "uncorr_err: request timed out after 2500 ms" and "VI channel not found for stream."

  • Context of the Problem: The issue arises when attempting to stream images without first executing specific commands to override the nvcsi clock. Streaming works only after running these commands:

    echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked
    cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
    
  • Hardware and Software Specifications: The setup includes:

    • Orin Nano Developer Kit
    • Camera carrier board from ST
    • Custom board for connection
    • Jetpack version 5.1.1
    • The camera streams RAW10 frames at a resolution of 1124×1364 over two D-PHY lanes at a rate of 1.022 Gbps per lane.
  • Frequency of the Issue: This problem occurs consistently when the commands are not executed prior to streaming.

  • Impact on User Experience: The requirement to manually adjust the nvcsi clock rate introduces complexity and hinders seamless operation, affecting overall functionality and user experience.

Possible Causes

Several potential causes have been identified for this issue:

  • Incorrect Device Tree Settings: Misconfiguration in the device tree, particularly related to pixel clock settings, may lead to improper functioning.

  • Driver Issues: There may be bugs or limitations in the driver that do not handle the sensor’s requirements correctly.

  • Configuration Errors: The pix_clk_hz property in the device tree must be set correctly; any discrepancies can lead to issues with streaming.

  • Signal Integrity Problems: Factors such as trace length and routing may affect signal integrity, causing streaming failures.

  • User Errors or Misconfigurations: Incorrect values or settings by users can lead to these streaming problems.

Troubleshooting Steps, Solutions & Fixes

To address the streaming issue with V4L2 on the Nvidia Jetson Orin Nano, follow these troubleshooting steps:

  1. Verify Device Tree Settings:

    • Ensure that pix_clk_hz is correctly set in your device tree. It should match the sensor’s reported pixel clock:
      pix_clk_hz = "160800000";
      
  2. Test Higher Pixel Clock Values:

    • Temporarily increase pix_clk_hz to see if it resolves the issue:
      • For example, try values like 180800000 or 200000000 as they have shown improved results in some cases.
  3. Check Signal Integrity:

    • Review signal routing as per Table 10-4 in the Jetson Orin NX Series Design Guide.
    • Consider probing the CSI lines to measure hardware signaling and ensure there are no physical connection issues.
  4. Run Diagnostic Commands:

    • Use terminal commands to gather relevant system information and check current clock rates:
      cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate
      
  5. Modify Driver Code (if necessary):

    • If comfortable, review and modify driver code related to pixel clock handling based on insights from community discussions. For example, check how pix_clk_hz is read and utilized in:
      err = read_property_u64(node, "pix_clk_hz", &val64);
      
  6. Consult Documentation and Community Resources:

    • Refer to relevant Nvidia documentation for driver updates or firmware upgrades that may address known issues.
  7. Best Practices for Future Prevention:

    • Document any successful configurations for future reference.
    • Regularly check for updates from Nvidia regarding Jetpack and driver support.
  8. Unresolved Aspects:

    • Further investigation may be needed into whether forcing maximum clock rates has side effects on exposure settings or overall performance in production environments.

By following these steps, users can diagnose and potentially resolve issues related to streaming with V4L2 on their Nvidia Jetson Orin Nano Developer Kit.

Similar Posts

Leave a Reply

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