joelpurra / uvcc

USB Video Class (UVC) device configurator. Used for webcams, camcorders, etcetera. Command line interface for automation.
https://joelpurra.com/projects/uvcc/
GNU General Public License v3.0
95 stars 5 forks source link

Not working with Logitech C270? #3

Closed Jip-Hop closed 4 years ago

Jip-Hop commented 4 years ago

I downloaded the repository and installed with npm install. Running it on macOS 10.14.6. But I can't get it to work with my Logitech C270.

Listing the devices only shows my internal trackpad. Checking chrome://usb-internals in Chrome gives me vendor and product ids, so I tried using them. But I still can't control the webcam...

I am able to turn off Auto Exposure on the C270 webcam on MacOS using the sample application on this page: https://phoboslab.org/log/2009/07/uvc-camera-control-for-mac-os-x So at least I know it's possible... I tried adjusting the gain in this app, and then checking again with uvcc to see if it changed, but uvcc returned the same gain value.

I was hoping to use uvcc so I can control the exposure of my C270 cross platform. Also the exposure range slider in the example app from phoboslab.org doesn't work properly for the C270, so I was hoping to fix that too using uvcc.

Apple-MBP:uvcc-develop apple$ node index.js devices
Apple Internal Keyboard / Trackpad [ vId: 0x5ac  / pId: 0x274  ]
Apple-MBP:uvcc-develop apple$ node index.js --vendor 0x46d --product 0x825 get whiteBalanceTemperature
{ [Error: LIBUSB_TRANSFER_OVERFLOW]
  cause: { Error: LIBUSB_TRANSFER_OVERFLOW errno: 6 },
  isOperational: true,
  errno: 6 }
Apple-MBP:uvcc-develop apple$ node index.js --vendor 0x46d --product 0x825 get gain
2306
Apple-MBP:uvcc-develop apple$ node index.js --vendor 0x46d --product 0x825 get gain
2306
joelpurra commented 4 years ago

@Jip-Hop: unfortunately I don't have that camera model available for testing, but let's see if it can be figured out.

The LIBUSB_TRANSFER_OVERFLOW error hints at the issue being upstream, in this case meaning uvc-control which contains the configuration for how many bytes to read for each type of UVC control. I see that you also opened a similar issue in that library, and it might be better to solve it there and then update uvcc when a new version is ready.

