yashsingh1/xdaforums huggingface dataset:
[Galaxy S II General] luizlee86:
I dont know if I got it right... these battery drains mean what? If I go to bed with battery at 100%, after 6 hours, it has to be at about 94%?

But how could Andrei have 74% juice left after 45 hours?
[Galaxy S II General] Entropy512:
There's nothing obvious power-related in update3... There are some things that might improve performance for CPU-bound stuff - but they likely won't affect timer-bound wakelocking and the 800 MHz "accelerate to wait" stuff.

I will mess with update3 this weekend - this was painful enough as it was - https://github.com/Entropy512/linux_kernel_sgh-i777/commits/samsung_update3

Andrei is managing to have craaaazy low usage for some reason - 100 MHz is probably a contributor to it.

Testing 100 MHz support now, also testing to see if this is what affects AOS:

http://marc.info/?l=linux-kernel&m=130152042607111&w=2

Edit: Nope that's not the cause of AOS reporting going down.
[Galaxy S II General] lokhor:
So if I understand this correctly: for stone reason the sgs2 has a hardware limitation that causes the device to wake for a minimum of 6 seconds upon any wakelock event. Would a 100mhz clock speed help reduce drain from wakelock?
[Galaxy S II General] Entropy512:
No, approx 0.8 seconds from any event that causes the device to wake from suspend and then immediately go back to sleep.

6 seconds is ONLY for cellular data (svnet-dormancy)
[Galaxy S II General] lokhor:
So if the wakelock is gmail or gtalk or Viber etc it stays awake for 6 seconds?

Does a 100mhz speed help at all?
[Galaxy S II General] yhrn:
Hi,

Did the suggested routine - charged full, rebooted, went to bed and then pulled /proc/wakelocks and dmesg and some screen shots. Sorted on sleep time but cannot make heads or tails out of it.

Wifi on, sleep policy never. I have a D-Link DIR-655 which I've heard might make things worse. Running Androidmeda 2.5.0 with the TWD kernel, no OC/UV.

Of the 7 hours on battery I was asleep for about 6 hours, snoozed maybe 40 minutes and fiddled around with the phone the rest of the time to get the stats.

On 3g I get much lower drain - maybe 1,5% per hour of not touching the phone, low AOS, "suspend" and "tv out resume wo" not acting up.

If anybody can spread any light on this I'd be very grateful.

(Had to zip wakelocks.ods because of the file extension and dmesg.txt because of the size)
[Galaxy S II General] AndreiLux:
You've got a .14 kernel so AOS is incorrect, 30% drain in 7 hours is bad. And it being worse on Wifi than on 3G seems to mean that you're suffering from a "dirty" network. Tvout resume being at 1 minute means that suspend and so on are really high, as they for that to get that high, the other needs to be about 10 times as high too.

The strange thing is, is it seems that the TWD kernel suspends at 500MHz for you.. that's interesting, I guess. I thought we concluded that that wasn't stable.. hrmm.

Edit: they really do suspend at 500MHz, *very* interesting.
[Galaxy S II General] yhrn:
So, with "suffering from a dirty network" you mean that there is really nothing I can do with the phone that will bring battery drain down on that network?

The only thing to do would be to get my old DIR-655 replaced? The annoying thing is that we have the same AP at my office for our public WiFi so I can't test here to see if I get lower drain with another AP.
[Galaxy S II General] Molitro:
Wel.. I can't believe it. I reached the 2% per hour on wifi objective.

I'm on 94% after 12 hours, and I rebooted the phone after unplugging, which always makes me loose about 1%, so even a little bit less than 1%/2h

It was the friggin' hotmail app... without push! Just by being there upped the drain about 25 - 35%, and didn't even show almost any wakelocks. Unbelievable.

Well... I'm finally happy with my drain. Now the problem is I have no email app, because the sotck one gave me similar problems than the hotmail specific one. But I think I only use it with push, so I'll have to tried with just sync.

Is the stock app known for bringing too much drain?

PD: Gokhanmoral is doing a great work on the battery life, by the way.

PPD: Wow... I just saw I had some wake time tonight, despite the 1%/2h drain. If I got rid of that I would be very nice...
[Galaxy S II General] Pfeffernuss:
I have that exact same router and "zero" idle drain. Well, 6% or so in around 9 hours so that's not too bad/quite normal I think.
[Galaxy S II General] AndreiLux:
To honest replacing the router might not do anything at all if the source of the problem is some broadcast being done by some other machine on the network. If you really want to get to the root of the problem then you net to do a network packet analysis. The fact that you said that you don't have this drain on 3G is a sign of such an issue. Even if it's the same router on a different network, I'll behave differently if the issue is not a service running on your phone, so go ahead and test it.
[Galaxy S II General] yhrn:
My feeling is that I do get the same drain at the office but I haven't tested it properly. I'll try to do that tomorrow.

