Meet NvBufSurfaceFromFd Failed when driving imx577 on Orin Nano

Issue Overview

Users are experiencing a failure when attempting to capture video streams from the IMX577 camera using the Nvidia Jetson Orin Nano. The specific error encountered is related to the NvBufSurfaceFromFd function, which fails during the execution of the command nvgstcapture --sensor-id=0. This issue arises despite the camera being detected via I2C, indicating potential problems in the software configuration or hardware setup.

Symptoms

  • Error message: NvBufSurfaceFromFd Failed when executing video capture commands.
  • Successful detection of the IMX577 camera through I2C.
  • Inability to retrieve logs or results from v4l2-ctl commands.

Context

  • The issue occurs when trying to capture video streams after setting up the camera.
  • Users are running JetPack version r35.3.1, which has been noted to have issues with streaming from 4-lane cameras on CSI-C interfaces.

Hardware/Software Specifications

  • Jetson Orin Nano Developer Kit.
  • IMX577 camera connected via I2C.
  • JetPack version: r35.3.1.

Frequency and Impact

This problem appears to be consistent among multiple users attempting similar setups, significantly impacting their ability to utilize the camera for applications requiring video streaming.

Possible Causes

  1. Hardware Incompatibilities: The IMX577 may not be fully compatible with the current configuration of the Jetson Orin Nano or with JetPack r35.3.1.
  2. Software Bugs: There may be unresolved bugs in the JetPack version being used that affect camera functionality.
  3. Configuration Errors: Incorrect settings in the device tree source or camera platform configuration could lead to failures in initializing the camera properly.
  4. Driver Issues: Outdated or incompatible drivers for handling video streams from the IMX577 may cause errors during capture attempts.
  5. Environmental Factors: Power supply issues or overheating could also impact performance and functionality.
  6. User Errors: Misconfigurations in device tree settings or incorrect usage of commands can lead to these failures.

Troubleshooting Steps, Solutions & Fixes

  1. Verify Camera Functionality with V4L2 IOCTL:

    • Use the following command to check basic camera functionality:
      v4l2-ctl -d /dev/video0 --set-fmt-video=width=4056,height=3040,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100
      
    • If no output is received, further investigate device tree settings.
  2. Check Device Tree Configuration:

    • Ensure that num_csi_lanes is set correctly in your device tree source file:
      tegra-camera-platform {
          num_csi_lanes = <8>; // Adjust based on your camera setup
      };
      
  3. Enable I2C and Camera Settings:

    • Confirm that both I2C devices are enabled and correctly configured in your device tree.
  4. Boost VI/CSI/ISP Clocks:

    • Execute the following commands to boost clock rates for testing:
      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
      echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/mrq_rate_locked
      
  5. Gather Kernel Logs:

    • Run dmesg --follow in a terminal to monitor kernel logs while attempting to capture video, which can provide insight into any underlying issues.
  6. Test with Different JetPack Versions:

    • If possible, consider downgrading to an earlier stable version of JetPack (e.g., JetPack 5.x) known for better compatibility with similar setups.
  7. Consult Documentation and Forums:

    • Reference Nvidia’s developer guide on validating V4L2 drivers and check for any updates or patches related to your specific JetPack version.
  8. Isolate Hardware Issues:

    • Test with another known working camera if available, or try using a different CSI interface.
  9. Review Configuration Files:

    • Disassemble your device tree blob (DTB) file into a text file for detailed examination using:
      dtc -I dtb -O dts -o output.txt tegra234-p3767-0001-p3768-0000-a0.dtb
      
  10. Seek Community Support:

    • If unresolved, consider posting detailed logs and configurations on Nvidia forums for community assistance.

By following these steps, users should be able to diagnose and potentially resolve issues related to capturing video streams from their IMX577 cameras on the Nvidia Jetson Orin Nano platform.

Similar Posts

Leave a Reply

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