Some suggestions:

  1. Use only one camera configuration software at a time, at least while trying to get things to work. This is because one piece of software might "lock" the USB "connection" to the camera, or perhaps crash if something unexpected happens. (I think this partially applies to software using the camera's video/imagery, but might come down to implementation details.)
  2. To "reset" the camera between tests it's easiest to just unplug it -- in particular if it's unresponsive to configuration changes.

Some questions:

  1. Did you try to disable automatic white balance using uvcc before reading the current white balance temperature? (The camera might not report the "current" value as expected, or the value set on the camera might actually be out of the expected range.)
  2. Did you check the range of the gain in uvcc? My Logitech C920 reports a gain range of 0-255, so 2306 seems way too high. (See some debugging output in a separate comment.)
  3. Did you try to set the gain through uvcc?
  4. I might already have fixed this issue a few months ago, while fixing some low-level USB communication modes, if we're both lucky. Would you mind trying some experimental uvcc/uvc-control branches and see if it fixes the problem? See instructions in this uvc-control issue.

Will post another comment with some camera configuration readouts for reference.

joelpurra commented 4 years ago

To confirm the expected/allowed ranges of a UVC camera control, here's some sample output from v4l-utils, found in the Video4Linux set of software. While it's not a macOS utility, it might give some guidance from a well-known UVC-capable implementation.

Note for example gain which shows min=0 max=255 step=1 default=0 value=0 for me.

v4l2-ctl --all
Driver Info:
    Driver name      : uvcvideo
    Card type        : HD Pro Webcam C920
    Bus info         : usb-0000:01:00.0-10.4.4
    Driver version   : 5.3.18
    Capabilities     : 0x84a00001
        Video Capture
        Metadata Capture
        Streaming
        Extended Pix Format
        Device Capabilities
    Device Caps      : 0x04200001
        Video Capture
        Streaming
        Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
    Width/Height      : 640/480
    Pixel Format      : 'YUYV' (YUYV 4:2:2)
    Field             : None
    Bytes per Line    : 1280
    Size Image        : 614400
    Colorspace        : sRGB
    Transfer Function : Default (maps to sRGB)
    YCbCr/HSV Encoding: Default (maps to ITU-R 601)
    Quantization      : Default (maps to Limited Range)
    Flags             : 
Crop Capability Video Capture:
    Bounds      : Left 0, Top 0, Width 640, Height 480
    Default     : Left 0, Top 0, Width 640, Height 480
    Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 640, Height 480, Flags: 
Selection: crop_bounds, Left 0, Top 0, Width 640, Height 480, Flags: 
Streaming Parameters Video Capture:
    Capabilities     : timeperframe
    Frames per second: 30.000 (30/1)
    Read buffers     : 0
                     brightness 0x00980900 (int)    : min=0 max=255 step=1 default=128 value=128
                       contrast 0x00980901 (int)    : min=0 max=255 step=1 default=128 value=128
                     saturation 0x00980902 (int)    : min=0 max=255 step=1 default=128 value=128
 white_balance_temperature_auto 0x0098090c (bool)   : default=1 value=1
                           gain 0x00980913 (int)    : min=0 max=255 step=1 default=0 value=0
           power_line_frequency 0x00980918 (menu)   : min=0 max=2 default=2 value=2
      white_balance_temperature 0x0098091a (int)    : min=2000 max=6500 step=1 default=4000 value=4000 flags=inactive
                      sharpness 0x0098091b (int)    : min=0 max=255 step=1 default=128 value=128
         backlight_compensation 0x0098091c (int)    : min=0 max=1 step=1 default=0 value=0
                  exposure_auto 0x009a0901 (menu)   : min=0 max=3 default=3 value=3
              exposure_absolute 0x009a0902 (int)    : min=3 max=2047 step=1 default=250 value=250 flags=inactive
         exposure_auto_priority 0x009a0903 (bool)   : default=0 value=1
                   pan_absolute 0x009a0908 (int)    : min=-36000 max=36000 step=3600 default=0 value=0
                  tilt_absolute 0x009a0909 (int)    : min=-36000 max=36000 step=3600 default=0 value=0
                 focus_absolute 0x009a090a (int)    : min=0 max=250 step=5 default=0 value=0 flags=inactive
                     focus_auto 0x009a090c (bool)   : default=1 value=1
                  zoom_absolute 0x009a090d (int)    : min=100 max=500 step=1 default=100 value=100
                      led1_mode 0x0a046d05 (menu)   : min=0 max=3 default=0 value=3
                 led1_frequency 0x0a046d06 (int)    : min=0 max=255 step=1 default=0 value=0
Jip-Hop commented 4 years ago

Hey, thanks for replying!

This is the output on Ubuntu:

ubuntu@ubuntu:~$ v4l2-ctl --all
Driver Info (not using libv4l2):
    Driver name   : uvcvideo
    Card type     : UVC Camera (046d:0825)
    Bus info      : usb-0000:00:1d.0-1.8
    Driver version: 5.3.13
    Capabilities  : 0x84A00001
        Video Capture
        Metadata Capture
        Streaming
        Extended Pix Format
        Device Capabilities
    Device Caps   : 0x04200001
        Video Capture
        Streaming
        Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
    Width/Height      : 640/480
    Pixel Format      : 'YUYV'
    Field             : None
    Bytes per Line    : 1280
    Size Image        : 614400
    Colorspace        : sRGB
    Transfer Function : Default (maps to sRGB)
    YCbCr/HSV Encoding: Default (maps to ITU-R 601)
    Quantization      : Default (maps to Limited Range)
    Flags             : 
Crop Capability Video Capture:
    Bounds      : Left 0, Top 0, Width 640, Height 480
    Default     : Left 0, Top 0, Width 640, Height 480
    Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 640, Height 480
Selection: crop_bounds, Left 0, Top 0, Width 640, Height 480
Streaming Parameters Video Capture:
    Capabilities     : timeperframe
    Frames per second: 30.000 (30/1)
    Read buffers     : 0
                     brightness 0x00980900 (int)    : min=0 max=255 step=1 default=128 value=128
                       contrast 0x00980901 (int)    : min=0 max=255 step=1 default=32 value=32
                     saturation 0x00980902 (int)    : min=0 max=255 step=1 default=32 value=32
 white_balance_temperature_auto 0x0098090c (bool)   : default=1 value=1
                           gain 0x00980913 (int)    : min=0 max=255 step=1 default=0 value=0
           power_line_frequency 0x00980918 (menu)   : min=0 max=2 default=2 value=2
      white_balance_temperature 0x0098091a (int)    : min=0 max=10000 step=10 default=4000 value=4000 flags=inactive
                      sharpness 0x0098091b (int)    : min=0 max=255 step=1 default=24 value=24
         backlight_compensation 0x0098091c (int)    : min=0 max=1 step=1 default=1 value=1
                  exposure_auto 0x009a0901 (menu)   : min=0 max=3 default=3 value=3
              exposure_absolute 0x009a0902 (int)    : min=1 max=10000 step=1 default=166 value=166 flags=inactive
         exposure_auto_priority 0x009a0903 (bool)   : default=0 value=1

Will also try out the experimental branch :)