Also, did anybody look at the wakelock and dmesg I extracted? I had hoped that some user app would stand out but I couldn't see anything that made meant anything to me. But maybe someone more knowledgeable can decipher the stats.
[Galaxy S II General] Entropy512:
crud, I had a fairly long post written but then my Internet went out at home...

Saved it, will post tonight...

Edit: One comment about your rewrite - you bolded late suspend/early resume. It's the regular suspend/resume (which are usually around 150 msec and 650 msec respectively) that are important.

More importantly is: When PM_SUSPEND_PREPARE and PM_POST_SUSPEND are hit in CPUFREQ. (There are printk()s for these - PM_SUSPEND_PREPARE is before the first suspend printk(), and PM_POST_SUSPEND is after the final resume printk(). )
[Galaxy S II General] AndreiLux:
Fixed it, wasn't paying attention when copying the dmesg's.

I lost motivation to continue on writing when I reached the explanations on how to find the apps etc, so I'll finish that at some later date.
[Galaxy S II General] Entropy512:
Yeah, I need to figure out some documentation on using Shark for Root to hunt data-eaters... Too much else to do!
[Galaxy S II General] tolis626:
Hey man,reaaaally nice work you did there.This was a much needed sorting for all the stuff about the AOS bug. :)

Might I throw a terrible idea on the table?Kernel devs could gather and start compiling kernels from source,with absolutely no personal tweaks,having removed one driver at a time,if such a thing is possible.If I'm not saying complete bull****,this would help pinpointing the issue.I'd try myself,but I cannot properly compile a kernel(Each try I have made resulted in a trauma for my PC :p ).

Hope Sammy isn't too busy in suing Apple... :rolleyes:
[Galaxy S II General] rvenes:
My Samsung Galaxy S2 got better battery life when i rooted and froze the 2 wifi things listed in the picture below:

Before i rooted it, i had battery for 10 hours of light usage then it said that it needed the charger!

It's a bit better now, but still not as good as i wanted it to be!
[Galaxy S II General] Geumbou:
Great OP. Thanks.

Did not realise how bad the problem was until I started analysing the battery usage based on your research.

I downloaded soft locker to prevent the phone going into deep sleep, and in turn the Android OS power usage has dropped from 60%+ mark down to <10%.

Just need to see now if the total battery drain rate is lower than with deep sleep.
[Galaxy S II General] prinzhernan:
Great thread. I finally understand why it's showing up in the battery stats. Great phone still, hope Samsung resolves the driver problem.
[Galaxy S II General] claimui:
Please follow up on this. I am curious to know if staying awake will actually save power instead of deep sleep!
[Galaxy S II General] tandeh:
download startup manager, I free trial, think it still works after trial period as my battery life its great, also can be used on unrooted phone s. all u need to do is untick stuff off startup as you would in windows startup, made afn amazing difference, couldn't believe it, I was about to send phone back to samsung before this
[Galaxy S II General] tCC:
doesn't help, my batt is great for the first 1.5 day as well without wakelocks and suddenly begins to drain, testing all kinds of things as well for the last couple of months and froze half of the apps.

with some tweaking I lose like 20/25% a day (not using my phone much because I'm still testing things), but when the drain kicks in I can start all over again.

another person I know has an I9100 as well, and he doesn't have internet/google account/market/etc (just using it for his wife to call him) and saw he lost only 15% after 2 days, haha, drives my crazy.
[Galaxy S II General] tfn:
AOS BUG

Is directly linked to Apps which sync in the Background.. like facebook, twitter emails etc.

If you wanna lower the AOS BUG reduce the time syncing happens in the Apps

or just switch to manual update ( so the apps only update when you click on them)

Thats your AOS Bug sorted!!! which also help increase your battery at at the same time

or try

Settings > Accounts and Sync > untick Background Data and

Settings > Privacy > untick Back up my Data
[Galaxy S II General] AndreiLux:
NO.

It has nothing to do with that. I wrote this thread exactly to discredit all those things. It will happen even with those things turned off.
[Galaxy S II General] Molitro:
50% after 18 hours, with just over 1h of screen... This is unacceptable. With the SGS the battery'd still be around 80.

I still can't understand that they fixed the problem on SGS, and not on S2...
[Galaxy S II General] saturn_de:
For the SGS2, you can do:

# adb shell dmesg | fgrep -C 15 -i s3c_pm_enter

and you will see from the timestamps, that the phone mostly wakes up immediately after suspending... of course, this implies, that the time is running, while in sleep.
[Galaxy S II General] KennyLegend:
Great thread man...weldone on the initial explanation
[Galaxy S II General] tCC:
System Tuner Pro is a great tool to see which processes consume what time (sorting by Total Time), I think it's better than BetterBatteryStats since I cannot get that to work the way I would (also CpuSpy doesn't help me much). I think CM7 has even a greater tool built in, but since I don't use CM7 I can't tell.

