-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Power consumption while idling #154
Comments
I have a feeling it is higher than SFOS based on AOSP9, but I am not sure yet. Will look into whether I can make suspend stay for longer. |
thanks, it's not a top priority issue, rather than a optisatiom one. i do not know how much is an aosp-10 issue or sfos tunning. |
It may run hand-in-hand with framerates being slow. Maybe I need to look into CPU/GPU governors and see if all can be improved. |
cat /proc/cpuinfo is almost identical to xa2, the only difference is the features lines that has more capabilities. i found tgat surprising as the two devices have different cpus |
Looks like suspend stats are OK. At least offline/wlan only are very decent. With SIM card working, most of the wakeups coming from Will continue looking. |
i can run some tests, what's the best way ti monitor activity? e.g. airplane mide, wifi only, cellular |
No, not yet. let me check few things first |
One observation, it seems that consumption while idling sometimes is really low and some other times it's draining fast. |
available governors and frequencies for cpubw using ssh connection
|
Yes, already checked most of them. Not all of them work for us, some lead to crash even. cpufreq governors are the one that is used to setup CPU frequencies and initialized in /vendor/etc/init/init.tama.pwr.rc . Although, some of the init sequence fails in SFOS and AOSP10 as well (error messages in dmasg). Will have to check it out:
Right now working on idea of switching off power-hungry CPUs and keeping only low-power CPUs available while screen is off. |
i thought checking the settings in the oem android, but required root access which i do not have. how android can achieve those power savings? |
Re Android power savings: I don't know, unfortunately. |
Out of the failures above, only target_load exists and fails. The rest of the API is missing, maybe updated with 4.14 kernel. |
i csm flash it bavk to android if we can get tge info from there but i have the feeling the oem 'aosp' is very different to what we have? |
stock != aosp android. as far as I know, even kernel versions are different. |
I know, for XZ3 with OEM Android 10, version 52.1.A.3.137 and kernel version 4.9.186-perf+ |
While I am looking into how AOSP or Stock regulates consumption (some techniques don't work for us, such as app freezing), try to run attached script that will hotplug big core CPUs depending on your screen state. It will switch off the power-hungry CPUs while screen is off and will turn them on when you turn on the screen. To run, install dependencies
In terminal on phone, start
Keep the terminal running that script for a while and see whether it improves the battery consumption. To judge cpufreq governors, I will have to fix collectd CPU frequency plugin first. It seems to ignore hotplugging of CPUs and shows some odd data (frequencies that are not expected to be there at all). |
Thanks, it's running now but will take some time to observe any difference. Is there any command line tool that displays battery level? I used to have an awk script that was grabbing that info but I forgot the command ;-( |
Yes, it will take some time. I should improve that script a bit further - looks like it resets Re battery: |
OK, looks like Linux kernel itself when calculating CPU frequency distribution doesn't take into account whether CPU is switched off or not. Not much I can do on collectd side of things and would have to use caution while interpreting the data. |
14h now battery percentage drop 18% (64 -> 46) with little use. the script might have crashed as it shows half a line print and no updates. collecting data ideally should not add to the load, tgat can be tricky on highly tuned systems. then the other option we have is to collect data over longer periods. i am wondering if tgere is a way to create a techical load, tgen at least by observing consumption we get more accurate measurements. |
For CPUfreq scaling, Stock is using
For GPU bw:
Few observations: gpu is frequently on 0 frequency if you don't use and scroll much. According to trans_stat, when active, frequencies 762 and 1144 are used. Probably others kick in at some other cases. 0 is not shown in stats, but is shown as current frequency in trans_stat as well. For CPU bw:
|
@pagism - try to press few |
Additional comment regarding stock - it doesn't use any CPU hotplugging, same as AOSP, I think. But Android workloads could be different from ours |
I've ctr-c and restarted the script, seems to respond ok now. Hopefully does not require reboot(?). Interesting, available frequencies in for GPU in xz3 do not go to 0, while in the stock one go:
the CPU frequencies are identical, available governors have some small differences too, and cpu stats look different:
and for gpu:
N.B. current notes were taken via an ssh connection, and the script running in a terminal, screen was off. |
When switching to
Example of a crash:
|
hm, not very informative to me unfortunately, can we get any help from xda community? or they are mainly now into aosp-11? makes me wondering how Jolla got relatively good quality aosp |
They may use the same interactive governor as we do. I don't think this is altered from the one set by AOSP. All in all, we are not too bad off. I will
|
my general feeling is very similar, is that issue at the aosp layer or further higher in the stack? should we run some tests running the aosp only? |
Woah, hitting 6mA on idle on AOSP, that is great figure. If I understand it right, this is not the case with SFOS even with 4.9, correct? I am seeing ~22mA as average (never below 16) when only mobile network is on to accept calls. Running 4.9 on SFOS 4.0.1, Apollo. Would it be possible to disable some sensors (like pressure sensor) and test if those are consuming power even when not in use? Like, disable from an even lower level than the OS itself? |
I presume this is in flight mode. In flight mode on AOSP9-based SFOS I am quite sure we can get very low in this case. @lal883: How do you measure power consumption? I let collectd do it's work for some time and take an average for few hours. Maybe should repeat that test on AOSP9 SFOS - would have to reflash then... |
I run a script to record the current consumption to a file at 1 min intervals. It doesn't record when the phone is sleeping though, as I understand. Collected data looks like this I can do the collectd test and report back too. Will also check flight mode. |
Good point regarding not recording at sleep. In this respect, drop in battery % is probably most reliable. Just requires longer measurement. |
is it reasonable to expect a newer release of the aosp blobs? the current release is from dec 2020 |
I suspect that no, looks like AOSP10 is sunset and development shifted to AOSP11. I will test whether legacy GPU driver will work and maybe check out if there is something else out there. |
Legacy MSM driver was no go - it has not been updated in the kernel to newer interface and we cannot use it. One more option out of the window! |
maybe we have to use aosp11 blobs, but that then will have to port SFOS... or wait until xperia 10 iii is ported. let's be realistic, I can live with GPU glitches, the increased power consumption is just about bearable I would say? the rest of the stuff and apps are working ok, and the camera is ok-ish, at least it does not crash. is there any expectation that we might get an improved driver in the near future? |
I don't expect we will get newer AOSP10 driver, I am quite sure it is as good as it is. As there have been no updates for AOSP10, that's all we can expect. And probably now we need to realize that the current state of AOSP10 would not improve much and discuss the options. I will probably open a new thread at FSO to make visible for all users. |
For reference, on AOSP9 based SFOS port
|
interesting, almost 4 times higher consumption in flight mode. but no difference with the sim enabled. my usage has also on the wifi. what tool do you use to collect the data? |
Battery state could be different in different devices (my apollo vs my akari). So, as mentioned, I have to check with AOSP10 on Apollo as well. I use collectd/SystemDataScope (obviously, as I ported collectd and wrote SDS), but probably something else can be used. Just measurements take time ... |
thanks, it's important to use the same tools, i was a bit hesitant running collectd not knowning its overhead. |
It should be minimal. But you could just record % on the paper as well :) PS: collectd on SFOS by default makes a snapshot only once in few minutes |
Observed the usage on Apollo, SFOS 4.0.1, Kernel 4.9, overnight. Had 4G network connected but not internet. ` Energy consumption (1:13 to 2:15) = 25731 uAh 02:29 - 16 % | 265436 uAh | 3 hr 26 min | 21 mA Energy consumption (2:15 to 3:16) = 25503 uAh 03:51 - 15 % | 231519 uAh | 3 hr 13 min | 22 mA Energy consumption (3:16 to 4:19) = 28019 uAh 04:35 - 15 % | 210962 uAh | 3 hr 13 min | 21 mA Energy consumption (4:19 to 5:3) = 17947 uAh 05:29 - 15 % | 188796 uAh | 3 hr 13 min | 21 mA Energy consumption (5:3 to 6:18) = 30875 uAh 06:36 - 14 % | 161465 uAh | 3 hr 1 min | 22 mA Energy consumption (6:18 to 7:9) = 21395 uAh |
I'll have to run the same test on my Apollo with AOSP10/aarch64 - then we can compare by battery %. Would have to see where I can get uAh data - any quick pointers? |
@rinigus I was using the value recorded in "/sys/class/power_supply/battery/charge_counter" Attaching the script that I use. Not very great, does the purpose, I believe. Records to a file "batterylog" in the same directory as the script. |
Thanks! |
on xz3, aosp10, zgovernor enabled, using collectd, in flight mode, user in deep sleeping mode too: battery 29uA on average, min 25uA over 4h period. |
@pagism : what about battery %/h? feeling what it was before? as uA are probably picked up during resume moments |
@rinigus observing the battery % graph consumption is 1%/h |
csv is maybe possible, but not trivial. easiest is to choose time window and then just calculate %/h from min/max values |
Update after testing Apollo AOSP9 and AOSP10. This is an update from earlier message where I had to compare to Akari in one condition. Turned out that Akari and Apollo data are touch different, but difference is not major: On AOSP9 based SFOS port
So, when used with SIM, the difference was not that massive. Here, AOSP10 was using zgovernor, not used in AOSP9 |
The figures are not that bad, there is massive difference in flight mode, but practically the use of that mode is minimal so not an real issue. The result with SIM card in is more interesting, that's 30% higher, however in practice that impact might not be that significant if we take into account normal use of the phone with active connections and screen on where consumption is a lot higher and will have more impact on battery. So let's try to use the device regularly, under normal conditions and revisit the issue. |
Agreed, such testing is pretty much what we do these days |
Tested without network, just SIM, on AOSP10 and without zgovernor - so no CPU on/off switching. Result was 1%/h on Apollo, so marginally better than with zgovernor. Will have to test on Akari and see if with normal usage zgovernor actually helps at all. But that is rather difficult to compare, though. Update: now looking on the latest stats, I am getting 1.33-1.5%/h without zgovernor Update 2: over 12 h, 1.17%/h I guess more testing is needed with and without |
I am going to test zgovernor changing GPU settings only. Got a phone responding in a bit choppy manner today and I suspect it is due to shifting most of its work to slow CPUs. Let's see whether it will hit the power consumption - I hope not much. |
I do not have exact figures, power consumption compared to OEM Sony Android-10 feels considerably higher. It might be comparable to the previous aosp-9 port, and I know it will be difficult to trace it, besides it might originate down to aosp-10 layers.
The text was updated successfully, but these errors were encountered: