Vi-output cpu 100%


While performing a stress test(stream on/off) using v4l2 code, a problem occurred in the vi driver.

So, I left debugging in the vi code, but after corr err occurred on the dequeue side, the vi-ouput process took up 100% of the CPU without the dequeue thread being terminated.

I’m keeping checking. Is there a patch for this? Or is there anything else I need to check?

I am using jetpack 4.6.4 and the board is a carrier board

dmesg :
dmesg.log (14.3 KB)

stress_test code :
stress_test.txt (7.0 KB)

vi5_fops.c(debug) :
vi5_fops.txt (30.0 KB)

As a result of continued testing, the thread did not die after the corr error and no data was received. After modifying the code as shown in the picture below, a corr error occurs, but data continues to be received. Will there be any problem if I modify it as below?


Apply below patch to verify.

0001-vi5-continue-captures-even-after-corr-errors.patch (2.3 KB)

I applied the patch, but in the end, vi-output took up 100% of the CPU.

When I debugged the vi5_fops.c code, an infinite loop occurred in the enqueue thread spin lock part.

Is there a patch regarding spin lock?

Or When I applied this method, the symptom of CPU taking up 100% disappeared. But will there be any problems if done this way?

I would suggest update to JP5.x to apply the provided patch for it.


Our product cannot be used in version 5.x

Please verify by v4l2-ctl


v4l2-ctl tested jetpack 4.6.4 (no apply ignore corr_err)


Dose the CPU 100% by using v4l2-ctl?

I repeated start/stop using the v4l2-ctl command, and a CPU problem occurred with corr_err appearing during the test.

Could you enable the trace log to check if more information.

echo 1 > /sys/kernel/debug/tracing/tracing_on
echo 30720 > /sys/kernel/debug/tracing/buffer_size_kb
echo 1 > /sys/kernel/debug/tracing/events/tegra_rtcpu/enable
echo 1 > /sys/kernel/debug/tracing/events/freertos/enable
echo 3 > /sys/kernel/debug/camrtc/log-level
echo 1 > /sys/kernel/debug/tracing/events/camera_common/enable
echo > /sys/kernel/debug/tracing/trace
cat /sys/kernel/debug/tracing/trace

What do flags 32 and err_data 161 mean in corr err before proceeding with trace log?

The error could be short frame that tell the sensor output less lines than expected.
Reference to below file for the error code.


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