VIM4 USB device transfer speed lower than expected

Which system do you use? Android, Ubuntu, OOWOW or others?

Ubuntu

Which version of system do you use? Please provide the version of the system here:

Linux Khadas 5.15.137 #1.7.3 Ubuntu 24.04.1 LTS

Please describe your issue below:

When testing USB 3.0 transfer speed for our device it will transfer at around 1300Mbps on regular linux x86, but on the vim4 connected to the USB 3.0 port, the one close to gigabit lan, it will transfer at around 400Mbps only.

Post a console log of your issue below:

Here are the logs of the device ( thinkRF_R6000 ) information:

root@Khadas:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 005: ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet
Bus 001 Device 006: ID 2c7c:0306 Quectel Wireless Solutions Co., Ltd. EG06/EP06/EM06 LTE-A modem
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 005: ID 3830:5301 thinkRF R6000-408

root@Khadas:~/git_clones/libtrf/build/source/arm_build# udevadm info --query=all --name=/dev/bus/usb/002/003
P: /devices/platform/soc/fde00000.crg3drd/xhci-hcd-meson.0.auto/usb2/2-1
M: 2-1
R: 1
U: usb
T: usb_device
D: c 189:130
N: bus/usb/002/003
L: 0
V: usb
E: DEVPATH=/devices/platform/soc/fde00000.crg3drd/xhci-hcd-meson.0.auto/usb2/2-1
E: DEVNAME=/dev/bus/usb/002/003
E: DEVTYPE=usb_device
E: DRIVER=usb
E: PRODUCT=3830/5301/0
E: TYPE=239/2/1
E: BUSNUM=002
E: DEVNUM=003
E: MAJOR=189
E: MINOR=130
E: SUBSYSTEM=usb
E: USEC_INITIALIZED=129831604
E: ID_BUS=usb
E: ID_MODEL=R6000-408
E: ID_MODEL_ENC=R6000-408
E: ID_MODEL_ID=5301
E: ID_SERIAL=thinkRF_R6000-408_500173880002
E: ID_SERIAL_SHORT=500173880002
E: ID_VENDOR=thinkRF
E: ID_VENDOR_ENC=thinkRF
E: ID_VENDOR_ID=3830
E: ID_REVISION=0000
E: ID_USB_MODEL=R6000-408
E: ID_USB_MODEL_ENC=R6000-408
E: ID_USB_MODEL_ID=5301
E: ID_USB_SERIAL=thinkRF_R6000-408_500173880002
E: ID_USB_SERIAL_SHORT=500173880002
E: ID_USB_VENDOR=thinkRF
E: ID_USB_VENDOR_ENC=thinkRF
E: ID_USB_VENDOR_ID=3830
E: ID_USB_REVISION=0000
E: ID_USB_INTERFACES=:fe0301:020201:0a0000:
E: ID_PATH_WITH_USB_REVISION=platform-xhci-hcd-meson.0.auto-usbv3-0:1
E: ID_PATH=platform-xhci-hcd-meson.0.auto-usb-0:1
E: ID_PATH_TAG=platform-xhci-hcd-meson_0_auto-usb-0_1

