My Battery and the 38 hour Charge...a Tutorial

Jarnld

Well-known member
Oct 22, 2012
70
0
0
Visit site
*****THE ULTIMATE SETTINGS PAGE*****

This is a guide entirely based on my own experience and experimentation on how to acheive amazing battery life and performance. I?ve spent countless hours reading, learning, trying tons of combinations of settings, and failing numerous times. Try, try, and try again, right? Hopefully I can help someone alng the way. There are a few things to realize before we begin:
a) Achieving 36+ hours on one charge IS possible
b) You can maintain a completely useable and bearable level of high performance
c) I?m assuming you?re rooted
d) ?and preferably running CM10 (or similar)
e) You can break your Juice Defender addiction in less than 12 steps (ha!)
f) The process takes time, patience, and a willingness to learn

LET?S GO!

*****BASIC SYSTEM SETUP*****
Ok, so here is my personal setup. I?ll list out my specs, however these tweaks/mods/common sense practices pretty much apply to all Android devices. All of these can be found by Googling the .zip + XDA. (for example: Carbon Rom + XDA)

HTC Evo 4G LTE
Carbon ROM for JB 4.2.2(HIGHLY recommended)
Komodo-31 Kernel (It?s a beast. Nuff Said.)
Firmware 3.16.651.3 (radio 1.12.11.1210 / PRL 25015)
Dual Core Mod AOSP (Google it or search XDA)
GPS Mod (8NTP)
TWRP 2.3.1 (There?s a reason I?m not using the latest.)


*****ESSENTIAL APPS*****

There are a few apps that I install IMMEDIATELY after flashing a ROM ? consider them my base package. I highly highly HIGHLY recommend using the following apps, as they will make your life as a flasher much easier. (YUP! I said it :p ) I?m assuming your recovery is already installed ? so that doesn?t count for the purposes of this section.

a) Titanium backup + License Key?..If you?ve dabbled at all then you know what this is. Backup and restore apps, app data, system data etc. The licensed version does it automatically as well. Well worth the couple bucks.
b) ROM Toolbox Pro?..This is essentially a giant toolbox for rooted phones ? and a da** good one at that. I use this to control voltages, CPU, governor, apps, ROM installs, UI tweaks etc, etc. Some people swear by SetCpu, and I used to as well, however I like the fact that I can consolidate all the functions I need into one app.

c) ES File Explorer?..Well, it explores files haha. Personal preference over all the rest. I believe this app just does it all better ? but that?s just me. Feel free to experiment obviously.

d) Cool Tool?..One of my favorite apps happens to be the most overlooked and underrated apps there are. This app will put any system information you often need to see in the status bar (or anywhere on the screen for that matter). Highly customizable, no effect on battery.

e) Better Battery Stats?..Ahhhh, for the love of battery. Everyone is after better battery life. This app lets you track system processes, alarms, partial wakelocks, etc in order to figure out your battery conundrums. I seriously use this every day. It provides incredible statistics for you, and to be honest, you need it when you?re trying to get amazing battery life (and we ARE?.right???)

This is my ?Bare Essentials Package? that I load up every time I start from scratch with a ROM. The other things you may need, like a terminal app, are usually baked into your ROM of choice. Everything you need to edit your system to perfection is included above.


*****NOT SO ESSENTIAL APPS ? AND BETTER ALTERNATES!*****

On the flip side, there are several applications that are plain evil when it comes to preserving battery. Google apps (Google+, Navigation, Maps, etc) are notorious for wakelocks, and in turn killing your battery. And on another note ? who says we HAVE to use Google apps anyway??? We are on Android after all. Find some alternatives!
How do I decide whether to use an app or not? Simple?it all comes down to battery life versus performance/app quality. For example ? Facebook used to be a crazy battery drainer, but there was no other app on the market (my opinion) that could compete with Facebook?s software. The alternates either didn?t sync correctly, didn?t update at all, or the notifications didn?t work. In the case of Jake VS. Facebook ? they came out on top, and I use their app.
POINT IS: I WAS WILLING TO LET FUNCTION AND FEATURES WIN OVER BATTERY SAVINGS IN THIS PARTICULAR CASE. (?partially because I lose my mind using buggy apps that only work 50% of the time!) You need to do the same. The quest for stellar battery life should not override enjoying the device you pay for month after month. Some folks I know get so carried away that they forget to have fun with it! However; If an app is not letting my phone sleep at all then it?s gotta go, and it gets ousted with a quickness. You have to draw a line somewhere.
Here we go with my list of alternates:
a) Facebook?????I believe the issues have been fixed but, Atrium (in development) will be great once they get push notifications. Friendcaster is one many recommend, but I think their UI is horrid, and my notifications worked 50% of the time, at best. I stick with Facebook.

