HiKey 960 USB 3.0 actual speed

Hi

I have tried to connect multiple USB camera on another 96 board (USB 3.0), but we found out that the actual speed we tested on that board was only 15Mbit/s for USB 3.0.
HiKey 960 has 2 USB 3.0, does anyone has test the actual throughput on HiKey 960 for one of the USB 3.0 port?

What procedure did you follow to get this result ? All exposed ports go to the same root hub (USB 3.0 on-the-go).

Hi Loic

Thank you for helping us, our procedure is like this
plug in a Kingston USB on the USB 3.0 and record how long/speed that it need to read a 500MB file
we use the command ā€œdd of=/tmp/111 if=/media/gorilla-h87/KINGSTON/test.txt bs=500M count=1 oflag=directā€
Then we got the result 15MB/s from Bubblegum 96 board USB3.0. Thatā€™s why we want to ask what is the actual speed on HiKey 960 before we purchase it

Thank you,

You need to define what you want to test here, the end-to-end read/write, from USB storage to Internal memory or the raw USB throughput. With your test you have at least three potential bottlenecks, the USB key flash read throughput, the USB raw throughput and the internal storage emmc write throughput (/tmp/111).

I think you can eliminate USB bus bottleneck since USB 3.0 throughput is ā€˜typicallyā€™ significantly higher than flash capabilities. I donā€™t know about your Kingston USB mass storage, but I know that bubblegum has a low-cost 8GB eMMC 4.51 (8-bit), so 15MB/s write speed would not surprise me.

I suggest you to eliminate unknown parameters.

  1. Test USB key read speed on both computer and board (results should be close)
    dd iflag=direct if=/media/kingston/test of=/dev/null bs=500M count=1

  2. Test internal bublegum emmc write perf.
    dd oflag=direct if=/dev/zero of=/tmp/111 bs=500M count=1

Anyway, The Hikey960 should have better result for internal storage writing, quick test on Android give me about ~100MB/s.

Iā€™d also be interested to know if dd figures improve if you change the transfer sizes to bs=1M count=500? Using such a massive block size is likely hurt performance (by eliminating any parallelism).

Finally can you share the model number and maximum transfer rates of the Kingston USB device? If its a cheap USB3 flash stick you may hit the limit of the flash stick long before you run out of USB3 bandwidth.

1 Like

We are using Kingston Data Traveler 100 G3 16GB, from USB storage to Internal memory

Our test result using below command:

  1. Test USB key read speed on both computer and board (results should be close)
    dd iflag=direct if=/media/kingston/test of=/dev/null bs=500M count=1
    Bubblegum:54MB/s
    Linux_x86PC:120MB/s
  2. Test internal bublegum emmc write perf.
    dd oflag=direct if=/dev/zero of=/tmp/111 bs=500M count=1
    Bubblegum:16MB/s

We are connecting USB3.0 with a USB HUB and connect four 720p camera (on bubblegum)
then we get the result of ā€œlibv4l2: error turning on stream: No space left on deviceā€
thatā€™s why we are checking USB 3.0 speed to make sure that Hikey 960 could support our scerario

I think until you understand what is happening on Bubblegum-96 then we cannot perform any experiment on Hikey960 that will be meaningful for you.

For sure experimentally measuring bandwidth with normal transfers simply doesnā€™t do much to help debug problems with the isochronous transfers from a web cam: the ā€œNo space left on deviceā€ doesnā€™t mean the bus has ever been overloadedā€¦ it means the kernel has refused to even try.

Can you connect up the hub and cameras and share the output of ā€œlsusb -tvā€ with the hub disconnected, with the hub attached to BG96 via USB2.0 and with hub attached via USB3.0 ? This should give us a view of how much bandwidth the kernel thinks it has to allocate.

Thank you for helping us, we use ā€œIsusb -tvā€ and test for USB
Doing these experiment, the result seems the same (with hub or no hub)

Result of USB2.0:
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=aotg_hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 2: Dev 6, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 1: Dev 7, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 1: Dev 7, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 1: Dev 7, If 2, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 1: Dev 7, If 3, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 2: Dev 8, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 2: Dev 8, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 3: Dev 9, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 3: Dev 9, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 3: Dev 9, If 2, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 3: Dev 9, If 3, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 4: Dev 10, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 10, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 10, If 2, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 4: Dev 10, If 3, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 4: Dev 10, If 4, Class=Human Interface Device, Driver=usbhid, 480M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
|__ Port 1: Dev 11, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 1: Dev 11, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M

USB3.0 result:
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=aotg_hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 2: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 2: Dev 5, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 1: Dev 8, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 1: Dev 8, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 1: Dev 8, If 2, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 1: Dev 8, If 3, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 2: Dev 3, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 2: Dev 3, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 3: Dev 9, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 3: Dev 9, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 3: Dev 9, If 2, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 3: Dev 9, If 3, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 4: Dev 10, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 10, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 10, If 2, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 4: Dev 10, If 3, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 4: Dev 10, If 4, Class=Human Interface Device, Driver=usbhid, 480M

No Hub:
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=aotg_hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 2: Dev 6, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 1: Dev 7, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 1: Dev 7, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 1: Dev 7, If 2, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 1: Dev 7, If 3, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 2: Dev 8, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 2: Dev 8, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 3: Dev 9, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 3: Dev 9, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 3: Dev 9, If 2, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 3: Dev 9, If 3, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 4: Dev 10, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 10, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 10, If 2, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 4: Dev 10, If 3, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 4: Dev 10, If 4, Class=Human Interface Device, Driver=usbhid, 480M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
|__ Port 1: Dev 21, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 1: Dev 21, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M

Are your webcams USB3? The results above look like you are connecting USB2 cameras into a USB3 hub. Such an arrangement does not result in any improved performance since only USB3 devices can exploit the extra bandwidth between hub and controller.

You might be able to squeeze an extra device onto the bus by looking at this FAQ entry: Linux UVC driver & tools ā€“ FAQ . Be warned that this technique will work only if the bandwidth is exhausted due to bugs in the webcams (it prevents cameras from requesting too much bandwidth).

Alternatively you might be able able to connect one of the cameras via a USB-OTG cable via the micro-USB socket. Again I canā€™t promise that will work since this would result in the webcam would be sharing the bus with your USB HID devices.

Did you solve the problem?

thank you for your advice, we are connecting with 4 USB 2.0 camera, and we did use the FAQ and expend from only 1 camera to 3 camera. But still got same message when connecting with 4th camera. We tried OTG, but the board shot down and couldnā€™t start until we unplug the OTGā€¦

Great to have an update!

Just out of interest can a hub work in the USB2 socket (or even just connect camera direct to board and use BT or WiFi to control the board)?

We connect usb 3.0 with usb hub and Ethernet port on USB 2.0. We also tried to connect camera on usb 2.0, but it is wired that we canā€™t see the screen. We modified camera driver for 1fps, but still got error msg on third cameraā€¦