Hi devs
I found something interesting about Android power management..maybe it will help us
http://developer.android.com/reference/android/os/PowerManager.html
http://www.netmite.com/android/mydr...s/power_management.html#androidPowerWakeLocks
and here is a app for users http://forum.xda-developers.com/showthread.php?t=1179809
I found some more things for power management
devs check pls
Enabling system for hitting OFF
#echo 1 > /debug/pm_debug/enable_off_mode
By default sleep_while_idle is set to false and enable_off_mode is set to true
CPU Dynamic Voltage Frequency Scaling settings
Enabling ondemand frequency governor
The ondemand governor enables DVFS(frequency/OPP) transitions based on CPU load.
#echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Enabling performance frequency governor
The performance governor keeps the CPU always at the highest frequency.
#echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Enabling powersave frequency governor
The powersave governor keeps the CPU always at the lowest frequency.
#echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Enabling userspace frequency governor
Once this governor is enabled, DVFS( frequency) transitions will be manually triggered by a userspace application by using the CPUfreq sysfs interface
#echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
See all the available operating points
#cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
Application can select any of the available frequency from the above
#echo <Desired Frequancy> > /sys/devices/system/cpu/cpu0/cpufreq/ scaling_setspeed
Checking CPU IDLE states usage
There are seven power states introduced by CPU Idle
The usage and time count for these different states can be checked via
#cat /sys/devices/system/cpu/cpu0/cpuidle/state*/time
#cat /sys/devices/system/cpu/cpu0/cpuidle/state*/usage
Enabling system for hitting OFF
#echo 1 > /debug/pm_debug/enable_off_mode
By default sleep_while_idle is set to false and enable_off_mode is set to true
CPU Dynamic Voltage Frequency Scaling settings
Enabling ondemand frequency governor
The ondemand governor enables DVFS(frequency/OPP) transitions based on CPU load.
#echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Enabling performance frequency governor
The performance governor keeps the CPU always at the highest frequency.
#echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Enabling powersave frequency governor
The powersave governor keeps the CPU always at the lowest frequency.
#echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Enabling userspace frequency governor
Once this governor is enabled, DVFS( frequency) transitions will be manually triggered by a userspace application by using the CPUfreq sysfs interface
#echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
See all the available operating points
#cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
Application can select any of the available frequency from the above
#echo <Desired Frequancy> > /sys/devices/system/cpu/cpu0/cpufreq/ scaling_setspeed
Checking CPU IDLE states usage
There are seven power states introduced by CPU Idle
The usage and time count for these different states can be checked via
#cat /sys/devices/system/cpu/cpu0/cpuidle/state*/time
#cat /sys/devices/system/cpu/cpu0/cpuidle/state*/usage
source: http://processors.wiki.ti.com/index.php/Android_Devkit_Power_Management_Porting_Guide
this is very interesting also:
Saving battery time for mobile devices has been a goal for the industry for many years. With the
advent of smartphones, reduction of energy consumption is even more important since they
consume a lot more energy than the generation of mobile phones before them. Consumers are
demanding longer battery life and greener electronics. One way to meet these demands is to
reduce energy consumption.
In order to make the mobile operating system utilize the Central Processing Unit (CPU) more
efficiently, applications should have different reservations based on how much they need to use
the CPU. A challenge the industry is facing is its lack of knowledge of the behavior of third
party applications. Especially since they are an increasing portion of the applications run on
smartphones. Without knowledge of how third party applications behave, it is hard to make
good reservations for them. If there was a way to dynamically make reservations for the
applications with adequate performance while they are running, the system could use this
information to reduce battery consumption by e.g. clocking down the CPU when a high clock
frequency is not needed. In this master thesis project, an open source resource manager called
ACTORS Resource Manager (ACTORS RM) [5][6] for desktop Linux [57] is ported to the
Android [37] operating system. The resource manager is also optimized for the applications
being run there. A power management patch to the Linux kernel was also used to get greater
control over the CPU’s frequency changes.
source: https://rapidshare.com/files/3398178110/Resource_reservation_and_power_management_in_Android.pdf
let's spy on HD2 kernel ?
feature:
AB: Audio Boost
AXI: AXI frequency tweak
BFQ: BFQ IO scheduler (default CFS)
BFS: BFS cpu scheduler (default CFS)
HAVS: Hybrid Adaptive Voltage Scaling (Static Voltage Scaling - SVS is default)
OC: OverClock
UV: UnderVolt
OC, UV and AXI features are the standard feature for EVO based kernel.
EBAT: Extended battery
http://forum.xda-developers.com/showthread.php?t=777921
Edit: after some more research i found out that we are in BIG $h|t,until the f**** HTC will unlock the bootloader and/or update Radio for us
What REALLY improves Android battery life on the HD2
So after all that rambling, the answer is: radio ROM version. When I installed Android, I installed the latest radio ROM available at the time (still the latest I think); i.e. 2.15.50.14, from http://forum.xda-developers.com/showthread.php?t=611787. After pulling my hair out trying all the above, I flashed the radio ROM with 2.12.50.02_2, and as if by magic, current draw under similar conditions to above is about 7mW; i.e. 10% of what it was, and an overnight period as above goes from 100% to 96%. Much better
source:http://forum.xda-developers.com/showpost.php?p=13397376&postcount=1
currently our phones use 150-200 mA (even in standby,and with setCPU on :O)...measured with Current Widget available on Market.
Edit2: Another thing that REALLY improves Android battery life on the HD2 is dumping your girlfriend.
Before, I needed to charge it almost twice a day. Lots of calls and messages.
Now, I can easily get two days of standby. LOL
The radio version on hd2 is a bit tricky. Its very different from people to people. Some people say that its related to your region too.
I dont know if its the same on HD Mini.
But some people here say the dont have battery drain. It would be nice to know what radio version they use and at what region they are.
tzacapaca said:
currently our phones use 150-200 mA (even in standby,and with setCPU on :O)...measured with Current Widget available on Market.
Click to expand...
Click to collapse
But if turn off wifi, gps and phone, consumption almost does not decrease.
Maybe this consumption of sdcard, because its slot is always hot.
ROM-Version (Vodafone)Switzerland German: 1.41.166.1, (10904) Radio:0.63.05.41
Strong battery drain is only after the first boot. after the third boot is the battery drain same as in wi-mo.. same experience with cm6(derefas) ,134++(schlund)
i don't really agree.
under android, the maximum we can expect is to get as much battery life as under winmo.
today, the phone consume too much battery when on sleep, because something prevents it to go sleep.
schlund has a fix for this battery drain, I tested it, it is really efficient.
it will be released in next release, be patient ;-)
regarding the android apps that tells you how much current you have:
it wont work if the phone is really sleeping, because all the apps would be put on sleep.
so you will never know how much your phone consumes when on sleep ;-)
I should say: after the third boot is the battery drain almost the same as in wi-mo , but the truth is that there is a big difference between the first and third boot in battery drain.
New battery Fix, I'm glad to hear.
I understand that it takes time to create something, I have patience but I think it is unfair to announce a new release for the end of the week and then change mind and do not give any explanation. I hope you'll accept this criticism. Thank you
codiak said:
The radio version on hd2 is a bit tricky. Its very different from people to people. Some people say that its related to your region too.
I dont know if its the same on HD Mini.
But some people here say the dont have battery drain. It would be nice to know what radio version they use and at what region they are.
Click to expand...
Click to collapse
well,telling region and radio version won't help with anything,I will not move from my city to get better signal and HTC won't make a new radio only for me too
btw,it's impossible to don't have battery drain when phone use 200mA
i guess people were talking about CM6 of derefas,but his version is based on r146 kernel,which still has battery issues...
p.s. since u own a HD2 also do u mind to test for me with Current Widget and tell me the values in standby and on?I read some guys had 6-7 mA in standby and i think around 60 while it was on
DmK75 said:
But if turn off wifi, gps and phone, consumption almost does not decrease.
Maybe this consumption of sdcard, because its slot is always hot.
Click to expand...
Click to collapse
i'm not an expert but i really think it's impossible sdcard will use 150-200mA,if it was so then we will have 5-6 hours battery life in WM
Edit: after little research i found this ->
Metric NAND SD
Idle (mW) 0.4 1.4
Read
throughput (MiB/s) 4:85 2:36
efficiency (MiB/J) 65.0 31.0
Write
throughput (KiB/s) 927:1 298:1
efficiency (MiB/J) 10.0 5.2
so SD cards use around 1,4 mW when idle and 2,36 mW when read from it(our case)
and to convert mW to mA-> http://www.ehow.com/how_8627497_convert-mw-ma.html
source: http://www.usenix.org/events/usenix10/tech/full_papers/Carroll.pdf
-r0bin- said:
i don't really agree.
under android, the maximum we can expect is to get as much battery life as under winmo.
today, the phone consume too much battery when on sleep, because something prevents it to go sleep.
schlund has a fix for this battery drain, I tested it, it is really efficient.
it will be released in next release, be patient ;-)
regarding the android apps that tells you how much current you have:
it wont work if the phone is really sleeping, because all the apps would be put on sleep.
so you will never know how much your phone consumes when on sleep ;-)
Click to expand...
Click to collapse
i'm not really agree with u too
Current Widget runs as a process,and processes are on even if Android is in suspended,no?for ex clock,alarm,etc
15MA1L said:
ROM-Version (Vodafone)Switzerland German: 1.41.166.1, (10904) Radio:0.63.05.41
Strong battery drain is only after the first boot. after the third boot is the battery drain same as in wi-mo.. same experience with cm6(derefas) ,134++(schlund)
Click to expand...
Click to collapse
lol I think that's placebo or else why would number of boots/reboots will improve the battery life?
tzacapaca said:
well,telling region and radio version won't help with anything,I will not move from my city to get better signal and HTC won't make a new radio only for me too
btw,it's impossible to don't have battery drain when phone use 200mA
i guess people were talking about CM6 of derefas,but his version is based on r146 kernel,which still has battery issues...
p.s. since u own a HD2 also do u mind to test for me with Current Widget and tell me the values in standby and on?I read some guys had 6-7 mA in standby and i think around 60 while it was on
Click to expand...
Click to collapse
I get about 3-7 mA with all on (GPS, BT, 3G etc). Sometimes there are peaks to around 60 mA that are related to mailcheck etc. Its roundabout 1-2% per Hour what is fine to me
codiak said:
I get about 3-7 mA with all on (GPS, BT, 3G etc). Sometimes there are peaks to around 60 mA that are related to mailcheck etc. Its roundabout 1-2% per Hour what is fine to me
Click to expand...
Click to collapse
u see?
this is what i'm talking about,u can't compare 3-7 mA to 150-200 mA..so i can't understand guys who said they have power usage same as on WM...
btw,that was in suspend or while display was on?
Thats with display off. When using it the value is very variable depending on what you are doing. From ~120 to ~350 mA.
tzacapaca said:
u see?
this is what i'm talking about,u can't compare 3-7 mA to 150-200 mA..so i can't understand guys who said they have power usage same as on WM...
btw,that was in suspend or while display was on?
Click to expand...
Click to collapse
lol ok
i read somewhere that the sdcard was using 10 to 50mA max, i dont think it uses so much. maybe someone using HD2 with Haret (on sdcard) could lighten us?
which application are they using to get those values, and how to read those values if screen is off?
codiak said:
Thats with display off. When using it the value is very variable depending on what you are doing. From ~120 to ~350 mA.
Click to expand...
Click to collapse
ok,thanks
what about when with display on and doing nothing?
I used an SD build on my HD2 before using the NAND Rom. The values where nearly the same. So I dont think sdcard has a big impact on battery.
I use this App from the Market. It logs to a file and you can view the history
tzacapaca said:
what about when with display on and doing nothing?
Click to expand...
Click to collapse
Then its around 120 mA.
But remember, HD2 has a BIG display
I don`t know, maybe it will be usefull for developers. I tested CM6 r146 releace from derefas.
All night in sleep mode it takes 10-15% of accum. Then I use it for maybe 4-5 hours, and android said that charge is needed (it was near 15%). Putting on charge, don`t bring any result, I wait for half an hour, no persets where moving.
Then I reboot the device i n WinMo and it shows me 70%, after it i use winmo for 2 days without charging...
It seems to me that the problem is with indicator... in my situation there was a good accum, but android don`t see it...
P.S. Sorry, if i am talking silly things
If you have specific profiles in SetCPU and a set CPU frequency NSTools, is there anyway to keep the profiles working without having to disable set on boot for NSTools? NSTools seems to overtake CPU settings on boot.
Sent from my Nexus S 4G using Tapatalk 2
why do you even want use SetCPU ? it seems to be useless with NSTools because what ever it can do is to be done by NSTools , if you say you wanna do something like change frequency while screen off , then the governor will do it automatically if you choose appropriate CPU governor
Jamin13 said:
If you have specific profiles in SetCPU and a set CPU frequency NSTools, is there anyway to keep the profiles working without having to disable set on boot for NSTools? NSTools seems to overtake CPU settings on boot.
Sent from my Nexus S 4G using Tapatalk 2
Click to expand...
Click to collapse
CPU Profiles aren't worth it for day to day use. Constant ondemand is perfectly fine and won't steal any extra battery from you.
However, setting NSTools to set on boot should still allow SetCPU to work fine, as long as CPU settings are set the same on boot time. If not, use init.d scripts but remove CPU parameters from them (find them in /system/etc/init.d/xx-xxxxx), keeping the other settings as you prefer. Might want to remove NSTools after this though as it may undo your changes after opening again.
i guess setcpu makes it easier to change cpu frequencies quickly through the widget, ns tools doeesnt have a widget so its "harder"
qtwrk said:
why do you even want use SetCPU ? it seems to be useless with NSTools because what ever it can do is to be done by NSTools , if you say you wanna do something like change frequency while screen off , then the governor will do it automatically if you choose appropriate CPU governor
Click to expand...
Click to collapse
SetCPU won't control the Backlight Notifications and Dimmer.
Harbb said:
CPU Profiles aren't worth it for day to day use. Constant ondemand is perfectly fine and won't steal any extra battery from you.
However, setting NSTools to set on boot should still allow SetCPU to work fine, as long as CPU settings are set the same on boot time. If not, use init.d scripts but remove CPU parameters from them (find them in /system/etc/init.d/xx-xxxxx), keeping the other settings as you prefer. Might want to remove NSTools after this though as it may undo your changes after opening again.
Click to expand...
Click to collapse
I'm just a bit OCD about battery life some days. I'd rather use the app than making my own scripts. I kinda derped with the profiles earlier today. All is good now.
I wish the two would play better together too - and I don't see how "just don't use them both" or saying SetCPU is no longer needed is acceptable answers. Especially since many of us actually paid for SetCPU...
Now that it looks like we'll only get two governors in MathKids kernel (what a crock)... saying you are picking the wrong one is a bad answer too. Ondemand certainly isn't the best for battery life, and for those of us who have tested and measured battery life we know just picking one isn't a solution either.
So what is the actual answer? Because setting the governor parameters at boot isn't the problem. It's switching between profiles - and the governors that give you the best battery life and giving acceptable performance need to be tweaked from their defaults.
With OnDemand I'm looking at using over 16% battery per hour under 4.1, even with considerable screen off time. Not being able to set it to Wheatley on screen off is killing the battery.
I will say the problem seems to lay directly with SetCPU and I'm going to contact the dev and see what I can find out. I don't see why it should be changing the parameters back to default on profile change.
But people who use neither or just one probably just not comment. Not to flame, or fight, but it's not helpful to add nothing.
guys...my phone sometimes freezes on the lockscreen....and I have to pull out the battery...the problem is that this happens with all roms, sense or not based....
what's going on?!
You may get more help if you provide a little more info, ie:
-Are you using a specific 3rd party launcher with roms?
-Are you using a custom kernel, and if so what are your settings?
-Have you tried running in safe mode to rule out 3rd party apps?
-Did this problem begin after anything in particular you can think of?
-etc....
Maybe too low CPU values?
Undervolt can cause this as well.
It happened to me while using APEX on ARHD.
But indeed more info is needed.
this started a week ago...with miui official/faux kernel and now with aokp b38/tamcore kernel....I know tamcore kernel is undervolted, and don't know nothing about faux's one...
I use nova launcher, setcpu is set at 384/1188 and I have a profile screen-off at 192/432...
uh, forgot, I use SIO scheduler...I set it with no frills and uninstalled it after, to have just one cpu control app (setcpu)...
this morning my alarm didn't ring! then I had to pull out the battery because it was freezed...luckily I woke up by myself this morning XD
I recommend to use a higher off-screen value (384 MHz) as a first try. See how it reacts and also use an app to check the current voltage (like system tuner / st pro).
If this does not helps then start isolating apps.
I have NOOP sched and 384-432 Off-screen and had no issues far, but I remember that with 192 Mhz a while ago the screen did not wake up a few times (on ARHD 6.3.x).
I updated to b39, nothing now....if it freezes i'll try setting a higher minfreq...
thank you all! thx+1
Hello,
Mi 4i lags/slows down most of the time, when i check CPU-Z during that time, i can see that only the lower clocked 2/4 cpu cores run constantly at 800 Mhz. It is very difficult to use when it is so slow. Other 4/6 cores remain inactive.
Is there any solution for this weird behavior while running in Balanced mode. Even when switching to Performance mode, nothing changes. I believe due to the heat generated, the OS automatically underclocks the CPU. I have already rooted and tried changing the CPU Governor, Clock speed but it resets to default every time. Sometimes i am unable to change that too.
Thank you.
There's a configuration that does this, just try to use the provided tweaks available here and then configure the phone's cores and so manually.
http://en.miui.com/thread-140563-1-1.html
I tried tweaking the thermal config using the above thread. But still only four cores are active @ 800 Mhz. The phone is so lagging that it is not usable at most of the time. Unable to change governor in any CPU clocking app, turn on the other cores. If you can help me out, please let me know.
Thanks.
Hackerpunk1 said:
There's a configuration that does this, just try to use the provided tweaks available here and then configure the phone's cores and so manually.
Click to expand...
Click to collapse
Might be a bug. Try a clean install and see
Same here
I am having a similar issue, very frustrating. I tried Sensei kernel, but no luck
i don't know what do you mean bro
everytime i change to other rom,other kernel
the results is...
all core is on
vijayr2002 said:
Hello,
Mi 4i lags/slows down most of the time, when i check CPU-Z during that time, i can see that only the lower clocked 2/4 cpu cores run constantly at 800 Mhz. It is very difficult to use when it is so slow. Other 4/6 cores remain inactive.
Is there any solution for this weird behavior while running in Balanced mode. Even when switching to Performance mode, nothing changes. I believe due to the heat generated, the OS automatically underclocks the CPU. I have already rooted and tried changing the CPU Governor, Clock speed but it resets to default every time. Sometimes i am unable to change that too.
Thank you.
Click to expand...
Click to collapse
strange, i am using miuipro with sensei and havent found any problem.
This happens in the latest stable MIUI7 ROM. I think it is time to change to a custom rom.
I was looking for a similar threads but didn't find any. So the problem is that my phone gets warm after root, (also it has less free ram available) I am not doing anything special, just normal magisk installation + kernel sometimes. No matter how I set frequencies in kernel manager, device still gets warm during simple phone usage like messaging/web browsing etc. Am I doing something wrong or this is just side effect of rooting?
Fixed, heating and low ram was happening because of the wrong settings in kernel adiutor. I was setting max frequencies at 1590 and this was limiting big core frequencies also - they have 2150 MHz maximum. There is an app in play store https://play.google.com/store/apps/details?id=com.dsmartapps.root.kerneltweaker and it can help with that.