yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] jeremysherriff:
Your kernel drivers still are not perfect, one of the drivers did not unload properly (could have been either gps, or wifi, or even camera/bluetooth) and kept the phone awake trying to unload.

This is a common problem in unofficial ICS ROM's, you should post this question in the Q&A thread for your ROM to confirm that others have the same experience, and then submit a bug report to the development team.

---------- Post added at 09:44 PM ---------- Previous post was at 09:43 PM ----------

Can't get to either the attachment (xda problem) or the dropbox link (says I need to be logged in). Sorry.
[BetterBatteryStats] Tungstwenty:
Obtaining detailed stacktraces from log

Hi all,

Does anyone know if it's possible to activate any logging mechanism (in specific kernels perhaps?) that would not only generate the info that BBB consumes to provide its outputs, but also the stack traces - including not only native but also dalvik methods - of all wakelock aquires and releases?

I would be looking for outputs similar to the ones obtained by java's crash files, or jstack generated, etc.

On checking my partial WLs I get for instance about 10m on AudioOut_1 ("nnnn" pid?), 9m on MAIL_SERVICE (com.android.exchange.Exchange Services), NetworkLocationLocator, etc.

While there are a couple of threads mentioning bugs in the WLs of Exchange, workarounds for the audio, etc., it would be great to obtain pointers to all the aquire/release locations in order to better identify the spots in the code responsible for the non-sleep state, rather than analyzing static java/smali code and theorizing about the possible culprit, or lots of code modifications to print logs in every single place.

Maybe this is more of a question for kernel writers, but I'm guessing the best place to raise it is here...

PS: I've checked logcat and only sporadic messages appear, but not with the stack. dmesg or kmsg could yeld additional information perhaps, altough I doubt the stacktrace would be included.

---------- Post added at 12:35 PM ---------- Previous post was at 12:12 PM ----------

I just came up with one possibility for this:

By using the Xposed framework, it should be possible to wrap around the appropriate PowerManager or Wakelock aquire* + release* methods to dump the information to log or file, and raise a dummy exception to have its stack trace filled in order to know the origin, along with writing the WL name, flags, PID, etc. It would only work for non-kernel WLs but nevertheless should be a big help.

Anyone already familiar with Xposed and/or knows what the best place would be to put the wrappers on? I'll try to experiment a bit with this when I have some time.
[BetterBatteryStats] McDastardly:
Here's an idle dump. I can live with this if my phone were to always run like this :)
[BetterBatteryStats] nam3less:
See, your idle dump shows VERY GOOD stats. Then your usage dump did not. :p

In that idle dump, for 1 wakeup, you have woot keeping your phone awake for 4 minutes:

WootCheck NotificationService (org.gtmedia.woot.Woot Check): 4 m 36 s (276 s) Count:1 1.0%

Other than that, everything else looks great. :)

The only thing I can suggest, as in my previous post, is to actually close apps when you get done using them. Push the back button until you get to the home screen (or force close them manually) rather than use the home button. See what that does for your wakelocks.

There isn't anything actually keeping your phone awake for any significant amount of time. It seems to happen during usage that something keeps your phone awake. That's why i'm suggesting the backing out of apps.
[BetterBatteryStats] Tungstwenty:
Sorry, just realized not everyone is using BBS on the same device (Xposed framework is posted in the SGS2 section) :o

Still, for the part on which are the best methods to intercept in order to log the stack traces, any info is appreciated.
[BetterBatteryStats] riskaa:
This is the first time I'm posting to this thread, but I have been using Better Battery Stats for a while. Thank you so much for this app, Chamonix.

I'm on a Samsung Vibrant, with ICS Passion 13.1 Rom, KISS kernel V. 6

My battery life is on average about 10 hours with what i would call medium use. It's never been much better than that. When i first installed BetterBatteryStats, i figured out very quickly that location services were causing wakelocks, so i unchecked all of those options.

Now it seems that K9 email is the main culprit, but I'd like someone to take a look at my stats to see what else is going on.

I unplugged the phone at 8.30am today, and now at 12.10, it's at 46%.

Here's my dump file:

https://dl-web.dropbox.com/get/Public/Android/BetterBatteryStats-2012-04-09_120244445.txt?w=8fd018b9

Thank you very much[/QUOTE]

Here's the dump file attached. Thanks![/QUOTE]

]

[/COLOR]