noticed as well that, when I reboot my device, it loses some of it's uptime history (minutes/hours), so I prefer not to reboot my device when something is draining my batt, but I start killing processes to prevent future draining/wakelocking, still try'ing to find out what's causing the drain.

now running for 3 days and 2 hours with 33% battery left (screen on is 1 hour 14 minutes), but I had a drain yesterday that costs me like 20% :(

Android OS is still on top with 2 hours and 34 minutes tho
[Galaxy S II General] Molitro:
Turning off wifi while screen is off definitely brings the bug down a little bit.

Still horrible, but...
[Galaxy S II General] Duffman19:
I can't post the screenshot but it basically shows my AOS at 77% and the battery more than half dead after only 5 hours with NO screen on time or data

This was from a couple of months ago, I was abroad at the time so data was off the whole time. While sat in a drawer it just went mental and drained the battery. I have always believed this has nothing to do with syncing or any sort of connectivity, people still get it in flight mode.

Good post OP
[Galaxy S II General] Hacre:
Great thread, once I'm done fixing my car and my house I can dive into the kernel and take a look, as well as ***** at Samsung.
[Galaxy S II General] :
trust you to come out with something like that:D
[Galaxy S II General] rvenes:
Not much usage today. A few Gtalk messages, etc.

Still high battery usage.

Downloaded cpu spy and betterbatterystats, if anyone can understand something...

What uses most battery? 3g or wifi?
[Galaxy S II General] KennyLegend:
3g and H most definitely
[Galaxy S II General] olavjunior:
Any news on this issue with the newly released KI4? http://xdaforums.com/showthread.php?t=1292330&page=9
[Galaxy S II General] lokhor:
I charged my phone up before bed and now after 7hrs it has gone down 6%

CPU Spy shows only 81% spent in Deep Seep with 14% at 200mhz

BAttery usage shows Android OS at 75% with 32m cpu usage

BetterBatteryStats doesn't show very much in the way of wakelocks

The highest in the list is AlarmManager with a count of 544 and 1m6s usage 0.2%

next is BWL (beautiful widgets) with a count of 2 and 1m1s usage 0.2%

IF I look in BAttery History for GB (basically looks like old battery history)

and select CPU Usage the '0' process has used 32m of cpu
[Galaxy S II General] luizlee86:
Can somebody give a help?

I cant use Excel... I´m a totally noob... :(

If somebody tell me how to convert the total/sleep/max_times to seconds or minutes, I´ll do.

But can somebody help me analysing my wakelocks please?

Thanks in advance! :)
[Galaxy S II General] Entropy512:
It's been established that BBS misses stuff present in /proc/wakelocks ...

Basic way to implement a calculation for a cell:

Click on a blank cell (like if you've created a new sleep_time_min column)

Type =

Without hitting enter or anything else, click on the cell in the same row with sleep_time

Then type /60e9 for minutes, /1e9 for seconds

will take a look at the XLS later
[Galaxy S II General] luizlee86:
Should the results be something like 1,02E-02? ??
[Galaxy S II General] jose.celestino:
They can be, now if they should..., I dunno.

Btw, that's scientific notation (wikipedia it):

$ c 1.02*10^-2

0.0102
[Galaxy S II General] Entropy512:
This was intended to be posted this morning:

In theory it should - but I'm not sure how much power it really saves. I'm running drain tests over the next few days to see how much less 100 MHz uses than 200.

I know that in the case of my phone, if dealing with an "accelerate to wait" situation (resuming from suspend at 800, doing a little work, then returning to suspend at 800) results in the phone almost never dropping to 100 in many situations - however it was a wifi test, I didn't try svnet-dormancy wakelocking.

500 MHz was a typo in early Ninphetamine kernels - but what might be interesting is, is it OK? I need to check, but I think the stock kernel may actually have been entering suspend at 1 GHz... Now people clearly have reported SoDs in certain situations, but I wonder if it's now more of "frequency has to be stable" than "frequency has to be 800".

Edit since this morning: http://permalink.gmane.org/gmane.linux.kernel.cpufreq/7439 - looks like it depends on the board. The fact that our stock kernels sleep at a frequency other than 800 MHz but the bootloader starts at 800 (just checked... have a modified SoD patch that detects it) means we might be OK at other frequencies.

And after looking more and more, I don't think broadcast does much. It didn't trigger anything on my phone - I know that was our initial theory because your network had a ton of broadcast, but when you eliminated most of the broadcast leaving only unicast (skype), it was still high.

I know IPv4 broadcast never seems to trigger a wake. I was theorizing IPv6 multicast might until you narrowed down your problem to Skype.

I think this latest report is likely, just like you, some rogue app using more data than it should, but it happens to be one with a "only use wifi" setting.

I'll post data tonight, but an overnight run with 100 MHz enabled and a permanent wakelock intentionally triggered (I wanted to see baseline drain of a core "always on" at 100 MHz compared to "always on" at 200 for the purposes of calibrating power_profile.xml) resulted in 33% drain in about 8 hours. It only spent about 66% of the time at 100 MHz, the rest at 200, so I'm going to see if I can tune the COREM0/M1/DIVHPM dividers to improve performance without negatively affecting power consumption much. It's nice to now have a preliminary CPU datasheet, and also cpufreq_high in the update3 sources has some useful info on HPM. Exactly what M0 and M1 are is still a mystery though...

This drain is pretty close to my pingdrain tests in power consumption, despite deep sleep being 0% instead of 58% - "accelerate to wait" really sucks. :(

Plan for tonight is to sit perma-wakelocked at 200 to figure out 100 vs. 200 drain.
[Galaxy S II General] AndreiLux:
Well won't that screw your results now when doing the 200MHz test?... Should have locked it to 100MHz.

I retested TWD 2.0 but there it seems that the lock is back at 800MHz from my ping-bombing of the device, I don't have the 1.0 version and I'm not to familiar with that kernel anyway.

I tested the first method and it was completely unstable unless I drastically increased voltage to above stock levels for 500MHz, the second one seems to work fine. This may just mean that voltage is a problem and not the frequency.

Edit:
[Galaxy S II General] Entropy512:
I've been thinking the same - that simply being locked to 800 isn't as important as having the voltage support 800.

I think what happens is:

CPU frequency gets set to the "lock" frequency, ALONG WITH the voltage. Interestingly enough, if you look at various descriptions of approaches to SoD patches, the main concern of them is that the I2C and SPI buses shutdown during suspend, and these are needed to communicate with the voltage regulators. Software in the CPU can easily change frequency internally - but changing voltage is harder.

This is semi-confirmed if you read the details of why the lock/unlock of frequencies are so early for our CPUs:

http://permalink.gmane.org/gmane.linux.kernel.cpufreq/7439 (again)

And also, similarly, for Tegra:

http://lists.infradead.org/pipermail/linux-arm-kernel/2011-January/039617.html

So the two things are:

1) You must disable cpufreq that requires voltage changes prior to suspend, since the regulators are going away

2) On our devices, you must be able to handle the fact that the processor defaults to 800 MHz initially on resume with your pre-suspend voltage settings

I'm going to look into this, but I need to investigate an SoD that happened today, I am not sure which of two things caused it:

1) 100 MHz support

