yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] TNSMANI:
Thanks for the link.

As far as I can see, nothing in the dump justifies the huge drain, that too on airplane mode. You could have switched off Location/Location Scanning also.

To eliminate software issues, flash the full ROM after wiping system, data, Dalvik and cache (OTAs sometimes produce weird effects). If things don't improve, I am afraid that your battery is the culprit.

There is a later version of BBS (beta) available on the Play Store.
[BetterBatteryStats] DB126:
I didn't bother with the dump as reported symptoms strongly suggest a hardware or battery issue. Get it serviced (better yet exchanged) under warranty, if possible.
[BetterBatteryStats] Prasad98:
Overnight battery drain

Hey guys,

A new user of BBS here. Wanted some help to diagnose my overnight battery drain (which is around 12-15%)

Can't figure out what's really draining the battery :confused:
[BetterBatteryStats] TNSMANI:
This dump is not useful since it is not as per OP of this thread. The screen on time is nearly 4 minutes. It should be as less as possible, definitely less than a minute.

Please take another dump and post it here.
[BetterBatteryStats] DB126:
Although dump is not to spec it is pretty clear (assuming data is accurate) that either the battery is shot, a hardware sensor is 'stuck'/misbehaving or there is a kernel compatibility issue. No smoking guns at the Android level.
[BetterBatteryStats] Prasad98:
Oh..sorry.. didn't read the original post completely. Will follow now and post another dump. Thanks!

Yeah man...that could be a possibility because the phone is ~5 year old now! (Bought the OP2 when it was launched in 2015... Still runs smoothly...just the battery life is terrible *Snapdragon 810*)

Could be a kernel issue as well... Because I think when I was recently on the stock OOS marshmallow build, the overnight drain was not as horrible as it has been recently (used to drain ~5% overnight vs 12-15% now)

But still gives me a SOT of around 4.5-5hrs and lasts 15hrs or sometimes even 24hrs

Don't know... that's why I am investigating using BBS ?
[BetterBatteryStats] Prasad98:
New dump

Hey.. I got a new dump from last night...
[BetterBatteryStats] TNSMANI:
Location/scanning seems to be on. Do you require it while sleeping?

Calendar had 12 wakeups. Restrict if possible.

Significant Motion Detector sensor was awake for more than 5 hrs. Do you have any DT2W or other gestures on?

Other than these, every thing seems normal. The suspects are kernel and battery, as DB126 said. You can see if flashing OOS helps even now (as you said that drain was better on OOS earlier). If not, it is a definite issue of battery. Five years is too long.
[BetterBatteryStats] Prasad98:
Hey, firstly, thanks for helping me out!

- No, I don't keep location(gps, scanning) on. It's always off as you can see in the attached ss.

- Will restrict Calendar as you say. Btw.. I have the Google Calendar installed but the sync is off for the same.

- Yes, I've been using the DT2W ever since I bought the phone and the off-screen gestures are on for flashlight (Draw V for flashlight). Should I disable those?

- Will revert to OOS and check as well. And yeah, even I guess it's the battery wear as 5 yrs is indeed a long time! But the phone was worth every penny I guess...never had a phone that lasted me so long...built like a tank! Might as well consider a battery change (if I'm luck to find a OP2 battery in stock at the service centre..lol) once the lockdown gets over.

Again, thanks for the help.
[BetterBatteryStats] lucfig:
Hi, do anyone knows of there is an app to visualize, sort and filter the dump from bbs?

Would be great if bbs could import back that dumps and display in the same interface we see the live data.

Regards
[BetterBatteryStats] AC130PL:
Hi, what's "PowerManager.SuspendLockout" responsible for?
[BetterBatteryStats] DB126:
There is not.

---------- Post added at 11:50 AM ---------- Previous post was at 11:42 AM ----------

Does it drain or otherwise adversely impact some aspect of the overall UX? If not disregard and move on with life. One of the many thousands of alarms, processes, services, etc that Android uses to manage itself. Exposing munita in BBS suggests they are problematic which is rarely the case unless rocking Lollipop or below on a device that still sports vacume tubes.
[BetterBatteryStats] AC130PL:
It's keeping little cores at max frequency when screen on, even without any usage
[BetterBatteryStats] DB126:
How do you know this? Not trying to be difficult, just looking for a definitive correlation.

