XHCI(USB 3.0) isochronous bandwidth calculation question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



yunhua li <yunhual@xxxxxxxxx>

6:46 PM (2 minutes ago)
to linux-usb
Hello all
For USB 3.0 isochronous endpoint, anyone know how to calculate
bandwidth for an XHCI chip?
I have 3 isochronous Cameras.
Camera1: 1920*1200*16(YUV) *20(FPS) = 737280000 ~ 740Mb/s
Camera2:  1200*1200*16(YUV) * 20(FPS) = 460800000 ~ 470Mb/s
Camera3:  1200*1200*16(YUV) * 20(FPS) = 460800000 ~ 470Mb/s
16(YUV) is 2 byte YUV encoding for each pixel.
20(FPS) is the frame rate.
Total bandwidth 740+470+470 = 1680Mb/s ~ 1.7Gb/s
USB 3.0 speed is 5Gbps. count in 10b/8b encoding, is 4Gbps. I know
there is some protocol overhead.  When I open the 3rd camera with
guvcview or other software. I got the following error.

xhci_hcd 0000:49:00.0: xhci_check_bandwidth called for udev 000000004bbf2dcd
xhci_hcd 0000:49:00.0: // Ding dong!
usb 10-2: Not enough bandwidth for new device state.
xhci_hcd 0000:49:00.0: xhci_reset_bandwidth called for udev 000000004bbf2dcd
usb 10-2: Not enough bandwidth for altsetting 1

the error comes xhci_check_bandwidth from
https://elixir.bootlin.com/linux/v5.10.140/source/drivers/usb/host/xhci.c#L2906
xhci_configure_endpoint
https://elixir.bootlin.com/linux/v5.10.140/source/drivers/usb/host/xhci.c#L2862
The result is COMP_BANDWIDTH_ERROR or  COMP_SECONDARY_BANDWIDTH_ERROR
https://elixir.bootlin.com/linux/v5.10.140/source/drivers/usb/host/xhci.c#L2022

The bandwidth check is done by hardware, not software, I just want to
know how to calculate the max supported bandwidth for 3 isochronous
devices?
I tried to read the XHCI spec.
https://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/extensible-host-controler-interface-usb-xhci.pdf
But I couldn't figure it out.  I appreciate any help, and thanks for
your time to read my post.

more info:
Here is when I open the 1st camera, the kernel print.
(1920*1200*2(Byte) = 4608000
uvcvideo: Device requested 46080 B/frame bandwidth.
uvcvideo: Selecting alternate setting 1 (46080 B/frame bandwidth).
uvcvideo: Device requested 46080 B/frame bandwidth.
uvcvideo: Selecting alternate setting 1 (46080 B/frame bandwidth).
Regards




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux