yashsingh1/xdaforums huggingface dataset:
[Galaxy S II General] AndreiLux:
I think that's fairly simple, everything that's a root process is bunched in together in there. The rest goes into Android System or individual entries.

I'll have to ask you a favor; look into the "tvout resume wo" process. I've already looked into the driver a bit and it just seems that it's exactly what the name implies, it's the TVOut driver doing whatever it's doing whenever the screen is turning back on, and I've also got the feeling that it's also doing stuff whenever the device resumes from sleep. Basically for today inside of 20h it now has a CPU time of 2m30s for something I can't even use since I don't have MHL adapter. I've tried disabling it by turning off some things in the compile configuration and tried to compile it as that but I'm doing something wrong. Maybe you'll have more success in ripping out the driver.
[Galaxy S II General] Entropy512:
I'll check that one out. Might give me some hints as to how to get the damn thing working on the Infuse. :)

I'm also going to check out our PowerProfiles.xml (buried within framework.jar I believe) for anything strange - I'm starting to think anyone with CM7 is going to have an incorrect value based on what I can see in the CM7 sources.
[Galaxy S II General] AndreiLux:
Also here: a prime example of when things go ****ing wrong.

​

I haven't figured out what the packets like

237	486.079278	192.168.1.4	192.168.253.101	UDP	Source port: 59985 Destination port: 10789​

are supposed to be. I tracked back the source port (192.168.1.4 is my Desktop), and it just shows me svchost.exe in netstat, I haven't dug in deep enough yet to see what it was. This was now on a "clean" network with no other traffic than the one captured. Still doesn't make sense to have 2200 wakelocks for 380 packets total, and the Wifi actually waking the device 92 times up inside of 8 minutes.
[Galaxy S II General] more2come:
I'm founding the "Android OS percentage is too damn high"-Party! ;)

Is it a kernel issue or a problem with the proprietary Samsung drivers?
[Galaxy S II General] Entropy512:
I think you want to try and figure out what's opening the destination port 10789 - note that multiple hosts are sending to 10789 on your device, some of them apparently external. Also, your phone is sending requests to your router to forward port 10789 to it. (See the NAT-PMP requests).

Have you ever run a torrent client on that phone?

It seems like a multitude of problems. Some people are having high AOS with no battery drain, which seems, well, odd, and others are seeing high AOS WITH high battery drain like Andrei.

In Andrei's case it's really starting to look like a network problem. Those unicast UDP packets going to 10789 WILL wake the device. Also, for whatever reason, that capture is clearly missing some data for some reason. All those TCP packets going to the phone with nothing coming back is simply not possible... However, the behaviors I can see (A UDP port opening up, then UDP connections from IP addresses all over, followed by TCP connections to those same IPs) screams "P2P protocol" to me.

Attached is a dmesg and /proc/wakelocks from today. It's a really crappy test as I didn't reboot the phone this morning or after pulling it from the charger, so I can't tell how much time that svnet-dormancy was accumulated in. It looks like radio management events are what cause that wakelock.
[Galaxy S II General] AndreiLux:
After failing with netstat not showing PIDs and LSOF being incomplete on Android, I found out by the old fashioned way, and as I already presumed it, 10789 is Skype. As to why those packets are getting lost and repeated like that, I have no idea. Best is if somebody with Skype on a different kind of phone does the same testing. I'm having mixed feelings about this.
[Galaxy S II General] Entropy512:
Well, that explains further why Skype was such a battery drainer the last time I installed it on my phone. It didn't stay around long. I never investigated in detail why, all I knew was:

Skype installed and running = battery drain

Skype installed and killed = respawned fast and drained battery

Skype removed from phone = happy phone with good battery life

It was so bad that I basically said that I would not accept battery drain bug reports against my Infuse kernel from anyone running Skype.

And yeah, figuring out what process has a port open using the standard busybox toolset is a *****.

