yashsingh1/xdaforums huggingface dataset:
[AT&T Samsung Galaxy S II SGH-I777] coolmalayalee:
What Happend to my SGS2 battery

I've been getting respectable battery life (about 24 hours on a full charge) on my S2 for the past several months.. I've been on UnNamed all these while. Last two days I noticed my S2 is not holding battery for more than 10 hours.. Today morning when I got up I was shocked to see the battery was completely dead.. connected it and checked battery usage and found 79% battery use on idle. It never used to be more than 7% to 8% till few days before. The only major change I did to my phone in the past one week was to set up Sipdroid and google voice as per the instructions here when I came to London last week. But I found that the CSipSimple app consumed only around 6% battery overnight...

I fully charged the phone today. It's been only 3 hours and the battery is now down to 50% with very limited usage..!!! that is totally uaccetable.. I am on UnNamed 2.2.1. No clues what is happening.. is there anything i can do to determine who is the culprit...
[AT&T Samsung Galaxy S II SGH-I777] naturefreak85:
Just because the app reports that it is only using 6% doesn't mean that's accurate. Pull your logs like Entropy asks in the first post. That way it can be narrowed down, based off the newest software installed it is possible that it is using more data than you realise over WiFi/3G causing you to drain your battery faster.
[AT&T Samsung Galaxy S II SGH-I777] coolmalayalee:
I have attached the Results for BetterBatteryStats here. If someone could help me figure it out...
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
CSipSimple is holding a lot of wakelocks - 47 minutes total.

You did not reboot after charging so your kernel wakelocks are not very useful,

but you've had 1h10min of wakelocks due to BLN. THERE IS A REASON I WARN PEOPLE THAT BLN DRAINS BATTERY.

However - you should start learning how to interpret wakelocks. You should have immediately thought something was wrong when:

You installed CSipSimple and drain problems started occurring

You ran BBS and it confirmed that CSipSimple was behaving badly - that fact is EXTREMELY obvious.
[AT&T Samsung Galaxy S II SGH-I777] garyd9:
There's a RC of BBS that doesn't require a reboot to limit kernel wakelocks to "since unplugged", "since charged", etc.

(download link in the second post of http://xdaforums.com/showthread.php?t=1179809)
[AT&T Samsung Galaxy S II SGH-I777] chamonix:
1. 5 final is out and supports 'since.... ' refs for kernel wakelock
[AT&T Samsung Galaxy S II SGH-I777] jasvncnt1:
my issue as of now was wifi. Tested 4 nights in a row. 2 with wifi on 2 nights off. When wifi was on battey would go from 100 to about 74 with no use. Wifi off it would go from 100 to about 95 over night.
[AT&T Samsung Galaxy S II SGH-I777] twiggums:
You likely have an app that's deciding it gets as much data as it wants when its on wifi, thus not letting the phone deepsleep much if at all.
[AT&T Samsung Galaxy S II SGH-I777] Zohdug:
I've noticed the StartingAlertService 3 of the last 4 days in BBB. I've taken a look at the above thread. It's a little beyond me at this point. Does anyone know if the touchwizcalendar.apk should work with UnNamed 2.2.1?
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Get a Wireshark capture - see this thread's OP.
[AT&T Samsung Galaxy S II SGH-I777] coolmalayalee:
I have fully charged unplugged, rebooted, reset timer on CPUspy and kept it idle overnight (less than 6 hours)... morning I captured the batterystats (attached) and cpuspy results with the below stats:

Deep sleep percentage: 84%

Time the phone was sitting: 5 hours 57 mins.

Percentage battery drained: 18%

On my phone battery usage standbye usage was around 79%.

Can someone help me figure out what is the culprit.

I dot use BLN. I dont have any so called battery draining apps installed. My battery use to only drain less than 10% in a 7 hour night

I am on ICScrewed 1.5.1.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
84% deepsleep is a little low, but not horribly low. It's a bit odd - your drain is a bit high (4%/hour) but there's nothing obvious to cause it.

Cell standby is using 79% of your battery? Are you in a no-signal area?
[AT&T Samsung Galaxy S II SGH-I777] coolmalayalee:
I am outside my network coverage area. Roaming internationally. But I am at a place where my sim is showing pretty much signal for a local carrier even though I am not able to make or recieve calls with it. For that I use GVoice and Sipgate.

My drain used to be only around 2% or so before I came here....
[AT&T Samsung Galaxy S II SGH-I777] Jonnyredcorn:
So I charged my phone to 100% just now and I rebooted BEFORE disconnecting the charger. When the phone finished rebooting it only read 98%, even though it was 100% prior to reboot...kinda weird.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Nah, a reset immediately before heavy drain (booting) confuses the fuel gauge a bit. Not weird at all.
[AT&T Samsung Galaxy S II SGH-I777] posthold:
Another Broadcom issue capture

Here is a Wireshark capture while my phone is draining at a higher than normal rate. It has the Broadcom's BT-AMP function flake out issue. I'm on unamed v2.2.1. I've noticed the battery draining 3 times now and each time I have had pending updates from the Android market. Not sure if it is just a coincidence or not, but thought it was interesting.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Thanks, confirmed - btamp is going nuts on you.

Interesting on the pending market stuff, but likely a coincidence... I've seen it happen on the Infuse without pending market updates. On the Infuse, it is most likely to happen (but does not always happen) when you are on a wifi network and walk/drive away.
[AT&T Samsung Galaxy S II SGH-I777] demonwind:
I have a hidden program or something that's causing a lot of wakelock. For example, on my Battery Info I see a huge full bar of Awake (while I was sleeping), but on BetterBatteryStats it says I have an almost 1:1 ratio of Awake and Screen On. So one of them is definitely wrong. BBS does not find any process or kernel that's causing this wakelock.
[AT&T Samsung Galaxy S II SGH-I777] LiLChris06:
I noticed this one day when I woke up that I didn't have it connected to the charger and it for some reason says it stayed awake.

It doesn't look like the battery decrease much but it's been bugging me and I finally had time to post it. (work is slow)

I attached some more images and BBS dump, not sure if I should have collected anything else but that opportunity has passed till I see this again.

Any help would be great! :)
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Based on that and what I saw in your statistics - Something about the network is making your radio VERY unhappy. Cell Standby of 79% is unusually high, and in most cases, having it this high is a Good Thing as it means your CPU is using very little. However it sounds like something about the network you're on is making the radio gulp power, and also talk to the CPU a lot more (you had unusually high svnet wakelock time - it wasn't horrendously high, but it was higher than normal. svnet wakelocks are radio management stuff - svnet-dormancy is radio data.)

