Discussion:
[linux-uvc-devel] Manual exposure with Microsoft Lifecam Studio does not work
Michael Haardt
2015-02-05 18:24:59 UTC
Permalink
Hello,

after noticing erratic behaviour of the manual exposure control, I found
out that the camera appears not to follow the USB video class for that
control.

Instead there are 12 values from the range of 1-10000, which have a
sensible function, as determined by image brightness with flatfield
acquisitions. Some neighbours to those values are interpreted as the
same, but most values are interpreted as maximum exposure. So unless
you happen to hit those 12 out of 10000, you will think manual exposure
just does not work.

From comparing motion blur, it looks like the exposure also is not
represented in steps of 100 us, but in steps of 10 us.

The function below converts v4l2 exposure to the nearest sensible
value. How can this be hooked in uvc?

/*
* The Lifecam Windows driver offers 12 unscaled exposure steps. Apart
* from some neighbour values to those below that do the same, all other
* values are interpreted as 10000, not as the nearest value, so manual
* exposure cannot be controlled with a slider, which likely hits a value
* being interpreted as maximum exposure.
*
* Very likely the camera does not use exposure in 100us units, but in
* 10us units, which cannot be represented by the USB video device class
* or v4l2.
*/
int exposure_100us_to_lifecam(int exposure_100us)
{
int lifecam_exposure[] = { 5, 9, 19, 39, 78, 156,
312, 625, 1250, 2500, 5000, 10000 };
int *cur,*end;

for (cur = lifecam_exposure, end = cur+ARRAY_SIZE(lifecam_exposure)-1;
cur < end && exposure_100us > (cur[0]+cur[1])/2;
++cur);
return cur[0];
}

The camera is:

usb 1-1: new high-speed USB device number 4 using ehci-pci
usb 1-1: New USB device found, idVendor=045e, idProduct=0772
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1: Product: Microsoft® LifeCam Studio(TM)
usb 1-1: Manufacturer: Microsoft
uvcvideo: Found UVC 1.00 device Microsoft® LifeCam Studio(TM) (045e:0772)
input: Microsoft® LifeCam Studio(TM) as /devices/pci0000:00/0000:00:1d.7/usb1/1-1/1-1:1.0/input/input6

I would not be surprised to see other cameras showing the same quirk,
as manual exposure is rarely used with webcams. It is essential for
astrophotography, though.

Michael

Loading...