b) Google Maps (package including Navigation)?????.I?ve been using two separate map applications lately. Meaning, I?m still not sold on a replacement yet. That being said ? Mapquest is OK in my book and will definitely do the trick for navigation. I personally use Scout and RMaps. RMaps is OSM, and I use it to basically just look at maps ? no navigation. Scout does great with navigation, and looks more like an external TomTom GPS unit.

c) E-Mail????..Save yourself the trouble and use K9 Mail. Trust me on this one.

d) Gallery??????.Nothing wrong with the original per se, and this has zero to do with battery life, but I just love QuikPic. Great UI, great options, easy to use, quality picture viewer.

e) Google+ and Google Now??????Based on my research there aren?t any apps that serve as replacements. These are BAD NEWS when it comes to battery life. I choose to simply not use them. Google+ can wait until I?m sitting in front of a computer ? just my thoughts. I?d rather have a phone that lasts 36 hours instead of 6. (Exaggeration, but still?).

Basically, just remember to weigh the app?s quality and features against the affect it has on battery life or performance. If it?s keeping your phone awake while it?s not in use ? dump it. More on wakelocks later.


*****GOVERNOR SETTINGS*****

There is a MOUNTAIN of information to be given about governors, but I?ll sum it up like this: A governor is a policy that sets frequency based on conditions. Easier terms: If you?re trying to do a lot at one time on your phone, or you?re using a resource intensive program, then the governor ramps up and sets the frequency at the highest value you have allowed it to go to.
On the other hand, if you?re doing nothing, then the governor sets the frequency to the lowest value you have indicated it is allowed to drop to. The manner in which the frequencies change is what I?m more concerned with (and is incredibly technical). You can Google ?Android Governors? and come up with an incredible amount of information. Because this is about my specific setup I?ll explain what I use.
I favor the Interactive Governor. I also favor SIO for the I/O scheduler. Interactive is like OnDemand in that it adjusts the CPU frequency as the workload increases. Interactive, however, scales up faster than OnDemand.
Here are my settings as far as my CPU is concerned (highest priority is on top):
Screen off: 192-384mhz
Charging: 384-1512mhz
Screen On: 192-1134mhz
Battery<20%: 192-810mhz

SIO:
Go highspeed load: 96
Hispeed frequency: 1134000
Min sample time: 5000
Timer rate: 30000
Go highspeed controls the threshold at which the governor ramps up.
Highspeed frequency is the frequency that the governor ramps up to upon reaching the threshold.
Minimum sample time is the lowest amount of time to spend at the highspeed frequency before ramping back down.
Timer rate is the amount of time spent reevaluating the system load while it?s not idle.

**A HIGHER go highspeed number means LOWER frequencies are used more often = better battery
**A HIGHER minimum sample time mean HIGHER frequencies are utilized for longer = worse battery


And yes, I don?t overclock. In fact I tune my system down a LOT as you can see. Stock on my phone is 1512MHz. I can do everything I need to on my phone (and I multitask like a champ) by using 1134MHz. It saves a LOT of battery juice.
For instance, by underclocking an Athlon XP 1700+ processor from 1466 to 1000 MHz and reducing the core voltage from 1.75 to 1.15V, a computer user reduced the power consumption from 64.0 to 21.6W, i.e., 66% power reduction, with only 26% less performance. ?Ultimate Underclock & Undervolt Project; http://www.silentpcreview.com/article33-page1.html?


*****BUILD.PROP SETTINGS*****

