I narrowed down the problem a little bit.
When I stream sensor 1 and then write to sensor 2 with v4l2-ctl, it can happen that I seem to sometimes lose sensor 1 MIPI CSI data. (The image “jumps” and sometimes the last part is more red (because the bayer pattern seems to be broken after that)
I checked dmesg. You are right, that sensor 1 is not written when writing sensor 2. So this does not seem to be the problem.
I was trying to get the error when using i2cset instead of v4l2-ctl, but I cannot reproduce the problem with that method so it seems to about the amount of i2c request or v4l2 in general.
The problem also appear when starting stream of sensor and also when stopping stream of sensor 2.
Do you have any idea, how this could happen?
EDIT: Also using i2cset in a for loop does not produce the problem!
EDIT2: Another thing I noticed but until now did not care too much about: All the register in my mode table are written multiple times, for exaple when setting a mode, but also everytime I call streamon with v4l2 api.
Even when using v4l2-ctl -c only to set one parameter, all the mode registers are written. Why is that?