yashsingh1/xdaforums huggingface dataset:
[Optimus One, P500 Android Development] franciscofranco:
In this thread you'll find a compilations of tweaks and settings to improve your phone's performance and battery.

It isn't a walk in the park, I'll strongly advise against trying these tweaks if you don't know what you're doing. I'm not responsible for any bricked device or any kinds of problems you may have when applying the following changes. If you don't know what you're doing then simply DON'T.

Changelog 1/05/2011:

Reverted few changes, and everything should work correctly and easily. Instructions how to delete the previous version below.

Fixed the files permissions. Now you don't have to do it manually for it to work.

Download:

Tweaks .zip

Patched libsqlite .zip:

(don't use this on andy's 2.3.3 and latest CM7 from mik 6.3 roms or you'll end in a bootloop or your phone will drain a lot of battery according to some users)

libsqlite.so

Data2ext: http://xdaforums.com/showthread.php?t=1042828 (thanks ungaze).

Very important:

libsqlite.so is a patched sqlite library file to turn sync off. With that change I/O should be waaay faster during db writes and reads. It only works with 2.3.x ROMs, don't bother flashing if you're with Froyo or you'll end up with a boot loop.

Instructions:

To delete the previous versions (thanks 32bits):

If you've installed any of the previously tweaks then you'll have to roll back. You have to do the following steps (this includes every possible locations):

1. Remove /system/etc/tweaks.sh

2. Remove /system/etc/init.d/00script

3. Remove /system/etc/init.d/99a

4. Remove /system/etc/init.d/99tweaks

5. Remove /data/local.prop

6. Reboot your phone.

For the .zips:

1. Download the .zips.

2. Enter recovery.

3. Flash them.

4. Reboot.

5. Done.

Prop settings, you can add them to your build.prop or local.prop:

wifi.supplicant_scan_interval=300
windowsmgr.max_events_per_sec=260
ro.lge.proximity.delay=25
mot.proximity.delay=25
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
ro.HOME_APP_ADJ=1
ro.mot.eri.losalert.delay=1000
video.accelerate.hw=1
ro.ril.disable.power.collapse=0
pm.sleep_mode=1

Don't forget to nand backup first in case something goes wrong. I'm not responsible for any problem from your part.

Thank you for your donation:

- Momaro

---------------------------------------------------------------------------------------

Different method to apply the tweaks. Make sure you thank ungaze for this script ;)

Visit this thread for a completely new method to apply these tweaks: SD Tweakz

What does it do?

-mounts SD
-checks if "scriptz" folder exists
-copies scripts from "scriptz" folder to /data partition
-sets permission to scripts
-runs all the scripts
-deletes "scriptz" folder from /data partition
-unmounts SD
-done

P.S.- Everything is pretty clear, I won't be answering anything that is specifically stated above in my post or in the following ones.
[Optimus One, P500 Android Development] sarfaraz1989:
in case u dont have root explorer

1. mount -t yaffs2 -o remount,rw /dev/block/mtdblock1 /system

2. echo 4096 > /sys/devices/virtual/bdi/179:0/read_ahead_kb

PS: u cud have integrated that read_ahead_kb in your script too..and dont u have to mount /system rw first ???

EDIT: found something !!! busybox has crontab ..Guess we can schedule the above script to execute like every half and hour or so !!!
[Optimus One, P500 Android Development] Zerobarat1:
Lol :) . How is that and battery life or performance , even remotely equivalate ?
[Optimus One, P500 Android Development] sarfaraz1989:
" ls -1 /sys/block/mtdblock* " u need to use cut and tr with it..DOesnt work

Here's My script :

mount -t yaffs2 -o remount,rw /dev/block/mtdblock1 /system

echo 4096 > /sys/devices/virtual/bdi/179:0/read_ahead_kb

for i in `ls -l /sys/block/mtdblock* | tr -s " "| cut -d " " -f 6`

do

echo "noop" > /sys/block/$i/queue/scheduler

done

echo "noop" > /sys/block/mmcblk0/queue/scheduler
[Optimus One, P500 Android Development] franciscofranco:
It increases performance and I'm sure a lot of people doesn't even remotely know how to activate HW acceleration.
[Optimus One, P500 Android Development] franciscofranco:
That's a variation, but my script works as well, been using it for a good while, but thanks anyway :)
[Optimus One, P500 Android Development] franciscofranco:
As far as I know there is no need to mount /system rw with any of those scripts, never did it before and always worked fine.
[Optimus One, P500 Android Development] freddysam:
Are you sure it is not:

