• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[Fix] SDcard speed Tweak

Search This thread

alfrix

Senior Member
May 19, 2011
152
435
Rosario
Hello everyone, i was testing 'SD speed tweak' of CF-Root by skin1980 in KPM, and found out that it wasn't working properly, so i decided to fix it and share the results

This tweak aims to increase read speed of both internal and external sd-cards by increasing the buffer size. It should work in any firmware/rom with ROOT privileges, if the rom doesn't support loading scripts from init.d, check the bottom of the post.

Put this script in /etc/init.d with any name, for example 98Sdfix:

Code:
#!/system/bin/sh
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo "2048" > /sys/devices/virtual/bdi/179:16/read_ahead_kb;

Important! it needs execution permissions (rwxrwxrwx) it can be done in root explorer or on a terminal by doing chmod 777 /etc/init.d/98sdfix

Important! the second path 179:16 may vary according external SD size, check the path with a root explorer and adjust the script if needed.

Reboot or run the script in a terminal as root to see the effects

Info: the number 2048 is the new buffer size (original was 128), it can be anything like 256,512,1024,2048,3072,etc. you can use whichever you found best (i recommend Sd Tools to test)

Option 2 (if the above isn't working for you)

Code:
#!/system/bin/sh
echo "2048" > /sys/devices/platform/mmci-omap-hs.0/mmc_host/mmc1/mmc1:1234/block/mmcblk1/queue/read_ahead_kb; 
echo "2048" > /sys/devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/queue/read_ahead_kb;

Please notice that in the path to the file there are folders named mmc0:0001 and mmc1:1234 this last 4 numbers could vary from different firmware versions/roms check the path with a root explorer and adjust the script if needed.

Note: if the rom doesn't support loading scripts from init.d, it could work anyways using Script manager or any app like it, be sure to check "Run as Root" and 'Run at boot'

Similar Post on http://forum.xda-developers.com/showthread.php?t=1010807
(it isn't exactly the same since i added external-sd and option 2 is device specific)

I hope it helps :D

Script attached: unzip and place it in /etc/init.d please check the second path with a root explorer and adjust the script if needed
 

Attachments

  • 98Sdfix.zip
    192 bytes · Views: 2,901
Last edited:

alfrix

Senior Member
May 19, 2011
152
435
Rosario
You should put a disclaimer: With this fix there will be sync issue with voice and video in video recording

Sorry to hear that, but its not a problem of the fix (tested several times, i don't have that problem), maybe it's a slow card (Class 4 or greater is recommended for HD), or it can be some other modifications you made, try with a ramscript to see if the phone has the problem because it struggling with ram, i suggest v6supercharger with MegaRAM settings...
 

akashsgpgi

Senior Member
Aug 31, 2011
364
100
27
Gurgaon
most of the script part went over my head so can someone pls tell how to install it in a simple way??pls

i can paste the script in /etc/init.d

but what does this mean?-
please check the second path with a root explorer and adjust the script if needed??
 
Last edited:

supergaijin

Senior Member
Jun 19, 2011
1,055
271
Honolulu
most of the script part went over my head so can someone pls tell how to install it in a simple way??pls

i can paste the script in /etc/init.d

but what does this mean?-
please check the second path with a root explorer and adjust the script if needed??


"Please notice that in the path to the file there are folders named mmc0:0001 and mmc1:1234 this last 4 numbers could vary from different firmware versions/roms check the path with a root explorer and adjust the script if needed."


after placing the script, using root explore, follow the system path as mentioned: "/sys/devices/platform/mmci-omap-hs.0/mmc_host/mmc1/mmc1:1234"
means "in the sys folder, open the devices folder, then open the platform folder, then open the mmi-omap-hs.0 folder, etc. etc." until you get where you need to go.

my address on mmc1 is e624 ;)
 
Last edited:

akashsgpgi

Senior Member
Aug 31, 2011
364
100
27
Gurgaon
im going to use method 1

but in place of 2048 what should i put , i tried sd tools but i got speed in mb/s (writing 7mb/s and reading 16.7mb/s)
so what to put in place of 2048 in the script:


#!/system/bin/sh
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo "2048" > /sys/devices/virtual/bdi/179:16/read_ahead_kb;
 

nitinvaid

Senior Member
Mine is 60MB/s read and 10 in write
im going to use method 1

but in place of 2048 what should i put , i tried sd tools but i got speed in mb/s (writing 7mb/s and reading 16.7mb/s)
so what to put in place of 2048 in the script:


#!/system/bin/sh
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo "2048" > /sys/devices/virtual/bdi/179:16/read_ahead_kb;



Sent from my GT-I9003 using XDA App
 

hamzaeid

Senior Member
Dec 28, 2015
145
45
│» ©âiro™ «│
i have 32GB class 10 SD Card before this script my Writing Speed was :28.3 MB/s and Read Speed: 34.2
but after the script my Writing Speed is:16.4 :crying: but My Read Speed: 64.8 :eek: what is this ???? :confused:
 

hamzaeid

Senior Member
Dec 28, 2015
145
45
│» ©âiro™ «│
Important!
For people that can't find the second path :: like Me :D
I think this is easiest way to know the second path the first part 179 is constant put the the second part (16) it depends on you Ext SD Card Size (i tried this tweak but without modification and it work on internal sd card only but when i modified it and make it 179:32 cuz i have 32GB micro SD card it works perfectly ) :eek:
 

Top Liked Posts

  • There are no posts matching your filters.
  • 11
    Hello everyone, i was testing 'SD speed tweak' of CF-Root by skin1980 in KPM, and found out that it wasn't working properly, so i decided to fix it and share the results

    This tweak aims to increase read speed of both internal and external sd-cards by increasing the buffer size. It should work in any firmware/rom with ROOT privileges, if the rom doesn't support loading scripts from init.d, check the bottom of the post.

    Put this script in /etc/init.d with any name, for example 98Sdfix:

    Code:
    #!/system/bin/sh
    echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
    echo "2048" > /sys/devices/virtual/bdi/179:16/read_ahead_kb;

    Important! it needs execution permissions (rwxrwxrwx) it can be done in root explorer or on a terminal by doing chmod 777 /etc/init.d/98sdfix

    Important! the second path 179:16 may vary according external SD size, check the path with a root explorer and adjust the script if needed.

    Reboot or run the script in a terminal as root to see the effects

    Info: the number 2048 is the new buffer size (original was 128), it can be anything like 256,512,1024,2048,3072,etc. you can use whichever you found best (i recommend Sd Tools to test)

    Option 2 (if the above isn't working for you)

    Code:
    #!/system/bin/sh
    echo "2048" > /sys/devices/platform/mmci-omap-hs.0/mmc_host/mmc1/mmc1:1234/block/mmcblk1/queue/read_ahead_kb; 
    echo "2048" > /sys/devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/queue/read_ahead_kb;

    Please notice that in the path to the file there are folders named mmc0:0001 and mmc1:1234 this last 4 numbers could vary from different firmware versions/roms check the path with a root explorer and adjust the script if needed.

    Note: if the rom doesn't support loading scripts from init.d, it could work anyways using Script manager or any app like it, be sure to check "Run as Root" and 'Run at boot'

    Similar Post on http://forum.xda-developers.com/showthread.php?t=1010807
    (it isn't exactly the same since i added external-sd and option 2 is device specific)

    I hope it helps :D

    Script attached: unzip and place it in /etc/init.d please check the second path with a root explorer and adjust the script if needed
    1
    these are already present in many roms

    Not really, only internal sdcard is considered (179:0) wich is universal, external-sd (179:16) it's not and must be manually added