yashsingh1/xdaforums huggingface dataset:
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
I think it gained me a little bit of improvement in my typical desk case. My main concern was that it would break something - but it actually adds a protection that didn't exist before (no LPA while GPS is running). So it might increase drain a little when GPS is running - but I'm guessing that the change was done as a fix for some sort of bug.

Previously, we had two idle states as far as statistics were concerned - IDLE and LPA. AFTR, if enabled, would get hit if LPA were selected by the cpuidle governor (this is different from the cpufreq governor...) but certain operational checks didn't pass. So we had two states (LPA and AFTR) lumped into one. (Note, this is why the "wheatley" cpufreq governor was guaranteed not to work as its designer intended if ported to I9100/I777)

In the Tab 7 Plus source base, these three states are tracked separately. So you can get statistics on time in AFTR instead of LPA, AND AFTR has a target_residency of 10ms, so it gets hit when there are expected idle gaps greater than 10 ms and less than 40 ms (before, it only got hit if there was a 40ms expected idle residency and the LPA criteria failed.)

Regarding the GPS operational checks - the problem with Samsung source code drops is that you know that something changed, you can GUESS why something changed by reading the code - but you don't KNOW why something changed unless you can match the changes with a publically available commit - which doesn't exist for anything cpuidle related. They still only have IDLE (no AFTR or LPA) support in mainline! But I figure blocking LPA when GPS is operation has to have a valid reason for being in the source base - better safe than sorry.

Overnight drain is a ***** to test these days due to that stupid intermittent wifi drain regression... :(

One problem is we're entering regimes where I can't do good testing without a dummy battery that has a fine-grained current sensor.

BTW, as I understand it (and I could be wrong, the documentation is ****...), the three idle states are:

IDLE - Clock to the CPU is shut off, but the CPU remains powered - so static dissipation is still there

AFTR - Clock to the CPU is shut off, and power to many of its parts is removed, eliminating most of the static dissipation. Cache remains powered

LPA - Even cache gets turned off, so it must be synced/flushed prior to entering this state
[AT&T Samsung Galaxy S II SGH-I777] garyd9:
Just to clarify - we no longer need an init.d script for enabling AFTR?

Thanks

Gary
[AT&T Samsung Galaxy S II SGH-I777] IVIadness:
Swipe still works fine for me, so bump that to 99.6,also love the newest kernel getting a little better battery life. Rock solid so far thanks for your hardwork man!
[AT&T Samsung Galaxy S II SGH-I777] Alucardis666:
Thanks for the update. gonna give it a shot :-)

EDIT:

Just flashed. seems very responsive and overall snappier than anything else I've ever run. I'm liking it so far. but it hasn't even been an hour. lol. I'll run it for a while and post back my findings. btw... I'm wondering what governor you're using in Voltage control? Noop ok or something else? Also...any particular reason that this kernel doesn't allow for GPU tweaking like siyah?
[AT&T Samsung Galaxy S II SGH-I777] Najuto9tail:
thank youuuuuuu
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Nope - I edited my init.d scripts post on that to indicate it was obsolete. Having that script there won't hurt it though

I hate uninformative errors:

<6>[ 163.115450] sdhci_suspend_host : MMC Card OFF samsung-hsmmc
<6>[ 163.172504] c1_enable_regulator_for_usb_mipi: disable LDOs
<6>[ 163.173957] PM: suspend of devices complete after 165.755 msecs
<3>[ 163.182104] pm_noirq_op(): platform_pm_suspend_noirq+0x0/0x38 returns -11
<3>[ 163.182117] PM: Device power.0 failed to suspend late: error -11
<6>[ 163.182243] PM: early resume of devices complete after 0.113 msecs
<3>[ 163.182325] PM: Some devices failed to power down
<6>[ 163.183018] wakeup wake lock: sec-battery-monitor

This seems to be catching my battery drain regression "in the act" - but it's really uninformative as to which device actually failed to power down. I think I might be able to get info with CONFIG_PM_DEBUG - but that might spam the dmesg so much I'll never see the start of the problem.

I wonder if there's an app that will fire an alert based on a dmesg printout?

Governor? noop is an I/O scheduler, not a cpufreq or cpuidle governor. Right now I'm using BFQ via the init.d scripts from my scripts thread - but I really haven't put huge effort into tuning this.

GPU tweaking - I currently have clock frequencies but haven't gotten around to voltage control. Some people stated to me that VC only mattered for serious overclocking, but I now have seen some reports of it improving battery life. So I'll look into it eventually.

