Jetson Nano MIPI CSI issue

Hello,
I have a custom carrier board with Jetson Nano, SDK is JetPack_4.5.1, I can capture image with ADV7282m(PAL to CSI) with no kernel error/warning log, but the image is wrong, can you help me?

hello jiakai1000 ,

it looks like stride alignment issue,
please note that you should have it following VI’s 64 alignment.
thanks

I changed #define TEGRA_STRIDE_ALIGNMENT from 1 to 64 in kernel/nvidia/include/media/tegra_camera_core.h, it solved my problem.
And the question is:

  1. Why not default to 64?
  2. My sensor image width is 720, I think stride should be 768, but it’s 736 when I call ioctl(fd, VIDIOC_G_FMT).
    Thanks

hello jiakai1000 ,

width alignment might changes based on the color format. TEGRA_WIDTH_ALIGNMENT is by default configure as 1. customer should update that according to their use-case.
you may also add --set-ctrl preferred_stride=<> into your v4l pipeline to configure the stride settings.