yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] chamonix:
AFAIK those are cool, just make sure not to freeze any GSF stuff.

Especially if you have variations in the power usage it's very important to be very systematic: I recommend checking your phone in the morning, look at the awake / deep sleep ratio and the drain, and if you are unhappy save a dumpfile and post it here. There are quite some experience people here who can help you in analysing readings and help you get better at understanding them
[BetterBatteryStats] yhrn:
Hi,

I was experiencing pretty good battery life for a day and then I looked at the phone to see that the battery had dropped dramatically over a couple of hours (~20%). Looking in BBS I found that the KWL boot_hsic had kept my phone awake for almost 1½ hour. I've searched a bit on it but couldn't find anything interesting. I found it in quite a few BBS dump files by other people but only for a few seconds. Anybody know anything about this one?

Including the full dump file as it might provide some clues (not asking for any general analysis since I've used the phone quite a bit). Also, I have the new "Discrete wakelock reporting" feature enabled.

Dump file
[BetterBatteryStats] Tungstwenty:
Do you by any chance have a jealous wife/gf? :laugh:

---------- Post added at 06:47 PM ---------- Previous post was at 06:23 PM ----------

I was curious about this myself, especially whether the phone goes to sleep when no WLs exist even if there's processor activity.

I did an experiment of creating a .sh with pretty much a while(true). Launched in background with nohup & and top shows ~90% as expected.

Disconnecting USB and turning off the screen for a while, however, reveals that the process was put to sleep as long as the screen was off, and perhaps it did loop a bit more for the small intervals where modem, etc. woke up the cpu for short periods.

When turning the screen on, the (now famous) "main" KWL maintained the cpu awake and we can see on top or BBS the loop eating up the cpu cycles.

So my conclusion is that if there's no KWL, the device will basically suspend even with apps wanting to use the CPU.

Next I did another experiment, which was resetting the reference and turning the screen off. After a couple of minutes, I quickly checked the awake time (it was about 1m) and then the individual discrete KWLs times. The total KWL time was only about half of the time (30s) of the total awake period.

I suspect that in addition to the KWLs, there's additional kernel drivers "housekeeping" time such as powering up the corresponding devices, responding to IRQs within a certain time limit (might need to create a KWL for a lenghty operation), and those IRQ handlers also take wake time even if there's no KWL active during their operation.

The device can only wake up due to a driver request - be it an incoming wifi packet, modem, a physical button press, etc.

Do you find this conclusion reasonable, that at least for this short test the KWLs were only active for half the time that the power was on? Are driver IRQ routines responsible for such a big chunk?

Of course if a KWL such as USB Charging is there, the housekeeping time gets negligible in proportion.
[BetterBatteryStats] Jaromos:
Quote:

Originally Posted by Jaromos View Post

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

(sorry for the weird quoting...)

I'm using 2 accounts with IMAP & PUSH. in one account I have 4 folders, in the other I have 4 or 5 (even though I think I've changed it to one... need to check it).

I'm a new user, so I'm unable to attach any files nor add a link in my message...

This is a downloadable text file (which surprisingly is only readable within a browser and unreadable in the windows Notepad).

(please add "www")

filehosting.org/file/details/359843/IG7vjg8Sm5b3KFjh/BetterBatteryStats-2012-07-13_203827327.txt

I appreciate your effort.

edit:

BTW, in the dumpfile I've replaced the accounts names with ***. So I have one gmail account (with ***), and two IMAP-K9 accounts (campus & b***)
[BetterBatteryStats] Tungstwenty:
Searching Siyah's sources shows it's related with one "modem_if" driver, which seems to be related with USB (not sure if charger, controllers, etc.)

In addition to that one, the same driver also uses "l2_hsic" and "rpm_hsic", although in different moments apparently - makes sense, since they all appear in your stats and were not masked by the discrete mechanism.

(HSIC should stand for High Speed Inter Chip)

Do you have any idea what you might have plugged on the usb port that could lead to this?
[BetterBatteryStats] chamonix:
That's consistent with the purpose of PWL: the only guarantee that an app having something to process will not be interrupted. If it would be different the phone would never sleep

I don't know that much about what the kernel does in housekeeping so I can't comment on that. But I remember a little bit of what PM does when the phone wants to go to sleep:

- there are multiple states of sleep before deep sleep so the phone always go through a sequence of states