Can't get to either the attachment (xda problem) or the dropbox link (says I need to be logged in). Sorry.[/QUOTE]

Ok, trying again. attaching an rtf file. hopefully this will work.
[BetterBatteryStats] chamonix:
Please check superuser and make sure the rights are granted for the command 'dumpsys alarm'. If it's the case then you may be missing a proper reference. To rule this out please try the Raw alarms and post a logcat if that fails too
[BetterBatteryStats] chamonix:
Here's the dump file attached. Thanks![/QUOTE]

]

[/COLOR]

Can't get to either the attachment (xda problem) or the dropbox link (says I need to be logged in). Sorry.[/QUOTE]

Ok, trying again. attaching an rtf file. hopefully this will work.[/QUOTE]

The main cause for awake is svnet (network traffic). Judging by the alarm's and partial wakelocks I would say k9 mail is the cause. To reduce that you may try:

- limit the folders synced and avoid eg draft

- try if poll works better that push in your case ( it does in my case as I spend a lot of time in a train moving pretty fast so the overhead of reconnection with push is higher as establishing a connection every hour)

Once you have fixed that please repost a new reading as there is more potential from what I see
[BetterBatteryStats] chamonix:
To what was said I'd just add that 44 alarms from Tasker and 21 from Facebook is too high for my taste in 7 minutes. Do you use any location based features with Tasker?

When it comes to fb: the stock app is bad and can not be made better. Alternatives are tweetdeck (limited), the webapp or friendcaster
[BetterBatteryStats] riskaa:
colors on display

[QUOTE/]

The main cause for awake is svnet (network traffic). Judging by the alarm's and partial wakelocks I would say k9 mail is the cause. To reduce that you may try:

- limit the folders synced and avoid eg draft

- try if poll works better that push in your case ( it does in my case as I spend a lot of time in a train moving pretty fast so the overhead of reconnection with push is higher as establishing a connection every hour)

Once you have fixed that please repost a new reading as there is more potential from what I see[/QUOTE]

Chamonix,

thank you. I moved my drafts folders to 2nd class, and im trying Poll (every 10 minutes), to see what that does.

I have a question about your app. when you look at the display (e.g "awake"), sometimes the line is in blue, and sometimes in red. What do those colors mean?

Thanks,

Bindiya
[BetterBatteryStats] chamonix:
The only two colored stats should be "processes". The reason is that there are two kind of times to be reported there: user CPU time and system CPU time.
[BetterBatteryStats] chamonix:
Release 1.8RC1

Guess what guys?

it is time for testing! 1.8RC1 is out (see post #2). As always it will stay RC for a while for you to test and send me feedback. I will do as many RCs as required before releasing final.

Please keep in mind that this is a test version, you may find bugs ;)

Note for the experimental features: the values for signal strength are all listed from none to very good, the data connection is only reported when "gone" (there are many other but I felt they are not interesting). The values may seem illogical, especially when running wifi but I was in the train today with highly variable quality and got results that seemed to be logical.

Happy testing!!!!!!!!!!!
[BetterBatteryStats] :
zOMG, widgets! You're a God.

After not observing a single wakelock problem in months, I'm back to poring over my battery stats. Seems I've been getting a wlan_ctrl_wake wakelock since kernel upgrade to 3.0.27
[BetterBatteryStats] chamonix:
Note on the widgets

A little explanation on the widget (will be copied to first post upon release).

There are two widgets:

- 2 x 2 for experts, showing the main indicators with times and bars to put things in persepective

- 1 x 1 for power-users: left bar shows "deep sleep" (green) vs. "awake" (yellow). The battery breaks down the "awake" part into "screen on" (black) and "screen off but awake" (obviously in red).

