yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] chamonix:
Very interesting, thanks for taking the time to summarize your observations. I will try to reproduce these but it would help me if you could do some more tests to refine:

- I noticed your phone was booted last 17 days ago. Do the problems you have found occur straight away or only after a longer time (time is no excuse, I'm just trying to see what I need to do to reproduce)

- are there similar discrepancies with "since unplugged" or it this specific to "since screen off"?
[BetterBatteryStats] chamonix:
I have planned an optional active monitoring and have added your request to that feature: https://github.com/asksven/BetterBatteryStats/issues/223
[BetterBatteryStats] RovG:
I use My Battery Drain Analyser from Play store to do this.
[BetterBatteryStats] chamonix:
Release 1.11RC7

New RC is up, fixing a slight inconsistency in the UI regarding to expand/collapse of permissions. See Post #2 for the changelog.

I have started the preparations for a release and am updating the doc to reflect the new features. Planned rollout is on coming friday
[BetterBatteryStats] chamonix:
the batteryinfo Service (BatteryStatsImpl) knows about the time awake, the time with screen on and the time in call: http://grepcode.com/file/repository...com/android/internal/os/BatteryStatsImpl.java

and my understanding is as well, that awake and in call overlap (looking at the code both have different source).

How to detect if the proximity sensor is the reason for the screen to go off:

- try accessing mFlags from PowerManager using reflection

- access the sensors and request proximity

- check for in call (that's how I do it in BetterWifiOnOff)

TelephonyManager telephony = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
if ((telephony.getCallState() == TelephonyManager.CALL_STATE_OFFHOOK)
|| (telephony.getCallState() == TelephonyManager.CALL_STATE_RINGING))

But this would require re-writing the BatteryStatsImpl: I could handle this in BBS but there is no added value in that as long as I can't pass this info to the place processing the history data (or did I miss something obvious?)
[BetterBatteryStats] chamonix:
I would call that "awake for no reason" and substract "phone on" to make it more accurate. In fact that's one of the options to calculate the percentages. That is the concept I try to convey with the 1x1 widget: https://github.com/asksven/BetterBa...tterBatteryStats/graphics/Doc_SmallWidget.png
[BetterBatteryStats] Lebenita:
Yes on both counts. I've just rebooted, and "Since unplugged" shows the same anomalies (see Unplugged and Screen off dumps attached). No less than two partial wakelocks are way longer than the entire wake time, and cpu state counts add up to more than the total time (same deep sleep time, but 6% more wake time than in Other).

Since the partial wakelocks are patently implausible (SyncManagerHandleSyncAlarm 30.0%, AlarmManager 23.0%), I am beginning to think that it's my system (Zeus custom rom on LG P970) that is at least partially at fault, reporting false wakelock values. Particularly as I cannot replicate the problem (at least not in this magnitude) on my other phones.

If a logcat would help in pinpointing the problems, let me know what to look for.

As an added twist, in Since Screen Off/Other, the deep sleep percentage is wrong this time:

Other Usage
===========
Poor Signal (): 55 m 38 s (3338 s) Ratio: 100,0%
Deep Sleep (): 54 m 19 s (3259 s) Ratio: 96,1%
Awake (): 1 m 18 s (78 s) Ratio: 2,3%
Screen On (): 17 s (17 s) Ratio: 0,5%

54m19s is 97.6% of 55m38s, not 96.1% as reported; at least that one is probably down to BBS, not my phone :D). Interestingly, in Since unplugged, the percentage is correct.

BTW, you may want to use dots instead of commas as decimal separators in the dumps (as they are in English rather than German).
[BetterBatteryStats] alexinna:
Good to know. :)

At some point you asked for "user story" or what I would call use case. Can you please take a look at what I wrote here. Is this what you are looking for?

---------- Post added at 10:15 PM ---------- Previous post was at 10:04 PM ----------

What do you mean "awake for no reason"? As BBS shows each wakelock always has a reason ;)

We would need a better name. Maybe something like "pure awake" / "unplanned awake" / "not user initiated awake" / "background awake".

Anyway sum of this time and deep sleep should be equal to total up time or "since" time. Agree?
[BetterBatteryStats] yhrn:
Ok, so I thought I'd add what I've seen lately.

I unplugged my phone before going to sleep the other night and woke up seeing a pretty bad battery loss. I did a BBS dump (BetterBatteryStats-1.txt, 1.11.0 RC5) and also took a logcat. The strange thing is that the total KWL time (discrete) is something like 15 minutes but the totals

are as follows:

===========
Other Usage
===========
Deep Sleep (): 5 h 26 m 38 s (19598 s) Ratio: 63.6%
Good Signal (): 8 h 28 m 46 s (30526 s) Ratio: 99.0%
Awake (): 3 h 7 m 5 s (11225 s) Ratio: 36.4%
Screen On (): 1 m 32 s (92 s) Ratio: 0.3%

I've had the feeling for a while now that the modem I had was not really good for my location/operator so I flashed another one and took a new measurement (BetterBatteryStats-2.txt, 1.11.0 RC6) the next night and got a lot less drain but still a big difference between the Awake time and the KWL total.

Is it possible that BBS is showing correct stats and that some sort of mobile network related stuff that are not part of any other BBS counter than the total Awake time is the reason for this difference? If so would it be possible to include some more info on this mysterious entity that can keep the phone awake in BBS?
[BetterBatteryStats] alexinna:
Thanks for suggestion but I do like and trust BBS so I'm ready to wait for this to be implemented.
[BetterBatteryStats] Lebenita:
Indeed. "Background awake" was an idea I had too. Or maybe Screen-off awake, even shorter and more explicit (although not entirely precise if screen-off phone calls are deducted).
[BetterBatteryStats] itsLYNDZ:
Can anyone help me? Im not getting as good of battery life as I could be.
[BetterBatteryStats] chantoine:
Did you read your dump before throwing it ?

Envoyé depuis mon GT-N7000 avec Tapatalk
[BetterBatteryStats] itsLYNDZ:
Thats what its been looking like since I updated to the newest BBS...
[BetterBatteryStats] Tungstwenty:
I have some doubts if there's a technical solution for this, considering the obvious limitation of not changing the code of the core services but merely accessing their APIs, even the private ones. Looking at the IPowerManager there doesn't appear to be a way to query the reason for the screen being off, there's only "boolean isScreenOn()" and that's it.

Accessing the sensors might be a way (didn't look at the details), but that would require re-calculating the same thresholds as used by the core services to trigger Power.setStreenOff due to Proximity.

Checking for a call might also have a bias, if we think that a call could be active and the screen being on, in case you're using a headset or a bluetooth car kit.

We could go on - it could be off but still awake "for a reason" because you're in a "pseudo-call": listening to music or to FM radio :)

My original line of thinking, for the proximity during a call, would be not polling but rather listening to the onScreenOn/Off broadcasts and whenever that happens actively interrogate the PowerManager or whatever to check, after the fact, whether the proximity motive is active.
[BetterBatteryStats] chamonix:
Ans what does it say on screen when you open since unplugged?
[BetterBatteryStats] KMAngelo:
I have for a long time had a pretty bad battery drain, for example i lose around 15% overnight, in a duration of 8 hours. I have tried a lot of things trying to improve it, changed rom, kernel and modem etc. but nothing seems to work. And I cannot find the explanation in BBS either. I unplugged my phone before going to sleep and did a BBS dump. I would appreciate if someone will take a look at it. :)
[BetterBatteryStats] kenzolo:
Sorry guys,

I know there are many topics on this subject, I have read all of them

but I not found a clear and precise solution about how to solve the gtalk_async_conn partial wakelock.

Some advice?
[BetterBatteryStats] skarboy:
Hi

I got a lot of kernel wakelocks through sec-battery-monitor. (24,8%)

the next big thing is l2_hsic with 7,1%

are there any solutions around for this behaviour?

i come hardly through the day

apart of that there is nothing unusual in the logfile

thank you
[BetterBatteryStats] It_ler:
Just a suggestion:

With 99,6% of deepsleep about 15% battery loss in about 8 hours ... maybe you should flash another ROM.

If you want to stay on GingerBrread, I recommend XWLA4 ... have a look at my kernel/stock ROM test results => http://xdaforums.com/showthread.php?p=26775950

In post #7 you will find my latest GB stock ROM test results.

Good luck !

P.S.:

Not interested in updating to latest ICS ROMs?! I also had very good battery life with Phenomenal 6.1 Extreme on stock XWLPT ROM.
[BetterBatteryStats] kenzolo:
sorry if I insist .... but I would like to solve this problem :crying:
[BetterBatteryStats] Karpfenhai:
Read the thread, you cannot get rid on it! Except by installing Windows mobile! :laugh:

Just read, its only a few pages back ..
[BetterBatteryStats] dh4645:
is this good, or is there something else i can do to make it better?

Thanks.
[BetterBatteryStats] It_ler:
Looks good.

What are your screen on and awake times?
[BetterBatteryStats] kvv515kvv:
dumpfile looks very good.

try to take out battery for couple minute, put it back, charge to 100% and wipe battery stat.

if it does not help, maybe you should change the battery
[BetterBatteryStats] kmetek:
which one?

https://play.google.com/store/apps/...mNvbS5XYXphQmUuYW5kcm9pZC5CYXR0ZXJ5RHJhaW4iXQ..

or

https://play.google.com/store/apps/...SwxLDEsImNvbS5tc2QuYmF0dGVyeS5pbmRpY2F0b3IiXQ..
[BetterBatteryStats] dh4645:
those are the only screens i took on sunday. (just forgot to share until today)

here is what it is now. that huge drop off on that graph was from rebooting twice while doing a nandroid, updating rom and installing the gotham theme

the recent smaller drop off was another restart. checking something in cwm. wish it wouldnt drop so much on reboot.
[BetterBatteryStats] lparcshinoda:
After some time I've reinstalled BBS to check a strange behaviour that my phone is doing lately (i used to get about 20h per full charge, now it lasts just 14 or such).

On the first run with it I'm seeing that BBS reports only 52m of Screen On, while Android Settings says 1h,16m,46s of Screen Activity - am I reading it wrong?

I'll attach a dumpfile in my next post to let someone help me better :) thanks in advance
[BetterBatteryStats] Karpfenhai:
Dont mix since charged (Android) and since unplugged (BBS)!

Guess thats the problem ;)

Right? :laugh:
[BetterBatteryStats] lparcshinoda:
BBS is set on "since unplugged" - shouldn't Android internal battery manager also report the informations since unplugged?
[BetterBatteryStats] foosion:
Is there a way to change the colors on the graph? I'm seeing dark blue on a black background, which is close to unreadable.

Being able to see a larger graph would be nice.
[BetterBatteryStats] Karpfenhai:
Nope, the full gauge chip resets itself only at reaching 100% Charge.

But set BBS to since charged and you should have the same values ;)
[BetterBatteryStats] lparcshinoda:
BBS has the same stats on "since unplugged" and "since charged" - android doesn't. Anyway, My phone was 100% charged when I've unplugged it :crying:

---------- Post added at 09:32 PM ---------- Previous post was at 09:24 PM ----------

Here we go :)

BetterBatteryStats-2012-09-25_212456194.txt

logcat-2012-09-25_212503069.txt
[BetterBatteryStats] dh4645:
on another note...my work pc randomly doesnt load google sites (docs, play, gmail, search/news) for chunks of time, then all of a sudden works again. whats that about?
[BetterBatteryStats] lparcshinoda:
problems with google servers not syncing up with your account (or contrariwise)
[BetterBatteryStats] RovG:
This one.
[BetterBatteryStats] vis80k:
by unrooting, do you mean locking the device? on the same line, rerooting meaning unlocking?
[BetterBatteryStats] haloeight:
Looking through the list of feature requests, I see one for mv/H but was wondering about summary drain per hour for various states.

I use BBS along with Wazabe's My Battery Drain Analyzer to get an idea on drain rates.

It would be nice to get a statistic to average % drain per hour for screen on, deep sleep, awake etc. as this information is useful in seeing if a ROM or settings changes have had a long term impact.
[BetterBatteryStats] koricua74:
Can someone take a look at the my logcat and dumpfile? I'm getting okay battery life at work but I would like to tweak it a bit more and a point in the right direction would be greatly appreciated! I've also included 2 screenshots of my alarms because I don't know what com.google.android.gsf does? --TIA
[BetterBatteryStats] chamonix:
double post, removed
[BetterBatteryStats] chmun77:
Did anyone facing the high wake locks of FacebookService like mine? Not sure if this is caused by the Facebook messenger or the Facebook app itself. Is weird. First time seeing this though.

Any advices?
[BetterBatteryStats] alexinna:
Yes. I did realize that and proposed alternative names such as "background awake" or "not user initiated awake" or "system awake".
[BetterBatteryStats] r2go:
Hi all.

What is this draining my battery?

Verstuurd van mijn GT-I9300 met Tapatalk
[BetterBatteryStats] nobnut:
I understand.

I will think about it. If there are no apps or wakelocks showing... I'm now thinking possibly kernel/governor/some other funky thing.

Have other users reported similar issues?

Got to go for tonight... until tomorrow ;)

Sent from my HTC Flyer
[BetterBatteryStats] XlAfbk:
it's now 1h after my initial check of all stats, battery drain is still as bad, phone was again awake all the time.