Maintaining a high frequency on little cores during 'screen on' operations may be by design to retain device responsiveness and reduce loading on the main cores. Generally small cores are very power efficient; the behavior you are observing may not have much impact on overall battery longevity.
[BetterBatteryStats] AC130PL:
You were right- there's no correlation ? flashed Miui and the wakelock is still here, but CPU frequency works as it should be
[BetterBatteryStats] DiamondJohn:
I used to have a Moto X (2013) that explicitly had two tiny little CPU's that would run 24/7, so as to enable google voice activation, while the phone was asleep/doze.
[BetterBatteryStats] Neodrox:
Hey guys new user here, been optimising my s10+ exynos but I feel that I am loosing too much battery during the night and feel like the phone does not go properly to deep sleep but rather light sleep, I was tracking the before with cpu spy and also with gsam. Cpu SPY says it goes to deep sleep but not fully, gsam says it only goes to doze or light sleep, I will be tracking today and overnight to see what happens, also I have restricted almost all apps and system apps from data usage and background activity. Will be posting the dump file whenever I have it available, thanks
[BetterBatteryStats] lucfig:
Can anyone take a look at my dump? Losing more than 2% per hour...

Wakelocks seems reasonable but battery is being drained quickly.

View attachment BetterBatteryStats-2020-05-15_091607394.txt.zip

Enviado de meu HD1903 usando o Tapatalk
[BetterBatteryStats] TNSMANI:
The dump is not for the stipulated 6+ hrs. However, the following are the issues:

Mobile signal is not constant, sometimes goes down, causing drain. Try to locate the phone where the signal is better.

Wifi seems to have an issue dropping sometimes. Restart the modem and see if the issue is resolved. If not, disconnect any other devices, especially like printers, from the wifi.

BT/scanning seems to be on. Switch off when not required, especially during sleep.

App Widgets were causing wakelocks. Try to reduce the number of widgets or their wakeups.

Location/scanning seems to be on and that drains a lot. Do you require it during sleep?

WhatsApp, Tasker, Timely etc also caused a number of alarms.

WhatsApp 8 MB, Gmail 5 MB etc had background downloads.

Significant Motion Detector sensor, Pickup, Pocket etc were running for long periods. Disable Gestures and Pickup and Pocket options.

You seem to have a lot of apps. Most of them are running in the background and causing downloads also. Try to reduce their number to the barest minimum.

May be a factory rest may also help.
[BetterBatteryStats] Neodrox:
Hey guys, first off I must say I do not have the complete dump file as per instructions as I was testing with the battery yesterday. I charged my phone until 28% and let it untouched for about 9h (Data off, airplane mode on, Bluetooth on, Sync on) and I lost about 1.5% with the phone not doing much, even connected to my watch the phone is not constantly tracking sleep. I have seen that the phone does not go fully to deep sleep, it goes around 82%, I have tested with different apps to see and some give me very confusing results, CPU SPY says it goes to deep sleep, GSAM battery says it goes to deep sleep, but put is as light doze sleep and not deep sleep. So I am rather confused, I have restricted 95% of apps and systems apps from background data and also background activity.

Can someone please take a look and help me with this issue, I with a phone completely on deep sleep I should not be loosing 1.5% battery per hour It should be more around 1% or 0.8% I have a Samsung Galaxy s10+ Exynos Variant.

Also I will be posting 2 dump files

1-Unplugged/Screen Off

2-Unplugged/Screen On

Thank you so much guy really appreciate it.
[BetterBatteryStats] DB126:
Both dumps appear identical despite having different names. Neither are useful for idle analysis due to too much 'screen on' time (48 min). That said, device appears to be operating normally given configuration and app portfolio. Expect higher drain rates when connected to external devices that expect regular data exchange (eg: 'smart' watch). There are a fair number of active apps although impossible to tell if they were in that state while the device was inactive due to dump characteristics. Idle drain rates exceeding 1% per hour are expected/normal on devices that are kept busy keeping track of the outside world when not being used. Battery apps such as BBS and GSAM are somewhat unreliable on Android 10 due to restrictions imposed by Google. Especially on unrooted devices. My advice: turn off what you don't need and enjoy your device for what it is. Does everything need to sync real time 7x24? Charger is never far away, especially at night. Expernal battery packs (keep is small; don't need a bulky 20000 mAh monster) are inexpensive on-th-go option relative to overall device cost. Good luck.
[BetterBatteryStats] DiamondJohn:
Your CPU sleeping is not the same as Doze.
[BetterBatteryStats] kenta09:
Would someone help me understand what is keeping my phone awake? That's the second dump I take, the first one got a lot app wake locks witch I disabled. Now I got even worst deep sleep but can't find on the dump any reason. Any help is appreciated
[BetterBatteryStats] DB126:
Whelp, it ain't app related. Device is not entering Doze properly with copious screen-off activity. Looks like that pup went through two major OS upgrades; likely one of them (presumably the last to Android 10) yielded corruption at the kernel level. When did the problem start?
[BetterBatteryStats] kenta09:
Thanks for your attention. I actually just performed a data format and installed lastest OOS availible couple days ago, trying to get better battery life (Didn't used BBS to see what was causing before, I'm using now since the battery drain still pretty fast)

