Hi, I’m currently plugging a black and white mipi camera into a jetson nano.
I added support for GRAY format in struct camera_common_colorfmt,
// Grayscale 8bit support
{
MEDIA_BUS_FMT_Y8_1X8,
V4L2_COLORSPACE_RAW,
V4L2_PIX_FMT_GREY,
},
// Grayscale 10bit support
{
MEDIA_BUS_FMT_Y10_1X10,
V4L2_COLORSPACE_RAW,
V4L2_PIX_FMT_Y10,
},
// Grayscale 12bit support
{
MEDIA_BUS_FMT_Y12_1X12,
V4L2_COLORSPACE_RAW,
V4L2_PIX_FMT_Y12,
},
and extract_pixel_format functions
else if (strncmp(pixel_t, "raw_y88", size) == 0)
*format = V4L2_PIX_FMT_GREY; //Grayscale
else if (strncmp(pixel_t, "raw_y1010", size) == 0)
*format = V4L2_PIX_FMT_Y10; //
else if (strncmp(pixel_t, "raw_y1212", size) == 0)
*format = V4L2_PIX_FMT_Y12; //
and struct tegra_video_format.
TEGRA_VIDEO_FORMAT(RAW8, 8, Y8_1X8, 1, 1, T_L8,
RAW8, GREY, "GREY8"),
TEGRA_VIDEO_FORMAT(RAW10, 10, Y10_1X10, 2, 1, T_R16_I,
RAW10, Y10, "GREY10"),
TEGRA_VIDEO_FORMAT(RAW12, 12, Y12_1X12, 2, 1, T_R16_I,
RAW10, Y12, "GRAY12"),
And I defined the corresponding patterns in dts.
active_w = "3088";
active_h = "2064";
mode_type = "raw";
csi_pixel_bit_depth = "8";
pixel_phase = "y8";
readout_orientation = "0";
line_length = "3088";
inherent_gain = "1";
mclk_multiplier = "2";
pix_clk_hz = "375000000";
Now using v4l2-ctl to get the image.
v4l2-ctl --set-fmt-video=width=3088,height=2064,pixelformat=GREY --set-ctrl bypass_mode=0 --stream-mmap --stream-count=10 --stream-to=y8-3136x2064.raw
I encountered the following error.
[ 4704.934920] video4linux video0: Syncpoint already enabled at capture done!0
[ 4705.136906] video4linux video0: tegra_channel_capture_done: MW_ACK_DONE syncpoint time out!0
[ 4705.146053] video4linux video0: TEGRA_VI_CSI_ERROR_STATUS 0x00000004
[ 4705.146081] vi 54080000.vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00000080
[ 4705.146100] vi 54080000.vi: TEGRA_CSI_CIL_STATUS 0x00000000
[ 4705.146116] vi 54080000.vi: TEGRA_CSI_CILX_STATUS 0x00000000
[ 4705.146252] vi 54080000.vi: cil_settingtime was autocalculated
[ 4705.146274] vi 54080000.vi: csi clock settle time: 13, cil settle time: 10
I can actually get one correct frame, then get 3 black frames, then another correct frame, and so on.
The camera output is right as it works fine on the Raspberry Pi.
I checked the camera bring up material, but I didn’t find a solution idea. Please help me, thanks!