I had set a new ref point, during that hour:

android +9 wakelocks

com.google.android.gsf +5 wakelocks

everything else is either +1 wakelock or unchanged

Interestingly gingerbreads battery log now shows Android System with 12 seconds less keep awake than an hour ago *confused*

CM nightlies are known to cause some battery drain, but I usually can pinpoint it to some specific app or it's a bug that gets fixed fairly quickly, but with this it's just the phone being awake and me having no idea at all what could be causing it :-(
[BetterBatteryStats] chamonix:
the problem is that not the provider but the requester that sets the precision, type and interval. Type would be coarse, fine or passive, and then precision eg 5Km with interval 15 min meaning either an update every 15 minutes or when you moved 5km (that's the one I use). Passive is not well known but interesting: requesting that type would deliver a position without getting a fix and is battery friendly. It just reuses the location that was previously determined by another app.

All that meaning there is now way for that settings you dream of because each requestor can decide what he wants and even request for multiple types (I want the best possible loctation). This is very powerfull and flexible but gives toomuch resonsibility to the apps imho (eg a poorly designed weqther widget could drain you battery requesting for fine location with high precision and frequent updates even if that makes no sense.
[BetterBatteryStats] nobnut:
Dollars to donuts it's that nightly. It's too coincidental.
[BetterBatteryStats] chamonix:
with experimental kernels it's frequent that awakes are caused by things prevention the power management to get the phone to sleep like kernel side wakelocks or worse, interrupts like touchscreen or buttons not being detached prior to sleep. I suggest you check you dmesg for PM messages as you may find an explanation there
[BetterBatteryStats] nobnut:
Too bad. Thank-you for the explanation. People will just have to be more careful about apps installed, permissions, autostarts and syncs.

I guess I'm off to the Apple Store tomorrow for an iPhone. They're great!
[BetterBatteryStats] chamonix:
grep dmesg for Power Manager activities and you may find that it tries to go to sleep but that cycle being interrupted all the time (by non release irqs eg).
[BetterBatteryStats] chamonix:
what we could look at of course is replacing the locarion service alltogether by one not caring about what was requested but deciding who gets what when. What I don't know (but will check) is if that service can simple be replaced by registering another one in its place or if - as I suspect - that requires tweaking the system apks/jars and providing ones signed with the same keys as the sz

system. That remines me that pulsar offered me some scripts to sign mynown rom in order to test if a system signed app could turn gps on/off by requesting the proper rights and being entitled to use them (by beinf properly signed).

If I find a way to tweak the location service I may really give that idea of yours a try.

Gee my todo list grows and grows.... I want a full time job in this area
[BetterBatteryStats] nobnut:
That is exactly what I meant. If you can't control it, kill it and build a better one.

*Now, should I get a black or a white iPhone*

;)

EDIT: Just had a thought. Who cares about what apps are asking the location service for? Why can't the service just repeat the last known location until IT decides to update... and then feed that location until it is ready to update again. I guess that's similar to what you suggested above.

Sent from my HTC Flyer
[BetterBatteryStats] XlAfbk:
would this be it?

<6>[299251.154445] s3c-rtc s3c2410-rtc: rtc disabled, re-enabling
<6>[299251.157748] PM: suspend of devices complete after 130.608 msecs
<3>[299251.158112] pm_noirq_op(): platform_pm_suspend_noirq+0x0/0x40 returns -11
<3>[299251.158126] PM: Device power.0 failed to suspend late: error -11
<6>[299251.158247] PM: early resume of devices complete after 0.103 msecs
<3>[299251.158309] PM: Some devices failed to power down

is there any way to "fix" those errors from the running system or is the only way restarting Android?

any idea how to catch such errors to take automatic countermeasures? My only idea would be using Tasker to grep dmesg for that error and restart if found, but that seems kinda ugly, maybe you happen to know a cleaner solution?
[BetterBatteryStats] theguru1974:
Capture app

Sorry to ask such a silly question, but the screencaps you guys are posting here - which app do you use? I tried drocap2 but couldn't make it work, no files ever ended up on my sdcard in the folder.

Eric
[BetterBatteryStats] sowen222:
On the Sensation with stock 2.3.4, I just press the power button and the home button, and it takes a screen shot and saves it to the camera directory.
[BetterBatteryStats] sowen222:
--- deleted ---
[BetterBatteryStats] hyperbolic:
Hi,

I read almost all the posts regarding this thread, I tried to even search for related wakelocks like I have and it seems that ppl are posting explanations to how that specific wakelock works instead of giving a real solution for this wakelocks.

I have searched this thread for hours and read most of the posts.

I am on stock rom 2.3.3, Ninpho kernel, undervolted using SetCPU and on minimal use I get almost 4 days. (Screen is barely on)

But still when looking at the wakelocks it seems I can get a better battery results, I have attached an edited pic with all the wakelocks.

Please, if someone have a solid solution for those wakelocks (the one with the high counts ~ 1000+ counts) please do tell me what to do.

I really don't want to read replays saying "some wakelocks are from the google source code bla bla bla..", because that isn't a real solid solution in fact reading and understanding what is the specific wakelock won't tell me how to disable it.

I mean no disrespect but I have been spending hours on this thread reading a lot with no solid solution to almost anything.

As you can see from the wakelocks I have a lot of apps that have a real high number of count.

Thanks in advance to anyone that could tell me how to reduce them.
[BetterBatteryStats] sowen222:
You don't specify over what period these stats are taken. If this is the result after 2 days, then it's amazingly low.
[BetterBatteryStats] hyperbolic:
It is exactly 2 days, good guess and thx for replaying.

So you are saying all the above wakelocks are ok and reasonable ?
[BetterBatteryStats] sowen222:
I guessed 2 days because you said your battery lasted 4 days and the battery in the screenshot was half full :-)

I think the number and length of the wakelocks is extremely good for two days.

Keep in mind that wakelocks are absolutely required for software to function on your phone. Applications need the cpu woken from time to time in order to perform certain functions, and so there is nothing wrong with them per sé. The problems are really when there are huge numbers (e.g. 3000 in a 12-hour period) or long awake times (2h awake at night), these indicate that there is an application which is perhaps misbehaving (but not necessarily).

Check your battery usage (in betterbatterystats, click menu>actions>battery history, then click on the graph at the top of the screen), and look for Awake... see if there is a blue bar underneath Awake at any odd times of the day/night.

But again, if you're getting 4 days, then it doesn't sound like there are a lot of lengthy Awake times on your phone.
[BetterBatteryStats] hyperbolic:
Thx for your replay,

Well there are few wakes at the graph (When screen is off I have few awakes blue lines), if I could reduce them I could get at least 10 more hours or more.

But you already said that those wakes are low and for the counts, so nothing to do I guess...

Unless someone has a clue...
[BetterBatteryStats] sowen222:
You'd have to post a screenshot of the graph.

If they are only thin lines, or if they are thicker but correspond to using the phone (making phonecalls, reading email, etc.), then there is indeed nothing to do about it. I mean, your phone has to be awake for you to use it! :-)
[BetterBatteryStats] sowen222:
I wonder if someone can please advise what is going on here. Nobnut perhaps? I'm testing to find out what is keeping my phone Awake for periods at night. Below is the screenshot of a 1h11m period on my phone, in which two big blocks of Awake are shown. Yet for the same time period, BBS shows only 4m59s Awake, of which roughly 2m30s is at the start when I was setting the test up.

I would expect to see about 20m of Awake time reported in BBS. Is BBS not reporting all the Awake time, or are the battery statistics wrong... or am I misinterpreting the info?
[BetterBatteryStats] Karpfenhai:
Maybe your sdcard is faulty, take it out for a while and check if the issue persist.

Tapatalked from my Samsung GT9100
[BetterBatteryStats] lparcshinoda:
Still no clue, anyone?

Inviato dal mio Galaxy Nexus con Tapatalk 2
[BetterBatteryStats] skarboy:
Hi

Could anybody explain to me why i have those huge amount of wakelocks.

I searched but didnt find any good infos on sec-battery-monitory

Any helpful input would be much appreciated. Thank you
[BetterBatteryStats] r2go:
Is that the main reason why that accurs or is there more I can look at?

Edit#

It really was faulty. I just noticed titanium backup said it could not use external sd.

After a reboot titanium is ok. Now to see if the drain is gone after a full charge.

Tnx

Verstuurd van mijn GT-I9300 met Tapatalk
[BetterBatteryStats] KC Boutiette:
Hi Chamonix,

I am a happy user of your great BetterBatteryStats app. I recently got a Nexus 7 and decided to buy your app from the market. However, later when I installed BetterBatteryStats on my phone something went wrong, and my buy got cancelled both on my tablet and phone. Is there some conflict when you install the market version of BetterBatteryStats next to the XDA-edition? Now I first uninstalled the XDA-edition from my phone, bought the app again from the market and all seems to go well.