Jetson Orin NX custom UYVY camera driver streams but image is repeated vertically and corrupted

uv_znh4240mh_debug.zip (84.4 KB)

Hello NVIDIA team,

I am bringing up a custom MIPI CSI-2 camera (uv_znh4240mh) on Jetson Orin NX.

Current configuration:

  • Jetson Orin NX

  • JetPack 6.x

  • 4-lane MIPI CSI-2

  • serial_c

  • Resolution: 1920x1080

  • Format: UYVY 4:2:2

The driver probes successfully and streaming works.

V4L2 reports:

  • 1920x1080

  • UYVY

  • 60 fps

The camera node is available as /dev/video0.

Issue:

The image is corrupted during display. The frame appears repeated multiple times vertically and colored artifacts appear on the right side of the image.

No CSI timeout or frame drop errors are observed.

I have attached:

  • Screenshot of the corrupted image

  • Driver source code

  • Kernel module

  • Device Tree files

  • Runtime Device Tree dump

  • V4L2 information

  • Media topology

  • Camera kernel logs

Attached file:

uv_znh4240mh_debug.zip

Contents:

  • uv_znh4240mh.c

  • uv_znh4240mh.ko

  • tegra234-camera-uv_znh4240mh.dtsi

  • tegra234-camera-uv_znh4240mh-portC-4lane.dts

  • tegra234-camera-uv_znh4240mh-portC-4lane.pp.dts

  • tegra234-camera-uv_znh4240mh-portC-4lane.dtbo

  • Makefile

  • running_device_tree.dts

  • v4l2_all.txt

  • v4l2_formats.txt

  • media_topology.txt

  • camera_dmesg.txt

Could you please help review whether the issue may be related to:

  • line_length

  • pix_clk_hz

  • active_w / active_h

  • embedded_metadata_height

  • CSI packet format

  • UYVY data interpretation

Attached image shows:

  • Repeated image blocks vertically
  • Color artifacts on right edge
  • Streaming is active and stable

Thank you.

hello lbinh0309,

please double check the sensor settings,
such issue (Repeated image blocks vertically) may related to your device tree configuration, such as.. active_w, active_h, line_length.

the issue of color artifacts on right edge seems related to the VI’s 64-alignment,
please review your active_w settings, please padding it to 1152 for testing.

Thank you for the advice.

I will review the device tree configuration and recheck the active_w, active_h, and line_length settings. I will also test active_w = 1152 to see if it improves the color artifacts issue on the right edge.

I will perform the tests and update you with the results as soon as possible.

Thank you for your continued support.

Hi JerryChang,

Thank you for your suggestion.

I tested by changing active_w to 1152 as you recommended, but unfortunately the captured image did not change. The repeated image blocks are still present, and the right-edge artifacts also remain the same.

Regarding your suspicion about active_w, active_h, and line_length, I believe these parameters are already configured according to the camera timing specification.

The camera outputs 1920×1080 @ 60fps, therefore:

  • active_w = 1920

  • active_h = 1080

For line_length, I calculated it from the timing parameters provided by the camera vendor:

line_length = HSW + HBP + HACT + HFP
            = 44 + 148 + 1920 + 88
            = 2200

The vendor’s timing configuration is shown below:

HSW = 44
HBP = 148
HACT = 1920
HFP = 88

VSW = 5
VBP = 36
VACT = 1080
VFP = 4

Pixel Clock = 148.5 MHz

These values match my current device tree configuration:

active_w = 1920
active_h = 1080
line_length = 2200
pix_clk_hz = 148500000

Since changing active_w did not produce any difference and these timing parameters match the camera specification, I am wondering whether the issue could be related to another configuration, such as CSI receiver settings, pixel format interpretation, or VI/NvCSI configuration.

Could you please advise what else I should check?

Thank you.

I have resolved the issue. The camera is now working correctly and the captured image matches the expected output.

The problem has been fixed, and everything is now functioning as required.

Thank you for your assistance.

hello lbinh0309,

glad to know it works, if that’s possible, please share the root cause for closing this discussion thread.

Thank you for your suggestions.

I referred to the camera vendor’s Linux driver and updated my Jetson driver and device tree to match the camera timing configuration.

The main changes are:

  • Updated the supported frame format from 1920 × 1080 to 2688 × 1520 in the camera driver.
  • Updated the device tree mode0 parameters:
    • active_w = 2688
    • active_h = 1520
    • line_length = 3300
    • pix_clk_hz = 297000000
    • mclk_multiplier = 13
    • Other timing parameters were also updated according to the vendor’s reference driver.

After rebuilding the driver and device tree, the captured image is now displayed correctly. The previous issue with repeated image blocks has been resolved, and the output resolution now matches the camera’s native resolution (2688 × 1520).