The responsiveness comment reminds me I should probably add an init.d script for dropping the conservative governor's polling interval (which improves responsiveness).
[AT&T Samsung Galaxy S II SGH-I777] Alucardis666:
Thanks for clarifying :-)
[AT&T Samsung Galaxy S II SGH-I777] jazzboyrules:
Well then, I guess that installing Swype Installer caused that. I just updated to DD 1/29/2012 without any issues.

@Entropy Thanks for the update! :)
[AT&T Samsung Galaxy S II SGH-I777] garyd9:
Increase the size of the kmsg ring buffer. Tripling the size wouldn't have too much impact on the phone performance. Shame there isn't a cron daemon on these phones - it'd be easy enough to write a quick shell script to grep the dmesg for a string and copy the entire buffer to a file if its found. (hmm.. I wonder if cron would be able to wake up the device from suspend... then again, that wouldn't be needed...) Port a crond over, and you wouldn't even need to triple the buffer.. just run a script every 30 minutes or so (depending on how quickly you wrap the kernel log buffer.)
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Hmm, good ideas. Probably more often, I think PM_DEBUG is really spammy.

Will look into it tomorrow. Might be able to do it with just a shell script with a long sleep() in it - hackish but viable.

Edit: Just grepping through code, it looks like some wakelock caused an -EAGAIN in power_suspend_late() in wakelock.c - time to enable wakelock suspend debugging and hope it happens tonight while I sleep.
[AT&T Samsung Galaxy S II SGH-I777] mkosmo:
Haha gotcha. I can't blame you... As a sysadmin by trade, I fully understand what a vital role laziness has ;-) But you could write a release packaging script that does that all automagically for you.

Also, do you accept external patches? If so, do you prefer them as pull requests on github or by another method?
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
As to accepting patches - if they fit within my design goals (e.g. I'm highly unlikely to accept a patch for a cpufreq governor - see gary's "why are there so many damn governors" rant a few pages back - I THINK his rant was in this thread?), I'll accept it.

I prefer patches formatted by git format-patch, e.g. something I can "git am". There was once a great link describing the shortcomings of github's pull request approach, but the basic idea was - There's no easy/clean way to have a patch "cleaned up" or amended using github's pull request process - you need to have it rejected and rewritten - but since it has to already be published to the submitter's repo, it's hard to rewrite it without commiting the mortal git-sin of rebasing something you've pushed publically!
[AT&T Samsung Galaxy S II SGH-I777] skullunit:
Entropy512, I just rooted and flashed your kernel. Is it safe to keep my wifi on now? Was keeping it turned off to conserve battery on the stock GB 2.3.6

Thanks for sharing your work btw :D
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Bad news is that the problems with UCKK6 in regards to wifi performance are in the system image, not the kernel - with the same kernel and different /system, UCKH7 does not have the BT-AMP bug and UCKK6 does have it.

There are other differences that I MIGHT be able to find a kernel workaround for eventually - in addition to the BT-AMP bug, UCKK6 appears to have ARP offloading settings and broadcast packet filters far more "open" than H7 - so certain types of traffic on your wifi network will cause problems with K6 that don't happen with H7.

For example, as documented in my battery drainers thread, the ****ty 2Wire routers included with AT&T Uverse send all sorts of ARP spam over the network. UCKH7 devices ignore this, UCKK6 wakes up once for every ARP packet - sending drain through the roof.
[AT&T Samsung Galaxy S II SGH-I777] skullunit:
Thanks for the reply, at least I have root access now so more options are on the table. If I'm understanding you correctly I may encounter the same battery drain issues as before.

Since flashing I've kept the wifi on and so far battery is holding steady. I'm guessing I'll really be able to see how things are doing after a complete charge and giving better battery stats a chance to do it's thing.

Thanks again.
[AT&T Samsung Galaxy S II SGH-I777] clown_luv:
Entro I need some cm7 love from your kernel :)
[AT&T Samsung Galaxy S II SGH-I777] tneil:
You can downgrade by flashing UCKH7 or flash UnNamed 1.3.2 which is based on UCKH7.

That's what I did and I'm getting good battery life.
[AT&T Samsung Galaxy S II SGH-I777] axis01:
I'm running the newest ATT 2 wire router and haven't had any issues with excessive wifi drain. I'm on the latest Unamed and your previous DD. Fixing to update to the 0129.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Hmm, maybe it's older units then.

I know I've seen ARP spam coming out of at least two Uverse routers made by 2wire
[AT&T Samsung Galaxy S II SGH-I777] DefTaker:
Hmm...maybe cause I have an older unit it's spamming out ARP requests like crazy? :confused:

