[PATCH] ondemand deep cpuidle detection - Galaxy S I9000 Android Development

[EDIT: Feel free to jump to comment #9]
[EDIT2: last version of the patch to apply to the kernel is in comment #25, applying the patch to the kernel source is all you need to test]
[EDIT3: changed name to deep cpuidle, I figured "deep sleep" is usually meant as "suspend-to-ram" and this has nothing to do with suspend, suspend is entered at fixed SLEEP_FREQ and the cpu frequency is irrelevant during suspend because CPU power is cut-off]
On my galaxy S I've been monitoring my cpufreq stats and the stats/total_trans keeps increasing every second or so with default cpufreq values and ondemand governor, when the screen is off and the cellphone is idle. This means the cpu spends some time spent at the high frequency even if the cellphone is idle and screen off.
I noticed if I increase the ondemand/sampling_rate from the default 40000 (on i9000) to 80000 the total_trans go down to one every 10 or 20 sec. But I want to decrease the sampling_rate to 20000 so it takes only 20msec to jump to 1ghz. 40msec (the default) is too much. 40msec means 25hz but the first image frame would get lost because it'd be rendered at 100mhz instead of 1ghz. at 20msec of sampling_rate the frequency is 50hz so if the first frame is lost we're still down to 25hz which is less noticeable to the eye. I think 20000 is the max that sampling_rate should be set for decent responsiveness.
However if I drop the sampling_rate to 20000 as I prefer, when the screen is off the stats/total_trans increases even faster at a couple per second, than with the default of 40000, so sampling_rate 20000 is ideal for responsiveness but it will waste power when the screen is off.
So my solution is to force the max frequency allowed by the cpu policy to the min frequency when the screen is off. After that I can easily set sampling_rate to 20000 and io_is_busy to 1, by adding this the init.rc of the initramfs. I prefer io_is_busy to be 1, because 100mhz is really slow and the I/O will take some significant percentage of CPU too if set at 100mhz, and especially because after the I/O is complete I'll avoid losing one frame.
write /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy 1
write /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate 20000
I'm also testing with up_threshold 80 but I'm not sure if it is better or worse... need to do more tests on the below one, could be a bad idea.
write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 80
This way I can tune the ondemand as aggressive as I need without sacrificing the powersaving when the screen is off. In fact it should use less power now when the screen is off than before.
The patch is for the ginger update2 kernel, running 2.3.4 XXJVR using the kernel modules of XXJVS (I rolled back the userland and initramfs to JVR because JVS disconnects wifi for me).
I've noticed there's a smartass2 governor which I didn't try, it may work better than this, but I tend to trust the ondemand governor to be the best for responsiveness, and my approach is much simpler than the smartass2 governor, I'm not in a mood of doing beta testing or risking instability for a feature that can be achieved so simply. If ondemand isn't aggressive enough I prefer ondemand to be improved to be more aggressive. Ondemand is what runs on most laptops/workstations so we can't afford it not to be as fast as it can.... The problem is not specific to cellphones. And when screen is off there is not point to ever increase the frequency over 100mhz on i9000 (and unfortunately it happens and it's not fair to pretend some background service to call usleep(1) just to avoid the frequency jump).
Note, you may want to remove the two printk from the patch, they shouldn't flood but they're only for debug...

I think you need to put a [MOD] in your title.

First, thx you for sharing your work !
Your .zip patch the existant ondemand governor, or it is adding a new governor which can be selected via app like voltage control & such ?

Anyone wanna try this out and share what it does actually? All thoaellse reading above are too technical for most of us I guess. I'd love to try but I'm on JVS now and you said it is for JVR.
Thanks for the share by the way...
Sent from my GT-I9000 using Tapatalk

cnn888 said:
Anyone wanna try this out and share what it does actually? All thoaellse reading above are too technical for most of us I guess. I'd love to try but I'm on JVS now and you said it is for JVR.
Thanks for the share by the way...
Sent from my GT-I9000 using Tapatalk
Click to expand...
Click to collapse
Well I'm running the JVS kernel on top of JVR userland+initramfs. It'll run perfectly on JVS but I only posted the source and it'll work for both
I'm also a bit annoyed often I see mods and tweaks and I try to search the source and it's not so easy to find it. I'd recommend people to post more source and less binaries.
You just need to ask one kernel builder that ships with the ondemand governor to apply my patch, add those 3 lines to the initramfs/init.rc file and rebuild and it'll work for JVS too. Theoretically it will drain less when the screen is off and it'll be a bit more responsive when screen is on.
---------- Post added at 07:42 PM ---------- Previous post was at 07:36 PM ----------
Rootax said:
First, thx you for sharing your work !
Your .zip patch the existant ondemand governor, or it is adding a new governor which can be selected via app like voltage control & such ?
Click to expand...
Click to collapse
The whole point of this approach is not having to change governor and to share the ondemand governor which must provide max performance and max responsiveness on laptop and desktops so I don't see the point of creating a new governor when the screen is on, considering the requirements are the same.
I thought lowering voltage was considered risky, I don't want to change voltage but if you want to change the voltage I think the best place to do it is still my two handlers I added in the patch, no new governor required, I doubt you want to change voltage when the screen is on, and when the screen is off I guess you want always the lowest voltage and lowest freq like me.
A new governor is not needed in short, just a few liner patch to set the max freq at the lowest when screen is off is my preference, especially because it's so much simpler

right... and umm... suppose that i want to apply this mod, how do we apply this patch of yours?
i'm sorry but am not really a linux frenzy...

cnn888 said:
right... and umm... suppose that i want to apply this mod, how do we apply this patch of yours?
i'm sorry but am not really a linux frenzy...
Click to expand...
Click to collapse
re-build kernel source
great work newmail !
another (non-invasive) approach
would be to use a bare screenstate_scaling (well - not really scaling)
init script and limit the max frequency via that + set those values

zacharias.maladroit said:
re-build kernel source
great work newmail !
another (non-invasive) approach
would be to use a bare screenstate_scaling (well - not really scaling)
init script and limit the max frequency via that + set those values
Click to expand...
Click to collapse
Thanks.
I figured with csipsimple with the proximity sensor, 100mhz are not enough.... so I'm now decreasing the max frequency to 800mhz when screen is off, and I'm keeping the default sampling_rate to 10000 msec (setting transition_latency to 10000, equivalent to writing 10000 into ondemand/sampling_rate).
I also changed the code a bit to call all notifiers when the max frequency changes from 1ghz to 800mhz.
Now I did quite a bit more tests and something's going wrong when screen goes off in cpufreq. The cpu is idle, but ondemand raises the frequency more than if the screen is on. That is probably why the cpu isn't very idle when the sampling_rate is reduced go give more responsiveness. If I change get_cpu_idle_time_us to return -1 unconditionally, the trans_total are greatly reduced with screen is off and the ondemand stays at the low frequency when screen is off with sampling_rate 10000 too.
I also tried to measure the cost of a frequency switch (including the overhead caused by ondemand sampling at 1khz) and it seems of the order of 38usec.
I'm wondering if there's some bug in the get_cpu_idle_time_us that is causing the jitters in the ondemand governor when screen goes off.

I found the problem with the ondemand governor while in earlysuspend suspend mode. The problem is that the cpu starts to go in deep sleep, so a sampling_rate of 10000 is applied only once in a while, the real sampling_rate becomes 1second or more.
So when that happens the CPU goes in deel sleep all the time and ondemand tends to stay stuck at the max frequency all the time, by mistake, despite the load is near 0%.
After deep sleep when a wakeup happens we return to the 10000usec sampling rate. ondemand sees activity after the deep sleep wakeup but those wakeups "loads" must be adjusted down if the previous wall_time delta was huge and the current one is tiny. We're too close to deep sleep to ramp up cpu freq.
So my solution is to tweak the ondemand to scale down the "load" according to the decrease in the wall_time delta ratio (deep_sleep_ratio variable).
When screen is on, or during a call or during playback with screen off, the deep_sleep_ratio is 1, so the ondemand behaves as aggressive as always. But the deep_sleep_ratio ramp up when the phone is idle and the idle deep sleep states starts. With this tweak I can use the ondemand governor with the default values and the sampling rate set to 10000 (for max responsiveness) and the cpu freq will stay down to 100mhz with no jitter when the screen is off and the load is near 0% (instead of staying close to 1ghz most of the time with the 10000 sampling rate setting, 40000 of the JVS tends to hide it but it still jitters a lot and it hurts interactivity to be unable to set it below 40000).
In my first post I already noticed this jittering of the ondemand governor with the screen off. And I thought to solve it by lowering the freq to min with the screen off (which screwed csipsimple). I also noticed that a sampling_rate of the order of 100000 would decrease the jittering and with 10000 the cpu freq would be set at the maximum all the time. But the real problem was the ondemand comparing apples to oranges with the deep sleep state, and this explains why the jittering wasn't as bad with the screen on, as opposed to the badness with the screen off and the CPU going in deep sleep at high freq most of the time.
So this heuristic I wrote solves the problem, and I also disabled all those dvfs magics in cpufreq that prevented to use the 100hz frequency most of the time. It works fine for me with screen on, and now with screen off (proximity sensors) voip works perfectly too (I also verified deep_sleep_ratio is 1 during calls with proximity sensor activated). Any real activity will prevent the deep sleeps so it's perfectly ok to ignore the high loads measured just after returning from the deep sleep.
Anyway feel free to experiment. I also wrote another patch to switch the governor to performance automatically when screen goes on, and return to ondemand (with deep sleep detection) when screen goes off. But I think this heuristic is better and ondemand won't be exactly as fast as "performance" but especially at 10000 sampling_rate the difference should not be noticeable. And so I prefer to save a tiny bit of power by using ondemand all the time. Plus it proofs the new logic is good if it works for both scenarios.
I still decrease the max cpu frequency when screen is off to 800mhz (not anymore to 100mhz after I found it screws the voip and playback with screen off). ondemand will immediately jump to max the moment the threshold is exceeded (default threshold is 95% of not idle time). So this helps because all csimpsimple/skype/musicplayer background non-interactive workloads that may run with the screen is off and this will avoid to ever reach 1ghz which isn't needed for any of those background apps. 1ghz returns when screen goes on again.
In addition to this patch you can also consider adding these two lines to init.rc, but they're just to tune it a bit more aggressively. In the end I couldn't measure any difference from either one (default is 0 for io_is_busy, and 95 for up_threshold) so I'm using the default values and I didn't add the below to my currently running kernel. Probably you can ignore this and only apply the patch to the kernel.
write /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy 1
write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 80
I recall having read of some tweakded ondemand governor in some rom, but there was no link to source... again I recommend folks to post link to source whenever a new cooked rom is published.
Considering this is closer to a bugfix, if this is confirmed to work by others I can try push the deep_sleep_ratio as a core feature in the kernel, maybe under some better name, to enable in sysfs so in future releases changing init.rc would be enough. It may be useful to other than arm as this is a common problem of what happens after the cpuidle governor enter deep sleep and sleeps more than the sampling_rate.
You can use this to monitor the effect before/after.
adb shell 'cd /sys/devices/system/cpu/cpu0/cpufreq; while :; do cat stats/*; sleep 1; done'
With the patch applied (which also sets sampling_rate at 10000, your default currently is 40000) you will get this when screen is off.
3384
1000000 11256
800000 21625
400000 1642
200000 6266
100000 469564
3384
1000000 11256
800000 21625
400000 1642
200000 6266
100000 469669
3384
1000000 11256
800000 21625
400000 1642
200000 6266
100000 469774
3384
1000000 11256
800000 21625
400000 1642
200000 6266
100000 469888
3384
And this with screen on (without touching
3461
1000000 11316
800000 22619
400000 2067
200000 6290
100000 477547
3461
1000000 11316
800000 22619
400000 2067
200000 6290
100000 477652
3461
1000000 11316
800000 22619
400000 2067
200000 6290
100000 477758
3461
1000000 11316
800000 22619
400000 2067
200000 6290
100000 477864
3461
1000000 11324
800000 22619
400000 2067
200000 6297
100000 477956
3464
There is some seldom jitter still but nothing significant anymore (and with sampling_rate set to 10000, it wasn't just a jittering problem but it was at max freq all the time). Some minor jittering like above is just unavoidable if some userland run a bit longer, and at 100mhz it doesn't take much CPU load to run longer.
I also measured the raw performance by calculating PI and it's within the measurement range error if compared to performance governor. quadrant just fine too unchanged over 1600 at the 3rd run, so I'm optimistic it's not degrading perf.

cnn888 said:
right... and umm... suppose that i want to apply this mod, how do we apply this patch of yours?
i'm sorry but am not really a linux frenzy...
Click to expand...
Click to collapse
I could upload a .tar file to flash in odin somewhere... but I worry about the redistribution of a zImage with an initramfs including those annoying binary modules that aren't GPLv2 (or we would have the source of those too) and I can't easily get rid of.

Dividing the load by deep_sleep_ratio was too aggressive. I noticed some app was more laggy than with "performance" governor. The better approach to the long deep sleeps is to ignore jitters until the wall_time_delta converges. I added comments on the reason why this is better, and it seems also better to ignore time jitters in both directions (so also to ignore measurement of long wall_time when the wall_time_delta average is short, with screen on). I attached an update, it still avoids the jittering with the screen off and phone idle, and it works better with the phone on.
With this one phone sits at 100mhz with screen off (freq range with screen off 100mhz-800mhz), works fine when doing voip calls with proximity sensor as before. With screen on the freq range is now 200mhz-1ghz, considering that without the patch the phone may never reach 100mhz even with screen off, it is most certainly not going to make a difference and 100mhz is way too slow and we've to run at least 10msec at 100mhz before we can ramp up the freq. So this will double speedup those first 10msec compared to the prev version. The jittering with screen off completely goes away and the phone stays at 200mhz fixed if you disable the rotation sensors, otherwise there are 2 jitters from 200mhz to 1ghz and back per second, which is certainly fine.
I've been using for a while and I'm pretty happy and should work better than the previous version. That app were I noticed an higher lag with previous version, now seem to be as responsive as performance or at least I can't see a difference anymore.
If you test it let me know and please check when screen is off and phone not awake, if the battery is lasting longer or not. By looking the chart I attached (running the sleep2 version in this post) it seems my battery went down 2/3% in 6 hours with this. Frankly I don't remember if it was as good before... all I know for sure is that what happened before with ondemand didn't make much sense: a proper governor allowed to use a range from 100-800mhz must keep the cpu at 100mhz when screen is off and phone is idle, and with the deep sleep detection fix, ondemand finally behaves well, and it works fine with voip with screen off, it doesn't require to rump up the min freq from 100mhz to 200mhz with screen off, and it seems more responsive than before thanks to the 4 times more frequent sampling rate (and maybe also thanks to ignoring the long deep sleep cycles during interactive behavior but that I'm not entirely sure if it helped but it still looks good idea to ignore the infrequent wall_time_delta jitters). It's also likely that the cpu goes into very long deep sleep shutting down the cpu harder and maybe the freq it enters those states don't matter, but at least this should help if you play music in the background with the screen off, it manages to do that now at 100hz without skips.

It's certainly refreshing to see good research being done in a consistent manner. Keep up the good work

pikachu01 said:
It's certainly refreshing to see good research being done in a consistent manner. Keep up the good work
Click to expand...
Click to collapse
Thanks well it all started with my phone being 80% dischared for two mornings in a row and that annoyed me enough to look into this. I was pretty certain it wasn't a kernel problem (I think it was the broken update of the facebook app that has "keep phone awake" privilege and is buggy, I uninstalled it since then) but that still made me look into this... and what I found looking at the cpufreq stats with screen off wasn't too pretty, it just become utterly ugly if I decrease the sampling_rate to 10000, and so I spent the weekend trying to fix it. In any case I'm unlikely to post further updates until next weekend .
Another possible way to fix this would have been to have the cpuidle governors interacting with the cpufreq governors through some notifier call... but adding a small heuristic to ondemand to detect the wall_time_delta jitters was certainly simpler.

newmail said:
Thanks well it all started with my phone being 80% dischared for two mornings in a row and that annoyed me enough to look into this. I was pretty certain it wasn't a kernel problem (I think it was the broken update of the facebook app that has "keep phone awake" privilege and is buggy, I uninstalled it since then) but that still made me look into this... and what I found looking at the cpufreq stats with screen off wasn't too pretty, it just become utterly ugly if I decrease the sampling_rate to 10000, and so I spent the weekend trying to fix it. In any case I'm unlikely to post further updates until next weekend .
Another possible way to fix this would have been to have the cpuidle governors interacting with the cpufreq governors through some notifier call... but adding a small heuristic to ondemand to detect the wall_time_delta jitters was certainly simpler.
Click to expand...
Click to collapse
well, I don't know how motivated or how much time you want to spend in investigating this
but if want to dedicate some more time
make sure you also take a look how ondemandx works
(cpufreq_ondemandx.c in my repo)

zacharias.maladroit said:
well, I don't know how motivated or how much time you want to spend in investigating this
but if want to dedicate some more time
make sure you also take a look how ondemandx works
(cpufreq_ondemandx.c in my repo)
Click to expand...
Click to collapse
Thanks for the pointer! Appreciated . I won't have much time to look into this until the next weekend (I'll look into it ASAP , but with the last version I posted in comment #11 (ondemand-deep-sleep2.patch) things are going absolutely great. In fact it works much better with skype than the stock unpatched kernel: when I iconize skype during a call it won't degrade the audio anymore. I'm sure it degraded audio for a little if I iconized skype and started another app during a call. I guess it's the faster sampling rate, or maybe the fact I now ignore the long idle times if the average wall_time is short. Both are good.
The sampling_rate not being constant with long cpuidle times that disregard software timers, really requires this fix to the ondemand to perform great. So I'm super happy about this change so far. 100-800/200-1000mhz also works great. And this change won't have any effect on laptops/workstations where the timers should fire as expected. (I also tried 100-400/400-1000 for a while but there's no point it seems, 100-800/200-1000 is enough so I'm back to the exact values in the last patch I posted)
I doubt it's worth to stop the sampling like interactive governor does while cpu is idle, considering cpuidle will disregard the timers so there's no risk to wakeup too early because of a timer it seems.... I think this changes will improve ondemand in general and it is required fix for these phones IMHO.
The fact background apps like music player with screen off now run 95% of the time at 100mhz also looks great. I didn't have any sign of instability, and I run a lot of load on it (though only for the last few days...). I sent my patch to some samsung engineer who added the SLEEP_FREQ to the cpufreq upstream code (to enter suspend to ram at 800mhz which I didn't alter, that sure is fine change considering the cpu is cut off the power during suspend to ram, it'll speedup suspend to ram too in addition to not crashing phone as described in the patch . In my patch I only handle the frequency changes right when cpuidle runs for long and I doubt the cpu is cut off the power for only 60msec or 500msec when screen is off, that's too fast to cut the power completely I guess so I think it's worth it. And if it doesn't help to save power when idle, for it sure won't hurt either and the statistics now look sane and this change should help while using the phone too by allowing to lower the sampling_rate and avoiding interactive usage to be fooled by long cpuidle samplings started at high freq that decrease the freq just before the real loads come in and idle is exited (ignoring those long wall_times during interactive usage is also good and should save power too as the load will complete faster and cpu will be allowed to spend more time in idle at low freq then).

Deep Sleep
Hi, you said that you first came to this topic because some app was keeping your CPU from deep sleep, probably FB app. This night I also experienced that the phone did not go into deep sleep, it was awake all the time according the battery status. So is there a way to check, which app causes this behaviour?
See attachment for a screenshot.

newmail, against what kernel base does your patch apply ?
samsung kernel sources JVB & JVH (1st release + 1st update) ?

zacharias.maladroit said:
newmail, against what kernel base does your patch apply ?
samsung kernel sources JVB & JVH (1st release + 1st update) ?
Click to expand...
Click to collapse
Thought you were on time-out??

dachau said:
Thought you were on time-out??
Click to expand...
Click to collapse
This is his time out, wait till you see him on his kernel dedication time.
^^
Sent from my GT-I9000 using XDA Premium App

newmail said:
I could upload a .tar file to flash in odin somewhere... but I worry about the redistribution of a zImage with an initramfs including those annoying binary modules that aren't GPLv2 (or we would have the source of those too) and I can't easily get rid of.
Click to expand...
Click to collapse
Newmail, first of all your analysis + the mod for governor was awesome !
basically actually not a dev and i can't patch my kernel myself (hmm.a noob kinds when it comes to kernel stuff )
i'm wondering how would be your patch's results vs Smartassv2's coz your patch includes the stuff directly in Ondemand Governor that's a perfect approach making it more effective .
So, please could you prepare a CWM flashable if possible on behalf of those GPLv2 (idk what are those btw ) or a step by step procedure to perform the FIX .. ?
Thankyou again for your approach on CPU freq tweak !!

Related

Desire's CPU throttling

Does HTC DESIRE with stock FROYO use CPU THROTTLING by default or not?
If not the the SetCPU would really come in handy when the Desire is idle.
+1
I too would like to know this.
what do you mean throttling? you mean it drops speed at high temperature? or drops speed when idle?
by default the desire is set ondemand 998mhz when idle or at sleep it drops to 245mhz
hamdir said:
by default the desire is set ondemand 998mhz when idle or at sleep it drops to 245mhz
Click to expand...
Click to collapse
this is what I meant.
When you say sleep, does that mean that when the you press the power button once and the screen turns off.
Does this constitute as sleeping and thus lowers the clock to 245MHz?
ashrack0 said:
this is what I meant.
When you say sleep, does that mean that when the you press the power button once and the screen turns off.
Does this constitute as sleeping and thus lowers the clock to 245MHz?
Click to expand...
Click to collapse
yes when the screen turns off, unless a program is requesting cpu resources it will drop to 245 not only during screen off but during idle time too
you can improve all this by rooting ofcourse and installing kernel with different schedulers like interactive but ondemand is there in stock froyo
1.
So the stock HTC Froyo just uses 2 states.
When operating the phone it is at ~1GHz, but when the phone is idle it's at 245Mhz.
Correct?
2.
If the scheduler was Interactive but On Demand that would mean that the CPU clock would adapt to my usage. Such as this example:
- If I was browsing the net thru WIFI the clock would be ~1GHz.
- If I was just adding a calendar entry then the clock would probably be < 500 MHz.
Correct?
3.
Are there any slowdowns expected by using the On Demand schedular?
ondemand is in stock
schedulers like interactive, powersave and smartass can be added via root
no on demand also scales the frequencies not just two state
ondemand is good enough only sometimes late to respond to low latency like UI menus, for example interactive is more smart and responds faster there is another called smartass which is supposed to be a further modification
by the way you can notice ondemand sometimes late response while scrolling the default white messages widget in sense
HAMDIR
thx for the thorough explanation.
While browsing through this forum I noticed that the frame of mind is that interactive would give better battery life.
Why is that so?
Hamdir,
Thanks for your explanations Can I just ask you 1 more question. I have asked it on another thread but no-one took the time to give me an answer.
I have installed Richard Trip's svs V5e_1113 kernel but I do not have SetCPU installed. Which governor does this kernel use by default and is there a way (using a command from ADB shell) to use smartass governor instead? I really need to know this.
Thanks and I hope to get an answer this time.

[Q] SETCPU GOvernOrs

okay i have a huge question about this... PLease Share YOUR Thoughts and experiences TOoOO!
we are using custom kernels right? but sometimes the developer/creator of the kernel doesnt mention on what recommended usage of the main profile and profile..
so i decided to put some description about this governs that i have gathered around in XDA FORUM so we can share our knowledge on this GOverns.
okay first.. i found this..
smartass governor - is based on the concept of the interactive governor.
I have always agreed that in theory the way interactive works - by taking over the idle loop - is very attractive. I have never managed to tweak it so it would behave decently in real life. Smartass is a complete rewrite of the code plus more. I think its a success. Performance is on par with the "old" minmax and I think smartass is a bit more responsive. Battery life is hard to quantify precisely but it does spend much more time at the lower frequencies.
Smartass will also cap the max frequency when sleeping to 352Mhz (or if your min frequency is higher than 352 - why?! - it will cap it to your min frequency). Lets take for example the 528/176 kernel, it will sleep at 352/176. No need for sleep profiles any more.
ondemand
Available in most kernels, and the default governor in most kernels. When the CPU load reaches a certain point (see "up threshold" in Advanced Settings), ondemand will rapidly scale the CPU up to meet demand, then gradually scale the CPU down when it isn't needed. - SetCPU website
conservative
Available in some kernels. It is similar to the ondemand governor, but will scale the CPU up more gradually to better fit demand. Conservative provides a less responsive experience than ondemand, but can save battery. - SetCPU website
performance
Available in most kernels. It will keep the CPU running at the "max" set value at all times. This is a bit more efficient than simply setting "max" and "min" to the same value and using ondemand because the system will not waste resources scanning for the CPU load. This governor is recommended for stable benchmarking. - SetCPU website
powersave
Available in some kernels. It will keep the CPU running at the "min" set value at all times. - SetCPU website
userspace
A method for controlling the CPU speed that isn't currently used by SetCPU. For best results, do not use the userspace governor. - SetCPU website
interactive
Advantages:
+ significantly more responsive to ramp cpu up when required (UI interaction)
+ more consistent ramping, existing governors do their cpu load sampling in a workqueue context, the 'interactive' governor does this in a timer context, which gives more consistent cpu load sampling.
+ higher priority for cpu frequency increase, rt_workqueue is used for scaling up, giving the remaining tasks the cpu performance benefit, unlike existing governors which schedule rampup work to occur after your performance starved tasks have completed.
SOURCES:
http://forum.xda-developers.com/showthread.php?t=969477
https://github.com/CyanogenMod/cm-kernel/commit/255f13bf41f368aa51638a854ed69cfc60f39120
Nice thread. I am new to this stuff (I learned just yesterday what governors are) and all this will be very usefull for people like me. Thanx.
In the SetCPU app, if you press About and then click the link you can get all this info there too
So Guys,
Im using Buzz 1.3.5 kernel at 1.2 Ghz (1.6 Ghz max), with ARHD rom.
What the best processor type to battery life \ performance ?
Any kind of values to screen of and temp > 50º or 40º ?
Thank you , lets share our configurations and post results !
so how do we get smartass? Im currently trying out interactive.
So guys, no one can put here some configurations?
Like, screen off values, > 50º temp, and others ?
Come on, share pls..

[Q] [CyanogenMod7 RC4] Overclock and Performance Settings

Hi,
I've just noticed the Performance settings menu under the CyanogenMod Settings menu and I wanted to give overclock and other features a try...safely.
I'm looking for increasing my Wildfire's performance in a remarkable way but without harming or causing any trouble to the phone. So I'd like to start in a quite conservative way.
What governor should I choose? (default: smartass)
What max and min CPU frequency? (default 518 and 352 Mhz)
What about the VM heap size? (default 24m)
What do you guys use as your settings?
Thanks a lot!
Governor : Smartass
CPU Speeds : 264 Min, 652 Max
VM Heap Size : 32 M
Remember, don't expect miracles by OC'ing your CPU. You'll probably be disappointed.
Thanks for answering!
In the meanwhile I set up 264 as min and 691 as max...is that too much and potentially dangerous?
No miracles indeed but the phone felt a bit more snappy when playing games for example.
Do you know where I can find some info about the different governors?
Also, what is exactly the VM heap size?
Thank you!
No, wont harm it. Only if you experience instability, reduce it to the next (Or rather, Previous) level.
CPU Governors:
* ondemand – Available in most kernels, and the default governor in most kernels. When the CPU load reaches a certain point (see “up threshold” in Advanced Settings), ondemand will rapidly scale the CPU up to meet demand, then gradually scale the CPU down when it isn't needed.
* conservative – Available in some kernels. It is similar to the ondemand governor, but will scale the CPU up more gradually to better fit demand. Conservative provides a less responsive experience than ondemand, but can save battery.
* performance – Available in most kernels. It will keep the CPU running at the “max” set value at all times. This is a bit more efficient than simply setting “max” and “min” to the same value and using ondemand because the system will not waste resources scanning for CPU load.
* powersave – Available in some kernels. It will keep the CPU running at the “min” set value at all times.
* userspace – A method for controlling the CPU speed that isn't currently used by SetCPU. For best results, do not use the userspace governor.
(The above wall of text is lifted from SetCPU's site)
In addition to that , Smartass is really the smart one. When your screen is on, the minimum frequency will automatically be set to 518 MHz, making your phone seem it is flying, and, when the screen is off, then, it reverts back to the minimum set value, and saves battery - Best of both worlds!
As for VM Heap Size, it is the maximum amount of heap space (i.e. memory) a single instance of the Dalvik VM (application) can obtain. Technical concept, but, you can read it up more if you like.
Thanks a lot for the insigthful reply, everything's clearer now!
i put everything on max. but thats just me. phone works fine though :L
Hi,
What's the best setting for my battery? It drains so fast.
Mine is as following:
Min.: 245 Mhz
Max.: 537 Mhz
INTERACTIVE
I have to charge the Phone every evening, thats a bit annoying.
Thank you in advance
When using the cyanogenmod settings for the cpu speed,setcpu isn't required anymore right?
Sent from my HTC Wildfire using XDA App
FrydaeXIII said:
When using the cyanogenmod settings for the cpu speed,setcpu isn't required anymore right?
Sent from my HTC Wildfire using XDA App
Click to expand...
Click to collapse
Yes, you are right. Conflicting apps are never recommended.
thanks for the tip...

[Q] Kernels ain't working for me

Hello there,
I've been flashing kernels since I was in LeeDroid Froyo and got no problems. However since I switched to GB based roms such as RCMix3D and TB Fusion, my phone always freezes when I try setting Kernel-Lee-V3.1.1-2.6.35.13-CALLREC or MDJs v19 to maximum overclock so I have no choice to but to stay on stock kernel. I have no ext3/ext4 partition on my SD card in case you ask.
Current ROM: TB Fusion 1.1.2
Radio: 12.54.60.25U_26.09.04.11_M2
Any idea what should I do to solve this issue?
golokipok said:
Hello there,
I've been flashing kernels since I was in LeeDroid Froyo and got no problems. However since I switched to GB based roms such as RCMix3D and TB Fusion, my phone always freezes when I try setting Kernel-Lee-V3.1.1-2.6.35.13-CALLREC or MDJs v19 to maximum overclock
Click to expand...
Click to collapse
uoooo this is sooo dangerous for your handset... u can "smoke" it...
Any idea what should I do to solve this issue?
Click to expand...
Click to collapse
yes, your handset freezes because the overclock that u do its too high... underclock it at 1200-1400mhz & try...
and configure SET CPU features... like the standby status, etc....but do it with common sense....
think about that DHD proccessor goes by default at 1gz, really when we overclock the processor we are putting in danger the security of our device
SERGI.3210 said:
uoooo this is sooo dangerous for your handset... u can "smoke" it...
yes, your handset freezes because the overclock that u do its too high... underclock it at 1200-1400mhz & try...
and configure SET CPU features... like the standby status, etc....but do it with common sense....
think about that DHD proccessor goes by default at 1gz, really when we overclock the processor we are putting in danger the security of our device
Click to expand...
Click to collapse
Haha! I know that overclocking is quite dangerous. Back on the froyo days, my phone is quite stable around 1.8ghz so I'm just wondering why is this happening (maybe my phone's processor is starting to fry up? ). Is there any effect if I'm using smartass profile on those kernels I've mentioned?
golokipok said:
Haha! I know that overclocking is quite dangerous. Back on the froyo days, my phone is quite stable around 1.8ghz so I'm just wondering why is this happening (maybe my phone's processor is starting to fry up? ).
i hope that the processor works or not works (don´t crashes a little bit...)
but the reason of your freezes maybe (almost sure) because froyo & gingerbread don´t works at the same form, and gingerbread need more resources & stability for to work correct... don´t forget that the kernel manages the hardware...
if u force it......... u know what can happen...
golokipok said:
there any effect if I'm using smartass profile on those kernels I've mentioned?
Click to expand...
Click to collapse
it´s possible, take this explanation, read and judge by yourself what´s the better cpu governor...
smartass (Best explanation i've found paraphrases to: based on interactive, but better.)
----
ondemand
Available in most kernels, and the default governor in most kernels. When the CPU load reaches a certain point (see "up threshold" in Advanced Settings), ondemand will rapidly scale the CPU up to meet demand, then gradually scale the CPU down when it isn't needed. - SetCPU website
conservative
Available in some kernels. It is similar to the ondemand governor, but will scale the CPU up more gradually to better fit demand. Conservative provides a less responsive experience than ondemand, but can save battery. - SetCPU website
performance
Available in most kernels. It will keep the CPU running at the "max" set value at all times. This is a bit more efficient than simply setting "max" and "min" to the same value and using ondemand because the system will not waste resources scanning for the CPU load. This governor is recommended for stable benchmarking. - SetCPU website
powersave
Available in some kernels. It will keep the CPU running at the "min" set value at all times. - SetCPU website
userspace
A method for controlling the CPU speed that isn't currently used by SetCPU. For best results, do not use the userspace governor. - SetCPU website
Interactive
The 'interactive' governor has a different approach. Instead of sampling the cpu
at a specified rate, the governor will scale the cpu frequency up when coming
out of idle. When the cpu comes out of idle, a timer is configured to fire
within 1-2 ticks. If the cpu is 100% busy from exiting idle to when the timer
fires then we assume the cpu is underpowered and ramp to MAX speed.
If the cpu was not 100% busy, then the governor evaluates the cpu load over the
last 'min_sample_rate' (default 50000 uS) to determine the cpu speed to ramp down
Click to expand...
Click to collapse
Thanks for the info
SERGI.3210 said:
because froyo & gingerbread don´t works at the same form, and gingerbread need more resources & stability for to work correct... don´t forget that the kernel manages the hardware...
if u force it......... u know what can happen...
Click to expand...
Click to collapse
You have mentioned about those "resources", is there any special measure that I need to do or what? I'm using the smartass profile on those kernels but still *sigh*
Anyway, I've observed on your sig that yours is overclocked @ 1.8ghz even though you're running GB, me envy
golokipok said:
have mentioned about those "resources", is there any special measure that I need to do or what? I'm using the smartass profile on those kernels but still *sigh*
Click to expand...
Click to collapse
you only should do a good over/underclock & set the correct cpu governor for your daily use....
well, you know ho is @MDeeJaay? the developer of MDJ kernels and roms...
he explained smartass with this words:
SMARTASS GOVERNOR - is based on the concept of the interactive governor.
I have always agreed that in theory the way interactive works - by taking over the idle loop - is very attractive. I have never managed to tweak it so it would behave decently in real life. Smartass is a complete rewrite of the code plus more. I think its a success. Performance is on par with the "old" minmax and I think smartass is a bit more responsive. Battery life is hard to quantify precisely but it does spend much more time at the lower frequencies.
Smartass will also cap the max frequency when sleeping to 245Mhz (or if your min frequency is higher than 245 - why?! - it will cap it to your min frequency). Lets take for example the 998/245 kernel, it will sleep at 245.
golokipok said:
, I've observed on your sig that yours is overclocked @ 1.8ghz even though you're running GB, me envy
Click to expand...
Click to collapse
no, no buddy... i only show the max speed nothing more... i set my cpu concretly like this;
CPU GOVERNOR:interactive
MAX SPEED:1113 MHZ
MIN SPEED:245 MHZ
PROFILE: screen off; 245 MHZ max.
245 MHZ min.
in adition i´m going to modify my syg LOL
haha..thanks again. I'm gonna try playing with the frequencies to see which will suit me
i hope someone can make a stable 1.8ghz kernel without the freeze
IT´S POSSIBLE but i don´t want to try it LOL
i love a lot my DHD

[How to]--->Simple Guide to Better Battery Life

Battery Life on a SmartPhone - The Riddle, The Enigma
I have been asked to port my original Battery Guide over to the SGS3 threads, so here it is in all it's glory.​
This thread was also recently featured on the XDA Portal. Thanks to Haroon Q. Raja for the write up.​
Attaining 20+ hours of battery life is not only possible it is totally attainable with most phone configurations. The secret to making this happen is, understanding what are the contributing factors are and knowing what to do first.
This guide will help. After reading this guide, you will be able to understand how to end power eating culprits and answer those same questions we see over and over in the threads...... that is .... solving the passive battery drain and get the 20 hours of battery life we all want and desire.
As we all know, all Samsung Galaxy S 3's and their Chipsets are not created equal. So if something works for one person and not the other, then is it a software, hardware or human error. Chances are it is a combination of all three. Hopefully this can slim those down a bit and answer some questions that you might have or have seen. I have tried to get almost everything I can think of and put it in one place.
You can click on the Post # below and it will take you directly to that post if you wanted to skip some things (although I don't know why you would want to do that)
Post 1: Tips and Tricks
Post 2: Roms/Kernels, OverClocking/Undervolting, Governors & I/O Schedulers
Post 3: Memory Management
Post 4: Apps (for your download pleasure)
Post 5: Proof
I will be using satirical stories and anecdotes to get my point across below. Not meant to offend or point fingers at anyone. I am just using real life references to get to the point. Also I am not much for fancy colors. I tried it at the top here but not so much further down. If there is something specific I want to call attention too, I will BOLD it and maybe RED it too.
This is not a GUIDE to get better battery life but rather a GUIDEline to get it. What is the difference, you say? A Guide is a step by step process that you must/should follow to get the outcome that the person who created it wanted you to get [A+B+C+D should = E]. A Guideline is more of a recommendation that allows some choice or flexibility in the understanding, execution or use [A +B-(C+D) can = E].
TopShelf10 has this to say about getting the most out of your battery life
the problem is, people want to believe that they can save battery without changing their usage habits. this simply is not possible. no rom or kernel will realistically do this for you. if you remove 1 brick from a bag full of 15 bricks, the bag will be lighter, but still very heavy. you need to download "spare parts" or "process monitor" from the market and start analyzing the way your apps are acting. also look into data syncs that are happening in the background. apps that stay open behind your back/what they are doing 9an app called "autostarts" can prevent apps from self-running under certain scenarios). animation speed. polling for notifications. gps. wifi scans. overclocking. cpu/ram usage. proper sleep. widgets. brightness. 2g/3g. data usage. call time. text volume. - THESE are the things that really affect your battery life.
bottom line is, if you truly want to save battery you are going to have to get your hands dirty...there simply isnt a one-click (or one-flash) solution.
Click to expand...
Click to collapse
Below is a list of fundamental things that can be done without rooting or custom ROM/Kernels. (Standard disclaimer applies: You use it, you set it and you are responsible)
1. Be Realistic -
Do you really think that you can get two whole days out of your battery? If you do, then you must have a very important pile of papers it is sitting on to not even pick up your phone for that long. These are phones. These are mini-computers. These are arcade games. And they want, dare I say, need to be played with, talked on or downloaded to. USE YOUR PHONE.
2. Syncing –
I know you are very important and you need to know what LeBron is doing right now, just in case you get a cup for a coffee and he might be in Starbucks at the same time and you get your picture taken with him and upload it to Facebook, Twitter or Google+. That is fine and I applaud you for it and will probably download the picture and Photoshop myself in your place. This is not the problem. Syncing your accounts is. That is what is causing battery drain. Do you really need to have your FB widget (see widgets section) streaming all day long? Does Kim K.’s endorsement of a potato chip really affect your everyday life? I doubt it. Kill them (not LeBron or Kim K. but rather the auto-syncing). Every time you “friend” someone their numbers, contact info gets sync’d to your phone. Also, there are settings in Facebook, Twitter and Google+ that you can upload pictures instantly. Don’t do that. Once you do, it is out in the Ether-World and just swallowed a bunch of battery doing it too.
Settings>Accounts and Sync>Auto-sync>uncheck it
3. Widgets –
They look cool. But widgets are nothing more than RAM and battery hungry monsters that you purposely put in your home screen. Think about it. What does a widget really do? All it really does is monitor an app that you have running. So not only is it running and taking up battery and RAM but the app that it is linked to is running in the background al’ a Facebook, Twitter, Google+, CNBC, MSNBC, BBC,… the list goes on and on because they want us to put THEM on our home page.
What a great marketing campaign the widget is.
“Hey look at me new home screen”
“Cool. Hey what widget is that?”
“Oh, it is X”
“Nice, I’ll have to download that tonight when I get home” and then and there they have you and your battery.
4. Apps –
You have to pay attention to your apps. I repeat. You have to pay attention to your apps. Especially if they run in the background. This can be anything from a harmless .99c game to a monster like Live Wallpaper. The battery drain threat is twofold here because the app is running in the background but it could also be using its anonymous data collection abilities and sending that back to the Mothership. Ever wonder why you have a 4/3G with up and down arrows in your status bar when your phone is just sitting there? This is because some app is transmitting data, whether you are using it or not. There are apps in the market that monitor these situations like Watchdog or kill the data link when the lock screen is enabled like Juice Defender (see Apps below) or you can adjust app permissions like LBE Privacy Guard. Data transfer is #2 on the What Kills My Battery list.
5. Display/ Wifi/ Airplane Mode/ Animations/ Location –
Display:
#1 when it comes to what is eating your battery. Always has been and always will be. Accept it and try to do something about it. This part is easy. Just lower the brightness. You can use Auto or set it as a brightness that is low but you are still able to see well enough to function. Live Wallpapers fall into this category. They are cool to look at but static ones take up less RAM and also less display because they are not running all the time in the background. These screens are bright at 100%, so tone it down. (see Apps below).
WIFI:
Another helpful tip is setting your WIFI sleep policy to Always. This can be done by going here Setting>Wireless>WIFI> Menu key>Advanced>WIFI Sleep Policy and set it to Always.
--->Then you can also do this Build.Prop edit as well (this is if you are Rooted, of course)
Allows your wifi to scan less, saving more battery:
wifi.supplicant_scan_interval=240 (I have mine set to 420)
Airplane Mode Toggle:
DocHoliday77 has this very helpful trick regarding Airplane Mode and how it effects your Data/Battery life.
I generally suggest toggling Airplane Mode on/off as a recommended step before running data speed tests, and to help with signal strength.
When you move from one area to another, generally your phone will automatically switch to another tower as the signal/connection to the current tower degrades. This is perfectly fine while travelling since you are not in a single location for very long. The problem comes into play once you have reached your destination. For many people, when they get home from work, for example, their phone will remain connected to the last tower they switched to on their drive home. However, there is very often a tower closer to their home that can provide better signal. The phone does not automatically switch to the better tower because it is still close enough to the current one to have adequate signal. By toggling Airplane Mode on/off, when the radio turns back on it will search for the strongest signal and will now connect to the closer, better tower!
Stronger signal will directly translate to a better battery. The better your signal, the less power is consumed for ALL radio operations (Including Cell Standby, Data, and Voice)! When the signal is weak, the radio requires more power to transmit to the receiver (the tower), which translates to higher battery use.
Toggle Airplane Mode on then off again to force the phone to connect to the best possible tower.
Animations: Set Settings > Display > Animations to .5 animations.
Location:
As pointed out by Arlanthir if your device is broadcasting your location, then you may need to rethink whether or not that is good for you and your battery. Generally, your location is based off GPS, Wifi or Mobile Networks. If these are on, then battery drain is occurring. Sometimes you need your location to work with Maps, Google Now, but most of the time, it is because of the unholy trinity, Facebook, Twitter and Google+. I mean, how do you think you "Check-In' at places right?
If you don't utilise these types of features on those three, then go into Settings>Location and untick them. Now there are also other apps like MLB At-Bat and the like that require location for blacked out games or services based on your location. I find that there is always a toast in those applications that notifies me and allows me to turn then on as needed. Then when I am done, I can turn them off.
These are 5 fundamental things that you can do to help reduce battery drain and get some more life out of your phone. Anyone can do these. All you have to do is watch your phone and use some common sense. “Why does my battery drain after only 6 hours? All I was doing was checking Facebook.” Do you really need to be on Facebook for that long of a time? I doubt it. How many services do you have running? How many tasks do you have running? (Android does a good job of shutting down tasks on its own, but if you are using a task killer, it takes more juice to start up an app than to turn it back on, so to say.) Think of it like an airplane. Takes more fuel to get up in the clouds, but once you are up there, it is pretty much coasting along with way less burn.
*******************
A special thanks to DocHoliday77 for convincing me to port this over and also for some of his helpful tips as well. You know who he is, so hit his thanks button to show your appreciation for all he does for this community.
ROMs are key things to think about when it comes to battery life. They can be fully established and working fine, can be RCs and still in development or they can be Alpha/Betas and completely experimental or just beginning. Choosing the best ROM or Kernel is going to depend on what YOU want out of your phone. Do you want a stable 4.0 ROM that has great battery life but not the customizability as MIUI or CM10 or AOKP? Because we have so many versions of 4.0.x ROMs that are official and almost all the sources have been attained, they have been Optimized to their fullest and some outstanding tweaks have really brought them to the forefront in daily drivers. Again, the choice is up to you.
Kernels go hand-in-hand with your ROM. Does the kernel support Overclocking or Undervolting. How much RAM and what tweaks are included in the kernel? Does THIS kernel work with THAT ROM? These are all spelled out for you in the OP of each kernel (and ROM) for you to find out. Read them because if you don’t, you’ll bork your phone and then your next post will be, “Help. I Bricked my phone”.
Overclocking/Undervolting –
If you don’t already know what Overclocking is, well it is pretty much self-explanatory. You can Overclock your CPU above the clock-speed that Samsung, T-Mobile governed it at. This can be done with apps like SetCPU (here and here and CPUtuner,…Generally have to be ROOTed to do these but if you are flashing ROMs and Kernels then you probably already are. UnderVolting is basically what it sounds like too. You are Undervolting your CPU to conserve battery.
This can be one of the best ways for a more advanced user to save battery. Overclocking is great to see those really cool Quadrant scores. Wow!!! But it also ramps up the battery drain, as well as temperature which can shorten your battery’s TOTAL life. If you want to Overclock to 1.8-2.1 just to see what you score on Quadrant or SmartBench, then do it for that time. Most ROMs/Kernels run stable and smooth at or about 1.2-1.6 with minimal effects on battery (as long as you do tweaks in above post). If you decide to Undervolt you can use Pimp My CPU, Voltage Control, SetCPU,... to do this but take care to step it down slowly until you find the right settings for you or you will see random reboots or phone freezes and those suck trying to diagnose.
***Please note that whether you Overclock or Undervolt, do NOT “Set on Boot” until you know that they are going to work. Otherwise if it doesn’t work and your phone randomly reboots, you will get into a boot cycle (not a bootloop) because you put them in “Set on Boot”. You must test before you should do this.***
Example scale of OC/UV setting from Ktoonsez' thread:
[KERNEL][TMO][AOSP/Touchwiz][JELLYBEAN & ICS][10/31/2012] KT747 - LJ7 - KTweaker
Stock___________________Undervolt startoff point___________________jerrygooch
Mhz - mV___________________Mhz - mV___________________________Mhz - mV
1890 - 1300___________________1890 - 1300____________________________1890 - 1200
1809 - 1275___________________1809 - 1250____________________________1809 - 1150
1728 - 1250___________________1728 - 1200____________________________1728 - 1100
1674 - 1200___________________1674 - 1175 ____________________________1674 - 1075
1512 - 1200___________________1512 - 1200 ____________________________1512 - 1075
1458 - 1187___________________1458 - 1187 ____________________________1458 - 1050
1404 - 1187___________________1404 - 1187 ____________________________1404 - 1050
1350 - 1175___________________1350 - 1175 ____________________________1350 - 1025
1296 - 1175___________________1296 - 1175 ____________________________1296 - 1025
1242 - 1150___________________1242 - 1150 ____________________________1242 - 1000
1188 - 1150___________________1188 - 1150 ____________________________1188 - 1000
1134 - 1125___________________1134 - 1125 ____________________________1134 - 975
1080 - 1125___________________1080 - 1125 ____________________________1080 - 975
1026 - 1075___________________1026 - 1075 ____________________________1026 - 925
972 - 1075____________________972 - 1075 _____________________________972 - 925
918 - 1050____________________918 - 1050 _____________________________918 - 900
864 - 1050____________________864 - 1050 _____________________________864 - 900
810 - 1025____________________810 - 1025 _____________________________810 - 875
756 - 1025____________________756 - 1025 _____________________________756 - 875
702 - 975_____________________702 - 925 ______________________________702 - 825
648 - 975_____________________648 - 925 ______________________________648 - 825
594 - 950_____________________594 - 850 ______________________________594 - 800
540 - 950_____________________540 - 850 ______________________________540 - 800
486 - 925_____________________486 - 850 ______________________________486 - 800
384 - 925_____________________384 - 825 ______________________________384 - 800
192 - 900_____________________192 - 825 ______________________________192 - 800
Governors and I/O Schedulers
Governors and I/O schedulers also have a huge impact on how your CPU regulates.
Here is about everything you need to know about them from Recognized Contributor droidphile from his thread:
[REF][TWEAKS] Kernel Governors, Modules, I/O Schedulers, CPU Tweaks, AIO App Configs .
If you haven't checked out his thread do yourself a favor and do it. A vast amount of information. Be sure to hit his THANKS too.
Governors
I) MANUAL:
These are the 19 governors we're talking about.
1) Ondemand
2) Ondemandx
3) Conservative
4) Interactive
5) Interactivex
6) Lulzactive
7) Lulzactiveq
8) Smartass
9) SmartassV2
10) Intellidemand
11) Lazy
12) Lagfree
13) Lionheart
14) LionheartX
15) Brazilianwax
16) SavagedZen
17) Userspacce
18) Powersave
19) Performance
NOTE: Info on Samsung's own multi-core aware governor - Pegasusq is here
1) Ondemand:
Default governor in almost all stock kernels. One main goal of the ondemand governor is to switch to max frequency as soon as there is a CPU activity detected to ensure the responsiveness of the system. (You can change this behavior using smooth scaling parameters, refer Siyah tweaks at the end of 3rd post.) Effectively, it uses the CPU busy time as the answer to "how critical is performance right now" question. So Ondemand jumps to maximum frequency when CPU is busy and decreases the frequency gradually when CPU is less loaded/apporaching idle. Even though many of us consider this a reliable governor, it falls short on battery saving and performance on default settings. One potential reason for ondemand governor being not very power efficient is that the governor decide the next target frequency by instant requirement during sampling interval. The instant requirement can response quickly to workload change, but it does not usually reflect workload real CPU usage requirement in a small longer time and it possibly causes frequently change between highest and lowest frequency.
2) Ondemandx:
Basically an ondemand with suspend/wake profiles. This governor is supposed to be a battery friendly ondemand. When screen is off, max frequency is capped at 500 mhz. Even though ondemand is the default governor in many kernel and is considered safe/stable, the support for ondemand/ondemandX depends on CPU capability to do fast frequency switching which are very low latency frequency transitions. I have read somewhere that the performance of ondemand/ondemandx were significantly varying for different i/o schedulers. This is not true for most of the other governors. I personally feel ondemand/ondemandx goes best with SIO I/O scheduler.
3) Conservative:
A slower Ondemand which scales up slowly to save battery. The conservative governor is based on the ondemand governor. It functions like the Ondemand governor by dynamically adjusting frequencies based on processor utilization. However, the conservative governor increases and decreases CPU speed more gradually. Simply put, this governor increases the frequency step by step on CPU load and jumps to lowest frequency on CPU idle. Conservative governor aims to dynamically adjust the CPU frequency to current utilization, without jumping to max frequency. The sampling_down_factor value acts as a negative multiplier of sampling_rate to reduce the frequency that the scheduler samples the CPU utilization. For example, if sampling_rate equal to 20,000 and sampling_down_factor is 2, the governor samples the CPU utilization every 40,000 microseconds.
4) Interactive:
Can be considered a faster ondemand. So more snappier, less battery. Interactive is designed for latency-sensitive, interactive workloads. Instead of sampling at every interval like ondemand, it determines how to scale up when CPU comes out of idle. The governor has the following advantages: 1) More consistent ramping, because existing governors do their CPU load sampling in a workqueue context, but interactive governor does this in a timer context, which gives more consistent CPU load sampling. 2) Higher priority for CPU frequency increase, thus giving the remaining tasks the CPU performance benefit, unlike existing governors which schedule ramp-up work to occur after your performance starved tasks have completed. Interactive It's an intelligent Ondemand because of stability optimizations. Why??
Sampling the CPU load every X ms (like Ondemand) can lead to under-powering the CPU for X ms, leading to dropped frames, stuttering UI, etc. Instead of sampling the CPU at a specified rate, the interactive governor will check whether to scale the CPU frequency up soon after coming out of idle. When the CPU comes out of idle, a timer is configured to fire within 1-2 ticks. If the CPU is very busy between exiting idle and when the timer fires, then we assume the CPU is underpowered and ramp to max frequency.
5) Interactivex:
This is an Interactive governor with a wake profile. More battery friendly than interactive.
6) Lulzactive:
This new find from Tegrak is based on Interactive & Smartass governors and is one of the favorites.
Old Version: When workload is greater than or equal to 60%, the governor scales up CPU to next higher step. When workload is less than 60%, governor scales down CPU to next lower step. When screen is off, frequency is locked to global scaling minimum frequency.
New Version: Three more user configurable parameters: inc_cpu_load, pump_up_step, pump_down_step. Unlike older version, this one gives more control for the user. We can set the threshold at which governor decides to scale up/down. We can also set number of frequency steps to be skipped while polling up and down.
When workload greater than or equal to inc_cpu_load, governor scales CPU pump_up_step steps up. When workload is less than inc_cpu_load, governor scales CPU down pump_down_step steps down.
Example:
Consider
inc_cpu_load=70
pump_up_step=2
pump_down_step=1
If current frequency=200, Every up_sampling_time Us if cpu load >= 70%, cpu is scaled up 2 steps - to 800.
If current frequency =1200, Every down_sampling_time Us if cpu load < 70%, cpu is scaled down 1 step - to 1000.
7) Lulzactiveq:
Lulzactiveq is a modified lulzactive governor authored by XDA member robertobsc and is adapted in Siyah kernel for GS2 and GS3. Lulzactiveq aims to optimize the second version of luzactive from Tegrak by a) providing an extra parameter (dec_cpu_load) to make scaling down more sensible, and b) incorporating hotplug logic to the governor. Luzactiveq is the first ever interactive based governor with hotplugging logic inbuilt (atleast the first of its kind for the exynos platform). When CPU comes out of idle loop and it's time to make a scaling decision, if load >= inc_cpu_load CPU is scaled up (like original luzactiveq) and if load <dec_cpu_load, CPU is scaled down. This possibly eliminates the strict single cut-off frequency for luzactiveq to make CPU scaling decisions. Also, stand hotplug logic runs as a separate thread with the governor so that external hotplugging logic is not required to control hotplug in and out (turn On and Off) CPU cores in multi core devices like GS2 or GS3. Only a multi core aware governor makes real sense on muti-core devices. Lulzactiveq and pegasusq aims to do that.
8) Smartass:
Result of Erasmux rewriting the complete code of interactive governor. Main goal is to optimize battery life without comprising performance. Still, not as battery friendly as smartassV2 since screen-on minimum frequency is greater than frequencies used during screen-off. Smartass would jump up to highest frequency too often as well.
9) SmartassV2:
Version 2 of the original smartass governor from Erasmux. Another favorite for many a people. The governor aim for an "ideal frequency", and ramp up more aggressively towards this freq and less aggressive after. It uses different ideal frequencies for screen on and screen off, namely awake_ideal_freq and sleep_ideal_freq. This governor scales down CPU very fast (to hit sleep_ideal_freq soon) while screen is off and scales up rapidly to awake_ideal_freq (500 mhz for GS2 by default) when screen is on. There's no upper limit for frequency while screen is off (unlike Smartass). So the entire frequency range is available for the governor to use during screen-on and screen-off state. The motto of this governor is a balance between performance and battery.
10) Intellidemand:
Intellidemand aka Intelligent Ondemand from Faux is yet another governor that's based on ondemand. Unlike what some users believe, this governor is not the replacement for OC Daemon (Having different governors for sleep and awake). The original intellidemand behaves differently according to GPU usage. When GPU is really busy (gaming, maps, benchmarking, etc) intellidemand behaves like ondemand. When GPU is 'idling' (or moderately busy), intellidemand limits max frequency to a step depending on frequencies available in your device/kernel for saving battery. This is called browsing mode. We can see some 'traces' of interactive governor here. Frequency scale-up decision is made based on idling time of CPU. Lower idling time (<20%) causes CPU to scale-up from current frequency. Frequency scale-down happens at steps=5% of max frequency. (This parameter is tunable only in conservative, among the popular governors )
To sum up, this is an intelligent ondemand that enters browsing mode to limit max frequency when GPU is idling, and (exits browsing mode) behaves like ondemand when GPU is busy; to deliver performance for gaming and such. Intellidemand does not jump to highest frequency when screen is off.
11) Lazy:
This governor from Ezekeel is basically an ondemand with an additional parameter min_time_state to specify the minimum time CPU stays on a frequency before scaling up/down. The Idea here is to eliminate any instabilities caused by fast frequency switching by ondemand. Lazy governor polls more often than ondemand, but changes frequency only after completing min_time_state on a step overriding sampling interval. Lazy also has a screenoff_maxfreq parameter which when enabled will cause the governor to always select the maximum frequency while the screen is off.
12) Lagfree:
Lagfree is similar to ondemand. Main difference is it's optimization to become more battery friendly. Frequency is gracefully decreased and increased, unlike ondemand which jumps to 100% too often. Lagfree does not skip any frequency step while scaling up or down. Remember that if there's a requirement for sudden burst of power, lagfree can not satisfy that since it has to raise cpu through each higher frequency step from current. Some users report that video playback using lagfree stutters a little.
13) Lionheart:
Lionheart is a conservative-based governor which is based on samsung's update3 source. Tweaks comes from 1) Knzo 2) Morfic. The original idea comes from Netarchy. See here. The tunables (such as the thresholds and sampling rate) were changed so the governor behaves more like the performance one, at the cost of battery as the scaling is very aggressive.
To 'experience' Lionheart using conservative, try these tweaks:
sampling_rate:10000 or 20000 or 50000, whichever you feel is safer. (transition latency of the CPU is something below 10ms/10,000uS hence using 10,000 might not be safe).
up_threshold:60
down_threshold:30
freq_step:5
Lionheart goes well with deadline i/o scheduler. When it comes to smoothness (not considering battery drain), a tuned conservative delivers more as compared to a tuned ondemand.
14) LionheartX
LionheartX is based on Lionheart but has a few changes on the tunables and features a suspend profile based on Smartass governor.
15) Brazilianwax:
Similar to smartassV2. More aggressive ramping, so more performance, less battery.
16) SavagedZen:
Another smartassV2 based governor. Achieves good balance between performance & battery as compared to brazilianwax.
17) Userspace:
Instead of automatically determining frequencies, lets user set frequencies.
18) Powersave:
Locks max frequency to min frequency. Can not be used as a screen-on or even screen-off (if scaling min frequency is too low).
19) Performance:
Sets min frequency as max frequency. Use this while benchmarking!
So, Governors can be categorized into 3/4 on a high level:
1.a) Ondemand Based:
Works on "ramp-up on high load" principle. CPU busy-time is taken into consideration for scaling decisions. Members: Ondemand, OndemandX, Intellidemand, Lazy, Lagfree.
1.b) Conservative Based:
Members: Conservative, Lionheart, LionheartX
2) Interactive Based:
Works on "make scaling decision when CPU comes out of idle-loop" principle. Members: Interactive, InteractiveX, Lulzactive, Luzactiveq, Smartass, SmartassV2, Brazilianwax, SavagedZen.
3) Weird Category:
Members: Userspace, Powersave, Performance.
I/O Schedulers
1) Noop
Inserts all the incoming I/O requests to a First In First Out queue and implements request merging. Best used with storage devices that does not depend on mechanical movement to access data (yes, like our flash drives). Advantage here is that flash drives does not require reordering of multiple I/O requests unlike in normal hard drives.
Advantages:
Serves I/O requests with least number of cpu cycles. (Battery friendly?)
Best for flash drives since there is no seeking penalty.
Good throughput on db systems.
Disadvantages:
Reduction in number of cpu cycles used is proportional to drop in performance.
2) Deadline
Goal is to minimize I/O latency or starvation of a request. The same is achieved by round robin policy to be fair among multiple I/O requests. Five queues are aggressively used to reorder incoming requests.
Advantages:
Nearly a real time scheduler.
Excels in reducing latency of any given single I/O.
Best scheduler for database access and queries.
Bandwidth requirement of a process - what percentage of CPU it needs, is easily calculated.
Like noop, a good scheduler for solid state/flash drives.
Disadvantages:
When system is overloaded, set of processes that may miss deadline is largely unpredictable.
3) CFQ
Completely Fair Queuing scheduler maintains a scalable per-process I/O queue and attempts to distribute the available I/O bandwidth equally among all I/O requests. Each per-process queue contains synchronous requests from processes. Time slice allocated for each queue depends on the priority of the 'parent' process. V2 of CFQ has some fixes which solves process' i/o starvation and some small backward seeks in the hope of improving responsiveness.
Advantages:
Considered to deliver a balanced i/o performance.
Easiest to tune.
Excels on multiprocessor systems.
Best database system performance after deadline.
Disadvantages:
Some users report media scanning takes longest to complete using CFQ. This could be because of the property that since the bandwidth is equally distributed to all i/o operations during boot-up, media scanning is not given any special priority.
Jitter (worst-case-delay) exhibited can sometimes be high, because of the number of tasks competing for the disk.
4) BFQ
Instead of time slices allocation by CFQ, BFQ assigns budgets. Disk is granted to an active process until it's budget (number of sectors) expires. BFQ assigns high budgets to non-read tasks. Budget assigned to a process varies over time as a function of it's behavior.
Advantages:
Believed to be very good for usb data transfer rate.
Believed to be the best scheduler for HD video recording and video streaming. (because of less jitter as compared to CFQ and others)
Considered an accurate i/o scheduler.
Achieves about 30% more throughput than CFQ on most workloads.
Disadvantages:
Not the best scheduler for benchmarking.
Higher budget assigned to a process can affect interactivity and increased latency.
5) SIO
Simple I/O scheduler aims to keep minimum overhead to achieve low latency to serve I/O requests. No priority quesues concepts, but only basic merging. Sio is a mix between noop & deadline. No reordering or sorting of requests.
Advantages:
Simple, so reliable.
Minimized starvation of requests.
Disadvantages:
Slow random-read speeds on flash drives, compared to other schedulers.
Sequential-read speeds on flash drives also not so good.
6) V(R)
Unlike other schedulers, synchronous and asynchronous requests are not treated separately, instead a deadline is imposed for fairness. The next request to be served is based on it's distance from last request.
Advantages:
May be best for benchmarking because at the peak of it's 'form' VR performs best.
Disadvantages:
Performance fluctuation results in below-average performance at times.
Least reliable/most unstable.
7) Anticipatory
Based on two facts
i) Disk seeks are really slow.
ii) Write operations can happen whenever, but there is always some process waiting for read operation.
So anticipatory prioritize read operations over write. It anticipates synchronous read operations.
Advantages:
Read requests from processes are never starved.
As good as noop for read-performance on flash drives.
Disadvantages:
'Guess works' might not be always reliable.
Reduced write-performance on high performance disks.
Some Kernel Settings from Users out "there" (Note: These are for the SGS3 kernels):
Swifks using LeanKernel (4.3 kernel/4.2 OS):
Swiftks said:
Just thought I'd share my settings:
Governor: InteractiveX
Custom Settings:
go_hispeed_low = 95
screen_off_maxfreq = 486000
Scheduler: ROW
Min: 192 MHz
Max: 1512 MHz
Frequency Lock: ON
MP-Decision: OFF
Multicore Power Saving: 1
GPU Governor: On Demmand
GPU Max Frequency: 480
Voltages:
192 MHz = 775mv
384 MHz = 800mv
486 MHz = 800mv
594 MHz = 825mv
702 MHz = 850mv
810 MHz = 900mv
918 MHz = 950mv
1026 MHz = 1000mv
1134 MHz = 1025mv
1242 MHz = 1050mv
1350 MHz = 1075mv
1458 MHz = 1100mv
1512 MHz = 1125mv
Enjoy
Sent from my SGS III
Click to expand...
Click to collapse
liltitiz from his thread [KT747: Share & discuss your settings]+[govs & scheds info] using ktoonsez' KT747 kernel.
Post is here
liltitiz said:
With my new settings I can get up to 5-6 hour of screen on with a discharging time of around 24 hours. Before I start playing with cpu1, I couldn't get more than 4hours of screen on with a discharging time around 15hours since the Linux 3.4 kernel
Note that I also use greening to hibernate apps and Tasker to turn on things like gps, data, wifi, auto rotate only when I need them.
I readjusted my settings yesterday to test something out if you got no loss in performance yet you can try them out:
Ktoonservative setup to input in ktweaker:
Boost 2nd core on button:0
Boost cpu:540
Boost gpu: doesn't matter
Boost hold cycle :0
Boost turn on 2nd core:0
Cpu down block cycle:0
Down threshold:75
Down threshold hotplug:60
Freq step:3
Ignore nice load:0
No 2nd cpu screen off:1
Sampling down factor:3
Sampling rate: 25000
Sampling rate screen off: 45000
Up threshold:94
Up threshold hotplug:96
---------------------------------------------------
Command lines to apply my asswax settings on cpu1 :
echo asswax > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo 135000 > /sys/devices/system/cpu/cpufreq/asswax/awake_ideal_freq
echo 200 > /sys/devices/system/cpu/cpufreq/asswax/down_rate_us
echo 189000 > /sys/devices/system/cpu/cpufreq/asswax/interactive_ideal_freq
echo 95 > /sys/devices/system/cpu/cpufreq/asswax/max_cpu_load
echo 65 > /sys/devices/system/cpu/cpufreq/asswax/min_cpu_load
echo 250000 > /sys/devices/system/cpu/cpufreq/asswax/ramp_down_step
echo 50000 > /sys/devices/system/cpu/cpufreq/asswax/ramp_up_step
echo 81000 > /sys/devices/system/cpu/cpufreq/asswax/sleep_ideal_freq
echo 135000 > /sys/devices/system/cpu/cpufreq/asswax/sleep_wakeup_freq
echo 5000 > /sys/devices/system/cpu/cpufreq/asswax/up_rate_us
---------------------------------------------------
If you set your ktoonservative to turn off 2nd core(cpu1) when screen is off, then it doesn't matter because your cpu1.will be off so only your ktoonservative(cpu0) settings matter. Personally I use 486 as my max freq when screen is off.
Click to expand...
Click to collapse
Before we begin on the below, I must continue something about kernels from above due to character limits in posts.
A word of advice from vikas.mishra via XDA RD dorimanx in this post:
This is long INFO post from real chip designer that help to create CPU/GPU and other chips for the living for 14 years now, so respect
He sent me PM, for now he cant post that by him self.
Vikas is monitoring our thread and want to say his professional stand about UV/OV and why it's works for some and why not for others.
==================
I am calling Vikas(vikas.mishra) to the speech stand
Hello people.
Let me introduce myself - my name is Vikas Mishra and I am a chip designer by profession. .
I have worked on critical parts of design of TI OMAP4, OMAP5, Nvidia Tegra 3 etc and have been doing this for the last 14 years.
Of late - I have seen a lot of folks posting BUGS about undervolting of the GPU/CPU.
I think I can explain what are the possible issues with undervolting/overclocking in a laymans language.
It is a little long winded but I think the length is needed for providing the appropriate context.
* What is inside your Cellphone
Your cellphone is an amazing device. It is a full fledged computer
that fits into your pocket. They have all the standard components
that a computer has - except that they are all usually soldered on
the motherboard directly and are not meant to be user-servicable.
The chief components inside your cellphone are
1. Application Processor (AP)- this is the heart of a modern
cellphone. These are manufactured by many companies - the main
ones are Qualcomm, Nvidia, Samsung and Apple. The other not so
well known ones are made by Texas Instruments, ST Ericsson,
Marvell and Broadcom.
A modern AP has logic to control the camera and process the image
that it generates, to do video encoding (video recording) and
video decoding (movie watching), Audio processor etc. in addition
to the well known CPU and GPU.
2. Power Management Controller - This is the chip that is
responsible for generating and regulating the voltages that are
used by all the components on the board.
3. DRAM - not very different from the DRAM found on a PC (except
that it is lower voltage)
4. Flash - for storage
5. Touchscreen controller
6. Logic for microphone, speaker
7. Battery
One of the most complex piece of circuitry on the phone is the AP
and the power management controller.
* Circuit Basics
A modern AP has millions of circuit units called (Flip
Flops). These flip flops have two parameters associated with them
called Setup time and Hold time. More details on what a flip flop
can be found on the wikipedia at
http://en.wikipedia.org/wiki/Flip-flop_(electronics) . This is a
nice bit of bedside reading if you are interested.
A setup time roughly indicates what frequency you can run a design
or an AP at before it becomes unstable.
A hold time roughly indicates the maximum voltage till which a
design is stable.
A fully technical analysis of what is involved in these timing
parameters requires a degree in electrical engineering but in broad
terms the problem is described below.
Chip designers diligently ensure that all of the millions of the
flip flops in a chip meet the setup and hold time across a broad
range of voltages and silicon parameters. They do a pessimistic
analysis to ensure that a chip will run reliably across a wide
range of voltage/frequency combinations.
However, contrary to the popular belief, chips vary widely in their
silicon parameters. Even chips on a the same wafer and different
flip-flops within the same chip can have widely different silicon
parameters. This is why what works on one particular chip will not
work on the other chip.
Your silicon manufacturer provides a range of voltages and
frequencies across which the device can work reliably. The phone
manufacturer will further narrow down the range depending on the
other components they choose within the phone board.
* How does voltage affect the design
Reducing voltage makes the design slower and increasing voltage
makes the design faster.
So can I keep on increasing the voltage for ever and make the
circuit faster and faster. The answer is no - a point will come when
the circuit will become unreliable. This becomes unreliable because
the "hold time" of one or more of the flops will start
violating.
As you reduce the voltage of the design, the circuit will start
becoming slower. However typically it will continue to work till at
apoint it starts failing - this failure occurs due to violation of
"setup time" of one or more flops in the design.
So what happens when the setup time or the hold time of a design
fails - the answer is that it is unpredictable. Meaning suddenly if
you ask the processor what is the value of 2+2, the answer it will
provide could be unreliable - in some cases it could be 3, in some
cases it could be 4 in some cases it could be -2349783297 (a random number).
I am of course oversimplifying but I hope you get the picture.
* How does undervolting affect your phone processor
The reason undervolting is so appealing to people because they
thing that undervolting will save power and improve battery
life. While this is true in theory, in practice there is a caveat.
It will reduce the power of the chip, but the power consumed by the
phone as a whole will not improve. In some cases in fact it can
deteriorate. Let me explain.
The most power hungry part in the phone is not the AP - it is the
LCD screen. All of these screens consume a ton of power. So even
though your AP is now consuming lesser power, the overall impact to
the phone as a whole is not that much.
If you accompany undervolting with a frequency reduction (which you
should), the total time taken for doing a web page rendering (for
example) would increase. During this time the screen is on and it
has more than compensated for the power that you saved in the
AP.
You could of course come up with examples where this wouldn't
happen - but on a whole, IMHO, you should leave the voltage of the
AP/GPU/CPU to the guys who know the system best - the guys who
designed the chip and people who manufactured it.
* How does overvolting/overclocking affect your phone processor
If you want that last drop of performance from your phone and you
over clock it, at a point some of the design flops will start
violating the hold time and the design will stop working reliably.
Again, in some anecdotal cases this would work - but this is not a
reliable means/mode of working. Just because your friend's or your
first cousin's girlfriend's phone works - doesn't mean yours will
work as well.
* What are the user observable impacts of undervolting/overclocking?
It is hard to say - simply because there are so many of flops in
the design.
In some cases - you wouldn't see anything wrong with the phone
until one day you do. In some cases it will result in a SOD
immediately. In some cases it will result in your phone not waking
up reliably.
IMHO the risks of issues with undervolting/overclocking far
outweighthe potential gains you may get out of it. Usually there
is no lasting damage to the phone/AP if you overlock/undervolt but
it is possible to do it. For example, You run the phone at such a
high frequency that the chip temperature becomes more than what it
was designed for and the Silicon just fails.
So "Just say No" . Don't overclock or undervolt your phone -
leave it to the guys who really understand what they are doing.
Thanks,
Vikas
Click to expand...
Click to collapse
^*v*^*v*^*v*^*v*^*v*^*v*^*v*^*v*^*v*^
Memory Management
Did you know that you can also free up some internal memory space by just basic maintenance? You can install a Cache Cleaner from the market. I use Cache Cleaner NG (root) and CacheMate (root) which will clear your cache for you, Cache Cleaner NG will even clear your cache on your SDcard. Open Root Explorer and if you see a bunch of free floating cache files, those need to go. Wasted space. Small in the scheme of your SDcard, but still wasted.
So here we go (best part is at the bottom though):
Ok so you go into XDA on your phone, go to the themes page and look at what and how people are theming their phones or see some pix of someone's SetCPU profiles. All those develop a cache that takes up space on your phone. Now lets say that you go to the market and look through some apps or update your apps (more on this later). This also generates cache, usually up to 2-4mb. Ever try to download something from the market and it says something like "not enough space". This not needed cache may be some of the reason.
Here are some tricks and apps that some of you may know and also some tricks that I have found that I am sure most don't know about.
SOME GOOD LOW MEMORY APPS:
Cache Cleaner NG and Cache Mate (both root and free-Cache Mate has a paid but the free one works just fine.)
Diskusage (free) ~ This one will show you a graphical version of your /data/apps and also you SD card to show you exactly what is taking up so much space. You can click on that item and hit "Show" and it will take you to the app's page in Manager Applications. It also has a root function too that will allow you to see what is in /system, /cache, /data,…
Some sort of file manager to get to some things I'll mention below. (I use Root Explorer)
SOME MEMORY CLEARING TIPS AND TRICKS:
Home Launcher ~ If you have a 3rd party home launcher, see if it has the ability to long-press an icon to take you to its screen in the Manage Apps section. I use APEX and if you long-press on say Market, it takes me to the same place as is I were to go to Settings->Applications->Manage Apps->Market. Instead of all that, just long-press on the icon and BAM! it takes you there. Here you can clear out your cache for the market or delete the data (if you need to do that). Or clear the cache of the XDA app b/c you looked at too many pix.
Browsers ~ These develop cache that takes up memory and space, especially the stock browser. If you use a 3rd party, you can get the settings to clear cache, cookies, passwords,…on exit. I use Dolphin, but I am pretty sure that most have something like this on them. (side note: most 3rd party browsers once exited will not run in the background unlike the stock one)
Media ~ So you download a bunch of mp3's from the net or click on some pix and save it to your SD card. Or maybe you just felt like wiping your card and having a fresh start. Every time you reboot, you phone will scan media. No big deal, but the more you criss-cross things from PC to phone and back again, it can create a bunch of double files in your media cache on the phone. With the proper placement of .nomedia files (this prevents your media scanner from doing just that, scanning media- i.e. pix, jpegs,…Don’t place a .nomedia in your music, album art or DCIM files**bad).
Every once in a while, I'll hit the Diskusage or go to Manage apps and clear the media cache. Then I got to my file manager and the DCIM->Thumbs and delete the .Thumbnails files (should be 2). Unmount the SD card and remount to start the media scan, pull up the Gallery and wait for the thumbs to come back (depending on how many you have, this could take awhile). By doing this you can get almost 5 mb back if you have a bunch of double scans in your media folder.
AND NOW FOR SOME TIPS THAT MOST COULD NOT KNOW:
LOSTDIR - Lets say that you have your phone plugged into your PC and for some reason you, in a fit of rage, jerk the plug out without unmounting it first. This creates a file that is put into your LOST DIR folder on your SD card. Anytime you don't safely unmount the SD card, it will create a file in that folder. In the scheme of the SD card, it isn't too much, but I don't like having useless items free floating about.
Here is a good explanation of what the Lost.dir is for, seems legit, I buy it.
TOMBSTONES - So you are downloading an update from the market and for some reason your phone freezes and the Force Close-Retry-Wait doesn't work out for you. You have to do a battery pull. Frustrating I know and the memory takes a hit too. Every time you have to do a battery pull because of a freeze up or something of the like, it creates a TOMBSTONE file in /data. These are useless and can be deleted. If you are flashing ROMs and are constantly having to do battery pulls b/c market crashes or an app freezes, then you are creating a Tombstone file.
**Here is where your file manager (with root) will help. Go into /data and scroll all the way to the bottom and open /tombstone. There should be some files in there and depending on how many there are, I could be a nice chunk of wasted memory. Just select all and delete. They are not needed. Your internal memory should go up by doing this.
LOST & FOUND - Same scenario, but now go into /data/ cache or /cache and you'll see Dalvik-Cache (don’t mess with this), Lost & Found and Recovery. If you tried to download an app and it got frozen for some reason and had to do a battery pull, the apk will be free floating in there, uninstalled (free floating radical). You can delete this. While it isn't in the Dalvik-Cache folder, it is taking up space. Once you are able to download something completely and correctly from the market, it will populate into Dalvik-Cache correctly and won't be a free radical, as I like to say.
Useful Apps
These are some apps that will help you get the most of your battery life. I will put a brief descpition of them and you can also click on their names to take you directly to their market link. Note that some of these are ROOT apps and almost all of them also have PAID versions that greatly expand their functionality. Use the free ones and see how you like them and then kick in for the PAID ones if you want. The only one that I really suggest paying for right out of the gate to get the most out of your battery is Juice Defender Plus.
Tasker –
Paid app from the Market. This app is highly technical and not for noobs. Use at your own risk.
I would love for some of you out there to give me your Tasker Battery Saving Profiles. Either put them in the thread here or PM to me directly.
Here is a thread about how it works by brandall:
[TUT] The Ultimate Noob/Beginners Guide to Tasker
Greenify –
XDA Thread is here: READ IT (at the very least, read the OP)
This app is probably one of the best battery saving apps that has come out in quite a long time. It allows you to "Hibernate" apps that are not being used at the time, get them out of the foreground and prevents them from running when not in use, thus eating battery.
It is really easy to use. All you have to do is fire it up, grant Root and then select the apps that you want to "Hibernate". (Note: be very careful what types of apps that you do this with, i.e. /system/apps, as it could cause adverse effects like missed notifications, missed SMS/MMS, misbehaving apps,...you get my point I hope).
Batstat Widget –
I know, I know. Above I said that widgets were nothing more that monitoring apps on your home page, but this one works great, has low memory and is very, very simple. It shows Charge in %, Volts to know when you are FULLY charged and Temperature F/C to tell you that your phone is getting hot and exactly how hot it is.
BetterBatteryStats –
This app will show you what exactly is eating at your battery. Processes, Running Services, Wakelocks, Partial Wakelocks. It is a PAID app but for XDA users it is free. See here for more extensive details, instructions, screenies, change-logs,... and credits go to Chamonix and his development team for this app.
JuiceDefender (Plus) [Since I use JD+, that is what I am going to refer too.]
–
This app’s ability to kill Radio/Data has NO EFFECT on phone calls or messaging. You will still get that call in the middle of the night you were expecting.
If you set it to custom, the go into the settings tab on the right and then all the way at the bottom, there is two buttons to push, The first in Interactive which will pull up Juice Defender for up for any app that isn't already configured and the other is Configure Apps. This is the one that you can customize on an app-to-app basis where if you are no using an app and the screen is locked, it kills the radio/data traffic for that app.
Say you are listening to IHeartRadio, this you would want either Enable or Enable/off (which means the screen will be locked but the radio/data will be working). Now take the browser. If you are not using the browser, then you don't need it transmitting data right? So you would set that one to Enable (which means that it will only enable data traffic when that app is being used).
Juice Defender only works when the screen is locked (WidgetLocker lock screens interfere with JuiceDefender), don't forget and all widgets are battery drains b/c all they really are is a monitoring app and if it is tied to something like Facebook or Google+, then that data will be running constantly.
Settings:
Enable = Radio/data on when app is in use (front)
Enable/off = Radio/data on for background apps (when screen is locked)
Disable = Disables radio/data traffic completely when that app is running
Do Nothing = What is says
Examples:
Angry Birds = Disable (Here is a little known trick that I use for this and any game with Ads. With this and something like Adfree, no more ads in Angry Birds even though the ads are embedded in the .apk)
Pandora/Jango/ Tune-in = Enable/Off (this will keep your battery temp down when streaming)
Browser/ Market = Enable (not enable/off b/c then it will keep your radio/data open)
Beautiful Widgets = Enable/off
mClock/Clockr = Enable/off
SMS/MMS = Enable or Do Nothing (why would you push disable)
I have been using JD+ for over a year on 3 different phones and multiple ROMs and have noticed a considerable difference in battery life. Just takes some time to figure out YOUR settings and what YOU like. I have also used it on Stock kernel and had no problems either.
Here are my personal setting but I am on JD+ and not Ultimate
Profile - Customize
Notification - Graphical
Settings
Mobile Data and WIFI both Enable
Options - Auto Disable
Location - Disable
Schedule -Enable --->2hrs
Night Enable --->12a to 9a (user take priority)
Apps --.Set to Interactive
E = Enable
ESo = Enable/Scrren Off
D = Disable
DN = Do Nothing
At-Bat12 = ESo
IHeartRadio = ESo
Jango = ESo
Sticher = ESo
Dolphin = E
Google Play Store = E
Messaging = E
Twitter = E
XDA pre = E
Zedge = E
Angry Birds (all variants) = Disable --->You get no ads this way wink wink
These are all Do Nothing
Addfree
Apparatus
BW
Betterbatterystats
Cachemate
Elixir
Fasterfix
FlickGolf
Google Search
Maps
Moboplayer
PowerAmp -->I can listen to music without it looking for Album Art b/c it is set to do nothing, so one of the above apps take priority and when the screen is off, data is off when I am listening to music
Quadrant
Blah, blah, blah you get the idea.
If you have every app you own and in the phone set to do "something", then you are going to run into priority issues when multi-tasking which will kill your battery for 1 b/c it is opening and closing radios and 2 for the RAM it is taking to figure out which priority take the lead. Hence why I have so many set to Do Nothing.
LBE Privacy Guard –
There may or may not be some issues with this app and Jelly Bean, so make sure you read the Market Comments and hit their website to make sure. Thanks to mypenismighty for the tip.
This will go good with JuiceDefender, as they both prevent unwanted data transfer. Protect your privacy by controlling the permission of each application to access your sensitive data. Block malicious operation from Mal-wares and Trojans. Block unwanted network traffic if you don’t have a unlimited data plan. Find out which application is trying to steal your privacy by checking the security log.
RAM Munchers eat battery too. These will fix that for you.
Autostarts (paid-CAUTION this is for advanced users) –
Keep control over your phone: See what applications do behind your back.
Shows you what apps run on phone startup, and what other events trigger in the background. Root users can disable unwanted autostarts and speed up their phone boot.
Watchdog –
See what is eating your RAM. Hint: if it is using RAM,then probably it is also using battery too.
Spare Parts –
Spare Parts allows you to enable some settings
that are not found in the default setting menu
Process Monitor –
List the running process on your Android device.
Long click item to kill application or open application.
Fastboot –
This is a handy little app that kills all your services at once and lets them restart back up. I use this right before I hit the lock screen, so that if any app-services are running that I don’t have configured in Juice Defender Plus they will be killed, frees up about 50-70mb of memory, and then I lock the screen and JD takes over. This one is optional if you want it or not. I like it just fine and it works for me.
Matte Screen Filter –
Puts a sort of Dim setting on your screen. Almost like a display overlay, ok? And I did mean to rhyme those. I don’t use it because I have my display set how I want it but you can.
Battery Calibrator –
Pointless, but if you want to check out more info, click the hide tag below.
If you are having some haywire battery readings, this is for you. THIS WILL NOT INCREASE YOUR BATTERY LIFE, but will give you a truer reading if your battstats somehow get corrupted.
When you flash a new ROM, it is always best to wipe the old battery stats associated with that ROM, so you can start fresh as a daisy. How this works is you plug you phone in and charge to 100%, do not mess with it or surf the net (I do this overnight). While still plugged in, hit the apps, grant SU permission and hit the Calibrate Battery button. Grant SU permission again and once done, unplug your phone. Your Batterystats.bin has been deleted. You running your phone down by just using it normally. Most say to run it until it shuts off, but I have had bad experiences doing this, so I let it get to 10-15% and plug it in then. Charge fully up to 100% (again no surfing or games) and you will notice a dramatic increase in battery life.
**Note that this can be done two other ways. You can boot into CWR or Custom Recovery and go to Advanced Settings and there will be the Wipe Batterystats.bin option. Or you can do it manually by going into /data/system/ and deleting the batterystats.bin in there. Any of the three methods work to get the entirely same result in the end. I just like using the app or manually myself. **
Why battery calibration is important and what it is doing.
The app and what it does is more for when you are flashing a ROM and have around 60% and then once booted up fully, you charge it up to 100%. Decided you don't like your ROM and go back to your original ROM via backup, it will show 60% instead of the 100 or 90% you had before you went back to back up b/c you backed up the batstat bin when you nandroided your original ROM. Also simply charing your phone up to 100% and shortly after you unplug it, the Battstats will reset.
Recently (about this time last year) there has been information debunking this process. I will post it below. Here is the post by Dianne Hackborn, a Google Dev on her G+ account.
Dianne Hackborn - Jan 12, 2012 - Public
Today's myth debunking:
"The battery indicator in the status/notification bar is a reflection of the batterystats.bin file in the data/system/ directory."
No, it does not.
This file is used to maintain, across reboots, low-level data about the kinds of operations the device and your apps are doing between battery changes. That is, it is solely used to compute the blame for battery usage shown in the "Battery Use" UI in settings.
That is, it has deeply significant things like "app X held a wake lock for 2 minutes" and "the screen was on at 60% brightness for 10 minutes."
It has no impact on the current battery level shown to you.
It has no impact on your battery life.
Deleting it is not going to do anything to make your more device more fantastic and wonderful... well, unless you have some deep hatred for seeing anything shown in the battery usage UI. And anyway, it is reset every time you unplug from power with a relatively full charge (thus why the battery usage UI data resets at that point), so this would be a much easier way to make it go away.
Click to expand...
Click to collapse
Here is a post from this thread with ERD Entropy512 and I discussing the Battery Calibration app.
Proof that these things work. Stock battery by the way. Sorry for the huge pix. I'll tag them with a Hide Parse for better viewing real estate.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Battery screenshots as of 12/13/12
View attachment 1561698View attachment 1561700View attachment 1561701
Change Log:
9 August 13 -Added in Greenify, Tasker, Kernel settings, cleaned up a bit.
13 December 12 - Added more battery screenies
2 November 12 - Initial Post
***********
If anyone has any tips or tricks that they want to share, by all means post them in here and I will link it in the OP. We are all in this together.
After reading this posts I am afraid to even use my phone cuz battery will drain lol jkjk! Thanks great thread!
Awesome thread man! Really glad to see you brought it over here!
Thanks for taking the time! I know it'll come in very handy for just about everyone.
Great job on a great guide!
:thumbup::thumbup:
Sent from my SGH-T999 using xda app-developers app
Woodrube said:
Y U Quote the whole OP
Click to expand...
Click to collapse
Awesome guide.. We thank you
Sent from my SGH-T999 using xda premium
This is some really great information. Thank you for taking the time to share it with everybody.
I knew it wouldn't take long for this to get to the top!
:thumbup:
Sent from my SGH-T999 using xda app-developers app
Great thread thank you
Sent from my SGH-T999 using xda app-developers app
I wanted to warn people that LBE Privacy Guard caused crazy boot loops for me. The reviews from the Play Store suggests that it's a Jellybean issue. Anyway, I was able to go into recovery, fix permissions, and force stop and uninstall before it went crazy again. Other than that, thanks for the great tips!
Woodrube good post, I remember seeing this in the vibrant section. Keep up the good work mod.
Sent from my SGH-T999 using Tapatalk 2
Thanks man. I ported the meat and bones of it over, but I added a ton of stuff specific to the SGS3, plus the sections about Governors and I/O schedulers.
If anyone reads this, I could use more OC/UV examples to put in the OP. It would be much appreciated.
This is great, what really got me is how the phone doesnt automatically go to the best tower for the best signal, so I will defnitely start toggling airplane mode when I travel, thanks a lot for all this helpful information and apps that can help up save battery as much as possible!
Be sure to turn off Latitude updates in
Maps > Menu > Settings > Location settings > Location reporting > Do not update your location
Already on the portal.
Great Great Great!
Thanks a lot.
Plus Post for anyone.....we seem to forget the things that kill us....back stab us the most when it comes to Battery Life!!
GOOD POST!!! VERY DETAILED AND INFORMANT!!!!
Great advice on the whole, but I don't agree with the stuff about app widgets.
Widgets don't use a bunch of resources just because they are widgets - I think you could almost say the opposite: the design of widgets allows them to be visible on your desktop without using any resources because the app code that controls the widget only needs to be loaded when the widget changes.
In the end, the resources used by an app widget depend on what it does and how it is designed - same as for any app. If your widget is supposed to go to the network and update some info for you every few minutes then this will drain your battery. However, there are tons of utility widgets that do nothing (and are not in memory) unless they are pressed or one of the phone states they are listening to changes (e.g. a radio is turned on).
Of course, a badly designed app will hurt your battery regardless. Personally I think apps need to get away from creating a custom Application object since these get instantiated whenever the system creates the app's (or app widget's) process, even if it is just to update a widget.
Nice thread
Thxs for this nice thread Any ore would be appreciated.
I have learned a few things besides already being techy.
Nice to see whole lot of apps for android

Categories

Resources