The most strange part, is that I took another dump right after uninstalling the wakelock apps, and all looked good (I'm attaching this one here), the dump I attched on my previous post was taken today, because I noticed that the battery drain was back.

Edit: Obs. I changed absolutely nothing between this two dumps.
[BetterBatteryStats] Prasad98:
Overnight Battery drain reduced ?

Hey [MENTION=5656100]TNSMANI[/MENTION] ,

2nd last page, you helped me with my post (a 5yr old OP2) we were suspecting a bad battery... I guess that is not the case. Because I switched to official LOS 16 from that ROM(AEX) and my idle drain has reduced now.... I guess this Battery can hold on for more... :fingers-crossed:
[BetterBatteryStats] DB126:
LOS packages often contain an imbedded kernel; guessing that was the elixir. Many AEX builds are not well optimized for the target device yielding higher drain rates that don't always manifest at the operating system level (read BBS).
[BetterBatteryStats] kenta09:
Hey guys still urging for any kind of help here.

Tryed to flash an alternative kernel, got a little better but still 20% awake. Attached the dump.

Flashed latest OOS again and got about 30% awake. Getting crazy here trying to find out a solution with no luck.

Anybody have any suggestion? If not of what is causing this, at least something I could try? Would do a data format again in intention to fix this make any sense or I shouldn't waste this time?

Any setting I can optimize on kernel auditor? Really running out of ideias here.

Thanks in advance.
[BetterBatteryStats] DiamondJohn:
For someone running out of ideas, other ways to investigate & understand battery drain

1. Battery Historian: https://xdaforums.com/showthread.php?p=77731268#post77731268

2. TeMeFI (my app;), Doze and battery history/drain): https://xdaforums.com/showpost.php?p=82136035&postcount=37010
[BetterBatteryStats] lucfig:
Thank you! I will try to grab a report with 6+ hours.

Yes, I am aware, not much I can do. I will disable the 2nd sim card this night for testing.

I will turn off WiFi during this night.

I will.

I have just one clock/date KWGT widget. There is also the oneplus weather running. I search a way to disable it or at least change the update frequency.

Also will turn off.

I will turn off data and WiFi during sleep. Hope that helps. Will try to tweak Tasker in order to reduce wakes during night.

I believe that doze is the one detecting these, am I wrong? Will check if there is any other setting.

Yes, I do. Is Greenify, 3C toolbox Crystalize or another app still recommended to make apps sleep? I want to try fixing drain without uninstalling many apps.

Will be my last option.

Thanks again for your time. I will get a better report this week, hopefully tonight.

---------- Post added at 07:57 PM ---------- Previous post was at 07:46 PM ----------

Just to complement your post about Battery Historian. You can generate the report in the device itself, just open developer options and click bug report.

After the report is done and clicking the notification, we can share to wherever we want (I use Join to send to my PC).

And also thanks for your app. Getting used to it, j just used the Doze and battery graphs.
[BetterBatteryStats] DiamondJohn:
And just to extend your post, you can actually generate the report via the TeMeFI app, which of course runs on your device.;)

Also, don't look past the other reports, such as Currently Running>Battery>Battery Stat Summaries>*
[BetterBatteryStats] TNSMANI:
Please note that turning off wifi or wifi and data are likely to increase the drain. Those apps which require either of them will continue to attempt to connect, increasing the drain. Also mobile data will drain more than wifi.

What you can do is, turn off the wifi modem and restart it after about 10 seconds and disconnect any other devices (especially printers) connecting to the same wifi. Do it atleast for the duration of the test.

Take the fresh dump after making the changes.

At present, ie on Android 9 and 10, no one will recommend running Greenify etc. But seeing that you need to have a lot of apps, may be something like SDmaid (needs root) can help in disabling boot for those apps which do not require that option. Also it can be used for freezing apps and stopping other unneeded services of these apps from running. But don't touch the System ones, unless you know what you are doing.
[BetterBatteryStats] DB126:
F