2) Attempting to rework the SoD patch to detect the processor's preferred sleep frequency automatically.

I'm leaning towards 1, because functionally, 2) should still be popping it to 800 MHz still.

Testing the SoD patch now with a pingstress test... If it's stable, that means that I need to revisit my 100 MHz support, either by juicing the voltage up slightly or by changing the dividers. (M1, M0, or HPM might be below some minimum frequency.)

As to locking at 100 MHz - that can really hose things up if the device just falls behind on work. What I can do is:

Measure the 200 MHz drain per hour

Use this to subtract the 200 MHz drain from last night's test, leaving the 100 MHz drain component behind.

There is one possible issue here - cpuidle may throw this data off by having 200 MHz be partially idle. So I may need to disable cpuidle or something. Not sure yet. To get a GOOD 100 MHz consumption estimate is going to take some work.

An interesting thing: power_profile.xml for our device does not have a "cpu.awake" entry, which is for when the CPU is on and running but in an idle state not doing work. GalaxyS series phones did have this (possible contributor to AOS reporting or misreporting?)

It's getting late tonight, but I'm curious what happens if I add a cpu.awake item to power_profile.xml on a .7 kernel...

Edit: Pingtested the crap out of it, it's something with 100 MHz support I'm fairly certain.
[Galaxy S II General] yhrn:
What hardware/firmware version are you on? Mine is A2/1.31EU.

