[ROM] B 0.8.4 based on stock HTC FroYo (04/13/2011)

segphault

Senior Member
Jan 20, 2011
122
10
0
twitter.com
blay0, I've got a suggestion for improving SD card speeds.

I noticed in your ROM that catting /sys/devices/virtual/bdi/179:0/read_ahead_kb prints a value of 128, which is a little bit on the small side to be honest. Perhaps you could chuck this into your init.rc file when you cook up B0.8?
# sd card read speed fix
write /sys/block/mmcblk0/bdi/read_ahead_kb 2048
Many users have reported that increasing the read_ahead value greatly increases SD read speeds and even write speeds get a noticeable boost, too.

Unless I'm grossly misinformed there are no drawbacks to this tweak, so not including this would be kind of silly...
 
Last edited:

BlaY0

Retired Recognized Developer
Sep 15, 2007
1,553
566
0
Medvode
blay0, I've got a suggestion for improving SD card speeds.

I noticed in your ROM that catting /sys/devices/virtual/bdi/179:0/read_ahead_kb prints a value of 128, which is a little bit on the small side to be honest. Perhaps you could chuck this into your init.rc file when you cook up B0.8?

Many users have reported that increasing the read_ahead value greatly increases SD read speeds and even write speeds get a noticeable boost, too.

Unless I'm grossly misinformed there are no drawbacks to this tweak, so not including this would be kind of silly...
You can do that by yourself... just edit /data/local/init.d/01init replacing 128 with whatever you like.

I won't do it coz 128 is the most sane value for everyone. You should also take under consideration that there are thousands of different SD cards available and every one has its own specs and may not work well with those settings.

There are drawbacks like ram usage which Legend doesn't have plenty.
 
  • Like
Reactions: segphault

segphault

Senior Member
Jan 20, 2011
122
10
0
twitter.com
You can do that by yourself... just edit /data/local/init.d/01init replacing 128 with whatever you like.
Do you mind if I post a how-to in this thread concerning how to do so? Some new users might want to apply the patch but will be unaware of how to do.

EDIT: Check the attached files for my results. All tests were performed on a 16GB Class 4 Kingston SD card, using the application "SD Tools".

I have more need for higher read speeds over write speeds, so I'm sticking with 2048. I've also noticed that in conjunction with your data2ext script, this tweak greatly improves how responsive the feel of your ROM is.
 

Attachments

Last edited:

BlaY0

Retired Recognized Developer
Sep 15, 2007
1,553
566
0
Medvode
Sure, post the howto and I will put a link to it into 1st post.

EDIT: Mind also that /data/local/init.d is wiped and repopulated from /system/etc/init.d on ROM upgrade/flash.
 

segphault

Senior Member
Jan 20, 2011
122
10
0
twitter.com
SD Card read_ahead_kb tweak

Many users have been reporting slow SD card read speeds regardless of the fact that they've a crazy-fast Class 10 card or something of a similar calibre. The issue lies within how large the read cache is, which the Android system defines at boot time. Luckily for us, we can change that with relative ease.

PRE-REQUISITES

You'll need the following:
  • Root access
  • blay0's ROM installed (duh)
  • ADB installed and functioning on a PC of your choice
  • System overlay enabled to be safe ("aufs --enable" using ADB shell or in a Terminal Emulator on your phone then reboot)
  • USB debugging enabled on your phone
You may also want to install the application SD Tools from the Android market in order to benchmark your results to see if you actually get improvements. Before you actually do all this, it's probably worth checking what your read_ahead_kb is actually set to. Using an ADB shell, plug in the following command and hit enter:



Code:
cat /sys/devices/virtual/bdi/179:0/read_ahead_kb
If the value returned is 128, then you're all set to proceed with the tweak. If it's anything else, keep reading if you want to change it.

Use your command line (cmd on Windows, terminal on Ubuntu etc etc) to enter the following command:



Code:
chmod 755 /data/local/init.d/01init
chmod 755 /sys/devices/virtual/bdi/179:0/read_ahead_kb
This will give you the correct permissions you need in order to permanently modify the file.

After you've done that, do this:



Code:
adb pull /data/local/init.d/01init
You should now have a file called "01init" in the same directory that your ADB session was initiated from. Open this file in a text editor and find the number which was printed earlier when you cat'd "/sys/devices/virtual/bdi/179:0/read_ahead_kb". This is the number you'll need to edit.



Change that number to 2048 for now and save the file in exactly the same format and location as it was before you started editing. After you've done that, you'll need to push the file back to your phone using the following command:



Code:
adb push 01init /data/local/init.d/01init
After that's done, you'll need to reboot. If you're not using data2ext, you can issue the following command and your phone will reboot automatically:
Code:
adb reboot
If you are using data2ext, you MUST turn off the phone using the power button and reboot manually.
Mind also that /data/local/init.d is wiped and repopulated from /system/etc/init.d on ROM upgrade/flash.
...in which case you'll need to do all of the above again every time you upgrade or flash.

Try different numbers using the guide above then benchmark with SD Tools and see what results you get. A general rule of thumb is to use numbers which are divisable by 4 I.E. 128, 1024, 2048, 3072, 4096 etc etc etc. If you find that a certain number gives better results, stick with it!

