yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy Nexus] aron7awol:
Another conclusion that I've come to after seeing this data is that using an aggressive governor is a great idea. There's very little power hit if the CPU stays at a higher frequency for a little too long (we're talking like 1 ms) because it doesn't use much more power at a higher frequency when idle anyway.

This just confirms my anecdotal impressions using interactive governor. It is aggressive in ramping up the frequency under load, which gives excellent UI responsiveness, and I never really noticed a difference in battery life. This makes complete sense now after seeing the small difference in idle draw, especially if you consider how little time it takes for it to ramp back down to 350 MHz. You can see this by going into SetCPU and switching tabs and watch it jump up to max frequency and then back down very quickly. When you're actively using the device, you get max performance, and as soon as it goes idle, it ramps back down for power savings. That's perfect if you ask me.

A description of how interactive governor works:
[Samsung Galaxy Nexus] ro_explorer:
I have no idea what actual chip is doing the decoding ... but as long as this is related to the video rendering I just assumed it is the same as the gpu (I might be wrong though).

I'll do some GPU stock and overclock on the same kernel to see what is the power drain difference. I expect to see a small increase in power (not a dramatic value).
[Samsung Galaxy Nexus] @rbiter:
If it's not too much trouble, try doing the tests when warm/hot also. The GPU @ 307 doesn't get as warm as 384 or as quick. I don't think it will be big difference from a cold test, but quite possibly more dramatic when warm.

My grandma beat me down and took my nexus. Sent from a jitterbug with beats by dre.
[Samsung Galaxy Nexus] RogerPodacter:
this phone cannot give mA current readings, the fuel gauge is not capable. so battery monitor widget guesstimates mA readings based on the drop in percent from battery. so basically your readings are useless and do not reflect any real values, so i would not worry about them at all. its just estimating those readings with a software algorithm, which we dont know exactly what it is.
[Samsung Galaxy Nexus] ro_explorer:
I played some heavy 3d games today and I got hot phone, reboots and a huge battery drop. I guess 384 for the gpu is a little too high. Doing exactly the same thing with the same kernel but with stock gpu clock resulted in normal behaviour. I'll hook up the phone to the multimeters tomorrow and I'll come with real numbers to support this.

// sent from my green robot //
[Samsung Galaxy Nexus] Ezekeel:
You cannot simply take the difference between idle and load while screen on and take that as the power consumption of the CPU at full load. With screen on the CPU is never completely idle; also there are four different idle states with different power consumption and some of them do not switch off the CPU properly. So the power consumption for the lowest state will be much larger than you will get by taking the difference. Judging from the voltages the difference in wattage of the lowest and highest frequency state should be around the factor 2-3 and not the factor 7.
[Samsung Galaxy Nexus] aron7awol:
Let me explain how I arrived at these numbers...

I wanted to get a baseline for the CPU-only power consumption with a wakelock held but no CPU usage at 350 MHz. I asked ro_explorer to find that and he did exactly that, with a result of ~0.05 W. I needed this baseline to try to eliminate the screen consumption from the equation.

Then ro_explorer found that in the same state, 350 MHz idle, but with the screen on, minimum brightness, showing the mostly black AnTuTu testing screen, the power consumption was ~0.60 W. By simple subtraction I deduce that the screen consumption baseline for these tests is about 0.55 W. I see no reason why I can't simply subtract this from all of the tests, since the screen was always in almost the same exact state.

By subtracting 0.55 W from each of the values ro_explorer measured during the 100% CPU usage tests, I ended up with my CPU-only power consumption numbers. I'm not sure why you would consider them to be bogus.

The f * V^2 ratio guarantees that efficiency will always be lower if the voltage is higher, since performance scales linearly at best, but power consumption scales exponentially quadratically with voltage. Therefore, even if idle consumption is zero, you cannot possibly have power saving benefit by running a higher voltage and racing to idle.
[Samsung Galaxy Nexus] Ezekeel:
The power consumption does to scale exponentially it scales quadratically - that is a big difference.

According to the equation you cited the power usages should be proportional to the square of the voltages.

Here are the voltage values from the source code:

#define OMAP4430_VDD_MPU_OPP50_UV	1025000
#define OMAP4430_VDD_MPU_OPP100_UV	1200000
#define OMAP4430_VDD_MPU_OPPTURBO_UV	1325000
#define OMAP4430_VDD_MPU_OPPNITRO_UV	1388000

The lowest is for 350MHz, the highest for 1350MHz. As you can see one would expect a factor of about 2-3.
[Samsung Galaxy Nexus] aron7awol:
How can you possibly expect the factor to be 2-3? Even if you ran at the same voltage across all frequencies, the factor should be more than that, since 1350 / 350 = ~3.86

If you consider the voltage increase necessary to run at 1350 as opposed to 350, 1.380 V vs. 1.025 V, the factor is much higher:

f * V^2 = 1350 * 1.380^2 = 2570.94

f * V^2 = 350 * 1.025^2 = 367.72

2570.94 / 367.72 = 6.99

And what I came up with based on the real-world measurements: 6.80

---------- Post added at 03:23 PM ---------- Previous post was at 03:20 PM ----------

I said power consumption scales exponentially quadratically with voltage. That is true. Edit: quadratically, not exponentially. Thanks, Ezekeel.

Keeping frequency the same but changing voltage:

f * V^2 = 350 * 1.380^2 = 666.54

f * V^2 = 350 * 1.025^2 = 367.72

666.54 / 367.72 = 1.813

Increasing voltage from 1.025 V to 1.380 V (34.6% increase) increases power consumption by 81.3%. That is exponential quadratic growth. 1.346^2 = 1.812
[Samsung Galaxy Nexus] Ezekeel:
Power consumption does not directly depend of the frequency, only the voltages if you apply Ohm's law. And it scales quadratically, not exponentially - that is what the ^2 tells you.
[Samsung Galaxy Nexus] aron7awol:
Yes, quadratic growth, not exponential growth. Sorry, I'll fix that. My point still stands.

According to the f * V^2 ratio, which is defined specifically for CPU power consumption (under load), power consumption absolutely depends on frequency.
[Samsung Galaxy Nexus] Ezekeel:
Yeah, well. That is not main point.

The thing is that equation you come up which is based on absolutely no physical reality at all.

Ohm's law says the power consumption is proportional to the voltage. The frequency does not play into that directly, but only indirectly since higher frequencies require more voltage. And if you calculate the power consumption based on the voltages I posted you get a factor of about 2-3.

As I explained before, as soon as the screen is on the device is not idle anymore. This idle baseline you measured is not the idle baseline because the device was not idle.

Citation please from a reliable source.
[Samsung Galaxy Nexus] aron7awol:
Thinking about this at a high level, if race-to-idle could in fact be more efficient, why would lower speed steps even exist at all?

---------- Post added at 03:49 PM ---------- Previous post was at 03:42 PM ----------

Maybe what's confusing matters is that saying "idle" isn't properly defining the CPU's state...

The baseline ro_explorer measured was with the screen off, but with CPU at 350 MHz, idle but not in deep sleep due to the kernel wakelock which was held. He then measured the power consumption in almost the same state, but with the screen on. CPU was idle, not in deep sleep, and still at 350 MHz. The only significant difference between those two states should have been the fact that the screen was on. That is why I subtracted those two numbers to find the power being consumed by only the screen. If this doesn't make sense to you, please explain why.

Some good reading about CPU power consumption and the f * V^2 ratio:

http://en.wikipedia.org/wiki/CPU_power_dissipation

http://software.intel.com/en-us/blogs/2009/08/25/why-p-scales-as-cv2f-is-so-obvious-pt-1/

http://software.intel.com/en-us/blogs/2009/08/25/why-p-scales-as-cv2f-is-so-obvious-pt-2-2/

---------- Post added at 04:02 PM ---------- Previous post was at 03:49 PM ----------

If power consumption of a CPU does in fact scale proportionally with f * V^2, the "race to idle" concept is completely disproven. Do we agree on that?
[Samsung Galaxy Nexus] Ezekeel:
Nice article. Finally someone that explained how they got to that equation. Never saw a proper explanation before.

I agree that if the power consumption actually would scale exactly like that equation proposes race-to-idle would not work - not even if the voltages for all frequency states were exactly the same.

Thing is, reality shows that race-to-idle does work. So either these terms the author neglected in his explanation are more dominant or the whole model does not describe reality good enough. After all a modern CPU, especially highly-integrated SoC like in smartphones is more than a simple collection of CMOS gates. And if the CPU is off we can also power down other parts that would be powered on all the time even if running at minimum frequency.

I would really appreciate, if ro_explorer could run a simple test playing some mp3 with screen off with the performance governor one time with 1.2GHz max frequency and one time with 700MHz and show us the results. Also try my GLaDOS kernel for the GN which has an improved C4 state.
[Samsung Galaxy Nexus] aron7awol:
Are you referring to your experience, anecdotally? According to the formula and my math, the 1350 MHz stepping should have used 6.99 times the power that the 350 MHz stepping uses. In ro_explorer's testing, it turned out to use 6.8 times the power. To me, that backs up the math and tells me that the f * V^2 ratio is a good guideline to go by.

I agree, and I think ro_explorer already plans on doing this along with some other additional testing that I suggested, when he has some free time. Keep tabs on this thread.
[Samsung Galaxy Nexus] aron7awol:
ro_explorer did do a test which sort of covers the first thing you're asking for. He tested playing an MP3 with the screen off with 350 minimum and 700 minimum:

Now, if the system makes use of the C4 power state now, and it wasn't in these previous tests that ro_explorer has done, it could certainly change these numbers.

Ezekeel: Is the C4 state not used at all in the stock kernel without your changes, or only when the screen is off?
[Samsung Galaxy Nexus] DebtMarkets:
Just wanted to say thanks to the OP.

The information in the thread has helped me with the optimization of screen brightness. I use tasker to change the screen brightness down to 30% when I am in the web browser as pages are mostly white.
[Samsung Galaxy Nexus] Ezekeel:
I am referring to years and years of experience me and others have made for desktop PCs and laptops. Just google it.

Test it with my GLaDOS kernel and 1.2GHz and 700MHz maximum and with performance governor. Until these results are available further discussion is moot.
[Samsung Galaxy Nexus] aron7awol:
Google what exactly? Why do lower speed steps exist if they lower efficiency as you are claiming? Back up what you say with some proof instead of making baseless conjecture. Even if it's anecdotal evidence from your experience, at least bring up some specifics.

Like I said, he's planning on doing that. In the meantime, further discussion is certainly not moot. It's clear mathematically that racing to idle can't be more efficient at a higher voltage, as long as you assume that power consumption scales proportionally with f * V ^2. It's sure looking like it does according to ro_explorer's previous tests. No matter how low the drain is in the C4 state, it can't change that fact. Testing the C4 state on your kernel directly will certainly put this discussion to rest, but until then, based on the current evidence, it's looking very unlikely that "race to idle" will prove useful.
[Samsung Galaxy Nexus] Ezekeel:
http://lmgtfy.com/?q=race+to+idle

Read the first two hits.

Also see my own benchmarks: http://xdaforums.com/showthread.php?t=1297535

It is clear mathematically if we assume that the equation is actually valid. It might not be as the author of that article says himself. It might as well be a gross oversimplification of the reality and turn your calculations upside down. I explained the reasons above.

Discussion is moot since there is no data which actually reflects what we are talking about. I explained to you above why you estimates might be wrong. As long as ro_explorer has given us the results of his test, all further discussion is just speculation. I got better things to do with my time since I got two kernels to maintain.
[Samsung Galaxy Nexus] ro_explorer:
Wow ... quite a lot of activity around here :).

