Jump to content

Welcome to CyanogenMod

Welcome to our forum. Like most online communities you must register to post, but don't worry this is a simple free process that requires minimal information for you to signup. Be a part of the CyanogenMod Forum by signing in or creating an account. You can even sign in with your Facebook or Twitter account.
  • Start new topics and reply to others
  • Subscribe to topics and forums to get automatic updates
  • Get your own profile and make new friends
  • Download files attached to the forum.
  • Customize your experience here
  • Share your CyanogenMod experience!
Guest Message by DevFuse
 

Settings to optimize battery on CM7 [Last Updtd May 8, 2011]


This topic has been archived. This means that you cannot reply to this topic.
22 replies to this topic

#1 rahvan

rahvan
  • Members
  • 10 posts

Posted 05 May 2011 - 03:21 AM


MyTouch 4G / HTC Glacier / MT4G Settings to optimize battery on Cyanogenmod 7

MyTouch 4G while a fantastic phone has a terrible battery life if you are a moderate to heavy user like me. I couldn't find a thread that gives a comprehensive list of settings specific to CM7 to optimize battery life. So I figured I should start one.  

I make a lot of calls and need data to be on at all times because I get work email, which is why I am not covering any settings that disable data or calling.

Here is what I am using. Please feel free to add any I have missed or comment on any setting that is counter-productive. Big thanks to synaesthetic for feedback and invaluable suggestions.

PHONE
Phone > Menu > Preferences > Enable Haptic Feedback DISABLED

POWER CONTROL WIDGET SETTINGS
Home > Widgets > Power Control
Wifi disables 3G (2G is used when you are on Wifi) - ENABLED
Wifi enables 3G (3G is used when you are not on Wifi) - ENABLED
These two settings should ensure you get the best data speeds without sacrificing battery life.

I also keep the following buttons on the widget enabled on one of the home screens to make quick changes in case I am running low on power or need one of them.
'2G/3G' button enabled  with '2G/3G+2G' under 'Choose network Modes'
'Brightness' button enabled with 'Auto/Dim/25%/75%/100%' under 'Choose Brightness Levels' (Gives me fine tuned manual control in case I need it quickly)
'Bluetooth' button enabled
'Wifi Hotspot' button enabled so I can turn it on whenever I want with a click


SETTINGS
Home > Menu Button > Settings

Wireless & Network Settings
WiFi ENABLED
Wifi Settings > Network Notification DISABLED (Turns off automatic scanning when not connected)
Wifi Settings > Menu Button > Advanced > Wifi Sleep Policy NEVER
Mobile Networks > Use only 2G networks (Use this if you dont care about data speeds and are only interested in battery. I don't use this. The Power Control Widget gives a better option)

Bluetooth DISABLED

Display
Brightness > Automatic Brightness
Brightness > Animation > Some Animations
Brightness > Screen Timeout > 30 seconds

Sound
Audible touch tones ENABLED
Haptic Feedback DISABLED (This consumes more power than sound)
You can safely enable all the sounds you want to enable really without impacting battery life

Location & Security
Use Wireless Networks DISABLED (Not required if you enable GPS)
Use GPS ENABLED (GPS only kicks in when needed so you can safely enable this)

Call Settings
Vibrate on answer DISABLED
Vibrate on hangup ENABLED (You can disable this but it is useful if you drop a call)
Vibrate every 45 seconds DISABLED (Default)
Vibrate call waiting DISABLED (Default)
Keep Screen awake DISABLED (Default)
I make a lot of calls so these make sense for me but might not be useful for a lot of people.

Language & Keyboard
I use Swype which I copied over from the Stock ROM.
Swype Settings > Vibrate on Keypress DISABLED
Swype Settings > Audio Feedback DISABLED (It's just annoying when enabled. Should save some battery but quite insignificant.)

Cyanogenmod Settings (The Fun ones)
Display
Display > Automatic Backlight > Screen Dim Level > 16

Auto Brightness on some versions of CM 7.x behaves a little erratically. Making the following adjustments should make it work a little more reliably and save battery power.

Display > Automatic Backlight > Light Levels > Use Custom ENABLED.

Display > Automatic Backlight > Edit Other Levels
Click on each of the values in the 'Lower', 'Screen' and 'Buttons' columns and adjust the numbers as outlined below:
Lower --- Screen ---- Buttons
0-----------35---------10
161---------35---------10
226---------50---------10
321---------76---------10
641---------88---------0
1281-------112--------0
2601-------130--------0
5801-------140--------0
8001-------150--------0
9494-------160--------0
Then click "Save & Apply" at the top.
The Screen brightness max value is 255. I have used 160 as max above. Display brightness differs from screen to screen. If your display is not as bright as mine or is brighter please adjust the values listed under 'Screen'. 160 works for me under bright sunlight since the phone is fairly new. Increase/Decrease each of the screen values as desired. The values under 'Lower' are based on the standard Raw light sensor reading values so please use the ones listed above.
Naturally, you can always set screen to max brightness of 255 manually at any time using Power Control widget.

Input
Input > Haptic Feedback Tweaks > Haptic feedback main DISABLED

Performance settings if you are running CM 7.x.x. and the standard BFS kernel it comes with.
Performance > CPU Settings > Availabele Governors > Conservative
This gives pretty decent performance on the MyTouch 4G. Heavier apps may take half a second longer to launch but after that performance is pretty good.
Performance > CPU Settings > Min CPU Frequency > 245Mhz
Performance > CPU Settings > Max CPU Frequency > 768 Mhz. This is the processor speed of the G2(my phone before MyTouch 4G) and is more than enough for good performance in most applications. (Default frequency for the MyTouch I think is 1017Mhz)
Performance > CPU Settings > Set on Boot ENABLED

Performance settings if you are running CM 7.x.x. and a low voltage kernel.

Quote

Instructions to first install a low voltage kernel - Be prepared for a little bit of risk. Bricking your phone is a rare but definite possibility.
I use Faux123's Low Voltage kernel for CM7 and Gingerbread. It is available here: Faux's Gingerbread Kernels for CM7
2.6.1 didn't play nice with CM 7.0.3 for me. However at the time of writing this 2.6.3 is out. I have not tried it yet. Instructions for install are straightforward enough.
1. Download the latest CFS Low voltage version zip file. If LV doesn't work well with your CPU(rare but very possible) you could use the CFS stock voltage version.
2. Reboot into recovery useing ROM Manager and do:
-- Wipe cache.
-- Advanced > Wipe Dalvik Cache.
3. Select 'Install zip from SD Card" and select the file you downloaded (should be in the downloads folder)
Once done reboot.
Performance > CPU Settings > Availabele Governors > smartass
Performance > CPU Settings > Min CPU Frequency > 245Mhz
Performance > CPU Settings > Max CPU Frequency > 768 Mhz/1017 Mhz/1113 Mhz . If you are using Smartass governor you can increase the max a little more if you like and even overclock it a little. Since the CPU spends a lot more time at lower frequencies, the affect on battery life is much lower even with a higher max.
Performance > CPU Settings > Set on Boot ENABLED

Quote

From XDA-Dev & setCPU :
CPU governors control exactly how the CPU scales between your “max” and “min” set frequencies. Most kernels have “ondemand” and “performance.”
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.
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 to.
smartass (Available only in certain CFS kernels. Not usually avaialble in BFS kernels like CM.): - Based on interactive, but better. Performance is on par with the "old" minmax and smartass is a bit more responsive. CPU spends 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. No need for sleep profiles any more!

I am done playing with settings. Yesterday's check of the uptime between charges was between 19-20 hrs with lots of voice calling, texting and emailing. Screen stats at 2% battery showed the display being on between 3-4 hrs (didnt note it down). I also used the navigation for a longish drive (which drains battery quite a bit).

Max data speeds always and no noticeable loss of any performance. This is using stock battery (no calibration ever done on it), LV kernel and above settings. Of course your performance will differ quite a bit depending on your battery as well as all the other factors mentioned above. You should however get 14-20 hrs of uptime between charges quite easily with these settings which definitely solves the problem of a normal day's worth of use without having to get one of those high capacity batteries.

ENJOY!

Edited by rahvan, 09 May 2011 - 01:24 AM.


#2 synaesthetic

synaesthetic
  • Members
  • 242 posts

Posted 05 May 2011 - 08:10 AM

Excellent write-up, thanks very much! I'll give the power widget options a whirl, see what they do for my battery life. The 3G data trying to enable while wifi is on can be really annoying.

My battery life was pretty awful unless I used the Conservative governor, but the sluggishness that imparted was not acceptable for me. So I flashed faux's low voltage CFS kernel. If you use the smartass governor and set maximum clockspeed to 768, battery life is huge and you don't lose anything in terms of smoothness.

Because absolute performance is more important to me, though, I run overclocked to 1401MHz. It seems, when combined with the undervolting when under 800MHz, that the battery life is virtually identical to stock clocks using the ondemand governor--only better performance AND far less battery drain while using as a music player (as the smartass governor prevents CPU spikes while the screen is off).

I suspect I can gain some more battery time from your writeup here even without sacrificing any performance. :) Thanks a lot for posting this, I'm sure many others will find it useful as well.

(Though I have been considering picking up one of the 1650mAh Mugen batteries to gain even more...)

#3 rahvan

rahvan
  • Members
  • 10 posts

Posted 05 May 2011 - 12:56 PM

Will try Faux's kernel. It sounds very promising. I had read up about the smartass setting. Couldn't find it in CM 7.0.2. Will install setCPU and try it out once I have exhausted the tweaks in CM.

Thanks for the encouragement :) . Will keep this thread alive. I have a bunch more to try but testing takes a day or two.

