How to adapt Monochrome Cameras?

I have a color camera, and on orin I was able to capture the video stream using the v4l2 tool with the following command:
v4l2-ctl --set-fmt-video=width=4128,height=3008,pixelformat=RG12 --set-ctrl bypass_mode=0 --stream-skip=30 --stream-mmap --stream-count=1 --stream-to=test.raw -d /dev/video0
However, I installed the same model of Monochrome Cameras and couldn’t capture the video stream.
dmesg log

[ 1399.556512] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 1399.565670] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 1399.576448] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 1399.584168] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 1399.594823] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 1399.602531] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 0
[ 1399.614452] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 1402.372972] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 1402.382139] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 1402.394103] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 1402.401840] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 1402.412500] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 1402.420215] t194-nvcsi 13e40000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 0
[ 1402.431971] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel

trace log

 kworker/4:1-133     [004] ....    99.746281: rtcpu_nvcsi_intr: tstamp:3921460871 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000008
     kworker/4:1-133     [004] ....    99.746282: rtcpu_nvcsi_intr: tstamp:3921461217 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000008
     kworker/4:1-133     [004] ....    99.746282: rtcpu_nvcsi_intr: tstamp:3921461565 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000008
     kworker/4:1-133     [004] ....    99.746282: rtcpu_nvcsi_intr: tstamp:3921461907 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000008
     kworker/4:1-133     [004] ....    99.746283: rtcpu_nvcsi_intr: tstamp:3921462251 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000008
     kworker/4:1-133     [004] ....    99.746283: rtcpu_nvcsi_intr: tstamp:3921462606 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000008

Please help me find out the problem, I appreciate it!

Duplicated with How to use camera tirg function on orin platform?

hi kayccc
Please help me find out the problem, I appreciate it!

there’s PHY interrupt with 0x8 error, which is LP sequence error.
normally, it should follow by LP11->LP01->LP00->LP11 sequence. it’s more like a hardware issue.

may I know what’s the format types, is it also output the bayer formats?

Not bayer format, RAW Y12 to be exact

hello 1508723374,

had you extend the formats?
please refer to below for default supported formats.
$public_sources/kernel_src/kernel/nvidia/drivers/media/platform/tegra/camera/camera_common.c
static const struct camera_common_colorfmt camera_common_color_fmts[] = {...}

FYI,
we’ve enable monochrome sensor support with bayer formats, CCCC.

I did not extend this format.
What changes do I need to make to orin to support monochrome sensor?Because I can get a stream using a color sensor, I can’t get a stream using a monochrome sensor. No changes were made to the driver and device tree.

hello 1508723374,

you’ll need to update the VI driver to extend the support formats.

If I have 12bit data, what monochrome format is supported in the vi driver?V4L2_PIX_FMT_Y12?

What changes should I make to the vi driver?

hello 1508723374,

it’s mentioned in comment #8.
please see-also pixel_phase property to understand how it parse the settings via device tree.

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