Corrupted frames capturing with a grayscale sensor

Hi,

I created a driver for a grayscale sensor and I’m able to capture. However, when I observe the video I notice an unusual behavior.

The camera seems to capture correct frames but they present noise in the first horizontal lines at the top of the image that doesn’t match with the other pixels. The number of these horizontal lines are different in each frame. Sometimes, it could take the half of the frame, but usually are ~5% of the whole frame.

Trying to find the cause of the issue I noticed that in the first two frames I can only see capture data in the first horizontal lines and the rest is a black frame. And after doing some tests I suspect that those lines that I see different on each frame seems to be like anticipated pixel information from the next frames. In other words, I think that those lines at the beginning of the frame are incomplete frames in advance.

I’ve been debugging the driver in order to change configuration that could be affecting the capture, but I think that everything is correct.

I also tested the capture after enabling jetson_clocks.sh and I noticed that the frames are more stable, the data corruption at top of the frame is smaller.

This final test enabling jetson_clocks makes me think that the issue is not on the driver neither on the sensor. I think that there is something related to the TX2.

Have you experience similar issues with grayscale cameras?
Do you know what could be causing this issue?

I attached here some images about the first two frames and other frame randomly selected, for normal TX2 performance and also, activating jetson_clocks.sh.

-Thanks


first_frame_jetson_clocks.png



Did you use v4l2-ctl to capture?
Enable the trace log to get more information maybe help.

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 2 > /sys/kernel/debug/camrtc/log-level
echo > /sys/kernel/debug/tracing/trace
cat /sys/kernel/debug/tracing/trace