Unless someone else capable of pulling /proc/wakelocks has a truly unexplained battery drain issue (Skype users need not apply, anyone who says they have Skype installed will receive one response from me - nuke that POS battery draining app - Andrei, had I known you had Skype installed that would've been my first advice to you without needing to collect any data.), I'm going to go back to regular kernel development and stop instrumenting my kernel. Anyone interested in the instrumentation used to generate my last dmesg, see https://github.com/Entropy512/linux_kernel_sgh-i777/commits/wifi_test_hacks

BTW, the svnet and svnet-dormancy wakelocks relate to modem control and cellular data. I would expect these to replace the wifi wakelocks for someone running Skype on cell data. Right now they're nonoptimal (a fixed 6 second wakelock after many svnet transactions, these really should be wake_lock_destroy()ed in the right conditions, I don't know what is "right" though), but they're not absolutely awful. It appears to be a limitation of the new radio interface architecture, on previous devices it was a simple serial port for RIL transactions so wakelocks for RIL items were very fine-grained - not sure about data itself though. My guess is that in most cases that the wakelock is held, the radio promotes to FACH or DCH mode anyway so a CPU held in idle wakelock isn't too bad anyway.
[Galaxy S II General] statusnone:
Sorry for the ignorance but I'm not even sure what this is. I know what a wakelock is but the /proc/ part is where I'm lost and even how to use it. Kind of new to this stuff! Thank you.
[Galaxy S II General] Entropy512:
It's a file on your phone. To pull it, either use Android Terminal Emulator:

cat /proc/wakelocks > /sdcard/wakelocks.txt