Jip-Hop commented 4 years ago

Here's some test output from node-uvc-control-master after freshly connecting the webcam.

UVCControl {
  _events: [Object: null prototype] {},
  _eventsCount: 0,
  _maxListeners: undefined,
  options: { vid: 1133 },
  device: Device {
    busNumber: 20,
    deviceAddress: 11,
    deviceDescriptor: {
      bLength: 18,
      bDescriptorType: 1,
      bcdUSB: 512,
      bDeviceClass: 239,
      bDeviceSubClass: 2,
      bDeviceProtocol: 1,
      bMaxPacketSize0: 64,
      idVendor: 1133,
      idProduct: 2085,
      bcdDevice: 16,
      iManufacturer: 0,
      iProduct: 0,
      iSerialNumber: 2,
      bNumConfigurations: 1
    },
    portNumbers: [ 1 ],
    interfaces: [ [Interface], [Interface], [Interface], [Interface] ],
    _configDescriptor: {
      bLength: 9,
      bDescriptorType: 2,
      wTotalLength: 2469,
      bNumInterfaces: 4,
      bConfigurationValue: 1,
      iConfiguration: 0,
      bmAttributes: 128,
      bMaxPower: 250,
      extra: <Buffer 08 0b 00 02 0e 03 00 00>,
      interfaces: [Array]
    }
  },
  videoControlInterfaceNumber: 0,
  ids: { processingUnit: 2, cameraInputTerminal: 1 },
  supportedControls: [
    'auto_exposure_mode',
    'auto_exposure_priority',
    'absolute_exposure_time',
    'brightness',
    'contrast',
    'saturation',
    'sharpness',
    'white_balance_temperature',
    'backlight_compensation',
    'gain',
    'power_line_frequency',
    'auto_white_balance_temperature'
  ],
  [Symbol(kCapture)]: false
}
auto_exposure_mode setting: { bAutoExposureMode: -128 }
auto_exposure_priority setting: { bAutoExposurePriority: 32 }
absolute_exposure_time setting: { dwExposureTimeAbsolute: 0 }
brightness setting: { wBrightness: 128 }
contrast setting: { wContrast: 32 }
saturation setting: { wSaturation: 32 }
sharpness setting: { wSharpness: 24 }
white_balance_temperature setting: { wWhiteBalanceTemperature: 4000 }
backlight_compensation setting: { wBacklightCompensation: 1 }
gain setting: { wGain: 0 }
power_line_frequency setting: { bPowerLineFrequency: 2 }
auto_white_balance_temperature setting: { bWhiteBalanceTemperatureAuto: 1 }
absolute_exposure_time range: { min: 0, max: 255 }
brightness range: { min: 0, max: 255 }
contrast range: { min: 0, max: 255 }
saturation range: { min: 0, max: 255 }
sharpness range: { min: 0, max: 255 }
white_balance_temperature range: { min: 0, max: 10000 }
backlight_compensation range: { min: 0, max: 1 }
gain range: { min: 0, max: 255 }

Used code:

const UVCControl = require("../index");
const vid = parseInt(process.argv[2]) || 1133;

const cam = new UVCControl({
  vid: vid
});

if (cam.device.deviceDescriptor.idVendor !== vid)
  console.error(
    `Input vendor ID (${vid}) does not match device vendor ID (${cam.device.deviceDescriptor.idVendor})`
  );

console.log(cam);

cam.supportedControls.forEach(name => {
  cam
    .get(name)
    .then(value => console.log(name, "setting:", value))
    .catch(e => console.log(e));

  try {
    cam
      .range(name)
      .then(range => console.log(name, "range:", range))
      // .catch(e => console.log(e));
  } catch (e) {
    // console.log(e);
  }
});