Tap causes (only) a refresh. I'm looking forward to your suggestions for the behaviour you'd like to have (will be user definable, but I'll handle that in 1.9)

I hope you like those.

Alpha as well as stat type for the widgets can be set separately (prefs).
[BetterBatteryStats] chamonix:
I just imagined you fumbling to unfreeze facebook and whatever bloatware you have in order to see the pretty colors :D
[BetterBatteryStats] :
I keep getting "there was an error parsing the package" when trying to install the apk. Tried a couple of DL's.
[BetterBatteryStats] chamonix:
4th upload / install of the download went through.... sorry for that!
[BetterBatteryStats] chamonix:
That wakelock of yours is weird. Google gives me results in fredericofranco's repo but the indexed file can not be found (404). Anyone from the kernel guys looking into it?
[BetterBatteryStats] :
I got lost on that link as well, this was the only useful one of the handful of results. I'm not able to decipher what any of it means however:

https://github.com/renaudallard/gnexus_kernel/commit/beb473e87e0096af6e126c7a110ab5dcfface924
[BetterBatteryStats] McDastardly:
I usually back out of the apps like you suggest. With all of the changes done hopefully now the phone actually sleeps like it's supposed to. Thanks for all of your help!
[BetterBatteryStats] chamonix:
It's too big for me but it reads like this wakelock would occur when wifi is turned on/off what seems to be a good thing. Now it is also related to timeout situations so I guess if those occur often the wakelock would become visible too. Unless there is a bug and something goes wrong and the wakelock is being help for too long.

Aynthing in your dmesg related to that?
[BetterBatteryStats] chamonix:
The wakelock suggests a service running and the action of forcing the activity to be removed would not affect the service
[BetterBatteryStats] :
I'm testing a different kernel right now; I'll take a look later today and see if the problem persists and then I'll flash the 3.0.27 kernel back on and take a closer look.
[BetterBatteryStats] McDastardly:
I have one location task for Tasker, but it's disabled. Thanks for the recommendation of FriendCaster!!! Much better then the Facebook app!
[BetterBatteryStats] suku_patel_22:
Biggest update after kernel wake locks. I had kept a 2x2 space free for your widget :-)

Everything looks fine thus far.

However a few observations.

1. The 2x2 widget has empty space, either make it 2x1 or add additional info to the widget. Screenshot attached

2. The height off graph bars is not set as default, better to set it as 4 or 8 as default values

3. Toast notification on dump file creation complete is missing

Well key you know of future observations
[BetterBatteryStats] mariotme:
I am having the same wakelock as your m8. And I find it sucking my battery faster than the older kernel.

Mind me asking which kernel you trying out?
[BetterBatteryStats] sp8y:
Nice one chamonix I am testing now.

One thing I've noticed so far is that the "tap to refresh the widget" only works after opening up the BBS app & then it only works one time meaning you have to open BBS again.

It may take me some time to understand the new stats in "others" & what they mean for me & there seems to be quite a bit of info going on in there what with deep sleep, signal stats etc.

Keep up the good work :D

*edit - after using the widget I really like the info it gives :)

** edit - the kernel wakelock info actually does refresh upon a tap even without having to re-open the BBS app.
[BetterBatteryStats] :
Presently Trinity stable, so far so good, the real test will be when connected to my home router. I'll compare the specs of my office router to my home router to see what differences lead to wakelocks at home, and not at the office. I've tried changing my GHz frequency preference, but it had no effect.

http://www.derkernel.com/ics-tuna.html
[BetterBatteryStats] Karpfenhai:
Well done Sven! I love the widgets!

Just two things, tapping the widget should open the application.

Background transparency should be adjustable or set to 100%.

2x1 widget without graphs as additional option would be nice.

Keep up your great work!

Swyped from my GT-I9100 using XDA App.
[BetterBatteryStats] sp8y:
Open the BBS app then > menu > preferences > widget settings (bottom of the list) the opacity can be set for each widget :)

---------- Post added at 08:15 PM ---------- Previous post was at 08:06 PM ----------

Hi chamonix,

Can't remember if it's all ready been suggested or if it's even possible to do but a "user defined" menu would be nice whereby the user can pick what stats show up for example the user may want to show just awake, screen on & maybe deep sleep - or maybe the current stats in "others" could have a tick box again each one in the settings to determine whether they show or not.

Probably a lot of work I guess.

Thanks again.
[BetterBatteryStats] gaui:
I'm wondering, under Kernel Wakelocks deleted_wake_locks takes 10%

Can someone explain what that is?
[BetterBatteryStats] nam3less:
Maybe a menu option to enable the opening of the app from the widget? That way if users want to just have it refresh they can. If they want it to refresh and open the app, they can.
[BetterBatteryStats] Karpfenhai:
Thx for the hint, but opacity is not what i meant, i mean the background transparency, not the "general" brightness..

Why manual refresh? Widgets are only refreshing when they are visible (current screen) so a refresh interval between 5sec and 2 min would fit all users expectations? I personally don't want to tap my widgets, i want them up to date if i reach the screen they are located on, just my opinion.

