From: Michael B. <mic...@gm...> - 2019-11-20 17:51:20
|
Hi there, I'm trying to read input from a USB device. I'm on Linux. I connected a USB device. I added it to udev rules to gain permissions. I got resource busy on set_configuration, so I did 'usb-devices' and found Driver= lines that correspond to the device and rmmod'd them. I probe for and unload any attached kernel driver in code. Now I can successfully connect to the device, but doing an interrupting receive (the first one), with any number of bytes, returns an Input/output error. As per usb-devices output, the device that's having the IO error is: T: Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 8 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=17cc ProdID=1310 Rev=00.46 S: Manufacturer=Native Instruments S: Product=Traktor Kontrol S4 MK2 S: SerialNumber=5C9367B8 C: #Ifs= 7 Cfg#= 1 Atr=80 MxPwr=480mA I: If#= 0 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=20 Driver=(none) I: If#= 1 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=20 Driver=(none) I: If#= 2 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=20 Driver=(none) I: If#= 3 Alt= 0 #EPs= 2 Cls=01(audio) Sub=03 Prot=00 Driver=(none) I: If#= 4 Alt= 0 #EPs= 2 Cls=03(HID ) Sub=00 Prot=00 Driver=(none) I: If#= 5 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none) I: If#= 6 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=f0 Prot=00 Driver=(none) This is puzzling because a similar device, from the same company, "works fine" with the same connect/read code: T: Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 9 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=17cc ProdID=1120 Rev=00.0b S: Manufacturer=Native Instruments S: Product=Traktor Kontrol F1 S: SerialNumber=D67CCB9F C: #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=480mA I: If#= 0 Alt= 0 #EPs= 2 Cls=03(HID ) Sub=00 Prot=00 Driver=(none) I: If#= 1 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none) The only difference in the code paths is that I select interface=0 on the latter and interface=4 on the former. libusb_set_configuration(handle, 1); libusb_claim_interface(handle, interface); Am I using the wrong kind of read? Did I forget to set a parameter? How would I know from the device output above? Thanks for any light that can be shed on this! -- Michael Bacarella |