Or use ADB (Google it, if you're on Windows also try Googling Droid Explorer)

adb shell cat /proc/wakelocks > wakelocks.txt
[Galaxy S II General] statusnone:
Thank you! Does it require a root to use? Also submitting more data from my 10 hour day. VERY low usage day, high drain. Hoping we get a shed of light here soon. I'll submit more data once I get a hold of the wakelocks.
[Galaxy S II General] statusnone:
Also seems like I answered my own question but getting a few errors.
[Galaxy S II General] Entropy512:
ADB is used from your PC, that's why my commands were different for Android Terminal Emulator and ADB. And I think I screwed up... one sec...

Yup, I made a typo, edited my post. If you're using ADB from a PC, it's:

adb shell cat /proc/wakelocks > wakelocks.txt

If you're in Android Terminal Emulator, you don't type the ADB command.

This won't work, which you typed in once:

/proc/wakelocks > wakelocks.txt

You forgot the cat command there

This will sometimes work, depending on where in the filesystem you are:

cat /proc/wakelocks > wakelocks.txt

Which is why my instructions were for:

cat /proc/wakelocks > /sdcard/wakelocks.txt

In the case of the ADB command, I don't pipe it to /sdcard because the output of adb shell goes to your computer, not to a destination on the phone.

Edit: Your drain doesn't look too bad considering how much screen-on time you appear to have.

An interesting feature of SiyahKernel might be the fact that it has a 100 MHz frequency step - This will reduce power usage in the case of long wakelocks (like svnet-dormancy if that's at the top of your list), however you won't see it show as reduced in battery statistics without modifying power_profile.xml in framework-res.apk to take into account the extra frequency when calculating stats.

One other thing I've noticed - power_profile.xml does not have any concept of dual cores. So I don't know if the CPU current usage numbers assume two cores active or just one. If two cores, then the current consumption will be considerably less than estimated if the second core is turned off (which it often is).

Of note: power_profile.xml in Honeycomb devices is also not dual-core-aware, although Honeycomb devices can't hotplug the second core in and out, at least not on the Tab 10.1

Edit: Also interesting, power_profile.xml seems to be broken in many phones. For example, the Infuse doesn't have speed steps for 1.2 GHz in Gingerbread. In Froyo, it didn't even have multiple CPU speed steps (although Froyo may not have supported that...) Now I REALLY want to connect an ammeter to my battery. :)
[Galaxy S II General] emilcioran99:
That's what you want?
[Galaxy S II General] Entropy512:
Nothing looks particularly bad in there, however, it really depends on how long the system has been running.

svnet is at 4.3 minutes, svnet-dormancy is next at 3.9 minutes total wakelock time.

As a frame of reference, when idle and just using background data (syncing, etc), I hit 15-25 minutes of svnet-dormancy wakelocks in an overnight run. Of interest is that svnet-dormancy is not much higher than sec-battery-monitor for you, considering your battery polls 4 times slower than mine does. (In theory - I've seen evidence that something causes sec-battery-monitor to frequently hold off from running its polls during sleep.)

I'll look at the dmesg later, but I can't see any evidence of anything unusually bad there.
[Galaxy S II General] emilcioran99:
If so, why the Android os level is so high overnight when (in theory) the phone will must be in sleep mode? :)
[Galaxy S II General] Bergaliden:
Excellent information. Thanks a lot!
[Galaxy S II General] staygold1gr:
I am still using stock kernels Android etc. I fully charged my phone last night and went to bed at 100% I turned all a apps off switched wifi off too. Seven hours later I was at sixty % with Android OS at 72%. Are you telling me that it its Skype? Why fares out not affect HTC then? A guy that sites next to me same handset never ever had the problem. will post details of his set up, think he is running litening ROM
[Galaxy S II General] staygold1gr:
Details of my friends set up, he never had this problem
[Galaxy S II General] staygold1gr:
I also had 16 watchdog alerts from base system running st 99%. Are we sure this is not a hardware issue??
[Galaxy S II General] claimui:
So after 250+ posts, the conclusion seems to be that the "Android OS bug" is just the side effect of some rogue app. I am disappointed, but not too surprised. I experimented before with a full wipe of the phone and running without any apps, Google accounts, or other accounts. I got great battery life when I did this, so I suspected the problem wasn't with the kernel or any low-level stuff.

Now I have battery drain but I am pretty sure it's the result of my Exchange email account. I need it for work so nothing I can do about that, except try other email apps.
[Galaxy S II General] Entropy512:
Grab /proc/wakelocks from both devices after an overnight run with Skype please:

Charge to full

Reboot (resets /proc/wakelocks)

Reset CPUSpy counters

Put phone to sleep for the night

When you wake up:

Pull /proc/wakelocks

Pull dmesg

Optionally grab a CPUSpy shot, but just stating your deep sleep percentage should be enough.

Also indicate:

Wifi or data network - if Wifi, was sleep policy set to "never"

In Andrei's case - I'm 99% positive it was Skype.

In your case - Try disabling calendar syncing, that seems to be the most likely Exchange function to freak out. If that helps, maybe there's something in the server's sync settings you can work with your network admins on.

Android OS does show, in my opinion, much higher drain than it should on our devices - however, it's possible for people to have excellent drain performanc while still retaining high AOS. There's a possibility that it might be due to our significantly longer wakeup-from-deep-sleep times than previous devices (650 ms for mine, 500 for Andrei, 100-150 for Infuse.). Also, depending on what CPU frequency governor you're using, the CPU might be ramping up more than it should after a wakeup event. I used conservative with a screen-off profile limiting to 800 MHz with good results.
[Galaxy S II General] staygold1gr:
I don't believe this, forgot to say the person I mention does use Skype!!

---------- Post added at 01:18 PM ---------- Previous post was at 01:15 PM ----------

No worries I do as instructed, but curious to see andreis reply
[Galaxy S II General] Molitro:
I watched AOS go up after wiping and just configuring the gmail account. That's hardly a rogue app unless it's a built in app.
[Galaxy S II General] Entropy512:
It went up, but did it actually DRAIN?

And did it drain if you reset all statistics after initial sync?

As I've said before - it does report unusually high even in very low-drain circumstances. It may be purely a reporting bug - something could be wacked in power_profile.xml. I can tell you that the wifi power consumption numbers are MUCH lower in my I777's power_profile than in my Infuse, which would cause wifi estimates to drop. (The Infuse's may be wrong - the Infuse has the same wifi chip we do, but it seems to have a power_profile from an original GalaxyS series device.)
[Galaxy S II General] claimui:
AOS was high, but did you have battery drain? When I did a clean install with no accounts, AOS would still sometimes report 30-50%+ but my battery lasted around 3 days. That's a lot better than using SiyahKernel and getting AOS of 4% but using up the battery in 10 hours heh.

I'm sure it's my Exchange server at work; it's incredibly unreliable and I can't connect 50% of the time. I tried a wakelock fix (see signature) with some improvement, but I'm pretty sure the problem is that if the Email app can't reach the Exchange server, it just keeps the phone awake and reconnecting until it works. Our admin has no resources to fix it and I guess I'd rather complain on XDA than give him a hand. ;)

I agree. It sounds like what is happening is that random apps (like Skype, Exchange sync, Gmail sync, etc.) are triggering events that get lumped into Android OS. I think what we need is a more detailed version of BetterBatteryStats so everyone can more easily analyze their wakelocks.
[Galaxy S II General] KennyLegend:
I think have one of those high reporting bugs with normal drain. AOS reports over 20%, sometimes higher yet I can get over 5 hours screen on and 36 hours + battery life.
[Galaxy S II General] AndreiLux:
Removing Skype definitely killed off part of my problem. I educated myself a bit on that and it's something that's unfixable unless they change their protocol and communication architecture. I'm still on a .14 kernel so I can't comment on any AOS% changes.

But then again this happened in the last 2 hours or so:

​

So one is as far away as ever from getting to a conclusion. Those 48k wakelocks are fun.
[Galaxy S II General] :
Should I kill skype even if I don't see strange wakelocks in bbs and its service is never running and disabled from startup or is it ok like this?

If not...

Can I just block it with titanium and enable if needed?

Thanks a lot guys, for your hard work!
[Galaxy S II General] AndreiLux:
Just logging out will close the ports, no need to remove it completely/freeze it. You may still get traffic from other peers after logging out for just a short period of time but that goes away.
[Galaxy S II General] staygold1gr:
Did you find what the other 48k was
[Galaxy S II General] kidau:
I think there are a lot of people in this category, although the real question is: Would we get even better/longer battery life if AOS reports normally??

(of course, not like .14 if what being claimed about AOS bug on it is real)
[Galaxy S II General] staygold1gr:
I have just finished charging and signed out of Skype, I must admit I was to date on Skype almost 24/7
[Galaxy S II General] emilcioran99:
1. + 1

2. Don't understand something... :confused:

Why with same OS version, same kernel version, this happened so:

- a - big Android OS reporting but no drayn (I have experienced something like this);

- b - big Android OS reporting and big drayn to battery (I have experienced something like this);

- c - no big Android OS reporting and no drayn (no such experience...).

Why? What's wrong?

Because I started with big Android OS and big battery drayn, I "odinized" since I bought the SGS2 since today over 120 times. Different roms, different kernels... combined them...

NEVER have small Android OS reporting and small battery drayn, so I think that besides the crapp aplications (like Skype, Gmail, etc that they are still standing awake, although they must be sleeping) and drayns the battery, even something it' related with hardware existing in the phone.

I read somewhere in a thread that exists a version with blue motherboard and others with green motherboard, the blue is more cooler than the green one so... :rolleyes:
[Galaxy S II General] m2smoe:
AndreiLux, what do you use to open wakelocks.txt to have it all ordered like that?
[Galaxy S II General] AndreiLux:
I just imported it into Excel and sorted the rows.
[Galaxy S II General] andreyvo:
So, all newest stock ROMs - 2.3.5, 2.3.4, 2.3.3 - by this power hungry bug.

But which is latest unaffected 2.3.4 / 2.3.3 stock ROM / kernel?

I9100XXKH3? I9100XWKF3?
[Galaxy S II General] m2smoe:
I was worried you were gonna say that :D Guess i will have to install Excel then. Thanks.
[Galaxy S II General] TheFirstBen:
I'm following this post closely since I've had this problem from the start. I do not think it's an application problem, at least for me, as i see the AOS appearing as soon as i fresh start (before restoring anything, and configuring anything) from all the different roms i tried.

I don't know if that has been already done, but could we do a usage comparison with someone that does not have the bug.

So here is my average usage (i only took what seems important to me) :

Wi-Fi/GPS/3G on all day

Latitude Sync

1 Gmail Accounts full Sync (Calendar, Gmail, G+, Music etc.)

1 Gmail Account mail only sync

Facebook Contact Sync

Skype Contact Sync

Brightness on Automatic

Font used : Neuton Regular

Language : French

Using HandCentSMS (i have about 6000 messages)

To replace the lockscreen : Widget lock + Missed it apps

Keyboard configured : Swype

Provider : Bouygue Telecom FR

Background : Animated (Thunderstorm)

A couple phone calls during the day, and some text messages

I get a Wi-Fi network only at home (after 18h), during the day it just searches. But the Wi-Fi does not seem to affect my battery that much as i get the same results if i turn it off all day.

I have a lot of apps installed but : no app killer and i have (almost) no other app running than the ones seen above (skype is not running in background ;-) )

With all the above, it's 19h20, i uplugged it at 7h00 and I have 42% battery.

I'm using the following :

Rom : Batista 70 FoxHound Edition 2.2 XWKI8

Kernel : Siyah v2.0rc1

Baseband : XXKI4

SetCPU : set as SmartassV2

Android OS is at 5%, before Siyah it was about 50%, I'm pretty sure it does not correct anything as i had the same battery life before.

So is someone having a similar usage having better or worse battery ?

(attached, my wakelock, and screenshots of the battery)

Thanks
[Galaxy S II General] AndreiLux:
TheFirstBen:

​

The fun thing about that screenshot is that it doesn't agree with Entropy's description of svnet-dormancy being cell data as you were all the time on Wifi. It's also completely different as to what I have on Wifi.

Edit: or did I misunderstand and that's a day-run? Why have the wifi on then?
[Galaxy S II General] kidau:
I think that's pretty normal battery usage with AOS still on, with latitude sync and all... but i don't have much experience with livewalls, so... - -'
[Galaxy S II General] emilcioran99:
The Siyah kernel is the only kernel that I don't flash at all since now because I don't found an answer to my questions about it.

Even in this thread was an intend (Andrei Lux I think) and in others threads also to discuss about the Siyah kernel but nobody (even it's creator) don't tell one thing: the Siyah kernel

eliminates

the drayns and decreased the reporting of Android OS or found an way to decrease the reporting of Android OS,

hidden

this and the drayn remaining... :confused:
[Galaxy S II General] TheFirstBen:
The wireless is On all day, but only connected from 7->8 then from 18h30->now.

Why have it on : choose one : lazy/forgot :p but as i said, if i turn it off all day, i get pretty much the same result. I will do it tomorrow

In my opinion it only hides it as the battery is only a little better, the difference is not that huge. I use it cause it changes some other things that seems to be better (charging time for example)
[Galaxy S II General] Entropy512:
Probably not. To get longer battery life:

1) Making svnet-dormancy wakelock more efficiently might help people on cell data a little bit. How much depends on your traffic patterns. If Google services are your main background data users, it'll be probably on the order of 1%/hour in moderate signal, slightly more if you get lots of emails or IMs.

2) It may be possible, with some work, to reduce the device's wake time. 650ms is a LOT longer than its predecessors. Spending 800ms for, say, 20ms of work (650 wake + 150 sleep) is MUCH less efficient than 250-300 ms (Infuse is 80-150 wake and 100ish sleep) However the wake time might be a hardware limitation of the svnet stuff.

