cezanne / usbip-win

USB/IP for Windows
GNU General Public License v3.0
1.98k stars 350 forks source link

Stub drivers capture newly connected devices #179

Closed TheProgramableTurtle closed 3 years ago

TheProgramableTurtle commented 4 years ago

Every time I connect a device by USB it is captured by the stub and rendered useless until the driver is manually updated to the correct default. I've removed the certificates from the stores, deleted the driver from the system drivers folder, and deleted the drivers from the Device Manager when that didn't work, but my PC still insists on using the stub drivers for everything. Every device is unbound using usbip, and I've disabled test codesigning. How can I fully uninstall the drivers? (It's driving me up the wall having to use the keyboard to change the driver for my mouse each time I boot the computer).

cezanne commented 4 years ago

@TheProgramableTurtle :

but my PC still insists on using the stub drivers for everything.

It's weird. When usbip.exe binds a USB device, a stub driver is updated to the only bound device. Can you share the output of pnputil.exe -e in command pronmpt ?

TheProgramableTurtle commented 4 years ago

pnputil.txt I removed the registry entries for the driver but I reinstalled everything again, usbip.exe binds my iPhone 4 without any issue (I think). ~Additionally, while trying to attach the device from a WSL2 client, usbip attach waits indefinitely.~ Console needed updating, I get this

usbipd: info: starting usbipd (usbip 1.0.0)
usbip: debug: C:\work\usbip-win\userspace\src\usbipd\usbipd_sock.c:38:[build_sockfd] opening 0.0.0.0:3240
usbip: info: listening on 0.0.0.0:3240
usbip: info: connection from 192.168.2.80:59848
usbip: info: recv_pdu: received request: 0x8003 - attach device
usbip: error: get_device_path: traverse_intfdevs failed, returned: 0
usbip: error: open_stub_dev: invalid devno: 94
usbip: error: export_device: cannot open devno: 94
usbip: error: failed to export device: 1-94, err:-1
usbip: info: recv_pdu: request 0x8003: failed

This is specific to the iPhone, using an Android produces

usbipd: info: starting usbipd (usbip 1.0.0)
usbip: debug: C:\work\usbip-win\userspace\src\usbipd\usbipd_sock.c:38:[build_sockfd] opening 0.0.0.0:3240
usbip: info: listening on 0.0.0.0:3240
usbip: info: connection from 192.168.2.80:59850
usbip: info: recv_pdu: received request: 0x8003 - attach device
usbip: debug: C:\work\usbip-win\userspace\src\usbipd\usbipd_import.c:18:[forwarder_stub] stub forwarding started
usbip: debug: C:\work\usbip-win\userspace\src\usbipd\usbipd_import.c:108:[recv_request_import] import request busid 1-206: complete
usbip: info: recv_pdu: request 0x8003: complete

as expected. With the Android device, however, it shows with lsusb, and seems to be available to programs using libusb as running listdevs from the examples folder in the libusb GitHub repo shows

1d6b:0003 (bus 2, device 1)
0bb4:0c8b (bus 1, device 2) path: 1
1d6b:0002 (bus 1, device 1)

, but gmtp is unable to detect the device, saying Detect: No raw devices found..

TheProgramableTurtle commented 4 years ago

I have uninstalled the Windows provided driver and installed the Apple driver as suggested here, and my HWID matches, but I still get the failed to export device error.

cezanne commented 3 years ago

@TheProgramableTurtle : How about your issue with an up-to-date version?

TheProgramableTurtle commented 3 years ago

@cezanne Unfortunately I don't have the time to test right at the moment, and I already have my system set up for other use. I will be able to test on a new system in a couple of months though. Since it doesn't seem like anyone else has the same issue I'll close it. Thanks for following up though, most other people just ignore issues and close them after a few months.

TheProgramableTurtle commented 3 years ago

I thought I closed this huh