- related to going to sleep some drivers and irqs need to be shut down (display, touch, etc). This is fore sure a lot of instructions and I remember that if something in those sequences fail the phone raises in state again and starts the sequence from the beginning. So one transition to sleep may take multiple "loops" between those states (there is lot of posts, logs with PM debug on and much more in the xdandroid threads)

- alarms can wake up the phone to do something and even if there i no wakelock involved in this waking up and going back to sleep is an overhead: looking at this document with an excerpt of a post from Entropy512 I understand that that cycle alone takes 800ms

Even with no PM debug dmesg shows a little bit of that activity
[BetterBatteryStats] eddylee09:
How would I go about pin pointing the culprit?
[BetterBatteryStats] camspy:
Thanks for that, i didn't read and realize it all yet, as I wanted to show you two more dumps. I tried the settings of other guy who showed me how to use poll with imap emails and I did what he said (sorry I don't remember who it was atm). By following his suggestion I got my emails working with poll. This I know already made things better as you can see from the dumps I'm attaching here.

1st dump is with nothing changed but email boxes set to poll only, no push

2nd dump is with Google Maps installed, but freezed (I wanted to see if it helps the map fetching thing you said earlier)

This thing cloudtv.hdwidgets is HD Widgets app, I have one widget to show weather and it is set to sync weather every 4 hours.

For next test I will have it freezone to see if it helps.

Lightflow - I will look into it, will maybe reinstall it to see if it helps or not. But it's a very useful app so far.

Please take a look at the dumps
[BetterBatteryStats] chamonix:
Google would have told you that this package is related to wifi calling. I can't tell if your phone has native wifi calling of if you have a voip app using that stack but if you use search on xda you will find lots of thread related to that. Tip: search for "javax.microedition.ims"
[BetterBatteryStats] chamonix:
First dump: #1 is location

Second dump: #1 is location (so if you froze maps that demonstrates that maps is not the app going crazy on location)
[BetterBatteryStats] chamonix:
I looked at your dumpfile:

Since 20 h 1 m 25 s
Deep Sleep (): 17 h 28 m 5 s (62885 s) Ratio: 87.2%
Awake (): 2 h 33 m 19 s (9199 s) Ratio: 12.8%
Screen On (): 1 h 34 m 9 s (5649 s) Ratio: 7.8%
Phone On (): 26 m 33 s (1593 s) Ratio: 2.2%

Screen on + Phone on would be 2 hours but I believe you listened to music a little too. But even ignoring that your phone would have been awake about 30 minutes in 20 hours. I wouldn't worry too much about those or any wakelocks based on that profil. If you want you can post a new one after pluggin/unplugging USB and leaving your phone alone 4-5 hours. From that we may identify something but based on the current reading I'd advise you to enjoy your smartphone
[BetterBatteryStats] Karpfenhai:
Here is my latest dump plus logcat.

Funny the WL almost disappeared in the latest rc...

Don't forget to fix the carriage return ;)

View attachment logcat2.tar.gz

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

Tapatalked from my Samsung GT9100
[BetterBatteryStats] Tungstwenty:
There isn't any WL at all in your dumpfile :rolleyes:
[BetterBatteryStats] Karpfenhai:
Funny guy.. Need to open a browser to attach.. :screwy:

Tapatalked from my Samsung GT9100
[BetterBatteryStats] Tungstwenty:
Interesting info, thanks.

I also found some additional related stuff when looking into the meaning of the main KWL, mentioning precisely those intermediate states: http://www.mjmwired.net/kernel/Documentation/power/devices.txt
[BetterBatteryStats] yhrn:
Weird - I didn't plug anything into the usb port (100% sure about this) after I pulled it from the charger more than 12 hours before this happened. I really did nothing out of the ordinary - just the stuff I do every day when working. But could modem_if have anything to do with the baseband because I switched modems the day before to NELP4?
[BetterBatteryStats] cdmackay:
I mean to ask this before... would you consider please adding the ability to sort kernel wakelocks by wake-count, in addition to the current sort by count? I didn't see this request in the issues list...

thanks much indeed...
[BetterBatteryStats] jabz:
Hi I have attached my stats from my S3. This is overnight. I sync 5 email accounts Gmail is set to every hr, Exchange is set to every 15mins peak and 1hr off peak, peak is 8-5 m - f

Phone was 100% prior to going to sleep and in morning is 79%

Is this drain normal?

Thanks
[BetterBatteryStats] kmaq:
i have Samsung Galaxy S2, updated to official ICS 4.0.3 couple of days before, not rooted. battery life was not that good. So did a factory reset. still battery life is not that good. battery drain is there even if there is no much use. did not make any calls only internet usage (browsing, g+, youtube, facebook etc..) 9 hrs.