Rebuild from scratch, full flush, stock everything. If the problem persists you have a hardware problem. If not tweak one thing at a time until the culprit is identified. Troubleshooting 101.
[BetterBatteryStats] kenta09:
Did it yesterday. MSMDownload, got everything back to stock, clean latest version availible, all updates throught offical OTA. Awake time got even worse.

Followed DiamondJohn suggestion, found something weird on wake reasons:

On the left side I was at a friends house, on the right side on mine. Found out that my network was spamming copious broadcast traffic, and that was waking up my device.

So in the end, nothing device related, thanks for the attention of you all. Didn't know Battery Historian, thanks for the suggestion, the tool is amazing.

The solution, in case anyone is experiencing the same: The broadcast came from the IPTV service my ISP provides throught their router. I have another router for my WiFi and it was connected on a LAN-to-LAN cascade. The simple solution was changing this to LAN-to-WAN, so the broadcast don't reach the wifi router subnet.

If I may ask one more thing, is there anyway to restrict app access to sensors? On last BBS dump there is something that bothers me:

" (com.facebook.katana.Facebook): Sensor: BMI160_ACCELEROMETER Accelerometer Wakeup(10), wakeup=true, Time: 0 s

Sensor: BMI160_ACCELEROMETER Accelerometer Non-wakeup(11), wakeup=false, Time: 0 s

Sensor: pedometer Wakeup(15), wakeup=true, Time: 0 s

Sensor: pedometer Non-wakeup(16), wakeup=false, Time: 0 s

Sensor: sns_geomag_rv Wakeup(17), wakeup=true, Time: 0 s

Sensor: sns_geomag_rv Non-wakeup(18), wakeup=false, Time: 0 s

Sensor: ak0991x Magnetometer Wakeup(26), wakeup=true, Time: 0 s

Sensor: ak0991x Magnetometer Non-wakeup(27), wakeup=false, Time: 0 s

Sensor: TMD3725_Light Ambient Light Sensor Wakeup(36), wakeup=true, Time: 0 s

Sensor: TMD3725_Light Ambient Light Sensor Non-wakeup(37), wakeup=false, Time: 0 s

Sensor: BMI160_GYROSCOPE Gyroscope Wakeup(38), wakeup=true, Time: 0 s

Sensor: BMI160_GYROSCOPE Gyroscope Non-wakeup(39), wakeup=false, Time: 0 s

Sensor: TMD3725_Proximity Proximity Sensor Wakeup(45), wakeup=true, Time: 0 s

Sensor: TMD3725_Proximity Proximity Sensor Non-wakeup(46), wakeup=false, Time: 0 s"

The app is already on optimize on battery settings and still using the sensors on background. Anything I can do to stop this?

Thanks!!
[BetterBatteryStats] lucfig:
Hi, and thanks again.

I did lots of changes, most of them with the 3c Toolbox app:

Crystallized several apps so they are not able to run while screen is off (similar to greenify).

Uninstalled a couple of apps.

With Tasker I created a sleep profile that:

Disables all data (wifi/mobile) - this was against your advise. :p

Disable location services

Turn on battery save mode

Disable all other non important profiles. Just kept enabled the one for alarm clock and disable sleep mode.

Kills all background apps when entering sleep mode

Other settings:

Removed Google feed from the left side of home screen.

Removed ambient display turn on if device is picked up.

Disable several google settings and notifications, such as instant apps, play store protection (not very useful anyway), personalized ads, etc.

During this night I lost only 0.4% per hour. This is the best result I ever had with this device.

I did a BBS dump, but I already uninstalled it because my next test would be with it off. But when I uninstalled, it also deleted the dump...

But I have a couple of battery historian screenshots to demonstrate.
[BetterBatteryStats] amn1987:
I can't seem to find a way to distinguish between active and idle drain.

In Light theme the text colour is not dark enough causing low contrast. Could the text colour be Black instead of Light Gray?

Also the app UI could follow the System Theme.

The big cores aren't shown under CPU Stats. This issue is present in more than one device of mine.
[BetterBatteryStats] TNSMANI:
[MENTION=843244]lucfig[/MENTION]

The set up is as per individual's liking. If you don't want data while asleep, whether mobile or wifi, that is perfectly alright but some can't live without it.

Happy to note that the actions taken have ended in a satisfactory manner. :highfive:
[BetterBatteryStats] lucfig:
Yes, I'm aware that most people prefer to have a connection always on.