Sorry for not posting updates but I was caught with real life (daily job - project that had to meet deadline).

First, I found a way to extract the exact display consumption - MP3 play.

While playing an mp3 file (1KHz continuous sound - to ensure stability in power measurements) I have to switch through various states of the screen (off - min - mid - max brightness). Under this circumstances, while playing with screen off we can read the power drawn by the awaken device alone and by simply subtracting that value from the other measurements we can find out exactly how much the screen is hanging on the battery.

Ok .. so, this is the schedule for this evening:

1. Display consumption measurement with the above algorithm.

2. mp3 play (1KHz sound) with screen off and performance governor at different fixed frequencies (350 - 700 - 920 - 1200) using my current kernel (franco's #13.1).

3. put GLADOS kernel and repeat #2.

4. online streaming - youtube and tunein radio

5. GPU stock frequency and overclocking (I have two flavors of the same kernel edition from Franco).

6. I accept suggestions for other tests :) .
[Samsung Galaxy Nexus] AdamOutler:
Hey, I was reading in my fluke manual about my multimeter. It says that in order to obtain a pulsed DC value, you must add +20mA, resolution is .75%. However, on the low end, below 50mA, on my multimeter I'd have to switch to uA, add 10uA and have a reading of +/- 1%. I just thought you might like to know that. This is an industry standard Fluke 187. You should check your manual to determine if you can actually handle values below 50mA on the mA setting.
[Samsung Galaxy Nexus] aron7awol:
Yes, this is similar to what I did to estimate the battery consumed by the screen. However, since the data you're talking about isn't available yet, I used your screen on idle at 350 MHz number and your PowerAMP wakelock number. I think that was the best I could do with the data that was available...