Have been considering the Mugen battery myself. Am sure I will buy it eventually, but first let me see what I can get out of this one.

#4 rahvan

rahvan
  • Members
  • 10 posts

Posted 05 May 2011 - 04:06 PM

Mistake in previous: smartass setting availability depends on kernel. I don't think setCPU will give me the option with the current kernel. Haven't tried it yet though.

#5 synaesthetic

synaesthetic
  • Members
  • 242 posts

Posted 05 May 2011 - 07:58 PM

It should be noted that not all SoCs are created equal, and depending on how your silicon ended up, the undervolting kernel may not work/may not be stable. Mine seems to be really tolerant of anything (I even max OCed it to 1.8GHz just to play around, but it killed battery life dead so I put it back to 1.4GHz).

#6 rahvan

rahvan
  • Members
  • 10 posts

Posted 05 May 2011 - 08:23 PM

Yes. It looks more like the exception than the rule though. Haven't read too many reports of the low voltage kernel not working dependably. Completely depends on your luck however.

I flashed Faux's low voltage kernel(CFS) in the afternoon and set governor to smartass(245/768). Haven't had a chance to test stability yet. Will push it once I have the battery settings figured out. Am thinking of trying BFS in a few days to see how battery life compares when underclocked. Any thoughts?

#7 synaesthetic

synaesthetic
  • Members
  • 242 posts

Posted 05 May 2011 - 08:37 PM

BFS will be worse on battery life than CFS since it prioritizes performance. I haven't tested it myself, because the CFS/UV basically fits me perfectly. Just wish I could goose a teensy bit more battery life out of it.

Turning off automatic brightness and setting the brightness to about 30% seems to be the best compromise for me, but it makes the phone hard to read outside. Auto-brightness seemed a bit wonky and would max brightness in a lot of situations where I didn't need it.

Edited by synaesthetic, 05 May 2011 - 08:37 PM.


#8 rahvan

rahvan
  • Members
  • 10 posts

Posted 05 May 2011 - 09:03 PM

The excessive brightness is being caused by the settings in the Light Sensor Filter me thinks. Raw light sensor readings go upto 10240. However I just noticed that in the light sensor levels any reading over 2600 sets brightness to 100% i.e. 255.

