
Originally Posted by
slagar
i was mostly curious to know if i would experience a smoother transition among voltage and speed therefore increasing battery life. Please forgive my ignorance
sent from my droid using droidforums app
you pose a very interesting question actually. And there is nothing to forgive. There are tons of things i am ignorant on.
what are the affects of a sudden jump from say 1.0 volts at 250 mhz to 1.6v at 1200 mhz? And would 10 steps be better to get to that point versus one large leap?
Lets look at this first from an execution stand point without taking into account the physical side of the electronics.
I have three applications in memory along with the core parts of the android os. One of these applications wakes up for a data sync check. Presently the os is clocking at 250 mhz. As the amount of available idle time drops the governor selected determines if a speed increase is warranted. But there are several factors that need to be taken into account for this selection of frequency. How many times a second do you want to do the check for increasing the clock rate? Lets assume that the data sync operation will take 1.2 seconds start to finish. And that most of our apps will take longer than 1 second to finish. So lets check every 100 milliseconds or 10 times a second. Now we need to decide what are the trip points in idle percentage to start ramping up. Since we need a good example lets do a 10 slot kernel with the frequencies 250, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200. And each step has an appropriate voltage between 1.0 volts and 1.6 volts. Now here is the interesting part of this discussion, only one governor has the ability to do the type of ramp up we are discussing, conservative. Ondemand, interactive, performance and powersave basically (ie i am a tad over simplifying this) are at a single trip point to decide how quickly i ramp up. All four of them basically snap from 250mhz to 1200mhz at a idle percentage threshold set by the user or from a default. Now conservative on the other hand can ramp in both directions. So lets use it. Now at this point the idle percentage has gone from 95% (basically the os is just keeping everything alive) to suddenly 50% which means half of the processing time is now in use. 100 milliseconds pass by and we see this new idle percentage and we up the clock rate to 600 mhz. Another 100 milliseconds pass, idle percentage drops to 30%. We need to give it more power! We ramp to 900 mhz. Now the application is grabbing actual data over the wifi and at the next 100 millisecond check we are at 5% idle. Ie we are using 95% of the processing power of the os. Time to hit 1200 mhz. Remember we said this was a 1.2 second application run time? We have only 1/4 of the way into it an already at top speed. Now if we had done the checks 30 times a second instead it would have allowed us to ramp up more gradually. Because the governor would have seen the idle % rise at smaller increments. But the overall affect would have still been the same. At 300 milliseconds we are at slot 10 and running at 1200 mhz. This will continue for another 900 milliseconds until the application finishes and then the idle time will return from the 0 to 5% back up to 95% or so. There is really no way to save power at this point.
That example is why most governor simply go from lowest slot to highest slot in one big jump once you clear a certain idle percentage. The benefits of a ramp up are usually negated by the very fact that the application runs longer than the actual time frame of the check.
So about now you have to ask yourself "how the hell do i save battery then"? Well you have to play with the governors advanced settings not the number of slot available. Basically when you have the screen on and you are actively doing something like touching the screen or something is redrawing on the screen, the idle percentage is going to be really low and you are going to want a fast ramp up before the phone seems to lag. But where you can save power is when the phone is displaying a static screen (ie you are reading what has just been presented to you) or you have it in sleep/standby. This is when you want the governor to ramp down as quickly as possible without causing a yo yo affect. Ie you are ramping down which means the clock rate is slower, which equates to less processing power, which then causes certain background tasks to take longer which then leads to a lower idle percentage which leads to ramping backup all of the sudden. Yes i got a headache from that sentence too. In fact almost every governor has code in it to avoid that condition by doing overlapping averages with 10% or so cutoffs. Ie if the last check is close enough to this check don't go up or down because we might have found the right frequency to keep the clock rate low and use less power to accomplish the task.
And that is the key to saving battery. Finding that point where the amount of background tasks are properly maintained at a certain frequency while you aren't actively doing something with the phone.
That is why i stated you only need three slots for most of the governors. A 250 mhz, 550 mhz, 1200 mhz would allow the phone to respond to most of the situations properly and maintain a good battery life. The extra slots just allow the conservative governor to really find the "perfect or ideal" balance on the up and down ramps.
Now you have the oversimplified basics of the os side.
What about the electronic side? Well i have good news. I can make this really short.
The hardware is created to handle its top voltage and frequency and stay there 100% of time as long as proper cooling is provided. Jumping the voltage instantly really doesn't happen in electronics. It takes time, granted it is in a pico to micro second time frame but it is time non-the-less. Plus the battery can't instantly provide more power, it also has to ramp up. So basically you say "more power" and it takes the electrons a few hundred pico seconds to start responding to it. As long as you don't have a heat problem, you are good to go.