IDLE:

350MHz: 152mA * 3.98V = 0.6W

~0.05W with screen off, no mp3 play and a software waiting for input (in this case, poweramp's lockscreen)

I simply subtracted 0.6W - 0.05W to come up with a rough estimate of 0.55W used by the screen. It will be interesting to see how close to this you end up with your new screen only test.

I then subtracted 0.55W from each of your full CPU load numbers:

FULL:

350MHz: 240mA * 3.95V = 0.948W -0.55W = 0.398W

700MHz: 380mA * 3.9V = 1.482W - 0.55W = 0.932W (2.34x the power)

920MHz: 503mA * 3.85V = 1.936W - 0.55W = 1.386W (3.48x)

1200MHz: 770mA * 3.75V = 2.887W - 0.55W = 2.337W (5.87x)

1350MHz: 880mA * 3.7V = 3.256W - 0.55W = 2.706W (6.80x)

Does f*V^2 pass the smell test?

350*1.025^2 = 367.72

700*1.203^2 = 1013.05 (2.75x the power)

920*1.317^2 = 1595.73 (4.34x)

1200*1.380^2 = 2285.28 (6.21x)

1350*1.380^2 = 2570.94 (6.99x)

It's close, so I'd say it passes the smell test. However, I used stock voltage values in the f*V^2 equation. ro_explorer, do you know what your voltages were when you ran those CPU consumption tests? If they were something other than stock, I'd like to re-do the math with the exact voltages you were running.

Awesome man, thanks again for doing this.
[Samsung Galaxy Nexus] ro_explorer:
Thank you for the input. However, in order to get high accuracy at low currents I'm not using the mA scale. I've built a sense resistor of 0.1 ohm with 1% precision and I'm measuring the voltage drop on it using a milivolt-meter with 0.1 mV steps (about 2-4% precision). I would love to have access to a fluke device though.

// sent from my green robot //
[Samsung Galaxy Nexus] RogerPodacter:
haha yes just read thru all the forums online, everyone uses black colors as much as possible because it's much better on battery life. this is why google gave the invert color setting in the web browser, so you can make all white web pages black instead.
[Samsung Galaxy Nexus] aron7awol:
Look at post #16 in this very thread to see just how much power you can potentially save.
[Samsung Galaxy Nexus] ro_explorer:
And now .... the moment of truth. The videos are still uploading.

I'll update this post with YouTube links as soon as I'll have them.

Updated - youtube links:

Display test

MP3 - Franco

MP3 - GlaDOS

GPU - STOCK

GPU - OC

YouTube 720P

TuneIN streaming

For additional details (or more test conditions) please don't be afraid to ask.
[Samsung Galaxy Nexus] Ezekeel:
Thank you very much for your efforts.

Seems like such direct measurements really are the only way to go and theoretical predictions are bound to fail due to inaccurate models that do not describe reality good enough.

I currently do not have the time to dive deeper into these numbers and draw conclusions for my kernel development. But judging from the first glance it seems C4 on the GN does indeed work less efficient that DEEP IDLE does on the NS. It is not as bad as that formula p=v^2*f make it out to be since the increase in power drain from 350MHz to 1200MHz is only about 20%, but it certainly not negligible.

How much does such a testing setup roughly cost in Euro?
[Samsung Galaxy Nexus] aron7awol:
The reason the difference wasn't as big in these tests is because playing an MP3 doesn't use much CPU. The f*V^2 ratio is a representation of the 100% CPU usage power consumption. These results are exactly what I expected.

Edit: ro_explorer, can you tell me the CPU usage % playing the MP3 at 350 MHz?
[Samsung Galaxy Nexus] ro_explorer:
It is quite cheap actually :).

