[Edited 07/01/2021]
The issue is inconsisten, and so the solution as I've been unable to repeat -consistently- the failure of the RT.
It's been described as "brightness control breaks if you do not se it manually right after boot, before suspension/sleep", but this is not accurate, as I've been able to use it normally even without tweaks or manually changing after boot. And sometimes the same (repeated and confirmed) steps produce the issue. So, it's not clear, not consistent, not repeateable 100% each time.
The brightness issue IS NOT SPECIFIC OF Windows 10 on ARM32 (Surface RT), as it's been present since Windows 8.1 on diff computer brands. While it affects desktop computers as well, it seems to hit harder on laptops, specially if the "sleep when you close the lid" is activated.
After reading quite a bit, many users report solving this issue on their computers (non Surface RT) removing the sleep when you close the lid, removing the stock display drivers and updating them, remove dimming the display to save power, and removing the automatic brightness adjustment. However none of this seems to work on the Surface.
I created some scripts / instructions for powershell (below) to change the brightness at startup, but it doesn't work 100% as expected, not all the times. So there is a difference between changing the brightness manually, VS doing the same with a script.
I managed to clear this issue after restarting the display driver manually, it works. It's a simple "disable / enable" display (NVIDIA Tegra 3), and you will hear the beep of detected hardware, that's it. Also created some script/instructions to do this and it works, but it shuts down the audio. I removed the -like on the device get to avoid affecting similarly named devices, but it's not that... as I also used -eq (equal), getting the device that exactly matches the name given, and it also shuts down the audio. It shouldn't but it does.
That's all I know for now, it's some strange issue.
************************************
[solution found, the first post keeps the first attempt. If the following doesn't work for you, then try the new one at the end.]
I managed to upgrade my Surface RT 1 to Windows 10 and yes, things work better this way, BUT the brightness control has some issues.
Problem:
The tablet starts from off state with brightness at 100% regardless of the last state.
While this has happened on most cases, I noticed sometimes it starts at 0% without user intervention.
Yes you can perform brightness adjustments BUT, if you don't do so, it breaks when the devices goes to sleep and you won't be able to change the brightness until restart.
Your experience might be different, I asked here and there, and it seems some users had a diff experience, but they seem to be just rare exceptions.
Runaround: right after first boot from off state, perform whatever adjustment and you will keep the freedom of changing the brightness at any time even after sleep. This is what I was told and tested myself, it works, but I'm not fully sure about this as I would need more time to test my tablet.
My fix:
Create a powershell script with this code inside:
Code:
$tempov = Get-Ciminstance -Namespace root/WMI -ClassName WmiMonitorBrightness;
$original = $tempov.CurrentBrightness *1
$valt=11
if($original -gt 30){
$blink=$original-$valt
}else{
$blink=$original+$valt
}
(Get-WmiObject -Namespace root/WMI -Class WmiMonitorBrightnessMethods).WmiSetBrightness(1,$blink)
(Get-WmiObject -Namespace root/WMI -Class WmiMonitorBrightnessMethods).WmiSetBrightness(1,$original)
You will have to enable running powershell scripts, in my case I opened a window, tried and was asked to enable it or not, I said yes, that's it. And you can run this script at any time. But the idea is adding it to the Task Scheduler and set it to run right after booting, this mean "at startup".
Originally I made the script set the brightness to 30% this way:
Code:
(Get-WmiObject -Namespace root/WMI -Class WmiMonitorBrightnessMethods).WmiSetBrightness(1,30)
But if the tablet wakes up at 100% or 0%, it won't be pretty. So I changed it to the code posted at the beginning of the thread. What it does is...
It gets the current brightness value
Then perform a simple calculation to know if it can add or substract
Then applies the new value (thus a change in brightness)
And then goes back to the original value applying the original percentage
This provides a more pleasant visual experience, a slight blink, almost unnoticeable.
Why those values on the code? long story, I don't think you want to know the details, what? ok, 10 doesn't always work, 1, 2, 3, 4, 5, etc don't work, on some ranges changes of 1, 2 values don't work (I don't know why), and the most safe way is to do so using 10 as the base units for change in brightness (don't ask me why, I tested over and over), so 11 is the safest value. I could explain more about my tests but I don't want too, it's too long and boring and wouldn't make a difference, the code above works, if you want something different then you are free to play with the code yourself.
IMPORTANT: to avoid seeing a window opening while running the script, set the task scheduler to "Run wether user is logged on or not". This would require your password, if you don't have one on your account then I don't know what to do, I tried but the thing insisted so there you go.
I'm not an expert on Task Scheduler so please don't ask, research yourself, don't want to be rude, I just don't know enough details to guide you, what I posted here WORKS.
Already tested (and will continue testing) and it works, the tablet does a light and almost unnoticeable fade-blink and the brightness control is preserved after sleep.
IF... you manage to add this feature to your Surface RT without errors, then report how the code helps or not your brightness control. My case = perfect. Will continue testing.
I think this is THE BEST method because even if you modify the brightness yourself, the code will be executed and it would be just slightly noticeable, so it's the best option regardless of the current brightness value.
Previous script works at times, don't blame me, I took my time to read, research and test, it's not that simple as "brightness gets broken after suspension", and it's not as easy to solve as "set your custom brightness level right after first boot", at least testing over and over prooves it.
But this one is bullet proof (PowerShell)
Code:
$d = Get-PnpDevice| where {$_.friendlyname -like "NVIDIA Tegra 3*"};
$d | Disable-PnpDevice -Confirm:$false;$d | Enable-PnpDevice -Confirm:$false
What it does is, it gets the screen device and disabled it and enables it again, the screen will just blink but the brighness control is fully restored, you can run it at any time it gets stuck. Not pretty but efficient. You could even set it on the task scheduler to run after wake up (I prefer not to).
Is this method still work?
Related
Hi,
First of all, I want to thanks all people that helped me testing the battery driver last time.
I'm starting a new thread for those tests as I seen many "users" of xdandroid were using my zImage as if it was an official one and claims having troubles with them.
As it's some still at devel level, I prefet to have a separate thread, this will avoid any confusion between official releases and development release.
As you may know, the first images I've released didn't not contains the modules, thus, wifi was not working. Also, I did broke the rodhium boot because of the battery temperature reporting false temperature for this model.
For those who wants to help me by testing this driver, the important thing is to clearly describe the problem you have (I.E : don't tell that the battery level is wrong only, tell me how you do know that, by comparison to winmo or else...). Second important thing is to make a "dmesg log" :
How-to make a dmesg log :
1/ Go to the "Dev tools" menu and launch the "Terminal Emulator"
2/ type "cd sdcard" (without the quote)
3/ type "dmesg >dmesg.log" (without the quotes)
4/ Send/Post me the dmesg file that will be made on the root of the SD card (either you can get it using android - don't work on my diamond - or you can get the file by rebooting the phone under winmo.
You can also do this using adb if you know how it works.
Shell script method :
1/ Make a txt file with "dmesg > /sdcard/dmesg.txt" on the root of your sdcard name it dumpdmesg.sh
2/ Under xdandroid, browse to the sdcard folder and execute the dumpdmesg.sh file
P.S : yu may have to make the dumpdmesg.sh executable using the followinf method : under a terminal (see above), type "cd sdcard" and then type "chmod +x dumpdmesg.sh".
If you need some special help or want to contact me, just send me a pm.
Here is a new set of zImages INCLUDING modules (hope it will work this time !). It have been build with the most recent kernel changes (Friday 10th September). The packages include the zImage+module in the folder zImage. Modified source files are available in the folder src.
1/ Only battery driver changes :
http://www.mediafire.com/?02qlq504pihhnnp
2/ Battery driver + Diamond panel on/off "improvement" (some people reports the screen does not powers up with this zImage. If you are experiencing same problem, please restore a working zImage (from your previous version or the last official build) and send me a dmesg log after having power on/off the screen at least 3 times. Thanks)
http://www.mediafire.com/?55qb3xpbrajivya
i think you may have the download links mixed up
hamagc said:
i think you may have the download links mixed up
Click to expand...
Click to collapse
Hard working day...thanks, I've fixed it.
Jerome
How to use?
viruscrazy said:
Hi,
First of all, I want to thanks all people that helped me testing the battery driver last time.
I'm starting a new thread for those tests as I seen many "users" of xdandroid were using my zImage as if it was an official one and claims having troubles with them.
As it's some still at devel level, I prefet to have a separate thread, this will avoid any confusion between official releases and development release.
As you may know, the first images I've released didn't not contains the modules, thus, wifi was not working. Also, I did broke the rodhium boot because of the battery temperature reporting false temperature for this model.
For those who wants to help me by testing this driver, the important thing is to clearly describe the problem you have (I.E : don't tell that the battery level is wrong only, tell me how you do know that, by comparison to winmo or else...). Second important thing is to make a "dmesg log" :
How-to make a dmesg log :
1/ Go to the "Dev tools" menu and launch the "Terminal Emulator"
2/ type "cd sdcard" (without the quote)
3/ type "dmesg >dmesg.log" (without the quotes)
4/ Send/Post me the dmesg file that will be made on the root of the SD card (either you can get it using android - don't work on my diamond - or you can get the file by rebooting the phone under winmo.
You can also do this using adb if you know how it works.
If you need some special help or want to contact me, just send me a pm.
Click to expand...
Click to collapse
another way to get the dmesg log that was advised to me some time ago was to make a txt file with "dmesg > /sdcard/dmesg.txt" inside of it and name it dumpdmesg.sh. when in android (using a file manager) execute the dmesg.sh file and it will create a dmesg log for you on the root of your sdcard. may be easier than typing it in terminal.
here is my log: http://pastebin.com/dPeEwFYr
winmo showed 80% when i booted android, android showed 77. this is on a siedio 1500mah battery. hopefully it will help with something. let me know if you need more info from me.
hamagc said:
another way to get the dmesg log that was advised to me some time ago was to make a txt file with "dmesg > /sdcard/dmesg.txt" inside of it and name it dumpdmesg.sh. when in android (using a file manager) execute the dmesg.sh file and it will create a dmesg log for you on the root of your sdcard. may be easier than typing it in terminal.
here is my log: http://pastebin.com/dPeEwFYr
winmo showed 80% when i booted android, android showed 77. this is on a siedio 1500mah battery. hopefully it will help with something. let me know if you need more info from me.
Click to expand...
Click to collapse
Thanks for the script thing, I will put it in my first post.
Thanks also for your log. Will have a look at it.
Jerome
still have wifi error
I used both fixes: battery driver and Battery driver + Diamond panel on/off "improvement" and with both of them I have Wifi error.
I attached dmesg for the first fix - battery driver
My device is DIAM100 with standard 900 mah battery
i can confirm this too. wifi still shows error.
Is the patch for Diamond only (reason to have "Diamond" on the name?)
I found it easier to just dump the file by doing this:
1. Open "cmd", type in "adb shell".
2. Type in "cd sdcard", then type "dmesg > dmesg.log"
3. Type "exit", then type "adb pull /sdcard/dmesg.log C:\Users\UserNameHere\Desktop\dmesg.log".
Also, check this post for my dmesg log. It's a whole day of me using my phone including charging and not, etc, etc..
http://forum.xda-developers.com/showpost.php?p=8097023&postcount=2281 <<
The only issues I've found so far are...
Sometimes the screen does not come back on. (Known issue, been about for a long time)
Touchpad seems to stop working randomly. I have to hit the up arrow on the "trackball" to re-enable the capacitive touchpad.
When plugging the phone into charge, it immediately reads 100% battery.
The good part is that my phone doesn't heat up to dangerous temperatures as it used to! It's a little warm, but definitely a huge improvement over the older revisions. I'm running the kernel with the Diamond patch, and I'm using an HTC Fuze with 3G Data turned on, Facebook, Handscent, Pandora, and GMail all running. I made a few phone calls in the process, too. The phone held together through all of that .
im'going to test it on my diam100!
edit: the battery seems to work better but wifi doesn't work and when i set the screen off the led start to blink like diamond is charging....this mean a battery consumption...!but this is the good way bro!!!!
edit2: android shows me 55% winMo 58%!!!
hey viruscrazy, are you working to get better battery life also?? I used your kernel update, kept the phone on standby (95% batt) throughout the night and saw low batt in the morning
But i got the correct battery %age and the panel worked well too
I just grabbed this tonight, and will DEFINITELY help to give feedback, it's one of 2 reason's I don't already use it daily (other being camera, i use alot), i know we got the fakecharge option, but it doesn't help to use and just have it go dead from actually being dead cause of no way to monitor it. This will be great to tweak it in time to be close to accurate as WM is. And get the patches officially added!!!
I am a little confused though, i over wrote my zimage, but the module's file was only like 400-500KB, versus the daily one i grab (when ever a new one is thrown up to DL.) is like 5MB in size. (current one i got is named "modules-2.6.27.46-01163-ge008466.tar.gz" and has 61 files, but on the site i got it from, it says "Kernels are built without debugging, for increase of speed." which i take it to mean a lot more compiled files are included to help speed.) I get them from http://balsat.hopto.org/.
I am still learning, but each time a new module file comes out, you DO delete the old one and use the new one right? Versus just ADDING the new one in your android directory (adding more and more doing this.)
I want to test, but don't want to mess up things that might make testing worse for you doing this'
EDIT- Ok, i havent's had time YET to follow the log instructions for info, BUT for now I ran it (didn't look at the battery level unfortunately, and will properly test more, but JUST wanted to give quick feedback since i already noticed a MMAASSIIVVEE difference in the metering of battery ALREADY.),
USUALLY ALWAYS after about 20-30 minutes (at most) it shows about 10-15% left. With new patches here provided on my CDMA Touch Pro, i was ACTIVELY was downloading and installing new games and utilities from the marketplace for over 3 HOURS, and it was showing battery power level pretty well, it showed 18% battery power left, i then rebooted into WM and battery power showed 34%, which isn't right, HOWEVER is WAY closer to showing proper battery levels compared to normal Android 2.2 builds by themselves. I will offer active helping support (using the shown proper proceedures.) in giving feedback with the rest of the helper here to help get us to the point where the battery level % is as closest to accurate as WM is. That is the 2nd only reason i don't use Android as my PRIMARY OS (forgetting about WM completely), Battery accurate level meter (TONS closer with current patches linked here), and CAMERA (as i use it a lot for normal images and family photo's and nephew
Hi there.
Fisrt of all, sorry for the wifi problem, I will have a closer look to the building process as it seems there is a problem with it. I don't use wifi myself so I don't test it but I will do for the next releases.
@m4f1050 : The diamond patch is for all phones but changes only affect the diamond phone. I made a different archive because maybe the panel stuff is not working correctly on all diamonds and people still want to test the battery stuff.
@gm112 : Thanks for the tip. I didn't put the adb method because on my diamond, the adb is not working all time. sometimes it will work (even using the Mass Storage profile under windows) and sometimes it won't work (even using the actyvesync profile)... Anywya, it's an easier way for people that have usb working on their phone.
@imrock : I'm not currently working on battery life but during my tests, I've seen a big difference between sleep mode using winmo (around 50mA drained over the usb cable) and android (arout 130mA drained over the usb cable). I've not yet measured the current drained from battery as I will have to make a small isolation between battery and contact.
@djdafreund : My modules are having problems because wifi won't work. When you download a new zImage, you should get the module that is provided with and you can delete the old one.
Thanks all for tests. I will at first try to figure out why I can't get the modules to compile properly.
Small questions : Do someone experienced problem letting the phone on charger all night ? I had a problem with one of my charger that will show charging but after a night, the battery is not fully charged, like if the charger stopped during the night. The other one charger works without any problem and the battery is fully charged. Maybe a problem with my charger but I want to be sure the problem is not coming from the android 2.2 (I just updated to 2.2 this week end, never had this problem before).
Hi,
I found the magic script that generates the modules correctly. I've updated the second post links to the new builded images + modules. Modules are not the smalles one without debug but I will make them withut debug for the next time.
Now, it's time for me to work on the rhodium temperature.
Please, continue testing,*especially for diamonds users that have problems with their screen.
Thanks
viruscrazy said:
Hi,
I found the magic script that generates the modules correctly. I've updated the second post links to the new builded images + modules. Modules are not the smalles one without debug but I will make them withut debug for the next time.
Now, it's time for me to work on the rhodium temperature.
Please, continue testing,*especially for diamonds users that have problems with their screen.
Thanks
Click to expand...
Click to collapse
Good job on the work, man! ..Question. Do you need a Fuze? I have one with a broken touchscreen, lol.
EDIT: After charging the phone a bit, it seems the battery level drops 1% every 8 seconds.
EDIT #2: It seems to get back in-sync with what Windows Mobile reports after dropping down to the accurate amount . After rebooting, the reported battery life was lower tahn what it actually was, and added up till it was fairly close to the actual value. It may jump around a few percentiles off, but it's much more accurate than ever before, it seems. My panel doesn't seem to "freeze" up like it did before, too. Waking up from sleep seems a bit more responsive, but that could be related to other things. I'd like to report that my HTC Fuze(RAPH110) does not get very much hot when it's charging and discharging ;P. I'll post a dmesg log in a few hours.
EDIT #3: Figured I'd mirror your kernel images!
http://gd-u.com/files/Android/HtcBatterySmem_1.tar.gz
http://gd-u.com/files/Android/BoardDiamondPanel_FullPatch.tar.gz
I to have the wifi error but at least 3g is still there. Im on rhod400, though as for the battery work that has been implemented at least so far seems to be a vast improvement. So far though its making me feel more like I know how much juice I got. Love the charging animation. Can tell for sure it's getting some charge. Thanks for the hard work you guys do.
Ok now I can confirm wifi working with newest update.
Sent from my MSM using Tapatalk
very exciting. thanks, the battery driver works fine on my diam100.
it's full charged when I charge it all night. I'd like to try it more ,I'll post it later if i find some problems
Better Battery Life Tips
I've been using (and tweaking) Android devices since the original HTC Dream (aka G1, Android Dev Phone) was released, and I've had devices that are both good and bad at power consumption. In this thread I will share what I have learned and invite you to share what you have learned as well so that we can all get the most out of our devices.
Please note that I like to keep my smartphones "smart" and don't like to be manually toggling things on and off throughout the day. If you like to geek out 24x7 you can manually turn on/off every feature of your phone every time you use it to conserve juice... that's not me though!
Here we go...
-Consider a Different Browser
It seems like Opera Mobile and Mini are the kings of battery conservation. I tried Dolphin, Boat, Firefox, Chrome, the stock browser, and about 10 others... I didn't see significant differences in battery with any of them, but with Opera I noticed the difference. It makes sense since Opera renders the pages and optimizes the images remotely and then sends the bare minimum amount of data to your device to display the page.
-Location, Location, Location
Android's location related services can be a big drain. There are 3 different location settings you need to know about.
1) Location Access (Settings -> Location access): For maximum savings, you can turn off "Access to my location". However, there are many apps that make good use of your location. If you don't want to cripple them, leave this option turned on but at the very least uncheck "GPS Satellites" to save some juice.
2) Google Apps Location Settings (Settings -> Accounts:Google -> Location settings): Allows Google apps, such as Google Maps, to access your location. Why this needs to be separate from #1 above is beyond me, but turning it on requires the above setting to be on as well. If you don't use Google Maps, Now, Plus, or any other Google services that use your location you can turn this off.
3) Location Reporting aka Latitude (Settings -> Accounts:Google -> Maps & Latitude -> Location Reporting): This is the bad one. Really bad. Wakelock and battery drain city. I don't even know why anybody would want this. Kill it with fire. Set it so that it does not update or report your location.
-Turn off stuff you don't use
This should be common knowledge by now... if you aren't using GPS, Bluetooth, or even 4G... turn them off. If you don't need instant notifications and app updates you can even turn off Auto-Sync. If you decide to do that, I recommend the Synker widget from the Play Store. It is nice and configurable so that you can sync on demand with one touch.
-ROMs and Kernels
I'm not going to go into these too much here... there's a whole development section devoted to them with tons of info. Generally you get the best life from the stock based ROMs. Liquid Nitro and HO!NO!'s v20f (+Wind kernel) are quite good. Next best is probably HO!NO!'s CM9. The CM10.1 ROMS and kernels have a bit of catching up to do at battery consumption, but they keep getting better.
-Kill Google Talk!
If you don't use this program, disable it. It is always trying to do something on the network. Even if you turn off data and wifi you can still get NetworkConnectivity wakelocks from this app trying to do its business! Killing it is the first thing I do after flashing a ROM, especially CM10.1. From home hit: Menu -> Manage Apps -> All -> Talk -> Disable.
*Some report that disabling apps through the Android OS might not stick. If this is a concern for you, download NoBloat or Titanium Backup and freeze this app. Or if you're a nerd like me, use a root file explorer and move or rename the .apk file in /system/app
-Kill Google+ (Plus)
Just like the above, if you don't use it, deactivate it. It also uses data and location services pretty regularly. Disable it in the same way, or use NoBloat or Titanium.
-Kill Google Now
If you don't use it, deactivate it. It uses data and location services pretty regularly. I like its features and keep it enabled on my N7, but leave it off on my phone. To turn it off, go into the Google Search app (long-touch menu/search button), hit Menu -> Settings -> Google Now. You'll see the option to disable it.
-Data-Toggling Battery Saver Apps
These are pretty controversial, almost as much as app-killers were when they were very popular. In a nutshell they turn your data connections on or off based on whether your screen is on or off. They usually will check to see if you are downloading or streaming anything before they shut off the connection. Then, they periodically turn the connection on while the screen is off so that the device can perform a sync to get emails, etc.
Should you use one? If you are running CM10/10.1/AOKP4x then YES USE ONE!! EDIT: THE LATEST VERSIONS OF QUATTRIMUS AND WIND FOR CM10.1 HAVE RESOLVED THE BATTERY DRAIN ISSUE. Use of a battery saver is no longer essential. If you still want to use one, read on...
Whether or not you use a battery saver depends on how you use your phone, and if you are willing to accept the trade-offs. These apps get their savings from maximizing deep sleep time for extended periods with zero data concerns or interruptions. If your usage habits allow the app to do its job, use it. If not, don't use it.
[What follows here is some long drawn out jibber jabber about the pros/cons of these apps. Read it if you like]
Some people love these battery saver apps and swear by them; others hate them. The reason some like them is because they get a few more hours of battery life. The reason why some people hate them is because:
1) They wake the device periodically to do their job... which negates some of the power savings you get from having them. To some people these tiny wakelocks are the most horrible thing ever... even if their impact is quite small compared to the power being saved. These people are usually the ones who live and die by their BBS logs. I'll admit, I was one of those people
2) Syncs are delayed, so messages and notifications do not arrive instantly but when either of the following conditions are met-
a) The screen gets turned on (which triggers data on and autosync)
b) The program hits a scheduled time trigger (usually at user selectable intervals)
3) There's a small lag while data connects when the screen gets turned on. If the screen gets turned on very frequently the constant on/off/syncing can actually hurt the battery more than it helps.
But, if you are ok with the delayed syncs and you set up the sync intervals long enough apart you WILL see a gain in battery life. Your phone will sleep much more soundly as well. With one of these apps my Nitro HD on CM10.1 can sleep all night and will only lose maybe a percent or two.
*Note that these will NOT help you at all when the screen is on, which is a bummer because the Nitro screen sucks down a LOT of power. Also, your usage patterns may make them ineffective for you... in which case you are probably better off without them.
Personally I get about an hour or 2 of extra life if I use one, but it's a trade-off since I lose instant notifications and a there's a slight delay while it reconnects to the network when the screen gets turned on. And the more you turn your screen on/off, the more it disconnects/reconnects/syncs... meaning it is using a bit MORE power than usual for those seconds.
[/jibberjabber]
The following are my favorite data-toggling battery-saver apps. All of them have "free" versions and more advanced "pro/prime/advanced/whatever" paid-for versions. These are not the only ones out there; feel free to report back on ones you prefer. If you find one that you really like, I suggest buying the pro version not only for the additional customization they offer, but to support the devs for a job well done.
1) DS Battery Saver - Super easy to configure and since it kills background tasks before sleeping it puts your device into a nice deep sleep. Also combines the feature of CPU Sleeper if you are rooted... it'll shut off a CPU core when sleeping.
2) Green Power - Works really well. The interface is simple and well laid out. I used it for years before I discovered DSBS.
3) Juice Defender - Another decent app, similar to Green Power. I personally preferred the options and the interface of GP better, but you may not.
4) CleverConnectivity +++Battery - The interface is a bit weak, and I had problems with the full data on/off features working on my P930 w/CM10.1... BUT this program has one very cool feature- it has an option for dropping the connection speed down to 2G/EDGE when the screen is off instead of disabling it completely. This allows syncs to still occur while still saving some power in 2G. I've even streamed Pandora on 2G, so in theory you could do stuff like that too. This feature worked fine on my P930 dispite the normal data on/off failing intermittently. There is a moment of zero data while it toggles between 2G/3G. I think this app might be awesome when development advances some more.
-Underclocking (rooted users)
Capping your max CPU frequency at a lower limit can save power. Quite honestly, for 99% of my daily use I can't tell the difference between the CPU clocked at 1.2ghz and 1.8ghz except that at 1.8ghz my battery bar laughs at me and gives me a wedgie. On custom ROMs there is often a built-in method to set the CPU clock frequency (Settings -> Performance -> Processor). On stock-based ROMs you'll need a 3rd party app like Kernel Tuner, SetCPU, or any of the other 50 options in the Play Store. You can usually safely set your minimum frequency to 192mhz, but some phone/ROM/kernel/voltage combos will cause stability or lag issues with doing this. YMMV.
*If you are using a CPU controlling app like SetCPU that allows for profiles, you might be tempted to set the screen-off frequencies to the absolute lowest setting of 192/192... be careful! This setting could end up costing more power consumption because the CPU has to work for a much longer time to handle the tasks at hand at such a low clock speed. If it was allowed to ramp up a bit the task would be done more quickly and efficiently. Honestly I gave up on setting screen-off profiles. I just use governors based on smartass which have their own screen-off settings integrated. Less adjustments needed, similar results. This leads us to...
-Changing governors (rooted users with custom kernel)
There's about 50 different governors floating around out there. If you don't know what a governor is or what each one does, read this thread: http://forum.xda-developers.com/showthread.php?t=1736168
In short: Any governor that is based on smartass, ondemand or interactive is going to be pretty light on battery, and you may not be able to tell the difference between them in normal use. I like smartassv2 and badass, which are both based on smartass. Conservative may sound the most battery friendly, but usually ondemand does better and is less laggy.
Try some out. Have fun with it. Eventually you'll want to start tinkering with the I/O Scheduler... that's a topic for another thread. There's not much battery life to be gained there anyway.
-Undervolting (rooted users with custom kernel)
WARNING: This can cause instability if done improperly. MAKE A CWM BACKUP BEFORE TINKERING WITH UNDERVOLTING!!! I've never seen *drastic* gains on any device, but you do get a little bit more life, and every little bit helps, right?
So if you want to do it, read this: http://bigfatreality.blogspot.com/2012/03/guide-to-undervolt-android-safely.html and then proceed with caution.
Generally you can aggressively undervolt at lower frequencies, but be careful at higher frequencies because your device needs more power under load and will not like it if it can't get it. If you're a car guy this is like running too lean of a fuel mixture
Kernel Tuner and IncrediControl have nice GUIs for fiddling with voltages. Remember, adjust in tiny increments, followed by thorough testing! If you get a crash or reboot then you've gone too far. DO NOT ENABLE "SET ON BOOT" UNTIL YOU ARE SURE YOU'VE GOT STABLE VOLTAGES!!!
-Screen dimming
Screen backlights use lots of power. This ain't no AMOLED where you can save power by using dark backgrounds- LCDs light up the entire display regardless of what is on them.
I suggest turning off auto-adjust and set your brightness at a level that is just bright enough to be comfortable. I keep mind around 30-40%. Auto-adjust periodically polls the sensor to get light data, and uses a small bit of power to do it each time.
Turn on the 'Status Bar Brightness Control' if your ROM supports it so that you can easily swipe your finger along the top of the screen to brighten or dim the display on the fly. In CM9/10(.1) this option is under Menu -> Settings -> System -> Status Bar -> Brightness Control.
If you MUST use the auto-adjust, consider adjusting the levels that it uses. Make them as dim as is comfortable for you. For stock-based ROMs you'll need a third party app like this: https://play.google.com/store/apps/...wsMSwyLDEsImNvbS52aXRvY2Fzc2lzaS5sdXhsaXRlIl0.
For CM/AOKP based ROMs this can be done from the Display -> Brightness sub-menu of your device's settings area. CM10.1 has an excellent and simple adjustment interface.
-Build.prop Tweaks (rooted users)
You can add the tweaks below into your build.prop file that may or may not help with battery life. Download BuildProp Editor from the Play Store and add them. They seem to help a bit, but it could be placebo effect. They certainly don't hurt anything so give them a shot and report back what you get. These seem to work with ICS and JB:
ro.config.hw_fast_dormancy=1
ro.ril.fast.dormancy.rule=0
ro.ril.disable.power.collapse=1
pm.sleep_mode=1
wifi.supplicant_scan_interval=180
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
^ this forum keeps adding a space near the 16384... there shouldn't be any spaces. I think they get disregarded anyway if they are put in the file, so no biggy.
^some of these have presets in BuildProp Editor, some you have to enter yourself. I copy/paste them individually. Don't paste the "=" signs though. Everything before the "=" goes under "Property Name", everything after it goes under "Property Value". If you are experienced you can edit the build.prop file directly using a text editor. Just back it up first and don't screw with the permissions.
-Some other useful apps that help with battery life:
*CPU Sleeper (root users)- Shuts off all but one cpu core when the screen is off. This probably isn't required with a good kernel and governor setup (and a stable phone that sleeps well), and if you are running DS Battery Saver this feature is built-in to it. It uses barely any resources whatsoever, so give it a shot.
*Greenify (root users)- This essentially freezes selected apps when they are not in use. They cannot do background tasks or wake your phone when they are not active. When you attempt to open one of the apps it instantly thaws them for use. After you are done with them it freezes them back up. It is quite brilliant really! It eliminates a lot of wakelocks and battery drain from apps trying to update, gather location data, etc. Use with caution though- don't greenify apps that you actually need to have a data flow from or ones that you use widgets for.
*RootDim (root users) - You know how when you are using your phone in bed at night and the screen is just too bright, even on the dimmest setting? This app lets you go even dimmer. Less brightness means less power, so it will reduce battery usage in the process.
-Apps that help diagnose battery drains
*Better Battery Stats - Good for discovering the cause of battery-draining wakelocks. Just uninstall it when you're done using it to diagnose- otherwise it is constantly doing its thing which is not going to help battery life any!
*OS Monitor - See if your CPU is settling down like it should and see what is keeping it busy. It also has a ton of other advanced options and features.
...there's too many apps to list here! Share the ones you like I'll add more later.
-Adjust your advanced Wifi settings
Go to Settings -> Wifi, then hit Menu -> Advanced
Most people agree that Network Notification should be UNCHECKED, Keep WiFi during sleep should be 'Always', and 'Avoid poor connections' and 'WiFi optimization' should be CHECKED.
If you have a noisy wifi router (some Netgears are guilty) that keeps waking your device from sleep with wifi packets you may get better results if you change Wifi During Sleep to 'Never' or 'Only when plugged in'.
-Watch the reboots!
Every time your phone reboots, Android checks the SD card for errors and then runs the Media Scanner to take inventory of all media files. Both processes consume power, so try to limit unplugged reboots. The more files on your SD card, the longer Media Scanner has to work, so get rid of unnecessary files cluttering up your card. You may have some luck using .nomedia files to tag directories to be skipped during scanning. You can also use an app like this to disable the automatic Media Scanning Service. It also lets you scan on demand. Caution- If you don't ever do a scan, then new pictures won't appear in your gallery nor will new music appear in your player.
I'm sure I'll think of some things later that I have forgotten, and I'll discover new things... I'll update this when I do.
Please share your findings so that this can be the best battery saving thread... In the world.
Very interesting and helpful info.
Thank you very much !!! :good::good::good:
Couple things I'd add, especially if you're running a CM-based ROM
Get NoBloat and disable the following:
SuperUser - Get SuperSU instead, less battery drain.
CM Update Checker - Every time I use my phone to go online (I don't have data on 24/7) this thing pops up and wants to check for updates, but never properly gets flushed. Disabling this one app dropped my hourly drain by about 1.5% on CM10
jekostas said:
Couple things I'd add, especially if you're running a CM-based ROM
Get NoBloat and disable the following:
SuperUser - Get SuperSU instead, less battery drain.
CM Update Checker - Every time I use my phone to go online (I don't have data on 24/7) this thing pops up and wants to check for updates, but never properly gets flushed. Disabling this one app dropped my hourly drain by about 1.5% on CM10
Click to expand...
Click to collapse
Thanks for this- I just disabled CM Updater.
BTW with JB there's no need to download NoBloat- you can disable most apps (including this one) from the built-in App manager. Settings -> Apps -> All -> CM Updater -> Disable
Here's another trick for a specific type of battery drain: (you don't apply the fix in on your phone though)
Symptoms:
1) Your phone drains its battery while doing basically nothing while connected to your wifi router.
2) BBS shows massive amounts of wlan_rx_wake wakelocks
3) Android OS seems to be a high contributor to battery use
Fix #1: (Found HERE) "Change DTIM value in your router configuration from 1 (default) to 255. This value is usually in Advanced->Wireless tab on most routers."
^Seems to help a lot.
Fix #2: Set a static IP on your phone for your home network. The easiest way to do this is to find out what address range your router uses when it hands out IP address via DHCP, then hard-set an IP on your phone that is not in that range so that there won't be any conflicts with other devices that connect to your network. You'll need to consult your internets and googles to figure out how to get this information from your router, if you don't know how. Once you know a clear address you can use, go into your phones Wifi Settings, long-touch your network name, hit 'Modify', 'Advanced', punch in the static IP you wish to use. This might not be an option on corporate or shared housing wireless routers.
Fix #3: Check ALL computers on your network for the presence of the Dropbox software. Mac, Windows and Linux computers alike. If it is running in the system tray, click it, go into preferences, turn off 'LAN Sync'. This little booger wreaks havoc with wifi locks on some Android devices.
mpsantiago said:
Thanks for this- I just disabled CM Updater.
BTW with JB there's no need to download NoBloat- you can disable most apps (including this one) from the built-in App manager. Settings -> Apps -> All -> CM Updater -> Disable
Click to expand...
Click to collapse
I've found that for whatever reason the built-in app disabler doesn't always work. I still like using NoBloat better.
Second to this, once you do disable a bunch of apps it's good to boot back in to recovery and wipe dalvik/fix permissions.
jekostas said:
I've found that for whatever reason the built-in app disabler doesn't always work. I still like using NoBloat better.
Second to this, once you do disable a bunch of apps it's good to boot back in to recovery and wipe dalvik/fix permissions.
Click to expand...
Click to collapse
I agree.
Thanks for all the info it is very interesting! I'll be trying this
---------- Post added at 01:17 PM ---------- Previous post was at 12:59 PM ----------
Thanks for all the info it is very interesting! I'll be trying this
thanks you. it greats:good:
LTE battery drain
Any good tips for reducing battery drain in LTE and Wifi for 20c?
Updated the OP... from now on I'll just put new tips at the top of the list.
frankshi said:
Any good tips for reducing battery drain in LTE and Wifi for 20c?
Click to expand...
Click to collapse
What ROM are you using and is LTE available in your area?
Awesome guide man, +thanks:good:
Oh this is kinda off-topic but Mattman86 I wanted to ask you, I just installed your Hono CM9 Full Throttle rom and I'm having some issues putting the apps onto my SD-Card. Whenever I move them (through titanium backup or just standard move to sd in settings) whenever my phone restarts the apps disappear and or say "app not installed" then they are a green default android icon and just don't work :\ Also does Wind Kernal work with your 4.0.4 Rom?
alainmona said:
Awesome guide man, +thanks:good:
Oh this is kinda off-topic but Mattman86 I wanted to ask you, I just installed your Hono CM9 Full Throttle rom and I'm having some issues putting the apps onto my SD-Card. Whenever I move them (through titanium backup or just standard move to sd in settings) whenever my phone restarts the apps disappear and or say "app not installed" then they are a green default android icon and just don't work :\ Also does Wind Kernal work with your 4.0.4 Rom?
Click to expand...
Click to collapse
I haven't done anything with CM9.
I currently have the ROM in my signature with Wind Kernel 3.5 and Battery Guru along with SetCPU installed and I get roughly 23 hours of battery.
mattman86 said:
I haven't done anything with CM9.
I currently have the ROM in my signature with Wind Kernel 3.5 and Battery Guru along with SetCPU installed and I get roughly 23 hours of battery.
Click to expand...
Click to collapse
Oh then I'm tripping then haha, I have a question though. I tried installing Liquid Nitro and every time I tend to wipe data, wipe cache, wipe dalvik, and wipe system. It just hangs at the LG logo and I haven't had the ability to try out your v7 or for that matter any of the other previous Liquid Nitro. I'll send you a PM since I can't really post in the development section due to my lack of postage xD :cyclops:
On the CM 10.1M3 with wind kernel 1.8, after one day of normal use with WiFi off and Data Off and Location services off I got Google Maps being the worst offender battery wise, the weird part is that I didn't really used maps that day. So even with everything off some service is still eating bat in background.
Sent from my Nexus 4 using xda app-developers app
The problem
I've been using CM10 on a Defy+ for a few days now. I've quickly noticed that I'm not getting exactly stellar battery life. Checking BetterBatteryStats indicated zero deep sleep, and "wifi_wake" as king of the wakelocks.
I realise that it's probably not wifi's fault but rather inconsiderate apps using wakelocks badly, still, something needs to be done.
Who is this for
People who, when their Defy+ has wifi on and connected, get absolutely no deep sleep in BetterBatteryStats, and wifi_wake or similar tops the kernel wakelock chart.
Does this work when wifi is on but not connected to an AP?
No idea. Theoretically, wherever you come near an AP there will be beacons and DTIM's flying around so it might work. But if you're not going to be connected you might as well turn wifi off, either manually or with an app. I can recommend Wi-Fi Matic, it uses a clever trick (uses GSM cell IDs to detect proximity to a known AP).
Possible solution (*ROOT* needed. This was ONLY tested on Defy+ with CM10.)
After some research I came to the configuration files for the TI wifi module, which are located in /system/etc/wifi and called tiwlan.ini and tiwlan_ap.ini. After some digging around and reading the Texas Instruments doc for the module (sprugt8.pdf), I'm prepared to offer a hack:
In tiwlan.ini change DtimListenInterval from 1 to 30.
In tiwlan_ap.ini change BeaconListenInterval from 1 to 10.
Reboot and see if BetterBatteryStats reports better (or any) deep sleep with wifi on and connected.
This combination gives me up to 85% deep sleep. YMMV because you probably don't have the same apps & background services installed as I do, usage patterns etc.
Increasing these values even further is possible (valid range is 1-50) but with only marginal improvements to deep sleep time and increasing issues with wifi (frequent disconnects in the case of weak signal). In other words, the connectivity problems aren't worth the extra 5% of deep sleep. Even so, if you manage to increase them (beacon in particular, I haven't tested large values as thorough as I did DTIM) and still keep wifi stable, please let us know.
Here's my findings for DtimListenInterval (on its own): 10 gives 25-30% deep sleep, 20 gives 42-50%, 30 goes up to 60%. Increasing it any further is pretty much useless, 50 (max) will get you to ~67% but expect heavy disconnects.
For BeaconListenInterval: 10 seems to be an upper limit when Dtim is around 25-30. Going over will cause disconnects even with very strong APs.
I haven't documented BeaconListenInterval on its own very rigurously, OR various combinations of the two, because I got bored of rebooting. Plus the fact I don't know when which of the two ini files will be used, so it's kinda like shooting in the dark. You're welcome to contribute your own findings.
But how do I edit those files?
You need root and any file manager worth its salt that lets you see the system files and edit them.
Is this dangerous?
I have no idea and I take no responsability. It's probably a good idea to make a backup of those files, and, even better, slap the backups into a flashable zip on the root of your sdcard. In case something bad happens you can reboot in recovery and install the good versions back. Example flashable zip and tutorial here. Remember, they go into system/etc/wifi/.
Warning: I used this on CM10 and Defy+
If you attempt it on anything else all bets are off. If the files are not there, you can't find the keywords and so on, you're on your own. Still, you can read the explanations below and try to see if anything helps.
Explanations
tiwlan.ini and tiwlan_ap.ini control the behavior of the wifi module. I have no idea why there's two of them (or more, on some devices), but after poking around I've determined they must all be modified because they are used in different cases. (Different apps? Different circumstances? Different hardware parts? If anybody can enlighten us it would be super.)
These config files are similar, but different in some key aspects. Both my files have dot11PowerMode=0 which means "auto", which means that it looks at AutoPowerModeDozeMode to determine if it uses short (2) or long (3) doze mode for power saving. tiwlan.ini has short mode, tiwlan_ap.ini has long mode. This in turn means they use different listen intervals: short mode (tiwlan.ini) observes BeaconListenInterval, long doze (tiwlan_ap.ini) observes DtimListenInterval. Which is why we modify different properties in each file.
What are beacons and DTIMs? Simply put, beacons are a signal broadcasted by wifi access points periodically to let wifi clients they're there, and DTIMs are packages of special information about the AP. The most typical setup for most wifi APs is to send a beacon every 100ms i.e. 10 times a second, and a DTIM after every beacon, or at most every other beacon.
The default settings of "1" for BeaconListenInterval and DtimListenInterval means that the phone watches for these signals 5-10 times a second and, well, it's no wonder it doesn't get any sleep. Mind you, this does make for superb wifi connectivity, at the expense of battery life.
BTW, you can probably achieve similar effects by tweaking your wifi router to send beacons/DTIMs less often – all the wifi devices around your home will probably thank you. But of course you cannot control wifi APs everywhere you go, and it might backfire! Read below.
So why didn't "they" put better values on these settings?
For exactly the reason in the above paragraph: because you don't know what settings a particular AP you're trying to use has.
Here's an example. Say somebody tweaked their AP and put 10 beacons a second and a DTIM every 10 beacons. This means a DTIM once a second, then you come along and tweak your phone to only wake up the wifi connection every 30 DTIMs. That means 30 seconds, time in which the connection will most likely time out.
You cannot predict this kind of stuff so there's no safe default values other than "1", which mean "react as quickly as possible to any beacons/DTIMs we get because we don't know when we're getting another". My tweak is based on the assumption that the AP emits 10 beacons a second and DTIM with every beacon (beacon interval 100ms and DTIM interval 1). If the AP you use has been tweaked for more relaxed values these ini tweaks may backfire and cause disconnects!
Other potentially relevant ini settings
Here are some more interesting settings which could be further tweaked to get even better results:
PowerMgmtHangOverPeriod
AutoPowerModeActiveTh
AutoPowerModeDozeTh
BeaconReceiveTime
See the TI pdf for details.
That's all folks
Thanks for reading this far. Please contribute if you have insights, if I said stupid things or if you find settings that seem to work better.
Hello,
My phone began to get hot since 1 week and the battery drains very quickly. I investigated and found out that it's the ksm deamon that is causing that (30% + cpu usage all time). The ksm deamon scans all the memory at an interval to do things with it... It is a normal linux process but :
The problem is that the interval is set to 20ms ! And that the run value is at 1. The files are here : /sys/kernel/mm/ksm/run
I changed run from 1 to 0 with the terminal emulator, it fixes the problem, but then it goes back to 1 after some minutes. Same for the interval, I set it manually to 10000000000000000000 and then it goes back to 20.
It's like there's a virus changing the value or something like that.
Help me please, I can't use my phone anymore, it lags, gets hot and the battery drains very quickly :crying:
Thanks.
I'm having the same damn problem on my oneplus. It get's so hot it causes the touchpad to stop working and the phone becomes unresponsive and I have to force shutdown. Did you find a solution to this problem? I might try a custom ROM on here, I didn't have this problem with my last oneplus so not sure if it was a recent kernel update to CM11 that did this or what.
skini26 said:
Hello,
My phone began to get hot since 1 week and the battery drains very quickly. I investigated and found out that it's the ksm deamon that is causing that (30% + cpu usage all time). The ksm deamon scans all the memory at an interval to do things with it... It is a normal linux process but :
The problem is that the interval is set to 20ms ! And that the run value is at 1. The files are here : /sys/kernel/mm/ksm/run
I changed run from 1 to 0 with the terminal emulator, it fixes the problem, but then it goes back to 1 after some minutes. Same for the interval, I set it manually to 10000000000000000000 and then it goes back to 20.
It's like there's a virus changing the value or something like that.
Help me please, I can't use my phone anymore, it lags, gets hot and the battery drains very quickly :crying:
Thanks.
Click to expand...
Click to collapse
into_311 said:
I'm having the same damn problem on my oneplus. It get's so hot it causes the touchpad to stop working and the phone becomes unresponsive and I have to force shutdown. Did you find a solution to this problem? I might try a custom ROM on here, I didn't have this problem with my last oneplus so not sure if it was a recent kernel update to CM11 that did this or what.
Click to expand...
Click to collapse
I kept disabling it manually with the terminal and was monitoring my phone with a process manager. Then it stopped by itself I don't know how....
But it may come back one day I really don't know why, I didn't even uninstalled an application. This is very weird and it's a core functionnality of linux, why is it designed like that ?
skini26 said:
I kept disabling it manually with the terminal and was monitoring my phone with a process manager. Then it stopped by itself I don't know how....
But it may come back one day I really don't know why, I didn't even uninstalled an application. This is very weird and it's a core functionnality of linux, why is it designed like that ?
Click to expand...
Click to collapse
I've noticed KSMD only pegs out like crazy on my phone when it's active. While the phone is asleep it does nothing.
I can tell it's not at all related to running the TOP process either to monitor things because if you do a ps -ef --sort +time, you can see KSMD process constantly climbing a few seconds of a time of CPU use the longer your phone uptime\Screen-on-time goes on. It's not growing at a massive rate, but like 1 second of CPU time for every 30 seconds of screen on time.
I did a little digging and apparently this is an issue on many Linux distributions and is generally seen as a bug from the user community(unsure how the dev community feels about it, but it's pretty old.. you'd think they would address it by now). It's possible that the Gamma kernel is based on a Linux kernel distro that has that bug in it.
I noticed that the LiveDisplay setting is not turning on by itself if set to automatic. At first I thought it was a bug in the ROM, but after searching around a bit, I found out it requires location to work. It uses our location to determine sunset and sunrise times, and activate/deactivate LiveDisplay accordingly. Correct me if Im wrong here.
My suggestion would be to make this setting user configurable in a way that we can manually set start/stop times of night mode. First of all because we might want to turn if on/off at different times, secondly because having GPS turned on drains battery. Or give an option to use either user set hours or GPS.
Considering the magic the guys usually do, this could be implemented in a matter of hours, and would benefit the users and battery life.
Note: Before some smart ass gets to say "its open source, download and do it yourself" - I do want to do that, I am a developer, but currently I have limited hardware to build LOS and will get to it after I upgrade it.
I second this as in the UK the sun doesn't set till really late.
I found a workaround for this issue as there is still no option to set sunset and sunrise time manually. The workaround is the automation app Automagic . It supports setting of LineageOS System Settings since version v1.36. Root is requiered. In the app you have to look for Lineage OS System Setting "display_temperature_mode" (Value 4- Auto, Value 2 - day).