RPi | Double SDcard IO (Read/Write speeds)

Guides and tutorials for various stuff. Posted by DietPi users.
User avatar
Fourdee
Site Admin
Posts: 2783
Joined: Tue Feb 06, 2007 1:36 pm

RPi | Double SDcard IO (Read/Write speeds)

Post by Fourdee »

I love Raspberry Pi's and I have been using them for years. Its also the very 1st DietPi image I created.

One of my major gripes with the RPi, is the limited performance of the SDcard IO (read and write) speed:
This is a known limitation with all Raspberry Pi's and only 17.5mb/s read and write can be achieved. Whereas, other SBC's (eg: Odroid C1/2) can offer SDcard IO performance at 40+mb/s

You can double the read and write performance to 35mb/s on all Raspberry Pi's:
sd_overclock.png
How?
First and foremost.
Make sure you have at least a UHS-1 capable SD card. Increasing the SDcard clock speed can cause data corruption if the card isnt capable. So please backup your data before hand using dietpi-backup to another location other than the SDcard (eg: USB Drive).
I've personally tested on Sandisk Extreme 16GB UHS-1 and UHS-3 cards and can confirm stability. Other brand SD card milage may vary, so this is at your own risk.

Ok, let do it
Simply add the following line to /boot/config.txt. For DietPi users, this will need to be applied to the Ramdisk location /DietPi/config.txt.

Code: Select all

#dtoverlay=sdhost,overclock_50=84 #Outdated, but may still be functional
dtparam=sd_overclock=100
What this does is increase the SDcard bus from 50mhz to 84/100mhz.

Confirm SDcard IO read/write speeds:
After rebooting your system, simply run dietpi-config and select tools from the menu to run a SDcard benchmark.

What is DietPi?
At its core, DietPi is a highly optimized minimal image with various tools, including automated installation and optimizations of optional popular software. Ensuring you get the most from your device, and the software you choose to install.
Find out more: http://DietPi.com.


Mentions:
Many thanks to GTR2FAN on the RPi forums: https://www.raspberrypi.org/forums/view ... 92#p921692
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Rich.T.
Posts: 14
Joined: Mon Nov 16, 2015 3:02 am

Re: RPi | Double SDcard IO (Read/Write speeds)

Post by Rich.T. »

This worked brilliantly on one of my installations (no proof, sorry), but I must reiterate the point that it can cause problems.
I have been doing some testing (and repeated re-installing) over the last couple of days on a Pi 3 (with some older 4GB SD cards) and discovered that each time I enabled this in my configuration file, it caused the onboard wifi to disappear. :twisted:

Please watch out for this...
User avatar
Fourdee
Site Admin
Posts: 2783
Joined: Tue Feb 06, 2007 1:36 pm

Re: RPi | Double SDcard IO (Read/Write speeds)

Post by Fourdee »

Rich.T. wrote:This worked brilliantly on one of my installations (no proof, sorry), but I must reiterate the point that it can cause problems.
I have been doing some testing (and repeated re-installing) over the last couple of days on a Pi 3 (with some older 4GB SD cards) and discovered that each time I enabled this in my configuration file, it caused the onboard wifi to disappear. :twisted:

Please watch out for this...
Hi Rich,

