From: Throctukes <jus...@gm...> - 2008-10-08 10:11:42
|
I have a USB device (a custom device I'm trying to talk to) with two endpoints, one writing to the device, one reading from the device. Both are bulk transfers. Every communication transaction takes the form of (1) Write a command to the device (2) Read the response. I'm using libusb 0.1.12 On Windows, all is well. I can connect the device, claim the interface and communicate happily. However, in Ubuntu (a standard Hardy desktop install), whilst I can connect to the device and write to it, all read operations fail with the error "error submitting URB: Invalid argument" reported from libusb (error code -22). If I check /var/log/messages I see a warning message logged for the same time as the read was attempted: "sysfs: duplicate filename 'usbdev4.3_ep81' can not be created" - which tallies with the device (it is indeed on that bus and it's endpoint 81 I'm trying to read from). Dunno if that's relevant. I've been trying to figure out what I'm doing wrong for days now - has anyone got any ideas where I should even be looking for the problem? I noticed that someone else reported a similar issue, but found that it was because their endpoint was really in interrupt, not bulk, mode. I'm pretty sure that's not the case here. -- View this message in context: http://www.nabble.com/%22error-submitting-URB%3A-Invalid-argument%22-on-bulk-reads-tp19875978p19875978.html Sent from the LibUSB Dev mailing list archive at Nabble.com. |
From: Greg KH <gr...@kr...> - 2008-10-12 04:15:17
|
On Wed, Oct 08, 2008 at 03:11:30AM -0700, Throctukes wrote: > > If I check /var/log/messages I see a warning message logged for the same > time as the read was attempted: "sysfs: duplicate filename 'usbdev4.3_ep81' > can not be created" - which tallies with the device (it is indeed on that > bus and it's endpoint 81 I'm trying to read from). Dunno if that's relevant. That's not relevant, it's a kernel problem with Ubuntu's kernel release, they should fix that... thanks, greg k-h |
From: Throctukes <jus...@gm...> - 2008-10-13 17:35:59
|
After digging a little more, and using the lsusb -v command, I went back to the firmware in the device and found a misconfiguration: The device had another interface (defined but never used) which had an iso endpoint defined on 0x81. Removing this interface completely from the device descriptor solved the problem (why Windows didn't complain I dunno). I must say, I'm very impressed by how easy libusb is to use. I'm porting the code away from a proprietary library and the codebase has shrunk and simplified considerably. Sorry for gumming up the mailing list with what turned out to be a problem elsewhere. Thanks for your help. Regards, Justen. -- View this message in context: http://www.nabble.com/%22error-submitting-URB%3A-Invalid-argument%22-on-bulk-reads-tp19875978p19959288.html Sent from the LibUSB Dev mailing list archive at Nabble.com. |
From: Tim R. <ti...@pr...> - 2008-10-13 18:37:05
|
Throctukes wrote: > After digging a little more, and using the lsusb -v command, I went back to > the firmware in the device and found a misconfiguration: The device had > another interface (defined but never used) which had an iso endpoint defined > on 0x81. Removing this interface completely from the device descriptor > solved the problem (why Windows didn't complain I dunno). > Each version gets a little pickier. Win2K accepted a lot of crappy descriptors. XP is better, but still misses things like this. Vista is much pickier. -- Tim Roberts, ti...@pr... Providenza & Boekelheide, Inc. |
From: Alan S. <st...@ro...> - 2008-10-12 16:15:16
|
On Wed, 8 Oct 2008, Throctukes wrote: > I have a USB device (a custom device I'm trying to talk to) with two > endpoints, one writing to the device, one reading from the device. Both are > bulk transfers. Every communication transaction takes the form of (1) Write > a command to the device (2) Read the response. I'm using libusb 0.1.12 > > On Windows, all is well. I can connect the device, claim the interface and > communicate happily. However, in Ubuntu (a standard Hardy desktop install), > whilst I can connect to the device and write to it, all read operations fail > with the error "error submitting URB: Invalid argument" reported from libusb > (error code -22). > > If I check /var/log/messages I see a warning message logged for the same > time as the read was attempted: "sysfs: duplicate filename 'usbdev4.3_ep81' > can not be created" - which tallies with the device (it is indeed on that > bus and it's endpoint 81 I'm trying to read from). Dunno if that's relevant. > > I've been trying to figure out what I'm doing wrong for days now - has > anyone got any ideas where I should even be looking for the problem? I > noticed that someone else reported a similar issue, but found that it was > because their endpoint was really in interrupt, not bulk, mode. I'm pretty > sure that's not the case here. Firstly, it wouldn't hurt to use the most up-to-date kernel available. That would be 2.6.27. Secondly, you shouldn't expect us to be able to figure out problems without any data. At the very least you need to post the kernel log. You should also include more information about the device, such as its entry in /proc/bus/usb/devices, or its "lsusb -v" entry. Alan Stern |