I have attached the batterystats log and battery usage. if anyone can pointout the issue it would be of great help as i dont understand the batterystats log.

Note: i have applied all the tips mentioned in this thread
[BetterBatteryStats] Tungstwenty:
It could be one of those situations already mentioned here when people are advised to clean the port (?)

I'm not 100% sure about it but looking at the sources this definitely looks to be related solely with USB and not the *baseband* modem. Perhaps tethering? Did you do anything like that before unplugging?
[BetterBatteryStats] yhrn:
No tethering, no new apps, nothing spectacular at all really. Some calls, some music listening, some surfing, etc. Of course I carry the phone with no case in my pocket all the time so there might have been some dirt in the port. I think I'll just try to clean the port and then write this off as a one off weirdness (until it happens again, anyways). Thanks for your input!
[BetterBatteryStats] Jaromos:
Thank you
[BetterBatteryStats] chamonix:
Sure: #202
[BetterBatteryStats] chamonix:
Exchange mail is keeping your phone awake a lot and waking it up too. This casues massive drain (20% awake)
[BetterBatteryStats] chamonix:
Since 9 h 15 m 52 s
Deep Sleep (): 6 h 19 m 56 s (22796 s) Ratio: 68.3%
Awake (): 2 h 55 m 55 s (10555 s) Ratio: 31.6%
Screen On (): 2 h 32 m 52 s (9172 s) Ratio: 27.5%

In this reading the only thing I can see is that your phone was awake because you have been using it.

If your concern is the drain when using the phone you should use at tweaks / tools to control your screen:

- disable auto brightness

- reduce brightness

- use screen filter / lux to adjust the brightness

If you are concerned about idle drain you should plug/unplug your phone and leave it alone 4-5 hours. After that post a "since unplugged" dumpfile
[BetterBatteryStats] chamonix:
Please post an attachement next time

Deep Sleep (): 1 h 31 m 52 s 92.4%

Basically your phone sleeps like a kitten.

Potentials I see:

- facebook: it's a known drainer, keep it (with the cost) or leave it

- if you keep wifi on all the time there are some negative side effects as this leads maps to do more caching: my advice: turn wifi off when you are not using it
[BetterBatteryStats] chamonix:
I have spent a few hours making greps and reading code and I came to the conclusion that everything is fine.