@axis - would you mind posting the model number of the router you have? Maybe I can get AT&T to update my router...

Thanks.
[AT&T Samsung Galaxy S II SGH-I777] :
The newer Uverse modems are a slimmer black 2wire version as opposed to the bigger bulky white ones that they have used forever. They are still only WirelessG and not N, but they seem to work better than the older white versions. Ive had mine since the beginning of November... along with my 3 wireless boxes. :D
[AT&T Samsung Galaxy S II SGH-I777] vladm7:
I wonder if any of those leaked UCKJ* modems would not have those bugs...
[AT&T Samsung Galaxy S II SGH-I777] desiromeo719:
Wait so if I am on unnamed 2.2.1 which is uckk6 base but flashed the uckh7 modem then I dont have the bt-amp bug affecting uckk6?
[AT&T Samsung Galaxy S II SGH-I777] NJGSII:
Changing the modem doesn't get rid of the issue. The aos bug is software based.
[AT&T Samsung Galaxy S II SGH-I777] vladm7:
removed, incorrect
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Correct. You need to flash a system firmware that is not based on UCKK6 to fix the BT-AMP bug.

You can remain on the UCKK6 modem - the modem is not the cause of the issue.
[AT&T Samsung Galaxy S II SGH-I777] avidmovies:
A good option would be unnamed 1.x
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Just uploaded 1/30 releases.

Main improvement: I found a change in the latest Epic 4G Touch sources to the Bluetooth HID driver. Applying this to I777 kernels seems to have fixed the BTHID issues in UCKK6, should help with newer I9100 bases too.

RANT TIME: Samsung and AT&T screwed this one up. They released UCKK6 with a kernel that did NOT have this fix in it, and in addition, they are not complying with the GPL for recent I9100 kernels. It is clear that they were releasing kernels over there with this fix but have not posted updated I9100 source code. The end result is only initramfs repacks over in I9100-land have working Bluetooth HID on newer bases. It wasn't until Samsung released updated E4GT sources that this patch was identifiable.

A few other improvements, see changelog.
[AT&T Samsung Galaxy S II SGH-I777] rav4kar:
Thanks Entropy, Super fast updates and super good releases! you are charged up so are we! :)
[AT&T Samsung Galaxy S II SGH-I777] autonomous-inc:
Man Entropy. You are fanfuckingtastic. To have actually corrected the Big S' mistake makes you one of the most talented and intelligent kernel makers on this forum. Gokhan's gonna be happy. So will all the I9100 users.

Cheers man.
[AT&T Samsung Galaxy S II SGH-I777] Nizda1:
Entropy,

This is very impressive work, so far not one peep out of Ashmem so far, our any of the VM issues

Sent from my SAMSUNG-SGH-I777
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Well, they did correct them eventually - they just did a ****tacular job of releasing the fix. Not released on I777 at all, and no sources on I9100.

I'm hoping to have a few more positive reports of the fix working before I post the link over there.
[AT&T Samsung Galaxy S II SGH-I777] autonomous-inc:
I can say with certainty that it works with my bluetooth keyboard and mouse. I just paired and connected the keyboard and mouse twice to make sure, and voila, worked like a charm. No cycling.
[AT&T Samsung Galaxy S II SGH-I777] Nizda1:
Sorry, got cut off. just tried the uckk6 base, your bthid solution was an elegant approach and works perfectly. Everything is working great, we are very lucky to have you as a Dev.

Thanks,

Nizda
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
More like lucky I just briefly peeked at Steady Hawkin's github and saw that he was applying a new set of Samsung updates, figured I'd look into the drop for goodies.

That power management bug is STILL pissing me off. I could be completely barking up the wrong tree with what I'm looking at now. I'm actually thinking I need to revert to 12/21 to see if maybe it was the BCM4330 driver changes, as almost right after I posted that I went out of town - so maybe it only happens on certain wifi networks. It does seem to only happen when connected to a wifi network.

If anyone who has Hellraised later Samsung bases like XWKK5 or later tries BTHID, reports of that would be greatly appreciated.
[AT&T Samsung Galaxy S II SGH-I777] garyd9:
If it helps any, and don't tell AT&T this, I never experienced this bug on my home network. I MAY have experienced at work, but it's extremely rare that I enable wifi at work, and I may have just assumed that any large drain was due to my tinkering with the phone.

