FORUMS
Remove All Ads from XDA

[Fix] SDcard speed Tweak

149 posts
Thanks Meter: 434
 
By alfrix, Senior Member on 29th October 2011, 09:51 PM
Post Reply Email Thread
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/show....php?t=1010807
(it isn't exactly the same since i added external-sd and option 2 is device specific)

I hope it helps

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
Attached Files
File Type: zip 98Sdfix.zip - [Click for QR Code] (192 Bytes, 2785 views)
The Following 11 Users Say Thank You to alfrix For This Useful Post: [ View ] Gift alfrix Ad-Free
 
 
30th October 2011, 08:54 AM |#2  
Senior Member
Thanks Meter: 279
 
More
You should put a disclaimer: With this fix there will be sync issue with voice and video in video recording
30th October 2011, 02:51 PM |#3  
alfrix's Avatar
OP Senior Member
Flag Rosario
Thanks Meter: 434
 
More
Quote:
Originally Posted by jaskiratsingh

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...
30th October 2011, 03:25 PM |#4  
vishal24387's Avatar
Recognized Contributor
Flag Solapur, Maharashtra
Thanks Meter: 1,981
 
More
Can u upload ur script so that we directly test it...? That will be good for every one.
30th October 2011, 03:30 PM |#5  
sakindia123's Avatar
Inactive Recognized Developer
Flag Noida
Thanks Meter: 9,667
 
More
Quote:
Originally Posted by vishal24387

Can u upload ur script so that we directly test it...? That will be good for every one.

these are already present in many roms
30th October 2011, 04:02 PM |#6  
alfrix's Avatar
OP Senior Member
Flag Rosario
Thanks Meter: 434
 
More
Quote:
Originally Posted by sakindia123

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
The Following User Says Thank You to alfrix For This Useful Post: [ View ] Gift alfrix Ad-Free
30th October 2011, 07:04 PM |#7  
vishal24387's Avatar
Recognized Contributor
Flag Solapur, Maharashtra
Thanks Meter: 1,981
 
More
Quote:
Originally Posted by alfrix

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

great work buddy...
1st November 2011, 10:23 PM |#8  
xXCorleoneXx's Avatar
Senior Member
Thanks Meter: 15
 
More
great work.
works well.
2nd November 2011, 10:45 AM |#9  
akashsgpgi's Avatar
Senior Member
Flag Gurgaon
Thanks Meter: 102
 
More
Question
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??
2nd November 2011, 11:36 AM |#10  
supergaijin's Avatar
Senior Member
Flag Honolulu
Thanks Meter: 271
 
More
Quote:
Originally Posted by akashsgpgi

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
2nd November 2011, 03:17 PM |#11  
akashsgpgi's Avatar
Senior Member
Flag Gurgaon
Thanks Meter: 102
 
More
Question
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;
Post Reply Subscribe to Thread

Tags
tweak

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes