Hi Chris, On Monday 11 October 2010 01:01:01 Chris wrote: > Hi, > > I want to be able to read the exposure value of my camera when it is set > to auto exposure. > I can make changes to exposure via exposure_auto and exposure_absolute > v4l settings. > > What I want to be able to do is find out the exposure value when > exposure is set to auto so I can know the value of a well exposed image > That way I can change the exposure based on this figure to either > slightly over or slightly under exposure the image. > > Does anyone know if this is possible or how it might be achieved?
When an auto control is turned on, cameras can report control change events for the corresponding manual controls to inform the host about current control values. This feature is currently not supported by the uvcvideo driver. Despite this, you should be able to use the VIDIOC_G_CTRL ioctl to read the current exposure value. However, the driver caches the value and doesn't read it back from the hardware every time an application reads the control. You can disable caching for the exposure control with the following patch. diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c index a350fad..cf5e5a5 100644 --- a/drivers/media/video/uvc/uvc_ctrl.c +++ b/drivers/media/video/uvc/uvc_ctrl.c @@ -210,7 +210,7 @@ static struct uvc_control_info uvc_ctrls[] = { .index = 3, .size = 4, .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE - | UVC_CONTROL_RESTORE, + | UVC_CONTROL_RESTORE | UVC_CONTROL_AUTO_UPDATE, }, { .entity = UVC_GUID_UVC_CAMERA, This assumes that your camera firmware isn't buggy and will report the current exposure value when queried. The only way to find out is to try it out. -- Regards, Laurent Pinchart _______________________________________________ Linux-uvc-devel mailing list Linux-uvc-devel@lists.berlios.de https://lists.berlios.de/mailman/listinfo/linux-uvc-devel