yashsingh1/xdaforums huggingface dataset:
[AT&T Samsung Galaxy S II SGH-I777] rhornig:
GPS Status and Toolbox - battery usage

Hi all,

I'm the author of GPS Status and Toolbox mentioned also on the first post.

I'm receiving several complaints about the battery issue and investigated the reports, because GPS Status was designed explicitly NOT to run in background. It does not have services, alarms, does not start at boot. In fact once you close it, it cannot be activated without user interaction.

Also it was strange people were reporting excessive use when they have not used the app at all. Here are my findings:

It seems that the battery measurement routines are buggy in android (ICS still has this bug). The battery measurement service registers when an app starts using a sensor, but sometimes forgets to unregister this when the app releases it. (even if you kill the app's process). When the battery use is displayed the battery screen calculates the battery use by adding up the different ways a program can consume the battery (CPU, GPS, network radio use, and sensor use). The sensor use is basically calculated by subtracting the last sensor start value from the current time and the difference is multiplied by the sensors power requirement (per second). Because the system does not de-registers the sensor use correctly some programs are treated as using the sensors while in fact they are not even existing as a running process. As time passes this 'phantom' battery use grows even relative to the rest of the system's power use.

In short this means that when the device is in sleep mode and consumes almost no battery, the calculation assumes that the sensors are still running. This results in increasing battery use reports for apps that use sensors.

This does not happen always, but I was able to reproduce it with practically any app that uses several sensors. The effect is most visible on Samsung phones because I guess samsung assigns higher power requirement values for the ensors than other vendors.

Long story short, DO NOT trust the battery usage display. It may give you an indication, but it is just a guess. (however seeing the code, the CPU usage statistics seems to come from the kernel so they are much more reliable).

As a rule of thumb, higher battery use should come with higher CPU use. If you see high battery use for a task that hast consumed only low amount of CPU then chances are that the battery use is not correctly displayed.

Hope this helps
[AT&T Samsung Galaxy S II SGH-I777] rav4kar:
Entropy,

fyi. this is same shark dump what I posted in DD Kernel thread
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Thanks for the info - I must admit, I hadn't had time to investigate, but I had started noticing strange and inconsistent behavior. In one case I'm fairly certain the battery WAS draining and a wakelock was in play (deep sleep was being inhibited) - in other cases I think it was a red herring and it was an indirect relation (GPS usage sometimes caused another power management bug to trigger), and you've now confirmed that in many cases it's just a reporting bug. I'm moving this into a new "You think you've got drain but you don't" category.

Thanks for the great app by the way. It's always one of the first items I ever install.

Also, higher battery use doesn't always come with high CPU use - some notorious drainers (such as Facebook) hold wakelocks - very little CPU but still a significant contributor to drain. ICS makes some major improvements to wakelock accounting though.
[AT&T Samsung Galaxy S II SGH-I777] rhornig:
Thanks for the thread. It's really useful. One more comment: The battery reporting bug related to sensors cannot survive a reboot. If you suspect that this bug is at play, just reboot the device and your reported usage will return to normal. (i.e. this is related to somehow to stale data in memory)
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
I think some of the bogus data will remain (e.g. the app will be mis-blamed for consumption prior to the reboot) - but continued accumulation of bogus data will stop.

Of course, charging to full will clear it.
[AT&T Samsung Galaxy S II SGH-I777] jhermit:
+1 on ESPN being a horrible battery drainer
[AT&T Samsung Galaxy S II SGH-I777] JustinW3:
I know but it seemed very odd to me because that's the only time it's ever been anywhere near the top of my usage list, and there were no updates done to it or anything... I uninstalled and reinstalled, problem seems to be gone now.
[AT&T Samsung Galaxy S II SGH-I777] F1reEng1neRed:
Thanks for the info and thanks for the awesome app. As Entropy said, always one of the first to get installed.
[AT&T Samsung Galaxy S II SGH-I777] Bieniu:
Hi,

Please help with my battery drains. I did like in the instruction: charging to full, restart and reset CPUSpy statistics. The phone was lying unused for 6.5 h.

Battery Drain from 100% to 65%

Deep Sleep 38%

200MHz 36%

500MHz 8%

800MHz 16%

I use stock XWLA4 rom with Siyah 2.6.7 kernel.

MODEM XXKI4

GPS off

BT off

Here are my BBS, wakelock, dmesg and Shark dump.

Thank you for any help.
[AT&T Samsung Galaxy S II SGH-I777] JustinW3:
Just thought about this... I'm not sure if it's still a problem on this phone like it was on my Infuse 4G. But samsung's bloatware has this service that runs called DRM Content on the I777. It was called OmaDRMconfig2.exe or something like that on my Infuse. It keeps the screen from every actually going into a sleep mode and it drains your battery really quickly, not as bad as the KK6 bug, but still pretty bad. Unrooted users can go to Settings>Applications>Running Services. Find the "service" I mentioned above and Stop it. Be aware that any time you reboot your phone it will restart itself again. Rooted users, you can use TiBu to freeze it.
[AT&T Samsung Galaxy S II SGH-I777] nitox.n2o:
I seem to have come across a wifi-associated battery drain issue on XWLA4 (CheckROM v6). With wifi turned off overnight, drain was less than 1%/hr. This is what happened after turning wifi on:

At the time of that screenshot, top two battery usage stats were Android OS at 47% and Display at 23% (1h10m screen on time).

Significant kernel wakelocks from BBS: svnet (2h3m), wlan_rx_wake (1h56m), wlan_rx_wake (1h26m), sec-batter-monitor (1h24m)

I've attached a zip containing dmesg.txt, wakelock.txt, and a 10 minute shark capture during which time the phone dropped 2%, so I'm hoping whatever the culprit is was caught in that time.

Concerning relevant installed apps: I do have both Words and Hanging with Friends installed. However, the drastic difference in battery drain between wifi on and wifi off makes me believe that there is something else at play here. If I'm wrong about this, then I apologize for wasting your time.

Any help to identify the cause of this would be greatly appreciated. Thanks in advance!
[AT&T Samsung Galaxy S II SGH-I777] Karashta:
Have you tried freezing or uninstalling those apps and testing to see if you still have drain?
[AT&T Samsung Galaxy S II SGH-I777] nitox.n2o:
I have not; I only just recently flashed CheckROM on my phone. I was running UnNamed 1.3.2 prior to this with the same apps installed, and did not have this problem.
[AT&T Samsung Galaxy S II SGH-I777] joeybear23:
What about these:

DRM Content Launcher

DRM Protected Content Storage

I have them frozen as well, but will it cause problems?
[AT&T Samsung Galaxy S II SGH-I777] JustinW3:
I have never touched them. Freezing them should be fine though as long as you're not actually using the Samsung bloatware. The battery drainer is just the service that I mentioned. It does a check every 6-15 seconds to see if you have any content you shouldn't from them or something like that. Basically it keeps the screen from sleeping properly, your battery usage on an untouched phone would read 80-90% of the usage was coming from the display.

Media Hub is the app that uses all the DRM stuff if what I was told is accurate. I can definitely say for a fact, if they haven't fixed that "bug" you will most certainly see at least a little bit better battery life by stopping the service every time you reboot or freezing it via TiBu.

It was brutal on the Infuse especially with that giant 4.5" screen.
[AT&T Samsung Galaxy S II SGH-I777] Simba501:
I removed all of that DRM stuff a long time ago. Nothing happened.

Sent from my Galaxy S II (i777)
[AT&T Samsung Galaxy S II SGH-I777] mcnutty:
It looks like you have broadcasts on your wireless that is waking the phone. If you use dropbox on your computer, turn off LAN sync. Also, if you know how, test out AP isolation on your router of it is supported and see if that helps.
[AT&T Samsung Galaxy S II SGH-I777] nitox.n2o:
I don't use dropbox, and unfortunately have no control over the network that I'm on so I can't run any network tests. Thanks for your feedback though!
[AT&T Samsung Galaxy S II SGH-I777] theredsonja:
Can someone help me? I attached the dump from shark, as asked in the first post.

BBS shows a high wifi_rx_wake.

The weirdest thing is that the excessive battery drain only happens when my PC is on.

Thanks.
[AT&T Samsung Galaxy S II SGH-I777] alacrify:
Do some reading in the thread - you likely have one of several bad-for-traffic routers (do you have AT&T Uverse, for instance?) and/or you have Win 7 and it's broadcasting from a variety of reasons (Winamp, dropbox, some Windows services). I'll let Entropy (or anybody else, they're all better than I am at it) comment on the shark dump.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Attach in the original .pcap format please - you'll need to zip it up.
[AT&T Samsung Galaxy S II SGH-I777] theredsonja:
I did read a great part of the thread. I live in brazil, so no at&t for me. How can i be sure that the culprit is said router? I believe the problem is in W7, because, as i stated before, it happens when my PC is on.

Thank you, anyway.
[AT&T Samsung Galaxy S II SGH-I777] theredsonja:
There you go.
[AT&T Samsung Galaxy S II SGH-I777] alacrify:
Check this for things I turned off to stop my Windows 7 PCs from broadcasting garbage: http://xdaforums.com/showpost.php?p=22758051&postcount=4696

It mentions post #341 in this thread but this link also lists the services I turned off.

I really need to load DDWRT on my router, which I think would have let me filter all this stuff out from general broadcast, but if you're not using this stuff, why let Windows run it? :)

EDIT: I should mention that after this and Entropy's newer kernels, I get around 1% an hour drain on UnNamed 2.2.1.
[AT&T Samsung Galaxy S II SGH-I777] theredsonja:
Tweaked the stuff you mentioned, now i'll charge and tomorrow see the results.

Thanks for all the helping.
[AT&T Samsung Galaxy S II SGH-I777] csetera:
It isn't a big hitter in my battery stats, but I'm wondering if anyone knows of a lighter replacement for My Data Manager (https://play.google.com/store/apps/details?id=com.mobidia.android.mdm) ? I like the function of being able to track my mobile data usage, but I do see it show up in the list of partial wakelocks that are costing me some amount of battery.

Thanks,

Craig
[AT&T Samsung Galaxy S II SGH-I777] dandrumheller:
I'm with you on this. I've heard onavo might be better, but haven't tried it myself yet.
[AT&T Samsung Galaxy S II SGH-I777] alacrify:
I use 3G Watchdog - it has had not any impact on my battery that I can tell, and from a quick read it has the features that MDM seems to.
[AT&T Samsung Galaxy S II SGH-I777] csetera:
I tried Onavo and it seemed heavier to me... I didn't run it long enough to know, but it seemed heavier. I used to run 3G Watchdog from previous thread and maybe it is time to go back. The thing I liked about MDM was that it showed both mobile versus Wi-Fi data, but 3G Watchdog may be a better choice from battery.
[AT&T Samsung Galaxy S II SGH-I777] alacrify:
3G Watchdog will do wifi vs. mobile data now - lots of updates the last few months.
[AT&T Samsung Galaxy S II SGH-I777] theredsonja:
@alacrify It seems the stuff you suggested resolved the issue, i thank you for the effort.

Now, may i have your current tiwlan.ini to take a look at some stuff?

Thanks again.

The reason is that while tweaking the file i found my wifi sleeping when screen is off even after setting it to never, in settings.
[AT&T Samsung Galaxy S II SGH-I777] alacrify:
I'm pretty sure we don't have a TI chip in these phones, so no tiwlan.ini. At least I don't have the file in mine :)
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Broadcom... Which is the root of many of our problems. Undocumented crappy chip with a driver that has almost no comments in the source code.
[AT&T Samsung Galaxy S II SGH-I777] ingbrzy:
Hello...

I have problem with inaccurate battery drain of my S5830 with stock rom Android 2.3.6...

see screenshots from BatteryDrain app...

- logcat at attachment

Thanks all
[AT&T Samsung Galaxy S II SGH-I777] jasvncnt1:
^^ Not sure but are you in the correct forum?
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Some of the stuff here is applicable to other devices - but whatever issue he's having is with an app I've never seen before and a device I've never worked with before.

All I can say is that current consumption estimates on most Samsung phones are basically worthless - any app claiming to have current consumption numbers is pulling them out of its ass.
[AT&T Samsung Galaxy S II SGH-I777] dandrumheller:
I'm actually running that battery drain app. All it does is plot a point in time at each percent drop in battery, and display the results extrapolated over an hour... Crazy wrong with screen on, but reasonably close for a rough idea for idle drain. Also provides an average that isn't too far off for watching drain per hour under use.
[AT&T Samsung Galaxy S II SGH-I777] greatlakesghost:
True. I do not own this phone but have been following this thread for a while now ever since you chimmed in on one of the early epic touch 4g threads. This has help me find some troublesome apps and now going to use a recent post about home network and windows to help fix some other wifi issues. Great thread and information! Thanks. :)
[AT&T Samsung Galaxy S II SGH-I777] Jonnyredcorn:
Is there a way to track what may be causing an AOS bug? My girls gs2 is reporting high AOS drain under heavy use. It is always on par with display %(both around 35% after a full charge & drain), while mine is always very low(5%, while display is 49%).
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Covered in the very first post....
[AT&T Samsung Galaxy S II SGH-I777] Jonnyredcorn:
For some reason I didn't think that AOS drain could be investigated with kmesg or logcat. Her idle drain doesnt seem to be higher than 1%/hr but when she uses it is when AOS is the highest. I was always under the impression that AOS would only be high when idle, and low under heavy use. Ill charge to 100% tonight and grab those files tomorrow morning after a overnight idle session. Sorry for the ignorance entropy.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Did she flash an ICS firmware by any chance?
[AT&T Samsung Galaxy S II SGH-I777] JustinW3:
Can somebody explain to me what causes the phone to register as "Awake" because I did not use my phone really at ALL and it had massive drain. I noticed that the "awake" bar was almost the whole way across the screen, even though as you can see, I only turned my screen on a couple times.

Battery usage stats:

AOS 30%

Display 29%

ASys 17%

Heywire 10%

Cell standby 8%

Phone idle 5%

Voice calls 2%

B&N Nook 2%

AOS = CPU total 32m 14s

Display = Time on 40m 20s

ASys = CPU total 16s CPU foreground 11s Stay awake 1m 35s

Heywire = CPU total 10m 34s CPU foreground 5m 33s Stay awake 35m 39s Data sent 1.49MB Data received 6.31MB

Cell standby = Time on 8h 52m 42s

Phone idle = Time on 8h 12m 21s

Voice calls = Time on 1m 3s

B&N Nook = CPU total 59s CPU foreground 59s Stay awake 5s

Running 2.3.4 KH7 via Entropy's root. Sometimes I get amazing battery life (had 1d 5h with 40% left 2 days ago with similar use to this charge which was 8h ~50m and down to 25%.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
"To keep the greatest of secrets, write them down in the first post of an XDA thread."
[AT&T Samsung Galaxy S II SGH-I777] Simba501:
Lmao. Good one.
[AT&T Samsung Galaxy S II SGH-I777] alacrify:
XDA needs a Like button. I hit thanks instead :)
[AT&T Samsung Galaxy S II SGH-I777] JustinW3:
I've read this entire thread... The first post several times, so would you care to tell me exactly which part? If you're referring to the part that talks about IM apps and thinking of Heywire, it's not an IM app, it's an SMS app. Not really sure what else you could be referring to in the first post, unless it's the AOS bug which how could it be if I'm on 2.3.4 KH7?

Also, on the battery usage graph, what causes the charge level to up as if it were charging, even though it is not charging?
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
You obviously didn't read my first post several times, since proper debugging technique is covered in the first post and it's clear that you didn't follow ANY of the debugging instructions.
[AT&T Samsung Galaxy S II SGH-I777] JustinW3:
I did read all that, I just don't understand it fully. I have CPUSpy and BetterBatteryStats. I don't really want to mess with ADB because even though I've read up on it, I still don't really feel like I know enough about it to do stuff with it.

I have done SEVERAL of the things in your post, so clearly you haven't been reading. The only thing I haven't done from your post is the ADB thing.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
You claim now to have used BBS and CPUSpy - but there isn't a single shred of evidence in your existing posts prior to this that indicate you have used it. No wakelock lists, no indication of what your deepsleep percentages were, nothing useful. All you've done is post some stats from the stock Android battery statistics screen which are basically useless.
[AT&T Samsung Galaxy S II SGH-I777] JustinW3:
Fine, I will post info from BBS next time I experience the drain, I disabled Facebook notifications and disabled the automatic refresh of the status updates for the widget to see if that was causing wakelocks. I have previously posted stats from CPUSpy but didn't in this case because they weren't any good. I had forgotten to reset the timers so there were like 3 days of data in there.

So far since I made the mentioned changes, the idle seems to be extremely improved. The AOS says it's been on the battery for 4+ hrs. CPUSpy is accounting for 3h 12 min and showing 96% of that in deep sleep. About phone says battery is still at 99%.
[AT&T Samsung Galaxy S II SGH-I777] akaleshnikov:
Entropy, attached are my wakelocks.txt and dmesg.txt

I would've analyzed in excel myself but I've never done formulaic work with it, and couldn't figure out how to do it.

Total wake time: 1hr 13m

Battery Drain: 4%

CPU Spy information:

80% deep sleep 59:16

9% 200mhz 06:43

6% 800mhz

2% 1000mhz

1% 500mhz

Firmware: CheckROM RevoHD V6

Kernel: Siyah 2.6.13 (noop I/O scheduler, smartassV2 governor, underclocked 1000mhz and undervolted)

Radio: KH3

I'll try and get a longer reading by doing it overnight, but I use Sleep as An Android to wake me up in the morning and that'd skew the data heavily
[AT&T Samsung Galaxy S II SGH-I777] Spo0f:
Hi guys,

while i'm reading through the thread, here is some wireshark from me. I see a little of the mentioned bug, few APR request, 2-3 IPv6 requests and huge amount of things that i cannot identify. Expect Yahoo ofc, but it does not seems to be that huge battery drain.

The problem is that at workside i get HUGE battery drain on WiFi - like 50% for 8 hours.

Can someone help me with this? Usually i have huge locks from wlan_wake and deleted_wake_lokcs.

This is with LA4/LA6.

I've identify that the biggest packages are send and received to Google and something like "CDNetworks".

Thank you in advance.
[AT&T Samsung Galaxy S II SGH-I777] duowing:
I've been following this thread and thanks to it have pretty much solved any issues with my phone constantly waking on 3G. With 3G on I pretty much have great battery life. With Wi-fi on my phone never goes to sleep. I've used wireshark over say a 10 minute period to try and analyze things. I see stuff, but I'm not exactly sure what it is. The biggest thing is that it appears my router/modem is continuously sending out ARP requests. It goes through what appears every single address and just continues to do it over and over and over. I don't know if this is the reason I'm not sleeping on wi-fi? I got up in the morning unplugged my phone rebooted it, reset cpu spy, and after a little over an hour of time on. Didn't touch the phone at all, I had 7 minutes of deep sleep. The rest remained at 200Mhz. I know this is the SII forum and I'm using the Galaxy Note, but hopefully you guys can give me some info. Is this just my phone or is it something going ridiculous with my wireless?

I just did a quick couple minute poll on my Galaxy Nexus on Wi-Fi and it looks like it's seeing these same ARP requests, but it looks like my Nexus at least goes into deep sleep. I added the dump from the Nexus as well. These are at different days/different times so unfortunately network activity may be different between the two. Hopefully someone can compare these and see if they have any recommendations.

Thanks!
[AT&T Samsung Galaxy S II SGH-I777] alacrify:
I didn't look at the shark dump (don't have the resources at work), but sounds like the Note has the same sucky problem the GSII does with UCKK6 - it doesn't filter out the ARP requests like it should. I fixed this by killing the services on my Win 7 network that were doing the continual broadcasts. You can find that here: http://xdaforums.com/showpost.php?p=23337687&postcount=514

