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

uvcc commands does not respect Camera selection #10

Closed wookayin closed 3 years ago

wookayin commented 3 years ago

uvcc@2.0.4

I have two USB cameras connected, e.g.:

[
  {
    "name": "Logitech C930c",
    "vendor": 1133,
    "product": 2193,
    "address": 4
  },
  {
    "name": "Logitech BRIO",
    "vendor": 1133,
    "product": 2142,
    "address": 1
  }
]

I tried the following to control the second webcam (BRIO in this example):

❯❯❯ uvcc set --product 2142 absolute_zoom 170

But the first one (C930c) gets changed. None of --vendor, --product, --address works. I tested with other commands such as import, export, get, set, but all of them only interacts with the default (first) camera.

joelpurra commented 3 years ago

@wookayin: unfortunately I don't have more than one UVC device, so I have never really tested this matching functionality. (Only briefly tested deliberately mismatching my own camera.) It relies on the assumption that the maintainer of the upstream uvc-control has confirmed that it works with the even more upstream libusb, which is widely used. That said, operating system differences might also play a role.

While both your cameras have the same vendor, I suspect you might need to specify (at least) both vendor and product for the device filtering to work. Did you try that?

wookayin commented 3 years ago

Hi @joelpurra, Thanks for your reply

Yes, specifying both of --vendor and --product worked as expected. However, specifying only one does not work.

It would be great to improve the behavior, by showing warning and/or error messages if the query has no effect, or no such devices are found, etc. We could also make the device selection work as I was expecting when there is no ambiguity. At least having --address (assuming this is a unique value) would be also great.

joelpurra commented 3 years ago

@wookayin: the issue was that the upstream uvc-control didn't filter only by product id (nor only by device address). I've fixed that in the uvcc-specific fork. Also added some warnings for mismatches, but they might never™ be shown.

Closing as fixed, but do let me know if using only --product is not working as intended. Thanks for reporting!