yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] Karpfenhai:
Okay my bad then, shame on me :o

Maybe you should post a logcat if this behavior persists, chamonix will take care.

---------- Post added at 01:28 PM ---------- Previous post was at 01:25 PM ----------

Hmm, not sure whether its a bug or we just cannot read ;)

We should not count them together i think its always related to 100%.

They are independent from each other?

Sorry i never noticed it before ;)
[BetterBatteryStats] yhrn:
I will try to post a logcat if I see it again but I don't always get that behavior.

I also thought about the possibility that the two should not necessarily add up to 100% but the thing is that the time spans do add up to 100% of the total time so it makes no sense to me. I mean in that case adding the two time spans should result in something smaller than the total.
[BetterBatteryStats] jeffreii:
I'm not sure if this will help or not but I've run some more tests and added info from Badass Battery Monitor as well...anything extra you can glean from this? I have been monitoring the router's log and not found anything unusual - both incoming/outgoing and dhcp requests. BTW I do have my phone set to a static IP on my network.

I've also included a new log for this 1 hour period during which I barely used the phone and it drained 9% of the battery. Thanks as always.

EDIT: Not sure if the image is working correctly in forums please see here for screens of BBM and BBS:

http://imageshack.us/photo/my-images/705/battery2.png/
[BetterBatteryStats] Tungstwenty:
Watchdog - 100% awake while screen off

chamonix,

When you have the charger connected, you'll get this warning when turning on the screen or removing the charger, since the usb connection entirely prevents sleep.

Does it make sense to ignore the high awake ratio in this case?

If so, is it technically doable, e.g. is the "vbus_present" KWL something that can be assumed will be the same for every kernel? Or some other means to know the charger was connected the whole time?

Cheers!

---------- Post added at 05:59 PM ---------- Previous post was at 05:22 PM ----------

I'm not an expert at all in BBS log analysis. All I can say is that in my limited knowledge on that, I also find it strange that a mere 9m awake (with 5m of those with screen / phone active) drains 9%.

Could any of the big fish share some ideas?

One thing I'd do right now would be start using RC4 to collect more info, even considering you're not yet rooted.
[BetterBatteryStats] chamonix:
Yes, at unplug the baseline reference 'since unplugged' gets created and that includes Alarms as well as networks stats starting in 1.9. Both these stats require root
[BetterBatteryStats] chamonix:
I will double check on the total used for calculating the %. After substracting the refs the total needs to be computed again as you can't substract percents.

The evenX-YYYY is not resolved with ps but against an android internal map of processed (key is pid) and this data object contains the list of underlying packages and processes. Once released you can check the logic
[BetterBatteryStats] chamonix:
I plan to add a pref checked by default where all computing is disabled as long as the charger is connected. That can be detected using the Android api. Connecting the charger will also void the references. Of course I will leave it up to experts to turn that off as certain action like debugging or adb requires usb. I have never tested if debugging would word with network adb but that would be great for bbs as being on charger impacts the readings, forcing me to basically find bugs using traces like in the old days where debuggers didn't exist (yes, I am that old :-))
[BetterBatteryStats] Tungstwenty:
mmm, did you ever disassemble Z80 bytes to mnemonics by hand or by memory and write it on sheets and sheets of paper? :D
[BetterBatteryStats] Karpfenhai:
No but he can read punch cards, with his tongue! :cyclops:
[BetterBatteryStats] chamonix:
What toast do you mean?

There are two toasts (if you enable them in prefs):

BBS: Watchdog processing..." (to show something happens)

BBS: Awake alert: .... (if threshold exceeded)
[BetterBatteryStats] Karpfenhai:
No No, watchdog toastsare disabled ;)

I mean the one beside dumpsys alarm, the network stats toast.

Sorry for the confusion.
[BetterBatteryStats] chamonix:
I have tried and tried and screen off gets created every time. If you have a chance to reproduce that please get a logcat.

With dumpfile you mean ref-file right?

When the screen goes on there is nothing written was there is no ref screen-on, there is just a calculation happening, based on "current values" and "screen-off-ref". If you had a ref-file with size 0 that was not created that way because you did something too fast but it was zeroed when the ref was written (the time depends on the ref).

As I can't see the log I must assume that this null pointer was due to the 0 size ref you mentioned above. A file of size 0 can normally not happen because a reference, even if emtpy, is a value object so it has a certain size that should be reflected by the file size. The only reason why a serialized file would have the size 0 is if you serialize "null" and not an instance of an object. Now in the way BBS is build references never should be null. Long story short: without a logcat I unfortunately can not analyse that error situation further [/QUOTE]
[BetterBatteryStats] chamonix:
What I mean was that we need to look further once the mail overheads are reduced. Location can be used by any app so we need a dumpfile where the big overheads from mail are gone, giving another picture.

I hope you will post a reading of that

I don't understand: I use Gmail and non gmail IMAP with pure polling every 30 minutes and K9. The reason I do that is that I often travel and the bad coverage causes a hue overhead with push because of the frequent reconnections caused by failing keep-alives. Poll is what works best for me.

[/QUOTE]

It's up to you to decide if you want to follow my advice
[BetterBatteryStats] chamonix:
I used papersheets to write assembler on the apple II yes :P
[BetterBatteryStats] chamonix:
"Batch processing" gets a completely meaning when you know how a batch used to look like: a pile of punchards
[BetterBatteryStats] chamonix:
( o).(o )

Now you really lost me: I have to toast when retrieving the network stats (except the one that superuser shows because I issue a 'su' command to get that data
[BetterBatteryStats] Rob2222:
Excuse me, is it helpful/important to say, that f.e. SGS3 now is able to deep sleep while charging?

SGS2 prevented deep sleep while charging, but SGS3 is going to deep sleep, even when charger connected.

BR

Robert

---------- Post added at 08:24 PM ---------- Previous post was at 08:21 PM ----------

Hello,

no, I was talking about the dumpfile (*.txt) on sd card was 0 byte. Just checked again. Its still 0 byte. ;)

Best Regards

Robert
[BetterBatteryStats] chamonix:
Ok so the test case you describe was: turn phone on, open bbs, create dump and you feel that being too fast the refs were not read yet and so the dumpfile could not be created because the refs in memory were not populated yet. Correct?
[BetterBatteryStats] camspy:
I tried polling without push, to poll every 15 min, i didn't receive any emails, even if i sent myself like 5 ones to different mailboxes myself to test. I had a lot of reading of various wikies and forums about gmail's imap, and i just found that poll is for POP3 only, Gmail's IMAP has push and push with IDLE.

I will try to get rid of everything what is not 100% necessary, and will leave JD for one of the last things to decide about. Thanks for your suggestions as they impact my thoughts and decisions a lot.

I am attaching new battery dump file now, please take a look at it. As I see, it is a bit better, but not much.
[BetterBatteryStats] chamonix:
I found the glitch in the sum of % deep sleep + awake not always being 100%.

the reason is that for deep sleep I was setting the 100% value to

SystemClock.elapsedRealtime()

where for all the othee values 100% is

computeBatteryRealtime

from batteryinfo

The difference is minimal but together with the substractions the gap could cause what we have seen.

Now let's focus on eventX-YYYY
[BetterBatteryStats] Rob2222:
Correct, thats how it felt. But to prevent this, I already waited some (2-5) secs after switching on before entering BBS. But maybe it was still to fast. Will wait longer, next time.

I PMed you the StatsProvider filtered logcat, the only one I have, maybe its still helpful.

BR

Robert
[BetterBatteryStats] Karpfenhai:
Imused to work with z/OS, so batch is well known to me..;) r 42,close immed ..

I need more wine or less work (lateshift sucks) disabling the toast via SuperSU did the trick, my fault again.. :eek:

---------- Post added at 09:04 PM ---------- Previous post was at 09:02 PM ----------

I use push for my private address, only gmail is set to PULL, every 6 hours, works fine so far.

Incoming server is imap.gmail.com (default)

Outgoing:

Settings:
[BetterBatteryStats] chamonix:
OK, I see where the problem comes from. On screen on a thread (service) reads the references and does the computation. If you are faster as that thread with creating a dumpfile I guess it may be possible to do so before the reference is present. That situation should be handled properly with an error message. I would be helpful if you could reproduce that (I see to be too slow for my sgs3) and post a complete logcat so I can check where the null pointer exception occurs.
[BetterBatteryStats] chamonix:
Under my test conditions the eventX-YYYY handling now works properly: I see multiple events for one YYYY. I undid the change to the key and moved the package list to another field (fqn) that is shown on second line. This also makes the display more consistent with PWL
[BetterBatteryStats] chamonix:
I opt for more wine. And get prepared for RC5, I need you to test eventX-YYYY reloaded ;)
[BetterBatteryStats] Karpfenhai:
Nice!