Two cheap multimeters with reasonable error (about 10-15 euro each), some wires and connectors (about 4 euros all of them) some aluminum foil - the one used for cooking (free - from my wife) some double sided tape (for creating the taps on the battery) and finally, a well calibrated resistor (I got mine by connecting in parallel 10x1 ohm metallic resistors - 1% tolerance).

I would say that the whole thing will fit in about 40 euros.

Anyway, I'm into electronics and home-made stuff (my main hobby) so actually I did not spent anything on the setup (except time) ... all the required materials were on my hobby-work-bench at home :).

Obviously, with some more advanced multimeters (like Fluke), the error of the measurements will be smaller but anyway, as long as I'm keeping the same devices with the same error, the compared results should be meaningful.

And from my experience in electronics and gadgets, the numbers that came put from these experiments are very realistic.

If anyone is interested I can create a photo tutorial about how to create such a test bench.
[Samsung Galaxy Nexus] Ezekeel:
True. But the CPU is used 100% when not idle. For the CPU power consumption being 7 times higher the baseline for the other components has to be well about 0.22W and that is unlikely if you look at the results from Francisco's kernel. And that is if you assume the power consumption while in C4 is zero. Something does not pan out with this formula. It might work when the CPU is under a continues uniform load, but for the situation we are discussion this equations seems to break down.

