Incorrecrt PAL is displayed on Orin

hi,
I try to port a “fake” nv_ov23850 driver and the relevant DT - camera-dummy.dtsi file from TX2 to Orin.
At first I got a skewed image:


as if the even field (of the PAL video) was overwritten on the first line’s last 18 pixels. When I enlarged the accepted resolution in the nv_ov23850.c file to be 1920x1080 I got a correct image but most of the image was green (empty)

Then I tried a non standard resolution (just to make sure a how the Orin copies the input video data into memory): 1400x576 and got again skewed image but with extra empty space:

Assumptions: I saw in the csi.c file that there are only 4 options for acceptable resolutions:

static struct v4l2_frmsize_discrete tegra_csi_tpg_sizes[_] = {
{320, 240},
{1280, 720},
{1920, 1080},
{3840, 2160}
};

and in the function tegra_csi_try_mbus_fmt I saw a print out which states that if the expected resolution is not available then utilize the default one: 1920x1080.

dev_err(chan->csi->dev, “use TEGRA_DEF_WIDTH x TEGRA_DEF_HEIGHT (1920x1080)\n”);

I added there some dev_err print outs but the dmesg, displayed none while I tried to play video:

gst-launch-1.0 v4l2src device=/dev/video0 ! deinterlace ! videoconvert ! xvimagesink sync=0

Though, I think that there is somewhere in the media/platform/tegra/camera code (or somewhere else) a code that imposes the default resolution.

Any suggestions?

Suppose the sensor output format is YUV? Did you modify NVCSI/VI kernel driver?
Please note the 32 alignment for the VI logic.

Thanks

hi @ShaneCCC
sensor’s output format is:

mode_type = “yuv”;
pixel_phase = “uyvy”;

by applying modification to NVCSI/VI you mean that it is desired to make some changes to the function tegra_channel_fmt_align in /usr/src/kernel/nvidia/drivers/media/platform/tegra/camera/vi/channel.c (please correct me if I’m wrong), then no I did not. I was under the impression that the TX2 and ORIN utilize the same code, should I apply any modifications to the kernel driver?

OK, no need any modification for YUV format.
Did you check by v4l2-ctl like below command?

v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=ov1080.raw -d /dev/video0 

@ShaneCCC RG10 is an invalid pixel format so I changed it:

v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=ov1080.raw -d /dev/video0

and uploaded the file.
ov1080.txt (1.6 MB) (please rename the extension to raw)

Maybe try the preferred_stride like below command.

v4l2-ctl -c preferred_stride=1024

@ShaneCCC,
thanks the stride has solved the problem.

v4l2-ctl -c preferred_stride=1920
v4l2-ctl --set-fmt-video=width=720,height=576,pixelformat=UYVY --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=frame_w_stride.raw -d /dev/video0

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