SD card speed fix (5Mbps to 15Mbps)

Search This thread

lahma69

Senior Member
Jun 19, 2010
102
58
I guess no one had really noticed, but there is a major flaw with the evo. The microsd read speed is severely limited. I just bought a new Patriot 32gb class 10 micro sdhc card, and the read speed was great on my pc, but on my evo it was getting stuck at 5Mbps oi tested with "sd card speed tester" while my write speed was correct at 11Mbps. I don't understand why all developers aren't integrating it into their roms/kernels , it doesn't make sense... All you have to do is use root explorer or some other root file manager and navigate to "/sys/devices/virtual/bdi/179:0/" and open the file "read_ahead_kb" with a text editor (with root explorer just long press the file and select "open with text editor", and if the value is anything other than 128, change it to 128 and save the file. The read speed on my new class 10 card went from 5Mpbs to 15Mbps, BIG DIFFERENCE! Only problem with doing it this way is it changes back to 4 after a reboot. There if a flashable file in the post I got this info from ( http://xdaforums.com/showthread.php?t=815557&page=19 ) but I haven't tried it. Apparently it is very easy to integrate... Enjoy the correct speeds for your card! Please visit the post to see who solved this issue, it surely wasn't me!
 
Last edited:

willy900wonka

Senior Member
Dec 14, 2009
644
74
Penguinville
If you want to increase the read ahead buffer automatically here's a gscript which does it.
Based on: echo 128 > /sys/devices/virtual/bdi/179:0/read_ahead_kb

Oops xda doesn't attach text?
Just enter the echo line in terminal.

cat /sys/devices/virtual/bdi/179:0/read_ahead_kb
echo 128 > /sys/devices/virtual/bdi/179:0/read_ahead_kb
cat /sys/devices/virtual/bdi/179:0/read_ahead_kb

Sent with Super-Sonic Vision using XDA app.
 

MrDSL

Senior Member
Nov 17, 2006
7,456
2,598
I have been wondering about my sd card speed here lately..Anyone know a free app on the market to test my speed?

cm7 has 128 already set so thats not it cause my card read seems slow.
 

Jus10o

Senior Member
Mar 11, 2010
1,431
5
mine was set to 4 as well.. What you can also do is add the echo line to a script in the init.d folder and every time the phone boots up it should echo the command to the file and change it.
 
mine was set to 4 as well.. What you can also do is add the echo line to a script in the init.d folder and every time the phone boots up it should echo the command to the file and change it.

I know I could just go searching for this, but given my physical state and my lack of lucidity bc of pain pills, im going to have to ask, lol, anyway you can put complete instructions on how to add this line to the init.d folder and have it work at every boot? Thanks so much... btw, long time no see... since heroc days lol

Sent from my sweet HTC EVO running Myn's Warm TwoPointTwo RLS 5 with all the goodies
 

njfoses

Senior Member
Jun 4, 2010
2,010
781
S Jersey
I guess no one had really noticed, but there is a major flaw with the evo. The microsd read speed is severely limited. I just bought a new Patriot 32gb class 10 micro sdhc card, and the read speed was great on my pc, but on my evo it was getting stuck at 5Mbps oi tested with "sd card speed tester" while my write speed was correct at 11Mbps. I don't understand why all developers aren't integrating it into their roms/kernels , it doesn't make sense... All you have to do is use root explorer or some other root file manager and navigate to "/sys/devices/virtual/bdi/179:0/" and open the file "read_ahead_kb" with a text editor (with root explorer just long press the file and select "open with text editor", and if the value is anything other than 4, change it to 128 and save the file. The read speed on my new class 10 card went from 5Mpbs to 15Mbps, BIG DIFFERENCE! Only problem with doing it this way is it changes back to 4 after a reboot. There if a flashable file in the post I got this info from ( http://xdaforums.com/showthread.php?t=815557&page=19 ) but I haven't tried it. Apparently it is very easy to integrate... Enjoy the correct speeds for your card! Please visit the post to see who solved this issue, it surely wasn't me!

So if its 4 then leave it at 4? If its anything else change to 128? Is that right? Your post kind of contradicts itself which is why im asking. Thanks.
 
  • Like
Reactions: WrlsFanatic

lucidox

Senior Member
Aug 11, 2010
170
20
South Florida
Anyone know what the true bandwidth for the EVO's stock 8GB card should be?

Using the stock card and the newest MIUI, I get 3MB/s write 5MB/s read.
 