3) The 100 MHz support of SiyahKernel might improve "real" drain in many of the situations above, AND if framework-res.apk is modified to have an entry for 100 MHz in power_profile.xml, the AOS reporting would go down too. (Without the framework mod, 100 MHz power consumption would be falsely reported high)

oocalc here - In both of our cases, we also add math to divide the nanosecond counters to give seconds or minutes as appropriate. :)

None - reread the past few pages carefully. So far, nearly every "bug" has been traced to a rogue app (except for Andrei's latest 107 minute wakelock and TheFirstBen's latest report, which I need to look at in more detail.)

Depends on what wifi sleep policy is. If sleep policy is not "never", the phone will go to cell data when screen is off. As I stated before, it looks like the standby drain of the BCM4330 is so incredibly low (assuming the number is correct in power_profile) that leaving it on constantly may not cause any drain problems. The Infuse has the same chip (which is different from other first-gen GalaxyS phones) and it gets amazing battery life in wifi-only airplane mode.

If sleep policy is "never" but no wifi APs were in range - same deal.

PowerManagerService was pretty high there though in that case... Another one I'll have to look into.
[Galaxy S II General] AndreiLux:
We don't know. My opinion is that it hides some processes, or at least that's my experience.
[Galaxy S II General] Entropy512:
It clearly alters the suspend dynamics somehow. You see far fewer cases of ultra-deep suspend (where the dmesg timestamps go to 0.0000 and you see a bunch of interrupt statuses printed), and you don't see the "early suspend" and "late resume" messages from entering/leaving deep sleep nearly as often.

However it's clear from the deep sleep statistics and the way the dmesg counter increments that the phone is still entering deep sleep states even when it seems like dmesg says it isn't.

I haven't taken a /proc/wakelocks dump with a .14 kernel recently.

Needs more investigation.
[Galaxy S II General] TheFirstBen:
My sleep policy is set to never but there are lots of Wi-Fi AP in the area where my phone is all day (Wi-Fi is my job speciality, so lots of AP)
[Galaxy S II General] Ztax:
So I just got my S2 and want to clear some things up.

1. Does this affect all S2's?

2. If not (and I'm guessing it's a software issue), is it possible that a factory reset could fix it if you're lucky?