Tonight I tested leaving WiFi on. Everything else is the same. Still have good (low) drain, just a little higher but still under 1%. View attachment BetterBatteryStats-2020-05-22_083319432.txt

Enviado de meu HD1903 usando o Tapatalk
[BetterBatteryStats] TNSMANI:
Now Tasker is setting off alarms. And Location/scanning. I have not seen so many Location related alarms in all my 6 yrs on XDA.

Anyway, if you are happy with the setup (drain is only 0.6% per hr), leave it and enjoy the device.
[BetterBatteryStats] lucfig:
I will stick with the profile that turned off everything, including WiFi. That one gave me 0,31 drain during the night and 1% half an hour before wake, as I run a couple of tasks.

Overall 4% drain per hour.

But how do you know tasker is asking for location? It should not as all location related profiles are off. And actually location services in Android system is set to off, the only thing on is WiFi.

Regards

Enviado de meu HD1903 usando o Tapatalk
[BetterBatteryStats] TNSMANI:
I am not saying that Tasker is setting off Location alarms. But Location alarms are very high in the dump. If Location is off, what about Scanning in Settings>Location? There is something which triggers Location.
[BetterBatteryStats] lucfig:
It is also off.

I see lots of location alarms in the format below, but they are all equal to zero:

com.google.android.gms.location.fused.SEND_LOCATION_IN_STATIONARY_MODE_ALARM_ALARM_XXX

All of them under Google services. I don't know if this is the normal behavior but I don't think they'll are impacting battery since the number of questions is 0.

Enviado de meu HD1903 usando o Tapatalk
[BetterBatteryStats] DB126:
Wakelocks in the absence of subsequent (presumably undesirable) actions are not evil. Good chance Google, at the request of some other application, is asking for location but can't get it due to device config. Rinse and repeat. Maintaining network connectivity typically resolves that behavior (if you care; ask yourself why...) and probably won't increase battery consumption in any meaningful manner.
[BetterBatteryStats] lucfig:
That makes sense. Right now I have no idea what is causing that behavior. The location settings does not show any app different than the ones I expected.

But it is not causing much overnight drain. During the day is a different story as Google play services is consuming almost as much battery as the display.

Enviado de meu HD1903 usando o Tapatalk
[BetterBatteryStats] DiamondJohn:
let me prefix the following with the caveat its all random unproven and untested thoughts, based on thinly veiled info made to look like actual knowledge. So prefix everything statement below with "possibly" or "maybe", and post fix it with "I dont know"

In regards to location, one unidentifiable source of location search/attainment not allocated to a specific app is a part of doze. In the config of doze there are two parameters that relate to location.

1. locating_to = LOCATING_TIMEOUT which is the max time it waits to get a location before allowing the phone to enter idle modes.

2. location_accuracy = LOCATION_ACCURACY which is the accuracy of the location before it is accepted as a valid location before allowing the phone to enter an idle mode.

I have edited my doze parameters such that the timeout is minimal and the location accuracy is very rough.

As for the playstore being a culprit,I have not done it myself, but I have seen code that removes googles vending from the whitelist (I am guessing for doze and/or battery optimisation).

sed -i '/<allow-in-power-save package="com.google.android.gms"/d' /system/etc/sysconfig/google.xml
sed -i '/<allow-in-data-usage-save package="com.google.android.gms"/d' /system/etc/sysconfig/google.xml
sed -i '/<allow-unthrottled-location package="com.google.android.gms"/d' /system/etc/sysconfig/google.xml

EDIT:Just read my post after posting, and I notice there is a location related item in the code above
[BetterBatteryStats] lucfig:
Thanks, I don't think it is Doze as my settings are similar to yours, quick and rough location.

Honestly I don't mind the location alarms during the night as my battery drainage is at 0.6% per hour, which is acceptable. And BBS is a great tool for analyzing that during the night.

My issue now is the drainage during the day and screen on. Google play services shouldn't be draining as much as the display.

How do you guys analyze that? Do you recommend another app or another form of analyzing BBS?

Enviado de meu HD1903 usando o Tapatalk
[BetterBatteryStats] DB126:
Yeah, it could - or more. Depends on services apps are requesting. Need location? GPS handles that. Notifications? Good chance GPS is involved. Physically active device? Yep, you guessed it - GPS is aware and paying attention. And getting the blame.
[BetterBatteryStats] artisticwizard:
Removed