If that doesn't do it, maybe someone else here will chime in, but you're probably better off in the Note forums building off each others knowledge.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
I'll need to look at the dumps when I get time (I've been busy lately) - but which firmware are you on?

Some bases (XXKI3, UCKK6, probably XWKK5) block the ARP filters from working right, on other bases (XWKL1, XWLA4) the ARP filters seem to work well.
[AT&T Samsung Galaxy S II SGH-I777] duowing:
I'm on the LB1 Rom for the note, I'm now running a custom Rom and I just flashed the LA4 Baseband as someone said it seems to work better with data connections. So I'm giving that a try. I saw there was a new LC1 Rom/Kernel with LB2 baseband just released for the Note. Supposedly this will be the last GB rom before ICS so I'm going to give that a try. As for 3G I checked after about an hour and a half in CPU spy and my deep sleep was I believe 96%. So I'm good as far as programs running in the background goes. At least over mobile data. Thanks for the help guys. I was looking around in the Note section and couldn't find any real topics on this.
[AT&T Samsung Galaxy S II SGH-I777] jsolares:
Latitude was eating through my battery, now i wonder if the drain i had on the ICS roms wasn't also due to Latitude, i signed out of latitude and disabled wifi for location.
[AT&T Samsung Galaxy S II SGH-I777] simplicityy:
I keep wanting to install Skype to make use of my phone's front camera, but I know it's a wreck of an app. Better app? Or do you think since Microsoft bought out Skype recently that they will fix it?
[AT&T Samsung Galaxy S II SGH-I777] JustinW3:
I wouldn't hold my breath for MS fixing Skype. Why not keep Skype and just freeze it on TiBu when you're not using it. Then if you want to use it, thaw it.

Will this work? I'm not 100% on it, can somebody else comment on this idea?
[AT&T Samsung Galaxy S II SGH-I777] sirhc81:
my results

hello entropy, just wanted to post my results and say thank you for all of your fine work, i'm currently running unnamed 1.3.2 w/standard kernel. if i can improve the battery life any further just let me know :)
[AT&T Samsung Galaxy S II SGH-I777] sirhc81:
and here's my battery drain....