Here are the settings I am trying out now. Will let you know how it works.

Cyanogenmod Settings > Display > Automatic Backlight > Light Sensor Filter ENABLED (REQUIRED if you want the light sensor to generate values between the 10 Raw values)
Cyanogenmod Settings > Display > Automatic Backlight > Window Length > 30 secs
Cyanogenmod Settings > Display > Automatic Backlight > Reset Threshold DISABLED
Cyanogenmod Settings > Display > Automatic Backlight > Sample Interval > 5 secs

Cyanogenmod Settings > Display > Automatic Backlight > Light Levels > Use Custom ENABLED
Cyanogenmod Settings > Display > Automatic Backlight > Light Levels > Edit Other Levels > Light Sensor Levels outlined below (21 Levels).
Input these values after choosing 'Set number of Levels' and entering '21'

Lower---Screen
0----16
21----28
41----40
81----52
161----64
226----76
321----88
481----100
641----112
1281----124
1665----136
2049----148
2601----160
3668----172
4734----184
5801----196
6534----208
7268----220
8001----232
8748----244
9494----255


I basically added more increments in between the fixed raw levels the sensor can detect which are 10, 160, 225, 320, 640, 1280, 2600, 5800, 8000 & 10240. By enabling the filter (which takes an average of readings) we can then adjust the screen brightness with more increments and accuracy.

I am going to try these settings for a few days. If they work well then I will add them above to the battery optimization settings. My only concern at this point: I do not know how much battery the sampling and filtering will take which is why I am starting with a 5 sec sample interval and will go down gradually as required.

Edited by rahvan, 05 May 2011 - 10:50 PM.


#9 rahvan

rahvan
  • Members
  • 10 posts

Posted 05 May 2011 - 11:16 PM

You can also disable filtering/sampling and use a 10 level scale. Here are the settings to improve Auto Brightness accuracy:

Cyanogenmod Settings > Display > Automatic Backlight > Light Sensor Filter DISABLED

Cyanogenmod Settings > Display > Automatic Backlight > Light Levels > Use Custom ENABLED
Cyanogenmod Settings > Display > Automatic Backlight > Light Levels > Edit Other Levels > Light Sensor Levels outlined below (10 Levels).
Input values below after choosing 'Set number of Levels' and entering '10'

Lower---Screen
0---35
161---64
226---76
321---76
641---88
1281---112
2601---124
5801---160
8001---196
9494---255

You can always adjust the numbers in the second column and also instead of using 255(max), use lower values to cap the maximum brightness of the screen under direct sunlight. The MyTouch 4G does have a very bright screen.

Edited by rahvan, 06 May 2011 - 12:54 AM.


#10 synaesthetic

synaesthetic
  • Members
  • 242 posts

Posted 08 May 2011 - 10:11 PM

CFS-LV #142 no longer has broken wifi with CM 7.0.3 and all nightly builds after 7.0.3. Works fine, I'm using it with nightly #65, no wifi problems.

#11 rahvan

rahvan
  • Members
  • 10 posts

Posted 08 May 2011 - 10:33 PM