Was it a full bar of Awake when you brought up the detailed screen? The summary screen will show a full bar if wifi was on.

I'd be more inclined to trust BBS than the stock battery summary screen which has known bugs. What does CPUSpy say about deep sleep percentage?
[AT&T Samsung Galaxy S II SGH-I777] Simba501:
In searching for the cause of my svnet dormancy wakelocks, I've discovered that yahoo messenger was the culprit. There is talk of im apps in the OP, but I falsely assumed that it performed like Google Talk (which has virtually NO impact on battery) and overlooked it. Deep sleep jumped significantly.

Edit: And considering the wakelock is only 6 seconds after data flow begins, its background network activity was CONSTANT. Over the course of a day, svnet dormancy was active for often at least an hour.

Sent from my Galaxy SII
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Not quite 6 seconds after it begins - 6 seconds after any activity. So one packet every 5 seconds = perma-wakelock
[AT&T Samsung Galaxy S II SGH-I777] alacrify:
Didn't see this anywhere in the thread(s), so I thought I'd offer for your (Entropy's) use. My phone was draining 10% an hour or more on wifi - I posted in the UnNamed thread since I had just gone to 2.2.1, and Entropy helped me with Shark/CPU spy, wakelocks etc. Having wiped and started with a clean flash of 2.2.1 (just loading Shark, BBS, CPUSpy etc.) I was still having horrendous battery life. The combination lead me to find out that it was Windows 7 and my home network/wifi doing it. The worst processes on Windows causing problems:

IPv6 was continually polling the network (and the phone). Turning this and IP Helper off got rid of 80%+ of the "wcbackup" Shark entries that were keeping the phone active. And I'm not using IPv6 anyway.

Other things that are polling the network (and I mostly turned them off) - WMPNetwk (Windows Media Sharing), ShellHWDetect (for autoplay), Network discovery (only needed if your network changes a lot - you can still reach shares, printers, etc. without it).

Cleaning this up got me to a drain of about 3% an hour, which is tolerable. I'm going to look at getting either the firewall or the router to block the packets bouncing off the phone so I don't have to keep tweaking Windows services (and worrying about updates turning stuff back on).

Hope that helps!
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
One thing I'm curious about - did the wcbackup polls wake up your device when on a different base?

I'm wondering if KK6 battery drain is due to multiple causes:

1) BT-AMP flakeouts