Great find. As the internal WiFi runs off the SDIO bus (https://www.raspberrypi.org/blog/raspbe ... t-1253749), it appears the upped frequency clock kills the WiFi.

I'am not sure if this is true, but I read somewhere (rpi forums, a while back) that setting the core_freq to 250mhz might allow for the increased SD card clock and WiFi. Bit of a trade off and Its untested, but I will give this a go over the weekend and report results.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
beerenheini
Posts: 16
Joined: Tue Mar 15, 2016 2:56 pm

Re: RPi | Double SDcard IO (Read/Write speeds)

Post by beerenheini »

Fourdee wrote:
Rich.T. wrote:This worked brilliantly on one of my installations (no proof, sorry), but I must reiterate the point that it can cause problems.
I have been doing some testing (and repeated re-installing) over the last couple of days on a Pi 3 (with some older 4GB SD cards) and discovered that each time I enabled this in my configuration file, it caused the onboard wifi to disappear. :twisted:

Please watch out for this...
Hi Rich,

Great find. As the internal WiFi runs off the SDIO bus (https://www.raspberrypi.org/blog/raspbe ... t-1253749), it appears the upped frequency clock kills the WiFi.

I'am not sure if this is true, but I read somewhere (rpi forums, a while back) that setting the core_freq to 250mhz might allow for the increased SD card clock and WiFi. Bit of a trade off and Its untested, but I will give this a go over the weekend and report results.
I can confirm that wifi stops working for me.. unfortunately. Maybe the overclockig frequenzy could be lowered so wifi plays nice.


Edit:
changing the sdhost value to either 50, 63 or 84 does not work, even if core_freq is set to 250. :(
User avatar
Fourdee
Site Admin
Posts: 2783
Joined: Tue Feb 06, 2007 1:36 pm

Re: RPi | Double SDcard IO (Read/Write speeds)

Post by Fourdee »

beerenheini wrote: I can confirm that wifi stops working for me.. unfortunately. Maybe the overclockig frequenzy could be lowered so wifi plays nice.


Edit:
changing the sdhost value to either 50, 63 or 84 does not work, even if core_freq is set to 250. :(
Hi Beerenheini,

Thanks for testing and letting us know the results. Its a shame SD overclock breaks RPi 3 WiFi. I've got so used to having 30mb/s +, I cant use a RPi without it lol.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: RPi | Double SDcard IO (Read/Write speeds) on RPi 3

Post by k-plan »

Hi,
Rich.T. wrote:over the last couple of days on a Pi 3 and discovered that each time I enabled this in my configuration file, it caused the onboard wifi to disappear.
on a Raspberry Pi 3, you can try:

Code: Select all

dtoverlay=sdhost,overclock_50=100
You can try other, lower overclock settings, as long as the number is an integer divisor of the core clock (default is 400 MHz on the Pi 3), e.g. 50, 80, or 100.

http://www.jeffgeerling.com/blog/2016/h ... berry-pi-3

And if it kills your WiFi connection:
Name: sdhost
Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock.
N.B. This overlay is designed for situations where the mmc driver is
the default, so it disables the other (mmc) interface - this will kill
WiFi on a Pi3. If this isn't what you want, either use the sdtweak
overlay or the new sd_* dtparams of the base DTBs
https://github.com/raspberrypi/firmware ... EADME#L915

you should try out the new " sdtweak-overlay.dtb " like:

Code: Select all

dtoverlay=sdtweak,overclock_50=100
https://github.com/raspberrypi/firmware ... EADME#L977

Code: Select all

:~# cat /proc/version
Linux version 4.4.16+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #899 Thu Jul 28 12:36:19 BST 2016


:~# /boot/overlays/sd*
sdhost.dtbo     sdio-1bit.dtbo  sdio.dtbo       sdtweak.dtbo

If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
User avatar
Fourdee
Site Admin
Posts: 2783
Joined: Tue Feb 06, 2007 1:36 pm

Re: RPi | Double SDcard IO (Read/Write speeds) on RPi 3

Post by Fourdee »

k-plan wrote: And if it kills your WiFi connection:
Name: sdhost
Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock.
N.B. This overlay is designed for situations where the mmc driver is
the default, so it disables the other (mmc) interface - this will kill
WiFi on a Pi3. If this isn't what you want, either use the sdtweak
overlay or the new sd_* dtparams of the base DTBs
https://github.com/raspberrypi/firmware ... EADME#L915

you should try out the new " sdtweak-overlay.dtb " like:

Code: Select all

dtoverlay=sdtweak,overclock_50=100
https://github.com/raspberrypi/firmware ... EADME#L977

Code: Select all

:~# cat /proc/version
Linux version 4.4.16+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #899 Thu Jul 28 12:36:19 BST 2016


:~# /boot/overlays/sd*
sdhost.dtbo     sdio-1bit.dtbo  sdio.dtbo       sdtweak.dtbo

K-plan you legend :). Have you tried this, running stable? If so, i'll look at adding it to dietpi-config.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: RPi | Double SDcard IO (Read/Write speeds)

Post by k-plan »

Hi,
Fourdee wrote: CODE: SELECT ALL
dtoverlay=sdtweak,overclock_50=100

K-plan you legend . Have you tried this, running stable? If so, i'll look at adding it to dietpi-config.
Tried? Yes, on RPi 3 and RBi Zero with a cheap Verbatim 8GB Class 10 / UHS Class 1 Micro SDHC

RPi Zero on DietPi v129 (default):
RPi Zero v129 (default)
RPi Zero v129 (default)
RPi Zero on DietPi v129 (sdtweak,overclock_50=100):
RPi Zero (SD overclock)
RPi Zero (SD overclock)

RPi 3 on DietPi v129 (default):
RPi 3 v129 (default)
RPi 3 v129 (default)
RPi 3 on DietPi v129 (sdtweak,overclock_50=100):
RPi 3 (SD overclock)
RPi 3 (SD overclock)

NEW:
RPi 3 witch ScanDisk Extreme 16GB (UHS Class 3 Micro SDHC) on DietPi v128 (default):
RPi 3 ScanDisk Extreme v128 (default)
RPi 3 ScanDisk Extreme v128 (default)
RPi 3 witch ScanDisk Extreme 16GB (UHS Class 3 Micro SDHC) on DietPi v128 (sdtweak,overclock_50=100):
RPi 3 ScanDisk Extreme v128 (SD overclock)
RPi 3 ScanDisk Extreme v128 (SD overclock)
It's works as well on a RPi B with

Code: Select all

dtoverlay=sdhost,overclock_50=84

Stable?
Not really tested. This are only my devices for huntig bugs, no productive use.


On my RPi 3 can't test with on board wifi, because I have break the support for brcmfmac interface ...


Adding it to dietpi-config?
Sure, but only with hint as experimental feature.
Last edited by k-plan on Sun Aug 21, 2016 3:59 pm, edited 2 times in total.
Reason: New: RPi 3 ScanDisk Extreme v128 / broken brcmfmac interface support (my fault)
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
greavette

Re: RPi | Double SDcard IO (Read/Write speeds)

Post by greavette »

Sorry for bringing back to life an old thread from the summer...but I'd like to confirm a few things since the original post by Fourdee and the followup post from K-Plan have slightly different details.

To overclock the SD card I need to edit this file on my DietPi - /DietPi/config.txt

In that file (anywhere? Does it matter where I put this) I add the line:

Code: Select all

Fourdee - dtoverlay=sdhost,overclock_50=84
k-plan   - dtoverlay=sdtweak,overclock_50=100
Which do I use? In k-plans post it mentions that
"You can try other, lower overclock settings, as long as the number is an integer divisor of the core clock (default is 400 MHz on the Pi 3), e.g. 50, 80, or 100."
This seems to say that I need to use only values of 50, 80 or 100...and not 84? When can I use Fourdee's suggestion of 84 and when should I not?

and when do I need to install the sdtweak-overlay.dtb? I don't use wifi on my Pi 3 so do I only add this if I want to use wifi?

Lastly...if DietPi uses Ramlog anyway so there is no writes to the card when using dietpi...will overclocking the SD parms in config.txt greatly improve performance due to increased Read speeds?

Thank you.
User avatar
Fourdee
Site Admin
Posts: 2783
Joined: Tue Feb 06, 2007 1:36 pm

Re: RPi | Double SDcard IO (Read/Write speeds)

Post by Fourdee »

This seems to say that I need to use only values of 50, 80 or 100...and not 84? When can I use Fourdee's suggestion of 84 and when should I not?
From what I remember during testing. I got the same results with 84/100mhz using Sandisk extreme uhs-3. But to confirm clocks, check dmesg for mmc entries.
In that file (anywhere? Does it matter where I put this) I add the line:
Anywhere is fine.
Which do I use? In k-plans post it mentions that
Either should work fine.
and when do I need to install the sdtweak-overlay.dtb? I don't use wifi on my Pi 3 so do I only add this if I want to use wifi?
Setting dtoverlay=sdhost,overclock_50=84 does everything for you. To enable WiFi again, simply disable the line and reboot.
Lastly...if DietPi uses Ramlog anyway so there is no writes to the card when using dietpi...will overclocking the SD parms in config.txt greatly improve performance due to increased Read speeds?
Loading times are vastly reduced. Desktop users should notice a major improvement. Generally, the RPi will feel much more responsive.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Post Reply