How to resume VI capture

Platform : Orin NX
JetPack:JP-6.1, L4T-36.3
Camera Module: max9296+max96717+imx556

Description:
My hardware module is not very stable. When I use below command to run my sensor, it runs normally for several days, and will stuck suddenly.
v4l2-ctl --set-fmt-video=width=640,height=480,pixelformat=RG12 --stream-mmap --set-ctrl=sensor_mode=0 -d /dev/video2


And the dmesg shows below:

[344943.116198] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[344943.116662] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 262144
[344943.119775] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[344943.120246] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[344943.125702] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072
[344943.126146] tegra-camrtc-capture-vi tegra-capture-vi: corr_err: discarding frame 0, flags: 0, err_data 131072

I checkcd the mipi signal from oscilloscope and comfirmed that sensor gone wrong.
So I refresh all the register of my module, incluing sensor, serdes, and deserdes, and make sure the waveform correct. But VI couldn’t resume capturing data. Only reruning v4l2 command can resume capturing.

Any suggestion will be appreciated!

hello Mr.Elephant,

it looks you’re able to recover the stream by restart the capture pipeline, right?

may I confirm the expectation, for instance, would you like to keep v4l2 IOCTL running always?

Yes, I want to keep v4l2 IOCTL running always, and getting the correct data.

I am not sure if restarting the capture pipeline is the same as re-running v4l2 command.
Recorvering the stream needs first refreshing all the register and then re-running the v4l2 command. Just executing any of them won’t work.
The dmesg below shows that the VI driver attempts to reset the capture channel after encountering error and resume successfully.


But with the error I mentioned above, the reset mechanism doesn’t seem to work.

Can anyone help me?

Help!Help! Help!

hello Mr.Elephant,

that logs indicate VI’s error recover mechanism has worked normally.
however, let us arrange resources to test with v4l2 pipeline to keep fetching the stream, and software simulation to corrupt the stream.

Ok, thanks. Wait for good news.

I would like to know if there has been any progress on this issue.

hello Mr.Elephant,

FYI,
we’re testing with CSI bayer camera sensor, using software simulation approach to stop/resume the stream.
it’s tested on developer kit to confirm this use-case, and, it’s verified VI able to resume capture after sensor output stream again.

It might be that I didn’t express it clearly before. Sometimes it can recover, but sometimes it can’t, especially when the length of the input data suddenly changes and is inconsistent with the correct length. After correcting the length, it turns out that it cannot be captured again.

hello Mr.Elephant,

please revise this from sensor side. since it’s expect the coming stream with correct formats.

So if the data format is corrupted and then restored, Vi may not be able to recapture it, right?

hello Mr.Elephant,

what did you meant data format corrupted?
the logic is VI trying to resume with the packet it expected, instead everything coming to VI.

Data format corrupted’ refers to the data length being incorrect, possibly due to a chip reset caused by power outage protection.

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