yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] chamonix:
l2_hsic wrapup

In my todo list I have an entry to add a wiki page on l2_hsic but after browsing the thread I come to the conclusion that we may not have the definitive answers yet.

Part of the information I found related to http://en.wikipedia.org/wiki/LAN_switching and puts that wakelock in the Wifi category. Now I also found that a possible remedy to it is to change the wifi sleep policy to not be always on, or go for a static IP to avoid DHCP ack/renew traffic.

Other reports are about the relation between that wakelock and certain apps, without being specific when it comes to what aprt of an app could cause that (maybe monitoring network traffic).

Any insights?
[BetterBatteryStats] Laynee1:
So i have set custom ref. and after aprox a hour of not using phone i see this:

Thanks guys
[BetterBatteryStats] chamonix:
And what is the question to that? please post a dumpfile
[BetterBatteryStats] Laynee1:
Sorry. I will do as it was said in first post, and then leave a dumpfile. Sorry for me being stupid
[BetterBatteryStats] bordikun:
app crashes when opening after updating to latest aug 4. tried uninstalling and installing same problem persists.

Sent from xda premium powered by GT-I9300 :D
[BetterBatteryStats] M.A.K:
I've installed 1.9.2.1 and done a dump and logcat. Again, the dumpfile is created but empty (0kb) so not much point in uploading that.

I've uploaded the logcat. This one's in long format.
[BetterBatteryStats] chamonix:
Send me a logfile or I don't believe you
[BetterBatteryStats] Cyclu:
Force Close with latest version 1.9.2.1 from Play Store.
[BetterBatteryStats] bordikun:
don't know how to do that.

someone already put a review he has also problems after updating

Sent from xda premium powered by GT-I9300 :D
[BetterBatteryStats] chamonix:
Package signer generated a corrupt APK. 1.9.2.2 is up with version number increased to make sure everyone gets the notification
[BetterBatteryStats] nobnut:
LOL

I'm too late. I was just about to post a logcat.

Thank you for the update Chamonix... I hope all is well with you :)

Take care!
[BetterBatteryStats] chamonix:
Thanks! I am good and I hope you are too :)
[BetterBatteryStats] xvs1100:
Since upgrading via google play to the newest version today, bbs is always crashing immediately after starting the app. I'm on a galaxy note with criskelo's rom v11.

All previous versions of bbs ran fine.

Now i'm trying to restore the last running version.
[BetterBatteryStats] chamonix:
Or you could read a few posts back and wait for the update to be replicated by google
[BetterBatteryStats] Vangelis13:
Update is there. Clean the cache & data of the play store and try again.
[BetterBatteryStats] Karpfenhai:
Sven would you mind to read my current dump, it seems i got strange values the first time too:

View attachment BetterBatteryStats-2012-08-04_142218844.txt

Thx in advance!

Tapatalked from my Samsung GT9100
[BetterBatteryStats] Simba501:
Can anyone impart knowledge regarding . . . _ALARM_WAKEUP_SENSOR_COLLECTION_POLICY (maps)? I've tried doing everything I can think of to lower it (aside from disabling the maps service altogether) and it still persists. I am also unable to find any information regarding it. The screenshot is to just show its name; the number of wakeups in the picture is not typical for what I usually see (normally higher).
[BetterBatteryStats] chamonix:
Could you please attache a dumpfile? Did you have wifi on during that reading?
[BetterBatteryStats] Rob2222:
On my 3G overnight dumps (90-95% deep sleep) in indiscrete mode with my S3 I can see _roughly_ the following wakelocks:

-multipdp

-secril_fd-interface (80-90% time in seconds of multipdp)

-l2_hsic (~50% time in seconds of multipdp)

On WLAN, it is the following:

-battery-monitor

-wlan_rx_wake (~60% time in seconds of battery-monitor)

-l2_hsic (also ~60% time in seconds of battery-monitor)

This schemes matches for most (or even all) of my overnight dumps.

Cause of that, I would not stick l2_hsic to WLAN only. For me it's clearly related to data traffic, but not only to WLAN.

Chamonix, one more feature idea, if you maybe like it:

A new menu entry like "Start recording & autodump".

-When you hit it, it checks if the phone is disconnected, if not, write an errormessage

-Then display something like "Hit powerbutton now and do not use the phone for as long as possible"

-*User its power* (Since screen off reference get created)

-IDLE TIME

-*User its power* or Screen goes on