..waiting for RC5 to confirm! :laugh:
[BetterBatteryStats] camspy:
Thanks, i will try these settings tomorrow, too tired today to set eveyrything up and test
[BetterBatteryStats] chamonix:
If I hadn't spend 7 years working on z/OS performance tuning and capacity planning, playing with SMF and strobe to save millions in CPU (and license) invest I would never have developed my passion for tuning and analysis and BBS would have been written by someone else.
[BetterBatteryStats] chamonix:
Ok, I think I wrapped my head around the basic concept of what I'd call "discrete kernel wakelocks" and I must say I am highly impressed. I can't comment on the kernel part because that's way out of my league but I have some thoughts and questions about the implications (please feel free to correct me where my understanding is not correct or precise enough).

First from an analysis point of view I think it changes a lot and it is really important to inform the reader of /proc/wakelocks (or of a BBS stat/dumpfile) of the fact that he's reading something different.

For that I think the reader needs:

1. some indication about the fact that those KWLs are "discrete"

2. an online doc about the concept and about the impact of that implementation

The top prio for mw right now would be to get the info on how I can detect that implementation and how I should name it, if I can reference any wiki page or post in the dumpfile and on screen to make the reader aware of the fact that he's looking at something different.

The beauty of the concept is that the overlapping is gone, leaving less data. One side effect is that when a reading has "screen on" as main reason for "awake" my understanding is that concurrent KWLs will be hidden; the good thing is it filters out the KWLs that are side effects and not the cause (that's the most difficult part in interpreting KWLs in situations where alarms cause frequent wakeups IMHO). The downside is that what we need to rethink and get used to the concept, IMHO the interpretation of dumpfiles with mixed usage will get more difficult.

Now what I don't understand completely yet is if there is any impact on "Power Manager" as proxy for the PWLs. And I even get more confused it I think of e.g. 777 kernel that does not have Power Manager but shows every userland PWL as a KWL as well.
[BetterBatteryStats] chamonix:
Release 1.9RC5

1.9RC5 is up, see changelog in post #2:

- next attempt to fix eventX-YYYY

- added kernel version to dumpfile

- fixed percentages in "other" not always summing up to 100

Enjoy!
[BetterBatteryStats] Karpfenhai:
Works like a charm!

Will post results tomorrow after a longer sleep period.

One entry occurs twice, means 2 eventX for the same app, might be normal.

Nice!

Tapatalked from my Samsung GT9100
[BetterBatteryStats] chamonix:
I noticed that too and went to the raw KWLs and saw the same. I admint that I was too lazy to check the file in /proc though :)
[BetterBatteryStats] chamonix:
Cool, going to sleep then :) Have fun testing guys
[BetterBatteryStats] Karpfenhai:
Hold on a sec, i think it shows always the last call:

In the dump its already another:

Maybe you should store and count them for the dump or in an extra section?

Count --> merge the time the specific app calls the system server.

Extra section --> list all apps counted under eventX and their calls/count/time awake.. Name this section Android system server wakelocks and don't show eventx anymore inside.

It's just an idea but this could help to identify the famous AOS-bug!?!

Good night people ;)

Tapatalked from my Samsung GT9100
[BetterBatteryStats] Sincitybronze:
Hey guys, I know it's been recommended in this thread to set up the gmail account through the stock email app and sync every 15 or 30 minutes instead of using gmail and leaving sync on, but the stock email app does not sync on schedule when it is scheduled to do so. I have to manually sync whenever I want to check e-mail, in spite of the fact that I have it set to sync every 30 minutes. My work account (exchange) syncs according to the schedule but gmail does not.

I did not perform a manual setup of my gmail account. Is this something I need to do and are there special settings I need to select for gmail syncing to make this work? The auto setup uses IMAP.

I'm on Slim ICS (4.04) if that makes a difference.
[BetterBatteryStats] xelra:
The people in here that don't use the gmail app are using kaiten. Not the stock e-mail app.

I'm using the gmail app with push, because it's one of the reasons I bought a smartphone in the first place. And the battery drain is close to nothing.

I guess it also depends in how well your data connection is. If you are a lot on 3G with bad coverage, push me ght get heavier on the battery drain.
[BetterBatteryStats] eddylee09:
Hey folks,

