yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] Sam Nakamura:
After searching this thread I could find reports of the "not appearing kernel wakelocks" on nougat but no actual answer for it, nor does the OP gives information about this issue on nougat (from what I could see), after looking for quite a while I was hinted to this workaround to show the kernel wakelocks on nougat

original post

So I learned that having the option to monitor kernel wakelocks with BBS is possible on nougat by using a terminal emulator and the shown command lines (screenshot + linked post) which is a great thing, unfortunately it doesn't survive a reboot, so I wonder is there any chance of getting the ability to monitor mentioned wakelocks with BBS back by default or is this a limitation of nougat itself?
[BetterBatteryStats] Kaffeetrinker:
Those commands just mount the debug partition if it isn't already mounted.

/sys/kernel/debug should always be mounted. If it isn't, then it's the rom's fault.
[BetterBatteryStats] Sam Nakamura:
Is it? I confess, I have no idea but I'll pass it on to my favorite dev.. Thanks
[BetterBatteryStats] rapboy91:
I cant solve this heartbeat_alarm of play service,and cant understand why I have this wakelock,I did full wipe and instal one app for time for understand if is any app but nothing to do. I have always this high wakelock

Inviato dal mio ONEPLUS A3003 utilizzando Tapatalk
[BetterBatteryStats] DB126:
Heartbeat insures your device is capable of receiving high priority notifications during doze maintenance windows. Presence of this wakelock does NOT indicate the device was woken and/or kept awake. Receiver determines what actions (if any) are taken.
[BetterBatteryStats] Usama707:
Someone Please Analyze these wakelocks.

They are after a short standby time but i have exactly the same wakelocks overnight too and i lose 10% overnight without WIFI Or mobile data ON in standby. This started happening​ after nougat update it never happened on Marshmallow. Please Someone Help.
[BetterBatteryStats] Kaffeetrinker:
This BBS log is not appropriate for investigation.

It goes only for 2h30 and you have used your phone for almost 50 minutes during this time.
[BetterBatteryStats] Usama707:
Ok i will post a new one tomorrow with 7-8 hours standby. They only reason i posted this is because i get the same wakelocks in longer standby time too.
[BetterBatteryStats] rapboy91:
Yes but this wakelock is The only one that consumes battery and for this google play service is at the top of consumption.

Inviato dal mio ONEPLUS A3003 utilizzando Tapatalk
[BetterBatteryStats] gaich:
Heartbeat is the way our phone is connecting to Google servers, it is sent every 15 minutes (Wi-Fi) or 28 (3G), sending idle alarm and reconnecting to the service.