There?s been a TON of debate about editing the build.prop. Essentially this file is your phone?s identity. Meaning that you can change the values to mimick another phone, which in turn allows you to install apps you would normally otherwise be unable to install. In addition, you can add custom script which will increase performance.
Keep in mind though, a lot of people list scripts that either do nothing, or do nothing for your particular phone model. A lot of scripts found online in reference to editing the build.prop are already contained in other files on the phone. This means they can?t be edited without going through a process that is worthy of its own thread entirely, and furthermore, if you put them in the build.prop they wont stick. Basically, you?ll be wasting your time by even adding them.

**Make a backup of your build.prop before doing any editing**
*****MAKE A BACKUP OF YOUR BUILD.PROP BEFORE DOING ANY EDITING*****

Here are scripts to add to the build.prop file. Feel free to knock em, tell me they don?t work, or tell me I?m genius. (# means ?ignore this line? for those who didn?t know):
#Media Streaming
media.stagefright.enable-player=true
media.stagefright.enable-meta=true
media.stagefright.enable-scan=true
media.stagefright.enable-http=false
media.stagefright.enable-rtsp=true
media.stagefright.enable-record=true
ro.media.enc.jpeg.quality=100
ro.media.enc.hprof.vid.bps=8000000
wifi.supplicant_scan_interval=180

#Scrolling
windowsmgr.max_evesec=90
#(90 is the max that android will handle, so anything above that is overkill)
ro.max.fling_velocity=12000
ro.min.fling_velocity=8000
View.scroll_friction=1
debug.performance.tuning=1
touch.size.calibration=geometric
touch.size.scale=100
touch.pressure.calibration=amplitude
touch.pressure.scale=5
view.touch.slop=8

ro.ril.enable.amr.wideband=1
ro.kernel.android.checkjni=0
ro.kernel.checkjni=0
logcat.live=disable
ro.ril.hep=0

persist.sys.shutdown.mode=hibernate
ro.ril.disable.power.collapse=0
ro.mot.eri.losalert.delay=1000
ro.config.nocheckin=1
pm.sleep_mode=1
persist.sys.ui.hw=1

ro.media.dec.jpeg.memcap=12000000
ro.media.enc.hprof.vid.bps=12000000
ro.media.enc.jpeg.quality=100

ro.telephony.call_ring.delay=0

ro.ril.hsxpa=3
ro.ril.gprsclass=32
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=14
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=6

#Keep Apps (my personal list. Substitute the app name you wish to keep in memory. Can be found in ROM Toolbox Task Manager by long clicking on the app name.)
sys.keep_app_1=net.dinglisch.android.taskerm
sys.keep_app_2=com.jb.gosms
ro.HOME_APP_ADJ=1

#3G Tweaks
net.dns1=8.8.8.8
net.dns2=8.8.4.4

Like I said?some of these work, some wont. It depends on your ROM, Kernel, Phone Model, the weather, time of day and what your favorite color is. Seriously. This has been debated a lot. Try it for yourself. I?ve definitely noticed a difference while utilizing a few, ESPECIALLY disable power collapse and pm sleep mode. I left my phone for eight hours before and the battery doesn?t drop 1%...yes that says one %.




*****SYSCTL.CONF AND INIT.D SETTINGS*****

Okay?here?s the more complicated part. First thing is first?

STEP ONE***********
-Use file explorer to create a new file inside the system/etc/init.d/ folder.
-Call it ?10sysctl? - No extension, no quotes.
-Now open 10sysctl as a text file and add the following to it:

#!/system/bin/sh
# grep sysctl /etc/init.d/*
# Load /sys/etc/sysctl.conf
Sysctl ?p

-Save that bad boy.

STEP TWO**********
-Use file explorer and navigate to system/etc/
-Locate sysctl.conf
-If it?s not there, then create a new file and call it ?sysctl.conf? -No quotes
-Paste the following into it:

fs.nr_open=1053696
fs.inotify.max_queued_events=32000
fs.inotify.max_user_instances=256
fs.inotify.max_user_watches=10240
fs.lease-break-time=10
fs.file-max=165164
kernel.threads-max=525810
kernel.random.write_wakeup_threshold=256
kernel.random.read_wakeup_threshold=128
kernel.sched_compat_yield=1
kernel.panic=0
kernel.panic_on_oops=0
kernel.msgmni=2048
kernel.msgmax=64000
kernel.shmmni=4096
kernel.shmall=2097152
kernel.shmmax=268435456
kernel.sem=500 512000 64 2048
kernel.sched_features=24189
kernel.hung_task_timeout_secs=30
kernel.sched_latency_ns=18000000
kernel.sched_min_granularity_ns=1500000
kernel.sched_wakeup_granularity_ns=3000000
kernel.sched_shares_ratelimit=256000
kernel.sched_child_runs_first=0
fs.lease-break-time=10
fs.file-max=65536
vm.dirty_ratio=90
vm.dirty_background_ratio=80
vm.oom_kill_allocating_task=0
vm.overcommit_memory=1
vm.page-cluster=3
vm.drop_caches=3
vm.min_free_kbytes=4096
vm.panic_on_oom=0
vm.dirty_expire_centisecs=1000
vm.dirty_writeback_centisecs=2000
vm.oom_kill_allocating_task=0
vm.vfs_cache_pressure=1
vm.min_free_order_shift=4
vm.laptop_mode=0
vm.block_dump=0
Here?s what we?re concerned with?rather, here?s the ones I feel are most important that I?m going to explain.
-vm.dirty_ratio=90?????See below
-vm.dirty_background_ratio=80??..These two control how often the kernel writes data to disk. Linux actually writes to the file system first and then pushes to the disk (our Micro SD) later.
-vm.oom_kill_allocating_task=0??.Kills or doesn?t kill the task that caused the OOM situation. 1=kill the guilty task, 0=fin me some RAM!
-vm.panic_on_oom=0????..Tells the kernel to panic and reboot, or to kill rogue processes to free memory. 1=panic, 0=find me some RAM! Reboot time is set by ?kernel.panic=0? ?number in seconds.
-vm.vfs_cache_pressure=1???.based on a scale from 0-100. Essentially tells the system to lean towards using the file system for caching. Setting this to ?1? means the kernel will drop the cache only when it is totally out of memory. Works great, but you should probably do manual cache clearing every so often. Twice a day should be sufficient. I personally haven?t had an issue with lag because of this, but I clear ever 4 hours for good measure (and because I?m OCD haha).

STEP THREE**********
-Open your terminal
-type ?su? ?no quotes
-type ?sysctl ?p?
-You will see all the info you loaded into the sysctl.conf file show up on the screen.
-You?re done. Reboot into recovery. Clear Dalvik. Reboot system. (PS?clear Dalvik when you edit the build.prop as well?
-Open terminal again.
-type ?sysctl ?aI grep vm? -no quotes
-Check the values that show up and make sure they match the values you entered in the sysctl.conf file.
-If the numbers match, then your system is loading the sysctl.conf file at boot, and you?re golden.
-Reap the rewards of being patient and learning!



*****MINIFREE SETTINGS*****

Next, open up ROM Toolbox and open the task manager. Pull the screen to the right and you?ll reveal the area to set minifree values. Again, Google minifree and you?ll discover a wealth of information.
I?m constantly messing with these, but here?s what I?ve found to work for me the best.
6 Foreground
8 Visible
16 Secondary
20 Hidden
60 Content
75 *empty

** Empty applications is where the magic happens, so to speak. Basically we?re robbing from Peter to pay Paul ? or the rest of the applications. I?d recommend keeping it under 95. Why edit the values if you?re not gonna get extreme with it? Set the values, let the phone sit for a few hours, and see where you stand. If you?re too sluggish or something isn?t working right then go back to stock values and try again. That being said ? I?ve been using these values, and they?ve been working out amazingly well.



*****FINAL THOUGHTS*****

Aside from all of the above, here are some common sense things to look out for.

A) Turn off your GPS when not in use. Better yet, automate it by using Tasker to turn on when you open your map or navigation app.
B) Minimize the amount of times individual apps sync in the background. Do you really need your Facebook updating ever 15 minutes??? NO.
C) And on that note?you can turn the sync to manual on Facebook without losing your push notifications. Yeah, that?s right. You?ll get all your fancy comments popping up when people tell you how much they like your last post. Just open up Facebook and manually refresh it. Save battery, and let your phone sleep a bit more.
D) I sync all my accounts manually. Meaning if I add a new number to my contacts I?ll go into the system settings and manually sync it. I want CONTROL over my phone?I don?t just want it to have free reign.
E) I favor a ?seek the information? approach. This means, like iOS, you are forced to seek out what you need rather than having it force fed to you at all times of the day.
F) Set your screen to turn off in 15 seconds.
G) Use Tasker to automate which apps will require the screen to stay on so your screen off time isn?t a nuisance. Apps like Feedly, and K9 Mail for example, tell my phone to stay turned on for a lot longer than 15 seconds.
H) Use your freakin? 3G. We?re such a society of ?NOW NOW NOW.? I?m not saying don?t use your 4G ? you?re paying for it afterall. What I?m saying is turn it on when you need it, then turn it back off. My network speed is more than fast enough with 3G, and I live out in the middle of nowhere. Seriously. I only use my 4G to download apps, upload pictures or video, to watch YouTube, etc,etc. Other than that????..turn it off.
Here?s why. When you have WiFi or 4G enabled it means your phone is constantly scanning trying to find a signal. If you don?t need it, then turn it off. Every time you switch from a 3G to 4G to WiFi area your phone begins searching ? and if your phone is searching then it?s not sleeping. It?s awake. Awake means no deep sleep. No deep sleep means battery drain. Edit your build.prop to change the rate at which your WiFi scans?instead of 90 seconds, set it to 180. Mess around with it!


