[libcamera-devel] Use and behavior of delayed sensor controls

Matthias Fend matthias.fend at emfend.at
Fri Dec 23 10:01:25 CET 2022


Hello,

I have some questions about delayed sensor controls introduced with 
'libcamera: pipeline: rkisp1: Use delayed controls'.

Referring to these lines of code:

std::unordered_map<uint32_t, DelayedControls::ControlParams> params = {
	{ V4L2_CID_ANALOGUE_GAIN, { 1, false } },
	{ V4L2_CID_EXPOSURE, { 2, false } },
};

If I see things correctly, the RKISP1 pipeline is supposed to write the 
analog gain to the sensor with a one frame delay and the exposure with a 
two frame delay.
I know there is a hint that these values are somehow guessed for a 
generic use case and this might need some fine tuning, but still I got 
some questions.

- Since gain and exposure somehow belong together and if an algorithm 
changes both values at the same time, they should be taken into account 
synchronously in the sensor, I expected these values to be written in 
the same frame. Is there a reason why there is a frame delay between 
these controls?

- Why are these controls even delayed by one frame (I would expect zero 
frames delay for both controls)?

- Since the parameter is called delay, I was expecting that a higher 
number would mean a longer delay, but it looks like the exposure (with a 
delay of 2) is written to the sensor before the gain (with a delay of 
1). I also had the impression that the control with the longest delay is 
always written as soon as possible and the others are delay by the 
number of frames resulting from the difference of their delay parameter.
Is my observation correct and is this intentional?

Of course, it's possible that there might be sensors that work exactly 
as intended with this configuration. But for a simple generic case, at 
least from my current understanding, that doesn't seem to fit that well.

Maybe someone knows about this and would be so kind and give me some 
background information or correct my observations and guesses.

Thanks!
  ~Matthias


More information about the libcamera-devel mailing list