Thanks. Flashed 2.6.3 (#142) today into CM 7.0.2 this morn. Rock solid. Will upgrade CM soon.

#12 synaesthetic

synaesthetic
  • Members
  • 242 posts

Posted 09 May 2011 - 12:42 AM

Had to turn off the automatic backlight... it was hitting my battery way too hard. Leaving the screen at 40% seems to work best for me except in bright sunlight, but I can just use the widget to toggle quickly.

#13 rahvan

rahvan
  • Members
  • 10 posts

Posted 09 May 2011 - 01:02 AM

:(

The custom light sensor levels(at the very top of the page) are working well for me. However there is one persistent glitch/bug: The screen will go to max brightness coming out of sleep sometimes when I switch it on i.e. it does not adjust automatically :blink:  

Just turning the screen off and on fixes it to the correct brightness specified in the levels. Other than that they are working well. Especially the maximum brightness cap. Battery seems to be holding a lot better than the default settings.

I am sure I could get more by setting it to a fixed 40% though.

Edited by rahvan, 09 May 2011 - 01:11 AM.


#14 synaesthetic

synaesthetic
  • Members
  • 242 posts

Posted 09 May 2011 - 05:58 AM

Something seems odd about all post-7.0.2 builds. They all seem to be extremely hard on the battery compared to 7.0.2. Nightly #65 I am seeing only 50% battery life after ten hours off the charger with moderate use--compare to 55-60% after fourteen hours off the charger with 7.0.2, same usage patterns.

My partner's Slide is eating its battery so fast it won't even make it through half a day with minimal use. No idea what's going on here, but it doesn't seem to be the kernel. Something in the build is misbehaving. I've been watching it with SystemPanel but I can't really tell what's going on...

#15 rahvan

rahvan
  • Members
  • 10 posts

Posted 09 May 2011 - 11:01 AM

Was planning to upgrade CM today. Thanks for the heads up. Battery life is important to me coz I need my phone working all times (for work). Guess I will have to hold off trying the newer builds till the weekend when I have a lil more time. Thanks again.

#16 synaesthetic

synaesthetic
  • Members
  • 242 posts

Posted 10 May 2011 - 01:25 AM

I just flashed nightly #66 last night and things seem to be more normal, though battery life is difficult to properly quantify when so many variables can influence it.

I wonder, though, if it wasn't signal woes that caused my battery to be so crappy yesterday. I was outside my normal range, and sometimes in San Francisco I have a harder time hanging onto a 3G signal.

The quality of signal seems to be such a wildcard that one can't really fill all the variables it introduces into the battery life equation. I suspect though that a day of moderate to heavy use ending on half capacity is still a significant improvement over the stock ROM... and all of that with far better performance and even overclocking! :)

#17 synaesthetic

synaesthetic
  • Members
  • 242 posts

Posted 10 May 2011 - 02:59 AM

An update... been in the East Bay all day today. Usage is about normal for me... a good bit of SMS, email, a little voice and an hour and a half of music playback and I'm at 76% after eight hours of time off the charger. Seems pretty consistent with my usual battery life since I started using the low voltage kernel.

Definitely a big improvement in both longevity and performance over stock.

(Running faux123's CFS/LV kernel, 245 min 1401 max, brightness constant at 40%)

#18 rahvan

rahvan
  • Members
  • 10 posts

Posted 10 May 2011 - 10:59 PM

It might just be the signal. 3G scanning is very demanding on the battery. My brother who lives in the bay area keeps his iPhone on 2G at all times coz 3G sucks around the city and his battery keeps running out.

Overall for moderate use these are working very well for me. The battery today is at 54% after 13 hrs and quite a few calls.

However yesterday it ran out really fast. It last till 6pm in the evening(13hrs only). No mystery in my case though. I was on the phone most of the day. I definitely need a backup battery for very heavy use days.

Sedio and Mugen batteries have very inconsistent reviews on Amazon, with quite a few people complaining of sub-par performance after a few weeks. Looks like it depends on your luck. At $40-$50 a pop that is terrible. Have decided to get a prodicell battery. Costs as much as an OEM replacement($20). At the very least will be my backup battery.

#19 synaesthetic

synaesthetic
  • Members
  • 242 posts

Posted 11 May 2011 - 07:39 AM

After fourteen hours I've got 50% left in the tank. A day of a few dozen SMS, twenty minutes of phone calls, two hours of MP3 listening, a bunch of web browsing... lots of reading the Google I/O liveblog... even though the damn convention is less than five miles away from me I can't go to it as an ordinary mortal... screen on for about 1hr 45mins.

This is damn good considering a 1.4GHz overclock. :D

#20 rocktoonz

rocktoonz
  • Members
  • 136 posts

Posted 02 June 2011 - 05:03 PM

This may be a stupid question, but I'm kinda stumped on this....how can I change the settings for the Power Control widget without removing it and adding a new one?