First time using BBS here. Here are my stats after a full day of use (after a battery stats wipe and cache/dalvik wipe). Still having horrible battery life. Are there any wakelocks that I'm unaware of or things that are hogging up by battery that you guys notice? Thanks a lot, really appreciate it.
[BetterBatteryStats] Karpfenhai:
Current Dump

@ Sven, it dissappeared overnight ..;(

See the dump.

View attachment BetterBatteryStats-2012-07-13_071201302.txt

How is that even possible?

Furthermore you lost a carriage return between OS Version and Bootloader.

MANUFACTURER: samsung
MODEL: GT-I9100
OS.VERSION: 3.0.15-Phenomenal5.5MediumBOOTLOADER: unknown
HARDWARE: smdk4210
FINGERPRINT: samsung/GT-I9100/GT-I9100:4.0.3/IML74K/XWLP4:user/release-keys
ID: IML74K

:)
[BetterBatteryStats] EH15:
Hi guys, I haven't been able to get around to doing a full day's log yet but I've noticed "com.google.android.syncadapters.calendar" is always at the top of my partial wakelock. Can someone explain what's causing this? Why is my google calendar trying to sync non stop?
[BetterBatteryStats] Ditamae:
Thanks very much for maintaining this thread. I've read a good bit of it now, but I still have a couple concerns. My battery life is fairly decent, but since moving from GB to ICS I've noticed that my phone now spends a good deal of time awake when the screen is off. With my previous GB ROM, this never happened. All my settings are also consistent across ROMs. I still only sync the few apps I really need (gmail, email, and facebook contacts only).

I keep reading how you guys recommend setting the WiFi sleep policy to turn off "when the screen is off," but in the past I found my battery really improved when I changed this setting to "never." However, I can see from what I do understand of my dumpfile, that google maps is super active in the background. Does disabling WiFi prevent GMaps from waking the device while it sleeps? I actually ran an old version of GMaps for this very reason, but had to update to the current version so that it would play nice with ICS.

Essentially, I'm hoping that someone might be able to tell me what the cause of my wakelocks could be... it appears that every notification is preventing my phone from deep sleep... also, why is there seemingly so much facebook activity when I have all notifications off?

If I didn't provide enough time with my dumpfile, please just let me know I'll remedy the problem. Thank you so much - in advance.
[BetterBatteryStats] gachana:
I have partial wakelock as a result of AudioOut_3 which is very high. I am using sensation vipers rom, sense 4. I have observed it for over 12 hours, how can I fix this? I did not listen to music. Is audioout_1 different from audioout_3. i did not see the later one in this thread.
[BetterBatteryStats] Karpfenhai:
Please update to RC 5 to demask the eventX entries.

Attach the dump, dont post it!

Facebook and your wlan are the main culprits!
[BetterBatteryStats] torchedlh:
Updated to RC5. new dump and link below.

What can i do about the WLAN wakelocks?? Also, i have Facebook refresh and notifications turned off. Anything I can do short of uninstalling it?

http://pastebin.com/zf9jUmAA

Thanks
[BetterBatteryStats] lordgoata:
Turn it off when you're not using it! In the original log, the screen was only on for ~7 minutes out of ~7 hours, yet you had almost 7 hours of WiFi On and over 2 hours of WiFi receive wakelocks.

Basically, if the phone is not in use, but is connected to a noisy WiFi network, the phone will keep waking up to all the noisy data packets that are broadcast over the network, hence it never gets to sleep. Turning WiFi off, means it won't respond and can remain asleep.

This seemed to get a lot worse on the SGS2 when ICS ROMs started to appear, and from what I have since read, Samsung changed the kernel packet filter to stop it ignoring multicast broadcasts (which it did in GB). Therefore any broadcasts on the network, wakes the phone up. This is particularly bad large networks (such as at work), home networks tend to be a lot quieter.

There is a patch for Siyah Kernel to revert the packet filter back to the GB-type, and many kernel devs are incorporating it into their kernels now, so hopefully this will help improve the situation: https://github.com/gokhanmoral/siyahkernel3/commit/34754c2204b14fc2cbff472a003e2bc273e6cbd1

Update: I see from the 2nd log you are using Siyah, but are on 3.3.2. I believe the patch above was added to 3.3.3, so try updating to 3.3.3d which was released yesterday I think, and see if it helps.
[BetterBatteryStats] Sincitybronze:
I'd read every page in this thread except the last few where k-9 and kaiten were discussed, specifically. Looking back just now I realized my issues were JUST addressed. Sorry for being "that guy" who didn't review the thread before asking. I feel like a bonehead. Thanks to everyone who commented on email/gmail strategies. I'll give k-9 poll a try :)
[BetterBatteryStats] Jaromos:
Is This Normal?

