Jetson Xavier NX CSI-2 Frame corruption

Hi Diego,

Sorry for the late response.
My command - gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=4 ! ‘video/x-bayer,format=bggr,width=2048,height=1024’ ! filesink location=…/imgFiles/image_20230323_1679566558.bin

I am using a application where it configures the FPGA and radar settings (configurations) and issue the above command.

@shreyas.pa ,

I was checking your dtb. And I saw that your line_length is smaller than your physical_w. Can you please increase that value?
For instance, this is the active_w and line_length relation of the IMX477 from the NVIDIA sources:

active_w = "3840";
.
.
line_length = "11200";

Best,

JDiego Delgado
Embedded SW Engineer at RidgeRun
Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com/
Website: www.ridgerun.com

@shreyas.pa

If you capture the frame using something other than GStreamer, for example, a Python or C/C++ program. Do you still see the corruption? Have you validated the output of the FPGA?

Hello Diego,

I tried this but has no effect. Still seeing the same issue.

Hi @alclark ,

Yeah we have validated the FPGA. If we trigger for 10 frames, FPGA sends out these 10 frames to Jetson Xavier NX. Jetson receives these 10 frames (confirmed by probing the CSI lines) but we receive only N-2 frames in the application.
Also, we have tested with Test pattern where sequence number is added for each frame, we are receiving only from 3rd frame. First 2 frames are somewhere dropped in the VI/V4l2 driver level.

Also in the application, we will compare the received frames against V4L2_BUF_FLAG_ERROR, we see some frame corruption messages.

Thanks,
Shreyas

hello shreyas.pa,

please also dig into kernel sources. i.e. $public_sources/kernel_src/kernel/nvidia/drivers/media/platform/tegra/camera/vi/vi5_fops.c
please examine the number of buffers that’s allocated for the queue.
for example,

static int vi5_channel_setup_queue()
{
...
        *nbuffers = clamp(*nbuffers, CAPTURE_MIN_BUFFERS, CAPTURE_MAX_BUFFERS);
        ret = tegra_channel_alloc_buffer_queue(chan, *nbuffers);

Hi @JerryChang ,

I have added prints in

function,
by default 32 buffers are allocated.
And also, I have tried reducing buffers to 16/8/4 and same thing in the application.
But nothing helped.

Thank you,
Shreyas

hello shreyas.pa,

is it possible for moving to the latest Jetpack-4.6 release, i.e. JetPack 4.6.3 for confirmation?

Hi @JerryChang ,

We are planning to move to Jetpack 5.1. Whether the issue still exists here?

Thanks,
Shreyas

hello shreyas.pa,

the latest release is JetPack 5.1.1, you may refer to JetPack Archive | NVIDIA Developer as see-also.
may I also know what’s your code snippets for tracking each frames from capturing?
for example, did you check vbuf->sequence and vb->vb2_buf.timestamp for each frame and compared with user-space?

Hi @JerryChang , I will test it and update you soon.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.