Fix for slow SD card speed with HTC's Froyo Kernel

Search This thread

frankoid

Senior Member
Oct 21, 2010
119
69
Google Pixel 4a
There have been quite a few complaints about slow SD card speeds with Froyo/Sense ROMs (e.g. http://forum.xda-developers.com/showthread.php?t=778748).

I've looked into the problem and discovered that the poor performance is due to HTC reducing the readahead settings in their kernel.

I've attached a prebuilt kernel (as a flashable zip using Koush's AnyKernel) and a kernel source patch that fix this. Let me know how you get on :)

EDIT: if you prefer Richardtrip's kernel to the stock one, use the update zip here, or v5 or later of his kernel, instead of kernel_2.6.32-frankoid.zip

To see whether your kernel needs the fix you need to run a command with your phone plugged in to your computer. On Linux and OS X you need to include quotes, like this:
Code:
adb shell 'cat /sys/devices/virtual/bdi/179:0/read_ahead_kb'
If you are using Windows don't include the quotes - run this:
Code:
adb shell cat /sys/devices/virtual/bdi/179:0/read_ahead_kb
If it returns 4 then you need the fix. If it returns 128 you don't need it.

If you are a developer and you'd like to incorporate this fix into your ROM without having to change the kernel see this post for instructions on how to edit init.rc to change the readahead setting.
 

Attachments

  • kernel_2.6.32-frankoid.zip
    3.9 MB · Views: 3,102
  • bravo-2.6.32_sd_speed_fix.diff.txt
    599 bytes · Views: 2,334
Last edited:

frankoid

Senior Member
Oct 21, 2010
119
69
Google Pixel 4a
Will flashing this remove OC? I'm running Richards kernel and not stock. Will your zip file overwrite?
I'm not sure, I don't overclock myself. I have turned off perflock in this kernel though so it might work.

You could always give it a try and restore a nandroid backup if you lose OC.

The best thing in the long run would probably be to ask Richard to apply the patch to his kernel.
 

eViL D:

Retired Recognized Developer
Jun 14, 2006
4,479
1,338
Nice, gonna check it out. Do you have any statistics?

*edit, this has already been pushed upstream to .35+ kernels.
 
Last edited:

bobbenedetti

Senior Member
Aug 7, 2007
173
9
Beaconsfield
I installed it on a Telus HTC Desire SLCD with LeeDroid 2.2d and tested it on a class 10 card with SD Speed Card Test..My write speed remained at the 2MB/s it showed before (same on a Class 6 and Class 2 card) but the read speed jumped to 13MB/s.
Any thoughts why the write speed didn't show the same increase as read?
Good start I love the increased read speed..it would be nice to see a similar increase in writing..

Good work
 

hover99

Senior Member
Apr 14, 2010
144
12
Vienna
Wow many great thanks !!!

Before:
Write 4 mb/s
Read 6 mb/s

After:
Write 4 mb/s
Read 13 mb/s

On my PC i have a read speed around 19 mb/s, but 13 mb/s is fabulous enough, more write speed would be nice, but i 4 mb/s is ok for the moment..

Im using this ROM: http://forum.xda-developers.com/showthread.php?t=773997
so this should work on every Froyo Sense ROM :)

PS: the gallery is now so f*** fast this is great ;-)
 
Last edited:

hamdir

Recognized Contributor
Aug 13, 2008
33,250
27,106
Beirut
twitter.com
Wow many great thanks !!!

Before:
Write 4 mb/s
Read 6 mb/s

After:
Write 4 mb/s
Read 13 mb/s

On my PC i have a read speed around 19 mb/s, but 13 mb/s is fabulous enough, more write speed would be nice, but i 4 mb/s is ok for the moment..

Im using this ROM: http://forum.xda-developers.com/showthread.php?t=773997
so this should work on every Froyo Sense ROM :)

PS: the gallery is now so f*** fast this is great ;-)

do you richard's UVOC installed?
 

whvnx

New member
Aug 11, 2010
4
0
This kernel certainly will replace Richard's. Just tried it minutes ago. In the SetCPU, the max speed goes back to 998 Mhz instead of Richard's 1330 Mhz.
 

frankoid

Senior Member
Oct 21, 2010
119
69
Google Pixel 4a
Not working in RcmixHD..!!!

In which ROM did you try OP..??

I'm using my own ROM based on RUU_Bravo_Froyo_O2_UK_2.14.207.1. This kernel should work on most Froyo/Sense ROMs that use the stock kernel. If your Sense ROM uses a custom kernel ask the ROM's developer to apply this patch. This patch is not necessary for non-Sense ROMs.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    There have been quite a few complaints about slow SD card speeds with Froyo/Sense ROMs (e.g. http://forum.xda-developers.com/showthread.php?t=778748).

    I've looked into the problem and discovered that the poor performance is due to HTC reducing the readahead settings in their kernel.

    I've attached a prebuilt kernel (as a flashable zip using Koush's AnyKernel) and a kernel source patch that fix this. Let me know how you get on :)

    EDIT: if you prefer Richardtrip's kernel to the stock one, use the update zip here, or v5 or later of his kernel, instead of kernel_2.6.32-frankoid.zip

    To see whether your kernel needs the fix you need to run a command with your phone plugged in to your computer. On Linux and OS X you need to include quotes, like this:
    Code:
    adb shell 'cat /sys/devices/virtual/bdi/179:0/read_ahead_kb'
    If you are using Windows don't include the quotes - run this:
    Code:
    adb shell cat /sys/devices/virtual/bdi/179:0/read_ahead_kb
    If it returns 4 then you need the fix. If it returns 128 you don't need it.

    If you are a developer and you'd like to incorporate this fix into your ROM without having to change the kernel see this post for instructions on how to edit init.rc to change the readahead setting.
    3
    try to change the values in /sys/devices/virtual/bdi/179:0/read_ahead_kb and check with SD card speed test for any improvements.

    I've got on average 10Mb/s W and 13Mb/s R with stock rooted froyo and RichardTrip V5 kernel
    1
    Thanks to inspiration from sibere I have come up with a way of increasing the readahead without changing the kernel. Instead we can add a line to init.rc - search for "SD card speed fix" in the attached init.rc to see what you need to add. EDIT: changed the path in init.rc to one that hopefully works with all Desires.

    I've made a complete flashable update zip including this fix, see here. EDIT: the path I used in that update zip doesn't work on all Desires and I haven't had time to update it, let me know if you'd like me to fix it.

    Unfortunately I can't easily make a flashable zip to apply the init.rc change to other ROMs because init.rc is on the boot partition so you need to unpack/repack boot.img to change it.
    1
    does this require s-off?
    1
    During chatting in Leedroid IRC i figgured out that my kernel returns 8 when executing this cat command. For some reason i was the only one in the Chat with that Number, i dont know how or why that is. Fakt is that my sd Card sucks before. But after i flashed snq seperated Kernel my SD Card Speed is as class specs should be. Now the cat command returns 128 as it should be.
    So to be sure, even when you have Leedroids Rom flashed to check your cat read_ahead command !

    /dev