gtkansan

Senior Member
Nov 28, 2007
634
48
Atlanta, GA
Just tried the edit, class 10 wintec 32 GB card went from 5.5 to 11.5 read. Write stayed about 12. Excellent. Thanks!

Now how do we setup a scrip or something to make this permanent?

EVO Sent
 

zone23

Senior Member
Feb 16, 2009
5,437
2,309
I guess no one had really noticed, but there is a major flaw with the evo. The microsd read speed is severely limited. I just bought a new Patriot 32gb class 10 micro sdhc card, and the read speed was great on my pc, but on my evo it was getting stuck at 5Mbps oi tested with "sd card speed tester" while my write speed was correct at 11Mbps. I don't understand why all developers aren't integrating it into their roms/kernels , it doesn't make sense... All you have to do is use root explorer or some other root file manager and navigate to "/sys/devices/virtual/bdi/179:0/" and open the file "read_ahead_kb" with a text editor (with root explorer just long press the file and select "open with text editor", and if the value is anything other than 4, change it to 128 and save the file. The read speed on my new class 10 card went from 5Mpbs to 15Mbps, BIG DIFFERENCE! Only problem with doing it this way is it changes back to 4 after a reboot. There if a flashable file in the post I got this info from ( http://xdaforums.com/showthread.php?t=815557&page=19 ) but I haven't tried it. Apparently it is very easy to integrate... Enjoy the correct speeds for your card! Please visit the post to see who solved this issue, it surely wasn't me!

Thanks for the tip.
 

jauger

Senior Member
Jun 9, 2008
256
86
Memphis Tennessee
Wow! what a difference, thanks for this info, reading the desire forums it looks like they are making it permanent by editing the kernel, anyone know how to do this??
 

nsxla

Senior Member
May 9, 2010
445
31
Carson,CA
Interesting, i had the value 4, changed it to 128 but my write speed didn't change but read went from 5 -> 13 - also its listing my class 4 card as class 2 - hence 2mb/write booooooo :D
 
Last edited:

n3x1s

Senior Member
Jun 16, 2010
68
8
I have a 16GB Class 6 Card from Sandisk:

Original Test:read_ahead_kb = 4
Read Speed: 4MB/s
Write Speed: 5MB/s

Test 1:read_ahead_kb = 128
Read Speed: 18MB/s
Write Speed: 6MB/s

Test 2:read_ahead_kb = 64
Read Speed: 17MB/s
Write Speed: 6MB/s

Test 3:read_ahead_kb = 32
Read Speed: 13MB/s
Write Speed: 7MB/s

Test 4:read_ahead_kb = 16
Read Speed: 10MB/s
Write Speed: 7MB/s

Test 4:read_ahead_kb = 8
Read Speed: 6MB/s
Write Speed: 6MB/s

Thanks for the tip! Good info to have.
 

WrlsFanatic

Senior Member
Jul 14, 2010
367
15
Interesting, i had the value 4, changed it to 128 but my write speed didn't change but read went from 5 -> 13 - also its listing my class 4 card as class 2 - hence 2mb/write booooooo :D
That's what he said would change.