Any hints on how to track down that app if that's the case? I can't think of any that I have installed and none of the stats I posted earlier give me any hint.
[Galaxy S II General] Entropy512:
To those that posted wakelocks files in the past day or two, sorry I haven't looked at them. I've been very busy the past few days.
[Galaxy S II General] furyau:
Well with the help of this thread and some tweaks my battery is going quite well.

Sync on

2x Push accounts and 1 IMAP 1hr updates

WIFI on

Lost about 5% in 8hours.

However something I have noticed is that if I put my three email accounts in the default email app, it seems to cause a wakelock (need to test further because I am unsure of the drain, just the % for email goes up considerably vs 1 account on any setting).

I currently am using the one IMAP account in the default app and the Hotmail app for the 2 live push accounts. I have found three issues which I can not get around with this setup tho:

1. Hotmail app only allows up to 30day old emails, want access to all emails in all folders.

2. Default app causes wakelock with more than one account (could be something to do with manual setting on one of them?).

3. Default app has no ability for quiet time (no emails pushed from 11pm - 6am).

Anyone got any good recommendations for a email app which can combine the two and meet these??
[Galaxy S II General] Dungeon47:
The stock Email.apk from SGS and variants or SGS2 and variants does both of those, I believe.
[Galaxy S II General] furyau:
Couldnt find the ability to have quiet time in the stock email app and along with the wakelocks, had to drop it! Can you confirm its there? May be a difference in CM7 nightlies
[Galaxy S II General] Userius:
I tried scanning my device with nmap, and with the screen off it didn't even respond to arp ping. It's like it's off the network. However, I too have seen those drains only with wifi on.
[Galaxy S II General] claimui:
In "Sync Schedule" (under Account Settings), you can set a "Peak schedule" and "Off-peak schedule." Just set one of them to Manual and define your "peak time" accordingly.

(The colors for setting the "Peak days" are really confusing. I think peak days are in black, and off-peak days are in white -- but it could be the other way around. Just try it both ways until it works.)
[Galaxy S II General] Molitro:
Guys, can you tell me which files I have to upload so you can help me find the app (or whatever) that is causing what I'm going to show on the pics?

I have the wakelocks, but I now there is at least another one you usually use, and I forgot to take pics from BBS.

The battery drain is good, I'm on 94% after 13 hours, but look at that wake time:
[Galaxy S II General] Seylox:
i have had my best result tonight: lost 1% in 10h.

this is with a fresh install of GalnetMIUI 1.10.25 and in flight mode. before i usually lost 5-15% even when in flight mode!!
[Galaxy S II General] Molitro:
You should kind of be worried if you lost more than that in flight mode.
[Galaxy S II General] AndreiLux:
@Molitro

CPUSpy tells you're only 12minutes awake for that period, I found the graph for the awake time to be something very inaccurate and those prolonged periods where it shows it to be awake, it's not really awake. I just think it's a bug.
[Galaxy S II General] Molitro:
Yeah, I noticed that.... Well then, I finally can forget about the freaking drain xD
[Galaxy S II General] Seylox:
i know, but i couldn't bring it down to less, that's why i'm in this thread ;)

the big losses were with ninphetamine 2.0.5 on litening 6.1...
[Galaxy S II General] Entropy512:
Yeah, a deepsleep percentage of 98% is excellent.
[Galaxy S II General] HellRazorGod:
mate do you expect ICS Android 4.0 to fix all the so called driver bugs for the s2 ?

Would it make a significant difference in battery life ?
[Galaxy S II General] Harsha Raj:
Someone can tell me if this is a problem? I don't see android OS using up the battery. But its always the display. Note that I use auto brightness setting and have custom ROM. Also the network is enabled only when I need it.
[Galaxy S II General] TMBS414688:
How do you get Display at 10%? Ive seen the screenshots.
[Galaxy S II General] chunology:
Is anyone familiar with what event2-2826 and even7-2826 is?
[Galaxy S II General] jose.celestino:
You get all other to add to 90% ?