On 17.01.2018 18:46, Michael Tretter wrote:
Hello, I am using a Magewell XI100DUSB-HDMI frame grabber which by itself works fine. However, I get a "Not enough bandwidth for new device state." error for any other USB device that is plugged after the frame grabber. This error is caused by the xHC sending a Bandwidth Error for the Configure Endpoint command during xhci_check_bandwidth(). I tested it with a USB-storage device (high speed and SuperSpeed) and a USB 3.0 hub, but there is no difference. If I plug the frame grabber after the other device, both work fine. The error only occurs, if Pulseaudio opened the device, which selects an alternate interface for the AudioStreaming interface. This alternate interface uses an isochronous endpoint with an interval of 1 ms and 192 BytesPerInterval. This should not reserve all bandwidth of the root hub. I implemented the Get Port Bandwidth command to check the available bandwidth of the xHC and it reports 80 % for HS ports, 90 % for SS ports, and 0 % on the port used by the frame grabber. LGTM. I am currently testing on 4.15-rc8, but I can reproduce the same issue with 4.12, too. This is the output of /sys/kernel/debug/usb/devices for the frame grabber with the isochronous endpoint selected: T: Bus=02 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#= 2 Spd=5000 MxCh= 0 D: Ver= 3.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 P: Vendor=2935 ProdID=0001 Rev= 0.01 S: Manufacturer=Magewell S: Product=XI100DUSB-HDMI S: SerialNumber=A201170218035 C:* #Ifs= 5 Cfg#= 1 Atr=80 MxPwr=800mA A: FirstIf#= 0 IfCount= 2 Cls=0e(video) Sub=03 Prot=00 A: FirstIf#= 2 IfCount= 2 Cls=01(audio) Sub=01 Prot=00 I:* If#= 0 Alt= 0 #EPs= 1 Cls=0e(video) Sub=01 Prot=00 Driver=uvcvideo E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us I:* If#= 1 Alt= 0 #EPs= 1 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo E: Ad=83(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=00 Driver=snd-usb-audio I: If#= 3 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio I:* If#= 3 Alt= 1 #EPs= 1 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio E: Ad=85(I) Atr=05(Isoc) MxPS= 192 Ivl=1ms I:* If#= 4 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid E: Ad=86(I) Atr=03(Int.) MxPS= 64 Ivl=64ms I don't understand, why the xHC sends the Bandwidth Error. I already looked at the information about the xhci in the debugfs and the event tracing, but I did not find anything relevant. Is there anything else that I can look for and test
Odd, there shouldn't be any bandwidth error in this case. There was one other case where bogus bandwidth errors for isoc transfers were reported. The reporter saw some correlation between the Bandwidth issues and LPM/MEL (Link power management/Max exit latency) settings. It could be worth disabling LPM, or just prevent changing the MEL to check if you see the same correlation. I might be able to get one of those devices. Do you have more detail (a testscript) on how to trigger the issue, and details about the xHCI host controller you are using. If you also could you send me the xhci debug and trace outputs just in case. Thanks Mathias -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html