Hi Jerry,
I will look into the manual to get more insight into what’s happening.
Anyhow, I tried changing some register writes to the MIPI bridge chip and changing the Pixel array dimension from 1280x720 to 1280x960 after which I observe that the error 0x4022 changed to 0x20022.
It seems like I fixed the pixel parser error, but still have CIL errors. I am not sure what parameters define the CIL configurations. It would be great if you could give me some guidance as to what kind of parameters I should be looking into.
While runnning v4l2 based streaming, I observe couple of syncpt timeouts as well, with a bit in pixel parser error set. Detailed logs below:
Attached: diff of debug code.
Running Yavta:
ubuntu@tegra-ubuntu:~$ cd debug/yavta/
ubuntu@tegra-ubuntu:~/debug/yavta$ ./yavta /dev/video0 -c1 -n1 -s1280x960 -fSRGGB12 -Fdata8.raw
Device /dev/video0 opened.
Device `vi-output-0, mt9m021 6-0010' on `platform:vi:0' (driver 'tegra-video') is a video capture (without mplanes) device.
Video format set: SRGGB12 (32314752) 1280x960 (stride 2560) field any buffer size 2457600
Video format: SRGGB12 (32314752) 1280x960 (stride 2560) field none buffer size 2457600
3 buffers requested.
length: 2457600 offset: 0 timestamp type/source: mono/EoF
Buffer 0/0 mapped at address 0x7f8b35e000.
length: 2457600 offset: 2457600 timestamp type/source: mono/EoF
Buffer 1/0 mapped at address 0x7f8b106000.
length: 2457600 offset: 4915200 timestamp type/source: mono/EoF
Buffer 2/0 mapped at address 0x7f8aeae000.
0 (0) [E] none 0 2457600 B 36.475063 36.506874 1.205 fps ts mono/EoF
Captured 1 frames in 0.861987 seconds (1.160110 fps, 2851086.806831 B/s).
3 buffers released.
ubuntu@tegra-ubuntu:~/debug/yavta$ dmesg
The relevant portions of dmesg:
[ 36.464010] mt9m021 6-0010: Starting stream
[ 36.464088] mt9m021 6-0010: mt9m021_write: 0x10dc to 0x301a
[ 36.482537] vi vi: CSI DEBUG tegra_csi_error
[ 36.486857] vi vi: CSI DEBUG csi2_error
[ 36.491001] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00000000
[ 36.498212] vi vi: TEGRA_CSI_CIL_STATUS 0x00000002
[ 36.503038] vi vi: TEGRA_CSI_CILX_STATUS 0x00020020
[ 36.508124] vi vi: vi2_channel_error_status:error 20022 frame 0
[ 36.514102] vi vi: CSI DEBUG tegra_csi_pad_control
[ 36.520809] vi vi: CSI DEBUG tegra_csi_error
[ 36.525103] vi vi: CSI DEBUG csi2_error
[ 36.529147] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00000000
[ 36.534756] vi vi: TEGRA_CSI_CIL_STATUS 0x00000002
[ 36.539644] vi vi: TEGRA_CSI_CILX_STATUS 0x00020020
[ 36.544543] vi vi: vi2_channel_error_status:error 20022 frame 1
[ 36.550680] vi vi: CSI DEBUG tegra_csi_stop_streaming
[ 36.555737] vi vi: CSI DEBUG csi2_stop_streaming
[ 36.560413] vi vi: CSI DEBUG tegra_csi_pad_control
[ 36.565301] mt9m021 6-0010: mt9m021_s_stream
[ 36.565309] mt9m021 6-0010: Ending stream
[ 36.565316] mt9m021 6-0010: mt9m021_write: 0x00d8 to 0x301a
[ 36.567710] vi vi: CSI DEBUG tegra_csi_channel_power
[ 36.572909] mt9m021 6-0010: mt9m021_set_power value: 0
[ 36.572917] mt9m021 6-0010: mt9m021_power_off
[ 36.678274] vi vi: CSI DEBUG tegra_csi_power
Running v4l2 based streaming:
ubuntu@tegra-ubuntu:~/debug/yavta$ v4l2-ctl -d /dev/video0 -w --verbose --set-fmt-video=width=1280,height=960,pixelformat=RG12 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=mydata.raw
VIDIOC_QUERYCAP: ok
VIDIOC_S_EXT_CTRLS: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
Width/Height : 1280/960
Pixel Format : 'RG12'
Field : None
Bytes per Line : 2560
Size Image : 2457600
Colorspace : sRGB
Transfer Function : Default
YCbCr Encoding : Default
Quantization : Default
Flags :
VIDIOC_REQBUFS: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_STREAMON: ok
Index : 0
Type : Video Capture
Flags : mapped, done, error
Field : None
Sequence : 0
Length : 2457600
Bytesused: 2457600
Timestamp: 383.854600s (Monotonic, End-of-Frame)
Index : 1
Type : Video Capture
Flags : mapped, done, error
Field : None
Sequence : 1
Length : 2457600
Bytesused: 2457600
Timestamp: 383.891743s (Monotonic, End-of-Frame)
Index : 2
Type : Video Capture
Flags : mapped, done, error
Field : None
Sequence : 2
Length : 2457600
Bytesused: 2457600
Timestamp: 18446743798852079600.18446744073434680968s (Monotonic, End-of-Frame)
Dmesg shows syncpt timeout errors as well:
[ 383.862040] vi vi: CSI DEBUG tegra_csi_error
[ 383.866365] vi vi: CSI DEBUG csi2_error
[ 383.870291] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00000000
[ 383.876144] vi vi: TEGRA_CSI_CIL_STATUS 0x00000002
[ 383.880996] vi vi: TEGRA_CSI_CILX_STATUS 0x00020020
[ 383.886047] vi vi: vi2_channel_error_status:error 20022 frame 0
[ 383.892480] vi vi: CSI DEBUG tegra_csi_pad_control
[ 383.899063] vi vi: CSI DEBUG tegra_csi_error
[ 383.903334] vi vi: CSI DEBUG csi2_error
[ 383.907171] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00000000
[ 383.912768] vi vi: TEGRA_CSI_CIL_STATUS 0x00000002
[ 383.917647] vi vi: TEGRA_CSI_CILX_STATUS 0x00020020
[ 383.922524] vi vi: vi2_channel_error_status:error 20022 frame 1
[ 383.928544] vi vi: CSI DEBUG tegra_csi_pad_control
[ 384.128222] video4linux video0: frame start syncpt timeout!0
[ 384.134041] vi vi: CSI DEBUG tegra_csi_pad_control
[ 384.139775] vi vi: CSI DEBUG tegra_csi_status
[ 384.144247] vi vi: CSI DEBUG csi2_status
[ 384.149084] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00000100
[ 384.154697] vi vi: TEGRA_CSI_CIL_STATUS 0x00000002
[ 384.159544] vi vi: TEGRA_CSI_CILX_STATUS 0x00020020
[ 384.164424] vi vi: TEGRA_CSI_DEBUG_COUNTER_0 0x00001100
[ 384.169705] vi vi: TEGRA_CSI_DEBUG_COUNTER_1 0x00000004
[ 384.174927] vi vi: TEGRA_CSI_DEBUG_COUNTER_2 0x000082ff
[ 384.180190] vi vi: CSI DEBUG tegra_csi_error_recover
[ 384.185147] vi vi: CSI DEBUG csi2_error_recover
[ 384.189774] vi vi: CSI DEBUG tegra_csi_stop_streaming
[ 384.194820] vi vi: CSI DEBUG csi2_stop_streaming
[ 384.199482] vi vi: CSI DEBUG tegra_csi_start_streaming
[ 384.204616] vi vi: CSI DEBUG csi2_start_streaming
[ 384.209367] vi vi: csi2_read:port 0 offset 0x000000d0
[ 384.214570] vi vi: CSI DEBUG tegra_csi_pad_control
[ 384.227182] vi vi: CSI DEBUG tegra_csi_error
[ 384.231496] vi vi: CSI DEBUG csi2_error
[ 384.235336] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00000000
[ 384.240939] vi vi: TEGRA_CSI_CIL_STATUS 0x00000012
[ 384.245783] vi vi: TEGRA_CSI_CILX_STATUS 0x00060060
[ 384.250706] vi vi: vi2_channel_error_status:error 20022 frame 3