-EOF-
 
Last edited:
  • Like
Reactions: madmatts87

whitetigerdk

Senior Member
Jun 1, 2010
1,057
59
68
Odense
www.dkmdesign.dk
Okay sorry.. I just don't get it.. Market has an app named "SD Card Speed Boost" that fords threw exact same thing.. The app is free so if you do not want to mess with ADB you should try this app at first..

Sent from my Legend using XDA Premium App
 

segphault

Senior Member
Jan 20, 2011
122
10
0
twitter.com
Okay sorry.. I just don't get it.. Market has an app named "SD Card Speed Boost" that fords threw exact same thing.. The app is free so if you do not want to mess with ADB you should try this app at first..

Sent from my Legend using XDA Premium App
[offtopic]
Sigh... using apps which mess with things like this are bad for people who actually wish to learn. Similarly why I'm against things such as one click rooting tools etc etc. If you don't do it this way you've no idea about the things involved.
[/offtopic]
 

Zeyckler

Senior Member
Oct 28, 2010
81
5
0
Seville, Spain
twitter.com
I tried this app and changed the default value of 128 and change it to 4096 and during playback music it have small stops several times during the playing. My SD card is a Trascend Class 2 16GB. I don't tried any more values, should I try any other value?
 

MaBlo

Senior Member
Dec 21, 2010
602
101
0
I tried this app and changed the default value of 128 and change it to 4096 and during playback music it have small stops several times during the playing. My SD card is a Trascend Class 2 16GB. I don't tried any more values, should I try any other value?
Try 2048. Works great for me, I use a Transcend Class 6 4GB.

Sent from my HTC Legend using XDA App
 

Zeyckler

Senior Member
Oct 28, 2010
81
5
0
Seville, Spain
twitter.com
Try 2048. Works great for me, I use a Transcend Class 6 4GB.

Sent from my HTC Legend using XDA App
I do the steps of the tutorial, and when I rebooted the phone I use cat for the read_ahead_kb and prints "128" it is normal or it should print "2048"? I check the other file and seems to be ok, and I did chmod 777 for the read_ahead_kb.

Thanks

Edit. Nevermind I did it with su and works :D
 
Last edited:

segphault

Senior Member
Jan 20, 2011
122
10
0
twitter.com
change it to 4096 and during playback music it have small stops several times during the playing. My SD card is a Trascend Class 2 16GB
Hm, because you've a Class 2 card it probably isn't able to keep up with 4MB (4096) of read_ahead at a time. As previously suggested, try changing to 2048.

My SD card is only Class 4 and it stutters during music playback too on 2048. I'm going to try 1024 or possibly something a little higher.

A general rule of thumb is to set the value slightly higher if you have a fast card, and vice versa for slower cards.

Swyped from my Legend using the xda app
 

bodjor

Member
Jul 13, 2010
35
4
0
You can do that by yourself... just edit /data/local/init.d/01init replacing 128 with whatever you like.

I won't do it coz 128 is the most sane value for everyone. You should also take under consideration that there are thousands of different SD cards available and every one has its own specs and may not work well with those settings.

There are drawbacks like ram usage which Legend doesn't have plenty.
Another thread on this: http://forum.xda-developers.com/showthread.php?t=1010807
 

Snowtoad23

Senior Member
Jul 17, 2010
250
5
0
I'm having problems with Wi-Fi tether, not sure if specific to this rom..

When I have Wi-Fi hotspot on, my mobile internet seems to constantly drop in and out. It will technically stay 'on' (as status shown in long press power button menu), but the symbol will dissappear from the notification bar for a while and no internet will work on any tethered devices, then it comes back again after a while.
Sometimes its so bad, it only stays on for about 5 seconds before it drops out again and then turns on again..

Anyone have this problem or a fix?

Cheers
 

BlaY0

Retired Recognized Developer
Sep 15, 2007
1,553
566
0
Medvode
0.8 is out!

Check changelog and 1st post for updated instructions.

Upgrading should work (I guess) but dalvik-cache needs to be wiped!

Replacing framework-res.apk or com.htc.resources.apk will break things and your phone might end up boot-looping so don't replace either of them! Ask theme creators to supply MetaMorph or NinjaMorph patches instead.

Supplemental Arabic files are in attachment. Link to Arabic patch is now in 1st post.

PS: 2nd mirror is not yet working.
 
Last edited:

Dr.Romca

Senior Member
Dec 12, 2008
768
207
0
Prague
Hey Blay0! Great work again!

What if I take those framework files, replace some images inside and re-sign?
That should work right?

Thanks so much :)

Dr.
EDIT: Good one Snowtoad! :D
 

BlaY0

Retired Recognized Developer
Sep 15, 2007
1,553
566
0
Medvode
When you say replacing, is it ok if I just get the framework-res.apk and change some images in it (e.g. batt stat icons)?
That would be OK. Replacing images inside your current apk should work. But be careful, some files (even images) have to be stored inside with no compression! You should inspect which are those. You can of course resign and zipalign apk also.
 
  • Like
Reactions: Dr.Romca