2) IPv6 multicast added to the BCM4330 MAC filter's "allow/wakeup" list.
[AT&T Samsung Galaxy S II SGH-I777] alacrify:
I had the battery drain on and off over several bases. I would swear it DID come back with 2.2.1, although I was still troubleshooting app issues so I can't swear it was the ROM version. If you want me to experiment, I can try prior versions (or other ROMs) this weekend for you - just let me know what you'd like to test.

And is that "allow/wakeup" list something I could hack? Being able to tell it to stop answering the stupid UDPs and ARPs would be nice.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Possibly - if it DOES turn out that UCKK6 responds to IPv6 multicast and earlier bases (like KH7 or maybe XXKI3) do not, then I'll look into altering the filters.

Ignoring ARPs probably can't be done - and shouldn't be needed unless the network is majorly broken. Ignoring IPv6 multi should be OK without breaking anything.
[AT&T Samsung Galaxy S II SGH-I777] nyydynasty:
ever since I installed shark, i haven't had the battery drain on wifi. So much for trying to help out, here - lol
[AT&T Samsung Galaxy S II SGH-I777] alacrify:
And after the cleanup described above, and work, errands, and home, I have this. Thanks Entropy!
[AT&T Samsung Galaxy S II SGH-I777] dandrumheller:
Holy Crap! how much screen on time did that include? That's some seriously good battery life...
[AT&T Samsung Galaxy S II SGH-I777] LiLChris06:
Doesn't look like much, but its awake for a significant amount of time for the little screen time.
[AT&T Samsung Galaxy S II SGH-I777] shortskoolbus:
not very much screen on time.
[AT&T Samsung Galaxy S II SGH-I777] alacrify:
No, there's not, but the big problem with the constant broadcasts on the Win 7 network was it would NEVER GO TO SLEEP. So this round of testing was to see if I had gotten so it could. Today's test will be how it does while I'm using it.
[AT&T Samsung Galaxy S II SGH-I777] shortskoolbus:
Hi Guys,

I'm having pretty decent idle battery life with wifi on in idle... i lost about 8% in 6 hours. But off wifi it's horrible draining on average maybe 300 mA per hr.

But i'm wondering if my wlan_rx_wake and wlan_wake are excessive and if this is the reason for the high battery drain on AT&T LTE...

I didn't have a chance to let the phone sit on idle and collect data with only the data network yet, so attached are my logs with wifi. Deep sleep is about 88%.. wonder if it could be better. i have no idea how to interpret the shark data... also you'll see BMW doing some things there and that's battery monitor widget which i am also using to measure drain.

I found that IMO, kik, facebook, and go locker were causing excessive wake locks so i've uninstalled all those...
[AT&T Samsung Galaxy S II SGH-I777] twiggums:
Do you have more info on the W7 issue? Is a certain program doing it? I've got 2 W7 machines on my network and have never noticed anything but now I'm curious about it.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Windows Client Backup broadcasts are IPv6 multicast and will wake the phone like crazy. (At least in UCKK6, may not affect UCKH7)
[AT&T Samsung Galaxy S II SGH-I777] twiggums:
Oh I see. So I'm guessing my router saves me then since its an older IPv4?
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Probably, unless it does bare Ethernet bridging between LAN and wireless.
[AT&T Samsung Galaxy S II SGH-I777] twiggums:
Ya lost me now :-). But I'll quit cluttering this thread and just be happy my device doesn't suffer from the issue :-).
[AT&T Samsung Galaxy S II SGH-I777] shortskoolbus:
So i left my phone on over night with wifi off.

I lost 31% over 7h 30m of idle... with about 69% deep sleep only. I havent had a chance to grab the logs yet, but it's pretty bad... :(
[AT&T Samsung Galaxy S II SGH-I777] MWilkenson:
Entropy,

I have a question for you. Not sure if this would be battery related but i figured I would post it here because I thought high ram use would lead to battery drain...sorry if im wrong. Anyways, my phones been on all day, some heavy usage...watched a show on hulu and browsed the internet as well as many calls and texts. When i go into task manager it shows the "Ram Status" and mine is up around 500/838mb ..Should i be alarmed? and is this going to increase how fast my battery dies?
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
nope, Android leaves stuff in memory unless the memory is needed for something else for faster task switching/loading.
[AT&T Samsung Galaxy S II SGH-I777] slatestud:
Decent battery life...

