Corrupt images received from CSI-2 pipeline

I have encountered issues with corrupt images while trying to implement streaming of raw images with two image sensors simultaneously.

It seems that the images are getting corrupt at the pipeline level while the system is under load because I was able to reproduce the issue using the CSID test generator and V4L2 software.

I configured the pipeline as described in the documentation:

sudo media-ctl -d /dev/media0 -l '"msm_csid0":1->"msm_ispif0":0[1],"msm_ispif0":1->"msm_vfe0_rdi0":0[1]'
sudo media-ctl -d /dev/media0 -l '"msm_csid1":1->"msm_ispif1":0[1],"msm_ispif1":1->"msm_vfe0_rdi1":0[1]'
sudo media-ctl -d /dev/media0 -V '"msm_csid0":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_ispif0":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_vfe0_rdi0":0[fmt:UYVY8_2X8/1920x1080 field:none]'
sudo media-ctl -d /dev/media0 -V '"msm_csid1":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_ispif1":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_vfe0_rdi1":0[fmt:UYVY8_2X8/1920x1080 field:none]'

I enabled the CSID test pattern:

./yavta --no-query -w '0x009f0903 1' /dev/v4l-subdev2
./yavta --no-query -w '0x009f0903 1' /dev/v4l-subdev3

When I try streaming from a single sensor using qv4l2, the displayed image sometimes has misplaced pixels:

When I put the system under load, the corruption gets more frequent and more visible:

stress --vm 1

This issue can also be reproduced when running two gstreamer pipelines simultaneously:

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,format=UYVY,width=1920,height=1080' ! glimagesink
gst-launch-1.0 v4l2src device=/dev/video1 ! 'video/x-raw,format=UYVY,width=1920,height=1080' ! glimagesink

I was also able to reproduce this issue on a custom V4L2 application and with actual image sensors.

Is this a known issues? Are there some limitations of the platform I am hitting here?

I am using the Debian Buster 528 installer image.

I’m not aware about it, but going to try reproducing.