Hi

I'm using K9-Mail, and experiencing a lot of partial wake locks (as opposed to gmail app).

Is this thing normal with K9? Does it drain the battery?

i46.tinypic.com/2ij17xz.jpg
[BetterBatteryStats] universed:
MIPI_LINK Revistied

Why would my camera be waking up my phone throughout the night? What application would that be happening through?

I have googled a bit on Mipi_link and I see quite a few questions here and elsewhere but not a lot of clear answers? 1 of the promising threads at XDA just kind of petered out without any clear answers as well: http://xdaforums.com/showthread.php?t=1462020

Also, GTALK_ASYNC seems to drain a bit overnight even though I have Google Talk Disabled?
[BetterBatteryStats] chamonix:
Reviewing the discussions of the last days about wlan rx wakelocks I have added a new project idea to my list: a service implementing an intelligent wifi sleep policy when screen is off. I guess you could do that with Tasker too but it seems a good idea to have an integrated tool.
[BetterBatteryStats] Kurre:
How about making it with the Tasker first and then turning it to a standalone app with the Tasker App Factory? :) then we could have them both :D
[BetterBatteryStats] nam3less:
So I'm running mwalts jellybean ROM for toro. Stock. AOSP. Nothing fancy about it.

And I get bug shown in the screenshot. Happened more than once. Disregard the "Since Screen Off." I was just checking to see what that option looked like but i didn't have a reference long enough. treat it as though it read "since unplugged"

Running rc4.

I guess I just noticed that you uploaded rc5. I'll test with that tonight and update accordingly.
[BetterBatteryStats] chamonix:
A wakelock is not something that wakes up your phone but something that keeps it awake. A wakeup can occur e.g. due to an email sync and the mipi_link wakelock prevents your phone to go back to sleep when done. One known error situation related to that was that google talk initialized the camera for video calls at boot but did not close the camera properly again, leading to a wakelock.

GTALK_ASYNC has nothing to do with Google Talk, it is relate to the cloud to device communication used, for example, in the payment system of Google Play. I know of no way to impact that and as it's closed source we can't analyse the code.

You mentioned you gave gtalk disabled. Did you freeze anything and in that case what did you freeze?
[BetterBatteryStats] chamonix:
What you mean is that deep sleep time is > than "since" time right?

If the problem persists could you please post a logcat?
[BetterBatteryStats] chamonix:
Could you please post a dumpfile and more info about how you use k9:

- number of mailboxes

- settings: IMAP, POP3, POLL, PUSH, number of synced folders if push
[BetterBatteryStats] nam3less:
Yeah, Deep sleep > since.

I will install RC5 tonight, test, and then if it persists i'll come back with a logcat.
[BetterBatteryStats] chamonix:
Have you looked at the screen when taking the screenshots :confused:

What i AlarmScheduledService (IMS Service)? This is what keeps your phone awake
[BetterBatteryStats] chamonix:
It is not. Could you attach a logcat so that we can check the references and the substractions. I think there may be a bug in the way the current KWL are substracted from the reference, leading to results with zero times (those are filtered out if you didn't set you prefs to show all data.

You could also check that it's still present in raw KWL and even in /proc
[BetterBatteryStats] universed:
Thanks Chamonix, I REALLY appreciate the explanation.

Yes i have frozen the following APPS using TB:

DROPBOX

GOOGLE PLAY BOOKS

GOOGLE PLAY MAGAZINES

GOOGLE PLAY MOVIES & TV

GOOGLE +

MESSENGER

NEWS & WEATHER

SKYPE

SOUND SEARCH FOR GOOGLE PLAY

STICKMOUNT

TALK

WALLET

I don't have FB or Twitter installed and have my K9 mail set to manually check for emails. Some nights I have good DEEP-SLEEP and very low battery usage and other nights are different. I just flashed JB 4.1.1 this week with the latest Baseband and Bootloader so my system is still settling in.
[BetterBatteryStats] eddylee09:
Not quite sure what it is..Going to try and turn my alarm off to see if this might be the problem
[BetterBatteryStats] chamonix:
It has nothing to do with the alarm to wake you up, it's a service or app that you have installed