Tapping the widget saves the space used by the main app :-)

Swyped from my GT-I9100 using XDA App.
[BetterBatteryStats] chamonix:
Thank you very much for the feedback guys!

I have created issues for the feature requests and bugs starting on #121 (https://github.com/asksven/BetterBatteryStats/issues/121) and will start fixing a few for 1.8RC2 coming soon
[BetterBatteryStats] suku_patel_22:
Found a few more bugs, well post with screenshots when I am back of office home tonight

Swyped from my HTC Desire S
[BetterBatteryStats] jeremysherriff:
The bottom part of the 2x2 widget is some graph bars, difficult to see though.

@chamonix, some suggestions:

add a "refresh" hotspot on each widget, and then have the remainder of each widget open up the main app.

Not sure if anyone else is having this, but I have the opaque settings different on each widget, but both appear the same. It's like the small widget is using the big widget's setting.

I find the graph bars on the 2x2 widget very difficult to see, not tall enough. There is no reason these bars should not touch (or come very very close together). Although, I don't know if the bars add value - they simply repeat the text. They could be replaced by a similar graphic to the small widget (then people would chose one or the other, not both) perhaps in a horizontal orientation instead of vertical to make it fit.

Mock-up pic attached.
[BetterBatteryStats] suku_patel_22:
The bars are invisible for my eyes :-)

Swyped from my HTC Desire S
[BetterBatteryStats] jeremysherriff:
Widgets appear to not update unless the main app is in memory, once it has gone out of the process cache the widgets won't update.

I'm guessing here @chamonix, but I think you have stayed away from auto-updating on the widgets so that they themselves do not cause wake-ups?
[BetterBatteryStats] sp8y:
OK this app has been a great help to me to keep track of what my device is doing I thought it was overdue that I lend some support so have bought the market version.

Great work :)
[BetterBatteryStats] Rallerbabz:
2nd try to squeeze out more battery

Alright, I've let my phone alone a whole night to get a more precise result and to find the battery drainers.

I've attached screens again and the BetterBatteryStats log.

I'd really appreciate some feedback about how to actually read the BetterBatteryStats. What does the bar with the blue/red color means? And what does "Sys (0 s) Us: (0 s) Starts: 0" means?

And what about Count?

Would love to know this :D

Oh, and what is RILJ? :P

Once again, Thanks XDA!
[BetterBatteryStats] Neejay:
this is crazy...email drain appears to be excessive...
[BetterBatteryStats] nam3less:
Do you have Sleep as Android installed? It appears as though it's causing most of your wakelocks:

Sleep (com.urbandroid.sleep.Sleep): 15 m 13 s (913 s) Count:1 3,6%

Try disabling it and using your regular alarm clock and see if that goes away. Do the same thing (idle over night) but just wake up with your alarm clock rather than Sleep as Android.

I couldn't actually find the sleep.Sleep process in my Googling. I have a suspicion that it is related to snoozing rather than dismissing the alarm. But I couldn't find it in the developer API as it's under construction. Maybe emailing the dev or posting on their forum could shed more light:

https://sites.google.com/site/sleepasandroid/developer-api

_________________________________________________________________

Idle dumps are more useful than usage dumps over a day.

You have found the initial cause. Now it's time to go through your settings. Change your email to pull at an interval (say, every 30 minutes) rather than push. Remove any accounts you don't actually use or make their pull time longer than your mail accounts (an hour, for example). Make sure your wifi is set to sleep when the screen is off as well.

Post another (idle) file when you have changed your email settings.
[BetterBatteryStats] Neejay:
That was idle while I was sleep last night lol. From about 12:30-5:30, then minimal usage (alarm, one phone call) from 5:30-8:00 (which was about the time of the dump). Thanks, I'll edit the sync time/usage.
[BetterBatteryStats] Danwms:
Excellent thread and app.
[BetterBatteryStats] suku_patel_22:
Few issues

1) No data connection and no unknown signal both are 100%

Some logs for the data strength i suppose.

