Error in capturing the image via Xavier NX

Hello everybody,
We have developed a driver for a camera module on the Jetson Nano board and successfully received the image without any issues. Now, we have prepared the same driver with the necessary changes to the DTS (Device Tree Source) for the Xavier NX board but are encountering the following errors:
[ 677.038338] tegra194-vi5 15c10000.vi: corr_err: discarding frame 4349, flags: 0, err_data 512
[ 677.058106] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 32, err_data 548
[ 677.078076] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 32, err_data 548
[ 677.098078] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 160, err_data 548

Jetpack 4.6.4
resolution 640x512@50, 1280x512@50
I have added these

  {
  MEDIA_BUS_FMT_SRGGB8_1X8,
  V4L2_COLORSPACE_SRGB,
  V4L2_PIX_FMT_SRGGB8,
  },

to "camera_common.c"

and these

else if (strncmp(pixel_t, bayer_rggb8, size) == 0)
*format = V4L2_PIX_FMT_SRGGB8;

to "sensor_common.c"

I used this in the DTS:

mode_type = bayer;
pixel_phase = rggb;
pixel_t = bayer_rggb8;
csi_pixel_bit_depth = 8;

The dmesg logs and trace output have also been attached for further analysis.

dmesg.txt (65.2 KB)
trace.txt (133.9 KB)

I have also tested resolutions from 630x512 to 650x512.

hello royayeazadi,

is it the same L4T software release version? just moving driver from Jetson Nano to Xavier NX?
please see-also Camera Sensor Drivers Porting to review your sensor driver.

yes, it is the same L4T software release version.

My driver works correctly on the jetson Nano and it is the same L4T software release version.

hello royayeazadi,

you may double check device tree property settings since Jetson Nano (t210 series) and Xavier NX (t194 series) they’re using different VI drivers.
for instance, Jetson Nano: vi2_fops.c, Xavier NX: vi5_fops.c

What are these different device tree property settings?

hello royayeazadi,

please try increasing pix_clk_hz, you must be set pixel clock correctly to avoid potential issues.

I have changed this parameter, but it did not have any effect.
The value of pix_clk_hz for 640x512 with embedded_metadata_height equal to 1 is what? The frame rate is also 50, and line_length is 640.

hello royayeazadi,

please refer to Sensor Pixel Clock to examine the clock rate.
besides, here’s another example to check CSI date rate via sensor output,
for instance, 4K(3840x2160),90-fps,10-bit. CSI data-rate = 3840 * 2160 * 10 * 90 * 1.15 ~= 8.584 Gbps

I calculated the pix_clk_hz value using the formula below, and the result was the same as before.
640 * 512 * 8 * 50 = 131072000

hello royayeazadi,

FYI,
here’s PHY interrupts, class:GLOBAL type:PHY_INTR0 phy:2 cil:0 st:0 vc:0 status:0x00000001
the error code 0x01 means LP sequence error has detected on clock lane.

normally, we need to have a pair of CHANSEL_PXL_SOF/CHANSEL_PXL_EOF to indicate a good frame has captured by VI.
although there’re CHANSEL_PXL_SOF to indicate start-of-frame has received by VI engine.
there’re CHANSEL_FAULT and CHANSEL_NOMATCH failures has reported.

according to CHANSEL_FAULT = 0x200, it as pixel short line interrupt, which means a line ends with fewer pixels than expected.
here’re couple of questions…
(1) may I know what’s your active region height? is it 512 or 511?
(2) how many lines of embedded metadata line has output by this camera sensor?

Thanks for reply
Active height is 512
And embedded Metadata line is 1.

How can I find out the meaning of these error codes?
My issue has not been resolved yet.

hello royayeazadi,

unfortunately, we did not release public documentation to explain those error codes.

is it possible to narrow down the issue?
for instance,
(1) please refer to developer guide, Verifying the V4L2 Sensor Driver.
(2) do you have oscilloscope to examine sensor signaling on the CSI channel?
(3) please also share your sensor device tree for cross check.

hello JerryChang,
Thanks for your reply,
Unfortunately, I don’t have oscilloscope.
dts.txt (4.4 KB)
v4l2-compliance.txt (2.6 KB)

hello royayeazadi,

please check below,
(1) please review sensor spec, is it a correct line_length, i.e. line_length = "2200";?

(2) please review your csi_chan0 port definition,
could you please also disassembler the dtb file into text file for checking,
for instance, $ dtc -I dtb -O dts -o output.txt tegra194-xxx.dtb

Thank you for your response.
(1) Could this value cause issues since I had set the same value for the Jetson Nano?
(2) dts.txt (234.9 KB)

This is the output of the following command: media-ctl.txt (939 Bytes)
$sudo media-ctl -p -d /dev/media0

hello royayeazadi,

it could be, since Xavier (t194 series) is more critical on device tree property settings than Nano (t210 series).


besides, VI did not support RGB888 memory formats due to it’ll add luminance format.
please running $ v4l2-ctl -d /dev/video0 --list-formats-ext to examine the format dumps,

it should be AB24 since it’ll add luminance format.
hence, please give it another try with below to fetch the sensor stream.
for instance, $ v4l2-ctl -d /dev/video0 --set-fmt-video=width=640,height=512,pixelformat=AB24 --stream-mmap --stream-count=10