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
98 stars 5 forks source link

LIBUSB_ERROR_NOT_FOUND when using uvcc devices #7

Closed witnessmenow closed 3 years ago

witnessmenow commented 3 years ago

Hello,

I get the following error when I try run uvcc devices

C:\Users\Brian>uvcc devices
Error: LIBUSB_ERROR_NOT_FOUND
    at Device.usb.Device.open (C:\Users\Brian\AppData\Roaming\npm\node_modules\uvcc\node_modules\usb\usb.js:38:7)
    at C:\Users\Brian\AppData\Roaming\npm\node_modules\uvcc\node_modules\uvc-control\index.js:297:14
    at new Promise (<anonymous>)
    at UVCControl.validate (C:\Users\Brian\AppData\Roaming\npm\node_modules\uvcc\node_modules\uvc-control\index.js:294:10)
    at Array.map (<anonymous>)
    at C:\Users\Brian\AppData\Roaming\npm\node_modules\uvcc\node_modules\uvc-control\index.js:282:40
    at new Promise (<anonymous>)
    at Function.UVCControl.discover (C:\Users\Brian\AppData\Roaming\npm\node_modules\uvcc\node_modules\uvc-control\index.js:281:10)
    at UvcDeviceLister.get (C:\Users\Brian\AppData\Roaming\npm\node_modules\uvcc\dist\uvc-device-lister.js:31:47)
    at DevicesCommand.execute (C:\Users\Brian\AppData\Roaming\npm\node_modules\uvcc\dist\command-handlers\devices.js:35:52)
    at CommandHandlers.execute (C:\Users\Brian\AppData\Roaming\npm\node_modules\uvcc\dist\command-handlers.js:43:38)
    at CommandManager.execute (C:\Users\Brian\AppData\Roaming\npm\node_modules\uvcc\dist\command-manager.js:71:55)
    at async mainAsync (C:\Users\Brian\AppData\Roaming\npm\node_modules\uvcc\dist\index.js:73:9) {
  errno: -5
}

Is their a driver setup step I'm missing or something?

I'm currently using Generic windows drivers rather than the logitech ones as described in this setup: https://blog.logitech.com/2018/01/03/multi-camera-streaming-with-logitech-webcams-a-how-to-guide/

Please let me know if you need more information

joelpurra commented 3 years ago

@witnessmenow: I admittedly haven't tested uvcc on Windows, at least not recently.

The underlying node-usb library is quite widely used, so should work. Might be a driver issue. Did you try Zadig, as recommended by node-usb?

Windows: Use Zadig to install the WinUSB driver for your USB device.

witnessmenow commented 3 years ago

Hey Joel, thanks for getting back so quickly.

So I could never get uvcc devices to work even after replacing the drivers with WinUSB using Zadig (plus it seemed to stop working as a webcam when I did this) but for the fun of it I just decided to try interact with the camera using the vendor and product ID as it's displayed in Zadig (although i think its standard) and it worked!

I would still say that this is an issue, but at least there is a workaround

image

uvcc --vendor 0x46d --product 0x82d export

image

(I'm running as admin in the screen shot, but I have tested without admin too and its fine)

joelpurra commented 3 years ago

@witnessmenow: great that it works!

Documentation on getting the vendor/product ids could be improved, including possible workarounds on different operating systems. The same numbers are available, for example, in Windows' Control Panel, but have to dig around a bit to find them. Don't really want to add Windows-specific code to uvcc devices though.

You might be going for a multi-camera setup (as indicated by Logitech link), but if you have a single UVC device you shouldn't even need to use --vendor and --product since the first device is (should be!) autodetected/used automatically (since uvcc v2).

joelpurra commented 3 years ago

@witnessmenow: slightly changed how devices are listed (in the forked uvc-control) and released uvcc v3.0.0 today. With this change, errors thrown by Device.usb.Device.open() should be swallowed/ignored. Perhaps uvcc devices works as expected now? Would appreciate if you could confirm, being a Windows user.

witnessmenow commented 3 years ago

Will try take a look at the weekend @joelpurra . Thanks for the update

witnessmenow commented 3 years ago

Sorry about the delay, just tried it there and successfully found the cameras

image

Also I do not believe I have installed anything with Zadig, as I mentioned in an earlier reply to this that it was not working for me when I did

joelpurra commented 3 years ago

@witnessmenow: happy to hear, thanks for confirming =)

UVC devices should be supported without a specific drivers, as that's presumably a major reason the UVC standard exists. Thanks for also confirming that Zadig is not needed (by libusb) for this use-case!