root@Khadas:~/git_clones/libtrf/build/source/arm_build# udevadm info -a -p $(udevadm info -q path -n /dev/bus/usb/002/003)

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/platform/soc/fde00000.crg3drd/xhci-hcd-meson.0.auto/usb2/2-1':
    KERNEL=="2-1"
    SUBSYSTEM=="usb"
    DRIVER=="usb"
    ATTR{authorized}=="1"
    ATTR{avoid_reset_quirk}=="0"
    ATTR{bConfigurationValue}=="1"
    ATTR{bDeviceClass}=="ef"
    ATTR{bDeviceProtocol}=="01"
    ATTR{bDeviceSubClass}=="02"
    ATTR{bMaxPacketSize0}=="9"
    ATTR{bMaxPower}=="96mA"
    ATTR{bNumConfigurations}=="1"
    ATTR{bNumInterfaces}==" 3"
    ATTR{bcdDevice}=="0000"
    ATTR{bmAttributes}=="c0"
    ATTR{busnum}=="2"
    ATTR{configuration}==""
    ATTR{devnum}=="3"
    ATTR{devpath}=="1"
    ATTR{devspec}=="(null)"
    ATTR{idProduct}=="5301"
    ATTR{idVendor}=="3830"
    ATTR{ltm_capable}=="no"
    ATTR{manufacturer}=="thinkRF"
    ATTR{maxchild}=="0"
    ATTR{power/active_duration}=="2545828"
    ATTR{power/autosuspend}=="2"
    ATTR{power/autosuspend_delay_ms}=="2000"
    ATTR{power/connected_duration}=="2545828"
    ATTR{power/control}=="on"
    ATTR{power/level}=="on"
    ATTR{power/persist}=="1"
    ATTR{power/runtime_active_time}=="2545609"
    ATTR{power/runtime_status}=="active"
    ATTR{power/runtime_suspended_time}=="0"
    ATTR{product}=="R6000-408"
    ATTR{quirks}=="0x0"
    ATTR{removable}=="unknown"
    ATTR{remove}=="(not readable)"
    ATTR{rx_lanes}=="2"
    ATTR{serial}=="500173880002"
    ATTR{speed}=="5000"
    ATTR{tx_lanes}=="2"
    ATTR{urbnum}=="272108"
    ATTR{version}==" 3.10"

  looking at parent device '/devices/platform/soc/fde00000.crg3drd/xhci-hcd-meson.0.auto/usb2':
    KERNELS=="usb2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{authorized_default}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceProtocol}=="03"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="9"
    ATTRS{bMaxPower}=="0mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bcdDevice}=="0515"
    ATTRS{bmAttributes}=="e0"
    ATTRS{busnum}=="2"
    ATTRS{configuration}==""
    ATTRS{devnum}=="1"
    ATTRS{devpath}=="0"
    ATTRS{idProduct}=="0003"
    ATTRS{idVendor}=="1d6b"
    ATTRS{interface_authorized_default}=="1"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="Linux 5.15.137 xhci-hcd"
    ATTRS{maxchild}=="1"
    ATTRS{power/active_duration}=="2653736"
    ATTRS{power/autosuspend}=="0"
    ATTRS{power/autosuspend_delay_ms}=="0"
    ATTRS{power/connected_duration}=="2672076"
    ATTRS{power/control}=="auto"
    ATTRS{power/level}=="auto"
    ATTRS{power/runtime_active_time}=="2653726"
    ATTRS{power/runtime_status}=="active"
    ATTRS{power/runtime_suspended_time}=="18342"
    ATTRS{power/wakeup}=="disabled"
    ATTRS{power/wakeup_abort_count}==""
    ATTRS{power/wakeup_active}==""
    ATTRS{power/wakeup_active_count}==""
    ATTRS{power/wakeup_count}==""
    ATTRS{power/wakeup_expire_count}==""
    ATTRS{power/wakeup_last_time_ms}==""
    ATTRS{power/wakeup_max_time_ms}==""
    ATTRS{power/wakeup_total_time_ms}==""
    ATTRS{product}=="xHCI Host Controller"
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="unknown"
    ATTRS{remove}=="(not readable)"
    ATTRS{rx_lanes}=="1"
    ATTRS{serial}=="xhci-hcd-meson.0.auto"
    ATTRS{speed}=="10000"
    ATTRS{tx_lanes}=="1"
    ATTRS{urbnum}=="85"
    ATTRS{version}==" 3.10"

  looking at parent device '/devices/platform/soc/fde00000.crg3drd/xhci-hcd-meson.0.auto':
    KERNELS=="xhci-hcd-meson.0.auto"
    SUBSYSTEMS=="platform"
    DRIVERS=="xhci-hcd-meson"
    ATTRS{driver_override}=="(null)"
    ATTRS{power/control}=="on"
    ATTRS{power/runtime_active_time}=="2672092"
    ATTRS{power/runtime_status}=="active"
    ATTRS{power/runtime_suspended_time}=="0"
    ATTRS{power/wakeup}=="disabled"
    ATTRS{power/wakeup_abort_count}==""
    ATTRS{power/wakeup_active}==""
    ATTRS{power/wakeup_active_count}==""
    ATTRS{power/wakeup_count}==""
    ATTRS{power/wakeup_expire_count}==""
    ATTRS{power/wakeup_last_time_ms}==""
    ATTRS{power/wakeup_max_time_ms}==""
    ATTRS{power/wakeup_total_time_ms}==""

  looking at parent device '/devices/platform/soc/fde00000.crg3drd':
    KERNELS=="fde00000.crg3drd"
    SUBSYSTEMS=="platform"
    DRIVERS=="crg_drd"
    ATTRS{driver_override}=="(null)"
    ATTRS{power/autosuspend_delay_ms}=="5000"
    ATTRS{power/control}=="on"
    ATTRS{power/runtime_active_time}=="2672099"
    ATTRS{power/runtime_status}=="active"
    ATTRS{power/runtime_suspended_time}=="0"

  looking at parent device '/devices/platform/soc':
    KERNELS=="soc"
    SUBSYSTEMS=="platform"
    DRIVERS=="simple-pm-bus"
    ATTRS{driver_override}=="(null)"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"

  looking at parent device '/devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"



Hello @LuisDias

400Mbps you mean the speed is only 50MB/s ?

Could you provide the test resoult of iozone?

sudo mkfs.ext4 /dev/sda1
sudo mount /dev/sda1 /mnt
cd /mnt
sudo iozone -e -I -a -s 100M -r 4k -r 16k -r 512k -r 1024k -r 16384k -i 0 -i 1 -i 2 iozone

The result on our side on a Samsung USB 3.0 SSD is about: Read/Write: ~300MB/s

I am having issues mounting the one USB 3.0 hard drive I have here:

root@Khadas:/mnttest# [410689.020530][5 T0 .s] sd 0:0:0:0: [sda] tag#0 timing out command, waited 180s
[410689.042017][5 T0 .s] blk_update_request: I/O error, dev sda, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[410689.059685][5 T0 .s] Buffer I/O error on dev sda, logical block 0, async page read
[412144.544917][4 T21423 …] sd 0:0:0:0: [sda] No Caching mode page found
[412144.566222][4 T21423 …] sd 0:0:0:0: [sda] Assuming drive cache: write through
[412426.353146][6 T0 .s] sd 0:0:0:0: [sda] tag#0 timing out command, waited 180s
[412426.374464][6 T0 .s] blk_update_request: I/O error, dev sda, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[412426.396109][6 T0 .s] Buffer I/O error on dev sda, logical block 0, async page read
[412608.234214][5 T0 .s] sd 0:0:0:0: [sda] tag#0 timing out command, waited 180s
[412608.255480][5 T0 .s] blk_update_request: I/O error, dev sda, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[412608.277060][5 T0 .s] Buffer I/O error on dev sda, logical block 0, async page read
[412792.217568][0 T13 .s] sd 0:0:0:0: [sda] tag#0 timing out command, waited 180s
[412792.228019][0 T13 .s] blk_update_request: I/O error, dev sda, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0


Anyway the thinkRF device I was talking about above is a real-time signal analyser, not a hard drive, so I am not sure this test is the best way to determine if USB drivers are working correctly for the thinkRF device or not.

Can you please share you system version too ? Ubuntu, kernel, etc.

Latest version:

https://dl.khadas.com/products/vim4/firmware/ubuntu/emmc/ubuntu-24.04/vim4-ubuntu-24.04-gnome-linux-5.15-fenix-1.7.3-241129-emmc.img.xz

Any other tests I can run which does not involve a storage device ?

Do I need to configure something in the overlays for USB 3 ? or somewhere else?

No need tother setup. Could you check with a USB storage device?

can you please give me the exact model of this SSD?

We tested with Samsumg Portable SSD T5.

Do you have any newer model storage device to test with so we can both use the same? Ideally something cheap. This T5 one is old model hard to find/buy.

the T5 Samsung should transfer at 540 MB/s, so there is clearly something wrong with the vim4 USB drivers. I also tested with a Western Digital HD here WDBPKJ0050BBK-0A, which the manufactures claims should go up to 625MB/s but the max I got was 140MB/s.

This is the WD HD on vim4:

random random bkwd record stride
kB reclen write rewrite read reread read write read rewrite read fwrite frewrite fread freread
102400 4 11942 14825 11558 11647 1467 759
102400 16 33991 42221 42126 42270 5975 13492
102400 512 96844 119377 120291 122494 57411 188017
102400 1024 108560 97130 127983 139950 77872 188396
102400 16384 145238 71455 135578 145784 144332 103496

This is the same WD HD on a x86 ubuntu laptop:

kB reclen write rewrite read reread read write read rewrite read fwrite frewrite fread freread
102400 4 30707 30398 27173 28060 1597 805
102400 16 40157 78129 80422 93926 5407 13104
102400 512 89918 104810 107457 127345 57436 239821
102400 1024 155581 115944 128212 233940 158871 350992
102400 16384 71279 106082 138594 158924 165013 95648

for the small blocks it was much faster on the laptop, also the top speed was much higher 233MB/s vs 135MB/s on the Vim4

Hello @LuisDias

Please setup the scaling governor to performance and fan to high speed then check again:

echo performance | sudo tee /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo performance | sudo tee /sys/devices/system/cpu/cpufreq/policy4/scaling_governor
fan.sh high

Here is the result from my side on the Samsumg Portable SSD T5.

khadas@Khadas:/mnt$ sudo iozone -e -I -a -s 100M -r 4k -r 16k -r 512k -r 1024k -r 16384k -i 0 -i 1 -i 2
        Iozone: Performance Test of File I/O
                Version $Revision: 3.506 $
                Compiled for 64 bit mode.
                Build: linux

        Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins
                     Al Slater, Scott Rhine, Mike Wisner, Ken Goss
                     Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR,
                     Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner,
                     Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, Dave Boone,
                     Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root,
                     Fabrice Bacchella, Zhenghua Xue, Qin Li, Darren Sawyer,
                     Vangel Bojaxhi, Ben England, Vikentsi Lapa,
                     Alexey Skidanov, Sudhir Kumar.

        Run began: Mon Mar 24 10:48:35 2025

        Include fsync in write timing
        O_DIRECT feature enabled
        Auto Mode
        File size set to 102400 kB
        Record Size 4 kB
        Record Size 16 kB
        Record Size 512 kB
        Record Size 1024 kB
        Record Size 16384 kB
        Command line used: iozone -e -I -a -s 100M -r 4k -r 16k -r 512k -r 1024k -r 16384k -i 0 -i 1 -i 2
        Output is in kBytes/sec
        Time Resolution = 0.000001 seconds.
        Processor cache size set to 1024 kBytes.
        Processor cache line size set to 32 bytes.
        File stride size set to 17 * record size.
                                                                    random    random      bkwd     record     stride
              kB  reclen    write    rewrite      read    reread      read     write      read    rewrite       read    fwrite  frewrite     fread   freread
          102400       4     22054     26104     26364     27782     22318     28439
          102400      16     86321     97484     99211     99712     74097     97955
          102400     512    284657    291097    278527    282151    280349    290196
          102400    1024    284465    287529    276428    278897    277851    283162
          102400   16384    295968    295423    286906    291145    289377    295595

iozone test complete.

For some platform limitation, VIM4 USB 3.0 can’t reach such speed.

I got very similar results as my previous tests with these performance settings. I feel like USB drivers need to be updated or there is something wrong with the vim4 USB 3.0 , because my thinkrf device I mentioned at the start really should be able to at least reach the same speeds as the harddrive and it is not reaching that.

Hello @LuisDias

Could you check with the old 5.4 images?

https://dl.khadas.com/products/vim4/firmware/ubuntu/emmc/ubuntu-22.04/vim4-ubuntu-22.04-gnome-linux-5.4-fenix-1.5-230425-emmc.img.xz