WICG / webusb

Connecting hardware to the web.
https://wicg.github.io/webusb/
Other
1.32k stars 132 forks source link

fail to open device with multiple interface usb device on windows #185

Closed sz1jrh closed 4 years ago

sz1jrh commented 4 years ago

I am trying to use the webusb api to connect my USB device which basically is a digitizer. the usb version is 2.0. I have successed to request the device in chrome but failed to open the device with the error Access Deny. 1

the usb device containing 3 interface: 2 HID and 1 USB (winusb loaded). here is the information shown in xusb:

Using libusb v1.0.23.11397

Opening device 2D80:1010... libusb: warning [hid_open] could not open HID device in R/W mode (keyboard or mouse?) - trying without

Device properties: bus number: 1 port path: 14 (from root hub) speed: 12 Mbit/s (USB FullSpeed)

Reading device descriptor: length: 18 device class: 0 S/N: 3 VID:PID: 2D80:1010 bcdDevice: 0100 iMan:iProd:iSer: 1:2:3 nb confs: 1

Reading BOS descriptor: 1 caps Unknown BOS device capability 05:

Reading first configuration descriptor: nb interfaces: 3 interface[0]: id = 0 interface[0].altsetting[0]: num endpoints = 1 Class.SubClass.Protocol: 03.01.01 endpoint[0].address: 81 max packet size: 0040 polling interval: 01 interface[1]: id = 1 interface[1].altsetting[0]: num endpoints = 1 Class.SubClass.Protocol: 03.01.01 endpoint[0].address: 82 max packet size: 0040 polling interval: 01 interface[2]: id = 2 interface[2].altsetting[0]: num endpoints = 1 Class.SubClass.Protocol: FF.00.00 endpoint[0].address: 83 max packet size: 0040 polling interval: 00

Claiming interface 0...

Claiming interface 1...

Claiming interface 2...

Reading string descriptors: String (0x01): "" String (0x02): "" String (0x03): "**"

Reading Extended Compat ID OS Feature Descriptor (wIndex = 0x0004): libusb: warning [hid_submit_control_transfer] unsupported HID control request libusb: warning [hid_submit_control_transfer] unsupported HID control request

00000000 28 00 00 00 00 01 04 00 01 00 00 00 00 00 00 00 (............... 00000010 02 01 57 49 4e 55 53 42 00 00 00 00 00 00 00 00 ..WINUSB........ 00000020 00 00 00 00 00 00 00 00 ........

Reading Extended Properties OS Feature Descriptor (wIndex = 0x0005): libusb: warning [hid_submit_control_transfer] unsupported HID control request libusb: warning [hid_submit_control_transfer] unsupported HID control request

00000000 8e 00 00 00 00 01 05 00 01 00 84 00 00 00 01 00 ................ 00000010 00 00 28 00 44 00 65 00 76 00 69 00 63 00 65 00 ..(.D.e.v.i.c.e. 00000020 49 00 6e 00 74 00 65 00 72 00 66 00 61 00 63 00 I.n.t.e.r.f.a.c. 00000030 65 00 47 00 55 00 49 00 44 00 00 00 4e 00 00 00 e.G.U.I.D...N... 00000040 7b 00 31 00 44 00 34 00 42 00 32 00 33 00 36 00 {.1.D.4.B.2.3.6. 00000050 35 00 2d 00 34 00 37 00 34 00 39 00 2d 00 34 00 5.-.4.7.4.9.-.4. 00000060 38 00 45 00 41 00 2d 00 42 00 33 00 38 00 41 00 8.E.A.-.B.3.8.A. 00000070 2d 00 37 00 43 00 36 00 46 00 44 00 44 00 44 00 -.7.C.6.F.D.D.D. 00000080 44 00 37 00 45 00 32 00 36 00 7d 00 00 00 D.7.E.2.6.}...

Releasing interface 0... Releasing interface 1... Releasing interface 2... Closing device...

the first hid interface is used to report digitizer which i think it is already claimed by the system. I guess that is the issue because I have tried to remove the two hid interface and repeat the process. this time the device is opened successfully.

however the same issue is not presented on Mac OS. so i am wonder if anyone has any suggestion to solve the issue on windows?

odejesush commented 4 years ago

WebUSB blocks access to HID, but there is a WebHID API currently in development for Chrome. You can check the status of that API in Chrome Platform Status.

For future reference, this repository is only for issues about the WebUSB specification so I'm going to close this issue. This seems like a question better suited for StackOverflow with the WebUSB tag.

reillyeon commented 4 years ago

If you are only trying to access the USB interface with the WinUSB driver loaded that should work, but as @odejesush said that isn't an appropriate issue for this repository because it is an implementation-specific bug. Please file an issue against Chrome on crbug.com and we will take a look.