Haha this is with an extended battery. Well recommended.
[AT&T Samsung Galaxy S II SGH-I777] shortskoolbus:
Hi Entropy,

I'm wondering if i could have your help in deciphering these files... i'm not really sure what it all means or how to read all of this. What i can tell though is my phone was "awake" for a long time and it looks like alarm manager is the culprit. I looked at the alarm manager dump and it looks like a lot of google services and possibly any.do is causing the wakelocks...

Over 4h 30m my phone lost 25% battery life with the last half hour being the worst.

I just wiped and reflashed the CM7 ROM and barely have any apps installed at all.

Any advice you can offer to improve my battery life would be greatly appreciated!

And sorry, i did forget to grab the cpu spy screenshot...
[AT&T Samsung Galaxy S II SGH-I777] Jonnyredcorn:
So what could cause my phone to drop 30% over the course of a reboot? I had 43%, rebooted, now have 13%
[AT&T Samsung Galaxy S II SGH-I777] twiggums:
Likely what's being seen is voltage sag I'd guess. It's typical of any li battery, even more so under heavy loads and when it's capacity is more depleted.

So on previous polling the voltage may be 3.8v, but on check after reboot it reads 3.6 or something. The phone goes by the voltage to calculate how much is left so it thinks that much power was consumed. But after a while the voltage will rise back to normal. Hence you may see your percentage rise without charging, or it'll just stay at a percentage for an unusually long time.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Odd... Something is wacky there, BBS completely failed to report any kernel wakelocks at all - so there seems to be 3 hours of wakelocks completely unaccounted for.
[AT&T Samsung Galaxy S II SGH-I777] Nizda1:
Entropy,

Something just wacked out on my bbs also, literally 3min before your post it was reporting nothing at all for the last couple hours I was tracking. The only stat I can get out of it now for some reason is kernel wakelocks. I'm gonna reinstall , clear cache/data reset timers and see if it resets. Regardless my battery life is still amazing even more so with your new dd.

Sent from my SAMSUNG-SGH-I777
[AT&T Samsung Galaxy S II SGH-I777] shortskoolbus:
Hmm... i'm running the CM7 alpha 4 with Da_G's kernel on a Skyrocket... i'm going to flash back to stock today and collect the data again and see if there's any difference. the battery life is pretty bad :(
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
I've said this multiple times - heavy load (such as booting) right after a reset (rebooting) confuses the fuel gauge and makes it report low.
[AT&T Samsung Galaxy S II SGH-I777] Firemonkey5:
Hey does anyone know what the kernel wakelock "deleted_wake_locks" from better batterystats is? It's not too much of an issue for now, but it's starting to pop up more and more lately.
[AT&T Samsung Galaxy S II SGH-I777] Jonnyredcorn:
I had the same issue, never seen it until recently
[AT&T Samsung Galaxy S II SGH-I777] :
What app do you use to get that graph of battery usage?
[AT&T Samsung Galaxy S II SGH-I777] msgfromside3:
Did you try to search for it?

https://gitorious.org/0xlab-kernel/...2d3e20d120254435addcf/kernel/power/wakelock.c
[AT&T Samsung Galaxy S II SGH-I777] garyd9:
I'm one of those people that really encourages people to search and try to help themselves. I'm probably even more sarcastic about it than most (though not in a mean way... just in a sarcastic way ;))

However, the link you just posted was WORSE than useless. Unless a person is familiar with both the linux kernel AND the modifications android makes to the kernel, a link to a source file from the kernel does what? It will only create more questions.

Even someone that is familiar with the kernel and android, and even an expert in C, would get questions from that link...

Here's what I got from that source file: There's a symbol exported from the kernel (available to modules, etc) that allows both kernel and non-kernel code to call "destroy_wake_lock()" and if that happens, the stats on the destroyed wake lock are added in to some global "deleted_wake_locks" structure.

This doesn't make clear if the kernel deleted_wake_locks structure is the same thing as displayed in BBS. It also, perhaps misleadingly, implies that every single wakelock in the system is eventually destroyed and all the time for those old wakelocks is added to the deleted_wake_locks. That would, in turn, lead logically to the question of "so if GPS is causing a wakelock, then I turn off the GPS, does the time for that wakelock show up as a GPS wakelock, in deleted wakelocks, both or neither?" We might even get people assuming that BBS wakelock stats are useless, as all the wakelocks have to eventually get destroyed, and if they do, their stats will just get dumped into this huge meaningless "deleted" pool.