-Directly/automatically create a dump "since screen off"

This way the use can almost nothing make wrong. And even more, the dump does not record the seconds from switching the phone on until the user selects create dump. This idea is similar to the auto-freeze on screen on idea.

If you like it, make it a feature suggestion, if not, just forget it. :)

BR

Robert
[BetterBatteryStats] hyperbolic:
I read here that a lot of ppl have com.android.exchange.Exchange wakelocks.

Besides changing in the sync settings instead of Push to every 4 hours (for example), is there another solution ?

Maybe a better email app for other mail service that isn't gmail ? (Hotmail etc..)

Thx.
[BetterBatteryStats] Laynee1:
Can you glance at my dump file? i left phone untouched after unplug for about one and half hour.

Thanks in advance
[BetterBatteryStats] GabrielSousa:
this last version dont show nothing on kernel wakelock, how i solve this ?
[BetterBatteryStats] chamonix:
Nothing or an error? What does the error say? What reference? Have you plugged / Unplugged?
[BetterBatteryStats] DJCrapsody:
Did you reboot your phone?
[BetterBatteryStats] mzaur:
Yes. I have plugged/unplugged and rebooted.

The problem is present right away. In 1.9 it would sometimes show stats after a length of time.. but now with 1.9.2 it always says no reference.

Location like where I live? I live in US.

I attached logcat and dump file
[BetterBatteryStats] chamonix:
Have you plugged/unplugged and rebooted or the other way around? at boot the references are deleted to you must plug/unplug after boot.
[BetterBatteryStats] mzaur:
Ok it seems that after I reboot and then plug/unplug, it is showing stats. After just a reboot, it shows no reference. I don't remember ever having to do plug/unplug after boot. It used to always show stats after boot for me
[BetterBatteryStats] chamonix:
Yes it used to show stats, before v1.9 but they were inconsistent. I added that to the FAQ in post #3
[BetterBatteryStats] mzaur:
Ok, thanks. Sorry didn't see that faq.

Is it possible to have a "since boot" reference?
[BetterBatteryStats] chamonix:
https://github.com/asksven/BetterBatteryStats/issues/209
[BetterBatteryStats] GabrielSousa:
yeah
[BetterBatteryStats] xvs1100:
OK, bbs now runs fine again after newest update from google play. Thanks for the fast response folks.

Bbs is such a helpful peace of software.
[BetterBatteryStats] osm0sis:
Nice! And could it fall-back to "since boot" if no other reference point can be found? (ie. it's been rebooted since being taken off charger)
[BetterBatteryStats] salleq:
Actually, colornotes seems to have kept your phone awake for 13 minutes, and I wonder why (doesn't seem like a notepad app should keep a phone awake?). If you fixed that, you might get even better battery life, but to be honest, it won't go MUCH more better anymore ;)

EDIT:

here's some screenshots I took from almost perfect nights!

https://www.dropbox.com/s/a5dt8d9tm6r7oda/2012-08-02%2006.31.07.png

https://www.dropbox.com/s/k4h4opv7jrzwdxp/2012-08-02%2006.31.00.png
[BetterBatteryStats] DJCrapsody:
How about plugged/unplugged?
[BetterBatteryStats] chamonix:
First draft of the how-to (high level) added to post #3
[BetterBatteryStats] chamonix:
Release 0.9.0

Version 0.9.0 fixes the pupup-bug, the missing refresh after changing preferences and there is a goodie (new feature).

Enjoy
[BetterBatteryStats] nobnut:
Thanks for the update.

I am not sure how easy (or not) this might be to fix but Google have blocked some apps on devices with non standard dpi settings.

If I want to upgrade (or even download) BBS, I first need to reset my dpi setting and reboot. Is this something that can be resolved from within BBS? Yours is not the only app affected in this way. Some apps are OK, others have this problem.

Thanks again.
[BetterBatteryStats] chamonix:
I'll have a look into device properties and see I if can losen or remove any requirement on resolution/density
[BetterBatteryStats] nobnut:
Thank you. The new dump properties work well :)

Sent from me to you using stuff
[BetterBatteryStats] XlAfbk:
oh, so that's why i'm not seeing some apps i'm supposed to see...

btw: when did you change the apps icon? liked to old one (large battery) waaaay better than the new one (actually hate the new one)
[BetterBatteryStats] nobnut:
LOL

