你好,我在配置我的yuv mipi相机遇到了问题,请帮我看看,谢谢。
使用的SDK是r32.7.2 的,相机是 1280*1024 30fps yuv422输出的,如下是报错日志和我的设备树。
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1280,height=1024,pixelformat=YUYV --stream-mmap --stream-count=300
dmesg 输出
trace 日志
trace.txt (4.9 MB)
我想知道如何配置 YUYV8_2X8 模式, 看驱动似乎只支持 YUYV8_1X16
hello Towe_Roll,
please see-also similar discussion threads,
such as… Topic 291161, Topic 252803 for reference.
Hello JerrChang, 我使用JETSON NX 套件上的这个mipi接口 , tegra_sinterface = “serial_a”; 对吗
hello Towe_Roll,
that’s correct, its’ tegra_sinterface = "serial_a"
of using CSI-0.
please also note that, on Orin NX, CSI0 D1 and CSI1 D0 P/N will always been swizzled for P/N.
please use device tree property, lane_polarity
to configure a polarity swap on any lane.
you may see-also reference driver,
for instance, $public_sources/kernel_src/hardware/nvidia/t23x/nv-public/overlay/tegra234-camera-rbpcv2-imx219.dtsi
Hello JerryChang,
1、我使用的底板是Jetson NX,应该不需要设置lane_polarity吧? 这是我的硬件设计
2、我的设备树是参考的你所说的文件的,但遇到了上述的问题,一直提示mipicsi2 接收数据错误
hello Towe_Roll,
you’re right, you don’t need lane_polarity
since you’re working with Xavier NX.
please see-also Topic 318537 to dig into discarding frame error report by VI engine.
Hello JerryChang,
我的err_data 是 10485856 ,但是我在源码中没有找到对应的错误代码

hello Towe_Roll,
it looks like CRC/ECC failure, please refer to Topic 196126 for the code snippet to disable CRC/ECC check.
Hello, JerryChang
我看了你推荐的文章也尝试了但对我没有用,我在看trace时注意到一个信息

CHANSEL_NOMATCH
, 这是格式不匹配的问题吗,我发现我已经设置了YUYV8_2X8
,看也设置进去了,
但是当我获取图像失败之后再去查看他又变回了YUYV8_1X16
, 是否跟这有关系呢,要如何修改这个问题
hello Towe_Roll,
please share the steps how you update kernel image and device tree blob.
Hello JerryChang,
i change here Linux_for_Tegra/source/public/kernel/nvidia/drivers/media/platform/tegra/camera/camera_common.c
and
make ARCH=arm64 O=$TEGRA_KERNEL_OUT -j4
sudo ./flash.sh jetson-xavier-nx-devkit mmcblk0p1
hello Towe_Roll,
please have a quick testing by removing YUYV8_1X16 since you’re not using that.
besides, make
commands should create kernel image, Image
, you may using ssh
to copy it to the target, and overwrite with /boot/Image
for updating your kernel image.
hello , JerryChang
when i delete it, why ?
hello Towe_Roll,
v4l2 standard control… --list-formats-ext
option is actually check the sensor driver side to dump the support format types.
device tree settings is passive, you should revise the settings to match your sensor output format types.
please see-also VI driver,
i.e. $public_sources/kernel_src/kernel/nvidia/drivers/media/platform/tegra/camera/sensor_common.c
here’s conversion from device tree properties as v4l formats,
for instance, mode_type
+ pixel_phase
+ csi_pixel_bit_depth
.
static int extract_pixel_format(
const char *pixel_t, u32 *format)
{
...
else if (strncmp(pixel_t, "yuv_yuyv16", size) == 0)
*format = V4L2_PIX_FMT_YUYV;
else if (strncmp(pixel_t, "yuv_yvyu16", size) == 0)
*format = V4L2_PIX_FMT_YVYU;
else if (strncmp(pixel_t, "yuv_uyvy16", size) == 0)
*format = V4L2_PIX_FMT_UYVY;
else if (strncmp(pixel_t, "yuv_vyuy16", size) == 0)
*format = V4L2_PIX_FMT_VYUY;
Hello JerryChang,
请问这些错误代码是什么意思,我现在有时候可以获取到图像了,但用着用着又会失败,这个截图前面的错误码是刚开机的时候抓图失败打印的,后面的错误码是在抓图成功后又失败了打印的。
hello Towe_Roll,
as you may know, discarding frame it’s due to unsuccessful capture state, it’s VI dropping frames and issue a requeue for new buffers.
sine it’s failure intermittently, you may dig into the driver for checking stream stability.
Hello JerryChang,
我现在能抓取到图像了,但是还有一个问题,取出来的图像排列顺序跟我机器本身出来的不一样,我的机器是 yuyv422的数据,但是通过jetson抓取得到的数据是uyvy422的,这很奇怪,我用其他平台来获取mipi数据都是按照yuyv422来排列的
hello Towe_Roll,
may I know what’s your software capture pipeline?
just an FYI,
if you’re using gstreamer, YUYV is referred as YUY2
.
for instance,
$ gst-launch-1.0 v4l2src device=/dev/video2 ! video/x-raw,width=1920,height=1080,format=YUY2,framerate=30/1 ! xvimagesink