Very Less USB Throughput

Post Reply
nikhil jarande
Posts: 9
Joined: Sat Oct 29, 2016 4:31 pm
languages_spoken: english
ODROIDs: odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Very Less USB Throughput

Post by nikhil jarande »

Query related to USB throughput of Odroid c2
We build custom usb FS device which having one bulk in , one bulk out and one Interrupt end point.At full throttle (At bulk in endpoint (Host) ) we getting following throughput.
Odroid c2 - 0.4 Mbps
Rasberry pi3b - 4 Mbps
x86 - 4 Mbps

Following things we tried .

1) libusb and usb skeleton custom driver with user space app.
2) Kernel - 3.14 , 3.16
3) OS - ubuntu, yocto ,DietPi

Results are same we cant go beyond 0.4 Mbps . Anything we are missing to configure USB host or any USB kernel patch is available let us know.

User avatar
odroid
Site Admin
Posts: 35871
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1316 times
Been thanked: 910 times
Contact:

Re: Very Less USB Throughput

Post by odroid »

When we tested some HS storage devices the throughput was near 200Mbps.

It seems to be very hard to reproduce the issue since we don't have the same device on our hands.

nikhil jarande
Posts: 9
Joined: Sat Oct 29, 2016 4:31 pm
languages_spoken: english
ODROIDs: odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Very Less USB Throughput

Post by nikhil jarande »

Thanks for prompt response.

To have same USB FS device , we can use ftdi device.
We did the following experiment to check USB throughput.
we loop-back the TX and RX terminal.Then run program which will write and read
64 bytes of data using termios (read call will blocking for 64 bytes and baud rate - 'B2000000').For Each 100 packets received we printed the following statistic

On x86:
Start time : 1553076293 Sec, 467012 uSec
End time : 1553076293 Sec, 499350 uSec
Time difference :
32104

64*100 = 6400 bytes per 32.104 ms
Throughput = 1.594816 Mbps

On Odroid c2:
Start time : 1553076173 Sec, 320970 uSec
End time : 1553076173 Sec, 450944 uSec
Time difference :
129975

64*100 = 6400 bytes per 129.975 ms
Throughput = 0.393921 Mbps

Attached code for reference. (aarch64-linux-gnu-gcc -o test.axf test.c uart.c -pthread)
Attachments
uart.h
(192 Bytes) Downloaded 41 times
uart.c
(2.45 KiB) Downloaded 41 times
test.c
(1.52 KiB) Downloaded 37 times

User avatar
odroid
Site Admin
Posts: 35871
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1316 times
Been thanked: 910 times
Contact:

Re: Very Less USB Throughput

Post by odroid »

Thank you for sharing the loopback test method. 2Mbps full-duplex bidirectional UART test could have 4Mbps transfer speed.
I think USB packet interrupt handler in the system(or kernel)might have very long latency or the on-board USB-hub IC MTT could be a root cause.

Please try an OTG-to-Host cable something like this if you can connect a PSU to the DC barrel jack.
https://www.hardkernel.com/shop/usb2-0-otg-cable/
https://wiki.odroid.com/odroid-c2/hardw ... wer_enable

If it doesn't help, there could be a Kernel IRQ driver issue.
If kernel has a problem with the speed of USB IRQ processing, I think our ability is not enough to solve it.

nikhil jarande
Posts: 9
Joined: Sat Oct 29, 2016 4:31 pm
languages_spoken: english
ODROIDs: odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Very Less USB Throughput

Post by nikhil jarande »

Got Expected USB throughput on Odroid c2 using OTG-to-Host cable. Potentially , we can conclude that The root cause is on-board USB-hub IC MTT. Interesting fact when i connected External USB-hub (AMKETTE high speed hub 4 port usb 2.0) to OTG-to-Host cable then performance downgraded to 0.4 Mbps and same usb hub do not get me in trouble when i using it on x86.
Do you able to re-produce usb performance issue on-board USB-hub?

User avatar
odroid
Site Admin
Posts: 35871
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1316 times
Been thanked: 910 times
Contact:

Re: Very Less USB Throughput

Post by odroid »

Our USB-IO board had a similar issue when we implemented a SPI bridge.
The maximum SPI transfer rate couldn't exceed 500Kbps when we used the host port while the OTG port showed over 1.5Mbps.
Could you archive near 4Mbps with the OTG port direct connection instead of external hub?

nikhil jarande
Posts: 9
Joined: Sat Oct 29, 2016 4:31 pm
languages_spoken: english
ODROIDs: odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Very Less USB Throughput

Post by nikhil jarande »

We achieved 5.68 Mbps USB Throughput with direct OTG connection.

nikhil jarande
Posts: 9
Joined: Sat Oct 29, 2016 4:31 pm
languages_spoken: english
ODROIDs: odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Very Less USB Throughput

Post by nikhil jarande »

Do you have same result after connecting external USB hub to OTG?

User avatar
odroid
Site Admin
Posts: 35871
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1316 times
Been thanked: 910 times
Contact:

Re: Very Less USB Throughput

Post by odroid »

Yes. But we have no idea why/how usb hub controller decreases the throughput to less than 1/10. :(

nikhil jarande
Posts: 9
Joined: Sat Oct 29, 2016 4:31 pm
languages_spoken: english
ODROIDs: odroid c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Very Less USB Throughput

Post by nikhil jarande »

Sorry for late reply after we moved towards kernel 5.0 i got expected throughput for USB.

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 1 guest