*****USING BETTER BATTERY STATS*****
This should be self explanatory, but hey, some folks need a little help, and there?s nothing wrong with that. Its why were all on here ? to learn, right?
Open that bad boy up. You?ll see a ton of stats that may appear meaningless at first. Take a moment and read them. I?ve found the stats that help me out the most are ?Alarms? and ?Partial Wakelocks?.
I charge to 100%, and then reboot the phone. Open the app and go to the settings and set a custom reference point. Now shut off the screen and let the phone sit for two or three hours.
When you come back, open the app and set the app to show Partial Wakelocks from your custom reference point.
If you have an app that is showing 4,000 wakes with a total time up of around 100 minutes, well then there?s your problem. That?s the stupid worthless app that isn?t letting your phone enter a deep sleep. Your goal is to eliminate these as much as possible. Google solving the wakelock issue, and you?ll find a wealth of info. Facebook and any email service you use (even K9) will generally be pretty high up, if not on top, of your wakelock list. It?s decision time ? either ditch the app, or deal with it.
After solving your wakelock issues you should be hitting a very low rate of battery drain per hour. I?m generally at 2.3-3% drop every hour.
For example:
My last boot was 7h 6 min ago and I was at 83% full. I?m at 65% now, which equals about a 2.6ish% drain an hour. Not too bad. I?ve had better?but not bad. There?s definitely improvements I can make, but this particular ROM setup I?m on is a work in progress ? so give me a break!!! Kidding. ;)
Your awake and screen on times should be almost similar?meaning when your phone wasn?t sleeping you were using it.