Design a better one then.
[BetterBatteryStats] XlAfbk:
There was nothing wrong with the old one imho.
[BetterBatteryStats] jawz101:
I'd like to suggest Android Wake Lock Analyzer for a new name if it's legally possible.

1) keep the battery icon so it still has reference to battery savings.

2) it differentiates itself from the 1000's of battery juicer apps out there.

3) it will attract app developers and the more technically inclined who are willing to pay for something. Otherwise it'll have to be free with advertisements. The more technically inclined will use it to fix their problems and also use it as legitimate proof to critique poorly developed apps.

4) If it's possible to use Android in the name it'd be found just as easily, if not easier, than searching for battery. When I look for Titanium Backup I don't search for "backup" I start by typing titanium and by the time I get to tit it's pulled up.

People who learn of your app will search for battery and give up because they are presented with a bazillion apps and then start downloading things until they find it. When I learned of this app a while ago I was skeptical, then I was having to remember what it was named. I was like it's "Battery Something", then it was "Something Battery Something", and then "SomethingBatterySomething", next "BetterBatterySomething" and finally "BetterBatteryStats".

Skeptics learn that an app that constantly polls to turn off 3g and whatnot kinda works against the purpose of the app. This type of app obviously spurs discussion as there's this huge thread in front of us. I doubt people discuss juice saver apps with much follow through except "take my word for it" as proof.

I wrote a lot more here but my damn browser locked up. I really think of this as an app for the tool bag rather than an attempt to save battery and take the devs word for it. In my mind the word battery in the name discredits more than it differentiates. It's something I'd download first every time I upgrade my ROM- which is what every person on this thread is doing right....now.
[BetterBatteryStats] nobnut:
Good, solid reasoning there!
[BetterBatteryStats] jawz101:
I was going to have a little fun with it. I was thinking with the renaming campaign he could have release notes that say 'complete code rewrite' and then have a really slow progress bar scroll across the screen before it shows results and then every few weeks update it to make it scroll a bit quicker until it finally is gone again. That'd be cool. I like progress bars. My work Samsung phone has a sssslow progress bar when I erase my call logs. It makes me feel like I'm doing something fantastic to my phone. I guess that'd be a sneaky gimmick for the regular juicers though.
[BetterBatteryStats] chamonix:
The old one was from a free collection of icons, the new one was designed by one of our peers and I like the new one better for many reasons
[BetterBatteryStats] nobnut:
Hehehe...

You reminded me of an old friend of mine who worked in the IT sector (some sort of programmer - don't ask me what language). He told me one time about a manager at his work who was complaining that the software that my friend had been working on was good but that it worked 'slowly'.

My friend just speeded up the waiting and loading animations and made no code changes at all...

The boss thought that as the icons were now spinning faster and moving quicker that the system was running faster.

It goes to show how much of what we actually take in is real, as opposed to perceived ;)
[BetterBatteryStats] chamonix:
Ok so the answer seems to be: yes we can!

Here's some interesting reading for you guys:

http://developer.android.com/guide/appendix/market-filters.html

http://developer.android.com/guide/topics/manifest/supports-screens-element.html

I'm going to try the following:

<supports-screens android:resizeable="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>

except if someone has a tablet with large/xlarge screen and tells me I shouldn't do that because the app looks crap. IMHO the app will run and everyone should have a chance to be able to use it.

This change will happen with next version,you can track it with issue #27.
[BetterBatteryStats] nobnut:
I'll test on my Xoom, but I think it shouldn't be a problem.

Thank you Chamonix! I wish every other Dev would do likewise :)

Hopefully this will increase your app's presence on the Market also now. More people/devices will be able to search for it... or just find it by accident whilst searching for something else!

EDIT: Maybe start pushing this app in some of the tablet forums also ;)

EDIT 2: BBS has always displayed well on my Flyer (7 inch screen)... I confirm it displays just fine on my Xoom (10.1 inch screen).
[BetterBatteryStats] ejstubbs:
Thanks for the recent updates, and for the first draft how-to.

I took some screen shots today and I'd appreciate any guidance that people might be able to offer:

So time awake is vastly more than time with the screen on. This is very bad. So I go look for what's been holding wakelocks:

Now I need to understand what ProviderThread is, so that I can make a change to stop it doing its bad thing. (FWIW this process shows up in the standard Froyo Spare Parts Battery History as "UID 10002".)

Anyone got any clues???

Lastly, this doesn't look right to me:

So it's been 42 days since my phone was charged? I don't think so! The Froyo Spare Parts Battery History (which incidentally is also available from within Battery Monitor Widget) offers "Since last unplugged" and "Total since boot". The "Since last unplugged" time matches the "Since unplugged" time in BetterBatteryStats, so that looks fine. "Total since boot" is a bit over one day, which is correct.

Nothing seems to match up with BetterBatteryStats' "Since charged" time, though. Where is it getting that information from?
[BetterBatteryStats] chamonix:
Thank you for the feedback. I compared the constants for the different "Since...." values between Froyo and Gingerbread and there is a mismatch there. I guess that's the reason of the discrepancy: the constant passed to the batteryservice is 0

public static final int STATS_SINCE_CHARGED = 0;

and I guess I'll have to check the match between Froyo's and GB's constants here. I have taken this up as a bug and you can track it unter the number #28.

Now back to your analysis: first I must say it is flawless!

The Wakelock held by ProviderThread is indeed impressive so now let's see how we can find the cause.

The ProviderThread is part of the ContentProdiver mechanism of Android, you can read more about it here: http://developer.android.com/reference/android/content/ContentProvider.html

A content provider is only required if you need to share data between multiple applications.

In the processes I noticed you have a motorola and I've found following related problem: https://supportforums.motorola.com/message/410400

I'm not saying it's that one but just guessing as I don't know if you use yahoomail. There has been major drainers from facebook to flickr in the past, all related to synchronising data or contacts using content providers.

What I suggest is that you first make sure the problem can be reproduced and then:

a) check for market updates for all your sync providers

b) recheck with updated version

c) disable them

d) enable them on by one till you get the one causing trouble

Hope this helps
[BetterBatteryStats] subworx:
Hi there,

Thank you for this useful app and especially the explanation in post #2 ;)

I'm using BetterBatteryStats xda edition 0.9.0.0.

Phone: HTC Desire Z (European T-Mobile G2)

ROM: Virtuous 2.0.0 (Android 2.3.3) with Sense

Please see the attached screenshot, all my bars are grey, no matter what the values say.

Could it be because I used UOT Kitchen to mod the volume and download bar colors, as well as added overglow and other stuff?

Unfortunately I have no backup left of before using the UOT mod so I cannot say if this is the cause.

I did not change anything else like density.

Would be really nice if you could look into this.

If I can be of any help, e.g. logcat, please let me know.

Kind regards,

Sub
[BetterBatteryStats] chamonix:
thanks for the feedback.

From the screenshot I assume that you are using a higher density than stock. I have added an option to force the size of the bars (preferences - advanced) addressing this and I hope it helps. If not please provide a logcat so I can check what is wrong with the rendering of the canvas (bars)
[BetterBatteryStats] subworx:
Thank you very much, this did the trick.

Changed it to 8 for full size bars.

Now I also know Virtuous runs a non-default density - maybe it's the Sense ROM default though, no idea.
[BetterBatteryStats] chrone:
Thanks for this apps, really helps analyzing what caused the drain. :good:
[BetterBatteryStats] Simba501:
The issue seems less pronounced overnight. But maps is still an issue. Throughout the course of a typical day, sensor collection policy is off the charts. I'm not sure what changes from sitting over night through the day that exacerbates it.

And wifi was not on (neither was it for the dump). I've been watching this for a while and it seems to occur completely irrespective of wifi status.

I've also attempted to find definitive information on time_tick to no avail.

http://dl.dropbox.com/u/22858025/BetterBatteryStats-2012-08-05_090534745.txt
[BetterBatteryStats] xpanmanx:
I switched from push to 15-minute polls. Not ideal as i get my business email on my phone but doing this calmed down the Exchange wakelocks.
[BetterBatteryStats] igalan:
After following Karpfenhai advice, the battery life of my wife's SGSII has increased dramatically. Now after over 11h mostly idling, battery goes down 10% vs 60% before. Now I only have to find out whether it's the Google backup, or location and which app in this case. So thanks, again, dude :) .
[BetterBatteryStats] Karpfenhai:
You're welcome mate, your feedback is much appreciated!

Tapatalked from my Samsung GT9100
[BetterBatteryStats] chrone:
Dear Karpfenhai,

How to disable Latitude on vanilla Jelly Bean? I only found to do not update my Location, disabled sharing my Location, and disabled Location History on the Maps & Latitude settings.
[BetterBatteryStats] Karpfenhai:
Yeah that's it , just sign out latitude and disable all location based services and you should be fine.

