11

I am trying to tune a C920 webcam for picture quality using v4l2-ctl utility on Ubuntu PC. I am unable to set exposure_auto to 'Auto' mode, but I am able to set it to 'Manual Mode' or in 'Aperture Priority Mode'. Any clues?

*lenovo@ubuntu:~$ v4l2-ctl -d /dev/video1 -c exposure_auto=0
VIDIOC_S_CTRL: failed: Input/output error
exposure_auto: Input/output error*

Following are the settings dump of C920 connected to my ubuntu:

 - brightness (int) : min=0 max=255 step=1 default=128 value=128
 - contrast (int) : min=0 max=255 step=1 default=128 value=128
 - saturation (int) : min=0 max=255 step=1 default=128 value=128
 - white_balance_temperature_auto (bool) : default=1 value=1 
 - gain (int) : min=0 max=255 step=1 default=0 value=0 
 - power_line_frequency (menu) : min=0 max=2 default=2 value=2
 - white_balance_temperature (int) : min=2000 max=6500 step=1 default=4000 value=4000  
 - sharpness (int) : min=0 max=255 step=1 default=128 value=128 
 - backlight_compensation (int) : min=0 max=1    step=1 default=0 value=0 
 - exposure_auto (menu) : min=0 max=3 default=3    value=3  (0: Auto Mode 1: Manual Mode
           2: Shutter Priority Mode
           3: Aperture Priority Mode) 
 - exposure_absolute (int) : min=3 max=2047 step=1 default=250 value=250  
 - exposure_auto_priority (bool) :    default=0 value=1 
 - focus_absolute (int) : min=0 max=250 step=5    default=0 value=0 
 - focus_auto (bool) : default=1 value=1 
 - zoom_absolute    (int) : min=100 max=500 step=1 default=100 value=100
Kyle Macey
  • 1,679

3 Answers3

8

That usually happens when you try to manually set a setting which is currently controlled by some other automatic. Try toggling ''exposure_auto_priority'' to see if that looses the grip of the auto algorithm on that particular setting.

For me, for example, setting ''white_balance_temperature_auto'' to 0 allowed me to manually set ''white_balance_temperature'' which resulted in "failed: Input/output error" before.

isync
  • 664
6

Using

v4l2-ctl -d /dev/video1 -c exposure_auto=1 

instead of exposure_auto = 0, you can set exposure to manual then set exposure_absolute to change the value.

anonymous2
  • 4,325
Jerry
  • 61
1

Hi it's easy to find out what parameters your camera accepts with uvcdynctrl

sudo apt install uvcdynctrl

To get a list of all supported commands type:

uvcdynctrl -c -v

-c will give you a list of all available settings

-v stands for verbose, giving you the range of values accepted

my Microsoft Lifecam will give me this output:

  Brightness
    ID      : 0x00000001,
    Type    : Dword,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ 30 .. 255, step size: 1 ],
    Default : 133
  Contrast
    ID      : 0x00000002,
    Type    : Dword,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ 0 .. 10, step size: 1 ],
    Default : 5
  Saturation
    ID      : 0x00000004,
    Type    : Dword,
    Flags   : { CAN_READ, CAN_WRITE },
    Values  : [ 0 .. 200, step size: 1 ],
    Default : 83

.. and so on.

You can then get the actual value with

uvcdynctrl -g 'Exposure, Auto'

or set the value with

uvcdynctrl -s 'Exposure, Auto' 1
andrey
  • 11