windowsmgr.max_events_per_sec

?
[Optimus One, P500 Android Development] franciscofranco:
Yes it is, it was a typo, thank you.
[Optimus One, P500 Android Development] xciton:
Some observations:

If you want to use "-1" option with ls, you'll need to use busybox's version. The stock ls doesn't support it.

The Linux sysfs file system (as mounted in /sys) is by design a read-write virtual file system. No need to do anything extra to play with it, other than be root.

These commands shouldn't be run from cron, they belong in some init script, perhaps /init.rc or other appropriate startup location.
[Optimus One, P500 Android Development] ungaze:
with which benchmarking tool/app? Using SD tools but no apparent change.

@franciscofranco

sent you a PM
[Optimus One, P500 Android Development] franciscofranco:
SD Tools indeed :)

First post updated with new tweaks.
[Optimus One, P500 Android Development] sarfaraz1989:
cud somebody post differences before and after applying the patch..SOmebody benchmark 'em !!!
[Optimus One, P500 Android Development] bluviper:
so we just add the new scripts from Ungaze?

and let the previous one as is....

using GScript, these folders are missing?

silly question but, do we need to create this folders?

-----------

and also, will this work in general for all android devices regardless of ROM?
[Optimus One, P500 Android Development] Omnichron:
Thanks. any chance of making it flashable for us troglodytes...:D
[Optimus One, P500 Android Development] franciscofranco:
Yes just add the scripts, don't need to mess with the previous ones.

If it says a directory was not been found don't worry about it, sometimes dm-0 is mounted, sometimes it is not, I still haven't found out when.
[Optimus One, P500 Android Development] franciscofranco:
You won't notice benchmark improvements, instead you'll notice it in the normal usage. Benchmark don't measure real life scenarios.
[Optimus One, P500 Android Development] franciscofranco:
I don't know how to do it I'm sorry.

EDIT: I'll have a loot at it.
[Optimus One, P500 Android Development] bluviper:
to tell my experience, after installing the scripts, screen transitions is now snappy.

not like before that youll have to wait half a sec or something near that... now its instant and snappy, its cool to look at. returning to homescreen is abit faster now.

opening files on my ES explorer, unzipping etc etc. works faster now.

exploring and changing files on Root Explorer is quite faster than before.

im using LG Optimus P500....

so again my question goes... will this also work with other android phones under different ROMS?
[Optimus One, P500 Android Development] franciscofranco:
Awesome :)

It will probably work on most devices but most likely with some adjustments, nothing I can really predict unless taking a look over the phone and it's filesystems.
[Optimus One, P500 Android Development] ungaze:
lol that's weird. shouldn't matter cause terminal is the one responsible for placing those brackets. BTW, which method did you use?

could you paste the output of

ls /system/etc/init.d

from terminal?
[Optimus One, P500 Android Development] bluviper:
actually i have deleted the tweak file in that area... trying to see if that does an impact..

or maybe it will return again after i reboot.. so now umma gonna reboot and tell you the soonest on what had happened...
[Optimus One, P500 Android Development] franciscofranco:
Keep us posted. I'm here too, kinda curious on the output now.
[Optimus One, P500 Android Development] kly91:
because some are place like this

]net.tcp.buffersize.default]: 4096,87380,....
]net.tcp.buffersize.wifi]: 4096,87380,....

and so fort and so on....

[/QUOTE]

I got this type of Parenthesis arrangement too for the manually placed tweaks in the buildprop..And i don't know if it's something i need to be worried about..
[Optimus One, P500 Android Development] bluviper:
ok i finally rebooted. and no theres no tweak files there

35apps2sd
99complete
05cpuclock
02firstboot
01sysctl
00banner

now why it wasnt there? pfffftt silly me. i did'nt flashed the tweak files on recovery anyway...

but whats interesting is that, it booted my phone faster than before...

and speeds around the system is quite snappy...

and i guess im being silly if this is just a placebo effect. but yea i dont have problems browsing inside the phone...

im on Nessy #Fenice ROM.

and i applied some tweaks manually on build.prop

particularly the VM parts.

