access to ALL camera controls for an UVC webcam
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Mon Jul 29 23:38:34 CEST 2024
Hi Florian,
On Mon, Jul 29, 2024 at 09:58:51AM +0000, Ager Florian (BSH GDE-EDSD7) wrote:
> Hello,
>
> How to get access to ALL controls which this USB UVC camera supports ?
>
> If this is called: “LIBCAMERA_LOG_LEVELS="*..:DEBUG" cam -c 1 --list-controls”
>
> I got something like this:
>
> [115:52:02.032372500] [2252] DEBUG DeviceEnumerator device_enumerator.cpp:318 Successful match for media device "uvcvideo"
> [115:52:02.032945000] [2252] DEBUG V4L2 v4l2_device.cpp:636 /dev/video4 [11:cap]: Control: Brightness (0x00980900)
> [115:52:02.033139375] [2252] DEBUG V4L2 v4l2_device.cpp:636 /dev/video4 [11:cap]: Control: Contrast (0x00980901)
> [115:52:02.033281250] [2252] DEBUG V4L2 v4l2_device.cpp:636 /dev/video4 [11:cap]: Control: Saturation (0x00980902)
> [115:52:02.033506000] [2252] DEBUG V4L2 v4l2_device.cpp:636 /dev/video4 [11:cap]: Control: White Balance Temperature, Auto (0x0098090c)
> [115:52:02.033775250] [2252] DEBUG V4L2 v4l2_device.cpp:636 /dev/video4 [11:cap]: Control: Gamma (0x00980910)
> [115:52:02.033906125] [2252] DEBUG V4L2 v4l2_device.cpp:636 /dev/video4 [11:cap]: Control: Gain (0x00980913)
> [115:52:02.034045625] [2252] DEBUG V4L2 v4l2_device.cpp:636 /dev/video4 [11:cap]: Control: White Balance Temperature (0x0098091a)
> [115:52:02.034163500] [2252] DEBUG V4L2 v4l2_device.cpp:636 /dev/video4 [11:cap]: Control: Sharpness (0x0098091b)
> [115:52:02.034278750] [2252] DEBUG V4L2 v4l2_device.cpp:636 /dev/video4 [11:cap]: Control: Exposure, Auto (0x009a0901)
> [115:52:02.034421625] [2252] DEBUG V4L2 v4l2_device.cpp:636 /dev/video4 [11:cap]: Control: Exposure (Absolute) (0x009a0902)
> [115:52:02.034532750] [2252] DEBUG V4L2 v4l2_device.cpp:636 /dev/video4 [11:cap]: Control: Pan (Absolute) (0x009a0908)
> [115:52:02.034597250] [2252] DEBUG V4L2 v4l2_device.cpp:636 /dev/video4 [11:cap]: Control: Tilt (Absolute) (0x009a0909)
> [115:52:02.034758375] [2252] DEBUG V4L2 v4l2_device.cpp:636 /dev/video4 [11:cap]: Control: Zoom, Absolute (0x009a090d)
> [115:52:02.034998750] [2252] DEBUG V4L2 v4l2_videodevice.cpp:632 /dev/video4 [11:cap]: Opened device usb-ci_hdrc.0-1.2: uvcvideo: VCI-AR0521-C
> [115:52:02.036675500] [2252] DEBUG Camera camera_manager.cpp:155 Pipeline handler "uvcvideo" matched
> …
> Using camera /base/soc at 0/bus at 32c00000/usb at 32e40000-1.2:1.0-3407:0521 as cam0
> Control: Brightness: [-1.000000..1.000000]
> Control: Contrast: [0.500000..1.500000]
> Control: Saturation: [0.000000..5.000000]
> Control: AnalogueGain: [1.000000..4.000000]
> Control: AeEnable: [false..true]
> Control: ExposureTime: [100..1000000]
>
> Howto get access to all controls ?
>
> The “libcamera::ControlList& controls = request->controls();” method give me
> access to only a subset of all available controls e.g. want access to Zoom and
> Tilt ?
You will need to improve the UVC pipeline handler in libcamera to map
the missing controls to libcamera controls. For some of the V4L2
controls supported by the camera, we may already have corresponding
controls in libcamera. In that case, you should simply need to add the
controls to the PipelineHandlerUVC class processControl() and
addControl() functions in src/libcamera/pipeline/uvcvideo/uvcvideo.cpp.
If libcamera controls are missing, you will first need to add them to
src/libcamera/control_ids_core.yaml, and then map them in uvcvideo.c.
Note that libcamera controls are meant to be generic, so you may need
more work than just taking each missing V4L2 control and adding the same
libcamera control.
What controls are you interested in ?
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list