Jump to content

USB 2.0 OTG port slow performance on PineCube (Allwinner - Sochip S3)


Disctanger

Recommended Posts

I am trying to get USB 2.0 port  to reach maximum bandwidth with OTG port (Hi-Speed - 480 MegaBits/second) on PineCube device. Currently it is performing as Full-Speed (12.5 MegaBytes/second) usb port.

I have measured the speed and performance using iperf + g_ether kernel mod + OTG port (details below)

 

Official datasheet of PineCube (https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf) tells that the port can perform up to 60 MegaBytes/second or 480 MegaBits/second.

g_webcam mod is also performing at Full-Speed mode.

 

Spoiler

root@pinecube:~/uvs-gadget# iperf3 -c 192.168.10.5 -f M
Connecting to host 192.168.10.5, port 5201
[  5] local 192.168.10.2 port 38834 connected to 192.168.10.5 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  14.0 MBytes  14.0 MBytes/sec    0    133 KBytes       
[  5]   1.00-2.00   sec  12.9 MBytes  12.9 MBytes/sec    0    165 KBytes       
[  5]   2.00-3.01   sec  13.3 MBytes  13.3 MBytes/sec    0    165 KBytes       
[  5]   3.01-4.00   sec  13.7 MBytes  13.8 MBytes/sec    0    165 KBytes       
[  5]   4.00-5.00   sec  13.0 MBytes  13.0 MBytes/sec    0    175 KBytes       
[  5]   5.00-6.00   sec  13.6 MBytes  13.6 MBytes/sec    0    252 KBytes       
[  5]   6.00-7.00   sec  12.7 MBytes  12.7 MBytes/sec    0    252 KBytes       
[  5]   7.00-8.00   sec  12.6 MBytes  12.6 MBytes/sec    0    264 KBytes       
[  5]   8.00-9.00   sec  13.1 MBytes  13.1 MBytes/sec    0    431 KBytes       
[  5]   9.00-10.00  sec  12.9 MBytes  12.9 MBytes/sec    0    431 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   132 MBytes  13.2 MBytes/sec    0             sender
[  5]   0.00-10.00  sec   131 MBytes  13.1 MBytes/sec                  receiver

iperf Done.

 

lsusb output:

Spoiler

root@pinecube:~# lsusb -v

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
 bLength                18
 bDescriptorType         1
 bcdUSB               2.00
 bDeviceClass            9 Hub
 bDeviceSubClass         0  
 bDeviceProtocol         1 Single TT
 bMaxPacketSize0        64
 idVendor           0x1d6b Linux Foundation
 idProduct          0x0002 2.0 root hub
 bcdDevice            5.15
 iManufacturer           3 Linux 5.15.43-sunxi musb-hcd
 iProduct                2 MUSB HDRC host driver
 iSerial                 1 musb-hdrc.2.auto
 bNumConfigurations      1
 Configuration Descriptor:
   bLength                 9
   bDescriptorType         2
   wTotalLength       0x0019
   bNumInterfaces          1
   bConfigurationValue     1
   iConfiguration          0  
   bmAttributes         0xe0
     Self Powered
     Remote Wakeup
   MaxPower                0mA
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        0
     bAlternateSetting       0
     bNumEndpoints           1
     bInterfaceClass         9 Hub
     bInterfaceSubClass      0  
     bInterfaceProtocol      0 Full speed (or root) hub
     iInterface              0  
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x81  EP 1 IN
       bmAttributes            3
         Transfer Type            Interrupt
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0004  1x 4 bytes
       bInterval              12
Hub Descriptor:
 bLength               9
 bDescriptorType      41
 nNbrPorts             1
 wHubCharacteristic 0x0011
   Per-port power switching
   No overcurrent protection
   TT think time 8 FS bits
 bPwrOn2PwrGood        5 * 2 milli seconds
 bHubContrCurrent      0 milli Ampere
 DeviceRemovable    0x02
 PortPwrCtrlMask    0xff
Hub Port Status:
  Port 1: 0000.0100 power
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
 Self Powered

 

armbianmonitor tool output (detailed logs) : http://ix.io/40o2

 

OS info (neofetch):

Spoiler

root@pinecube  
 -------------                                                                                                                                                                             
OS: Armbian focal (22.02.0-trunk.0003) armv7l                                                                                                                                             
Host: PineCube IP Camera                                                                                                                                                                  
Kernel: 5.15.43-sunxi                                                                                                                                                                                                                                                                                                                                                
Packages: 808 (dpkg)                                                                                                                                                                      
Shell: bash 5.0.17                                                                                                                                                                        
Terminal: /dev/pts/0                                                                                                                                                                      
CPU: Allwinner sun8i Family (1)                                                                                                                                                           
Memory: 46MiB / 111MiB                                                                                                                                                                                             

 

My questions are:

  1. How can i reach high speed on USB 2.0 port. (probably too general)
  2. Could the issue be be related to USB drivers or Device Tree set up?
Edited by Disctanger
Add important log info
Link to comment
Share on other sites

Hello Disctanger.
Have you measured the speeds that you get with OEM's officially supplied software, if the OEM supplies any?
 
It been my experience that some 'open source' OEM's quote the theoretical maximum specs if hardware and software were optimized.
Some OEM's provide very limited support for their 'open source' boards, and rely on the community to optimize the software and even the hardware.
If this is one of those OEM's, then it's up to the community (people like you) to optimize the software (or even the hardware). 
You can search these forums to see if anyone has found solutions, and sometimes someone might answer with a suggestion or a solution. 
The Armbian build system is an ideal platform for you to develop solutions, providing an easy way to apply patches and stream improvements into the build via Github pull requests.

I took a look at your logs, and I didn't spot anything obvious. Perhaps someone more familiar with your board will turn up.
Good luck :)
 

Link to comment
Share on other sites

On 6/19/2022 at 9:10 AM, schwar3kat said:

Hello Disctanger.
Have you measured the speeds that you get with OEM's officially supplied software, if the OEM supplies any?
 
It been my experience that some 'open source' OEM's quote the theoretical maximum specs if hardware and software were optimized.
Some OEM's provide very limited support for their 'open source' boards, and rely on the community to optimize the software and even the hardware.
If this is one of those OEM's, then it's up to the community (people like you) to optimize the software (or even the hardware). 
You can search these forums to see if anyone has found solutions, and sometimes someone might answer with a suggestion or a solution. 
The Armbian build system is an ideal platform for you to develop solutions, providing an easy way to apply patches and stream improvements into the build via Github pull requests.

I took a look at your logs, and I didn't spot anything obvious. Perhaps someone more familiar with your board will turn up.
Good luck :)
 

 

Thanks for your suggestions and instructions.

I will try to reach out sunxi-linux and pinecube community asking about this matter.

 

Quote

Have you measured the speeds that you get with OEM's officially supplied software, if the OEM supplies any?

I don't know anything about OEM's officially supplied software yet. I will research about this and test on officially supplied software if available.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines