yashsingh1/xdaforums huggingface dataset:
[Nexus S Android Development] caleb1783:
Yours:

Idle: 12274316

Top On: 151883

Top Off: 3545659

looks like you have more idle time than deep idle... -> some app is keeping your phone awake...

I got about 50-50 between them... No top on for me because i dont use bluetooth or gps...

Idle: 5838320

Deep Idle: 4196067
[Nexus S Android Development] Ezekeel:
Not sure how accurate these battery stats really are. Also, there were reports that the battery needs a few charge cycles to properly calibrate. I suggest to use it for some time and look at the effects in daily use.

Only the normal IDLE state is used with screen-on or while connected to USB, so this probably just means that the device spends more time with the screen on. Look at the average time in idle_stats if you want to see if some app keeps waking up the device from DEEP IDLE.

Regarding the wakeups from DEEP IDLE while playing music, it puzzled me that the average time was only 7ms for mp3 playback while it was 17ms for FLACs (with the stock app). Estimating that the DEEP IDLE cycle takes about 1ms to complete, the 7ms for mp3 playback is not that much and it certainly would be nice if one could reduce the number of wakeups. My gut told me that removing RTC TICK as wakeup source and adding RTC ALARM instead could reduce the number of wakeups so I tried that. With this change for both mp3 and FLAC playback using different music players the average residency now is consistently 20ms. And after a day of usage I have not stumbled upon any problems, so I am making a note here: HUGE SUCCESS. Question is why is my gut a better coder than me. :D

Bugfix: http://www.pastie.org/2805119
[Nexus S Android Development] franciscofranco:
You're a machine, thank you.

I'm gonna try that.
[Nexus S Android Development] polobunny:
I see what you did there... ;)

Still working very nicely so far. Seems very stable using morfic's latest TEUV, whereas in the past it was definitely not as stable. One big applause for lazy and deep idle combo. :D
[Nexus S Android Development] caleb1783:
looking good! always go w ur instincts!

Sent from Divinus Nexus S...
[Nexus S Android Development] brenix:
Just added the bugfix and whoa my avg for top=off went way up.. in my previous post it was 135ms.. this is what I just got after leaving the phone sit for just a bit:

# exec sh '/sdcard/idle_stats.sh'

idle state total (average)

===================================================

IDLE 196200ms (1ms)

DEEP IDLE (TOP=ON) 0ms (0ms)

DEEP IDLE (TOP=OFF) 33988ms (2124ms)
[Nexus S Android Development] morfic:
From now on you are only allowed to release patches from 5pm central central time to 10pm central time, so I have a chance to respond with a built kernel within the hour.

;P

Curious how this impacts poweramp now.

If it's not any better, we can at least learn from it, maybe pass on the findings to the creators of poweramp.
[Nexus S Android Development] morfic:
Looking forward to the latest didle patch, seems to be a real power saver.....on top of what is already saved.

6 more hours before I get home :)

Edit: Oh wow, wrong thread, so sorry.
[Nexus S Android Development] Tzorg:
Hi Ezekeel,

I get a lot more idle than didle and my screen is off 90% of the time. Using Franco's 2/11 kernel on NSC50. See stats below:

IDLE 3480207ms (2ms)

DEEP IDLE (TOP=ON) 0ms (0ms)

DEEP IDLE (TOP=OFF) 921626ms (41ms)

And:

I have loads of apps doing updates on the background draining my battery :D , but the screen is definitely off as you can see.
[Nexus S Android Development] yaronyud:
look i just saw that in less than 12Hours your phone has BIG DRAIN...

when i use 3G and facebook+whatsapp and many other draining i lose about 50-60%... with current deepidle i am on Franco->27.10 Kernel
[Nexus S Android Development] polobunny:
Now that is weird. It's going down waaaaay too fast.
[Nexus S Android Development] Tzorg:
I've never had much better battery than that, to be honest, not even when I was on stock. Have the same drain with matr1x or trinity.

I've been assuming it's because my background tasks, like GTalk, mail, etc.
[Nexus S Android Development] red_skittles:
I asked this over in the Trinity thread but never got an answer so I'll ask here.

Does the race to idle effect also apply when the screen is on and the phone is in use? I'm assuming that when the processor isn't under heavy load the frequency drops down so are there any positive effects of running at a higher frequency and finishing tasks faster or does the increased voltages needed for higher frequencies cancel out any of the benefits of race to idle (or race to lower frequency) when the phone is in use.
[Nexus S Android Development] polobunny:
The effect is negligible, but is still applying. A big energy sucker is the screen, so when you got the screen on you can say bye to your battery. :P
[Nexus S Android Development] Ezekeel:
I tried PowerAMP and it also has an average time of 20ms for both mp3 and FLAC.