(Of course, I have the ability to dig deeper into this and find the answers - but most people don't. Even most of the people who develop for android are NOT proficient in C and kernel issues.)

So... was that link supposed to be some kind of answer, or something to encourage more questions?

:)

Gary
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Gotta agree with Gary on this one... wakelocks.c is a tough read even for me...
[AT&T Samsung Galaxy S II SGH-I777] msgfromside3:
I was just showing a link that I could find from a search engine. I am not making any assumption that the person who asked the question has any knowledge - in fact I am not even trying to answer the question directly. The link could be a starting point to the question or not - depending on how much the person knows about the code and how much the person has an interest in that, but sorry I don't know the person. Maybe I should have said "I found this from searching for deleted_wake_locks". Maybe I could have said "go to BBS thread and ask". Maybe I should have just kept my fingers away from keyboard at the time. :)

While I agree with you that reading the link itself is not sufficient enough and it may bring more questions but I have a problem with your approach to this. Say that my respond led to more questions, what is wrong with that? Should we spoon-feed others? Yeah, I do recognize there are many people who are not familiar with the detail and who are not interested in it - then they can choose to stay away from the topic. I basically believe in this: If we don't ask more, we won't get the answer and no one will get it for us.

Maybe this is a topic for the other thread in this forum. :)
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Added the UCKK6 BT-AMP bug to the OP - first actual firmware bug to get confirmed and make the grade!
[AT&T Samsung Galaxy S II SGH-I777] shahulvm:
Open Market, setting and untick Notification. That should help to take care of check-in service
[AT&T Samsung Galaxy S II SGH-I777] Jonnyredcorn:
So I just got my first Bluetooth headset, Plantroics Explorer 243. I was curious if having Bluetooth enabled and turned on drains battery? I mainly got the Bluetooth for my ps3 to play online but after using it on my phone while I'm at work I think I will start using this on my phone, but only if it doesn't affect battery life.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Shouldn't drain it much, the wifi/BT chipset's standby drain is low.

However it could be affected by a misbehaving device or do something unexpected.
[AT&T Samsung Galaxy S II SGH-I777] Jonnyredcorn:
So far it seems like its behaving. I've only had it paired for 2 hours or so and I haven't noticed any additional drain at all. If for some reason my bt goes juice happy what would bbs indicate?
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Might be some bluetooth-related wakelocks, not sure.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Doesn't look like low service - you were on wifi, so data was going over wifi.

Top three wakelocks were wlan_rx_wake, svnet, and mmc_delayed_work

wlan_rx_wake is a dead ringer for network traffic. This wakelock happens when your phone receives a network packet addressed to it and it's asleep. So incoming network traffic is waking your phone often.

svnet is unusually high - usually this is fairly low, as it's basic radio management stuff (Edit: low service MIGHT have driven this one up)

svnet-dormancy is almost nonexistent - this is what you will usually see when an app is driving network traffic via cell data

mmc_delayed_work is new to me, but I'm 90% certain that it is due to some app reading/writing to storage

Nailing your culprit might need a network capture - I'm going to work on a tutorial for using Shark for Root ( https://market.android.com/details?id=lv.n3o.shark ) in a day or two.

BTW, to analyze the /proc/wakelocks dumps:

Open in Excel or OpenOffice/LibreOffice Calc

Import as tab-delimited text

Add a new column called sleep_time_minutes

Set this column to equal sleep_time divided by 60e9 - this converts nanoseconds to minutes

Sort by sleep_time_minutes
[AT&T Samsung Galaxy S II SGH-I777] penskyc:
any update on a tutorialfor shark reader and shark for root? i would really like to nail this down, thought i did, but than realized that the battery icon for Serendipity is kinda made to make it look like u have better life, I was at 54% but my battery basically looked like it was at 80%.. Left my phone off the charger last night and it droped 30% in 8 hours of idle.. ughhhh!
[AT&T Samsung Galaxy S II SGH-I777] mcorrie1121:
Update for WWF. Didn't explicitly say it fixed battery drain, but has anyone seen improvement?

EDIT: Went in, played a move, exited, and went to kill the task just to find it killed itself. Seems like it won't run in the background anymore.

That's a start.