hhhmmmm
[Optimus One, P500 Android Development] franciscofranco:
If you can't make ungazes method to work for you, try either mine (adb), or kpbotbot script. But try to follow ungazes instructions exactly as he say, and I bet it will work fine to you. About the build.prop settings, at the moment you people gotta add them manually. Me and ungaze are working on it, but I bet tomorrow I'll update the first page with new info.
[Optimus One, P500 Android Development] AsherChua:
Yup got it! And I have actually really experienced improvements;) Thanks so much!!!
[Optimus One, P500 Android Development] franciscofranco:
A new update to the first page is incoming in a few hours with updated info and suggestions.
[Optimus One, P500 Android Development] franciscofranco:
First post updated with new vm-tweaks and a new method to apply the build.prop settings correctly.
[Optimus One, P500 Android Development] AsherChua:
If I've flashed it before,do I need to flash again?
[Optimus One, P500 Android Development] franciscofranco:
Which method did you use?
[Optimus One, P500 Android Development] kly91:
Will this new method still run even after reboots?

I am using the sd tweaks of ungaze and have manually edited the build.prop too..

Should i also delete those manually placed lines in the build.prop?

EDIT

After trying it without deleting the manually placed build.prop lines i got this:

Tried to check on my local.prop if i had a mistake in typing but there was none..its clearly 256960 and not 2569]0

And i think the edit on the vm tweaks works..after applying it, i didn't experience any noticeable or annoying lags at my screen..
[Optimus One, P500 Android Development] franciscofranco:
Of course it runs every reboot. As far as I know local.prop settings will override build.prop ones, but I can be mistaken here, although I'm almost positive about this, like 99% positive. You just have to place it into /data, and it will work.
[Optimus One, P500 Android Development] kly91:
Okie Dokie..thanks..how about the "]" showing in the supposedly 256960?
[Optimus One, P500 Android Development] franciscofranco:
Where? Do this: cat /data/local.prop and paste here the results
[Optimus One, P500 Android Development] kly91:
Ok i finally found the prob..the 256960 didn't fit the screen in portrait mode so terminal emulator showed

"net.tcp.buffersize.default=4096,87380,256960,4096,16384,2569]

0"

but when i run it at landscape mode it corrected itself and now show

"net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960"
[Optimus One, P500 Android Development] franciscofranco:
Good, but that's when you cat local.prop right? Better be sure than sorry ;)
[Optimus One, P500 Android Development] socialdistortion:
Just a suggestion:

The first post is now really cluttered and confusing. And all the codes are not updated (for eg: The vm tweaks are updated in the second part but the same is not updated if we download under ungaze's method)...

If it is not too much of a hassle, it would be great for all if you could make your 1st post short with only required things (deleting older unimportant stuff). It'll encourage more people to try it out.

Sorry to bother! Thanks! And cheers for the good work :)
[Optimus One, P500 Android Development] AsherChua:
Ungaze's method!
[Optimus One, P500 Android Development] franciscofranco:
Fixed the clutter. About ungaze's scripts, thats his responsibility, it's his "work". I only post his stuff to have everything together in the same place. But I think he's going to update his script soon with the new stuff. In the mean time you can update the .sh file file yourself.
[Optimus One, P500 Android Development] franciscofranco:
Update vm-tweaks.sh file then and the changes will be applied on boot.
[Optimus One, P500 Android Development] kly91:
Nope..I used getprop
[Optimus One, P500 Android Development] AsherChua:
But how do I update?
[Optimus One, P500 Android Development] ungaze:
Local.prop flashable zip download

A new method of applying some tweaks without touching the default build.prop.

Not sure why, but it seems that wifi supplicant scan interval and all tcp enhancements don't get implemented this way or even inserting the line on build.prop(at least for wifi supplicant). Anyone have an idea on this? There was a post way back about sysctl for x10, can anyone re-post it? thanks.
[Optimus One, P500 Android Development] ungaze:
first page, then just edit you vm.sh with any android text editor.

------------

My post with individual tweaks/scripts updated
[Optimus One, P500 Android Development] AsherChua:
Alright thanks!
[Optimus One, P500 Android Development] cg87:
There are a few problems I came across when I tried to run the script.

In the script,

DM=`ls -d /sys/block/dm*`;

it errors that

/sys/block/dm*: No such file or directory

I'm a noob so can someone explain to me what is wrong? Am I suppose to have this directory? Once I removed that line from the script, there's no error.

In the script,

for i in `ls -1 /sys/block/mtdblock*`

it errors that

-1: No such file or directory

I changed it to this and it runs fine.

for i in $MTD
[Optimus One, P500 Android Development] Stumpalump:
UPDATE: Screen grab of my battery life on miks beta 4 with all latest battery tweaks applied.
[Optimus One, P500 Android Development] :
I have tried to flash this local.prop and use these scripts and now my phone is stuck in bootloop =|
[Optimus One, P500 Android Development] Magnumutz:
Can someone please help me out with this?