If no background task is holding a wakelock while the screen is off, the device will go to SLEEP. This is not reflected in the above statistics - take a look at CPUSpy instead.

IDLE
/
y
/
screen on? SLEEP
\ /
n n
\ /
wakelock? DEEP IDLE TOP=ON
\ /
y y
\ /
BT or GPS?
\
n
\
DEEP IDLE TOP=OFF

While the screen is on only the normal IDLE state is used and the increase in the voltages for the higher frequency states outweight the power savings in IDLE.
[Nexus S Android Development] polobunny:
Super drawing... but anyway :P

How do you check for wakelocks? It seems latest TEUV with didle isn't as power saving as I thought it would be (although I didn't go through a few charge cycles yet) and my average idle seems low (do I need to reset those idle_stats?).

IDLE is 8,000,000ms while DEEP IDLE TOP=OFF is around 3,000,000. Phone is laying on desk at work with little to no activity. I had maxfreq disabled though, just enabled it a few minutes ago..

There's absolutely nothing running, or nearly, I disabled Tasker to make sure it wouldn't steal my thunder either.

Thanks for the help
[Nexus S Android Development] Ezekeel:
Check wakelocks with BetterBatteryStats (http://xdaforums.com/showthread.php?t=1179809).
[Nexus S Android Development] cabstrak:
Sorry if this has been asked before, I couldn't get myself to browse through 40 pages nor do I know what keywords should I put in on the search bar, but anyway..

I just recently tried out deep idle using morfic's latest TEUV-S22-0211.

From the cat /sys/class/misc/deepidle/idle_stats ,

IDLE 465632ms (4ms)

DEEP IDLE (TOP=ON) 0ms (0ms)

DEEP IDLE (TOP=OFF) 158549ms (35ms)

and on CPU Spy it shows I spent most of the time on the state "Deep Sleep"

It's actually working, right? Should I be worried that CPU Spy shows Deep Sleep instead of Deep Idle?

'cause I think few weeks ago I saw a screenshot of CPU spy with an extra column that says something like "unused cpu state" ..
[Nexus S Android Development] polobunny:
*shrugs*
[Nexus S Android Development] Ezekeel:
The time in DEEP IDLE is not shown in CPUSpy. That is why I implemented idle_stats. And these stats look fine to me.

That answers your question if some process is keeping a wakelock for an excessive amount if time - no. So everything seems to be working fine.
[Nexus S Android Development] polobunny:
Nevertheless my average for DI top=off is always near 8ms. Shouldn't it be higher?
[Nexus S Android Development] morfic:
idle state total (average)

===================================================

IDLE 516148ms (5ms)

DEEP IDLE (TOP=ON) 0ms (0ms)

DEEP IDLE (TOP=OFF) 668638ms (6753ms)

just phone laying around shows largely improved avg TOP=OFF.

*IF* i turn the camera on and off, still a requirement to see anything but 0s

Did i miss something somewhere?
[Nexus S Android Development] FloHimself:
What rom are you running?

This behavior doesn't appear on GWK74 for me. So it's maybe a GRK93F related bug!?
[Nexus S Android Development] Tzorg:
CPUSpy always reports my screen off time as Deep Sleep though.
[Nexus S Android Development] waterface:
I'd like to try that latest bugfix, but I suppose you need to know programming to add that bugfix yourself, right?...
[Nexus S Android Development] skitapa:
No, you just need to add the patch and compile the kernel. Google it. If you can learn to do it yourself, you have come a long way to becoming an arcane master of the dark compiling arts - And you can answer to the question, -what kernel are you on? -My own, muhuhahaha *fingers tapping together* :-O
[Nexus S Android Development] coloxim:
My phone doesn't want to go in deep sleep..open close camera doesn't fix it..why?

Inviato dal mio Nexus S
[Nexus S Android Development] al_madd:
what kernel do you use?

how many cycle you have charged after flashing latest kernel?
[Nexus S Android Development] waterface:
And I need a Linux platform for this, right? Sorry for going off-topic. A lot of the stuff I'll find googling is going to be SO over the top of my head...
[Nexus S Android Development] coloxim:
I've tried matrix and Trinity..always

Inviato dal mio Nexus S
[Nexus S Android Development] Maximilian Mary:
It looks like deep_idle is working well for you.
[Nexus S Android Development] coloxim:
Sorry my mistake ..i misunderstood top on and top off..sorry..

Inviato dal mio Nexus S
[Nexus S Android Development] doc_v15:
I was just wondering, Ezekeel, is your mod is applicable for other phones such as LG Optimus 2x?? Sorry, I dont know much about programming..
[Nexus S Android Development] coloxim:
Anyway battery Widgets with stock kernel show -20mA..if i try a kernel

With deep idle..never less 40-50mA..

Inviato dal mio Nexus S
[Nexus S Android Development] sixstringsg:
Probably not in the same way it works here. All phones should be capable of deep idle, just in different ways.
[Nexus S Android Development] coloxim:
Sorry..instead to use Max freq, i use set CPU screen off profile(800-1000) and charging profile(100-1000) when i connect the USB the phone isn't at Max freq if deep idle is off, i m right?

Inviato dal mio Nexus S
[Nexus S Android Development] franciscofranco:
Profiles just kill your battery, but that's just me.
[Nexus S Android Development] coloxim:
Ok..thanks.. :p

Inviato dal mio Nexus S
[Nexus S Android Development] Maximilian Mary:
I figured out what was keeping my phone from going into deep idle.

I had 4G (wimax) on (but not connected).

O.o
[Nexus S Android Development] morfic:
I need to start camera or nothing is reported for top on and off.

If the phone is off for longer periods of time I end up seeing 0mA in battery monitor indicating the length of the SleepOfDeath.

Despite my best efforts to wake it, it's a battery pull.

Worst, I had it reboot when I had just turned off screen and a incoming call triggered a reboot.

That's with a kernel built up to bugfix #11
[Nexus S Android Development] morfic:
Post Cm7.1 nightlies and or kangs.
[Nexus S Android Development] Ezekeel:
Good to know. Maybe someone with a NS4G who is able to compile a kernel can investigate what check exactly is keeping the device from entering DEEP IDLE like Flo did before. If we know that, we could try modifying the code so that at least DEEP IDLE with TOP=ON is used.

That camera issue seems to be a ROM problem. I am not having any trouble with CM7.1 stable. According to Flo the problem is not in GWK74, but in GRK93F and since you are using CM nightlys and kangs it probably was introduced recently with an update. Someone should contact the CM devs and make them aware of this issue.

Concerning the SoD and reboot, I checked the threads of the different kernels that have DEEP IDLE implemented and it seems so far there are no reports of such problems for other kernels. I also personally do not have experienced any issues on my test kernel, so until this changes I am inclined to believe that is it not caused by DEEP IDLE.
[Nexus S Android Development] morfic:
Going to flash cm7.1 while building a gwk74 stock source + didle on defconfig build.
[Nexus S Android Development] Ezekeel:
That problem also exists in stock, so the MIUI guys probably just patched in an erroneous update from the stock tree just like the CM devs did. But that is just a guess, because no one can know what the people responsible for MIUI are actually doing besides themselves, because they are not releasing any source...
[Nexus S Android Development] morfic:
pastie-2709212:

@@ -49,3 +49,4 @@ obj-$(CONFIG_SCREEN_DIMMER) += screen_dimmer.o

obj-$(CONFIG_TOUCH_WAKE) += touch_wake.o

obj-$(CONFIG_BLX) += blx.o

obj-$(CONFIG_LIVE_OC) += live_oc.o

+obj-$(CONFIG_CPU_DIDLE) += deep_idle.o

diff --git a/drivers/misc/deep_idle.c b/drivers/misc/deep_idle.c

That patch needs fuzz for Kernels that do not use blx, liveoc and others, just a fyi, maybe you can clean them up for others, to make it easier for them to apply.

Are you going to keep checking this post if i add more or want them in separate posts?
[Nexus S Android Development] Ezekeel:
In the coming days I will try to create some patches for all my mods (except for Screen Dimmer, because Touch Wake replaces that) based on the latest released stock kernel. I hope once the stock kernel source finally is online again as a git I can simply use these patches to start creating my new reference kernel. However since I never tried I am not sure if it possible to create universal patches that can be applied without fuzz for all possible target kernels, because patches do need some context or at least line numbers and these will be different for different kernel sources.
[Nexus S Android Development] morfic:
You work on each in their own branch. (Now you could, but won't need to, make patches against the source)

then you create a "allmy****" branch and merge all others into that. Now this branch is complete, while the other branches have only the individual changes in it.

working with git allows even people who have no clue what they do to throw around words like "cherry picking" and "merging" and getting your patches into their projects, even if they could never manage to apply a patch let alone make one.

yeah, git is that good if you sit down and use it.

I'm still barely scraping the surface of the powers of git myself :/

Now where didle is in GWK74 stock kernel, do you want me to test with stock + didle, or stock + lazy + didle?
[Nexus S Android Development] morfic:
https://dl.google.com/dl/android/gpl/android-gpl-kernel-sojus-gwk74.tgz

Just in case you don't want to wait for their git to return afterall.
[Nexus S Android Development] Ezekeel:
With lazy and screenoff_maxfreq enabled it could be more stable. Some people were reporting issues with DEEP IDLE when using low frequencies. Also putting lazy in is not much extra work.
[Nexus S Android Development] morfic:
Was just asking wrt minimum changed from stock source.

Going to patch in lazy now.
[Nexus S Android Development] morfic:
cm 7.1 on stock source + didle + lazy:

needs camera to be turned on and off to get stats

do not touch phone for ~8 minutes, try to get stats: no device, nothing will turn it on, classic SoD

didle enabled, maxfreq enabled as per init.d script

flashing another rom right now
[Nexus S Android Development] morfic:
http://morfic.euroskank.com/simka/****-04112011b.zip

Now we have something interesting:

Behaviour unchanged for me (SAMOLED i9020), open cam or no stats, hit home, hit power, then a few minutes later, device dead.

Same kernel, same rom (Oxygen 2.3.1) but SLCD i9023 phone, also no stats on boot, turns on cam, home, power off, the (same) kernel does not SoD for francisco.

(FYI -> **** just means "full of defconfig")

This is the GWK74 source linked earlier, plus didle, plus maxfreq'd lazy
[Nexus S Android Development] Serious_Beans:
I'm using latest CM7 Kang with 3/11 deep idle and I opened cam a while ago and I still have no SOD, like I said in your thread still Rock Solid! I have a i9020t btw.
[Nexus S Android Development] caleb1783:
does going into didle mean battery drain will be -2ma?

according to my battery widget. i am spending around -50ma even when screen is off...

Sent from Divinus Nexus S...
[Nexus S Android Development] FloHimself:
on what system are you building and what toolchain do you use?
[Nexus S Android Development] Ezekeel:
When I checked my phone today I realized that the clock did fall 15min behind. I never had anything like that before and since in the Trinity thread someone reported the same issue, this must related to the latest DEEP IDLE changes. That makes sense since I did remove the RTC (real-time clock) TICK as a wakeup source. However I do not want to revert that change since it significantly improved on the number of wakeups while playing music, so instead I additionally added ST (system timer) as a wakeup source. During music playback the wakeup interval is still 20ms for both mp3 and FLAC, so that is still fine. One change I noticed is that the wakeups while screen-off with no process running, have decreased from several seconds to about 300ms. I think that is a good thing since 300ms is still more than enough to be efficient and waking the device more often might solve the problem with the clock and maybe even the SoD some people are experiencing.

Bugfix: http://www.pastie.org/2815223
[Nexus S Android Development] waterface:
To all of you guys struggling and hoping to see -2mA as soon as you turn off the screen:

I am no geek and I may as well be very much off base, but it just seems like Battery Monitor Widget Pro does an ESTIMATION of the power consumption, based on what I don't really know. It dawned on me because firstly, it DOES use the word "estimated"; secondly, nothing seems to change if I select auto or estimated mA retrieval method; thirdly, another app called CurrentWidget, that I used on my previous Android phone and worked perfectly, is not able to display the mA drain.

My conclusion is that the mA drain is just an estimate, and it probably becomes more accurate the more the battery cycles- I don't know, I'm no expert but all the above seems to make sense to me.

Devs?
[Nexus S Android Development] Ezekeel:
Afaik it is just an estimate. I would not rely on such battery info tools too much, but instead evaluate the performance in daily usage. The only 100% reliable way to measure battery performance is charging the battery to full and performing a set of exactly defined task repeatedly until the device shuts down. Doing such a battery-rundown test for different configurations will give you information about the relative battery performance.
[Nexus S Android Development] waterface:
Bingo.

Did this test just now, any of you will probably be able to repeat it. You want to see -2mA? Plug the phone into the charger, charge for even just a minute, then unplug and put to sleep. You'll see -2mA all the way the next time you will look at the stats. But then if you put it to sleep again, and go look again after a bit, you'll have -50 or so, and then it will decrease and decrease the longer the phone sits with screen off and little or no activity.

In my opinion, this behavior confirms that it is an estimate.
[Nexus S Android Development] coloxim:
Is an estimate but when it shows -12 or -2..in 1hour i lost only 1%...

When it shows more than 60ma i lost 1% every ten minute..

Inviato dal mio Nexus S
[Nexus S Android Development] Ezekeel:
I had some problems waking up the device with the power button (sometimes had to press more than one time), so I added KEY as a wakeup source and the issues are gone. Music playback is still at 20ms.

Bugfix: http://www.pastie.org/2815884
[Nexus S Android Development] coloxim:
I have same problem

Inviato dal mio Nexus S
[Nexus S Android Development] waterface:
I didn't say it's a completely inaccurate estimate. I said it's an estimate, and as an estimate it probably looks at usage stats and confronts them with battery stats. I don't know. All I'm saying is that when it shows -50 and decreasing, the instant drain could as well actually be lower. As I said, mine is a guess based on those facts I listed in my previous post.
[Nexus S Android Development] caleb1783:
aite... thanks for the kind answer...

my device lasts the whole day with 3.5 hr display on time...

i am happy with it...
[Nexus S Android Development] got2best:
Can any1 help? 2nd charge since battery stats wype.. i9023 nscolleb Franco Nov 3rd kernal deep idle on.. stock voltages.. CPU 400-1000 no live oc
[Nexus S Android Development] darthchilli:
how to apply this fix?

thanks
[Nexus S Android Development] waterface:
Not sure what you need help with.
[Nexus S Android Development] got2best:
Did u see the picture my battery dies superfast! I will say about 20-30% in an hr
[Nexus S Android Development] darthchilli:
im having the clock issue

and I see that there is a fix for this

curious on how to apply this fix so the clock does not lag when idle

Im still new to all this modding and trying to learn!

thanks!
[Nexus S Android Development] waterface:
You need to compile the kernel yourself, applying the patch.

Devs would surely appreciate a quick search before posting, so the thread stays as light as possible. I'm no dev, I'm just saying.
[Nexus S Android Development] matmat07:
Not sure if it's caused by deepidle, but when I get a new sms, the phone vibrate only half of what's it's supposed to be. I think I even miss some completely. I'll try to play around with settings, but maybe i'm not the only one..
[Nexus S Android Development] Jonathon Grigg:
When you're learning, some things don't make sense ;) sorry if you already know all of this but basically all of Ezekeels mods are things for people who know what they are doing (some of which are really good developers) to add in to their source code before they compile a new version. You can see this because in all the titles Ezekeel puts [MOD][KERNEL] to basically say this is a kernel level mod, not something you could flash over the top.

If you were to add it yourself, you would need to be running Linux (possibly Mac) with a full kernel source downloaded and a C compiler (usually found in AOSP but others are available). Once you have this, you need to apply the bugfix in the form of a patch, enable (if applicable) the new setting in menuconfig and compile. Then you either need to fastboot flash or package it up as an anykernel zip for flashing.

That is just a barebones run through of the basic steps, its more complicated than that unless you have some sort of build script or bash allias. For the majority of people, its usually just better to wait the few hours or a day or two until a kernel developer updates their kernel, or provides a test version.

Sent from my Nexus S
[Nexus S Android Development] Jonathon Grigg:
Ezekeel, I have compiled a kernel with the latest bug fixes (13 and 14) but I'm having major issues with it only an hour after flashing. Twice in the space of about 20 minutes it has just not woken up at all, requiring a battery pull to fix it. This only happens when there has been no music or anything in the background, and I leave it for 5+ minutes. Could it have something to do with the changed key event wake-up?

For reference, my kernel is a mostly stock 1ghz, stock voltages, lazy governor with voodoo sound, nothing else. I had no issues like this with bugfix 12 as the latest update.

Sent from my Nexus S
[Nexus S Android Development] morfic:
Since including i have not had an SoD, device wakes up quick, no double takes on power button.

So far, so good, while i keep phone pretty busy right now, i have periods of 20-30 minutes where i did let it sleep, just to collect stats, no issues then.

*knocksonwood*
[Nexus S Android Development] Jonathon Grigg:
Hmm, would you be able to have a look at my source here (https://github.com/jonathongrigg/carbon-core) and see if there is anything remarkable different in my herring_defconfig compared to yours? I checked your skanky git but it seems older than the bugfixes so I imagine you keep your simka releases to yourself :P

Edit: Just had another SoD, or whatever it is called. I was by my computer this time, plugging in a USB cable didn't help, and fastboot and adb both said there was no device present.