[libcamera-devel] Problems with getControls() and listControls()

David Plowman david.plowman at raspberrypi.com
Wed Mar 3 16:57:02 CET 2021


Hi everyone

I've been chasing down problems with a camera driver (sometimes) not
running at the correct framerates. It seems that I've tracked it down
to libcamera's control list mechanism. Please correct me if I've got
anything wrong in my explanation below.

V4L2 devices produce a list of all their controls, including min and
max values, when they are opened - as the V4L2Device constructor calls
the private listControls() method.

The CameraInfo::sensorInfo() method calculates the minimum and maximum
frame lengths using the min and max vblank values. These values were
read and stored when the device was opened. Since then, however, the
format requested from the sensor may well have changed which may mean
these values are now wrong.

So firstly, have I understood this correctly? And secondly, what do
you think would be the preferred way to fix it? Perhaps the
listControls() method should be made "protected" and called at the end
of V4L2Subdevice::setFormat? Or should getControls() always update the
ranges..?

Thanks!
David


More information about the libcamera-devel mailing list