04-11 20:40:43.468: I/TAG(5584): getWifiOnTime with params 48177000 and 0 returned 6957930000
04-11 20:40:43.468: I/TAG(5584): getGlobalWifiRunningTime with params 48177000 and 0 returned 6957566000
04-11 20:40:43.498: I/TAG(5584): getPhoneDataConnectionTime with params 0, 48177000and 0 returned 54645283000
04-11 20:40:43.498: I/TAG(5584): getPhoneSignalStrengthTime with params 0, 48177000and 0 returned 54645283000
04-11 20:40:43.498: I/TAG(5584): getPhoneSignalStrengthTime with params 1, 48177000and 0 returned 0
04-11 20:40:43.498: I/TAG(5584): getPhoneSignalStrengthTime with params 2, 48177000and 0 returned 0
04-11 20:40:43.498: I/TAG(5584): getPhoneSignalStrengthTime with params 3, 48177000and 0 returned 698686000
04-11 20:40:43.498: I/TAG(5584): getPhoneSignalStrengthTime with params 4, 48177000and 0 returned 0

2) Screen On is 2.9% but graph is at 100% (could not reproduce, guess can be ignored)

3) As mentioned earlier, the widget doesnt show correct data when the app i snot in memory. It shows the data of "since unplugged" by default in such cases, whereas the heading still reads "since custom ref". It is easy to reproduce.

Set widget type as custom ref ( after setting a custom ref)

Refresh the widget to show data of custom ref

Go to app manager nad kill the BBS cached process

Refresh the widget ( data from "Since unplugged is shown)

Start BBS, hit back to exit app

Refresh widget, data from custom ref is shown

Screenshots below

4) Kern Wl should be Kern WL, its a bit confusing

5) Its better to show BBS in the widget ( more consice in my opinoion)

6) Very difficult to see the graphs,

7) Have we done away with the service for the custom reference, guess that could be used to refresh the widget.

8) We could have the to half of the widget to refresh it and the bottom half to open the settings
[BetterBatteryStats] osm0sis:
Big issue with the new bars on my GSM GNex, Stock ICS 4.0.4. Not sure what's up but they display (even after closing and opening the app multiple times) until the first time I go into the Preferences. I don't even need to change a setting; I just enter and exit the Preferences dialog, do anything to refresh the list, then they disappear. Clearing data and cache shows them again but I can continually reproduce the issue by entering Preferences again.

Thanks for all the hard work! Your app has already helped me improve my battery life by leading me to turn off Touch Sounds, improving the AudioOut_1 partial wakelock percentage. New version showing deep sleep is excellent. Loving it!

Edit: On an unrelated note, is there any way to figure out why AlarmManager would have a count of like 8000+ without rooting my phone?
[BetterBatteryStats] riskaa:
Hi Chamonix,

Ok...here we go again. I changed my K9 settings to poll instead of push, and now that's not showing up as a power consuming app anymore.

However, I unplugged my phone this morning at about 6.30, and by 10.55, i was down to 27%.

here are a few screenshots from System Panel, Baddass Battery, and the file dump from Battery Stats. From what I can tell, any.do app is consuming a lot of power. I went into the app, but there is no way of controlling how often it syncs with google tasks, and so i am happy to uninstall the app and find a replacement. But Android System...is really giving me grief. Help please!

http://dl.dropbox.com/u/8231578/BetterBatteryStats-2012-04-11_105506583.txt

I've attached the dump file as a text file below too. hope it all works.

Thank you so much,
[BetterBatteryStats] chamonix:
The drain is still pretty high but there is no reason to give up, you are on the right track. The problem is that your phone is not in a lab environment and conditions like network coverage have a big influence. The good news is that bbs sees all that stuff.

The dump shows two main things, one is that the coverage was bad during the reading (I see some gprs stall alarms) and the other thing is that SyncLoopWakeLock is killing your battery by obsessing about syncing one of your accounts. This situation can not be explained alone by the bad coverage but is rather a sign for a poorly designed sync provider reaction negatively on an unavailable or overloaded cloud service. Unfortunately I can't name it so you may need to check all the accounts you have and maybe turn them off one by one to find the bad one.

A few other things to look into:

- the number of alarms from zenclock (I guess it's a widget) is suspect: widget should use rtc_alarms and not wake up your phone (the reading shows 500+ alarms so I guess something is wrong here)

- the number of k9 wakelock suggests about a poll per minute and that is far too high. If this does not apply those wakelocks may be related to the bad coverage but I don't think so as I have frequent poor coverage situation without that count

- beside k9 the reading shows gmail activity. Is there a reason for having both k9 and gmail. Gmail will always do push