I wanna use the tweaks but i'm a bit noobish, i would use ungaze's SD Tweakz method, but i need to know which of the scripts i should download (links please), and which are safe.
[Optimus One, P500 Android Development] ungaze:
@cg87

What ROM are you using?

@stumpalump

I'm not well acquainted with CM battery life so, is your screenie a good thing, or the other?

@KezraPlanes

Visit my SD Tweakz thread again, and flash the undo zip at the bottom. BTW, what ROM are you using? You might wanna apply the tweaks manually. The local.prop zip should provide no problem at all, it's just one file added on /data with just a few additional configs/properties.

@Magnumutz

Visit my thread again and there should now be a link to downloadable tweaks/scripts. Add them one at a time to make sure nothing's going wrong. Just read carefully and you'll know your way around.
[Optimus One, P500 Android Development] Magnumutz:
@ungaze: Thanks a lot dude!

@Everybody: Is the last tweak giving any problems to you guys?
[Optimus One, P500 Android Development] :
Hey ungaze :P

I was using mik's CM7 Beta 4 ROM. I'm now upgrading to beta 5. I found out the problem was not in the local.prob file, but rather in the SD Tweakz. I put the tweaks in the folder on the sd, flash the app, and then bootloop.

Any ideas?
[Optimus One, P500 Android Development] Magnumutz:
I juat applied applied the tweaks except the last one Sandu the strangest thing happened.

After the last reboot the quadrant score droppes juat about 300 sandu after about 5 minutes of the phone being locked, i try to unlock the phone, but the screen turns on a grey background but norhing else, so i had to reboot. After the reboot, everything was normal. Hope that doesn't happen again.
[Optimus One, P500 Android Development] ungaze:
@Kezra

Yep that is a known issue with CM7(actually an issue with my script, I'll update it as soon as I get time) and thus the warning at the top of my thread(SD tweakz). I suggest applying the tweaks manually as explained in the first page. Or use gscript/kpbotbot's method and apply the tweaks manually every boot.

@magnumutz

hope so too ;)
[Optimus One, P500 Android Development] cg87:
I'm just messing around with the kitchen and cooking my own roms. The /sys/block/dm* showed up after a reboot. But I still having some problems with changing /sys/block/dm* to 0. I put a script in the init folder and it changed mtd, loop, and ram fine but it doesnt change the dm. What am I doing wrong?
[Optimus One, P500 Android Development] franciscofranco:
I'll be honest, I have no idea. My dm block hasn't appeared anymore, I don't know why. But don't worry 'bout it.

These tweaks are working fine with CM7 beta5.
[Optimus One, P500 Android Development] ungaze:
SD tweaks updated (fix for CM7 users)
[Optimus One, P500 Android Development] franciscofranco:
Good job ungaze!

More tweaks incoming soon :) I'm just finishing my primary testing.
[Optimus One, P500 Android Development] franciscofranco:
New tweaks added. Read the changelog.

Please post feedback. My phone is fast as hell, but I don't how if the battery is fine or worse with this new tweaks, you just gotta test them yourself and decide what's best for you.
[Optimus One, P500 Android Development] Stumpalump:
Its a great thing!
[Optimus One, P500 Android Development] kly91:
can you create a flashable zip sir so i could try it..please..
[Optimus One, P500 Android Development] franciscofranco:
Save the tweaks into a file called 99mytweaks. Move it into your sdcard. Use Root Explorer or any other explorer that lets you browse /system. Copy 99mytweaks from /sdcard and paste it into /system/etc/init.d. Then on terminal do:

su
chmod 755 /system/etc/init.d/99mytweaks
reboot

