yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] chamonix:
I have not merged anything on purpose at least :-)

I will recheck the code and also try to reproduce. If you want to see the records being processed you can find the whole (it's a lot) in the logs, including what was in the reference and the result of the subtraction. The reason may be related to the fact that the package list is part of the name (and key). Retrospectively that's a bad idea because I can imagine that the packages summed under one entry may differ over time and that would mean changing the key and the inability to map one entry among refs.

I will try to spend some time tonight to understand and fix
[BetterBatteryStats] Karpfenhai:
Dont worry and take your time ;)

If you need logs or tests just let me know ;)

Know what? Im in the right mood, have yourself a beer, pm me your donation mailaddy.. :D
[BetterBatteryStats] chamonix:
adb install has a force-flag to reinstall, the behavior you mention is normal and different from Google play and the package manager (those do install/update). Even if the app file name is different for each release the package name is the same (com.asksven.betterbatterystats_xdaedition)
[BetterBatteryStats] chamonix:
It is not AudioOut_1, that would happen only as long as there is a sound notification associated with the led.

Partial wakelock: that may depend on the was the app is implementing the notification, shouldn't be required when using the notification manager.

Kwl: depends on hardware and kernel. I know phones where even blinking effects are handled without any help from the kernel (HTC touch pro aka raph for example) looking at the kernel threads and logs we process I'd say most of the time no kwl for the LEDs designed for notification, often kwl for other LEDs like bln
[BetterBatteryStats] vol2ume4:
The APK does not install on my Samsung Note

Hello!

Recently I upgraded to ICS and have been facing battery drain. Am keenly looking to understand it better using this App.

I was able to download the APK file to my Note. Setting the "Unknown sources" on, i tried installer. It goes to the install screen and only the "Cancel" button works. The "Install" button is not active.

Any pointers?

Thanks,

Sridhar
[BetterBatteryStats] chamonix:
Thanks for your generosity sir. Hold that thought a second, think of an organisation you'd like to support and donate that amount to it please.

But I'll have that beer when I get home :-)
[BetterBatteryStats] chamonix:
In the meantime I read an important info you posted on that matter in another thread: you have an impressive number of mailboxes that you all sync.

I believe that you are beyond the scope k9/kaiten were designed for and I don't see a solution to your problem without consolidating your mails in one mailbox on the server side.

To test the impact you can just turn off sync for all your mailboxes except one and I bet the problem will be gone.

About the other questions :

- my suggestion is to completely from jd

- you can take a reading at any battery level but I would not recommend going below 20% due to many phones using different energy management policies at lower charges. That unknown may make comparisons between dump files more difficult

- whether you use maps or not doesn't make any difference, if it's installed and not tamed by other means the service runs, whether you want it to or not. Setting the caching to wifi only limits the overhead, a better solution would be the prevent the service from staring or freeze maps completely
[BetterBatteryStats] chamonix:
I hope you are not under the impression that I ignored your posts and effort on kwl. I just have more focus on the release right now and feel studying your contribute (that was merged as I saw the last release note) will require my full attention. On the other hand the release will come soon and I feel that I (we) need a proper understanding as we will get dump files for that variant soon. I will try to get an overview and get back to you as soon as I feel I have grasped the power of your patch
[BetterBatteryStats] Karpfenhai:
Screenfilter enabled?

If yes, turn it of and experience a miracle! :p
[BetterBatteryStats] mahercs:
Well, crap! Thanks for the feedback. I keep seeing this partial WL and I don't have a clue what it is. I don't stream music or anything, and I have all the haptic sounds/vibrations turned off. The only other thing I can imagine is the vibrations from texts and calls, but again, these are not "audio" so this is where I get lost. Maybe I will try to post a dump here to see if one of you experts can glean any insight. I'm confused by this one!:silly:
[BetterBatteryStats] camspy:
I don't have maps installed at all, if you mean google maps.

I have 8 mailboxes, well what to do, it's my life and my work, I need to have my emails everywhere with me. These 8 mailboxes have like 19 folders to sync combined, 4 of the boxes rarely get emails, like maybe once per week. I have these folders set as 1st class and all others are 2nd class, I have set to poll and push only 1st class emails. They are set to sync every 60 minutes. Why does it wake every 30 sec?