100%/2.6%=38 hours on a charge
38 hours*.25 (25% we actually use the phone) = 9.5 hours of screen time.

How much time per day?
38/9.5 X 24/x ??.cross multiply??
228=38(x)????228/38=X??..
X=6
First of all, 9.5 hours of straight screen time is a lot. Even if it works out to be less than that (and it likely will with YouTube and other CPU heavy tasks) it?s still a lot. That?s 6 hours of straight screen time a day. I would beat my child if they spent that much time on a phone! Kidding?but starting to see my point? It adds up!
In all honesty I text a lot. I mean, a LOT. More than is probably healthy. Plus I have Facebook, Twitter, Feedly, Press, APW Widgets, and K9 (and probably a few more apps) all pulling data in every hour or two. Imagine if you just ditched them? Or set them to sync every 4 hours or daily? First of all, you?d get a lot more done not being on Facebook ;) Secondly, you?d have a sub 2%/HR battery drain.
In fact, I may just do that when I?m done writing this. Well, I?ll keep Twitter at 20 minute intervals, because I get news updates, but hey - Risk versus reward.
??Just food for thought.

**************************
Hopefully this very brief explanation of my setup helps SOMEONE. It?s a lot of trial and error, but well worth it in the end when you are able to enjoy your phone for hours on end!
 

Members online

Forum statistics

Threads
943,210
Messages
6,917,828
Members
3,158,882
Latest member
xak47d