wjasper / Linux_Drivers

Open source Linux device drivers
GNU General Public License v3.0
111 stars 64 forks source link

USB: urb status: -32 Broken Pipe while usbAInScanRead_USB20X() #42

Closed Windoofs closed 2 years ago

Windoofs commented 2 years ago

Hi, thanks for creating this code! This helped me a lot to get the USB204 working: But I am unable to get it running stable:

Occasionally occurring error:

The function usbAInScanRead_USB20X() returns less of the required data. Often 0, is returned. After that the state of the USB204 is 4 --> AIN_SCAN_OVERRUN

After investigating with WireShark the USB-Protocol there was a change in a USB-Status during transmission. In packet 5002 the USB204 sends a smaller packet to PC. Instead of transporting the requested samples, is a USB-Status embedded:

urb status: -32 Broken Pipe

usb_stall.zip

Automatic test have shown that urb status: -32 Broken Pipe occurred likely instant after starting the first capturing. Also the tests show that it is most unlikely to fail after the first successful capurting.

Any idea what causes this broken pipe? Thanks Hendrik

Relevant Parameters

usbAInScanStart_USB20X(dev, CONTINOUS_SCAN, 288000.0, u8UsedChannels, BLOCK_TRANSFER_MODE, 0, 0);

usbAInScanRead_USB20X(dev, 64, 3, pu16RawData, (BLOCK_TRANSFER_MODE | CONTINUOUS), USB20X_READ_BLOCKING);
wjasper commented 2 years ago

I can't duplicate your error. However, you should look at test-usb20X.c under the 'C' option for continuous sampling. I ran it for 3 Channels at 96k Hz sampling rate on a USB-205 on a Raspberry Pi 3 for an hour with no issues. Please use my test-usb20X code to validate errors and send me screen shots.