Normally network based location should be okay (passive) only gps based are bad (active).

Try altitude if you need to be located :).

Tapatalked from my Samsung GT9100
[BetterBatteryStats] riskaa:
Hi Karpfenhai,

Could i pick your brain for a moment please?

I'm on Vibrant and a Team Passion (Chimera) ROM.

I installed Google Now for ICS and am trying to play with it.

I also installed Altitude, and disabled Latitude.

In my location services, I have 3 options.

Google's Location Service

GPS Satellites

Location and Google Search

Which of these do i need to check to have a working Google Now?

I'm confused by the difference between Google's Location Service and Location and Google Search.

Could you please explain these to me?

Thank you,
[BetterBatteryStats] chrone:
thanks for the tips, but still I could not find the Log Out option from Latitude settings.
[BetterBatteryStats] Karpfenhai:
Since i dont use google + i dont have a reliable answer for you, but why does it need your location to work? I think there are tools to setup a fake location for such purposes. You should search for an app which is able to provide the location for google + by using your cell towers.

I think this can be found within the maps application, but not using should be sign out anyway or?

No clue, never used ;)
[BetterBatteryStats] chamonix:
Googles location service is what you want (that would be cell/wifi location). Google Now will tell you that latitude is set to manual (as you use altitude) but will still work as designed (I get my train schedules on my gnex)
[BetterBatteryStats] hyperbolic:
I tried almost every email app for my hotmail account.

K9 and TouchDown aren't working right, Enhanced Email has the same wakelocks and few more I don't remember.

I am now working with Maildroid which is pretty good with the wakelocks (when setting up to every hour), I tried push - which supposed to be battery efficient but it has some unwanted wakelocks BUT less then the stock...

Tomorrow I am going to try the official Hotmail app and after that -> Secure9 Mail,ProfiMail and will look for more apps.

All that just to find a worthy app that "sits" at the server and doing the push method correct, which is waiting for the server to push mails!

Btw I didn't have that problem using Gingerbread...which is frustrating.
[BetterBatteryStats] superbobup:
+1 for ALTitude, great app :)

Question though...how 'bad' is active location service/GPS? I've found that only running the app (such as Maps) with GPS enabled uses it...otherwise it isn't in use. Is this not true?
[BetterBatteryStats] Karpfenhai:
It depends, gpsuse will need power, so it will cause battery usage, how much and if you can live with that is up to you, people are coming here to save as much energy as possible, so we try to reduce the cause as much as possible ;)

Many apps are requesting location information, if enabled, these apps are "sneaking" all the time, for what reason? i dont know.

FB will use it per example, afaik whatsapp too, call me superstitious but i dont want to be located..;)

It might be interesting to count the userland WL with gps enabled vs. off for a while..
[BetterBatteryStats] sam3000:
But the problem *only* occurs with BBS. I use plenty of other apps on cm10 that require root and they work without issue.

I'm not saying I think the problem is BBS but neither do I think it can be categorically ruled out.
[BetterBatteryStats] MattyDip:
With latest Checkrom v. 4 my battery drains very fast and I don't understand why. Never had this problem before on GS3 with older roms. I tried three different kernel but nothing changed. Thanks
[BetterBatteryStats] chamonix:
Well it really depends on the apps you are running. I have seen weather widget requesting for fine grained location (!)
[BetterBatteryStats] Laynee1:
Can any one check this dump file?
[BetterBatteryStats] chamonix:
I don't assume anything either and would be happier with a fix than a workaround. I have contacted the author of superuser (chainsdd) about that.
[BetterBatteryStats] nobnut:
There do appear to be some inconsistencies with Superuser for *some* apps running on JB. For example, Franco's kernel updater app has a problem with Superuser (as opposed to SuperSu) and also the most recent changelog for PGM contained a fix for the app starting at boot correctly when using Superuser.
[BetterBatteryStats] Rob2222:
@Chamonix:

Habe you seen this? :cowboy:

BR

Robert
[BetterBatteryStats] Tungstwenty:
Just for the record... I also saw the teaser from chamonix :D

I had a look at kernel sources and tried to understand the flow of events leading to lock/unlock of l2_hsic. Unfortunately, and unlike others I previously analyzed, I wasn't able to understand just from the static analysis what conditions lead to its use :(

At least for now, I think the best info we might have is based on the observed behavior, such as the one provided by Rob.

BTW, I also think this KWL is not related to wifi directly but all data transfers.