Nvidia Jetson Orin Nano Camera Display Issue

Issue Overview

Users are experiencing difficulties displaying video from a camera connected to the Nvidia Jetson Orin Nano development board. The specific symptoms include:

  1. nvgstcapture failing to display video
  2. OpenCV displaying video with image quality issues
  3. Errors related to incorrect camera parameters or configuration

The issue occurs with an IMX390 camera connected via CSI (MIPI) interface, using a 4-lane configuration on the Jetson Orin Nano developer kit running JetPack 5.1.1 or 5.1.2 (R35.3.1).

Possible Causes

  1. Incorrect device tree configuration for the camera
  2. Mismatched camera interface settings (e.g., lane configuration, polarity)
  3. Software compatibility issues with the specific camera model
  4. Improper GStreamer pipeline configuration
  5. Incorrect sensor ID specification in command-line tools

Troubleshooting Steps, Solutions & Fixes

  1. Verify camera connection and detection:
    Run the following command to check detected video devices:

    ls /dev/video*
    

    Ensure that /dev/video0 and/or /dev/video1 are present.

  2. Check camera topology:
    Use the media-ctl tool to verify the camera’s connection and configuration:

    media-ctl -p /dev/media0
    

    Confirm that the IMX390 camera is properly detected and linked.

  3. Review and update device tree configuration:

    • Examine the current device tree configuration for the camera:
      dtc -I dtb -O dts -o temp.txt /boot/tegra234-p3767-0000-p3768-0000-a0.dtb
      
    • Ensure the camera is correctly defined in the cam_i2cmux section
    • Verify that the port-index and bus-width properties are set correctly for your camera configuration
    • For a 4-lane configuration, use i2c@1/cam_0@20 and set port-index = <0x02>
  4. Update tegra-camera-platform configuration:
    Modify the tegra-camera-platform section in the device tree to match your camera setup:

    tegra-camera-platform {
      compatible = "nvidia, tegra-camera-platform";
      /* ... other properties ... */
      modules {
        module0 {
          badge = "imx390_rear";
          position = "rear";
          orientation = [31 00];
          drivernode0 {
            pcl_id = "v4l2_sensor";
            devname = "imx390 9-0020";
            proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/cam_0@20";
          };
        };
      };
    };
    
  5. Use correct nvgstcapture parameters:
    When using nvgstcapture, specify the correct sensor ID and format:

    nvgstcapture-1.0 --sensor-id=0 --camsrc-sensor-mode=0 --camsrc-width=1920 --camsrc-height=1080 --camsrc-fps=30
    
  6. Try alternative GStreamer pipeline:
    If nvgstcapture doesn’t work, try a custom GStreamer pipeline:

    gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM),width=1920,height=1080,framerate=30/1,format=NV12' ! nvvidconv ! 'video/x-raw,width=960,height=540' ! nvegltransform ! nveglglessink -e
    
  7. Verify camera format and adjust OpenCV code:
    Update the OpenCV code to handle the RGGB12 format correctly:

    import cv2
    import numpy as np
    
    cap = cv2.VideoCapture("/dev/video0")
    cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc('R', 'G', '1', '2'))
    cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1920)
    cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080)
    
    while True:
        ret, frame = cap.read()
        if ret:
            # Convert RGGB12 to RGB
            rgb = cv2.cvtColor(frame, cv2.COLOR_BayerRG2RGB)
            cv2.imshow('Frame', rgb)
            if cv2.waitKey(1) & 0xFF == ord('q'):
                break
    
    cap.release()
    cv2.destroyAllWindows()
    
  8. Check for hardware compatibility:
    Refer to the Jetson Orin NX Series and Orin Nano Series Design Guide for proper CSI lane connections and polarity settings.

If the issue persists after trying these steps, consider reaching out to Nvidia developer support or the camera manufacturer for further assistance.

Similar Posts

Leave a Reply

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