Regarding JD I didn't understand what you wrote... As i guess you meant to get rid of it. But i need to update apps, weather, etc etc, and emails too every 60 min, so JD is doing that for me to open WIFI or MOBILE DATA connection every hour
[BetterBatteryStats] Karpfenhai:
How long is this WL occured?

You need to understand that any noise produced by your device will cause this WL!

Especially for games, turning down the system volume does not disable the sound in apps!

So if an app does not have the function sound off, the WL will occur, even if your phone is on mute.

Hope it helps a bit?

Did you disable keyboard / swype sounds as well?

Good luck ;)
[BetterBatteryStats] mahercs:
I think you nailed it. Sounds pretty stupid to me...If a tree falls in the forrest and no one is around, does it make a sound? In this case, it appears that my phone believes there is a sound and sends a WL to prove it! I have a social game on my phone that notifies me when it's my turn, but while at work, all sounds are muted. Apparently, the phone still has this WL as you stated. Thanks so much. I will shut that off and see if there is a difference.
[BetterBatteryStats] Rob2222:
Excuse the question, but what do you need to do to enable the BBS debug logs? Are they in the standard logcat?

BR

Robert
[BetterBatteryStats] melvinaury:
I'm using the latest rc4. I see some strange info. I include a screen shoot. As you can see time since unplug vs. the are not in zync.
[BetterBatteryStats] Karpfenhai:
Wrong recipient :) Sven will answer this i guess..

---------- Post added at 09:14 PM ---------- Previous post was at 09:13 PM ----------

Mate these are real time stats, they change every single time, cuz your phone / time / life runs further, so they will never be in sync ;)
[BetterBatteryStats] TecQuality:
just working onto the latest nightly (GT-9300), and checking the logs, noticed some errors by this app ...
[BetterBatteryStats] chamonix:
Yes they are standard logcat. Depending on what you are looking for it requires the knowledge of the code to isolate the tags that are relevant. For e.g. all the reference handling and substraction stuff StatsProvider is the right place to look.

I am a log4j guy but my projects all use the standard logging except ALTitude where I use a configurable logger allowing own logfiles. I may bring that helper to AndroidCommon one day when I am bored ;)
[BetterBatteryStats] Tungstwenty:
Not at all mate! I'm fully aware of where your focus needs to be right now ;)

Plus, you show an excellent track record on picking up even matters buried deep in past pages when there's something you think you should follow up on. No need to "dad, daaaad, are we there yet?" :D
[BetterBatteryStats] chamonix:
Was your phone on the charger/usb at that time? If no had you plugged/unplugged your phone after installing RC4? if both are "no" could you try reproducing that and send me a logcat?

If one is yes then that's the reason:

- RC4 fixes a problem where the ref "since unplugged" did not get saved properly so if you didn't re-create that ref with RC4 it would potentially suffered from that RC3 bug