I'm not sure what to look for exactly but to me it seems like it doesn't match up too well to the Ubuntu reference output.

Jip-Hop commented 4 years ago
uvcc-feature-uvc-control-v1-next apple$ ./index.js --vendor 0x46d --product 0x825 --verbose export
Parsed arguments: {
  "_": [],
  "version": false,
  "verbose": true,
  "help": false,
  "vendor": 1133,
  "product": 2085,
  "$0": "index.js",
  "cmd": "export"
}
Error getting value, ignoring. autoExposureMode [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting value, ignoring. autoExposurePriority [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting value, ignoring. absoluteExposureTime [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting value, ignoring. absoluteFocus [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting value, ignoring. absoluteZoom [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting value, ignoring. absolutePanTilt [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting value, ignoring. autoFocus [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting value, ignoring. brightness [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting value, ignoring. contrast [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting value, ignoring. saturation [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting value, ignoring. sharpness [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting value, ignoring. whiteBalanceTemperature [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting value, ignoring. backlightCompensation [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting value, ignoring. gain [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting value, ignoring. autoWhiteBalance [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
{}
uvcc-feature-uvc-control-v1-next apple$ ./index.js --vendor 0x46d --product 0x825 --verbose ranges
Parsed arguments: {
  "_": [],
  "version": false,
  "verbose": true,
  "help": false,
  "vendor": 1133,
  "product": 2085,
  "$0": "index.js",
  "cmd": "ranges"
}
Error getting range, ignoring. autoExposureMode [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting range, ignoring. autoExposurePriority [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting range, ignoring. absoluteExposureTime [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting range, ignoring. absoluteFocus [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting range, ignoring. absoluteZoom [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting range, ignoring. absolutePanTilt [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting range, ignoring. autoFocus [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting range, ignoring. brightness [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting range, ignoring. contrast [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting range, ignoring. saturation [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting range, ignoring. sharpness [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting range, ignoring. whiteBalanceTemperature [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting range, ignoring. backlightCompensation [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting range, ignoring. gain [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
Error getting range, ignoring. autoWhiteBalance [OperationalError: LIBUSB_TRANSFER_STALL] {
  cause: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 },
  isOperational: true,
  errno: 4
}
{}
Jip-Hop commented 4 years ago
uvcc-feature-uvc-control-v2-next apple$ ./index.js --vendor 0x46d --product 0x825 --verbose export
Parsed arguments: {
  "_": [],
  "version": false,
  "verbose": true,
  "help": false,
  "vendor": 1133,
  "product": 2085,
  "$0": "index.js",
  "cmd": "export"
}
Error getting value, ignoring. absolute_exposure_time {
  id: 'absolute_exposure_time',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. absolute_focus {
  id: 'absolute_focus',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. absolute_iris {
  id: 'absolute_iris',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. absolute_pan_tilt {
  id: 'absolute_pan_tilt',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. absolute_roll {
  id: 'absolute_roll',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. absolute_zoom {
  id: 'absolute_zoom',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. analog_lock_status {
  id: 'analog_lock_status',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. analog_video_standard {
  id: 'analog_video_standard',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. auto_exposure_mode {
  id: 'auto_exposure_mode',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. auto_exposure_priority {
  id: 'auto_exposure_priority',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. auto_focus {
  id: 'auto_focus',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. auto_hue { id: 'auto_hue', error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 } }
Error getting value, ignoring. auto_white_balance_component {
  id: 'auto_white_balance_component',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. auto_white_balance_temperature {
  id: 'auto_white_balance_temperature',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. backlight_compensation {
  id: 'backlight_compensation',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. brightness {
  id: 'brightness',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. contrast { id: 'contrast', error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 } }
Error getting value, ignoring. digital_multiplier {
  id: 'digital_multiplier',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. digital_multiplier_limit {
  id: 'digital_multiplier_limit',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. gain { id: 'gain', error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 } }
Error getting value, ignoring. gamma { id: 'gamma', error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 } }
Error getting value, ignoring. hue { id: 'hue', error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 } }
Error getting value, ignoring. power_line_frequency {
  id: 'power_line_frequency',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. privacy { id: 'privacy', error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 } }
Error getting value, ignoring. relative_exposure_time {
  id: 'relative_exposure_time',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. relative_focus {
  id: 'relative_focus',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. relative_iris {
  id: 'relative_iris',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. relative_pan_tilt {
  id: 'relative_pan_tilt',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. relative_roll {
  id: 'relative_roll',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. relative_zoom {
  id: 'relative_zoom',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. saturation {
  id: 'saturation',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. scanning_mode {
  id: 'scanning_mode',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. sharpness { id: 'sharpness', error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 } }
Error getting value, ignoring. white_balance_component {
  id: 'white_balance_component',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
Error getting value, ignoring. white_balance_temperature {
  id: 'white_balance_temperature',
  error: [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
}
{}
uvcc-feature-uvc-control-v2-next apple$ ./index.js --vendor 0x46d --product 0x825 --verbose ranges
Parsed arguments: {
  "_": [],
  "version": false,
  "verbose": true,
  "help": false,
  "vendor": 1133,
  "product": 2085,
  "$0": "index.js",
  "cmd": "ranges"
}
Error getting range, ignoring. absolute_exposure_time [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. absolute_focus [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. absolute_iris [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. absolute_pan_tilt [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. absolute_roll [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. absolute_zoom [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. backlight_compensation [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. brightness [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. contrast [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. digital_multiplier [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. digital_multiplier_limit [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. gain [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. gamma [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. hue [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. relative_focus [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. relative_pan_tilt [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. relative_roll [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. relative_zoom [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. saturation [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. sharpness [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. white_balance_component [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
Error getting range, ignoring. white_balance_temperature [Error: LIBUSB_TRANSFER_STALL] { errno: 4 }
{}
joelpurra commented 4 years ago

@Jip-Hop: thanks for testing the branches!

I note that your c270's v4l2-ctl output shows that exposure_absolute and white_balance_temperature have wider ranges than my c920. The gain has the same range though, so the value 2306 you showed before should not be possible. It also seems the c920 have 7 additional controls, but that shouldn't be a problem (at least when using uvc-control v2-next as it dynamically retrieves the list of controls).

Even though control endpoints do not halt, a completed control transfer may have a LIBUSB_TRANSFER_STALL status code. This indicates the control request was not supported.

I tried your test code and get similar output. That should mean that master (https://github.com/makenai/node-uvc-control/commit/ca1e2c963e98b309ad3b65c5fc538f052ea5fd64) of uvc-control works at least. Wonder why uvcc doesn't.

It seems LIBUSB_TRANSFER_STALL can be ignored; it's just a "not supported" message. (Which might be a bit strange when reading the setting, given that the list of supported controls lists them. Not all controls support ranges though.) I get a bunch of those, but not for all controls like you.

You get no output at all (just the empty object {} on the last line) using uvcc, but at least some settings/ranges when using uvc-control directly. You wrote that you unplugged the camera before the first debug run, but did you unplug it before the subsequent runs? (For the sake of debugging, please also double-check if any other camera-related program might be running.)

Strangely enough, I get more readouts for uvcc export and uvcc ranges for the v1 branch than on the v2 branch, even though the latter should dynamically support all controls/ranges. Didn't diff the output, but it seems consistent between macOS and linux. Did you try uvcc on linux? (Note that uvc-control gives LIBUSB_ERROR_IO on linux without the control transfer fixes in my fork.) Perhaps there's something in the UVC-specific constants sent to libusb that needs to be fixed?

Sorry, no real fixes for now. Without your particular camera (not to mention system setup) it's hard to find the exact cause. Do you have any ideas? I don't want to go as far as suggesting that you format your (macOS) computer ;)

Jip-Hop commented 4 years ago

Thanks for looking into it :)

I bought another webcam: ELP USBFHD06H-SFV(2.8-12mm). Tried out to set manual exposure with the node-uvc-control-master webgui, but it wouldn't disable auto exposure properly.

The Webcam Settings app from the Mac App Store supports my new ELP camera and Logitech C270 perfectly, so I'm going to have to go that route for now.

joelpurra commented 4 years ago

Webcam Settings looks pretty nice. It seems to add support for different manufacturers/cameras one by one, according to the most version history -- wonder if that's also necessary for uvc-control/uvcc. In that case, more hardware is needed.

Closing this issue for now. If you get around to test the new camera as well, please reopen!