From the logcat I isolated the parts where the "current" wakelocks are substracted from the "reference" (in your case "since unplugged). While doing this I noticed a flaw in the logging as it was stating "Substraction ref from current" instead of "Substracting current from ref" but that's only formating so it doesn't affect us here.

A typical sequence looks like (I removed all non relevant KWLs, fixed the order of the output so it makes sense and did some formating):

I/StatsProvider( 3121): Reference used: Reference since_unplugged_ref created 2012-07-13 15:20:02

I/StatsProvider( 3121): Substracting [
-> "event4-1966" [ (0 s) Cnt:(c/wc/ec)4/1/0 0.0%],
-> "event5-1966" [ (0 s) Cnt:(c/wc/ec)0/0/0 0.0%],

from
[empty, there were no eventX-YYYY in the ref]

I/StatsProvider( 3121):
Result [
-> "event4-1966" [ (0 s) Cnt:(c/wc/ec)4/1/0 0.0%],
]

As you can see event5 has no time and no count so it seems pretty logical that it does not appear in the result since BBS filters out "zero" values by default (preferences can disable that)

This is consistent to the dumpfile showing:

"event4-1966" ( (system, com.swype.android.inputmethod)): (0 s) Cnt:(c/wc/ec)4/1/0 0.0%

I have checked the whole logcat and there were only those two eventX-YYYY there, event5 was consistently zeroed.

Conclusion: the last RC fixed the previous bug where the packages were added to the key, flawing the substraction.

We also know that the packages can change from the reference to the current eventX-YYYY if more apps have been waiting to that given event. We also know that we can not attribute the count to the packages as those are total at the KWL level.

This leads me to process following bug:

- when substracting eventX-YYYY KWL the package list should not the the package list of the current state of KWL but the concatenation of the package list of the eventX-YYYY from the reference and the package list of the reference eventX-YYYY KWL

Together with the CRLF in the dumpfile I expect - assuming the fix works - the next RC to be the golden candidate for a release
[BetterBatteryStats] chamonix:
Did I even mention that I have really fun doing what I do? :D
[BetterBatteryStats] kami2k:
@ torchedlh

disable google sync, facebook notifications etc
[BetterBatteryStats] chamonix:
Release 1.9RC6

Release 1.9RC6 is up (golden candidate). The changelog is in post #2.

Happy testing!
[BetterBatteryStats] kmaq:
thanks for your feedback. i have done all the tweaks mentioned in the thread. my main concern is the battery time. it just last over 12 hrs. will post the latest stats after 5 hrs.
[BetterBatteryStats] camspy:
I froze HD Widgets today, battery is pretty fine now, i would say, 6 hours and 90% left.

I will be tweaking Light Flow app to find the optimal settings to have it even better. Will post some new dump maybe tomorrow.

One thing bugs me - IMAP with just polling, if i set it to poll today's emails only, it seems that I'm not getting emails at all. If i set it to "3 days" i get 3 days worth of emails sent few times per day even if they all were read before and then deleted on the phone. If i set it to "6 days" i get 6 days worth of emails sent few times per day even if they all were read before and then deleted on the phone.

Anyone knows how to get just the most recent new emails without downloading the same stuff that was downloaded before?
[BetterBatteryStats] chamonix:
I never get am E-Mail twice (using K-9) and as long as "delete from server" is set te mails I delete on my client are deleted on the server as well. I am using two different IMAP servers (gmail and my private one) and run K-) with poll. I suggest you take the questions about setting up your mail client to the proper threads and focus on whatever is related with BBS here.
[BetterBatteryStats] mariotme:
Chamonix can you point me out to a guide to reduce the silly wlan_rx_wake wake lock. Its been driving me crazy! I tried looking around with no success
[BetterBatteryStats] chamonix:
http://xdaforums.com/showthread.php?t=1308030
[BetterBatteryStats] gollyzila:
It's like detective work, isn't it?
[BetterBatteryStats] chamonix:
it is! Plus at the end of the day you see what you have written/solved/found. That's quite a good balance to my job
[BetterBatteryStats] mariotme:
Chamonix i pulled a little log by using wireshark but i cant understand anything from it lol.

Can i upload it for you to have a look? sorry for being a total noob here :eek:
[BetterBatteryStats] chamonix:
I can't help on that neither. I have used wireshark years ago but I am no specialist. You should take that to the appropriate thread
[BetterBatteryStats] mariotme:
hehehe alright bro will do :)

thanks
[BetterBatteryStats] Karpfenhai:
A good start would be setting a static IP on your phone, tell it also to the router.

Increase beacon interval a second step 150ms should be good.

Good luck!

@Sven, rc6 performs fine so far!

Tapatalked from my Samsung GT9100
[BetterBatteryStats] nam3less:
Alright, I'm back. sorry it took so long.

Still the same issue. Screenshot is attached and I've linked you to the logcat from my dropbox since it exceeds the .txt file size limit. I am installing RC6 now and will clear the logcat and retest for you. The log cat is a full log cat since I forgot to clear it this morning so it probably has a couple days worth of data on it. I do apologize for that.

http://db.tt/FuqjE8Fj

Let me know if you have any issues seeing these.

I'll report back with RC6 findings and a new logcat probably tomorrow afternoon unless i get back to my comp late tonight.
[BetterBatteryStats] jtcady:
I love this app by the way :). I use it to test the battery consumption of my apps as well.
[BetterBatteryStats] Steven6489:
Hi all,

Based on the BBS, is that mean line is draining my battery badly??

Anyone using line that have so much wakelock?
[BetterBatteryStats] jeremysherriff:
Hi all, bit of help please? The issue is clearly "wow_wake_lock" but I can't find any useful information as to what this is, and how to prevent it.

My Googling has led to indications that it is tied to wifi activity, but I have found nothing concrete.

Dump file attached via Dropbox: http://db.tt/jYVFQb7T

Any help much appreciated.

---------- Post added at 12:44 PM ---------- Previous post was at 12:41 PM ----------

It could be, but it *looks* like only 37s out of 5hr is from alarms, and line is simply the biggest alarm count.

You might want to post a full dump file for us to analyse.
[BetterBatteryStats] Steven6489:
Thanks for your reply..Actually what is the count mean?

Kindly refer below for the dump file..
[BetterBatteryStats] jeremysherriff:
The count is literally the number of times the app has done some background task. The phone may or may not have been awake already.