- values when plugged are not representative (any yes, I will prevent BBS from deivering data while plugged in the near future)
[BetterBatteryStats] chamonix:
Thank you. I am aware of the leaked window error but didn't find an elegant way to fix it yet.
[BetterBatteryStats] Tungstwenty:
(I'm not sure but I think I might have already made this comment in the past)

The fact that the audio WL is there and people get worried about it, disable keyboard sounds, etc. to make it go away, is somewhat of a flawed argument.

Unless e.g. Swype is making sounds while the screen is off (and the phone could potentially be sleeping like a baby), the phone is already awake since you're using the keyboard anyway.

Sure, it will be a couple more mA's to power the speaker or vibrate, but it's not affecting the deep sleep ratio. It's still there on the WL list, true, and makes people worry about it...

The only real impact would be for audio WLs that are happening with the screen off (such as a game that allows the screen to turn off but still runs the audio, even muted) - only then would the audio lock be indeed preventing deep sleep.

In this sense, the "main" WL issue that has been brought up (and I don't really understand yet, BTW), would even be helpful as a way to know: "as long as main is the one locking the device, it's good because it just means the screen is on so no sleep during work hours". But the association of "main" to screen off isn't for sure that simple, even on the devices where it apparently is showing up.

---------- Post added at 10:00 PM ---------- Previous post was at 09:50 PM ----------

Since you're on S3 you'll get a change to try with/without the patch soon, apparently.

*If* the issue is with wifi "noise" in your environment, I'd say alarms info will not be relevant at all. The device would be waking up due to incoming traffic (the antenna is the one waking it up), and the way it reflects in the dump is increased wlan_rx_wake activity.

Alarms info just records which processes are asking the device to wake up in x seconds, which has nothing to do with what might be going on outside.

The fact that it's intermittent doesn't prove a thing, it all depends on what else is using the network and whether it has its own agenda to broadcast stuff. So, pointing this to wifi is just a possibility. I guess trying out the multicast block kernel once it's available could be one way to see if it makes a difference, if indeed those intermittent periods are provoking wlan_rc_wake to stand out.
[BetterBatteryStats] chamonix:
Well I may require your assistance and patience.

Here's what I found and tht is not logical (compressed):

I/StatsProvider( 3874): Substracting ["event6-9675" (system, com.android.calendar) [3 s (3 s) Cnt:(c/wc/ec)15/6/0 0.0%],"event8-9675" (system, com.google.android.syncadapters.contacts, com.google.android.gsf, com.google.android.location) [ (0 s) Cnt:(c/wc/ec)2/1/0 0.0%]]
from
["event6-9675" (system, com.google.android.apps.maps) [3 s (3 s) Cnt:(c/wc/ec)17/7/0 0.0%],"event8-9675" (system, com.google.android.location, com.google.android.syncadapters.contacts, com.google.android.gsf) [ (0 s) Cnt:(c/wc/ec)2/1/0 0.0%], "
Result ["event8-9675" (system, com.google.android.location, com.google.android.syncadapters.contacts, com.google.android.gsf) [ (0 s) Cnt:(c/wc/ec)2/1/0 0.0%]]

I guess we agree that the substraction of event6 nulls the time but not the counts and should appear in the result.

On the other hand event8 is a 0 - 0 but ends up in the result, to me the counts are not correct as they should end up being 0/0/0

I will look at this as it is weird but at the same time it would be great if you could provide me a logcat (complete, without filtering as may have to look into the classes doing the substraction) with more eventX-YYYY than I can produce
[BetterBatteryStats] chamonix:
Just if someone wonders: BBS works great on JB :)
[BetterBatteryStats] chamonix:
If you donÄt have maps then there is another cause:

But let's take that up later.

To your mail problem: I understand the problem but again, you are beyond what the clients were designed for.

Now I see four solutions:

- all your accounts are on gmail: in that case you could test in how far the gmail client does a better work bundling the traffic

- you find a way to delegate the task of consolidating the collection of the accounts to the server and use some logic with tagging and folders to distinguish the accounts

- you try to go to poll

- you accept the extreme high costs

What you said about the settings (60 minutes puzzles me): from the dumpfile I was under the impression that at least some of the accounts were using push and not poll. In that case there is not refresh interval but only a keep-alive-interval (IMAP timeout). That said moving part to poll may be the solution.

About JD: I don't want to excude that your mail problem comes from the fact that JD regulates the data traffic and the application, that does know anything about that, keeps trying to reconnect because there is an IMAP keep alive to respect. That should illustrate why JD can do no good in regulating the data traffic.
[BetterBatteryStats] Karpfenhai:
sure! Just tell me what is the best way, full dump?

View attachment full-logcat.tar.gz

I know, one of my collegues is using it on his nexus since jb was out. :D

Tapatalked from my Samsung GT9100
[BetterBatteryStats] Tungstwenty:
Great news! "main" is my fault :victory:

Well, that's not the good part, but rather the fact that I finally undestand how it all works :cool:

"main" is a wakelock that is held as long as the screen is on, and that is released when it's turned off.

You can't see it on BBS (unless you have my bad math in place, that is), because its "sleep_time" on /proc/wakelocks is *always* 0.

If you go to that file and take a look at the counts, though, you'll see it increasing by one whenever the screen goes from off to on. Also, as long as the screen is on, "active_since" keeps counting the amount of time it's held (again, with no sleep_time and therefore not seen on BBS).

Another thing is that as long as "main" is active, all other KWLs' BBS time (field "sleep_time") are also stopped - this means that the time shown on BBS is only for the period while the screen was off. And here I was just a couple of posts back saying that the audio KWL's time was nothing to worry about since the device was already awake :o

One thing that is slightly inconsistent is that even tough the "time" is not being incremented for as long as the screen is on ("main" is locked) the C, WC, EC do increment. It might be worth discussing whether it would be useful to also have those respect the screen state so that the KWL section would really reflect only what happens during screen off time, in all aspects (not only lock elapsed time).

In conclusion, those using 3.3.3x Siyah will notice this issue with "main" being reported, but rest assured that it's just a math problem. The power being consumed is exactly the same as before. Dump stats are biased, though - not only in the "main" entry, but the others as well since under those conditions where "main" is increasing, the others will also increase whereas previously they didn't.

Learning is fun!!! ;)

PS: I'm now running a fixed version which is working fine according to my explanation above. The patch to Gokhan is on its way and will make into his next build, I'm sure.
[BetterBatteryStats] jeffreii:
Thanks again for your comments. How would you suggest I proceed? My first thought was to wait until it starts happening again and monitor the traffic log on my router, watch for the phones local IP, and see what it's talking to. I then thought perhaps there are packet sniffer apps (probably requires root though?) that I could install and see what my phone is talking to?

Is there the possibility that it's non-internet traffic waking my phone? In such a case, how can I go about figuring out what's causing it? Also if it's LAN traffic that should be easy to fix since it's happening on my home network that includes only my PC (always on), two boxes (HTPC, laptop, usually off), and the phone.

Also with regards to the intermittent thing...isn't more of the evidence the fact that a phone reboot solves it immediately? If it were LAN traffic causing the wake ups, they would not suddenly stop just because the phone reboots, correct?

I'm just trying to figure out what the best steps are for me to troubleshoot this issue for the next time it happens and appreciate your expertise on what's a waste of time/what else I might consider trying. One thing that's not an option is to just turn wifi off...when I'm home I want wifi on to use that instead of LTE. The other option is just to stay aware and reboot every time there's a plummeting battery...but the OCD side of me wants to fix it, not work around it!

Thanks again!
[BetterBatteryStats] Tungstwenty:
Well, if it's something that once it starts will start eating up the battery, but stops when the phone reboots (I might have missed this info before), chances are it might have nothing to do with multicasts.

What I'd do if I were you would be flashing a custom kernel such a Siyah and start from there. There are so many tweaks and optimizations built into them (drivers, fixes picked from other places, etc.) that I wouldn't be surprised at all if the mere fact of flashing a custom kernel instead of the stock one would eliminate that symptom altogether.
[BetterBatteryStats] iRide113:
Noob question... What does the blue and red parts each represent in the graphs? Also can anyone help me with my wakelocks?

Thanks in advanced.
[BetterBatteryStats] xelra:
You are doing it wrong. You need to aggregate all those mail accounts server-side.

E.g., I have about 100 mailboxes (I know it's a lot, but they became more and more over the decades) and they all go to my gmail account. In gmail I use filters and labels to put everything in its right place.

I have 3 special e-mail addresses that I need to be able to answer with. Those are 2 work addresses and a second main private address. You can setup SMTP for those and then you can answer back with the same address or compose with that address.

That's how you use gmail the exchange way.
[BetterBatteryStats] mammenj:
Recently I am having a major battery issue during non-use of the device usually from 11PM to 6PM. I dont remember installing any new app prior to not having this issue.

I am on cm-9-20120709-NIGHTLY-galaxys2 with LQ5 radio.

Any suggestion (except to flash the latest nightly, unless there was a battery issue specific fix in the latest nightly) to improve to the battery would be appreciated.:o

Attached the bbs dump.
[BetterBatteryStats] chamonix:
Yes, a plain unfiltered logcat
[BetterBatteryStats] chamonix:
Unfortunately that dumpfile does not show consistent data, maybe because of a bug that was present in RC3. Please go back to the stable version or update to RC4 and redo the exercise. The log indeed suggests a huge awake time and drain.
[BetterBatteryStats] chamonix:
yes: in processes there is "user" CPU time and "system" CPU time and for that we need two colors.

Sure, once you have read post #2 about providing dumpfiles and posted one
[BetterBatteryStats] mammenj:
OK, I will install the latest RC and report back. Thanks.
[BetterBatteryStats] chamonix:
I just want to make sure that I focus on the rights things for RC5.

1. eventX-YYYY is the last open bug

2. RC4 fixes the inconsistent 'since...' readings

3. Watchdog works fine

4. CPU States work fine

5. Network stats work fine

Please let me know if I have overseen anything or if I wrongly interpreted something as fixed that is not
[BetterBatteryStats] suku_patel_22:
Since screen off doesn't update.

I had screen off for 2 minutes.

Tapatalked from a Desire S waiting for Kernel 3 sources. WAKE UP HTC!!!!!!
[BetterBatteryStats] yhrn:
Hi,

I'm on RC4 and I sometimes get weird percentages under "Other".

As you can see Awake and Deep Sleep time spans add up to the total time span but the percentage only adds up to around 90%. I see the same thing in the 2x2 widget. However, when looking in BBS a couple of hour later the percentage did add up to 100. The screenshot is taken after installing RC4, rebooting, charging and unplugging.

EDIT: Oh and a question about the eventX-YYYY feature - where do you get the package name from? I see package names on RC4 but I don't understand how you find them with ps. If I do "ps w" on my phone I only see that YYYY is the system_server. This is no bug report I'm just trying to understand how you find different package names for events where only the X part differs.
[BetterBatteryStats] suku_patel_22:
Also, I am unable to set a custom reference.

Basically unable to set any reference

I am on RC 4

Tapatalked from a Desire S waiting for Kernel 3 sources. WAKE UP HTC!!!!!!
[BetterBatteryStats] vol2ume4:
The APK does not install on my Samsung Note

Thanks! I experienced the miracle.

:good:
[BetterBatteryStats] Karpfenhai:
Full Ack.

Confirmed working on Miui v4 on SGS+

Maybe you can suppress the second toast notification from watchdog?

I guess it will confuse some user.

Nicely done mate!

Tapatalked from my Samsung GT9100
[BetterBatteryStats] Karpfenhai:
Guys please plug/unplug or reboot your device!

The reference and the percentage should work then!

Tapatalked from my Samsung GT9100
[BetterBatteryStats] suku_patel_22:
Works now thanks

Tapatalked from a Desire S waiting for Kernel 3 sources. WAKE UP HTC!!!!!!
[BetterBatteryStats] Rob2222:
Hello,

RC4 still has _some_ problems with "since_screen_off".

Was going to bed, switched off wlan, entered BBS and took a custom ref and switched the phone off after some seconds.

Now in the morning "since screen off" has 8 more minutes then "custom ref" and also some WLAN use. Could not be normally.

File-Timestamps prove it. "Cust" ref was set x:51 and "SSO" ref was set x:43.

So "since screen off" wasn't updated at least at the last "switch off".

Also, I waited some seconds before entering BBS. Then I was going directly to dump "cust" and "SSO" reference. But it looks I was a little to fast with that. I was hanging for a millisecond, and I was thinking "huh, I was to fast?" and in the end I just see one dumpfile has 0 bytes.

I have also a "Exception: null" after "Added Deep sleep" and before "Retrieved Ref" in the StatsProvider logcat.

BR

Robert
[BetterBatteryStats] yhrn:
Hi,

If you were referring to my post about the percentage I wrote that I had both rebooted and plugged in/unplugged my phone and it happened after that.
[BetterBatteryStats] camspy:
Ok, explain it when possible

I already made changes as you suggested, I created one new gmail account and forwarded messages from 5 mailboxes to it with filters and labels. I also revised the other 3 mailboxes to merge some of the folders, so in the end I now have 4 mailboxes in Kaiten Email instead of 8 and 14 folders instead of 19. I hope it will have better results for me.

All my boxes are IMAP, so from what I know, POLL cannot be used without PUSH, first goes the PUSH.

Without JD (or similar app or tasker profile) I believe that WIFI will drain the battery more :(
[BetterBatteryStats] str0ppy:
Whenever I unplug my Galaxy S2 I get the following message:

BetterBatterysStats has been granted superuser permissions:

dumpsys alarm

Is this behaving correctly?

Thanks.
[BetterBatteryStats] Tungstwenty:
Yes.

If you're running SuperSU, I advise you to configure the per-app settings and disable the toast notification for BBS specifically, so you're not bothered by that message every now and then.
[BetterBatteryStats] xelra:
I've this bug, too. Everything else worked fine.

The time makes sense, but the percentage besides it is garbage.

And of course the order is wrong, since it orders based on the percentage.