[GUIDE] Maximum Battery - Maximizing your battery life with CM7 ROM by NeoLojik - HTC Desire S

UPDATE [11th September 2011]
Modified the SetCPU profiles:
Removed AC-charging Overclock (subject to temperature warnings mentioned in replies)​Reduced some MAX values (has added 5 hours of real-world battery use and makes no noticable difference in performance)​Added an optional < 101% profile to default the maximum clock speed to 729MHz (does not reduce performance, adds 2 hours effective runtime)​Specified the Priority values (which I had forgotten to mention originally)​
Introduction - The Desire S Battery Problem
As a fellow Desire S owner, you no doubt agree that it is a lovely phone: sleek, thin, relatively light, feature-filled... almost everything anyone could ever want from a phone!
However...
As a fellow Desire S owner, you no doubt agree that the battery life (on the Stock Sense ROM, regardless of how strict your PWM settings) is rather pathetic.
I have two HTC Desire S phones (one for myself, one for my wife), and both of them have almost exactly the same runtime (give or take a few minutes) when run in identical test conditions... no more than 18 hours (almost all of which with the display turned off) between charges, and less than 8 hours average with light-to-moderate screen-time when in use.
Bottom line: it's rather pathetic, and unacceptable.
Thankfully, we have options now... and this guide provides you with the option I have chosen for my Desire S phones.
Introduction - The Sacrifice
HTC Sense is (to many) considered a very "pretty" GUI, with nice animated transitions, a rounded feel etc, however it comes at a price: it's a battery hog!
I have played with many Sense 2 and Sense 3 ROMs on the Desire S, all of which share the common result of dimished battery runtime...
Bottom line: The simplest way to get more battery life is to sacrifice Sense entirely!
Just to point out: HTC Sense is the only sacrifice this guide makes in the persuit of optimal battery life! Unlike other guides, this one doesn't compromise any other features, or ANY performance (in fact, I've found performance with the setup described here to be even better than the stock ROM... noticably so!)
DISCLAIMER
I cannot (and will not) be held responsible for any losses or damages resulting from your use of this guide or the materials it contains. If you brick your phone, you've done something wrong and the fault is your own.
You should follow this guide with a fully charged battery, and if possible perform all steps involving a PC from a Laptop, with your phone connected via USB to minimize the risks associated with sudden power loss on your mains supply.
Stage 1: S-OFF
Aside from a lucky few whose Desire S came with S-OFF as a factory default, most of us have S-ON handsets.
With S-ON, you cannot flash a custom ROM onto your Desire S... but fear not, as there is now a FREE (and insanely simple) way to unlock our handsets, giving us the precious S-OFF we require.
You will require the Android SDK to be installed on your system, as well as the USB drivers for the HTC Desire S (these are installed as part of HTC Sync, though you should close HTC Sync from the system tray before proceeding as the S-OFF process will refuse to run with HTC Sync running at the same time)
Head on over to http://revolutionary.io/ to download their tool. This guide presumes you are using Windows, though it should be easy enough - if you're a Linux user - to adapt this information for your Linux platform.
Once you press the link to download Revolutionary, you will notice that a form appears asking for certain information. You'll see a screenshot of this below, but before we get to that there's something you must do...
Open a Command Prompt window from the Platform-Tools directory of the Android SDK.
From that Command Prompt window, type adb devices. Presuming you have the HTC Desire S drivers installed correctly, and your handset connected to your PC via USB, you should something like this:
{
"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"
}
LEAVE THIS COMMAND PROMPT WINDOW OPEN, WE'LL NEED IT AGAIN SHORTLY
The third line of text begins with your handset's serial number.... you will need to enter this into the form on the Revolutionary website in order to generate your Beta key:
Once the Revolutionary zip file has downloaded, extract its contents into a folder on your PC (doesn't matter where, so long as you have access to that location).
Run revolutionary.exe following the instructions provided (it's a very quick and simple process... the automated portion of which shouldn't take more than 2 or 3 minutes to complete)
When it prompts you to install the Recovery mod, do it! You will need it for the next stage of this guide!
Your HTC Desire S now has S-OFF, is equipped with a version of ClockWork Recovery, and is ready to recieve the custom ROM! (All is good with the world).
Stage 2: The Custom ROM
IMPORTANT - THIS WILL FACTORY RESET YOUR PHONE (UNAVOIDABLE) SO DON'T FORGET TO BACK UP WHATEVER YOU NEED BEFORE YOU PROCEED WITH THIS GUIDE! YOU HAVE BEEN WARNED!
NOTE You will either need a spare MicroSD card, or to back up your existing MicroSD card and make it accessible to have files written to it from your PC (I use a card reader, but you can always use the USB Mass Storage feature of the phone itself to access the SD card in your phone from your PC)
The custom ROM of choice is NeoLojik's CyanogenMod 7, lovingly and paintakingly prepared especially for our HTC Desire S handsets, with quite probably the most prompt and spectactular support from NeoLojik himself.
I have chosen NeoLojik's CM7 ROM because it has proven (after exhastively testing other ROMs for the Desire S) to provide me with the very best battery performance, as well as all of the settings you will tweak as part of this guide.
Download (from the ROM's thread linked above):
The latest version of his ROM
The recommended Tiamat Kernel
The recommended version of the Google Apps package
To save time later, download The Android Market 3.1.3 APK
(You can download the APK from your phone directly after you've completed this portion of the guide, if you prefer)
Place the three ZIP files, as well as the Android Market APK, on the root folder of your MicroSD card (by "root" I mean the initial path of the SD card, which is whatever drive letter it mounts as on your Windows PC - e.g. "H:\")
Now, with your phone still connected to your PC via USB (and the SD card put back into your phone, if required), return to the Command Prompt window we used earlier and type adb reboot recovery
Now direct your attention to your phone
Once the Recovery Menu has loaded (should take about 30 seconds) we will follow some simple instructions below... but first, a few points on how to use Recovery:
Use the Volume Up and Down buttons on your handset to highlight one of the displayed options
Use the Power button to trigger the highlighted option.
wipe data/factory reset
wipe cache partition
apply update from sdcard
choose zip from sdcard
update-cm7.1.0-RC1-DesireS-Nexx-signed.zip (or whatever the ROM's filename is at your time of downloading... it will change as the ROM evolves)
apply update from sdcard
choose zip from sdcard
Tiamat_Saga-v1.1.2.zip (or whatever the filename is for the recommended Tiamat kernel at your time of downloading)
apply update from sdcard
choose zip from sdcard
gapps-gb-20110613.zip (again, filename might be slightly different for you)
Remembering with each selection to navigate to the "YES" option in the confirmation menu (this exists to prevent you from accidentally flashing the wrong file onto your phone)
Now, from your PC (or from the Recovery menu... doesn't matter which), you want to reboot your phone! To do this from the PC, you will just type adb reboot into the Command Line window we used previously.
Your phone will now boot with the new ROM (CyanogenMod), and has been factory reset (so you'll have to run through the first-run configuration wizard).
NOTE: Don't be scared if (after the boot animation disappears) the screen remains black for a minute or so! The first boot of the new ROM (especially with the Tiamat Kernel) does take a bit longer than every subsequent boot there-after. Just give the phone a few minutes, and press the Power button. You SHOULD see the Lock screen once the device is ready!
Run through the first-run wizard following instructions provided (fairly strait forward), though keep in mind that (at the time of writing) the wizard does not prompt for a WiFi connection until AFTER it attempts to log in to your Google account! Fear not, though, as when it fails to connect to your Google account (presuming you don't have Mobile Data available to you), it'll then prompt for a WiFi network and repeat the Google account login afterwards.
Once you have completed the first run config, open the "File Manager" app included as part of the ROM.
Navigate to /sdcard and run the com.android.vending-3.1.3.apk file. You'll be prompted to allow unknown sources, you want to tick that box and click on the APK again.
Once you've installed this, you will be running the latest (and greatest) version of Android Market, which (amongst other things) enables you to use a different Google account for your Apps (very useful if you want to install your paid applications on your wife's phone, as I have)
Welcome to CyanogenMod!....
Stage 3: Battery-saving Mega Settings [Menu-by-Menu]
The Settings I'm providing you here are the results of countless hours of experimentation (as well as logic and common sense). They have proven to provide the best degree of battery runtime with absolutely no performance or feature sacrifice!
If a menu or entry within a menu isn't mentioned, it's because it has no bearing on power saving!
Wireless & networks
Wi-Fi settings
Network notification = OFF
Press the Menu button, then Advanced
Wi-Fi sleep policy = NEVER​
Call settings
Vibrate on answer = OFF
Vibrate every 45 seconds = OFF
Vibrate on hangup = OFF (NOTE: I leave this ON as my one concession as it's the only way you will know if a call drops out on you unexpectedly!)
Vibrate call waiting = OFF
Always use proximity = OFF
Enable sensor rotation = OFF
Voicemail notifications = ON (it doesn't save power, but seriously... you want it on!)​
CyanogenMod settings
Display
Automatic backlight
Light sensor filter > Enabled = OFF (If enabled, unnecessarily drains more battery life! The feature itself is pointless as there is no difference to the UX with it Enabled or Disabled!)​Light levels
Use custom = ON
Screen dim level = 14
Allow light decrease = ON
Edit other levels...
This is what I consider to be the most optimal set of levels:
Lower | Screen | Buttons
0 | 21 | 2
160 | 31 | 2
255 | 35 | 2
320 | 40 | 0
640 | 50 | 0
1280 | 75 | 0
2600 | 90 | 0
5800 | 130 | 0
8000 | 200 | 0
10000 | 255 | 0
Press Save & apply (scroll to the top to find the button)
NOTE: You may want to play around with some of the values in this table, as screen brightness is not a "one size fits all" affair, and what I can see clearly might not be so clear for you (or vice-versa). Basically, use those levels as a starting point, and tweak them from there until you find the best settings for you in various lighting conditions.
I will say this, you don't want to set the Buttons value above 0 if you can see the buttons even faintly at a given light level. The backlighting for the buttons is a surprising battery drain (it's calculated as part of the Screen's power consumption in the Battery Usage menu). Bottom line: if you don't need any lighting on the hardware buttons in order to use them even in pitch blackness, then set the value of Buttons for each set in the table to 0 and squeeze more life out of your battery!​
Performance (press OK when the warning is displayed)
CPU settings
Available governors = SMARTASS ("SMARTASS" has been designed specifically [and brilliantly] to scale the CPU frequency with such a perfect balance of performance-on-demand versus power saving... it's the perfect choice!)
Min CPU frequency = 192
Max CPU frequency = 1036 (We'll be using SetCPU [full version, bought from the Market] to set up some magical CPU profiles later in this guide, saving us LOTS more battery life!)
Set on boot = ON​
Sound
Haptic feedback = OFF (Remember: The phone's vibrator consumes more power than playing a beep or other short tone through the speaker at even the highest volume!)​
Accounts and sync
Auto-sync = OFF (Auto-sync being disabled saves both battery power, as well as bandwidth on your Mobile Data tarif [2G and/or 3G dependant on carrier]. Really, you should just "sync on demand" as and when you want/need to!)​
This concludes the Settings portion of the guide!
Stage 4: SetCPU (for ROOT users) configuration
SetCPU for ROOT Users is available for on the Android Market for just £1.25 (or $1.99 USD). Not only does this program enable you to overclock/underclock your phone's CPU, but more importantly it enables you to provide Profiles, to scale the CPU based on the operational status of your phone.
This is well worth the infintismal pricetag, as the potential power savings (at no performance cost) is more than significant!
Open SetCPU, go to the Profiles tab:
Enable = ON
Notifications = ON (Really this is up to you! I like to have notifications for when the profile is changing to ensure that the CPU is scaling properly, and to ensure that my profiles are the best they can be for performance/battery balance)
Add Profile
Profile = Charging AC
Max = 1036800 (Potentially, you could set it up to 2GHz, but I have stability (and heat) concerns, and I can't possibly see any circumstance where 2GHz would be remotely useful! If you do elect to overclock (particularly whilst charging), you will need to add a profile (with 100% priority) to drop the Max value if the temperature exceeds 45 C)
Min = 192000
Scaling = smartass
Press Save​
Add Profile
Profile = Charging USB
Max = 1036800 (Basically 1GHz [original] CPU clock. We don't want to bleed into the minimal input of power provided by USB, so this is the best setting to use)
Min = 192000
Scaling = smartass
Press Save​
Add Profile
Profile = Battery <
Battery < = 75%
Max = 652800
Min = 192000
Scaling = smartass
Press Save​
Add Profile
Profile = Battery <
Battery < = 50%
Max = 576000
Min = 192000
Scaling = smartass
Press Save​
B]Add Profile[/B]
Profile = Battery <
Battery < = 30%
Max = 422400
Min = 192000
Scaling = smartass
Priority = 80
Press Save​
Add Profile
Profile = Screen Off
Max = 345600
Min = 192000
Scaling = smartass
Priority = 60
Press Save​
Add Profile
Profile = Time
Time = 01:00 - 08:00 (NOTE: Substitute the given range with whatever your daily sleeping hours are!)
Max = 345600
Min = 192000
Scaling = smartass
Priority = 70
Press Save​
The following profile is optional... and (if used) would specify your default clock speed
Add Profile
Profile = Battery <
Battery < = 101%
Max = 729600
Min = 192000
Scaling = smartass
Press Save​
Feel free to experiment with other profiles as well! Perhaps you may want to procedurally reduce your CPU speed based on Battery % in a more gentle way... this is certainly possible, and would squeeze even more life out of your battery.
You should also feel free to use lower MAX values for each setting (I would strongly advise against higher values) if you feel that the lower clock speed makes little-to-no noticable difference in performance as you use your phone.
Personally, I notice no difference between 729600 and 1038600!​
Stage 4: Recalibrating your Battery
Install the Battery Calibration app (FREE on the Android Market).
If your phone isn't charged, charge it up so that it is showing 100% (with the Green LED lit).
Run Battery Calibration and press the Battery Calibration button. Immediately unplug the power/USB cable from your phone, and allow it to run (as normal) until fully discharged.
Once the phone has switched itself off, plug it into the AC cable (using the mains charger).... and LEAVE YOUR PHONE SWITCHED OFF until the LED indicator is lit green!
You may want to repeat the discharge/recharge cycle one or two more times (as many people claim that this provides a better calibration)... though really that just entails running your phone on the battery until it is fully discharged, then allowing it (whilst switched off) to fully recharge on the mains adapter (AC)... which is not what most people would normally do as a routine.
Potential Stage 5: Tasker
Tasker (£3.99 on the Android Market) enables you to create profiles which automatically change various settings based on one or more given criteria. This even includes the ability to switch on and off features of your phone such as WiFi, Bluetooth, GPS, GSM, Mobile Data and Airplane Mode.
By creating suitable Tasker profiles, you can squeeze even more battery life out of your phone!
If it's of benefit to people (let me know in the comments) I can expand this guide to include step-by-step instructions on creating the various profiles I would recommend in order to squeeze more battery runtime out of your phone without sacrifising features/functionality.
General Battery Storage/Maintenance Advice (Applies to all Lithium-Ion Batteries, including those used in Laptops)
To prolong the operational lifespan of your battery, you should not really allow your battery to run for very long below 50% charge, as "topping up" a half-charged battery generates less wear and tear on the battery, prolonging its overall lifespan.
NEVER leave your phone fully discharged for more than an hour, or the LiIon cells will begin to degrade, meaning your battery will never be able to physically hold as much charge. Indeed, the longer you leave a discharged battery, the less overall capacity your battery will retain.
NEVER store your battery (even if the phone is running at the time) in cold conditions! As a general rule of thumb, if it's "a little chilly" for you, it's unhealthy for the battery!
Both of the above tips form respectively the Number 1 and 2 causes of battery death! Don't let your battery become another statistic!
If - like me - you have one or more "spare batteries", you will likely be tempted to store them when they are fully charged (100%). This sounds like a good thing to do, but actually it can have (to a slightly lesser degree) the same damaging effect on the battery as leaving it fully discharged for any prolonged period of time!
The absolute best level of charge at which you should store a battery is at 50%, or as close there-to as possible!
Dependant on how often you find yourself recharging your battery, you should recalibrate it between every 3 to 6 months (the more often you discharge/recharge, the less often you should recalibrate).
Also, you should ALWAYS recalibrate after having flashed a new (or updated) ROM and/or Kernel!
My results using the exact configuration [excluding Tasker] detailed in this guide...
As I stated above, with the way I use my Desire S, I was lucky to get 8 hours of what I would call "light-to-moderate" use whilst running on the battery!
With the configuration detailed in this guide, I have now had a successful "100% to discharged" usage of 46 hours (under the exact same usage conditions as when I was using the stock ROM factory-installed on the phone (and updated OTA ~ a week ago).
This is a VERY significant improvement, though I must stress that results will vary heavily based on how much (or what) software you're running on the phone, how often you're interacting with it, how long you spend in calls etc.
Basically, every phone is different, and every operator (me, you, everyone) is different.
Please also keep in mind that your phone won't "settle in" to the new settings in terms of battery runtime until you've done 2 or 3 discharge/recharge cycles (as explained in the Battery Calibration portion of this guide)
Conclusion
There are plenty of third-party ROMs out there, and (obviously) I can't physically test them all! I have tested what I believe anyone would consider to be a perfectly suitable number (more than a dozen now), and have found the exact combination detailed in this guide to provide the very best battery runtime for me.
I understand that some of you will likely have your own ROM preference (for various reasons), but I hope that at least some sections of this guide will be useful to you.
If you just want to get the very best battery performance out of your Desire S, and either don't particularly care what ROM you use, or (like me) happen to love Cyanogen anyway... this guide will fit you like a glove!
Need any more advice?
No problem... post your comments and questions as a reply to this guide, and I'll answer anything I can, as promptly as possible (please consider that I have a company to run, and a life beyond the Internet... so replies might not always be "instant")
I hope you like this guide, and more importantly... I hope you enjoy your new-found battery runtime!

Unfortunately, I'm a Sense fan. ...so will take persuding to move away from the interface, as been using it for many years, but, I still appreciate a piece full of insight and advice written for the communities benefit. Well done and thanks for sharing.
I'll reference this in the development INDEX next to CM7 ROMS

ben_pyett said:
Unfortunately, I'm a Sense fan. ...so will take persuding to move away from the interface, as been using it for many years, but, I still appreciate a piece full of insight and advice written for the communities benefit. Well done and thanks for sharing.
I'll reference this in the development INDEX next to CM7 ROMS
Click to expand...
Click to collapse
Yeah, I can understand why so many people strictly adhere to Sense ROMs... for me the "slight prettiness" of Sense doesn't justify the hammering of the battery... especially as I actually preffer the L&F of Cyanogen anyway

If I have gotten 18 hours with almost always screen off I returned the phone. With nomal usage my phone last more than one day. Keeping the screen almost always off last almost 2 days with wifi and sync turned on (to be honest, never reached that again). ROM is whether LBC or rooted stock whith stock HTC kernel. So I can find any problem there. Nevertheless, this is a smartphone, and I always have a charger with me
I will try CM and what the battery life is like.

Profile = Charging AC
Max = 157440 (Potentially, you could set it up to 2GHz, but I have stability concerns, and I can't possibly see any circumstance where 2GHz would be remotely useful!)
Min = 192000
Scaling = smartass
Press Save
Fried CPU kgo. Overclock + Charging = Excessive heat being generated.

zeekiz said:
Profile = Charging AC
Max = 157440 (Potentially, you could set it up to 2GHz, but I have stability concerns, and I can't possibly see any circumstance where 2GHz would be remotely useful!)
Min = 192000
Scaling = smartass
Press Save
Fried CPU kgo. Overclock + Charging = Excessive heat being generated.
Click to expand...
Click to collapse
I have tested this setting with my own phone, and the heat increase was LESS than 1 Celcius (infintismal)... sure, if you wanted, you could use a lower value.

Its your call, your thread, I just feel that it isn't a good idea. At least even consider placing a warning adjacent to it.

LaKraven said:
I have tested this setting with my own phone, and the heat increase was LESS than 1 Celcius (infintismal)... sure, if you wanted, you could use a lower value.
Click to expand...
Click to collapse
You could add a setcpu profile for limitting the temperature. I dont overclock, but when im using my phone while charging, it gets hot, so I limit the temperature at 41.1 C , so 768mhz - 245mhz , on demand.
lbc ROM, stock kernel

zeekiz said:
Its your call, your thread, I just feel that it isn't a good idea. At least even consider placing a warning adjacent to it.
Click to expand...
Click to collapse
I've updated the guide (see the update notes at the very top of the post). The on-AC overclock setting has been removed, and I have placed a warning about overclocking next to it.

Updated the post to address a typo in one of the SetCPU profiles (I missed a 0 from the end of 345600).

I will have done this process by tomorrow, I'm sure - even bought Tasker. - Hoping I wont damage something in the process since I've never dealt with an HTC phone before. :/ Since my mom bought it to me as a present, she just peeks in from time to time to check wth am I doing with it - gotta keep a satisfied grin on my face all the time while I'm figuring how to fix this problem lolz

Really you just need to follow instructions (read everything through at least twice before you begin), be patient... and double-check everything you're abuot to do before you do it.
You can't do any more than that!
I've flashed both of these phones so many times now, and the only mistake I ever made was forgetting to clear the cache (Which results in an infinite boot loop or "soft brick", easily recovered by constantly typing "adb reboot recovery" in your Command Prompt, which will eventually make the phone re-enter recovery mode (exiting the infinite boot loop), at which point you can wipe, clear cache, reflash, and relax!

LaKraven said:
Really you just need to follow instructions (read everything through at least twice before you begin), be patient... and double-check everything you're abuot to do before you do it.
You can't do any more than that!
I've flashed both of these phones so many times now, and the only mistake I ever made was forgetting to clear the cache (Which results in an infinite boot loop or "soft brick", easily recovered by constantly typing "adb reboot recovery" in your Command Prompt, which will eventually make the phone re-enter recovery mode (exiting the infinite boot loop), at which point you can wipe, clear cache, reflash, and relax!
Click to expand...
Click to collapse
Funny, so true, in fact, did just that myself about two minutes ago while testing another ROM, meant trip to PC, plug in, power on, and then sorted adb reboot recovery
Swyped from HTC Desire S using XDA Premium

ben_pyett said:
Funny, so true, in fact, did just that myself about two minutes ago while testing another ROM, meant trip to PC, plug in, power on, and then sorted adb reboot recovery
Swyped from HTC Desire S using XDA Premium
Click to expand...
Click to collapse
Good to know I'm not the only one! It's such an easy step to overlock... just a good job it's also the least fatal mistake to make!

and then this
.. Ther is no Path in User, but there is in System...Geez, so tired..What do....:/ I'm all set to flash, just this thing I think...

You need to reinstall Java JDK.
This has happened to me before!

LaKraven said:
You need to reinstall Java JDK.
This has happened to me before!
Click to expand...
Click to collapse
Thx man I did that, I also don't have any command prompts in here :
C:\Program Files (x86)\Android\android-sdk\platform-tools

Bombastc said:
Thx man I did that, I also don't have any command prompts in here :
C:\Program Files (x86)\Android\android-sdk\platform-tools
Click to expand...
Click to collapse
Open Windows Explorer, navigate to C:\Program Files (x86)\Android\android-sdk\platform-tools
Hold down SHIFT and RIGHT-CLICK in on that folder
Click "Open command line window here"
You're then ready to start using ADB commands

LaKraven said:
UPDATE [11th September 2011]
Potential Stage 5: Tasker
By creating suitable Tasker profiles, you can squeeze even more battery life out of your phone!
If it's of benefit to people (let me know in the comments) I can expand this guide to include step-by-step instructions on creating the various profiles I would recommend in order to squeeze more battery runtime out of your phone without sacrifising features/functionality.
Click to expand...
Click to collapse
I would really like that. Yesterday followed your guide and learning new things as i went about the CyanogenMod. I'm curious now how far my battery will bring me :-D.
At the moment i'm using the trial version of phoneweaver and automateit, which are nice programs, but if tasker is more efficient although having a steeper learning curve, i will switch in an instant.

shizuku said:
I would really like that. Yesterday followed your guide and learning new things as i went about the CyanogenMod. I'm curious now how far my battery will bring me :-D.
At the moment i'm using the trial version of phoneweaver and automateit, which are nice programs, but if tasker is more efficient although having a steeper learning curve, i will switch in an instant.
Click to expand...
Click to collapse
As a tasker convert myself, I can also say that you'll read a great review of some of its functionality and a slightly biased review of the product by wnp_79 as part of his [GUIDE] Update 28/06/11: HTC Desire S Guide (V1.03) For Newcomers to Android which is in a sticky at the top of the forum.

Related

[GUIDE][UPDATE] Try the battery tweak with Myn's RLS3!

Battery tweak can be found HERE:http://www.mediafire.com/?xmjdd797f6v2m90
Tweak can only be used with No HAVS kernels (recommended kernels below)
What is the battery tweak exactly? More information in this thread:http://forum.xda-developers.com/showthread.php?t=810940
The intended scope of this thread is for people having trouble with Ksoft consuming too much CPU resources
DO NOT USE WITH SETCPU!
Ksoftirq is something in the kernel that manages requests to the CPU. That means some device in your system is sending the processor a slew of IRQs so that the softirqd for your processor is being consistenly woken up, which ends up using most of your CPU cycles, thus sucking your battery life and performance. As indicated before, anything with a "K" in front of it is referring to the kernel. A kernel is a bridge between applications and the actual data processing done at the hardware level. The kernel's responsibilities include managing the system's resources (the communication between hardware and software components).
When the ksoftirq is using such a high percentage of CPU, it is causing your CPU to work harder and doing two things that we dont' want; taking away from performance and draining the battery.
As it stands now, we know that depending on what kernel you're using it is going to determine whether or not you have that problem in the tweak. We know that it is not an app that is sending processes to the CPU that is causing the problem.
Don't fret if you read through this thread (http://forum.xda-developers.com/showthread.php?t=810940) and flash 1 of the 2 kernels known to work and it still shows ~30%, you're probably just not doing it right. You cannot simply just flash a new kernel, because as said before, the kernel is the link between software(battery tweak) and hardware. Therefore you must have the new kernel in place, then go about flashing the battery tweak. That way it is installed properly by the proper kernel.
As of now, there are 2 known kernels compatible with this tweak:
STOCK HTC 11 kernel, modded: http://www.mediafire.com/?i7u103j9xqnaw3s
Netarchy NoHAVS kernel: http://forum.xda-developers.com/showthread.php?t=719763
**Scroll down and you will see NoHAVS kernel by request, I have had better luck and amazing battery life with Netarchy's kernel
Instructions:
1. Open terminal emulator, type su. You will be prompted that you have gained superuser access
2. Type batt-cfg, then press 1 and then enter when dialog comes up about having root access
3. Choose option 4 to Disable battery tweak, then 9 to save changes and exit
4. Type batt-rm.sh, follow directions to remove tweak (It will tell you to choose y/n, choose "y"
5. Reboot your phone into recovery and install new kernel from zip. When that is finished, install battery tweak.
**It is ESSENTIAL that you follow these first 5 steps in order or I promise you that you will have the same ksoft issue over and over again**
6. When you reboot your phone, go into terminal emulator and type su again.
7. After gaining root access, type batt-cfg. Choose option 1 and save changes and exit.
8. Make sure that phone is unplugged from computer/wall! This is very important, having the phone plugged in will not show the ksoft process so you will not know whether it is still a problem or not.
9. Type top "-m 5 -n 1"(without quotes) This will show you your top CPU processes. You should see no abnormally high percentages for system or ksoft particularly. What percentage you see can depend on your current battery life when you run this test. Make sure that your phone is not plugged in when running the test! Also, take note of your battery life.
Tweak Will stick after reboot. You do not need to re-enable it.
If you install system monitor, you will be able to monitor the cpu level. When I am not touching the screen of my phone, it shows 245mhz. When I start moving the screen or etc, it hikes up a little bit. This shows that the tweak is working properly.
I have gotten incredible battery life out of this with very heavy usage(facebook, texting, phone calls, gps, pandora, running command prompts, etc).
Until something new comes around that I am sure will give me equally as good or better performance and battery life, I will not be switching ROMS/kernels EVER!
ROM: Myn's Warm 2.2
Kernel: Netarchy NoHAVS
Sidenote- I have just as good of performance and speed as I did while having CM6 with Snap7.6&turbo enabled, so don't think that you are sacrificing any performance.
Hope this clears up everything for everyone!
UPDATE-
There has been much debate as to whether or not this tweak works or not. I should have been more clear in the original post. Ksoft is still a necessary process, however, when I said that the purpose was to elimate the "ksoft problem" I was meaning that it should not be detectable by the CPU when you run the "top -m 5 -n 1" command. Neotelos_com made a very good point that is necessary to understand this tweak, "ALSO, this tweak lowers the CPU speed as the battery drains, so within the first hour you will notice the most battery drain." This means a few different things:
-Depending of the charge of your battery when you run the top 5 command, you will see different percentages of ksoft. For example, if I run the top 5 command right now, my battery is at 30% and ksoft doesn't even register at all. Assuming that I charge my battery full and run the top 5 command in the morning when my battery is fully charged, it will register as a process. Ksoft in the low ~20% is completely normal with a full charge. IT WILL BECOME LESS LESS AS THE BATTERY DRAINS.
-I have been toying with this in the very little free time that I have had the past couple days and have also discovered a few other things. Programs like Ultimate Juice, Juice Defender, and Tasker used in coherence with the battery tweak will improve a already great mod to give you significantly more battery life than before. the main reason being that 90% of the time your cell stanby is what is draining your battery the most. Those programs will turn off your mobile network when you are not using it saving a TON of battery power.
I will be posting screenshots at the conclusion of my testing either late tomorrow night or wednesday around 12ET. I want to be able to provide everyone with the info that they need to be able to get the best life out of your battery possible.
Contributions:
intheb0x
Neotelos_com
Myn
Developers of battery tweak
So, is seeing ksoftirqd in step 9 bad?
Techrocket9 said:
So, is seeing ksoftirqd in step 9 bad?
Click to expand...
Click to collapse
It depends what percentage of CPU it is using; in my experience it had been 20+ percent every time when I had the problem.
Is this good or bad? I would guess bad if i'm reading it right.
{
"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"
}
Changed Screen Shot. Keyboard was hiding results
nugzo said:
Is this good or bad?
Click to expand...
Click to collapse
Try exiting out and then do it again. Mine showed up but still showed ksoft.
Sent from my PC36100 using XDA App
when you say incredible battery life...how many hours are we talking about
Using this with SetCPU = fail?
freeza said:
Using this with SetCPU = fail?
Click to expand...
Click to collapse
Yes, do not use this with SetCPU. It is unnecessary and will cause conflict as both are going to be scaling your CPU.
jhoffy22 said:
It depends what percentage of CPU it is using; in my experience it had been 20+ percent every time when I had the problem.
Click to expand...
Click to collapse
I just uninstalled, followed directions to the T again with netarchies no havs, this time 37%. Hmmm not working for me.
flam253 said:
when you say incredible battery life...how many hours are we talking about
Click to expand...
Click to collapse
It will be different for everyone based on usage, quality of service in your area(how hard your phone is working to give you good service), and a number of other things. I can't tell you exactly how many hours but I can tell you this...after configuring this battery tweak correctly, battery life has nearly doubled. It's only been one day, but to this point I am extremely satisfied and never looking back. I will report further on this in the future and provide screen shots of my battery usage and Juice Plotter graphs.
nugzo said:
I just uninstalled, followed directions to the T again with netarchies no havs, this time 37%. Hmmm not working for me.
Click to expand...
Click to collapse
What ROM are you using?
OK for clarity are we suppose to have one of those kernels installed before following the instructions or only during step 5?
JaiCameron said:
OK for clarity are we suppose to have one of those kernels installed before following the instructions or only during step 5?
Click to expand...
Click to collapse
It doesn't matter what kernel you have originally, just make sure that before you flash the battery tweak you have it completely disabled and removed and use one of the two suggested kernels when you reflash the tweak.
Im getting "batt-cfg: not found"
JaiCameron said:
Im getting "batt-cfg: not found"
Click to expand...
Click to collapse
You must not have the battery tweak flashed. You need to go to the forum and find the original thread of the collin_ph battery tweak and get the zip file and flash that separately and after flashing the kernel.
Sorry, this was a quick write up and I left out some information for people who weren't familiar with what the battery tweak is exactly.
Mine still shows ksoft.
Sent from my PC36100 using XDA App
heres the post to the updated one FOR THE ERIS, NOT the evo, BUT it has more features, and the creator is in the thread, lots of info about different settings, how things work and so on..
http://forum.xda-developers.com/showthread.php?t=784089
i think i found out all the bugs from this tweak, there may be more, but i think through about a week and a half through my own trial and error, ive found out everything and whats going on. If working correctly (NO KSOFT), you can achieve great battery life.
hopefully the coder from that thread will update the battery tweak we use to include the temperature mod, since my phone overheats and could really benefit from that feature.
if you wanna be more customized, i recommend choosing option 3 and setting it up your way.
heres what i set.
i left it on underclock
i left the governor alone
i also chose deadline instead of noop.
Min cpu- 245000
max cpu 768000
for polling, instead of 60, i used 120 and instead of 15 i used 30,
then when it gets to cpu usage when battery is low, i choose 28 instead of 33.
you can change these numbers to your choosing, but with these above, i noticed no performance issues and everything seemed normal, just with extra battery life.
but with all our heads together, we can work everything out and get this tweak perfect...
Not working. Myn 2.2 netarchy noHAVS kernel. Showing 28% k...irq
Sent from my PC36100 using Tapatalk
What % should cpu be at to determine if the tweak works or not?
JaiCameron said:
What % should cpu be at to determine if the tweak works or not?
Click to expand...
Click to collapse
Go into terminal, run "top -m 5 -n 1" (without the quotes) and if you system says anything more than 20% the tweak is not working correctly.

[DEV-Info] Learning about SBC charging

I just ran across this info and just wanted to share it and gather others opinions...
Posted by Ziggy471 in Android Development
"For those that don’t know me personally, I work for the government on special projects, and we’ll just leave it at that. However, in the course of normal work, we talked in depth to a National Lab in regards to batteries. One of the discussions was charging. I can’t post the actual info I got from them, however, here is a good stand in:
This is an except from here:
No trickle charge is applied because lithium-ion is unable to absorb overcharge. A continuous trickle charge above 4.05V/cell would causes plating of metallic lithium that could lead to instabilities and compromise safety. Instead, a brief topping charge is provided to compensate for the small self-discharge the battery and its protective circuit consume. … Typically, the charge kicks in when the open terminal voltage drops to 4.05V/cell and turns off at a high 4.20V/cell.
There is a whole lot more info on that site, but I’ll sum up the excerpt, if you continually charge a Lithium Ion battery, it will degrade, and worst case explode, but hey, at least it looks cool when it does.
Just don’t end up like others have, for example, a Chinese man who took his phone off the charger, put it in his pocket, and then it exploded. To read a little more about that, check out EnGadget, if you want to see the phone, Tech-Ex. Here’s another one, no one was killed, but it burst into flames, over on PCWorld.
I’m not sure if those were good factory batteries or the cheap Chinese knock offs, but either way, if you decide to assume the risk, that’s your decision. However, my decision is NOT to hack the battery code.
I hope this explains why I have not or WILL NOT modify the battery code."
This was already discussed in the thread regarding the SBC kernel, which is what Ziggy is referring to.
The maker of that kernel stated simply this: You can't overcharge a battery that's being used. The phone is sucking power while the charger is charging it.
Also, it's a type of trickle charging. When it reaches a certain voltage, it stops charging. This kernel will never "overcharge" the battery and the talk about this is getting old. Either use the kernel or don't. I, being a user of that kernel for about a month now, have had absolutely no problems. I pick my phone up and it's as cool as room temperature.
Don't mean to sound rude, but that's what it looks like. It just gets old people not reading the first post of that SBC kernel thread where he answers questions like this and discusses that overcharging won't happen.
Will this damage my battery?
This charging method doesnt damage the batteries at all. It shouldnt. Because our batteries dont even charge up to 4.2V without the tweak. They charge up to 4.2V the first charge, then drop all the way down to 4.08V or something and then does these weird short burst chargers to 4.1-4.125V. Thats why there's the rapid drop in the morning. Because your voltage is actually at 4.125V and that's not 100%. So with this tweak, the charger keeps charging until you're at 4.2V (or the maximum voltage your battery can get to) and then it trickle chargers while at that voltage. The charger itself never turns off. Thats not a bad thing. Because as you reach your actual voltage, the mA decreases. Which is why our phones will never be damaged. You ever want to know why its really easy to charge from 50-80% but the charge from 90-100% seems to take so long? Its because from 50% the mA going into the phone is in the 600's. Once it reaches 90%, the mA is around 150 and once it reaches 95% you're looking at 90mA. The phone when absolutely idle uses anywhere from 60-120mA, even when on the charger. So charging from 90% to 100% takes longer becaus the mA going into the phone isnt always higher than the mA you're losing. This is the same with charging past 100%. As you leave the phone on the charger with this tweak, you're mA will decrease from 50mA all the way down to 2mA overnight. But on the charger you're losing about 30-60mA already, so you'll never overcharge the battery, in best case scenarios, you'll just maintain the voltage of 4.2 or around 4.2V.
Click to expand...
Click to collapse
Thanks for making it a little more clear to me
Anytime bro. Try the kernel out. You'll seriously be surprised at how much longer your battery last. I never go a full charge without at least reaching 20 hours unplugged. Performance doesn't suffer either. I use the 4.1.9.1 CFS More Aggressive version because I have an 0003 Evo and 4.1.9.1 is the latest stable kernel that Netarchy made that has this SBC mod incorporated.
i have 0003 as well and im currently testing out "SBC for Netarchy's CFS More Aggressive 4.2.1" do you think 4.1.9.1 would be better?
I had better battery on the 4.1.9.1. I personally prefer to use a kernel that's labeled as stable than use one that's labeled as beta. Since the kernel is the lowest level of the software, I'd rather it be as stable as possible. I get Quadrant scores in the 1200, but don't rely on that. Benchmarking is useless. All my hardware works and I have no performance deficits. I also use a modified-by-me version of Ziggy's kernel tweaks to help save even more battery. See how 4.2.1 does for you and then try 4.1.9.1 and see which one feels better.
I was actually looking for a kernel that someone has complied that included ziggys tweaks plus have the SBC, I would love to try what you have modified your self could you post it?
BAttitude7689 said:
I was actually looking for a kernel that someone has complied that included ziggys tweaks plus have the SBC, I would love to try what you have modified your self could you post it?
Click to expand...
Click to collapse
Sure. It's attached. Just flash in recovery. Here's what it's set to...
Screen ON
Min: 245
Max: 998
Governor: Ondemand
Powersave_bias: 100
Up_threshold: 99
Screen OFF
Min: 245
Max: 652
Governor: Ondemand
Powersave_bias: 500
Up_threshold: 99
These settings seem to work perfect for me. Giving the CPU enough speed for idle tasks while sleeping without sucking too much battery. When the screen is on, I rarely ever see my CPU get to 998. Highest I usually see is 921, which is good.
***EDIT: I had some requests on instructions on how to remove this. Maybe it's not your cup of tea or you just prefer SetCPU. So, below are the instructions to do just that.
1. You should have ADB and all that good stuff. If you do, open up a CMD prompt and navigate to your ADB folder.
2. Type: adb remount. You should see "remount successful." If not, then type: adb shell. Then type: mount -o rw,remount -t yaffs2 /dev/block/mtdblock4 /system. If you know a shorter way of remounting, do so.
3. You should still be in adb shell, so type: cd /system/etc
4. Type: rm sysctl.conf
5. You should have no errors. Now, type: cd /init.d
6. Type: rm 90screenstate_scaling
7. Type: rm 90sysctl
8. You should have no errors with both of those. Now, to finish the "uninstallation," type: reboot
9. Your phone should reboot and will no longer be scaled by that script.
10. ???
11. Profit!
***EDIT 2: I've posted instructions on changing this scaling script as well. If you'd like to do that, then click HERE.
nothing to see here...move along
are those preset with the kernel tweaks? or do you use SetCPU? currently I have using setcpu
Screen ON:
Max:1075
Min:245
Governor: Conservative
Screen OFF:
Max:245
Min: 245
Governor: Powersave
and i think my battery is pretty decent,
Yes. Those are preset in the kernel tweaks I attached. You don't need SetCPU as this script pretty much changes everything the SetCPU app does but only does it for screen on or screen off which is what I wish SetCPU would do, but doesn't.
I only use max 998 because it doesn't make sense to want to save battery but then overclock the CPU which causes more battery drain.
Also, the 4.1.9.1 kernel only offers 3 governors. Ondemand, conservative, and performance. I use ondemand because it responds to power demand faster but, unlike conservative, doesn't lower the frequency as fast which isn't a big deal.
raiden89 said:
Yes. Those are preset in the kernel tweaks I attached. You don't need SetCPU as this script pretty much changes everything the SetCPU app does but only does it for screen on or screen off which is what I wish SetCPU would do, but doesn't.
I only use max 998 because it doesn't make sense to want to save battery but then overclock the CPU which causes more battery drain.
Also, the 4.1.9.1 kernel only offers 3 governors. Ondemand, conservative, and performance. I use ondemand because it responds to power demand faster but, unlike conservative, doesn't lower the frequency as fast which isn't a big deal.
Click to expand...
Click to collapse
well i know its either battery or performance in a sense.... but i kinda want my cake and eat it too, which plenty of people here want as well. I want a decent battery life but i do want performance thats the only reason for the overclock....
Sure. To each their own. I'm not going to modify and re-post custom versions as that's not what I'm here for. I'll provide what I've done and nothing more. However, I'll tell you how you can modify it yourself.
1. Get Android Terminal Emulator by Jack Palevich from the Market. This is the one I use and the one I can give you exact steps for how to use.
2. Open it and type: su then allow it to use SuperUser
3. Type: mount -o,rw remount -t yaffs2 /dev/block/mtdblock4 /system
(There's a shorter way of doing this in Terminal but I can't remember it at the moment. If you know a shorter way to remount in read/write, do so.)
4. Type: cd /system/etc/init.d
5. Type: nano 90screenstate_scaling
6. Use the directional keys to navigate to the max CPU freq and change it to the frequency you want as long as you know the right increment. What you had with SetCPU will work just fine. Be careful when using backspace not to bump the enter key or it'll mess up the alignment with everything. If you do, just keep hitting the back button and start back at step 3.
7. Press the menu key and go to preferences. Set your control key to something you can hold down. I use the volume down button.
8. Go back to the terminal screen, press menu and hit "Toggle Soft Keyboard."
9. Hold down the control key you just set in step 6 and press X on the keyboard and then press enter to save the file and enter again to save it as the current file name.
10. Reboot your phone.
11. ???
12. PROFIT!!!
thanks for the lesson, i appreciated that
Sure thing. I'm sure a lot of people will benefit from this. If only I had a working Paypal.
raiden89 said:
Sure. To each their own. I'm not going to modify and re-post custom versions as that's not what I'm here for. I'll provide what I've done and nothing more. However, I'll tell you how you can modify it yourself.
1. Get Android Terminal Emulator by Jack Palevich from the Market. This is the one I use and the one I can give you exact steps for how to use.
2. Open it and type: mount -o,rw remount -t yaffs2 /dev/block/mtdblock4 /system
(There's a shorter way of doing this in Terminal but I can't remember it at the moment. If you know a shorter way to remount in read/write, do so.)
3. Type: cd /system/etc/init.d
4. Type: nano 90screenstate_scaling
5. Use the directional keys to navigate to the max CPU freq and change it to the frequency you want as long as you know the right increment. What you had with SetCPU will work just fine. Be careful when using backspace not to bump the enter key or it'll mess up the alignment with everything. If you do, just keep hitting the back button and start back at step 3.
6. Press the menu key and go to preferences. Set your control key to something you can hold down. I use the volume down button.
7. Go back to the terminal screen, press menu and hit "Toggle Soft Keyboard."
8. Hold down the control key you just set in step 6 and press X on the keyboard and then press enter to save the file and enter again to save it as the current file name.
9. Reboot your phone.
10. ???
11. PROFIT!!!
Click to expand...
Click to collapse
on step 4, it tells me
"nano: permission denied"
Love the kernels Zig, but ya don't need to be a secret government employee to understand li-ion batteries. Just check here for some info:
http://batteryuniversity.com/index.php/learn/article/charging_lithium_ion_batteries
Any battery charging is safe, as long as it doesn't charge over 4.2v
http://forum.xda-developers.com/showpost.php?p=10374600&postcount=3599
It's been forever and a day since I have used setcpu for anything besides verifying governors/frequencies.
I was using tasker to switch governors before I added smartass to htc #15. Smartass is the best governor I have used so far and I have used them all.
Init scripts that change cpu parameters run on a constant loop always checking to see if the phone state has changed from screen on to screen off and vice versa. It's automated but at the cost of extra cpu load (minimal and negligible but some people notice the littlest things about their device) it's better just to let an app like setcpu catch the broadcast event when the screen state is changed.
The kernel number (#5) is simply the number of times I have compiled this kernel. It is HTC #15 from source with SBC (courtesy of ms) and smartass added.
BAttitude7689 said:
on step 4, it tells me
"nano: permission denied"
Click to expand...
Click to collapse
D'OH! I forgot a step. When you open Terminal Emulator, type: su and hit enter. Then continue to remount in read/write, etc.
I think it goes without saying, but if you're using a cheap battery, you probally shouldn't use an SBC kernel.

how to compare a power consumption of your devices

So, for a long time reading the forum and asking a question along the way, why I have so quickly battery discharging on my phone, I came across an interesting thought: "and from what I actually compare?. someone wrote about 5% per night, someone love to confess on the tab "Journal of the battery and it shows that he is the difference between" running "and"phone on "0.5%. but what is a night (for me it's 8 hours for someone 5). which network who have (GSM or 3G)? Also, we are constantly being developed and modified ROMs and kernels, which also constantly featured the words "lowered energy consumption."
And how do you actually compared the energy consumption of the old firmware to new. usually it sounds like "on the old firmware, I charge the phone every day, and now I charge every 2 days." but we don’t know details of how actively you used options of your phone on the old version, and how use now "(for me, For example the first 3 weeks after buying the phone had lived only one days, but now 2-3 days. but not because the new firmware, but because I'm tired of constantly digging through the phone settings and install the different soft, thus discharging it).
So, our challenge is to develop an algorithm (and in the future opportunities programs), as can be correctly and objectively compare the power consumption of our devices. That at least from the transition to the firmware to the firmware, from one kernels to another to be sure that the phone will not live less than before. Search for programs of this kind I have not been successful, can someone tell me if he knows?
actually look to you for ideas, how best to develop an algorithm testing the phone, and simultaneously bring your own.
then everything will be set out with respect to the software part, because hardware is not subject to us
1. So, first of all we need to start with any initial data. Having read all the threads about power consumption, I have come to the conclusion that the original data should include the following:
- Do wipe battery stat. We fully discharge the phone till shutdown and charge it in off state. after the device is fully charged, unplug it from the charging device and do wipe batter stat from the recovery menu
- To make the calibration of the battery you need to discharge and completely charge in turned off state the device at least 3 times
Here is one of the toughest parts, considering the long battery charging our phones. charging off-state means 4 hours of losing connection. and we need to do it 4 times. One discharge-charge cycle for a complete calibration system, as I understood , is not enough.
all the widgets and programs that can perform any action to in background must be disabled.
well, and then discharges our apparatus up to 95% in quiet mode, to give the battery a little bit cool, and eliminate trouble with 99-98-97% and you can begin testing.
2. Measurement tool. I would have chosen for this purpose, program or Battery Monitor Widget (she effects on discharging battery, but it writes logs, which can be tracked over time the battery status in percentage and millivolts) or JuicePlotter (don’t have logs. We have to extract data from the graphs that it constructs). JuicePlotter showed the best result in power consumption while the CPU time drain more than BatteryMonitorWidget - here's the first interesting fact. Now I’m testing these programs repeatedly to confirm this effect
3. In order to reduce measurement error the device must be discharged at least 20% of one test. or better at 30%. then + / -1% in the testing will not be particularly significant. That why testing process will be long and tedious.
4. In order to understand the power consumption of device in general, you should at least try to understand and share the power consumption of its individual components:
5. power consumption of the screen. For this purpose you can use the widget to extend controls, where you can turn the screen on constantly. And choose any standard wallpaper with middle brightness. we need to measure how much battery discharging for 3 hours the screen on. for small, medium and very high brightness, respectively. you can check consumption on the automatic brightness too. is believed that the turning on an automatic brightness strongly discharge the device..
6. power consumption of the file system. In the good we ought to write a program that creates a file in a loop on the internal flash drive, and anything he writes and deletes the file. Repeat the loop few thousand times to the total time was about 2-3 hours. but until there is no such a program, you can simply copy the file size of 2-3 gigabytes of internal memory with a program such as ES Explorer. In this case, the screen must be enabled to minimum brightness (since we already know how much the phone is discharged from simply turn on the screen) to control the copy process and accordingly the percentage of discharge.
7. Estimation of consumption of the processor. To do this, too, we can write a program that would do any arithmetic operations within an hour of time. But here we get the maximum load, therefore the maximum power of the processor. and it is unlikely it will be different from the firmware to the firmware . But our processor is also able to reduce the frequency and consequently reduce power consumption. And here I think there is much to improve the software. Therefore, must be differences from firmware to firmware. And the best test for this, I think, show any video on device, it loads processor to 30% on average (better view a videoconcert, so there isn’t quite boring) for one hour and thus measure how much discharge our batteries from this view .
8. Estimation of Wi-fi. Then the test can serve up any file copy from PC (connected through wires to an access point, so this segment was not the brakes) to our unit. Since the maximum speed that I managed to squeeze out of the standard N on my Captivate is 0,8 MB / sec I think copying the file size of 2GB will be enough to discharge our device is not less than 20% battery. copy can be perform using the same ES Explorer
9. Rated power consumption in standby mode. here it must enable the network only GSM. turn off the wi-fi and bluetooth. the screen went off and did not touch the machine for 8 hours. Better course would be 24 hours, but I think hardly anyone will be able to perform such a test
Actually look to you for your suggestions and additions, as can be realized by comparing energy consumption of our devices.
from the general collective thoughts we can open thread with algorithm, where you can write your test results according to the algorithm ... and make any conclusions.

Advanced Tricks for Saving Battery (it Works)

EDIT: Last Update: 10th Sep 2011 with New INfo (trick no.7)
Advanced Tricks for Saving Battery
The following tweaks can greatly save battery if you done it right. But bear in mind that risk are relatively higher since its involve those deep system components.
If you know what you're doing, there is not much to worry about.
Note: I will not responsible for the any damage of your device
My Result:
Before: After moderate usage of 20 hours, Battery Left 30% - 35%
After : After moderate usage of 20 hours, Battery left 70% - 75%
Note: Battery Usage is very subjective matter. The numbers here is not trying to give you an exact calculation, it just trying to give you a feel of how the battery saving. But i have try my best to be consistent on the usage pattern, cpu loads and temperature to do this comparison. Of cause, you might discover different result on your device. With different ROM, kernel, radio, usage, screen brightness, all the other factors come into play, the result would varied.
Kindly please post a feedback on how it works on your device>
1. Use Undervolted Kernel / ROM
- Undervolted means that your device will use relatively less battery to give the same CPU frequency
- (e.g. normally CPU run at 1.61ghz @1350mv, after undervolted it may require only 1275mv at the same frequency)
- Tested on my device, it is the most effective tweak to increase battery life (I reduced -100mv at most of the CPU frequency (except 1), give me about 30-35% more battery)
- Because the undervolting value is varied depend on the ROM and kernel, so no point i post all the numbers here. (PM me if you need the list)
- Ask at your respective ROM thread for the availability of undervolted tweak
- If you wanted to try to change the undervolting value, i recommended to use OC/UV beater2 http://forum.xda-developers.com/showthread.php?t=1207546
{
"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"
}
- Because the tool have ease-to-use interface (no need use terminal emulator), just few taps will do.
- Most importantly, we can test new UV value with "Temp Activate", if the device freeze, just restart and it will go back to the last good state (last best config for you, instead of kernel's default value), and no need to flash the vddreset.zip / other reset.zip
2. Use "GSM auto (PRL) to save more juice while still connecting through 3G
- in the phone setting>wireless and network>MobileNetwork>NetworkMode
we are only allow to choose GSM only/ WCDMA / Auto between two
- but if you use type "*#*#4636#*#*" to phone Information, you can choose more type of networkmode. It is claimed that choose "GSM auto (PRL)" allow you to save more battery (cell standby) while allow you to connect to 3G network.
- This might somehow depend on your carrier / provider
- Please provide feedback on this. THanks
3. Try out different CPU Governor
- nowadays a lot of ROM have advanced CPU governor like Smoothass, Smartass, Interactive, etc.
- Try different combination during wake up and screen off to look for the best setting that let u save more juice
- This are my settings:
Governor during awake = On Demand
Max Wake = 998mhz​ Min Wake = 122mhz​ Governor during Screenoff = PowerSave
Max Sleep = 307mhz​ Min Sleep = 122mhz​ - NOTE: if you put min sleep too low, there is a chance that you device might freeze and won't wake up!
- I personally recommended "DaemonController" from Sybregunne for controlling the CPU governors and frequencies. It is a ease-to-use, yet sophisticated enough for the purpose of OC/UC. It is my favourite OC/UC controller since it released.
- DaemonController is a smart tool that it will bypass virtous daemon, and use direct frequency if we choose governors that is incompatible with the virtuous o/c. Hence, only 1 deamon is run which is more efficiency.
- Refer to the original thread here for more details: http://forum.xda-developers.com/showpost.php?p=16726715&postcount=2
- Quoted from original thread: "It is a Graphical tool that allows users to change andrev_oc/virtuous_oc frequencies and governors without having to reboot their device. Confirmed to work on Android Revolution HD 6.1.0 and a lot more ROMS.
4. Use AutoKiller Memory Optimizer
- This tool is different from other app killer
- It fine tunes android systems inner memory manager to keep your device fast over time.
- As a side effect it also lowers battery consumption.
- At certain free memory level (e.g. 250mb), the android os will automatically close those apps not in use (according to original android os logic)
- The lowMemoryKill level can be modified to suit your style of usage. It is to find a balance point between "not killing the apps you're need" and "sufficient free RAM to avoid sudden out of RAM / Laggy ".
- What i experience before is that these values are set to be too low. It keep most of the apps opened in background. So we can use the apps much faster and consump less cpu. Result: we have lower free RAM. The tradeoff: When I open heavy game, I experienced run out of RAM (it tell me not sufficient RAM to run).
- When the values set too high. It will kill the apps in background faster. So we will spend more cpu, and slower to reopen it. Tradeoff: you will have alot of free RAM back there. But for what?
- Therefore, it is to find the middle point that satisfy both ends. Generally, users with more apps better off with lower lowmemorykill value. Users with less apps (always switch between fews app only), are better off with higher lowmemorykill value.
- MY case: I only have 25+ apps installed. and Only use few apps (other rarely use). THis is my setting (in Pages): 3072, 8192, 16384, 50688, 58368, 76288. I have experimented with many values for 3 months. Just 1 month ago, i found these value suit me very much. It keep balance between the two tradeoff mentioned. Maybe you can try to figure out your own.
- Generally, we play with the last 3 numbers only. The first 3 numbers is related to:
(Foreground app)
(Visible app)
(Secondary server)
Which offer no significant benefits if we kill them.
5. Use Autostart
- Instead of closing them, it would be better if we don't let the app start from the begining
- You can choose to disable those app that u feel unnessary, so that they will not run during your phone startup
5. Check your Battery Consumption
- Download "Current Widget" or "battery monitoring widget" from market
- these apps will monitor your battery usage and recoded in a log file
- This is the normal consumption rate (varied across ROM, kernel and CPUI frequency and other factors)
Sleep/ScreenOff Consumption: 2mv - 8mv
WakeUp Consumption (no wifi, just use local apps, no gaming): 150mv - 250mv
Gaming consumption: about 300 - 400 mv (varied across diff games)
- To be comparable, it is suggest that you try to compare the consumption rate with your friends with same ROM, kernel, radio)
- With the monitoring log, you will able to notice adnormal peak / adnormal high drainage easily
6. Use "Battery History for GingerBreak" to check what running in background (Especially thanks for Saluco for this useful way to check battery drainage )
- this is a free tool can be download from xds forum http://forum.xda-developers.com/showthread.php?p=13328125
- Go to "Partial Wake Usage" to see what apps running when your device is sleeping
- Please "thanks" the developers of the apps for creating and letting us use his useful tool
- Give the screenshot of "Battery History for Gingerbreak" to the community of your ROM, this will give them more clues for them to help you
- For consistency, please monitor your usage for at least 3 hours (@ frequency 1 - 5 minutes) in order to have sufficient data and reliable readings.
7. Disable "Receiver" of application using AutoRun Manager (Really for Advanced User ONLY)
- Receivers are the "condition" where if it is fulfilled, the app will be executed
- For stance, Google Map has 8 receivers. Either 1 of these 8 conditions is met, google map will be open and run automatically.
- Now we actually try to disable this autoRUN by disable the "receiver" = means that even if the condition is met, the app won't run
- TO do this we need donated version of AutoRun Manager (available in market) to do this, go setting enable advanced mode
- Go second tap of the menu (advanced menu) to disable the receiver of particular app
- It is HIGHLY recommended to disable 1 receiver at 1 time, so that you can know the impact and trace back to the receiver
- you might get confused if you disable too many receivers at 1 time
- WARNING: ONLY disable those receiver that you know. DIsable system's receiver will make your system instable. So better only disable the user app.
- WHY IT IS USEFUL? Example: i used "Battery History for Gingerbreak (tip 6) to found out that "Facebook for android" is locking my device from being deep sleep (as it shown as high minute usage in the "partial wake menu"). Then i wanted to disable the feature of the that keep my device awake. THen i disable the "awake service" receive of it. Then it will help to save more battery by preventing those app that run automatically when certain conditions are met (example: Wifi-on, location changed..etc_
<More humble sharing is coming>
<<< Please click on "Thanks" if you found this post helpful, your thanks are very much appreciated >>>
------------------------------------------------------------------------------------------------------------------------------------------------------------
(The content is talking about HTC Desire HD, but the tricks can generally apply to any other smartphones, Hope it help you~)
Well it’s been 7½ days since I reviewed the Desire HD in which I said I didn’t want to comment on battery life until I’ve used it for 10 days. Tomorrow morning at 10am will be the 10th day, but I’m ready 14 hours early!
I’ve seen a lot of talk on the internet about terrible battery life, I’ve even experienced it myself (10% per hour on standby) but not wanting to give it a bad name without being sure, I’ve waited. I can now declare – the Desire HD does not have a battery life issue!
Read on after the break for how you can make yours last 24 hours on one charge!
Let me explain first of all, why I don’t think there is an issue. My Desire HD, last night and today, has shown better battery life than my Samsung Galaxy S and Nexus One ever did. It will probably continue to improve for the next week too.
Yesterday, after 10 hours of medium to light use (screen on was 40 minutes), I was still at 59% battery.
Today, I’ve been off for 12 hours and I’m still at 48%. The screen has been on for 50 minutes, 30 minutes of streaming music via bluetooth, 1 hour of podcasts playing through my earphones and a few text messages. Generally, on standby (and not being used) on 3G while at work, it was only using 2% an hour! I’m not [/B]sure any Android phone has ever managed that low consumption for me.
I don’t know how HTC have managed it from a 1230mAh battery, but if anyone manages to produce an ‘extended’ battery that fits, this thing could last a very long time. As for what the Desire Z might be able to do, wow!
So, what have I done to get this? As well as the usual tips I’ve given, here’s a few more for your Desire HD -
Remove apps you don’t use. You’ll need to root your device with VISIONary and then remove system apps like Flickr, Twitter, Stocks, Peep, Gmail and Friend Stream using Titanium Backup.
Syncing kills! Go to Settings -> Accounts & sync and see what apps are set to sync. For me, a big improvement came from turning off syncing my Facebook ‘Live Feed’ (this seems to turn back on at reboot). Also, only have one of the two Facebook apps syncing at all. For me, I stopped HTC Sense, News and Weather from syncing. If you really want these, maybe just drop their frequency an extra hour or two.
Lower e-mail checks. I have 4 e-mail accounts that K9 Mail checks for me. Like the other syncs, I dropped them from 15 minutes, to 1 or 2 hours, 4 for the less important one. Definitely don’t use the push e-mail setting on K9.
Try different connections. Go to Settings -> Wireless & networks -> Mobile networks and change Network Mode. For me, for some reason on Orange in London ‘WCDMA only’ works the best for me.
Calibrate. After 7 to 10 days use, calibrate your battery and you should be good to go, simple as that!
**ADDITION** Once in a while (if not always) try charging via USB rather than mains. It has been reported this is better for the battery and will actually provide better life from one charge. I can’t necessarily say this claim is true, but I have often seemingly got better life from a USB charge. Try it!
Bear in mind, there are people reporting much better life than I get. Some say they can last over 40 hours on one charge.
Also, make use of the ‘Power Saver’ in Settings. I’ve put mine at 30%. When this kicks in I tend to find battery consumption might even drop to 1% per hour, which means it may be possible you could last for 3 days on one charge! I can’t wait to see what happens when we get proper root and can use custom ROM’s!
(source:http://hemorrdroids.net/htc-desire-hd-battery-life/)
<<< Please click on "Thanks" if you found this post helpful, your thanks are very much appreciated >>>​
Looking for general guideline for your Lithium Ion Battery?
Have a look at this http://forum.xda-developers.com/showthread.php?p=15631703#post15631703
i might have to try this on my fassy
Is it necessary to have one of these threads every other day?
Sent from my HTC Sensation 4G
Turn off your phone. Battery life will be awesome.
Otherwise carry spare chargers and/or batteries. Simples.
DirkGently1 said:
Turn off your phone. Battery life will be awesome.
Otherwise carry spare chargers and/or batteries. Simples.
Click to expand...
Click to collapse
Lol. I have 3 spare batteries, girlfriend has 2. Still chew through em in a day
ADR6300
Not really sure anything here is new information...
Cheers, I'll try a couple of these.
How about putting your phone into Flight mode while at work.
I, for my part, get my mails to my desktop machine anyways and i like the fact, no one can distract me while I'm hacking in a gazzillion lines of code.
If it's important my lazy colleagues can use their legs and walk into my office.
flight mode is as good as switching off your phone
My battery already goes down like 1% every hour when the screen is off. So it's fine to me. It's only when I'm actively using WhatsApp, Facebook and Twitter that it goes down faster.
Main killer of the battery is the screen. The screen with high backlight burns through it. While idle it hardly drains.
thanks for this
servellia said:
How about putting your phone into Flight mode while at work.
Click to expand...
Click to collapse
I would get fired if I do that
I think you just made s regular phone from your smartphone
Sent from my Desire HD using XDA Premium App
Good reminders - thanks.
cooooll thanksss
DirkGently1 said:
Turn off your phone. Battery life will be awesome.
Otherwise carry spare chargers and/or batteries. Simples.
Click to expand...
Click to collapse
niceeeeeeeeeee
Thanks for the tips, although if Google just closed maps instead of having it open all the time!
Bet that would save some battery!
Good one to see... thanks for the post
I´ll try this...
Thanks!
I use Juice defender beta with ultimate features and i did calibrate my battery. It's 1:26 AM and through moderate to heavy usage i'm still at 41%. It still has a lot to do with your CPU speed (over/under clocked), ROM, Radio and kernel. I'm CM7 Lordmod's CFS kernel and the latest Radio from AT&T Stock (I have the Inspire the Desire HD's identical cousin.) and a RIL to match. Oh and I'm Overclocked to ~1.2 GHz using the ondemand governor.

Improve idle drain by tweaking Android Doze parameters

Hey xda-Community!
I recently wanted to reduce my idle drain and searched for ways to edit Android Doze settings, because I remembered seeing a tutorial that said you can change deviceidle-constants, that dictate how Doze works (how fast it kicks in, how long it kicks in, light/deep doze).
I tried all those old tutorials, but I quickly realized the old ways to change the parameters are deprecated, so I asked people on android.stackexchange.com and someone actually gave me the answer (thanks Andrew) (https://android.stackexchange.com/questions/247680/is-device-idle-constants-deprecated-in-android-12).
This works from Android 12 on and is achieved using a shell.
Commands:
Note: When using an adb shell, you have to put "adb shell" before those commands. I'll just put the bare commands here, you add what you have to add.
Checking the settings:
You can check your current Doze settings (and statistics) with "dumpsys deviceidle".
Changing a setting;
Every parameter has to be set individually. It's not that bad tho, as you only have to do this once.
Syntax is: "device_config put device_idle [KEY] [VALUE]".
One example: "device_config put device_idle light_after_inactive_to 30000"
You can check "dumpsys deviceidle" to see what keys there even are. To help you out, here's an explanation of what each key actually sets. You can also get a visual sense of how the light mode and the deep mode work (not my work, thanks to easz from github).
Spoiler: My recommended settings
First; reset parameters with: "device_config reset trusted_defaults device_idle"
light_after_inactive_to 30000
light_pre_idle_to 120000
light_idle_to 300000
light_idle_factor 2
light_max_idle_to 900000
light_idle_maintenance_min_budget 30000
light_idle_maintenance_max_budget 180000
inactive_to 900000
sensing_to 0
locating_to 0
motion_inactive_to 0
idle_after_inactive_to 900000
idle_pending_to 60000
max_idle_pending_to 120000
idle_pending_factor 2
idle_to 900000
max_idle_to 21600000
idle_factor 2
wait_for_unlock true
I also wrote a windows batch script (works via adb, you have to rename the .txt file to .bat) and a bash file that changes the parameters to my recommendations. See attachments.
will these settings persists even after a reboot? or upgrading rom?
maxs8007 said:
will these settings persists even after a reboot? or upgrading rom?
Click to expand...
Click to collapse
yes, these will stick after a reboot. Not sure about upgrading, but I would guess that it'll stay, because we don't actually modify anything on the system partition
@Doomkopf for me those settings won't stick.
For testing purpose I just applied those yesterday morning:
adb shell device_config put device_idle motion_inactive_to 300000
adb shell device_config put device_idle light_after_inactive_to 180000
This morning they are back to stock values. Any ideas? :S
Utini said:
@Doomkopf for me those settings won't stick.
For testing purpose I just applied those yesterday morning:
adb shell device_config put device_idle motion_inactive_to 300000
adb shell device_config put device_idle light_after_inactive_to 180000
This morning they are back to stock values. Any ideas? :S
Click to expand...
Click to collapse
I set mine like 6 weeks ago, it's still set. I miss many information, what phone do you use, what ROM, how you check if it's still set etc
Doomkopf said:
I set mine like 6 weeks ago, it's still set. I miss many information, what phone do you use, what ROM, how you check if it's still set etc
Click to expand...
Click to collapse
Hi, oh well here are some more infos:
Pixel 6 Pro
Latest Android 13 Stock ROM
Kirisakura Kernel
I check via "adb shell dumpsys deviceidle".
I set it all your settings on friday and today (monday) there are back to stock values.
Previously I tried settings my own settings on wednesday morning and had stock values on the next day already as well :S
Utini said:
Hi, oh well here are some more infos:
Pixel 6 Pro
Latest Android 13 Stock ROM
Kirisakura Kernel
I check via "adb shell dumpsys deviceidle".
I set it all your settings on friday and today (monday) there are back to stock values.
Previously I tried settings my own settings on wednesday morning and had stock values on the next day already as well :S
Click to expand...
Click to collapse
That doesn't sound good I'd check right after setting it, so you can see if it was changed at all (which I assume). If it indeed gets set and unset again, you could check this github repo (https://github.com/easz/doze-tweak) at "Caveat".
Those values got reset in the past already, but as it didn't happen to me, I thought Google stopped doing that. Maybe that old workaround still works Otherwise, you'll have to flash a custom rom I guess xD
EDIT: I also recommend looking at values easy to distinguish. For example, "sensing_to" and "locating_to" were nonzero before, now they are zero (for me), so these values are easy to compare for me. The values you need to look at are at the most upper part of the output, but I guess you already knew that
Doomkopf said:
That doesn't sound good
Click to expand...
Click to collapse
Did you ever mess with any other settings using device_config before? Like the number phantom processes, empty or cached processes, ActivityManager tweaks or anything else? Because I assume you did (and using Android 10 or higher) and disabled the settings sync back to the defauls.
Did you ever use the below command?
device_config set_sync_disabled_for_tests persistent
What does the below commands says?
device_config is_sync_disabled_for_tests
Perhaps it says true? If yes that's why your settings aren't changing.
crok.bic said:
Did you ever mess with any other settings using device_config before? Like the number phantom processes, empty or cached processes, ActivityManager tweaks or anything else? Because I assume you did (and using Android 10 or higher) and disabled the settings sync back to the defauls.
Did you ever use the below command?
device_config set_sync_disabled_for_tests persistent
What does the below commands says?
device_config is_sync_disabled_for_tests
Perhaps it says true? If yes that's why your settings aren't changing.
Click to expand...
Click to collapse
You quoted the wrong man
@Utini How'd it work out? If my last response doesn't help, maybe this one helps u
Doomkopf said:
You quoted the wrong man
@Utini How'd it work out? If my last response doesn't help, maybe this one helps u
Click to expand...
Click to collapse
No, logically I quoted the correct man Just wanted to indirectly tell others about the above trick / setting
Doomkopf said:
Hey xda-Community!
I recently wanted to reduce my idle drain and searched for ways to edit Android Doze settings, because I remembered seeing a tutorial that said you can change deviceidle-constants, that dictate how Doze works (how fast it kicks in, how long it kicks in, light/deep doze).
I tried all those old tutorials, but I quickly realized the old ways to change the parameters are deprecated, so I asked people on android.stackexchange.com and someone actually gave me the answer (thanks Andrew) (https://android.stackexchange.com/questions/247680/is-device-idle-constants-deprecated-in-android-12).
This works from Android 12 on and is achieved using a shell.
Commands:
Note: When using an adb shell, you have to put "adb shell" before those commands. I'll just put the bare commands here, you add what you have to add.
Checking the settings:
You can check your current Doze settings (and statistics) with "dumpsys deviceidle".
Changing a setting;
Every parameter has to be set individually. It's not that bad tho, as you only have to do this once.
Syntax is: "device_config put device_idle [KEY] [VALUE]".
One example: "device_config put device_idle light_after_inactive_to 30000"
You can check "dumpsys deviceidle" to see what keys there even are. To help you out, here's an explanation of what each key actually sets. You can also get a visual sense of how the light mode and the deep mode work (not my work, thanks to easz from github).
Spoiler: My recommended settings
First; reset parameters with: "device_config reset trusted_defaults device_idle"
light_after_inactive_to 30000
light_pre_idle_to 120000
light_idle_to 300000
light_idle_factor 2
light_max_idle_to 900000
light_idle_maintenance_min_budget 30000
light_idle_maintenance_max_budget 180000
inactive_to 900000
sensing_to 0
locating_to 0
motion_inactive_to 0
idle_after_inactive_to 900000
idle_pending_to 60000
max_idle_pending_to 120000
idle_pending_factor 2
idle_to 900000
max_idle_to 21600000
idle_factor 2
wait_for_unlock true
I also wrote a windows batch script (works via adb, you have to rename the .txt file to .bat) and a bash file that changes the parameters to my recommendations. See attachments.
Click to expand...
Click to collapse
Hi, currently I am using Naptime by Franco with ADB permissions. I'm not sure, but it should work by using the following options (maybe not only these, but I don't know well if there are other places where Doze options are stored):
inactive_to=2592000000,
motion_inactive_to=2592000000,
light_after_inactive_to=0,
light_pre_idle_to=30000,
light_max_idle_to=86400000,
light_idle_to=43200000,
light_idle_maintenance_max_budget=30000,
light_idle_maintenance_min_budget=10000,
min_time_to_alarm=60000,
min_light_maintenance_time=10000,
wait_for_unlock=0,
quick_doze_delay_to=86400000
It's working very well (I get 2% drain in 8 hours of sleep), but I wanted to try and improve it further, because the App tells you when and how much Doze is enforced and when maintenances are performed.
In my case, from my understanding, I don't need maintanances so often, or maybe I don't need it at all, because all the apps of which I need notifications are in non-optimized battery mode.
For reference, during night it performs 4-6 maintenances circa.
Coming to the point, I wanted to ask you I can use you settings even if they have further options like:
sensing_to 0
locating_to 0
and if I can make your settings even more extreme on some values.
For further reference, I have disabled through adb the "motion_engine", any system gesture and I have the Location always disabled (through UI shortcut, not ADB or advanced options).
NovaProspekt70 said:
Hi, currently I am using Naptime by Franco with ADB permissions. I'm not sure, but it should work by using the following options (maybe not only these, but I don't know well if there are other places where Doze options are stored):
inactive_to=2592000000,
motion_inactive_to=2592000000,
light_after_inactive_to=0,
light_pre_idle_to=30000,
light_max_idle_to=86400000,
light_idle_to=43200000,
light_idle_maintenance_max_budget=30000,
light_idle_maintenance_min_budget=10000,
min_time_to_alarm=60000,
min_light_maintenance_time=10000,
wait_for_unlock=0,
quick_doze_delay_to=86400000
It's working very well (I get 2% drain in 8 hours of sleep), but I wanted to try and improve it further, because the App tells you when and how much Doze is enforced and when maintenances are performed.
In my case, from my understanding, I don't need maintanances so often, or maybe I don't need it at all, because all the apps of which I need notifications are in non-optimized battery mode.
For reference, during night it performs 4-6 maintenances circa.
Coming to the point, I wanted to ask you I can use you settings even if they have further options like:
sensing_to 0
locating_to 0
and if I can make your settings even more extreme on some values.
For further reference, I have disabled through adb the "motion_engine", any system gesture and I have the Location always disabled (through UI shortcut, not ADB or advanced options).
Click to expand...
Click to collapse
Hey; please don't quote the whole post, it doesn't really tell me anything
I don't really understand: What do you want to know from me/what is your question? ^^
Yes, you can make some values more extreme, but you said you already did (less maintenance, more idle)
Doomkopf said:
Hey; please don't quote the whole post, it doesn't really tell me anything
I don't really understand: What do you want to know from me/what is your question? ^^
Yes, you can make some values more extreme, but you said you already did (less maintenance, more idle)
Click to expand...
Click to collapse
Hey, I'm really sorry, I'm new on XDA.
I wanted to know why you have some options valued that I don't, like for example:
light_idle_factor 2
sensing_to 0
locating_to 0
and if using them might improve even more my doze.
Also, even if I have Naptime installed, which already improved things by a lot, I wanted to know if some of my values could be improved further to avoid useless maintenances (like I said I have between 4 and 6 maintenances during night, but I barely need 1).
NovaProspekt70 said:
Hey, I'm really sorry, I'm new on XDA.
I wanted to know why you have some options valued that I don't, like for example:
light_idle_factor 2
sensing_to 0
locating_to 0
and if using them might improve even more my doze.
Also, even if I have Naptime installed, which already improved things by a lot, I wanted to know if some of my values could be improved further to avoid useless maintenances (like I said I have between 4 and 6 maintenances during night, but I barely need 1).
Click to expand...
Click to collapse
Doomkopf said:
You can check "dumpsys deviceidle" to see what keys there even are. To help you out, here's an explanation of what each key actually sets. You can also get a visual sense of how the light mode and the deep mode work (not my work, thanks to easz from github).
Click to expand...
Click to collapse
I linked a xda post that explains every value in detail (first link in second quote/my post);
locating_to and sensing_to: By the pictures (also in second quote/my post), you can see how deep doze works; before going into IDLE mode of deep doze, it goes through a sensing phase (motion detection starts) and locating phasing. Default behavior of doze is to not go sleep when you move the device. This skips this phase (time for detecting motion with sensor is 0). Same with locating; when android notices that you move the device (train, car, ...) via gps (or wifi triangulation, etc) it doesn't go to sleep. This also skips that phase
light_idle_factor 2: This multiplies light_idle_to with 2 everytime if goes thorugh a idle/maintenance cycle until it reaches light_max_idle_to. So this basically doubles your light idle time every cycle until it reaches a max duration (which you can set, I also did in my recommended settings)
In that overview you could also think about how to tweak your values so you get less maintenances during night, as you wanted. Basically you have to make both (deep and light) idle_to's longer. I recommend to increase light idle_to first (more light idle, less maintenance), before going too deep on deep sleep - sometimes your phone needs to do backups at night, etc. Dont be afraid to set a "too large" maintenance window, your phone won't suddenly start to draw much power for nothing. You just have a few seconds/minutes less deep sleep (which is ok, little percentage). Give it something like 2 minutes per night, if you're afraid a backup will take longer, you can even go for 3-4 minutes per night.
Doomkopf said:
I linked a xda post that explains every value in detail (first link in second quote/my post);
locating_to and sensing_to: By the pictures (also in second quote/my post), you can see how deep doze works; before going into IDLE mode of deep doze, it goes through a sensing phase (motion detection starts) and locating phasing. Default behavior of doze is to not go sleep when you move the device. This skips this phase (time for detecting motion with sensor is 0). Same with locating; when android notices that you move the device (train, car, ...) via gps (or wifi triangulation, etc) it doesn't go to sleep. This also skips that phase
light_idle_factor 2: This multiplies light_idle_to with 2 everytime if goes thorugh a idle/maintenance cycle until it reaches light_max_idle_to. So this basically doubles your light idle time every cycle until it reaches a max duration (which you can set, I also did in my recommended settings)
In that overview you could also think about how to tweak your values so you get less maintenances during night, as you wanted. Basically you have to make both (deep and light) idle_to's longer. I recommend to increase light idle_to first (more light idle, less maintenance), before going too deep on deep sleep - sometimes your phone needs to do backups at night, etc. Dont be afraid to set a "too large" maintenance window, your phone won't suddenly start to draw much power for nothing. You just have a few seconds/minutes less deep sleep (which is ok, little percentage). Give it something like 2 minutes per night, if you're afraid a backup will take longer, you can even go for 3-4 minutes per night.
Click to expand...
Click to collapse
Thank you very much, very helpuful!!
Based on your information, I think I understand better how Naptime works. It increases the parameters of Light Doze making them similar to those of Deep Doze, and also increases the duration.
Wouldnt it be easier to just create a routine or mode ?
Like when I am around my work place I have set it to turn wifi off so it dont keep scanning for wifi and stuff.
I personally feel with Samsung most things can be controlled within their phone and developer settings and not to mention their add on apps like Good Guardian and Good lock.
tfn said:
Wouldnt it be easier to just create a routine or mode ?
Like when I am around my work place I have set it to turn wifi off so it dont keep scanning for wifi and stuff.
I personally feel with Samsung most things can be controlled within their phone and developer settings and not to mention their add on apps like Good Guardian and Good lock.
Click to expand...
Click to collapse
I do use Samsung Routines to Enable Offline Mode and Battery Saving at night, which along with Naptime gives me 2% used battery in 8 hours over night, but during the day I can't find a good usage for it.
tfn said:
Wouldnt it be easier to just create a routine or mode ?
Like when I am around my work place I have set it to turn wifi off so it dont keep scanning for wifi and stuff.
I personally feel with Samsung most things can be controlled within their phone and developer settings and not to mention their add on apps like Good Guardian and Good lock.
Click to expand...
Click to collapse
I don't know what it would be easier as; this method?
This basically just configures doze to better fit your needs. It already had values in it before and it was activated before. You can (and should) do all this and still create a routine or mode additionally.
Doze is android's main internal battery saving feature, so tweaking it goes a long way.

Categories

Resources