What are the odds that whatever is spawning the i777 wifi power drain bug is related to the issue people are seeing on the 7+ with wifi related SOD's? Completely different wifi drivers and chipsets... but if there's something in common somewhere else... (I haven't experience the 7+ issue either.)

Interesting thought...

Gary
[AT&T Samsung Galaxy S II SGH-I777] th3g1z:
OMG you are the man entropy. I am hell raised with checkrom revohd v4 and with your latest kernel I finally have Bluetooth hid back since 2.3.5. That's amazing. How did you do it? Thanks again.
[AT&T Samsung Galaxy S II SGH-I777] Alucardis666:
Thanks for another great update. gonna flash now.
[AT&T Samsung Galaxy S II SGH-I777] NJGSII:
The AOS battery drain has only occurred for me whenever the phone was on a wifi network. I'm back on a UCKK6 based rom ATM and tonight while I had the phone just sitting on my counter connected to home wifi, it was draining at a higher rate.

No big deal if it's for an hour, but if I forget to put it in the charger overnight, I'll wake up to get my ass bitten in the morning. That's when I'll be at 15-20% charge.

Hopefully you can find a solution to the problem.
[AT&T Samsung Galaxy S II SGH-I777] axis01:
I just updated everything in November with the new slimmer black modem. It's model is 3801HGV.

I have 2 wireless boxes. LOVE THEM. Hated that they charged me $50/each to ship them and the other two back. In the end it saved me money since I was fixing to have to run lines to my oldest sons room.
[AT&T Samsung Galaxy S II SGH-I777] Nizda1:
Entropy,

I hate to be the one with the first bug, but i anyone that uses Bluetooth especially HID and is currently on UCKH7 firmware should probably not update to this latest kernel. Everything was working great, then I went back to UCKH7 because I cant stand that battery drain, now i figured their potentially could be a problem but not of this magnitude. Ok, so Im going though my usually testing and when i try to connect my first HID device(keyboard) Bluetooth settings FC. Oddly enough the keyboard worked even though it wasn't even showing it found it or paired the device. After rebooting and leaving bluetooth off I noticed the device getting very warm then logcat was showing all kinds of error under power_management, touch input etc.. Basically UCKH7 bthid is incompatible with the rest and as it seems vice versa So since I have not delved into yet as its very late and I have to wake up soon, the only way i got everything to return to stable was to flash/wipe, the power mgmt issue you were discussing before as well as sound issues were definitely aggravated as a direct result from the bthid. Anyway tomorrow I will reproduce the experience and get you some logs to take a look. On the other hand a version of the kernel w/o the bthid fix for UCKH7 firmware would be cool if you think it appropriate, bc I noticed a massive increase in boot time, response and stability before I hit that bthid curveball.

Thanks again
[AT&T Samsung Galaxy S II SGH-I777] AntwanL:
For some reason this is killing my video playback. Keeps giving me a "File contains incorrect data"
[AT&T Samsung Galaxy S II SGH-I777] Simba501:
Have you tested it with a revert?
[AT&T Samsung Galaxy S II SGH-I777] AntwanL:
I reinstalled UnNamed 1.3.2 which I believe comes with 12/08 and it seems to work fine, I'm keeping it there for now, I downloaded 1/30 from my pc and I'll try it in the morning

I uploaded it to the phone using Samsung Kies, which I like for songs and certain files, but I noticed it seems to corrupt large photos, likes skews the colors. Anyone else notice issues with files using Kies?

I ask because I'm worried may its corrupting something in my larger files during the upload.
[AT&T Samsung Galaxy S II SGH-I777] AntwanL:
I tried reverting to 1/29 with no luck, but 1/30 rolled out so quickly I don't think I tried any videos on it to compare.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Hmm, jump between something before 1/2 and afterwards. I'll try poking at this tonight.

I would first suspect 1/2 as it's the only time the MFC driver got touched - but the changes were minimal and don't even affect I9100/I777: https://github.com/Entropy512/linux...e3b827b0856bbb83a23f2b81c981d72d12ab0#diff-10
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
Hmm, I'll check into these.

XXKI3 is working fine, UCKH7 will need to wait until tonight. Time for a shower and work.

Edit: Did you have existing paired HID devices? What happens if you unpair them, switch kernels, then redo the pairing? In my XXKI3 tests, it was a fresh pairing.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
I've stated multiple times over the past few pages where I got the fix from. The origin of the change is also stated in the changelog.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
The problem I'm fighting is not an AOS drain case - see the known issues in the first post. In some cases, when wifi is connected, it seems like a regulator is not getting shut off in deep sleep. This appears to happen starting with 1/2, but it could have been 12/21 - I was away from my apartment visiting family and friends most of the time in between, and the different wifi environment could have changed things.

It appears that it MIGHT start first if sec-battery-monitor grabs a wakelock during suspend, causing suspend to fail - but it could just be coincidence. It should be possible for this to happen without permanent effects though.
[AT&T Samsung Galaxy S II SGH-I777] shoman94:
Have you done any looking into the auto brightness level?
[AT&T Samsung Galaxy S II SGH-I777] rav4kar:
Flashed DD-013012 last night, charged the phone to 100% battery and left it around 8 hours on WiFi syching my emails ( 2 gmail (default + enhanced email),1 excahge, 2 yahoo, 1 hotmail), facebook. And it's 97% after 8 hours! So drain is less than 0.5%/hour! Impressive hah!
[AT&T Samsung Galaxy S II SGH-I777] axis01:
Is there anything that can be done with the "tvout resume work"? I know it's a process that the CPU goes through even if you don't use it but didn't know if something could be written in the kernel to prevent it from being triggered or at least triggered less often. It doesn't seem to use a lot of battery but as racers say, ounces make pounds. :D
[AT&T Samsung Galaxy S II SGH-I777] smknutson:
Thank your so much Entropy for your continued work!!!
[AT&T Samsung Galaxy S II SGH-I777] :
Besides the BluetoothHID, how did the new kernel react with the KH7 base? Im still on 1/2/12 because for me its rock solid, but the changelog makes me want to jump to the 1/30 kernel.
[AT&T Samsung Galaxy S II SGH-I777] jazzboyrules:
From your experience, does unnamed drain lesser battery than stock 2.3.4? If so, how much is the difference?

Thanks.
[AT&T Samsung Galaxy S II SGH-I777] rav4kar:
I am on work wifi for about past 3.5 hours, something is draining my battery so fast that I have never experienced before with any other previous releases, I need to investigate it!

Android OS tops the battery usage chart!

Entropy, attachments are for your review! As I noticed in the after noon, the very idle phone (in the sense I did not use the phone for call or browse at all) drained 11% battery from 1.52PM to 2.52 PM ( 1hour).
[AT&T Samsung Galaxy S II SGH-I777] AntwanL:
I tried 1/24 and it works fine, 1/29 and 1/30 show this screen
[AT&T Samsung Galaxy S II SGH-I777] Peaster111:
+1 any progress? It is still not working right. I'm stuck on the 12/8 version awaiting that fix.
[AT&T Samsung Galaxy S II SGH-I777] Entropy512:
It's on my list. That one's a hard one - something in the I9100 megapatch changed it. Based on what people have said, this one breaks before 1/2/2012?

Was it broken in 12/12/2011? I know I pulled the upload for that, but I'm reattaching it here.

Way, way low on my priority list - I've never seen it take more than a few seconds of time, it's insignificant compared to the IRQ time spent on suspend/resume, which is second after trying to hunt this intermittent drain-in-deep-sleep issue I keep running into.

Weird, I cannot think of anything in the release that would change this behavior - hit the known battery drainers thread, you can probably skip straight to the Shark for Root instructions.

Find a small clip that exhibits the problem, upload it with Kies, confirm it's broken, then pull the converted file from your device and post it here or PM me a link.

I confirmed that my existing baseline profile H.264 Handbrake encodes work fine, I'm going to try one of my high profile ones soon.

Also, get a dmesg/logcat of the problem.

Last, I've got a test kernel attached for you that reverts this commit out of 1/29:

https://github.com/Entropy512/linux_kernel_sgh-i777/commit/fe5e1dafd862c9da144e6cff1a512367864b0910

This will determine if it was the GPIO patch or the cpuidle patch that broke things.

Edit: Also, if that test kernel is still broken for you, can you try this init.d script on 1/24 to see if it breaks things? http://xdaforums.com/showpost.php?p=20023083&postcount=4
[AT&T Samsung Galaxy S II SGH-I777] Alucardis666:
Running yesterday's release. Everything's good on my end... 11 hrs and I'm at 75%. :-)
[AT&T Samsung Galaxy S II SGH-I777] rav4kar:
I would suggest as many do to stay on KH7/2.3.4 ( either Stock with bloatware removed) or UNamed 1.3.x if you are concerned about battery and connected to various wifi networks like home/work in order to avoid wifi drain,etc with KK6 base.

The good thing is you are already on KH7/and Entropy's DD kernel. Straight to your question, UnNamed 1.3.x ( KH7/2.3.4) is better than UnNamed 2.2.1 ( KK6/2.3.6) as far as battery drain is concerned.

KH7/Entropy's DD /stock 2.3.4( with bloarware removed) or UnNamed 1.3.x is best I ever rated top! ( This is my personal, nothing to hurt anyone's review).

Thanks