Besides what does count for the user in the end is the actual battery drain and a 20% increase will mean a certain decrease in runtime. And that is what the user is interested in at the end and I have to consider as a kernel dev. And for me it seems to only way to get reliable results is actually test it, because theoretical predictions are not reliable.

Yes a detailed list of parts and some photos would be awesome. My brother works with electronics and he can probably snatch a few things for me. After all, it is for science. ;)
[Samsung Galaxy Nexus] aron7awol:
It is perfectly logical that the more time the CPU is spending idle, the less the power savings at a lower frequency will be. The 6.80x power consumption number applies when the CPU is being used. In this case, it's actually 5.87x since he tested up to 1200 MHz. And keep in mind, that 5.87x is how much more power the CPU is using when it's running at 100% usage at 1200 MHz. The CPU is also getting 3.84x as much work done in that state.

Here's an example to show this:

i = idle %

u = usage %

Consumption@350 = 0.12W*i + .398W*u

Consumption@1200 = 0.12W*i + 2.337W*u

100% CPU usage @ 350 (i=0,u=1):

Consumption@350 = 0.12W*0 + .398W*1 = .398W

29% CPU usage @ 1200 (i=.71,u=.29)

Consumption@1200 = 0.12W*.71 + 2.337W*.29 = .763W

In this case, running at 1200 instead of 350 uses 92% more power

50% CPU usage @ 350 (i=.5,u=.5)

Consumption@350 = 0.12W*.5 + .398W*.5 = .259W

15% CPU usage @ 1200 (i=.85,u=.15)

Consumption@1200 = 0.12W*.85 + 2.337W*.15 = .453W

In this case, running at 1200 instead of 350 uses 75% more power.

Man, let this whole "theoretical predictions are not reliable" thing go. They have absolutely been proven reliable by all of this testing ro_explorer has done. Do what you want with your kernel, it's yours. But I'm sorry, race to idle is bogus, and it's been proven so here.
[Samsung Galaxy Nexus] ro_explorer:
YouTube links added to the initial post
[Samsung Galaxy Nexus] Ezekeel:
If you really want to believe that this simple formula is the 100% truth (despite the fact that the original author of that article you cited says himself that it is not anymore for modern processors) that is fine with me.

I am all for theoretical predictions as long as they are possible and meaningful, but in this case it seems much more reliable to me to directly measure it instead.

And saying that race-to-idle is bogus is a wrong generalization of the results obtained for one device. Years of experience has shown that it works on Intel processors and my own benchmarks have shown it works for the Hummingbird on the NS. I have not looked into the details for the OMAP4 in the GN yet, but planning on doing so.
[Samsung Galaxy Nexus] aron7awol:
1. I never said the formula was the 100% truth. I used it as a guideline, and compared with real life numbers and it checked out. Put the strawman away.

2. Yes, of course it's much more reliable to directly measure it.

3. Answer this question for me: If race to idle works, and thus saves battery on Intel CPUs, then why does Intel SpeedStep technology exist?

4. Your Nexus S benchmark that you linked me to absolutely did not show that race to idle was beneficial even with deep-idle. The higher frequency seemed to be eating more battery if anything, and your experimental setup was flawed, as you were using battery %, which is known to be an inaccurate estimate, as the basis of all of your measurements.

5. Until I see a single piece of evidence that shows race to idle being beneficial, I'm going to assume it's bogus, because there's a ton of evidence suggesting that it is. Can you please show me some real evidence of this? I really don't think it exists.

6. You need to learn to admit when you're wrong, it's obviously a problem for you.