Discussion:
[libusb] LIBUSB_ERROR_PIPE when performing bulk transfer (IN)
chendra
2016-08-10 05:25:27 UTC
Permalink
LIBUSB_ERROR_PIPE when performing bulk transfer (IN)

Dear all,

I just started using libusb. I am trying to control a usb3 camera which
complies with usb3vision using libusb in Linux (Ubuntu 14.04, libusb
1.0.20).
In usb3vision spec, to retrieve information of the camera's setting, there
is a device control interface which consists of two endpoints (IN and OUT).
I tried to send a command through OUT endpoint using libusb_bulk_transfer
and read the ack and the requested data from the IN end point also using
libusb_bulk_transfer.
I could send the command successfully through the OUT end point. But I
always obtained LIBUSB_ERROR_PIPE when I attemped to read data from IN end
point right after sending the command.
The usbfs_snoop shows error "ep3 bulk-in, actual_length 0 status -32".

Any help or suggestion is very appreciated.

Chendra.


My snippet code:
-----------------------


--------------------------
----------------------
-----------------------




Compared with a 3rd party application that successfully accessed the device:
---------------------------------------------------------------------------------------







--
View this message in context: http://libusb.6.n5.nabble.com/LIBUSB-ERROR-PIPE-when-performing-bulk-transfer-IN-tp5715945.html
Sent from the LibUSB Dev mailing list archive at Nabble.com.
Alan Stern
2016-08-10 14:18:37 UTC
Permalink
Post by chendra
LIBUSB_ERROR_PIPE when performing bulk transfer (IN)
Dear all,
I just started using libusb. I am trying to control a usb3 camera which
complies with usb3vision using libusb in Linux (Ubuntu 14.04, libusb
1.0.20).
In usb3vision spec, to retrieve information of the camera's setting, there
is a device control interface which consists of two endpoints (IN and OUT).
I tried to send a command through OUT endpoint using libusb_bulk_transfer
and read the ack and the requested data from the IN end point also using
libusb_bulk_transfer.
I could send the command successfully through the OUT end point. But I
always obtained LIBUSB_ERROR_PIPE when I attemped to read data from IN end
point right after sending the command.
The usbfs_snoop shows error "ep3 bulk-in, actual_length 0 status -32".
Any help or suggestion is very appreciated.
LIBUSB_ERROR_PIPE indicates the device sent a STALL, which probably
means it did not understand the command you sent.

Alan Stern
michel
2016-08-10 19:33:29 UTC
Permalink
i can see 2 "claim interface" in the successful app , and only one in yours ?

did you issue "clear halt feature' to the in end point ?
i can it see twice in the log but this does not tell me what ep

I can see fully different end point usage in the 2 app , for instance ep
bulk 4 in and ep 2 bulk in are used
then control before access to "ep 3 "
All this ep access do not appear in your "interface dump" ??
Are your sure about the interface dump ? is it the full device desriptor
dump ?
Is their any interface alternate interface setting you are missing ?

i do agree with alan certainly your command set is incorrect and device
"stall "




--
View this message in context: http://libusb.6.n5.nabble.com/LIBUSB-ERROR-PIPE-when-performing-bulk-transfer-IN-tp5715945p5715948.html
Sent from the LibUSB Dev mailing list archive at Nabble.com.
chendra
2016-08-11 00:17:22 UTC
Permalink
Thanks for the comment.

The device has three endpoints actually. I used only ep 3, so I claimed only
for the ep 3. The successful app claimed ep 3 and ep 4 (I did not use ep 4
yet).

Regarding the interface dump, I am sorry I sent only the interface dump for
ep 3.

You and Alan are correct. It turned out that I made a silly mistake in
constructing the command. I post the explanation in reply to Alan's
comment.





--
View this message in context: http://libusb.6.n5.nabble.com/LIBUSB-ERROR-PIPE-when-performing-bulk-transfer-IN-tp5715945p5715950.html
Sent from the LibUSB Dev mailing list archive at Nabble.com.

chendra
2016-08-11 00:05:00 UTC
Permalink
Thanks for the comment.

I compared again the data sent using my code with the data sent using 3rd
party application. I finally found a silly mistake in the command that I
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
23
------------------------------------------------------------------------------------------
55 33 56 43 00 40 00 80 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
23
------------------------------------------------------------------------------------------
55 33 56 43 00 40 00 08 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00

Now my code works well. Thanks alot!



--
View this message in context: http://libusb.6.n5.nabble.com/LIBUSB-ERROR-PIPE-when-performing-bulk-transfer-IN-tp5715945p5715949.html
Sent from the LibUSB Dev mailing list archive at Nabble.com.
Loading...