Armbian + KODI (Ubuntu\Debian) for SD & USB & eMMC

Is anyone else getting ā€œInput/output errorā€ when transferring data between two external drives? Iā€™ve hoped the issues regarding IO errors were fixed in kernel 5.3 for Amlogic devicesā€¦ Iā€™m on 5.3.0-rc6-aml-g12 so perhaps I should give the final version a try.

To Khadas devs: Have other with VIM3 reported Input/output error? Especially those using khadas-vims-4.9.y which you maintain on GH, @numbqq. This was one of the main reasons for why I bought a VIM3 instead of the cheaper ODROID-N2 as Hardkernel have had massive issues regarding this (https://forum.odroid.com/viewtopic.php?f=181&t=35031).

Update:
Changing /sys/class/block/?d?/queue/max_sectors_kb from the value of 1024 to 32 still trigger the error.

My setup is as follows: A VIM3 with a ORICO Mini USB 3.0 HUB 4 Port connected to a Rocketek usb 3.0 multi Smart memory card reader with a mSD card inserted and a Seagate Expansion Desktop. Both the ORICO USB HUB and Seagate HDD are powered with an external power supply.

Update 2:
This is the patch I need which Amlogic worked out for g12 devices:
dwc3/core: xHCI host not responding to stop endpoint command

I canā€™t seem to find the patch in Kernel 5.3 patch notesā€¦ So I suppose it isnā€™t merged yet. Iā€™ve asked balbes if he can include the patch into the next build with Armbian. I highly advice the Khadas team to look into this as it should also affect others using kernel 4.9.

@Frank Please follow up.

@Z11ntal33r
Hello , I use a hub and two usb drivers .
First I mount two usb drivers in /mnt

khadas@Khadas:/mnt$ sudo mount /dev/sda2 usb1/
khadas@Khadas:/mnt$ sudo mount /dev/sdb1 usb2/

Then I cp a file to USB1 from USB2

khadas@Khadas:/mnt/usb2$ sudo cp ldlinux.sys ../usb1/
khadas@Khadas:/mnt/usb2$

I donā€™t find any error.Can you tell me how to reproduce ?

Device: VIM3 Pro (A311D)
DTB: meson-g12b-a311d-khadas-vim3.dtb
Installation procedure: Complete step-by-step guide for installing Armbian on VIM3

After I completely wiped eMMC, I installed VIM3_Pie_V190907 to eMMC. Then I installed Armbian_5.95_Aml-g12_Debian_buster_default_5.3.0-rc6_20190904 to eMMC.

Both my mSD and USB HDD are mounted in fstab with:

echo ā€˜UUID=SD_UUID /mnt/mSD ext4 noatime,nofail,defaults 0 0ā€™ >> /etc/fstab
echo ā€˜UUID=SEAGATE_HDD_UUID /mnt/usb ext4 noatime,nofail,defaults 0 0ā€™ >> /etc/fstab

If I try to copy a file from my mSD to my Seagate HDD either with the simple cp command (cp /mnt/mSD/file1 /mnt/usb/) or using mc (midnight commander), Iā€™m facing the error. Iā€™ve never had any issues with this on my RPi, but this is the first time Iā€™ve been using the USB3 interface, which allows much higher speeds.

Example: Copying a 20GB file from my mSD to my HDD I hit over 70 MB/s and after 4-7 seconds, everything halt and then I get the error. The error is likely related to high speeds over USB3 interface as seen from Hardkernel forums. So in order to reproduce this, youā€™ll need a USB3 hub and that all devices use USB3 to get high enough speeds to trigger this. If you follow some of the steps which people recommend over at Hardkernelā€™s forum, Iā€™m sure you should be able to reproduce this. This should also affect VIM3_Ubuntu-server-bionic_Linux-4.9_arm64_EMMC_V20190830 builds etc.

@Frank, I recommend contacting Amlogic too as they created the patch for Hardkernel and theirā€™s ODROID-N2 to fix the IO issue for meson-g12b (he.he <he.he@amlogic.com signed the patch).

As soon as @balbes150 include the fix dwc3/core: xHCI host not responding to stop endpoint command into his next Armbian build, Iā€™ll be able to test if the fix also covers VIM3 and not only ODROID-N2.

@Z11ntal33r OK , I will try with USB3.0 HUB

Everything has to be USB3.0. You should at least read disk A at 100 MB/s and write to disk B at 70+ MB/s simultaneously. Use rsync which shows current speed :+1:

rsync -a --info=progress2 src/ dest/

Iā€™ve not tested dummy files created by dd, but they should as well trigger this error. So test different dummy files from 1 GB to 50 GB.


Iā€™ll do some more testing as soon @balbes150 has included the XHCI patch into his next Armbian build :slight_smile:

If the patch does not solve this Iā€™ll try the USB2 port on my VIM3 to see if the USB2 interface is affected as well. Iā€™ve not tested USB2 yet as it should be fine. Time will tell.

Update:
@Frank, if you get the same error as I did, you need to try the patch dwc3/core: xHCI host not responding to stop endpoint command which solved the issue for me as Iā€™m now able to copy/move files between two drives over USB3.0 interface simultaneously. The patch should be added to the vendor kernel Khadas use for VIMs to prevent others from facing the same issue. The patch will eventually be merged upstream into mainline if either Amlogic or Hardkernel follow it up. More info at Hardkernels forum.

It took 12 days, incorrect infa (links) is present on the page. Do you have plans of removing the references LE and Armbian this page ?

@balbes150, latest 5.96 image with 5.3.0 kernel, wifi doesnā€™t work using khadas vim1, i am using also approriate vim1 dtb?

@balbes150 I didnā€™t delete it, but I changed the content of the document. Do you think there is something wrong with the document now? If you tell me where, I donā€™t see any mistakes in this revised document.

@Frank, have you done any further testing over the USB3.0 interface?

At least the xHCI patch Amlogic made for Hardkernel and Odroid-N2 fixed the issue for me. More information about it in my last post. balbes150 has included the patch into his Github repository 150balbes/Amlogic_s905-kernel with his latest commit v20190918. So meson-g12 users wonā€™t be affected by the issue anymore :+1:

You need to remove the reference LE and Armbian from this page. The description on this page does not match the currently used system startup LE and Armbian (this misleads users).

1 Like

Iā€™ve to agree with balbes here as it is not necessary to example copy the appropriate DTB file as the script uses the DTB name in /extlinux/extlinux.conf and/or uEnv.ini which the user has to type in to boot Armbian / LE.

What I recommend is to split up and add a new section for LE and Armbian on the same page with the complete guide I posted earlier. You are free to use it and do any modifications as you want. Here is the post: Complete step-by-step guide for installing Armbian / LE

1 Like

and whatā€™s more, it is harmful (to copy and rename DTB to dtb.img), then the automatic kernel update by standard apt tools will be broken.

Yeah. Iā€™ll change it by my self and propose a file change. It should be done in the next 10 minutes.

Update: Done - https://github.com/khadas/khadas_docs/pull/168

1 Like

@Z11ntal33r I test it with one USB3.0 hub && one USB3.0 U-disk && one SSD .
In SD_USB/VIM1_Ubuntu-server-bionic_Linux-5.3-rc4_arm64_SD-USB_V20190830.7z. I get the same error with you .
In VIM1_Ubuntu-xfce-bionic_Linux-4.9_arm64_EMMC_V20190830.7z.This error did not occur.

@balbes150 OK,I understand what you mean.

@balbes150 CE and Armbian are separate

Iā€™m not sure why you are testing a meson-gxl device (VIM1) when Iā€™ve a meson-g12 device (VIM3) and clearly point out that Amlogic has fixed this for Hardkernel and theirs Odroid-N2ā€¦ Have you read some of the posts at Hardkernels forum regarding this issue?

I can confirm that the xHCL patch provided by Amlogic devs fixed the issue for me on my VIM3 as well. However, itā€™s not 100% perfectly fine as it seems that every first time I copy/move files from one ext. device to a new ext. device the transfer halts after some seconds before it continues (before the patch it triggered the IO error). Balbes150 has included the patch into his GH repository with the latest commit v20190918, so Armbian users with a meson-g12 wonā€™t be affected of this further.

I suggest that you devs do some proper testing for meson-g12 devices with the latest vendor kernel - which Iā€™ve not tested. I would recommend contacting Amlogic to hear from them as they made this patch for Hardkernel, which is also fixing the problem for VIM3.

Have a good weekend!

@Z11ntal33r Thank you pathch and you suggest . Itā€™s very useful for us.

I donā€™t see any changes on the documentation page on the site. All systems are listed together.