You won`t get rid of this withought killing Google GSM service on your phone.
[BetterBatteryStats] DB126:
Don't be dupped by the presence of a number. This wakelock (like so many others) does not contribute to significant drain and is more than offset by the functionality it provides.
[BetterBatteryStats] JuanVillagran:
In Marshmallow does BBS has to be on doze white list ?
[BetterBatteryStats] DB126:
I don't; works fine. Might have to add it if 'Active Monitoring' is enabled (off by default).
[BetterBatteryStats] fossils-n-dents:
This setup worked for me....I went from 3-8% per hour, to 0.3% per hour in the first 7.5 hours.

Greenify, Forcedoze (Whitelist Forcedoze, Ignore lockscreen timeout, zero doze delay, disable WiFi during sleep), put any app you don't really use on the block list. Better still to delete it.

PnP Thermals. (Optional, but recommended)

The guide by MeggaMortY (Google Play Services Wakelock Guide for OnePlus 3 on xda). This tamed Google Play Services for me.

Delete FB app, use browser instead.

Disable Location until you need it.

Turn off Wifi when you go outdoors. (I've done that since my rooted Evo 4g running Myn's Warm.)

Results may vary depending on your configuration. My BBS graph looks like a barcode, but my phone has minimal actual wakelock.

I have the HTC 10, ViperRom 10 version 5.9.0, rooted, S-off, running Nougat.

I hope this helps someone. Sorry if I'm off topic.
[BetterBatteryStats] DB126:
Excellent example of not being driven by raw stats. The number of alarms and wakelocks doesn't matter; determining which ones actually contribute to drain and/or unwanted wake time does. Your data also demonstrates limited screen-off wake time is not horrible, especially on newer hardware/SOCs which idle efficiently at lower frequencies. Many devices do a good job limiting WiFi drain when there is no connection; I have stopped toggling​ the radios on my G4 and have not observed a meaningful impact on battery life (with a few exceptions). Obviously hardware, kernel and situation dependent. I will happily give up 3-5% per 24 hours to have everything available on demand vs tuning stuff on/off (even with automation can be a PiTA).
[BetterBatteryStats] fossils-n-dents:
Thank You Davey126! For me, the main offender was Google Play Services. It has too much background activity, far too much data collection, and the ability to phone home no matter what state your phone is in. It behaves like cpu intensive spyware. (Like Windows 10 updates and telemetry)

By denying Google Play Services certain services (Such as 'Keep Awake While Device is Sleeping'), I save cpu usage, Android System works less, thus saving my battery drain overall. PnP Thermals uses the Little Cores for idle (Sleep) at 307mhz, saving more battery, Greenify will hibernate selected apps before sleep...Then Forcedoze comes in and keeps the other monsters at bay as best it can.

This is all theoretical. No logcats and such, just trial, error, and xda forum searches.

But, after rom switching, kernel swapping, cache clearing, safe mode app testing, forum searching, and different 'Doze' apps, this solution dramatically reduced my battery drain, while maintaining full functionality of my device.

As stated in my previous post, my BBS graph looks quite frightful, but we both agree those SO wakeups have minimal impact on the battery. Finding those offending apps/ processes are for another day, for now I stand down. Thank You Again for your input.

I include my normal standby time, as I never leave my device untouched for 19 hours at a time.
[BetterBatteryStats] DB126:
Brief thoughts:

- Allowing cores to soft idle at a slightly higher frequency can sometimes be beneficial as newer processors often don't have to ramp the voltage to achieve higher frequencies. Jobs complete quicker which can consume less overall power. I do not have direct experience with a Snapdragon 820 or the SOC in your device so don't know if that generality applies. In most cases the manufacturer gets the min speed right; think twice about under clocking.

- Disabling Fire Base Analytics in Google Play Services goes a long way to taming unruly behavior without introducing side effects. Simply disable the service then use a tool like MyAndroidApps Xposed (MM and below) from re-enabling. Play Services then sleeps nicely with your phone waking on occasion to perform useful tasks that reduce the flurry of activity and associated lags that can occur on wakeup after a prolonged period of 'sleep' (eg: overnight).

- Not sure ForceDoze offers an additional benefit over native Doze and Greenify on Nougat assuming you have made the later a system app. Be interested in your direct experience on this one. There is no real benefit on Android 6 but Greenify utilizes Xposed on that platform.
[BetterBatteryStats] Mesmurized:
Is this only on N? Can't find it on MM?
[BetterBatteryStats] DB126:
It's available in MM and can actually benefit from the use of MyAndroidTools Xposed to keep Play Services from periodically reenabling the service (my previous post referenced this module for Nougat which obviously wouldn't work today).
[BetterBatteryStats] Mesmurized:
Can Fire Base Analytics be disabled only with MyAndroidTools and Xposed installed? Not keen on installing two new items to tame it.
[BetterBatteryStats] DB126:
Any tool that can disable individual components within Google Play Services will work for the initial block. You'll also need a tool to periodically reapply that block as it is auto-enabked on reboot and likely other events. Google really does not want folks turning that off.
[BetterBatteryStats] Mesmurized:
Encouraging ... How about a little more hand-holding please.

Can't find head-nor-tails of Fire Base Analytics with SDMaid, Greenify, or AppOps (5X PN MM). Thought I had all the necessary tools installed, guess not ?!?!

Solution here: https://xdaforums.com/oneplus-3/how-to/guide-stop-google-play-services-t3549760

Note: MyAndroidTools is highly recommended. SDMaid does not exposed the mentioned broadcast receivers
[BetterBatteryStats] fossils-n-dents:
With the 307mhz idle, I experience no lag, freeze, ect. I am well aware of sending my device into a coma. Been there. I'm using an Interactive profile which scales from 307-2150mhz. When the device wakes, it's ready, responsive, and awaiting user input. If the device bricks, I report it as lost, as it is insured. No worries, lesson learned.

I've disabled Firebase Anyltics, and followed the instructions from the following link;

https://xdaforums.com/oneplus-3/how-to/guide-stop-google-play-services-t3549760

^Good stuff in the absence of Xposed/ Amplify for Nougat. That thread cured my heavy battery drain massively.

Greenify is not installed as a system app on my device, apk. I chose Forcedoze because of the options; 'Zero Doze Delay When Screen is Turned Off', 'Override Lockscreen Delay', and the Block List. The Forcedoze Block List helps me when Greenify will not fully hibernate certain apps during doze. For me, one compliments the other. Native doze kicks in far too late, Greenify Aggressive Doze mode was not aggressive enough for my tastes, but Forcedoze knocks my phone out very quickly in my experience.

You guys do incredible work here, I love it!

P.S. Is there any point to me posting a logcat without Amplify or Xposed for Nougat?
[BetterBatteryStats] DB126:
Thanks for sharing. These things often boil down to personal preference. I go with a few tools as possible (preferably stock) and let hard data drive actions/choices. I found the few min wait before entering doze does not contribute to increased battery drain in any meaningful way. I might give up 1-2% over 24 hours (if that). Not enough to warrent introducing another tool to my portfillo. Again, personal preference.

p.s. Idle drain rate is typically under 0.2% per hour (6+ hours per percent lost), although that can easily double when in motion with location services enabled. WiFi and LTE always on unless traveling in a known poor reception area.

---------- Post added at 03:44 AM ---------- Previous post was at 03:28 AM ----------

Yeah - that's a bit of an overkill for the limited focus of my suggestion. Use MyAndroidTools to stop PackageManagementService. I lean toward 80/20 (preferably 95/5) solutions. Doesn't win any 'extreme' awards but yields top 20% with minimal effort and no side effects. YMMV.
[BetterBatteryStats] Mesmurized:
Oops... Didn't realize a less extreme solution exists. While waiting for you I found this one. Assumed it was what you were talking about. Hope following it doesn't cause other problems.

Guess I went off the extreme end :)
[BetterBatteryStats] beren:
since i updated my nexus 6p to android 7.1.2 and switched to magisk supersu, bbs can't show alarms...

how to fix? i tried to install bbs as system app but doesn't help.
[BetterBatteryStats] masteruniverse:
Battery Drain what is that
[BetterBatteryStats] DB126:
First several posts in this thread contain a wealth of information and links to self-help documents published by the developer. Good chance a solution (or clues to resolution) can be found there.
[BetterBatteryStats] mondohow:
Read here: https://xdaforums.com/showpost.php?p=15869868&postcount=1

Pay special attention to the section: If you need help
[BetterBatteryStats] beren:
actually i did, but couldn't find any useful hint...

btw had some time to try and find out that the problem is the magisk root, as going back to supersu BBS started to work as expected. (hope this can help someone)
[BetterBatteryStats] Kzyw:
Hi guys

It is correct?
[BetterBatteryStats] TNSMANI:
LoL!

He was boasting about successfully controlling his drain!
[BetterBatteryStats] kmem:
Can anyone help me solve this sensor which wakes the device under lineageOS?

Thanks in advance!
[BetterBatteryStats] kmem:
A little more data.
[BetterBatteryStats] mondohow:
Really? Didn't realize that's what's considered success but I guess you told me :good:
[BetterBatteryStats] Bobthahog:
I am on Sprint Galaxy note 5 running 7.0 and BBS does not show any stats for Doze idling mode time. All it shows is Doze interactive time.

Sent from my Sprint Note 5 running 7.0
[BetterBatteryStats] streamck:
Hi chamonix! I found small bug in your app ;). Look at these screenshots.
[BetterBatteryStats] githyanki:
Do you have a theme installed? Those screens look fine on my phone.
[BetterBatteryStats] phonetech101:
Switch selinux to permissive ?
[BetterBatteryStats] Dreamgun:
Absolutely amazing app! Might be my favorite app on my phone now. Thank you very much for creating and sharing this! Using xda edition for now but will definitely be buying from the playstore.
[BetterBatteryStats] dr.wtf:
If I do this:

adb -d shell pm grant com.asksven.betterbatterystats_xdaedition android.permission.BATTERY_STATS

does it allow me to use all the same features as if I was rooted? The first page is not quite clear about that.
[BetterBatteryStats] :
Yes
[BetterBatteryStats] jackyaway:
Who can help me to analyze this log? My phone lose 10% in standby in 5 hours. Thank you. http://cloud.tapatalk.com/s/58fb009b50b0d/BetterBatteryStats-2017-04-22_085901873.txt

http://cloud.tapatalk.com/s/58fb00ac3bc4c/dmesg-2017-04-22_085950291.txt

http://cloud.tapatalk.com/s/58fb009e8b9f8/logcat-2017-04-22_085950211.txt

Inviato dal mio ONEPLUS A3003 utilizzando Tapatalk
[BetterBatteryStats] githyanki:
Something is wrong with your log, all items say 7 min 12 sec.

Please clear app data on bbs and make a new log.
[BetterBatteryStats] MrMagicPotato:
So I've got a big problem. My phone (a xiaomi redmi note 3 pro, also called Kenzo), despite being of August 2016 and having a massive 4050mAh battery combined with a special 650, discharges very rapidly because of Google play services that sometimes are managing to consume even 4 times more than the screen itself. Now I've noticed that if the phone is in offline or with the data connection is switched off the battery usage decreases a lot, but when the 3g (or 4g or even 2g) the battery drops like crazy, preventing me to get the 10h sot that I would usually get on wifi and without cellular network active.

After a lot of research, I've stated that this happens on every single rom and every single kernel combination, but not on the stock xiaomi's rom (which battery life is **** compared to the custom ROMs one). Where is this problem coming from?

I think that it is due to the fast dormancy or maybe to my bad cellular provider network optimization.

Or maybe some bad wakelocks that I haven't still found.

In conclusion, the ampere app shows a 120 mA drain when using only WiFi (at minimum brightness) but a full 520 mA when cellular network is on! I mean! What the hell is going on with my beloved device! :eek:

Is there a way to disable fast dormancy on a xiaomi device?

If anybody is available to able, please give me a hand, or maybe two would be better:o! :rolleyes:

Thanks in advance​!
[BetterBatteryStats] Callliope:
Any idee what can i do to those alarms? Every god damn program has it...even my evernote widget...

P.S i greenified gmaps
[BetterBatteryStats] DB126:
Since the problem occurs on every custom ROM that you tried it suggests stock ROM includes a modem driver/component to properly control radio power levels that isn't replicated in those ROMs. You'll do better asking in your device forum.
[BetterBatteryStats] phonetech101:
Ditch play services ?
[BetterBatteryStats] Callliope:
I have installed the google apps pico versio...if i ditch the play services i wont get notifications, or i am wrong?
[BetterBatteryStats] phonetech101:
Notifications for what?
[BetterBatteryStats] Callliope:
Google play services manages all the notifications, any idee what gp services are good to not get *alarms wakelock at every app?

Or how i should proceed to get rid of them?
[BetterBatteryStats] phonetech101:
My rom has alarm blocker inbuilt, u could try "myandroidtools" this is what my blocker looks like
[BetterBatteryStats] Callliope:
My rom has too, but i dont know what to block, should i block *alarm?
[BetterBatteryStats] phonetech101:
Use better battery stats to find what alarm to block
[BetterBatteryStats] DB126:
Most alarms and wakelocks are *not* evil. They are the mechanisms Android uses to perform useful (and generally desired) actions on your device. That said, alarms/wakelocks can be indicators that something is wrong, especially when they occur in large numbers -and- block/delay sleep. Dumping Google Play Services is both impractical and ill advised for the vast majority of the Android community.

So - what specific issues are you facing? Or is it just the raw numbers BBS exposes that are bothersome?
[BetterBatteryStats] Callliope:
I have high held awake time în gsam
[BetterBatteryStats] DB126:
That reveals nothing. True, device was supposedly 'held awake' for 70+ min with zero reported power loss. Both figures are suspect. Need to dig deeper to identify what apps/services are keeping device awake. If you are playing a game, watching a video or installing apps you generally don't want the device falling asleep.

This is also a BBS thread. If your question/concern is not about that tool (or info the tool reports) it should be posted elsewhere.
[BetterBatteryStats] m0han:
if you haven't been to this thread lately, try the latest test build. several peope are reporting > 8 hrs sot on stock kernel.
[BetterBatteryStats] justjr:
Hi, I don't know if it's this rom I'm using, but why almost all wakelocks have the same time? And what up with all this *job* and *odex* wake locks?

Dump and logcat:

http://cloud.tapatalk.com/s/58ff36c6d571b/logcat-2017-04-25_074021969.txt

http://cloud.tapatalk.com/s/58ff36d511bcc/BetterBatteryStats-2017-04-25_074021436.txt

Enviado de meu MotoG3 (AOSPExtended 4.1) usando Tapatalk
[BetterBatteryStats] ivy.lally:
Please review this BetterBatteryStat log:

http://cloud.tapatalk.com/s/58fe238297f6c/BetterBatteryStats-2017-04-24_175926287.txt

It is weird:

===============
Kernel Wakelocks !!! wakeup_sources !!!
================
PMS^15496^BBS_WAKELOCK_WHILE_SAVING_REF (): 3 h 11 m 53 s Cnt:(c/wc/ec)0/0/0 100.0%
PowerManagerService.WakeLocks (): 1 m 35 s Cnt:(c/wc/ec)60/0/0 0.8%
radio-interface (): 7 s Cnt:(c/wc/ec)31/0/0 0.1%

What does it mean, BetterBatteryStat prevents DeepSleep??

It happens sometimes, let's say once every 6 runs.

Aqua-M4 E2303, modded MarshMallow, SkyMelon kernel
[BetterBatteryStats] relax24:
Can someone please take a look at my log please. I know it's only 0.5% per hr at the moment, however, this is significantly more than it used to be. Also I struggle to get 4hours SOT on the s7 Edge, when i used to get about 7.

I've noticed one of the sensors "Samsung significant motion" sensor is constantly awake. What the hell is that?

Here's a link to my batterystats dump https://files.fm/u/rvkrs27e#_
[BetterBatteryStats] DB126:
Was this device upgraded from Marshmallow and if so, how was that done? There is a reported issue with S7s that were manually updated to Nougat vs allowing it to occur via OTA. Elevated imsservice wakelocks, dramatically reduced SoT, CPU spikes and lake of WiFi video calling match some of the symptoms you are reporting and evidenced in the log. I wouldn't worry too much about the sensor activity until it can be correlated to wake time. No evidence that is happening but something to keep in mind.
[BetterBatteryStats] relax24:
This was happening on MM too towards the end. I was thinking maybe the battery is just old, but then again the phone is only 1 year old.

I did a clean wipe including internal, and then flashed the rom. Noone else on the rom is experiencing the same issue so I have no idea what it is. The phone used to sleep at 0.2% ph, and get great sot's. I could understand if it was an app, but it doesn't seem that way. VoLTE got activated by my network provider but it's always Android System as my second biggest hog behind Screen, sometimes it's even top.
[BetterBatteryStats] DB126:
You'll want to do some further research on this device and the experiences of others who updated to Nougat. Likely a mising/bad binary in the ROM zip that is not allowing the device to properly interface with various apps or hardware components. Have seen this before where the kernel gets updated during an 'official' OTA update but not with a manual install. Good luck.
[BetterBatteryStats] xman099:
How to tell from BBB log whether the mobile signal strength affects battery life? Which section or part should I check in the log file?

The LTE signal level is not very good in my area, I am trying to compare LTE vs 3G standby. My phone has dual-sim. I also want to check how ?% would save if I only enable one sim card.

Need help to design my experiment. Thanks a lot.
[BetterBatteryStats] DB126:
I don't know of a direct method of measuring radio power consumption in BBS; it's more by inference. I can say with high confidence that radio (WiFi, mobile) power levels adjust in inverse proportion to signal strength with finite steps between lowest and highest levels. Number of steps and power consumption difference between steps is largely hardware dependent.
[BetterBatteryStats] fajarlazuarding:
Hi, anyone can help me reading this ? Graph stated my device wake all the time. WiFi on. Overnight about 9h losing battery like;18%. What's causing it ?
[BetterBatteryStats] relax24:
The stats show your phone was in deep sleep for 83.9% of the time. Probably should be higher, but nothing too alarming. Perhaps it's crappy network reception?
[BetterBatteryStats] woodman:
I'm not an expert but:

> Screen ON time is 26 minutes.

First off, try to provide a correct "idle dump". It means: charge to 100%, disconnect from charger, and let the device rest for at least 6 hours. Screen On Time has to be less than one minute.

> WiFi On is 8h56

WiFi is considered set to ON. Maybe WiFi is ON or it's OFF with WIFI scanning ON?

Please read HERE and HERE.
[BetterBatteryStats] fajarlazuarding:
Hi thanks for your responses.

For the crappy network reception, yes it is. But when WiFi is off, the drain isn't that much. Is it possible when WiFi is on battery drain is higher ?

My WiFi scanning is already off. As I stated before, my WiFi is on at the moment, could it be the culprit?

Maybe I'll try to provide a correct idle dump.
[BetterBatteryStats] githyanki:
Yes it can be higher with wifi on. I had to deal with a noisy network at work for the longest time. Network noise would not let my phone sleep at all and I could lose 5%/hr easy. Your network may have some noisy items on it?
[BetterBatteryStats] Oswald Boelcke:
It might be really wise to provide a correctly taken idle dump.

And did you try to assign your device a fixed IP within your (home) network, or are you always using DHCP?
[BetterBatteryStats] dimm0k:
has there been any progress towards determining why the kernel wakelocks on LG are missing? it's appears for me "randomly" where it'll show after a reboot, but the next few reboots it won't. not sure what causes it to work properly and what causes it to stop working, but when it works it works until I reboot. not sure what else to provide that others haven't already provided. let me know if there's anything I can do!