Done.
[Optimus One, P500 Android Development] kly91:
thanks..however i've already done it your way as instructed in the first post....thank you so much..I've just noticed in here i was supposed to use chmod 755 but in your first post it's chmod 0700?..sorry i'm really a no knowledge person for this things..
[Optimus One, P500 Android Development] kly91:
oh hell that's fast..great tweaks..i sure wish it doesn't drain my battery for i'm using mik's cm7 right now..
[Optimus One, P500 Android Development] franciscofranco:
Don't worry, both work, you've done fine. Can you post feedback of the applied tweaks?
[Optimus One, P500 Android Development] kly91:
okie dokie..thnx mate..i'm really experiencing fast screens with my drawers and more responsive..but i can still feel the micro lags in my home screen at time and i don't know if it's caused by the beta 5 cm7 or by the tweaks or maybe by set cpu's transition time from a low clock during screen off to a higher one when at screen on..but that's all good cause it still comes smooth after minimal sec.
[Optimus One, P500 Android Development] franciscofranco:
Have you applied the local.prop settings along with ondemand governor with 480 min frequency?
[Optimus One, P500 Android Development] kly91:
yes for the local prop..i got a 245 min and 480 max during screen off and on demand..i'll try using the 480 min max but i'm really concerned cause will that not drain my battery setting it always at 480 at screen off?
[Optimus One, P500 Android Development] franciscofranco:
I'll get it simple for you: those profiles only hurt your performance. If you're using SetCPU with CM7 from mik, just uninstall SetCPU and use the CM7 config menu and set 480 min frequency and 691 max at least. Between 125 and 480 mhz bettery usage won't change, in fact it should be better with 480 since won't constantly jump frequencies that much and everything is done faster.
[Optimus One, P500 Android Development] kly91:
thanks for the info..now i'm gonna set it to 480 min..i'll see if there's a change..
[Optimus One, P500 Android Development] franciscofranco:
Good. If it doesn't change I bet it's your launcher app.
[Optimus One, P500 Android Development] kly91:
ok i've tried turning the screen off then on then browse the screen for many times then standby then browse through screens only..and now i get minimal lag for the first screen i browse..i think i got 1 lag over 10 times of trying to screen off then on then browse through screens...that's an improvement since i always notice those microlags every time i browse the screens before..but everything else is so fast now..my launcher now responds so fast unlike before..opening the app drawer and browsing through the drawer screens is far better this way..

This is really an effective tweak mate..
[Optimus One, P500 Android Development] franciscofranco:
Awesome! If you don't mind asking, which launcher are you using?
[Optimus One, P500 Android Development] franciscofranco:
Just as I thought I couldn't squeeze anything else from our phone new tweaks should be avaliable soon, thank you Google.
[Optimus One, P500 Android Development] kly91:
I'm using ADW launcher ex..
[Optimus One, P500 Android Development] franciscofranco:
LauncherPro is way faster and snappy, give it a try and get back to me ;)
[Optimus One, P500 Android Development] kly91:
yeah..but i don't like it,,.lol..i like adw cause of the dock at the app drawer..in launcher pro i only have the home button..unless there is a way that i could place other shortcuts in the app drawer using launcher pro..
[Optimus One, P500 Android Development] franciscofranco:
Of course you can. Just press one of the shortcuts of the app drawrer for a little while, then a menu appears and you can change the shortcut for whatever you want.
[Optimus One, P500 Android Development] kly91:
i mean placing the icons beside the home icon that is seen when i open the app drawer..all i could change are the icons in the dock at homescreen
[Optimus One, P500 Android Development] franciscofranco:
That's something LP can't do, but seriously, do you really need that... or does anyone really needs that...
[Optimus One, P500 Android Development] franciscofranco:
Thanks to Google I just had it updated again with new tweaks. Copy and paste everything as I changed it quite a bit. I doubt I can squeeze anything else from it, but I'll keep looking.
[Optimus One, P500 Android Development] waydownsouth:
check your PM...
[Optimus One, P500 Android Development] franciscofranco:
Thank you :)

EDIT: Fixed.
[Optimus One, P500 Android Development] kly91:
Sir francisco, what was fixed? the script?..BTW i tried using launcher pro again and its smooth..no more micro lag but i really like the drawer customization of ADW..anyway i'll sick with launcher pro yet.

one thing more..while using launcher pro and the tweaks i always get an alert from watchdog that the android media process is always at 68% cpu usage..is this ok?or will it affect anything like the battery?
[Optimus One, P500 Android Development] bluviper:
me too! im curious on what was changed on the script?!

and what are the benefits we can get..
[Optimus One, P500 Android Development] ungaze:
One thing I noticed, he removed MMC from the non-rotational flag.

@Franco

YGPM
[Optimus One, P500 Android Development] franciscofranco:
Try this:

Go to settings/application/manage applications/all, click on "media storage", and then "clear data".
[Optimus One, P500 Android Development] franciscofranco:
Most of the script was changed/updated, but after I posted here the last update (last night 5 AM for me) I got a kernel panic and after I fixed it I updated it without 2 or 3 lines I added before I had the panic.

@ungaze MMC is already flagged as non-rotational as far as I know, and I never had it on the loop before, just tried to add it for extra settings, but I think that was the cause of the panic. I'm still going to research a bit about it.