Black stripes in raw image


I’m trying to capture images with two IMX264 modules (monochrome), using the recent 36.2 release (kernel 5.15). I’m using a custom carrier board with an Orin NX. The same board and cameras were tested successfully with the previous release so I know the hardware is OK.

I receive almost good images, but I get a lot of black stripes.

  • Changing the pix_clk_hz property and the csi/vi/etc clocks seems to impact the number of stripes, but I could not find a proper configuration to remove all of them. The stripes are multiples of 32 bits, if that helps.

  • Using more buffers with v4l2 generates better images. For example, the first image is obtained with only 1 buffer requested, and the second one with 20 buffers requested (There are at least two stripes).

  • If I get 30 images, with 10 buffers, then frames 0, 10, and 20 have the the same defects, which I find strange.

The pixel format is Y12.

Is there any way to debug such behavior? Thank you.

P.S.: I tried applying the patch from here but it changed nothing.

Just as a follow-up, running a capture of 500 frames with 20 v4l2 buffers, the defects go away after a certain number of frames.

I applied an offset to see the black stripes and everything else as white.

Peek 2024-03-04 17-29

What’s the resolution? Try below command to set alignment according the size.

v4l2-ctl --preferred_stride=<>

Apply this patch :

@ShaneCCC: The resolution is 2432x2048, Y12 (RAW12) format, but the result is the same with Y10 (RAW10) or RAW8. I tried --set-ctrl preferred_stride=2432/4864 and the proposed patch by @phdm but I got the same results.

@phdm: My defects are quite random, as opposed to your original post, so I think there’s an issue elsewhere. The fact that allocating more buffers improves the image is strange.

Boost the clocks to try.

sudo su
echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/isp/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/mrq_rate_locked
cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate |tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee  /sys/kernel/debug/bpmp/debug/clk/isp/rate
cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
cat /sys/kernel/debug/bpmp/debug/clk/emc/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/emc/rate

I already tried that and did not make any difference.

If the problem is random I would suspect it could be the sensor output problem.

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