Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DWC OTG Error on Port Open #1652

Closed
bradfol opened this issue Sep 23, 2016 · 4 comments
Closed

DWC OTG Error on Port Open #1652

bradfol opened this issue Sep 23, 2016 · 4 comments

Comments

@bradfol
Copy link

bradfol commented Sep 23, 2016

Raspberry Pi 3 Model B
Kernel version: 4.4.13-v7+
Subsystem: dwc_otg

Experiencing an issue opening serial ports to connected Atmel devices over USB. The Pi is configured using the dwc_otg.speed=1 argument to make USB run at full-speed.

We are running a Node.js app and using the serialport module to communicate with 8 full-speed devices connected using powered hubs. There are no other USB devices connected. When opening the ports, an error is thrown:

Error: Error: Input/output error, cannot open /dev/ttyACM1
    at Error (native)

NOTE: Each time the app is run, a different path is identified as the one causing the error (ttyACM0 through ttyACM7).

This also causes dmesg output:

[  264.905287] INFO:: schedule_periodic: Insufficient periodic bandwidth for periodic transfer.
[  264.905306] ERROR::dwc_otg_hcd_urb_enqueue:544: DWC OTG HCD URB Enqueue failed adding QTD. Error status -1
[  264.905319] cdc_acm 1-1.5.4:1.0: acm_port_activate - usb_submit_urb(ctrl irq) failed

Here is the lsusb -v output

@P33M
Copy link
Contributor

P33M commented Sep 23, 2016

Why are you using dwc_otg.speed=1?

@bradfol
Copy link
Author

bradfol commented Sep 26, 2016

@P33M We were experiencing data loss issues. We haven't been able to track down the root cause of the data loss, but adding dwc_otg.speed=1 ended that issue.

@P33M
Copy link
Contributor

P33M commented Sep 27, 2016

Up to 80% of a frame is reserved for periodic traffic. At full-speed, the driver assumes that any periodic transfer can occur in any frame, thus bandwidth allocation to any endpoint is global. Full-speed is only 12mbit/s line rate therefore the max byte/s for periodic endpoints in totality is 1000/frame (1ms). The driver is additionally pessimistic in assuming line stuffing and device response times (which is the right thing to do).

You're simply running out of bandwidth. This is a hard limit when running in full-speed mode.

@P33M
Copy link
Contributor

P33M commented May 4, 2017

I have spotted that your hubs are single-TT hubs and your Arduinos expose 64-byte interrupt endpoints. See point 4 under Known Issues here:

https://www.raspberrypi.org/documentation/hardware/raspberrypi/usb/README.md

With multi-TT hubs it'll work a lot better at high speed.

@P33M P33M closed this as completed May 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants