Preliminary remark:
The µSD card used for the speed tests, a Samsung Pro 512GByte (2021 series) has, as I found out on the internet, a bug. This bug manifests itself in the fact that the write speed drops massively after prolonged use, while the read speed is completely normal. Fortunately, I was able to fully regenerate the card using a method recommended on the Internet, namely to write 00 bytes to it completely. I used the freeware version of the “Active@ Killdisk” program for this. Of course the card has to be partioned and formatted after that. Why for heavens sake there is no “trim” for SD cards ?
I also reactivated the petitboot bootloader in the HC4 and have now installed both Coreelec and Ubuntu on a HDD. I intentionally partitioned this HDD with GPT so that I could use enough partitions for my tests.
With this configuration, I was able to achieve the following speeds with the Samsung µSD card mentioned above:
Coreelec:
Odroid-HC4:~ # dd if=/dev/zero of=/var/media/SAMSUNG-PRO/testfile bs=1024k count=1024 oflag=direct
1024+0 records in
1024+0 records out
1073741824 bytes (1.0GB) copied, 58.881070 seconds, 17.4MB/s
Odroid-HC4:~ # dd if=/var/media/SAMSUNG-PRO/testfile of=/dev/null bs=1024k count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.0GB) copied, 13.378344 seconds, 76.5MB/s
Odroid-HC4:~ #
Ubuntu:
root@odroid:~# dd if=/dev/zero of=/media/odroid/SAMSUNG-PRO/testfile bs=1024k count=1024 oflag=direct
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 51.1421 s, 21.0 MB/s
root@odroid:~# dd if=/media/odroid/SAMSUNG-PRO/testfile of=/dev/null bs=1024k count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 13.541 s, 79.3 MB/s
root@odroid:~#
This shows that the card benefits greatly from the activated SDR104 mode when reading under both operating systems, while it remains considerably below its capabilities when writing.
For comparison:
In an USB3 card reader, which also supports the unofficial UHS-1 DDR200 mode, this card achieves 170Mbyte/s reading and 125MByte/s writing, whereby the card is formatted in FAT32 for compatibility reasons.
But there is another problem:
If I boot Coreelec directly from the µSD and then perform a soft reboot, the SD card slot is somehow “blocked” so that the card is no longer recognized and the system hangs. Only after a cold reboot it works normal again. If I do the same under Ubuntu, this does not happen. However, if I start the operating systems via the Petitboot bootloader, the soft reboot also works with Coreelec without any problems. Apparently Petitboot and Ubuntu initialize something on the card reader during the warm boot which Coreelec does not do.
Possibly this is related to three lines in the devicetree, which exist under Ubuntu but are missing in the Coreelec devicetree and which I have adopted without questioning their meaning:
aml_reboot {
compatible = “aml, reboot”;
sys_reset = <0x84000009>;
sys_poweroff = <0x84000008>;
sd_volsw_gpio = <0x11 0x06 0x00>;
sd_power_gpio = <0x11 0x03 0x00>;
sd_vddio_gpio = <0x11 0x0e 0x00>;
};
These three lines are the difference:
sd_volsw_gpio = <0x11 0x06 0x00>;
sd_power_gpio = <0x11 0x03 0x00>;
sd_vddio_gpio = <0x11 0x0e 0x00>;
Since I was too lazy to dig through the kernel resources, I don’t know what these three entries are supposed to do. Nevertheless, this is not important when booting via Petitboot, because everything works in this case.
The question remains whether it is worth activating the SDR104 mode on the compatible Odroid devices at all, but that is up to each owner of an HC4 ( and possibly a C4 ) to decide.
Enclosed for test-crazy nerds is my modified devicetree, which is only suitable for the Odroid HC4. Since the C4 is very similar, you should be able to adopt the changes after decompiling the C4 dtb to a dts file.
dtb_104.dts (67.1 KB)
dtb_104.img (57.3 KB)
If you want to give it a try then make a backup of the original dtb.img and rename dtb_104.img to dtb.img.
P.S.:
I have identified the source file containing the three lines in question, and those lines/symbols are present in the Hardkernel ubuntu sources but missing in the Coreelec sources. It is the source file reboot.c located here
and here