And OP, I'm still lost. You said if the value is anything but 4 change it to 128. Is there some reason we can't change it from 4 to 128?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 39
    I guess no one had really noticed, but there is a major flaw with the evo. The microsd read speed is severely limited. I just bought a new Patriot 32gb class 10 micro sdhc card, and the read speed was great on my pc, but on my evo it was getting stuck at 5Mbps oi tested with "sd card speed tester" while my write speed was correct at 11Mbps. I don't understand why all developers aren't integrating it into their roms/kernels , it doesn't make sense... All you have to do is use root explorer or some other root file manager and navigate to "/sys/devices/virtual/bdi/179:0/" and open the file "read_ahead_kb" with a text editor (with root explorer just long press the file and select "open with text editor", and if the value is anything other than 128, change it to 128 and save the file. The read speed on my new class 10 card went from 5Mpbs to 15Mbps, BIG DIFFERENCE! Only problem with doing it this way is it changes back to 4 after a reboot. There if a flashable file in the post I got this info from ( http://xdaforums.com/showthread.php?t=815557&page=19 ) but I haven't tried it. Apparently it is very easy to integrate... Enjoy the correct speeds for your card! Please visit the post to see who solved this issue, it surely wasn't me!
    25
    Since I'm getting A LOT PM's today about this mod, I'll post the zips I made for it.

    1st is the stock #15 kernel modded to run init scripts & I threw in all the modules I had for it, perflock disabled, powersave & conservative governors, -50mV undervolted & obviously the SD card fix. And before anyone ask, this does not include my screen scaling script that I include in my ROM

    2nd is the SD card fix script itself that only runs if needed, so if your running Ziggy's latest, it doesn't run as it's not needed
    23
    I'm running Myn's 5 with one of Netarchy's kernels. Also am running one of the new Lexar 32gb Class 10 cards. My Evo's was set to a value of 4. And I'm thrilled to say that this fix worked wonderfully for me.

    Here are my SD Speed Tester results:

    Setting = Write/Read
    4 = 6/5
    8 = 6/7
    16 = 6/11
    32 = 6/12
    64 = 6/14
    128 = 6/15

    Knowing enough about Linux to be dangerous, I created a separate init.d script that will run on reboot. I'm also including adb instructions on how to install the script. akazabam @ AndroidForums has now created a flashable zip that you can use too.

    WARNING: I do not know if all Android ROMs make use of /system/etc/init.d scripts, so this may not work for you. Use at your own risk!

    ROOTED STOCK ROM USERS: Unfortunately, it seems that you folks will not be able to make use of this tweak, since it seems that the stock ROM does not utilize init.d. I do not have access to a phone running the stock ROM, so am not sure where in the boot process we can alternately insert a script to apply this tweak upon every bootup.


    First, check to see if you even have an init.d folder.

    adb shell ls /system/etc/init.d

    Your output should look something like this:

    c:\Incoming\Android>adb shell ls /system/etc/init.d
    00banner 02firstboot 04apps2sd 99complete
    01sysctl 03modules placeholder

    If you get "ls: /system/etc/init: No such file or directory" as a result, then you don't have this folder and SHOULD NOT CONTINUE.

    DOWNLOAD FLASHABLE ZIP HERE: Courtesy of akazabam @ AndroidForums

    http://www.mediafire.com/?eto9uoz2aml66cv

    Boot into recovery, flash, reboot.

    After rebooting, run the following to double-check everything worked properly.

    adb shell cat /sys/devices/virtual/bdi/179:0/read_ahead_kb

    If it says 128, you're done! I hope this helps some of you out!


    OLD MANUAL ADB INSTRUCTIONS:

    Next, please rename the attachment and remove the ".txt" extension. XDA requires a file extension on attachments.

    Next, run the below adb commands. There are 3 commands chained together here. The first will remount /system in read/write. The next will push my init file to your phone. The third will grant execute permissions on the file.

    Be sure to change the path "C:\10sdreadahead" to wherever you downloaded 10sdreadahead to.
    adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system &
    adb push C:\10sdreadahead /system/etc/init.d &
    adb shell chmod 755 /etc/init.d/10sdreadahead
    Reboot your phone now, to make sure that the tweak is applied correctly on reboot.
    After rebooting, run the following to double-check everything worked properly.
    adb shell cat /sys/devices/virtual/bdi/179:0/read_ahead_kb
    If it says 128, you're done! I hope this helps some of you out!



    NOTE: If you open up my init script in a text editor to check it, be sure to resave it with UNIX carriage returns, NOT DOS. This one bit me in the butt while I was testing! :)


    Thanks again to the OP for posting about this!!!

    UPDATE: I've adjusted the file to use /system/bin/sh instead of bash. Also, another user at AndroidForums is packaging this up as a flashable zip for me. I'm going to test it real quick and once I verify it, I'll add it to this post.

    UPDATE 2: akazabam @ AndroidForums was awesome enough to throw together a signed, flashable zip for me. I've edited the instructions accordingly.
    16
    I have been wondering about my sd card speed here lately..Anyone know a free app on the market to test my speed?

    cm7 has 128 already set so thats not it cause my card read seems slow.


    free version of the Sdcard speed tester
    7
    If you want to increase the read ahead buffer automatically here's a gscript which does it.
    Based on: echo 128 > /sys/devices/virtual/bdi/179:0/read_ahead_kb

    Oops xda doesn't attach text?
    Just enter the echo line in terminal.

    cat /sys/devices/virtual/bdi/179:0/read_ahead_kb
    echo 128 > /sys/devices/virtual/bdi/179:0/read_ahead_kb
    cat /sys/devices/virtual/bdi/179:0/read_ahead_kb

    Sent with Super-Sonic Vision using XDA app.