Sent from my GT-P7510
[BetterBatteryStats] rk249:
I've disabled fast dormancy by editing my build.prop, but I still get the secril_fd-interface wakelock. Any fix for this?
[BetterBatteryStats] iamnotkurtcobain:
Which rom? What did you edit?

Gesendet von meinem GT-I9100 mit Tapatalk 2
[BetterBatteryStats] EH15:
Hey can someone check out my BBS log and tell me what's draining my battery? This was with 1.5 hours of screen time too. Although this is my first ICS rom since upgrading from GB, the battery life shouldn't be this bad should it? I can't even last 15hrs now compared to at least 24hrs before.
[BetterBatteryStats] rk249:
I added ro.ril.fast.dormancy.rule=0 to my build.prop and deleted the .bak file but till have that wakelock. Ive tried AOPK & Sammy roms but it doesnt matter, that wakelock is always there. Ive even tried *#9900# on sammy roms, even that doesnt work. Right now I'm on rootbox 1.6. I have a Galaxy S2 AT&T I777 unlocked. Using it in India. Any help would be greatly appreciated.
[BetterBatteryStats] Rob2222:
@All:

Does someone know when/why "battery-monitor" kernel wakelock occurs on SGS3? It's in the battery-driver kernel source.

Here is a dump (not mine), where "battery-monitor" is 1:23h out of 9h. But there is wlan_rx_wake for 1:30h, so maybe battery-monitor is just a side effekt from wlan_rx_wake?

Dump: http://www.loaditup.de/files/720970_qpdaw6smyd.txt

I just wonder if the 1:30h wlan_rx_wake come from a noise wlan network or from the phone itself (data transfer) cause facebook and maps count are not that high?!

@Chamonix:

I sent you two debug cases for RC6 with a set of files via PM.

One time the dump information of "since custom ref" include more time/data, than time was gone by since setting the custom ref. Could not be.

Other time the SSO-ref was not set at last screen-off and also, it included more time than it should. More infos in the files.

NOTE: All included dumps were done with siyah 1.3.8 and exclusive kernel wakelocks enabled.

Can someone say, how this logcat system works? Does a unfiltered logcat include always all information since boot?

Some logcat apps can "clear" the log. Do they really clear the log or do they just set a timestamp when hitting "clear" and then just show information from that time and later? (Then other logcat apps should still get the whole log, right?)

Best Regards

Robert
[BetterBatteryStats] chamonix:
I don't know line but you should explore the settings to find out what settings brings it to waking you your phone twice a minute.
[BetterBatteryStats] nobnut:
Here is a flashable zip which I edited to remove BBS, it also wipes the Dalvic, so subsequent boot takes longer. It contains its own busybox. I have tested it and it works fine. Chamonix, maybe you want to test also before you do anything with it. I was able to redownload from the Market after flashing :)

Assumptions:

1. BBS is stored on Data

2. The filename is 'com.asksven.betterbatterystats-1.apk'

If either of the above is not correct, the 'updater-script' and 'romcleaner.txt' inside the zip can be edited accordingly.

Credit here for original script. (See, giving credit isn't that hard ;))

@everyone else not on Litening ROM, no need to flash this.
[BetterBatteryStats] Plopz:
Just so we're clear, to set the custom reference, you hit the menu button > custom reference, correct?

It seems to happen all the time now... plugged or unplugged

- However, if I set the reference and exit the app through the home button, it remembers my reference.

- If I set the reference then exit through the back button, it will not remember my reference.
[BetterBatteryStats] ejstubbs:
Just purchased from the market. Very useful app, much better than the standard one.

A few observations:

The "time since stat began" for "Since charged" and "Since unplugged" are vastly different: 38d 10h 40m 18s vs 6h 10s. Is this expected?

The "time since stat began" toggle only seems to take effect by exiting and restarting the app (minor but I thought I'd mention it).

The "Default stat" and "Default stat type" setting don't seem to have any effect: it always starts up showing "Process"/"Since charged". If you go in to Preferences, though, the settings are as I set them. It just doesn't seem to be taking any notice of them!

Speaking of the standard battery use tool, does anyone know of any way to get the Gingerbread battery use graph - which shows the Wi-Fi/Awake/Screen on/Charging timelines - on Froyo?
[BetterBatteryStats] chamonix:
Thanks for the précisions. Obviously it's not the expected behaviour as the OnPause even used for saving the state is supposed to be triggered in both cases. It should be easy enough for me to reproduce and I will deliver a fix together with some other bugs that are already fixed as soon as I can.

Thank you again for the great help making bbs a better tool