Hi everyone,
I've been reading this
http://forum.xda-developers.com/nexus-5x/general/guide-advanced-interactive-governor-t3269557
and was wondering if anybody was interested and knew their way around to try and adapt these tweaks for our trusty htc ones?
Some n5x users (specifically those who tend to not game heavily or use the camera extensively) seem to reek performance boosts while also considerably extending SOT. The OP's tweaks got the attention (and as far as I know the support) of flar2 (elementalx kernel) considering he implemented the ability to apply profiles into his ex kernel manager specifically so the interactive governor settings could be applied more easily (unless I misunderstood something - correct me if I'm wrong on that). These tweaks can be made regardless of kernel or rom - the only prerequisite is the availability of the interactive governor. It may be something worth looking into and I'm willing to learn and test - I just kinda need someone to take me by the hand and help and explain because I feel a bit lost in regards to how to best proceed :silly:
What do you guys think?
over the next few days,im gonna be working on testing out some settings (of course following that guide)
if i get anywhere with them,i shall share them
That's great to hear, thank you :good: If I can be of any help please let me know!
These are my minimal settings for now based on my usage analysis . Will probably adjust them with battery performance this week.
Idle - 384000
Page Scrolling - 702000
Video - 918000
App Loading - 1134000
High Load Processing - 1728000 ( or 1566000 )
Sinistersky said:
These are my minimal settings for now based on my usage analysis . Will probably adjust them with battery performance this week.
Idle - 384000
Page Scrolling - 702000
Video - 918000
App Loading - 1134000
High Load Processing - 1728000 ( or 1566000 )
Click to expand...
Click to collapse
If this is a stupid question I apologise but how do you apply these in ex kernel manager (or equivalent app you use)?
antimatter.web said:
If this is a stupid question I apologise but how do you apply these in ex kernel manager (or equivalent app you use)?
Click to expand...
Click to collapse
This is my setup right now. Can someone who is working on this check if I did it correctly, I have some stuttering here and there so I think i'm missing something, since it should be buttery smooth and battery friendly.
Sinistersky said:
This is my setup right now. Can someone who is working on this check if I did it correctly, I have some stuttering here and there so I think i'm missing something, since it should be buttery smooth and battery friendly.
Click to expand...
Click to collapse
Thanks :good:
Again, I'm not sure about this, but I believe you shouldn't be needing to spend that much time at max. frequency. No idea how to get it down, but I feel like I did read something in the original thread. To me (as a fairly noob, layman forum user) that 32% seems high.
Have you seen any battery savings with your current setup?
antimatter.web said:
Thanks :good:
Again, I'm not sure about this, but I believe you shouldn't be needing to spend that much time at max. frequency. No idea how to get it down, but I feel like I did read something in the original thread. To me (as a fairly noob, layman forum user) that 32% seems high.
Have you seen any battery savings with your current setup?
Click to expand...
Click to collapse
Yea, I kinnda have. But Im still tweaking it. I just dont know how to bring down the frequency It's like I setup something wrong. I do have more battery life, but I think I can do even better. Just need the right values
Sinistersky said:
Yea, I kinnda have. But Im still tweaking it. I just dont know how to bring down the frequency It's like I setup something wrong. I do have more battery life, but I think I can do even better. Just need the right values
Click to expand...
Click to collapse
One follow up to my post on the N5X thread: (http://forum.xda-developers.com/showpost.php?p=66100620&postcount=2990)
set
highspeed freq to 810000 or 702000
go highspeed load to a value between 95 and 98
the first value on taget loads to 95 384... (90 or anything lower should be ok, too, doesn't matter much as this already is the lowest freq)
the target_load value for your highspeed freq (the value after the ":" ) to a value between 81 and 90
---Edit:
Oh, and: lower target_loads => earlier to the next freq => less laggy. You can tweak that behavior with the delays and timer rate, too
But: Many frequency changes / jumps => more lag
.hEiMDaLL. said:
One follow up to my post on the N5X thread: (http://forum.xda-developers.com/showpost.php?p=66100620&postcount=2990)
set
highspeed freq to 810000 or 702000
go highspeed load to a value between 95 and 98
the first value on taget loads to 95 384... (90 or anything lower should be ok, too, doesn't matter much as this already is the lowest freq)
the target_load value for your highspeed freq (the value after the ":" ) to a value between 81 and 90
---Edit:
Oh, and: lower target_loads => earlier to the next freq => less laggy. You can tweak that behavior with the delays and timer rate, too
But: Many frequency changes / jumps => more lag
Click to expand...
Click to collapse
Ok. So what happens if I don't set every frequency? I think I saw a EVO 4G thread with this and OP had only 3 freq set in the target_load ? Is that more efficient? So to make this have proper results, I need to change the numbers after ":" until i get the perfect results?
--Edit:
Ok. These are waaay better results than I ever had. Now the other frequencies are actually being used
Sinistersky said:
Ok. So what happens if I don't set every frequency? I think I saw a EVO 4G thread with this and OP had only 3 freq set in the target_load ? Is that more efficient? So to make this have proper results, I need to change the numbers after ":" until i get the perfect results?
Click to expand...
Click to collapse
It uses the target_loads you set for the lower freq. efficiency depends on the numbers it's less text to write if the loads are all the same for each freq...
The numbers behind the ":" (the target_loads) are only one part. the other settings like timer_rate and above_highspeed_delay have a huge impact on how fast the cpu reacts under load, too. sonicron described them very well in his guides.
---EDIT:
Seems you are on the right way with these values. Max freq still is used a bit to much, but I'm sure you'll find the best values after some tries. Took me hours, sometimes days to set up my profiles...
.hEiMDaLL. said:
It uses the target_loads you set for the lower freq. efficiency depends on the numbers it's less text to write if the loads are all the same for each freq...
The numbers behind the ":" (the target_loads) are only one part. the other settings like timer_rate and above_highspeed_delay have a huge impact on how fast the cpu reacts under load, too. sonicron described them very well in his guides.
---EDIT:
Seems you are on the right way with these values. Max freq still is used a bit to much, but I'm sure you'll find the best values after some tries. Took me hours, sometimes days to set up my profiles...
Click to expand...
Click to collapse
Yes, I keep re-reading sonicron's first post due to not understanding it so well even though he explained it with so much detail, but the way I see it, if I'm correct, increasing timer_rate makes the cpu use the lower frequencies more, or the jumps between frequencies are faster? I set the timer_rate to 40000 now, just to see if it will prolong my battery. And why is the timer_slack in N5X set to -1? What's the purpose of that? If i understand correctly, it makes the switch between frequencies incredibly fast, almost instant??
Thank you for guiding me so far with this. I understand these might seem as annoying questions, but I'm trying to learn as much as I can through them
Sinistersky said:
Yes, I keep re-reading sonicron's first post due to not understanding it so well even though he explained it with so much detail, but the way I see it, if I'm correct, increasing timer_rate makes the cpu use the lower frequencies more, or the jumps between frequencies are faster? I set the timer_rate to 40000 now, just to see if it will prolong my battery. And why is the timer_slack in N5X set to -1? What's the purpose of that? If i understand correctly, it makes the switch between frequencies incredibly fast, almost instant??
Thank you for guiding me so far with this. I understand these might seem as annoying questions, but I'm trying to learn as much as I can through them
Click to expand...
Click to collapse
I've read sonicrons first post a few times myself (as I'm very interested in the idea) but my technical knowhow stops at basic adb and recovery knowledge for flashing roms... May I bother you for the current values you are using? Sorry if I seem like I'm not trying - I am
antimatter.web said:
I've read sonicrons first post a few times myself (as I'm very interested in the idea) but my technical knowhow stops at basic adb and recovery knowledge for flashing roms... May I bother you for the current values you are using? Sorry if I seem like I'm not trying - I am
Click to expand...
Click to collapse
Yes, of course. You can have it, it's no bother. I'll attach my settings. However, these are not final. The phone jitters here and there, and I think the battery life is better by only a slight percent. I am hoping during hte next few days to find values that wil give more SoT and smooth performance. I will also need help with that
Sinistersky said:
Yes, of course. You can have it, it's no bother. I'll attach my settings. However, these are not final. The phone jitters here and there, and I think the battery life is better by only a slight percent. I am hoping during hte next few days to find values that wil give more SoT and smooth performance. I will also need help with that
Click to expand...
Click to collapse
Thanks for those I will apply those and see how they work for me. I'm currently using CM12.1 (Snapshot) and greenify for a few apps. What setup are you using?
If I can be of any help (I'm not going to pretend I will be of much) please let me know
Edit: I may have spotted an error: in the first line of target loads your second frequency should be 486000:60 not 48600:60, right? Could that be the reason for your jitters maybe?
antimatter.web said:
Thanks for those I will apply those and see how they work for me. I'm currently using CM12.1 (Snapshot) and greenify for a few apps. What setup are you using?
If I can be of any help (I'm not going to pretend I will be of much) please let me know
Edit: I may have spotted an error: in the first line of target loads your second frequency should be 486000:60 not 48600:60, right? Could that be the reason for your jitters maybe?
Click to expand...
Click to collapse
Yes, that is correct. I spotted it myself this morning. And the battery life has gotten insane. 8% in 1 hour of texting and screen on :highfive: So generally, this would mean about 8 hours of screen on time for sure.
--EDIT: Im using AICP with stock kernel and greenify and amplify
Sinistersky said:
Yes, I keep re-reading sonicron's first post due to not understanding it so well even though he explained it with so much detail, but the way I see it, if I'm correct, increasing timer_rate makes the cpu use the lower frequencies more, or the jumps between frequencies are faster? I set the timer_rate to 40000 now, just to see if it will prolong my battery. And why is the timer_slack in N5X set to -1? What's the purpose of that? If i understand correctly, it makes the switch between frequencies incredibly fast, almost instant??
Thank you for guiding me so far with this. I understand these might seem as annoying questions, but I'm trying to learn as much as I can through them
Click to expand...
Click to collapse
In short, the timer_rate is just the intervall after which the governor reevaluates the loads. So it doesn't affect which frequencies are used more, but how long it "waits" to check whether it should go up to the next freq. However, this is indirectly linked to the fact, that the device will stay at a lower freq for longer.
After the decision is made to change the freq, the next thing that keeps the cpu ramp up to the next freq instantly is the delay timer (above_highspeed_delay)
timer_slack defines the max additional time that can be added to timer_freq, thus the time to defer handling the governor sampling timer.
From kernel docs: [...] at speeds greater than minimum, this places an upper bound on how long the timer will be deferred prior to re-evaluating load and dropping speed.
For example, if timer_rate is 20000uS and timer_slack is 10000uS then timers will be deferred for up to 30msec when not at lowest speed.
A value of -1 means defer timers indefinitely at all speeds. Default is 80000 uS.
here's the link to the document. Might come in handy https://android.googlesource.com/kernel/common/+/android-3.4/Documentation/cpu-freq/governors.txt
Questions are there to be asked and do not only help the one who asked the question, but the one who get's asked as well So asking and answering, both can be about learning something new, for both parties.
.hEiMDaLL. said:
In short, the timer_rate is just the intervall after which the governor reevaluates the loads. So it doesn't affect which frequencies are used more, but how long it "waits" to check whether it should go up to the next freq. However, this is indirectly linked to the fact, that the device will stay at a lower freq for longer.
After the decision is made to change the freq, the next thing that keeps the cpu ramp up to the next freq instantly is the delay timer (above_highspeed_delay)
timer_slack defines the max additional time that can be added to timer_freq, thus the time to defer handling the governor sampling timer.
From kernel docs: [...] at speeds greater than minimum, this places an upper bound on how long the timer will be deferred prior to re-evaluating load and dropping speed.
For example, if timer_rate is 20000uS and timer_slack is 10000uS then timers will be deferred for up to 30msec when not at lowest speed.
A value of -1 means defer timers indefinitely at all speeds. Default is 80000 uS.
here's the link to the document. Might come in handy https://android.googlesource.com/kernel/common/+/android-3.4/Documentation/cpu-freq/governors.txt
Questions are there to be asked and do not only help the one who asked the question, but the one who get's asked as well So asking and answering, both can be about learning something new, for both parties.
Click to expand...
Click to collapse
Is there an app that I could use to determine instantly what load the CPU uses when I open chrome, or messenger or just scroll around?
I want to make it so I get a higher frequency on the app opening load, and a lower one on the idle and scrolling load. But if i for instance, set target_load 1566000:85, it uses the 1242000:89 for app opening I think, since it's kinnda laggier?
I can't get rid of these little jitters when switching screens, or apps I'm trying to learn what happens if I put higher numbers after ":" on certain mHz, does that make it so it stays longer on that mHz value or does it wait longer before it goes higher/lower to/from that mHz? And if so, would it be logical and less laggy to put something like 1242000:50 1350000:83 1458000:80 1566000:87 ( I'm guessing these frequencies are used the most when opening an app?)
Sinistersky said:
Is there an app that I could use to determine instantly what load the CPU uses when I open chrome, or messenger or just scroll around?
I want to make it so I get a higher frequency on the app opening load, and a lower one on the idle and scrolling load. But if i for instance, set target_load 1566000:85, it uses the 1242000:89 for app opening I think, since it's kinnda laggier?
I can't get rid of these little jitters when switching screens, or apps I'm trying to learn what happens if I put higher numbers after ":" on certain mHz, does that make it so it stays longer on that mHz value or does it wait longer before it goes higher/lower to/from that mHz? And if so, would it be logical and less laggy to put something like 1242000:50 1350000:83 1458000:80 1566000:87 ( I'm guessing these frequencies are used the most when opening an app?)
Click to expand...
Click to collapse
I use the overlays from DevCheck by flar2 and the process/cpu usage overlay one can enable in the developer options in settings. I guess there are plenty of tools/apps out there that do the same (I remember an app called "cool tool" which I had on my M7).
The jitters might get better when you change the delays (and/or timer rate to a lower value). setting the target_loads lower also helps, but you have to remember that the frequency might not be used at all (which is not a bad thing in general). When you set the load to eg. 40, the cpu will will go up to the next frequency as soon as the load under actual circumstances reaches 40%. As an example (with fantasy numbers): With a setting like 1000000:80 1100000:30 1200000:80, the 1100MHz might never be used at all when ramping up, cause the 80% at 1000MHz are already higher than 30% at 1100MHz. Of course, if the gap between those two frequencies would be higher (lets say 1000MHz and 2100MHz) the cpu might not be ulilized over 30% when coming from 80% at 1000MHz). Thats why you have to calculate the efficient loads, to find out what the most (power) efficient frequencies are, and give those a bit more "priority". You can do this by setting the target load higher on those (lower on the others)
I can't tell you what numbers (target_loads) you have to put in, I'd need the actual device to test how it performs under different loads with stock and tweaked settings.
.hEiMDaLL. said:
I use the overlays from DevCheck by flar2 and the process/cpu usage overlay one can enable in the developer options in settings. I guess there are plenty of tools/apps out there that do the same (I remember an app called "cool tool" which I had on my M7).
The jitters might get better when you change the delays (and/or timer rate to a lower value). setting the target_loads lower also helps, but you have to remember that the frequency might not be used at all (which is not a bad thing in general). When you set the load to eg. 40, the cpu will will go up to the next frequency as soon as the load under actual circumstances reaches 40%. As an example (with fantasy numbers): With a setting like 1000000:80 1100000:30 1200000:80, the 1100MHz might never be used at all when ramping up, cause the 80% at 1000MHz are already higher than 30% at 1100MHz. Of course, if the gap between those two frequencies would be higher (lets say 1000MHz and 2100MHz) the cpu might not be ulilized over 30% when coming from 80% at 1000MHz). Thats why you have to calculate the efficient loads, to find out what the most (power) efficient frequencies are, and give those a bit more "priority". You can do this by setting the target load higher on those (lower on the others)
I can't tell you what numbers (target_loads) you have to put in, I'd need the actual device to test how it performs under different loads with stock and tweaked settings.
Click to expand...
Click to collapse
Oh, so, if I understand this correctly, the number after ":" is like a roof. And when the CPU load hits that roof, it goes to a higher frequency, for example if i have 810000:81, as soon as the load goes to 81 it will switch to 918000, which is the next frequency ? And If i put 918000:90, it will stay on 918 mHz until the CPU load reaches 90? and then go to the next one? And the timer is just used to determine how long it takes to jump between the frequencies? So, what happens if I put 0 on the timers? Do they do it instantly? Does it take more battery life that way?
Related
Hi, I spend last few days optimizing voltage table on my Desire and it left me wondering.
I bumped into several situations where 2 or 3 frequencies would be stable on the same voltage level. My question is, theoretically, if 300MHz would use the same voltage as 800MHz, would the power consumption increase proportionally or would it remain fairly similar?
Seeing that 300MHz would need more burn time at the same voltage to complete a task that 800 MHz would do in fraction of that time and then idle, this leaves me puzzled. Is it better to always use highest frequency of the group with same voltage for better efficiency? Or does the slower frequency actually consume less power even though it has to work longer and uses the same voltage?
Please enlighten me or discuss
I would also like to be enlightened on this.
AFAIK your assumption is on the right track, get the job done as quick as possible & get back to idling...
Slightly off topic, but somewhat relevant
byrong did a great write up on the effects of cpu speed vs screen brightness power consumption here that may be be of interest...
Interesting but still doesn't answer one question:
If my 245, 368 and 768MHz would be stable at the same voltage, does it matter if I set 768MHz as my minimum/idle frequency instead of 245MHz? Would is consume more power in the long run say on conservative governor?
And what about the screen-off profile? Consider a scenario when I'm playing an MP3 while screen is off and the player will still take a lot of CPU power to pre-buffer the song, apply equalizer, post-processing etc. Now would that nearly constant burn theoretically consume more power on the 245MHz or 768MHz? It still has to do the same work and 245MHz should just have higher constant load, right?
And how about complete idle. Does it really matter if I idle on 245 or 768 MHz if the voltage and actual work done is identical?
This is I'm sure something everybody is asking but nobody knows the real answer. Unless I'm speaking utter rubbish it's perhaps time to run some tests.
Even if the voltages are the same for different frequencies, I'm sure higher frequencies draw higher amounts of current (as shown in byrong's research, although his voltage tables were not stated). If you change your min cpu freq from 245 to 768 MHz I'd almost guarantee more power consumption, even when idle. I could be wrong though. If you're so curious, why don't you try and post back?
I might be wrong but my $0.02
From what I can remember in class, Power = voltage x current
To do the same amount of work, supplying lesser voltage would mean more current is consumed. That said, if less work is being done at the same voltage, less current would be consumed.
So running the CPU at a slower clock cycle means less work is being done, so less current consumption, compared to running it at full 768MHz.
I think ... ;p
Well I think I will make some empiric testing as soon as I find a way to log current current (yea funny ) to a file.
Even if your $0.02 are right, you're still talking about drawing less current over longer time or more current in a short burst. Of course there are apps like games that will probably take as much horsepower as they can get for redrawing the screen - in that case lower constant frequency is better, because higher frequency would actually have to do more work - drawing more FPS just because it can. For minimum frequency the situation is completely different as the apps only require bursts of workload.
nik3r said:
Well I think I will make some empiric testing as soon as I find a way to log current current (yea funny ) to a file.
Click to expand...
Click to collapse
I thought you read waydownsouth's link?
In the methodology section byrong states he used CurrentWidget to log current over time. You can also use Battery Monitor Widget.
By the way, his methodology is pretty excellent as it minimizes as many variables as possible, and he wrote his own script to keep the cpu working at a controlled rate. I think at a minimum, you should put the phone in airplane mode while conducting the tests.
KNIGHT97 said:
And fir the advanced users (with text reading that, in red color) some ABB settings would be good too
Click to expand...
Click to collapse
Am sure Devs, others and I too have said this across various places, so I will skip the intro to ABB and go straight to tuning it for our benefit. The only things you need to know before getting the hands dirty are ( @KNIGHT97 I know you are no newbie, but this post will cover some basics too )
Do your homework - ABB is not for the faint hearted. If you are not ready to put in some time to test multiple combination of settings, have the phone freeze on you several times until you perfect it, this is not for you. Stay with the UVing that we are used to, or stick with the -25/ -50 - 75 mV undervolting.
ABB will vary with device. You need to know the ASV of your device (/sys/devices/system/abb/abb_info - the last line in this file tells what your phone's ASV value is), and then go about changing the values keeping your ASV's values as baseline.
Anyone jumping in late, make sure you read the changelog dated 22nd April 2013 in this post. All credits for whatever I know about this goes to @AndreiLux and all that I say here are from the post I have linked and what I did from there. Another good read will be this thread, where @cba1986 has collated a lot of inputs from AndreiLux and a few others.
Before you play with ABB, have your stock gate voltages and stock body voltages handy (these are also in the third sheet of the spreadsheet I have attached).
So here is how I went about this whole task - the prerequisite is you pick a stable (preferably stock ROM, and kernel that supports ABB (of course) and is deemed stable for everyday use). This is important because you do not want a freeze occurring due to a kernel or ROM anomaly to impede on your undervolting decisions
Undervolt the gate of the device (the usual voltage we all undervolt) step by step. When I say step by step, what I mean is
Undervolting it based on a rough logic (say, -50 mV) and letting it run for a day
Then undervolt ONE FREQUENCY STEP a bit more (say by 25 mV). Let in run one more day.
If your phone didn't act weird (SoD, random freeze ups, etc.) then undervolt THE SAME STEP SOME MORE (by another 25 mV), let it run one day more
Rinse and repeat until your phone freezes up during the course of the day. And when it does, reduce the undervolting by, say, 12.5 mV and see if all goes well for that frequency (else reduce the undervolting some more)
When doing all this, make sure you are putting your phone to full use - watching videos, playing audio through bluetooth, Wi-Fi, et all. Repeating this for every frequency step will give you the maximum undervolting your phone can tolerate, Congratulations
The Body voltage - the one that ABB-enabled kernels let us play with
By default, you will have 4 sets of body voltages - one for the 200 MHz step, one for 300 to 800 MHz steps, one for 900 to 1600 MHz steps, and the last one for anything higher. Using BetterBatteryStats (or any other tool that works for this cause), find the amount of time your phone spends in each frequency step while it is awake and while on battery. Note that the voltages or their combinations I mention here on may be for a ASV 1 device, YMMV.
The frequency that almost everyone's device uses the most must be 200 MHz (we are not going to factor the Deep Sleep time here). The stock gate voltage for this step is 912.5 mV, and for an ASV 1 device, the stock body voltage is 750 mV. That is, the gate voltage is higher than the body voltage - what this means is that while the CPU will be able to clock easily, it will also have a higher static leakage (Forward Body Bias). So, for lower frequencies, we have to try and bridge the gap between these two voltages such that the gate voltage is lower than the body voltage, thereby saving on static leakage. Let's assume that you were able to get the phone undervolted to 837.5 mV (-75mV undervolting) and find it stable. You will have to overvolt the body to 850 mV so that you will have a -12.5 mV difference between the gate and the body, give you what is called a Reverse Body Bias - in this state, the CPU will find it difficult to ramp the clock, but it will not leak static current. With the same assumption of 837.5 mV at gate, and with 850 mV at body, you will have to go through the 24 hour observation cycle for freeze ups or SoDs - if they occur, it means your phone is finding it way too difficult to ramp the clock up at these voltages - in which case, you will raise the gate from 837.5 mV to 850 mV (while the body remains at 850 mV). When you do this, you are actually undervolting the gate by -67.5 mV and overvolting the body by 100 mV - while this may sound bad to achieve a 37.5 overvolting after going through too much trouble, you are actually overvolting a bit to arrest static leakage which is a higher cause of drain at lower frequencies.
For steps 300 to 800 MHz, you will follow a similar logic, and find a body voltage that, while might be a bit higher than the stock, will give you a negative or zero difference between the gate and the body as much as possible. The same procedure of validating the value you choose by letting the phone run a day's course is imperative. A Word of Caution: The 800 MHz step is a bi*ch. If you encounter a hang or a freeze, increase the gate voltage, or reduce the body voltage such that the 800 MHz step is at a low or zero RBB and keep it in observation. If this step is not the cause of the freeze up or SoD, then go through the usual cycle of manipulating the voltage of each step. Rule of the thumb from here on is to change the body voltage such that most or all of the frequencies between these steps will be in RBB (have a 0 mV difference between gate and body, or a lower positive value- like +12.5 mV). Depending on your phone's ASV, you may very well end up effectively overvolting your device here too by applying a higher than stock voltage at the body, but the same purpose as the 200 MHz step applies here - only a little less pertinent because the time your phone spends in these steps will be about 40% lower than the time it spends in the 200 MHz step.
For steps from 900 to 1600 MHz (and above), where a phone spends roughly 30% of it's time on, the more important factor is to ensure the CPU is able to scale. And, to increase the body voltage to match the gate voltage to create a reverse bias or a lower forward bias will be an overkill of an overvolt on the body. So my suggestion, at least for ASV 1 CPU is to leave the body voltage of these frequencies to stock, and be happy with whatever undervolting you achieve at the gate.
Miscellaneous points:
Forward Bias will enable higher undervolting at the gate, but will have a higher static leakage. Reverse bias will arrest static leakage to a greater extent, but it will be difficult to undervolt as much as you could in a Forward Bias setup. This is why you may have to increase the gate's voltages a bit more than without ABB, to achieve a stable system (that will have a much lower static leakage)
The most positive indication of a good ABB/ Voltage configuration is that your device will run relatively cooler because of the obvious reduction in static leakage
In most kernels, you can change the body voltage by 50 mV steps (700, 750, 800, 850, etc.) - anything else will be rounded up
You can change the thresholds for the Body voltage steps (example - change the 300 to 800 MHz step to, say, 300 MHz to 900 MHz, which will also change the next step to 1000 to 1600 MHz). But it my various, time consuming experiments, there is no perceptible gain. This is of course not true for all phones, so some of you may still benefit on a case to case basis
The process for modifying the gate and body voltages for the GPU are similar to the above. And not all kernels allow modifying the gate voltages for MIF and INT, in which case, I recommend that you do not touch the body voltages either
The BetterBatteryStats input on how much time is spent on each frequency step is useful to adjust the gate and voltage combinations such that you will create a reverse bias as much as possible in the lower frequency steps that your phone will dwell on for a longer time. The attached spreadsheet will tell you that I have configured it in such a way that I have reverse bias in the steps that my phone spends 70% of it's time on, and am achieving an average of 7% overall undervolting - yes, all this for just 7% To put that into perspective, a -50 mV undervolt across steps will give you an overall undervolt of about 3%. To find that out, find the time spent in each step, the overall undervolt/ overvolt of each step (with or without ABB), and do a SUMPRODUCT in Excel against the total time spent in all the frequencies combined. Also, while % numbers are good to say and nice to hear, what matters is how much of a difference they actually make - for me, I have a super low battery drain in screen-off and during sleep - provided that some weird app or setting does not kill my battery
Before putting a script with all your UV and ABB values in that init.d folder and giving it executable rights, make sure you put it in a harmless location (like /data/tmp), give it executable permissions and execute it from there, so that if your phone goes thermonuclear, all you would need is a hard reboot and not look at how to remove that darned script from init.d to even get to the home screen
I don't know if I caused more confusion than clearing them Ask your questions, I (and others too, who have dirtied their hands in this amazing power-tool) will try to answer them as much as possible.
An important note on the attachment - DO NOT APPLY THE VOLTAGES THERE BLINDLY EVEN IF YOU HAVE AN ASV 1 DEVICE. NOT ALL DEVICES, EVEN WITH THE SAME ASV BINNING ARE MADE EQUAL. Do your experiments, at least attempt some and apply your findings.
Yes, thanks for clearing this out. This is going to help many advanced users understand the gate and body voltage related settings and body bias related stuff.
While I read and read all the time, some of the points, I admist to have missed and you explained them thoroughly, so a big thanks to you for that.
And yes, like you said, starting from the basics, this is always good since it'll help some users get acquainted to this advanced tuning.
I ha e experimented and bencmarked carefully to get my best UV/ABB combo and I can easily manage 2 days with 6-7 hours SOT without any static leakage, plus I have quite a high UV (-90) so my device hovers around 28-33 degress in normal usage and 36-37 during heavy HD games. Stability checks, benchmarking, I/O scheduling and VM/Kernel tweaks have provided a super smooth experience.
I'll include a link to this in my signature, in case someone wants to learn about ABB basics and begin with advanced stuff
Have a good day
Regards,
KNIGHT97
KNIGHT97 said:
Yes, thanks for clearing this out. This is going to help many advanced users understand the gate and body voltage related settings and body bias related stuff.
While I read and read all the time, some of the points, I admist to have missed and you explained them thoroughly, so a big thanks to you for that.
And yes, like you said, starting from the basics, this is always good since it'll help some users get acquainted to this advanced tuning.
I ha e experimented and bencmarked carefully to get my best UV/ABB combo and I can easily manage 2 days with 6-7 hours SOT without any static leakage, plus I have quite a high UV (-90) so my device hovers around 28-33 degress in normal usage and 36-37 during heavy HD games. Stability checks, benchmarking, I/O scheduling and VM/Kernel tweaks have provided a super smooth experience.
I'll include a link to this in my signature, in case someone wants to learn about ABB basics and begin with advanced stuff
Have a good day
Regards,
KNIGHT97
Click to expand...
Click to collapse
Ah! I missed mentioning the lower device temperature point - will add that
(If you own a Nexus 5X or 6P and you are too lazy to read the philosophy of this technique, head on down to the 2nd post and pop those values into your kernel manager and be happy. If you own a different device, please read this post in full.)
The Introduction
I'm about to tell you how to get buttery smooth, lag free performance with insanely good battery life, using an old school governor featured in practically every kernel... This tweak is applicable to every phone with any ROM or kernel--stock or custom--that provides the Interactive Governor. :good:
Yeah, yeah... everyone promises good battery with great performance, but who actually delivers? Maybe it isn't as smooth as you want, or maybe it requires something your kernel or ROM don't support. Or maybe the battery life promises just aren't what you expected. There's always some awful compromise. Not here!
This isn't a guide to get 36 hour battery life... provided you never use your phone. That's deep sleep optimization, which is lovely and all, but what good is the phone if you can never use it?! And with the new Marshmallow Doze feature, this strategy is becoming a think of the past. What I'm talking about is 7-14 hour screen on, actual hands-on usage times! Without compromising anything, you can get 7-8 hour screen on usage with regular, no-compromise usage habits: daytime visible screen brightness, both radios on, sync on, network location on, all the regular usage features, the whole kit and kaboodle... all smooth as a baby's butt and snappy as a Slim Jim! (Up to 14+ hours if you can stand minimum brightness and WiFi-only with a custom ROM and other stuff turned off! And this is with stock voltages and full frequency range--you'll likely get even more if you choose to optimize those as well!)
However, it should be noted that this does not apply to gaming, heavy camera use, etc. Anything that is an automatic battery killer in and of itself. There's nothing that can be done about anything that forces the phone to utilize its maximum resources all the time. But you should know that by now. Further, this guide is about optimizing the CPU as much as possible. It does not cover things like eliminating wakelocks so your phone sleeps well, removing unnecessary and battery draining stock apps, keeping your screen brightness down*, and all that stuff that's been covered in other posts ad infinitum. Those optimizations are up to you.
*At least on the Nexus 5X, you shouldn't be turning your screen brightness above about 60%. It should be more than viewable in sunlight at that brightness, and keep in mind that the brightness power requirements increase exponentially, so a 100% bright LCD screen will use about 3.5-4.5x more power than a 60% bright screen. I don't see that fact brought up often, so I thought I'd mention it here.
After a bit of tweaking and experimenting, I developed some settings that provide absolutely incredible battery life, buttery smooth performance, and a lag free experience. And you don't need a fancy governor, or a custom kernel, custom clock rates, or even a Nexus 5X. This will work on any ROOTed phone with the Interactive governor!
So, after writing a (nearly identical) guide for the EvoLTE folks over a year ago, I'm now back to update this information to provide strategies for multi-CPU devices, as well as specific settings for the Nexus 5X you can use right away.
Enough long winded preamble! Let's get down to...
The Nitty Gritty
Before I lay out all the settings so you can blindly enter them into your governor control, I should to explain some of the principals I employed to get the results I did. The primary thing to understand before I do is: little might you know, the settings in the Interactive governor can be tweaked on a clock range basis. That is to say, you can finely control how the governor responds at a variety of clock rates, thus better dictating how it should operate under various loads. This is integral to the configuration, because it means the difference between jumping from the slowest speed to the highest speed under load and sustaining lower clock speeds for tasks that don't really require higher clock speeds.
By default, the Interactive governor will jump from lowest speed to a "nominal" speed under load, and then scale up from that speed as load is sustained. That is lovely, but still too twitchy to provide serious efficiency and power savings. It spends most of its time at 2 or 3 clock speeds and barely hits other clock speeds that are ideal for other tasks or usage patterns.
Instead, what we want to do is configure it to handle different types of loads in different ways. A load suited for scrolling through a webpage is not the same as a load suited for downloading/processing streaming video is not the same as a load suited for snappy loading of an app is not the same as a load suited for high performance gaming. Every kind of load has different tolerances at which their minimal speed is indistinguishable from their maximal speed.
To understand what's best under a variety of tasks, we have to identify two types of load profiles: nominal clock rates and efficient clock rates.
Nominal Clock Rates
Nominal clock rates are the minimum CPU clock rates that perform a given task smoothly and without stuttering or lag. To find the nominal clock rate for a given task, turn on only the first CPU using the Performance governor and turn them both down incrementally until you find the minimum clock rate that works best for what you're trying to do, without introducing hiccups. (If you have a CPU or kernel that hotplugs individual cores, multiply that clock speed by your number of cores.) Keep the 2nd CPU on the Powersave governor with the lowest frequency your kernel supports. (Or turn it off completely if hotplugging allows.)
(Note: If your device supports per-core hotplugging, you might be better off using the old guide to determine your nominal clock rates. The Nexus 5X and all current kernels only support hotplugging entire CPUs, so your results may vary if you use any other device.)
For example, on my Nexus 5X, scrolling (not loading, simply scrolling) through a large webpage smoothly will occur when the first CPU clock rates are no less than 460Mhz. (This is on mine without background tasks taking any CPU. Yours may be different depending on services running, the browser you use, your ROM, kernel, etc.) Thus, the nominal clock rate for scrolling a webpage on my Nexus 5X is 460Mhz.
Efficient Clock Rates
Efficient clock rates are CPU clock rates that are unique in that they are the most optimal frequency given the range of voltage requirements. If you map out the frequency jump and the voltage requirement jump between each of the available clock rates, you will find that occasionally the voltage requirement will jump significantly without the frequency jumping proportionally to the previous differentials. For example, using stock voltages, the EvoLTE's msm8960 chipset clock/voltage ratios jump significantly higher from 702Mhz to 810Mhz than the ratios from 594Mhz to 702Mhz.
Because I cannot find the stock voltages of the Nexus 5X clock speeds, this section is INCOMPLETE! If you know the voltages, please post and I can update this guide to include the 5X's Efficient Clock Rates.
Clock Rate Biases
Using the information provided above, figure out both your nominal clock rates for the tasks you perform most often and your efficient clock rates depending on your kernel/custom voltage settings. For me, since I cannot determine the efficient clock rates, I use the nominal clock rates listed above. For the tasks I generally perform on my phone, my nominal clock rates are as follows:
Idle - 384Mhz
Page Scrolling - 600Mhz
Video - 787Mhz
App Loading - 960Mhz
High Load Processing - 1440Mhz
(Note that you must calculate the values that are optimal for your phone for best battery and performance! Each phone is different because of the ROM, kernel, background tasks, etc!)
With this done, you will want to start the fine tuning phase! Correlate the efficient clock rates with their closest nominal clock rates, similar to below:
(This section of the guide is INCOMPLETE because I do not know the clock rate voltages for the Nexus 5X. If you know these, please post in the comments and I will update the guide!)
Idle - ???Mhz efficient / 384Mhz nominal
Page Scrolling - ???Mhz efficient / 600Mhz nominal
Video - ???Mhz efficient / 787Mhz nominal
App Loading - ???Mhz efficient / 960Mhz nominal
High Load - ???Mhz efficient / 1440Mhz nominal
Keep these handy, as they're going to be necessary for...
The Set Up
Now that we know what are the most efficient nominal clock rates we want to focus on and what the most optimal are for what we want to do, we will start low and scale up as necessary. It's always better to begin with underperforming and tweak the settings upward until we're satisfied with the performance of our target tasks.
In its default state, the Interactive governor has a hair trigger that will raise and lower the clock rates, which means it spends too much time at unnecessary clock speeds, wasting power, and scales down too quickly, leading to stuttering performance. We will take advantage of a seldom used feature of the Interactive governor. Specifically, that with which it determines when it is okay to scale up to each higher clock rate, on a frequency by frequency basis.
We have two primary goals: respond as quickly as possible to each load request for a lag free experience and exceed the desired clock rate for a given task as little as possible. To do this, we will instruct the Interactive governor to trigger certain clock rates in different ways depending on our expected load.
I won't explain all of the settings of the Interactive governor--there are plenty of summaries all around. (Go search now if you don't know what any of the settings for Interactive governor do. I'll wait here.) However, I will explain an incredibly powerful feature of the Interactive governor that is rarely included in those summaries: multiple frequency adjustments.
The above_highspeed_delay setting, for example, defines how long the governor should wait before escalating the clock rate beyond what's set in highspeed_freq. However, you can define multiple different delays that the governor should use for any specified frequency.
For example, we want the above_highspeed_delay as low as possible to get the CPU out of the idle state as quickly as possible when a significant load is applied. However, we don't want it to jump immediately to the fastest clock rate once it's gotten out of idle, as that may be overkill for the current task. Our target trigger (which you will later adjust to suit your system and usage profile), will begin at 20000μs. That means 20,000μs (or 20ms) after our idle max load has been reached, we want to assume idle has been broken and we want to perform an actual task. (We want this value as low as possible without false positives, because it is one of a few factors that determine how snappy and lag free the CPU's response is.)
But at this point we're not ready to take on a full processing load. We may just be briefly scrolling a webpage and don't need the full power of the CPU now that we've allowed it to break out of idle. So we need it to reach a particular frequency and then hold it there again until we're sure the load is justified before we allow it to push the frequency even higher. To do that, rather than just setting
above_highspeed_delay - 20000
we will instead use the format "frequency:delay" to set
above_highspeed_delay - 20000 460000:60000 600000:20000
"Waaaait... What does that do?!"
This tells the Interactive governor to hold out 20ms after our target load when it's at our highspeed_freq (which we're actually using as our idle frequency--not a burst frequency as originally intended), but then it tells the governor to hold for 60ms after it's reached 460Mhz. Once it has exceeded 460Mhz, it then has free reign to scale up without limitation. (This will be optimized with the target_loads setting in a minute. And if you don't know what I'm talking about when I say "highspeed_freq" then you didn't go search for the basic Interactive governor settings and read about it! Go do that before you read any further, because I will not explain the basics of this governor!)
These settings are among the most important, because they limit the phone's clock rates when you are not interacting with it. If it needs to do something in the background, chances are it does not need to run full throttle! Background and idle tasks should be limited to the lowest reasonable clock rate. Generally speaking, if you're just looking at your phone (to read something, for example), you want the phone to use as little CPU power as possible. This includes checking in with Google to report your location or fetching some pull data or... whatever. Things that you don't need performance for.
So now that we know how to specify different settings for different frequency ranges, let's finish it all up with...
The Money Shot
If you've made it this far, you're ready to put these strategies into play! If you have not read the previous sections, DO NOT COMPLAIN IF THE DEFAULT SETTINGS DON'T PROVIDE WHAT YOU'RE LOOKING FOR!! These settings are templates only and these need to be adjusted for each case based on your system and usage patterns! IF YOU ARE NOT GETTING THE PERFORMANCE OR BATTERY LIFE PROMISED, ***READ THE SECTIONS ABOVE!!!***
With that out of the way... let's rock!
If you are using a Nexus 5X, use the following Interactive governor settings for CPU 1 ("little"–the one with 4 cores) and then tweak with the instructions below:
(If you are using a phone other than a Nexus 5X, you must read the above sections and replace the frequencies with your own efficient clock rates!)
above_highspeed_delay - 20000 460000:60000 600000:20000
boost - 0
boostpulse_duration - 80000
go_highspeed_load - 99
hispeed_freq - 600000
min_sample_time - 30000
target_loads - 98 460000:19 600000:80 672000:12 787000:81 864000:9 960000:69 1248000:95 1440000:95
timer_rate - 20000
timer_slack - 80000
These defaults work fine for me, but I have otherwise optimized my system fully, so they are at the minimal adequate values. If you have background tasks that consume any somewhat significant amount of CPU on a constant basis, you will most likely see awful, stuttery performance and poor battery life! So you must adjust them to suit your system before you see results!!! Anything more than about 15-20% idle CPU use at any given time will negatively affect the results you see without further tweaking!
Optimize Idle Frequency
Now that you've got the base configuration, we need to tweak it so that the CPU stays at your efficient idle frequency (384Mhz in this case) without spontaneously jumping when your phone is actually idle. To do this, open a CPU monitor that displays the current core frequencies (I like CoolTool, but you can use what you like as long as it doesn't significantly impact the CPU use--you're best off using a passive monitor and checking the results after 30-60 seconds of no activity), watch the frequencies and see how often they go above your efficient idle frequency when you're not doing anything at all, and adjust the following:
timer_rate - If your idle frequency is not being exceeded much, adjust this downward in increments of 5000 until it is, then increase it by 5000. If your idle frequency is being exceeded often, adjust this upward in increments of 5000 until your CPU primarily stays at or below your desired idle frequency.
above_highspeed_delay - Only if your timer_rate has matched or exceeded 50000 and still won't stay at or below your desired idle frequency most of the time, set timer_rate to 50000 and adjust the "20000" portion of the value upwards in increments of 5000 until the idle frequency has stabilized.
The lower these two values are, the more snappy/lag free your system will be. So try to get them as low as possible without the idle frequency being exceeded too much, as this inversely affects the snappiness and efficiency of your phone when you're not doing anything. Lower = snappier but uses more CPU when you're not doing anything (such as reading a webpage); higher = less snappy but stays in a power saving state more often reducing CPU use when you're not interacting with the device. These are the most critical in determining your idle power savings, so keep that in mind if you want the most battery life!
Enhance Task Responsiveness
Now use the efficiency and nominal clock rate correlations you made for your master clock rate list in the section above and adjust your frequencies to suit your usage patterns. For example, I had web page scrolling as my 600Mhz rate, so I will open a web page and scroll and see how everything feels. If it feels sluggish, I will increase all the references to "600000" in both above_highspeed_delay and target_loads upwards to the next available clock rate until that task is smooth. What you are looking for is constant poor/sluggish performance when the task you're testing for is using its highest CPU use. If the task becomes sluggish/stuttery as it winds down (such as a scrolling webpage slowing to a stop), we will address that next, so do not take that behavior into consideration as you adjust these values! If the task is smooth until (or after) it slows down, then you have reached your optimal clock rate and can move on.
Find Optimal Loads
Now here's where we get a little math-heavy to determine what the optimal target_load frequencies are for each clock rate. (Might want to bust out a spreadsheet to do the math for you if you're not using a Nexus 5X.)
We want to determine 2 values for every available clock rate: the maximal efficient load and the minimal efficient load. To make this determination, we need to bust out our calculators. (Or spreadsheets!)
For the maximal efficient load, we want to correlate a load value no higher than 90% of a given clock rate before it would be more efficient to jump to the next clock rate–to avoid overwhelming a particular rate while avoiding premature jumps to the next. For this value, we calculate it as:
(clock rate * 0.9) / next highest clock rate
For example, the maximal efficient load for 600Mhz on the Nexus 5X would be caluclated as:
(600000 * 0.9) / 672000 = 80.36% (rounded and normalized: 80)
For the minimal efficient load, we want to correlate a load value at which anything higher would be better served by a higher clock rate. To calculate this:
(1 - next highest clock rate / clock rate) * -1
For example, the minimal efficient load for 600Mhz on the Nexus 5X would be calculated as:
(1 - 672000 / 600000) * -1 = 12.00% (rounded and normalized: 12)
For the Nexus 5X, the maximal efficient loads of CPU 1 are:
384000:75
460000:69
600000:80
672000:76
787000:81
864000:81
960000:69
1248000:78
For the Nexus 5X, the minimal efficient loads of CPU 1 are:
384000:0
460000:19
600000:30
672000:12
787000:17
864000:9
960000:11
1248000:30
1440000:15
For the Nexus 5X, the maximal efficient loads of CPU 2 are:
384000:72
480000:68
633000:74
768000:80
864000:81
960000:69
1248000:83
1344000:84
1440000:84
1536000:84
1632000:86
1689000:83
For the Nexus 5X, the minimal efficient loads of CPU 2 are:
384000:0
480000:25
633000:32
768000:21
864000:13
960000:11
1248000:30
1344000:8
1440000:7
1536000:7
1632000:6
1689000:3
1824000:8
Using Optimal Loads
Now, you might be asking, "Why the heck did I do all this math?! WHAT IS IT GOOD FORRRR????!!!!"
Well, we had put some values into target_loads earlier, but those values weren't arbitrary. See, for all of our nominal clock rates, we want the CPU to hang out on them for as long as possible, provided they're doing the job. For each frequency tagged as our nominal clock rate, we want to use the maximal efficient load in target_loads. For every other frequency, we want to use our minimal efficient load value.
We don't care about those other frequencies. We don't want the CPU to hang out in those states for very long, because it just encourages the device to be reluctant to jump to a higher nominal frequency and causes stuttering. We eliminate the desire for the governor to select those frequencies unless it is absolutely efficient to do so. For all the nominal clock rates, we want the CPU to hang out there... but not for too long! So we set those values to the maximal efficient load, so they can escape to the next nominal frequency before they overwhelm the current frequency.
All said and done, this reduces jitter and lag in the device while providing optimal frequency selection for our day-to-day tasks.
Fix Stuttering
Now that you have adjusted your frequencies for optimal high CPU use in each given task, you may notice some stuttering as the task winds down. (Such as a scrolling webpage slowing to a stop.) If this bothers you, you can tweak this at the expense of some (minor) battery life by adjusting min_sample_time up in increments of 5000 until you are satisfied.
If you have exceeded a value of 100000 for the min_sample_time setting and still are not satisfied, change it back to 40000 and increase (and re-optimize) your idle frequency by one step. This will impact battery life more, but less than if you were to keep increasing the value of min_sample_time.
However, this step should not be necessary if you properly calibrated your maximal and minimal efficient loads!
But What About That 2nd CPU?!
So we've all but ignored the 2nd CPU. The reason? It's a horribly inefficient processor designed for high load tasks that generally don't come into play during normal usage patterns. It's good for gaming and image processing, but not for most moderate tasks a user might employ.
But it is good for one thing that all users do pretty frequently... loading and switching apps.
Fortunately, at least for the Nexus 5X, the system is pretty smart about when to employ the power of this inefficient 2nd CPU. So it's generally kept at bay most of the time. What we want is to configure it to be our burst processor–we want it to come into play spontaneously and quickly during tasks that necessitate immediate high loads, like loading and switching apps. To do this, we will ignore all but 3 frequencies:
384Mhz
1248Mhz
1824Mhz
In this case, we configure it just as we did with CPU 1, but only worry about keeping it idle as much as possible, allow it to jump to 1824Mhz immediately when needed, and encourage it to fall back to 1248Mhz if a sustained load is needed.
These values are ideal for the Nexus 5X, so if you have a different phone, choose the lowest clock rate, highest clock rate, and median efficient clock rate, using the instructions previously.
For the Nexus 5X, we'll jump straight to...
The Money Shot: Part Deux
If you are using a Nexus 5X, use the following Interactive governor settings for CPU 2. ("big"–the one with 2 cores)
(If you are using a phone other than a Nexus 5X, you must read the above sections and replace the frequencies with your own efficient clock rates!)
above_highspeed_delay - 20000
boost - 0
boostpulse_duration - 80000
go_highspeed_load - 99
hispeed_freq - 1824000
min_sample_time - 20000
target_loads - 98 480000:25 633000:32 768000:21 864000:13 960000:11 1248000:95 1344000:8 1440000:7 1536000:7 1632000:6 1689000:3 1824000:95
timer_rate - 20000
timer_slack - 80000
What About Bob Touchboost?
Touchboost is a nifty feature in a lot of kernels (including stock on Nexus 5X) that jumps up the frequency so that you experience minimal lag. However, with all the above settings, touchboost is usally detrimental to the efficiency of the device!
We generally want to keep the CPU on the lowest possible frequency as much as possible, and touchboost interferes with that. Further, because we've set up the maximal and minimal efficient clock rates, as well as burst processing from the 2nd CPU core, we don't need touchboost!
If your kernel allows you to shut it off, try to do so and see if the responsiveness of your device is acceptable. On the Nexus 5X, touchboost adds no perceptual performance gain and only hurts efficiency and battery life. If your kernel doesn't allow you to turn off touchboost, try another one, like the excellent ElementalX.
Your battery life will thank you!
The Conclusion
I have achieved unprecedented performance, smoothness, snappiness, and battery life with the default settings I outlined above. However, your mileage may vary, as every phone, ROM, kernel, installed applications, etc are different. This is a very sensitive governor profile and must be tweaked to just meet the requirements of your system and your usage patterns!
If it is not optimally tuned, performance and battery life will suffer! If you're not seeing buttery smooth, snappy performance, you have not correctly tuned it for your system!! However, if you do have superb performance (and you tweaked the values conservatively and not in large steps), then you will also get the aforementioned battery life.
I will be happy to answer any questions, or provide any guidance I can. However:
You must otherwise optimize your phone first! This will not "fix" a poorly optimized system and will, in fact, reduce performance and battery life without further optimization and proper tweaking.
I will not answer questions about "what is a governor?" There are plenty of resources available already, so search for them.
I will not answer questions about "how can I tweak [some other] governor?" This is about the Interactive governor only.
I will not respond to "nuh uh! show proof!" posts. The fact that I spent 12 hours writing this up should be proof enough that I am satisfied with the results. You can take it or leave it; makes no difference to me. The default settings should work with any fully optimized Nexus 5X running ElementalX Kernel, so just try them on your own. If you're not absolutely satisfied (and trust me, either it'll work out-of-the-box with flying colors and you'll know it works for your system, or it'll be an awful experience which means you must tweak it), then you haven't adequately adjusted the settings to suit your system.
Lemme know what you think, and good luck!
"I'm Too Lazy To Read All That! WHAT DO I NEED TO DO?!?!"
If you own a Nexus 5X or 6P, install the ElementalX Kernel and the EX Kernel Manager. (Yes, it works in other kernels, but you're on your own regarding how to set the values. Other kernel editors, such as Kernel Adiutor, are currently buggy and problematic, so your mileage may vary. And if you have another device, you must follow the instructions in this post to derive your own values.)
UPDATE: EX Kernel Manager now supports governor profiles and most currently published profiles are distributed with the manager. To access: EXKM> CPU> Governor options> Load, then select the profile you wish to try! Many thanks to @flar2 for providing native support!
In the "CPU" section, turn off "Touchboost". (This is crucial!! YOU MUST TURN OFF TOUCHBOOST OR ELSE YOU WILL NOT SEE ANY BATTERY SAVINGS!!!) Make sure the "Max CPU Frequency" is set to the maximum possible value for each CPU. Make sure the "Min CPU Frequency" is set to the minimum possible value for each CPU. Then set the following values for each CPU under "Governor options" for each CPU respectively:
CURRENT STABLE – Version 2.0
Nexus 5X - The "Easy Way" Setup - For ElementalX Kernel
CPU #1 (aka "little", aka "has 4 cores", aka "maxes out at 1440Mhz")
target_loads - 75 460000:69 600000:80 672000:76 787000:81 864000:81 960000:69 1248000:78
timer_slack - -1
hispeed_freq - 460Mhz
timer_rate - 20000
above_hispeed_delay - 30000 600000:20000 672000:10000
go_hispeed_load - 75
min_sample_time - 60000
CPU #2 (aka "big", aka "has 2 cores", aka "maxes out at 1824Mhz")
target_loads - 72 480000:68 633000:74 768000:80 864000:81 960000:69 1248000:83 1344000:84 1440000:84 1536000:84 1632000:86 1689000:83
timer_slack - 80000
hispeed_freq - 633Mhz
timer_rate - 10000
above_hispeed_delay - 10000
go_hispeed_load - 72
min_sample_time - 100000
Under "CPU Boost", set "input boost milliseconds" to "0".
Nexus 6P - The "Easy Way" Setup - For ElementalX Kernel
CPU #1 (aka "little", aka "low", aka "maxes out at 1555Mhz")
target_loads - 75 460000:69 600000:80 672000:79 768000:80 864000:81 960000:69 1248000:84 1344000:82 1478000:86
timer_slack - -1
hispeed_freq - 460Mhz
timer_rate - 20000
above_hispeed_delay - 30000 600000:20000 672000:10000
go_hispeed_load - 75
min_sample_time - 60000
CPU #2 (aka "big", aka "fast", aka "maxes out at 1948Mhz")
target_loads - 72 480000:68 633000:74 768000:80 864000:81 960000:69 1248000:84 1344000:84 1440000:84 1536000:85 1632000:85 1728000:85 1824000:84
timer_slack - 80000
hispeed_freq - 768mhz
timer_rate - 10000
above_hispeed_delay - 10000
go_hispeed_load - 72
min_sample_time - 100000
Under "CPU Boost", set "input boost milliseconds" to "0".
(Having trouble applying these? Check out these great scripts from @Alcolawl PLEASE NOTE THAT THESE ARE OFFICIALLY UNSUPPORTED–direct your queries to Alcolawl so he might provide assistance.)
ALPHAS – USE AT YOUR OWN RISK!! (Actually, we really like "GostPepper". Try it out. It's spicy! And don't worry–it won't break anything!)
NEW! GlassFish (For most devices!) - High battery savings with buttery smooth interface!
NEW! HawkTail (6P) - An advanced, modern profile that is both battery efficient and highly performant! All users are urged to check out HawkTail!
Butterfly - A culmination of all strategies, provides smoothest performance of all currently published settings, though battery savings are a little more modest. Excellent for light and moderate users; heavy/marathon users might want to check out a different setting profile.
GhostPepper (6P) - Uses a quantized, frequency-aligned parametric curve to influence low core clock rates while providing extremely smooth transitions from each clock rate and exceptional battery life. The current favorite, albeit not very well tested so far. HIGHLY RECOMMENDED
SilverFish - Effectively eliminates "hispeed_freq" so perceptive scrolling performance is increased, giving the illusion of excellent performance while providing great battery life. Some users experience problems with performance while multitasking--NOT RECOMMENDED FOR EVERYONE. Light users should enjoy this very much, however.
MadDog - The first major departure from the core strategy. Very well tested, extremely stable, and HIGHLY RECOMMENDED if you aren't fully satisfied with v2.0 settings. This is on the table to be the next stable v3.0, so rest assured you can't go wrong with this one!
ARCHIVE
v1.0
Nexus 5X - The "Easy Way" Setup - For ElementalX Kernel
CPU #1 (aka "little", aka "has 4 cores", aka "maxes out at 1440Mhz")
target_loads - 98 600000:80 787000:81 960000:69 1248000:85 1440000:90
timer_slack - 80000
hispeed_freq - 600Mhz
timer_rate - 20000
above_hispeed_delay - 10000
go_hispeed_load - 64
min_sample_time - 80000
CPU #2 (aka "big", aka "has 2 cores", aka "maxes out at 1824Mhz")
target_loads - 90 633000:74 768000:80 960000:69 1248000:83 1536000:84 1689000:90
timer_slack - 80000
hispeed_freq - 1248Mhz
timer_rate - 10000
above_hispeed_delay - 10000
go_hispeed_load - 90
min_sample_time - 80000
Under "CPU Boost", set "input boost milliseconds" to "0".
Nexus 6P - The "Easy Way" Setup - For ElementalX Kernel
CPU #1 (aka "little", aka "low", aka "maxes out at 1555Mhz")
target_loads - 98 600000:80 768000:80 960000:69 1248000:84 1478000:85 1555000:90
timer_slack - 80000
hispeed_freq - 600Mhz
timer_rate - 20000
above_hispeed_delay - 10000
go_hispeed_load - 64
min_sample_time - 80000
CPU #2 (aka "big", aka "fast", aka "maxes out at 1948Mhz")
target_loads - 90 633000:74 768000:80 960000:69 1248000:83 1536000:84 1632000:85 1824000:90
timer_slack - 80000
hispeed_freq - 633mhz
timer_rate - 10000
above_hispeed_delay - 10000
go_hispeed_load - 90
min_sample_time - 80000
Under "CPU Boost", set "input boost milliseconds" to "0".
Changelog:
8/23/16 - Added GlassFish profile
8/16/16 - Added HawkTail profile
1/24/16 - Added instructions to use EXKM's native profiles
1/4/16 - Archived v1.0; elevated "crazy alpha 2" to v2.0 and posted; added links to other alpha settings
12/27/15 - Updated for better performance on 5X and 6P
12/25/15 - Updated to improve battery use on 6P and somewhat on 5X
12/23/15 - Made the beta #2 settings the default; added settings for 6P
FAQ
In this guide, I am using the ElementalX Kernel on the Nexus 5X. If you are using a different kernel or device, your available features may vary, so you must determine the appropriate values to use based on the instructions in this guide! If you are too lazy to do this, I will try to keep a running list of compatible settings you can just plug-and-go. But the purpose of this guide is to assist you in discovering the best values to use with your device, so if something doesn't work, it's because you're probably not following the guide and coming up with your own values! specific to your kernel and device combo! You've been warned!
My settings don't show up after I reboot! What am I doing wrong??
If you are using EX Kernel Manager, tap the power icon to the right of the setting after you set it. If you are using a different kernel manager, check with that developer to see how it's implemented. Also, give the kernel manager a few minutes after the device boots. The settings aren't applied immediately, so check back after 3 minutes and you should see the correct values.
Why is one of my CPUs not letting me change a setting or set a certain frequency?
The device may be thermally throttling and had turned off that CPU or limited it. Turn off your device and let it cool for 5 minutes, then try again. (Keep it unplugged and make sure you don't have any apps running that might be trying to use a lot of CPU while the device is off.)
These settings don't work/I'm not getting great screen on time!
You probably haven't disabled touch boost. YOU MUST DISABLE TOUCHBOOST, OR THIS WON'T SAVE YOU JACK SQUAT!!
How do I change governor/kernel settings?
If you're not comfortable or don't know how to do this, search the XDA forums. There are plenty of guides that explain this in great detail.
My kernel editor won't let me set [whatever]Mhz for a value you showed!
Either you have done something wrong, or you're using a kernel/device combo that isn't ElementalX on Nexus 5X, for which this guide was written. Follow the instructions in the first post to determine the appropriate settings for your own device!
Do I have to be rooted?
Yes. See the fourth question and learn more about your device before trying to change things like governor settings!
been waiting for this since I saw a few posts saying it would be released on r/nexus5x
Thanks!
What program to use to set all these tweaks?
Smultie said:
What program to use to set all these tweaks?
Click to expand...
Click to collapse
I recommend using the ElementalX kernel with the ElementalX Kernel Manager, because it supports all of the features necessary to get the most out of this guide. (Especially turning off touch boost.)
That said, you can try any kernel manager to make these changes. Just search Google Play!
How important is io_is_busy? Can't find that string in the elemental X app.
What are your thoughts, if any, on zram and swappiness values?
soniCron said:
I recommend using the ElementalX kernel with the ElementalX Kernel Manager, because it supports all of the features necessary to get the most out of this guide. (Especially turning off touch boost.)
That said, you can try any kernel manager to make these changes. Just search Google Play!
Click to expand...
Click to collapse
I tried it with Kernel Adiutor, but I noticed that I can't set "hispeed_freq - 600000" on CPU1. Closest options are 480000 and 633600. Which one to choose?
Smultie said:
I tried it with Kernel Adiutor, but I noticed that I can't set "hispeed_freq - 600000" on CPU1. Closest options are 480000 and 633600. Which one to choose?
Click to expand...
Click to collapse
What kernel are you using?
soniCron said:
What kernel are you using?
Click to expand...
Click to collapse
Stock
dg4prez said:
How important is io_is_busy? Can't find that string in the elemental X app.
What are your thoughts, if any, on zram and swappiness values?
Click to expand...
Click to collapse
Sorry, that was inadvertently copied from the old guide. I'll remove it from the post. You can ignore that setting.
Far as zram, I'm not sure, yet. I haven't spent time exploring it on this device. That said, I'm not sure disabling it will improve performance in any noticeable way on this device. With these governor settings, things are screamingly fast, and my concern would be with more apps unloading because of the smaller RAM.
I'll make additional posts as I discover the most reasonable tweaks for this device, but not before I test each methodically and thoroughly...
soniCron said:
Sorry, that was inadvertently copied from the old guide. I'll remove it from the post. You can ignore that setting.
Click to expand...
Click to collapse
I already set it at 0. Should I put it back at 1?
Smultie said:
Stock
Click to expand...
Click to collapse
Would you mind posting all the frequencies available for both CPUs? I'll update the guide to reflect the proper values.
I'm using ElementalX because of its ability to turn off touch boost, so I haven't worked much with the stock kernel.
Thanks!
Smultie said:
I already set it at 0. Should I put it back at 1?
Click to expand...
Click to collapse
Leave it at 0 until I can investigate the stock kernel options.
soniCron said:
Would you mind posting all the frequencies available for both CPUs? I'll update the guide to reflect the proper values.
I'm using ElementalX because of its ability to turn off touch boost, so I haven't worked much with the stock kernel.
Thanks!
Click to expand...
Click to collapse
Big:
Deep Sleep, 384, 480, 633, 768, 864, 960, 1248, 1344, 1440, 1536, 1632, 1689, 1824
Little:
Deep Sleep, 384, 460, 600, 672, 787, 864, 960, 1248, 1440
Also: Stock kernel in combination with Kernel Adiutor allowed me to disable 'Input Boost Frequency Core 1' which I assumed is the same as touch boost. It's described as 'CPU frequency to be boosted to this frequency upon input detection'.
Thanks for your quick replies.
Smultie said:
Big:
Deep Sleep, 384, 480, 633, 768, 864, 960, 1248, 1344, 1440, 1536, 1632, 1689, 1824
Little:
Deep Sleep, 384, 460, 600, 672, 787, 864, 960, 1248, 1440
Also: Stock kernel in combination with Kernel Adiutor allowed me to disable 'Input Boost Frequency Core 1' which I assumed is the same as touch boost. It's described as 'CPU frequency to be boosted to this frequency upon input detection'.
Thanks for your quick replies.
Click to expand...
Click to collapse
Ohhhhh! Okay, I see what's going on! The little CPU is #1 and the big CPU is #2. Reverse your assignments and it should all be fine.
I'll update the post to clarify. (I thought it was a little strange that there would be different clock rates for different kernels. Didn't even think that was possible since it's a hardware feature, not a kernel feature. You had me thinking I missed some major technological advancement! )
soniCron said:
Ohhhhh! Okay, I see what's going on! The little CPU is #1 and the big CPU is #2. Reverse your assignments and it should all be fine.
I'll update the post to clarify. (I thought it was a little strange that there would be different clock rates for different kernels. Didn't even think that was possible since it's a hardware feature, not a kernel feature. You had me thinking I missed some major technological advancement! )
Click to expand...
Click to collapse
Might be a bug in Kernel Adiutor cause I can select the same hispeed_freq for both CPU's (big/little or 1/2).
Also, you state that you want the big CPU to only run at 384, 1248 and 1824 MHz, but I notice it never reaching lower than 633MHz. Are you sure your settings are correct?
Smultie said:
Might be a bug in Kernel Adiutor cause I can select the same hispeed_freq for both CPU's (big/little or 1/2).
Click to expand...
Click to collapse
I made a simplified guide for you (and others):
http://forum.xda-developers.com/showpost.php?p=64279960&postcount=2
I haven't used a kernel manager besides EX Kernel Manager that supports 2 CPUs reliably, so if you're having problems, I suggest you try EX.
If you find one that will modify the stock kernel reliably, please let me know and I'll update the simplified version of the guide to reflect that.
Thanks for your feedback! (And warnings! And concerns!)
Smultie said:
Also, you state that you want the big CPU to only run at 384, 1248 and 1824 MHz, but I notice it never reaching lower than 633MHz. Are you sure your settings are correct?
Click to expand...
Click to collapse
Can you set the minimum clock rate for the big CPU? If that's not possible to set at 384 in stock, I'll update the guide. If it is, then that needs to be done as well.
soniCron said:
Can you set the minimum clock rate for the big CPU? If that's not possible to set at 384 in stock, I'll update the guide. If it is, then that needs to be done as well.
Click to expand...
Click to collapse
In your main guide you state for CPU1:
above_highspeed_delay - 20000 460000:60000 600000:20000
In the "learn to read" guid you state:
above_highspeed_delay - 20000
Which is the correct one?
Also, can't find "Touchboost" under "CPU". Can you be a bit more specific maybe?
Hey guys, Kyuubi10 back once again with another Guide.
I thought it might be useful to pop in a couple results of my trial and error for the HTC One M8.
Note: This is not scientifically, calculated accurate, but it's close enough, based on estimates.
After following these guides:
http://forum.xda-developers.com/showthread.php?t=2769899
https://vjnaik.wordpress.com/2015/06/25/kernel-tweak-interactive-governor-paramaters-rooted-phone/
I decided to make a summary guide of the above but with specific HTC One M8 values.
Since I agree with the idea of "race to idle" embodied in the Wheatley governor, I tried emulating that on the Interactive governor while also keeping it as efficient as possible.
Here are the values (all others not mentioned, leave default):
Code:
[B]above_hispeed_delay [/B]- 80000 2265600:10000
[B]go_hispeed_load[/B] - 95
[B]hispeed_freq[/B] - 1728000
[B]io_is_busy[/B] - 1
[B]min_sample_time[/B] - 10000
[B]target_loads[/B] - 45 729000:80 883200:50 1267000:85 1497600:50 1728000:90 1958400:50
[B]timer_rate[/B] - 10000
[B]timer_slack[/B] - 5000
"above_hispeed_delay" makes sure that longer time is spent on the frequency step 1.72Ghz, before quickly raising higher into max freq.
1.72Ghz is the most energy efficient frequency with a good performance, e.g. it will not cause lag during casual usage, while it uses minimal voltage.
If the load is too high for this frequency to handle, I set the time short once it's gone over this freq step so that it will not waste time before reaching max freq. Thus dealing with the issue asap.
Another important parameter is "target_load", with this I have defined that at each efficient freq step the load needed to overcome it would be higher than normal. But it would up-scale quickly when using non-efficient frequencies.
The other parameters I have set so that the frequency is lowered as soon as CPU load is finished, so that it will rush back to idle as quickly as possible.
The interesting thing about this set-up is that for general, non heavy usage, it basecally functions as if I have underclocked to 1.72Ghz, but when the CPU is truly pushed it reaches up to 2.5Ghz which is my Overclocked max freq value.
Thus both saving battery and providing high performance.
I have felt no lag, and it's been quite a smooth experience while I used this
Combined with using GPU rendering (found in developer settings), and Seeder, the over all usage is pretty good.
Battery usage has been very efficient and I have managed to squeeze out an extra hour or two using this.
I highly recommend it!
Hope I helped you guys... don't forget to press the thanks button if you also feel that I did!:good::good:
I noticed I have some governor settings left at 0 or blank. I did some quick googling, found some other tweaks for the M8 and the interactive governor. So I played around a bit, and I think the following would be useful to add to the above tweaks.
-----------------------
sampling_down_factor: 60000
sync_freq: 1036800
up_threshold_any_cpu_load: 65
up_threshold_any_cpu_freq: 1190400
boost: 0
boostpulse_duration: 80000
--------------------
Also of note there is not a entry for " io_is_busy " under the Interactive governor under ElementalX Sense kernel v6.03. I believe it's possible to modify the governor to add the function, if it's desired.
Hope this helps others.
nice one i read the links that you posted and follow the guides there also to tweak the interactive governor on the first link that you posted is really interesting he has updated that post also, i followed his guide inspired by your guide and i have been getting good results on my phone with battery and performance i mean almost no battery drain at all while my phone is idle. thanks for the help mate!
Plugged the settings into Yankactive on DU. Quick, freqs stay low when nothings going on, seems legit. I set my timer_rate higher tho, 10000 feels a little low, makes me think that the CPU will spend too much time polling loads.
SaskFellow said:
I noticed I have some governor settings left at 0 or blank. I did some quick googling, found some other tweaks for the M8 and the interactive governor. So I played around a bit, and I think the following would be useful to add to the above tweaks.
-----------------------
sampling_down_factor: 60000
sync_freq: 1036800
up_threshold_any_cpu_load: 65
up_threshold_any_cpu_freq: 1190400
boost: 0
boostpulse_duration: 80000
--------------------
Also of note there is not a entry for " io_is_busy " under the Interactive governor under ElementalX Sense kernel v6.03. I believe it's possible to modify the governor to add the function, if it's desired.
Hope this helps others.
Click to expand...
Click to collapse
Some of those actually make no difference. Since they are overruled by other perameters. E.g. up_threshold aren't used in interactive, since they follow target_load instead.
Sampling_down_factor on the other hand is overrulled by the timer features of interactive.
When you use ondemand, or conservative, sampling_down_factor is a fun parameter to play with, but not interactive.
While Sync_Freq I don't like using because it raises minimum frequency to its value...although temporarily, the timer features can already deal with CPU loads efficiently.
lil_kujo said:
nice one i read the links that you posted and follow the guides there also to tweak the interactive governor on the first link that you posted is really interesting he has updated that post also, i followed his guide inspired by your guide and i have been getting good results on my phone with battery and performance i mean almost no battery drain at all while my phone is idle. thanks for the help mate!
Click to expand...
Click to collapse
Great The links are important!! They are my sources, and often contain much more detail than what I use in my guides. I attempt creating a well ordered summary, but my sources are better if you don't mind reading loads.
I'm glad I could help
munkyvirus said:
Plugged the settings into Yankactive on DU. Quick, freqs stay low when nothings going on, seems legit. I set my timer_rate higher tho, 10000 feels a little low, makes me think that the CPU will spend too much time polling loads.
Click to expand...
Click to collapse
That's the idea. And never heard of Yankactive...but I'm gonna assume it's good lol.
And about time_rate, you are right, but you are also wrong.
There isn't a true right answer unless someone performs a scientific experiment in order to fully test which one is better.
But I'll explain why I put my one short... I want the frequencies returning to IDLE asap. While yes, you are right it's polling often, it also returns to idle much faster, rather than staying at higher frequency uselessly wasting battery.
I'll try to run some tests checking CPU load, if CPU load considerable lowers I'll come back and report.
Yankactive is Interactive with some under the hood tweaks, I believe, same tunables. I also looked at some documentation on Interactive and I think the target_loads have to be in ascending order based on load when paired with clock speeds, I'm gonna mess with them a bit and see what I get. Link
munkyvirus said:
Yankactive is Interactive with some under the hood tweaks, I believe, same tunables. I also looked at some documentation on Interactive and I think the target_loads have to be in ascending order based on load when paired with clock speeds, I'm gonna mess with them a bit and see what I get. Link
Click to expand...
Click to collapse
And no, target_loads has to be in ascending order based on FREQUENCY. You are applying load percentages to frequency ranges, therefore it is imperative that its the frequency defining the order.
e.g. 50 4:80 10:20 12: 50 means:
50% load before going to the next frequency step, until you reach frequency 4, then use 80% instead until frequency 10, then use 20% instead until 12, then use 50% until max frequency.
Feel free to play with them as much as you want, just make sure to keep the idea of using efficient frequency steps in mind.
Kyuubi10 said:
And no, target_loads has to be in ascending order based on FREQUENCY. You are applying load percentages to frequency ranges, therefore it is imperative that its the frequency defining the order.
e.g. 50 4:80 10:20 12: 50 means:
50% load before going to the next frequency step, until you reach frequency 4, then use 80% instead until frequency 10, then use 20% instead until 12, then use 50% until max frequency.
Feel free to play with them as much as you want, just make sure to keep the idea of using efficient frequency steps in mind.
Click to expand...
Click to collapse
Thank you for the knowledge dump, been scraping the barrel for weeks trying to figure out tunables!
munkyvirus said:
Thank you for the knowledge dump, been scraping the barrel for weeks trying to figure out tunables!
Click to expand...
Click to collapse
Hehe it's a pleasure.
It's a way I find to give back to the community, since I learn so much through it. I can try help make life easier for those who follow the same path I did.
Hello kyuubi10 thanks for your help, would it be ok to change mp decision to battery saver mode ? Whats your take on that?
Wow, this is awesome! I had the performance gov on, which just destroyed my battery. Now, I have a question for you!
What is your take on "Multicore Power Savings" ? I'm using a flarport kernel which has it set to aggressive by default. Should this be changed to anything else while using your gov settings? Thanks for any assistance!
lil_kujo said:
Hello kyuubi10 thanks for your help, would it be ok to change mp decision to battery saver mode ? Whats your take on that?
Click to expand...
Click to collapse
I have never heard of mpdecision having a battery saver mode XD
Would you please expand on that? Also tell me which tweaking app you are using?
Kyuubi10 said:
I have never heard of mpdecision having a battery saver mode XD
Would you please expand on that? Also tell me which tweaking app you are using?
Click to expand...
Click to collapse
It's in the ex app mate, it uses a less aggressive version of mpdecision to saver on battery power but I can't say that I noticed much improvement TBH.
Sent from my HTC One_M8 using Tapatalk
Anonaru said:
Wow, this is awesome! I had the performance gov on, which just destroyed my battery. Now, I have a question for you!
What is your take on "Multicore Power Savings" ? I'm using a flarport kernel which has it set to aggressive by default. Should this be changed to anything else while using your gov settings? Thanks for any assistance!
Click to expand...
Click to collapse
You had performance on?? You do realise that the perf gov basically keeps your CPU cores running on max frequency all the time right?
No wonder your battery was dying XD
Anyhoo....good thing you found my guide
Now, about multicore power savings, as usually with most things you will be compromising something to gain something else...always keep that in mind.
With MPS you'll be giving up some multitasking, in order to gain some battery savings.
Why (you may ask)?
Well, think about a to-do list, and for each list you have one person completing the tasks within that list. Let's say you have four lists and 4 people completing those tasks.
What MPS does is it takes as many tasks as possible and places them within a single list, for one person to do. At the end of the day that one person will have done a lot of work, while the other 3 will have done very little work. The drawback? The work was completed much slower, because only one person was doing it.
Why can MPS be good? It is the way it chooses which CPU to use to add the tasks to, it chooses CPUs which are already turned on, rather than turning a new one on.
The frequency voltages on each core range from the lowest of 775mV, to the highest of 1075mV. That's a 300mV increase in battery consumption between lowest frequency and highest. (Mind you, 1075 for me is an overclocked value, if you are not OC then it will be even less)
When CPU cores have nothing to do they get turned off....they don't idle at 775mV....they are literally off. Therefore around 0mV usage XD
If you get tasks which would have run on 2 CPUs at minimum frequency, using only 775mV each, and put them to run on only 1 CPU at MAX frequency at 1075mV, you still have about 400mV battery savings. Now lets say its something which would have used 4 CPUs, but you end up using only two.... then the battery savings double to 800mV.
Final answer...it depends on your tastes, what do you prefer most? Multitasking or battery saving.
Personally I keep it enabled, but not aggressive.
But if you really don't care about multitasking, you may as well leave it as aggressive.
lil_kujo said:
Hello kyuubi10 thanks for your help, would it be ok to change mp decision to battery saver mode ? Whats your take on that?
Click to expand...
Click to collapse
smeejaytee said:
It's in the ex app mate, it uses a less aggressive version of mpdecision to saver on battery power but I can't say that I noticed much improvement TBH.
Sent from my HTC One_M8 using Tapatalk
Click to expand...
Click to collapse
Well, I use adiutor, so I don't have that option.
I am happy with my phone how it is (if it wasn't for the damned plug issues XD)
But @lil_kujo, as @smeejaytee said....he hasn't noticed much improvement.
So I'd trust his advice
Kyuubi10 said:
You had performance on?? You do realise that the perf gov basically keeps your CPU cores running on max frequency all the time right?
No wonder your battery was dying XD
Anyhoo....good thing you found my guide
Now, about multicore power savings, as usually with most things you will be compromising something to gain something else...always keep that in mind.
With MPS you'll be giving up some multitasking, in order to gain some battery savings.
Why (you may ask)?
Well, think about a to-do list, and for each list you have one person completing the tasks within that list. Let's say you have four lists and 4 people completing those tasks.
What MPS does is it takes as many tasks as possible and places them within a single list, for one person to do. At the end of the day that one person will have done a lot of work, while the other 3 will have done very little work. The drawback? The work was completed much slower, because only one person was doing it.
Why can MPS be good? It is the way it chooses which CPU to use to add the tasks to, it chooses CPUs which are already turned on, rather than turning a new one on.
The frequency voltages on each core range from the lowest of 775mV, to the highest of 1075mV. That's a 300mV increase in battery consumption between lowest frequency and highest. (Mind you, 1075 for me is an overclocked value, if you are not OC then it will be even less)
When CPU cores have nothing to do they get turned off....they don't idle at 775mV....they are literally off. Therefore around 0mV usage XD
If you get tasks which would have run on 2 CPUs at minimum frequency, using only 775mV each, and put them to run on only 1 CPU at MAX frequency at 1075mV, you still have about 400mV battery savings. Now lets say its something which would have used 4 CPUs, but you end up using only two.... then the battery savings double to 800mV.
Final answer...it depends on your tastes, what do you prefer most? Multitasking or battery saving.
Personally I keep it enabled, but not aggressive.
But if you really don't care about multitasking, you may as well leave it as aggressive.
Click to expand...
Click to collapse
Hah, thanks for the guide-- I am pretty well versed in task / resource allocation on multi-threaded systems, though
Main reason I was asking was because I haven't a clue what some of the values are on this interactive gov. Just wanted to make sure they didn't clash! I'll chance it to "Enabled" rather than "Aggressive," because a compromise between the two sounds the best
As for Performance gov-- default setting on this flarport kernel, didn't bother to check it until I noticed that any time a core was on, it was racing at 2.5ghz, even with nothing going on. Battery pretty much committed suicide
Anonaru said:
Hah, thanks for the guide-- I am pretty well versed in task / resource allocation on multi-threaded systems, though
Main reason I was asking was because I haven't a clue what some of the values are on this interactive gov. Just wanted to make sure they didn't clash! I'll chance it to "Enabled" rather than "Aggressive," because a compromise between the two sounds the best
As for Performance gov-- default setting on this flarport kernel, didn't bother to check it until I noticed that any time a core was on, it was racing at 2.5ghz, even with nothing going on. Battery pretty much committed suicide
Click to expand...
Click to collapse
LOL I suggest you change kernel asap! If the dev uses uses Performcance gov as his default he doesn't know what he is doing XD
And no, as far as I know governor tunables won't ever clash with MPS.
Thanks!
rjavc said:
Thanks!
Click to expand...
Click to collapse
You're welcome! Pleasure to help.
But I'd appreciate if you press the thanks button on the relevant posts which helped you. That's the XDA way :good::good:
Kyuubi10 said:
You're welcome! Pleasure to help.
But I'd appreciate if you press the thanks button on the relevant posts which helped you. That's the XDA way :good::good:
Click to expand...
Click to collapse
Hi mate, I wondered if I could ask your advice, I want to set interactive up on my maw Android TV box it's quad 1.5gb and I want maximum performance as its constantly plugged in, there is no battery so that's not an issue,
Sorry if you think this OT but I thought I'd ask you as you know the governor well, thank you in advance mate.
Sent from my HTC One_M8 using Tapatalk
First of all read orginal thread for Nexus 5
http://forum.xda-developers.com/nexus-5x/general/guide-advanced-interactive-governor-t3269557i
Please read this post in full
also read this document:
https://android.googlesource.com/ke...7aebe08b/Documentation/cpu-freq/governors.txt
For now the tweak is only for ARDE overclocked kernel,Underclocked kernel from @Unjustified Dev
If you are too lazy to read the post and configure what suites best for your device I made a template kernel with already integrated tweaks working on all Cm based roms and ill upoload it asap
or simply use Kernel Aduitor to input theese settings
updated Mar.29.2016
Setting for little CPU :
above_highspeed_delay - 25000 800000:50000 998400:30000
boost - 0
boostpulse_duration - 80000
go_highspeed_load - 89
hispeed_freq - 800000
min_sample_time - 30000
target_loads - 80 523400:60 800000:77 998400:81 1113600:77 1309000:81 1448000:81 1601000:10
timer_rate - 20000
timer_slack - 60000
Setting for BIG CPU:
above_highspeed_delay - 20000
boost - 0
boostpulse_duration - 80000
go_highspeed_load - 99
hispeed_freq - 1651200
min_sample_time - 20000
target_loads - 98 533333:60 800000:24 960000:16 1113600:20 1334000:81 1497600:7 1612800:6 1651200:96
timer_rate - 20000
timer_slack - 80000
NOTE:If the big cpu minimum frequencie keeps reverting to 960mhz change governeur to smartmax, liitle cpu max frequencie to 1334000
settings for underclocked kernel (200mhz-1.4ghz) in post 54
The Introduction
I'm about to tell you how to get buttery smooth, lag free performance with insanely good battery life, using an old school governor featured in practically every kernel... This tweak is applicable to every phone with any ROM or kernel--stock or custom--that provides the Interactive Governor.
Yeah, yeah... everyone promises good battery with great performance, but who actually delivers? Maybe it isn't as smooth as you want, or maybe it requires something your kernel or ROM don't support. Or maybe the battery life promises just aren't what you expected. There's always some awful compromise. Not here!
This isn't a guide to get 36 hour battery life... provided you never use your phone. That's deep sleep optimization, which is lovely and all, but what good is the phone if you can never use it?! And with the new Marshmallow Doze feature, this strategy is becoming a think of the past. What I'm talking about is 7-14 hour screen on, actual hands-on usage times! Without compromising anything, you can get 7-8 hour screen on usage with regular, no-compromise usage habits: daytime visible screen brightness, both radios on, sync on, network location on, all the regular usage features, the whole kit and kaboodle... all smooth as a baby's butt and snappy as a Slim Jim! (Up to 14+ hours if you can stand minimum brightness and WiFi-only with a custom ROM and other stuff turned off! And this is with stock voltages and full frequency range--you'll likely get even more if you choose to optimize those as well!)
However, it should be noted that this does not apply to gaming, heavy camera use, etc. Anything that is an automatic battery killer in and of itself. There's nothing that can be done about anything that forces the phone to utilize its maximum resources all the time. But you should know that by now. Further, this guide is about optimizing the CPU as much as possible. It does not cover things like eliminating wakelocks so your phone sleeps well, removing unnecessary and battery draining stock apps, keeping your screen brightness down*, and all that stuff that's been covered in other posts ad infinitum. Those optimizations are up to you.
*You shouldn't be turning your screen brightness above about 60%. It should be more than viewable in sunlight at that brightness, and keep in mind that the brightness power requirements increase exponentially, so a 100% bright LCD screen will use about 3.5-4.5x more power than a 60% bright screen. I don't see that fact brought up often, so I thought I'd mention it here.
So, after reading a (nearly identical) guide for the EvoLTE folks over a year ago, I'm now back to update this information to provide strategies for multi-CPU devices, as well as specific settings for the Idol 3
In this guide, I am using the ARDE overclocked and underclocked kernel by @Unjustified Dev Kernel on moded stock rom by @DallasCZ AICP rom and latest CM 12.1 by @The Marionette. If you are using a different kernel or device, your available features may vary, so you must determine the appropriate values to use based on the instructions in this guide! If you are too lazy to do this, I will try to keep a running list of compatible settings you can just plug-and-go. But the purpose of this guide is to assist you in discovering the best values to use with your device, so if something doesn't work, it's because you're probably not following the guide and coming up with your own values! specific to your kernel and device combo! You've been warned!
My settings don't show up after I reboot! What am I doing wrong??
If you are using EX Kernel Manager, tap the power icon to the right of the setting after you set it. If you are using a different kernel manager, check with that developer to see how it's implemented. Also, give the kernel manager a few minutes after the device boots. The settings aren't applied immediately, so check back after 3 minutes and you should see the correct values.
Why is one of my CPUs not letting me change a setting or set a certain frequency?
The device may be thermally throttling and had turned off that CPU or limited it. Turn off your device and let it cool for 5 minutes, then try again. (Keep it unplugged and make sure you don't have any apps running that might be trying to use a lot of CPU while the device is off.)
These settings don't work/I'm not getting great screen on time!
You probably haven't disabled touch boost. YOU MUST DISABLE TOUCHBOOST, OR THIS WON'T SAVE YOU JACK SQUAT!!
How do I change governor/kernel settings?
If you're not comfortable or don't know how to do this, search the XDA forums. There are plenty of guides that explain this in great detail.
My kernel editor won't let me set [whatever]Mhz for a value you showed!
Either you have done something wrong, or you're using a kernel/device combo that mpdecision driver. Follow the instructions in the first post to determine the appropriate settings for your own device!
Do I have to be rooted?
Yes. See the fourth question and learn more about your device before trying to change things like governor settings!u can use right away.
Enough long winded preamble! Let's get down to...
The Nitty Gritty
Before I lay out all the settings so you can blindly enter them into your governor control, I should to explain some of the principals I employed to get the results I did. The primary thing to understand before I do is: little might you know, the settings in the Interactive governor can be tweaked on a clock range basis. That is to say, you can finely control how the governor responds at a variety of clock rates, thus better dictating how it should operate under various loads. This is integral to the configuration, because it means the difference between jumping from the slowest speed to the highest speed under load and sustaining lower clock speeds for tasks that don't really require higher clock speeds.
By default, the Interactive governor will jump from lowest speed to a "nominal" speed under load, and then scale up from that speed as load is sustained. That is lovely, but still too twitchy to provide serious efficiency and power savings. It spends most of its time at 2 or 3 clock speeds and barely hits other clock speeds that are ideal for other tasks or usage patterns.
Instead, what we want to do is configure it to handle different types of loads in different ways. A load suited for scrolling through a webpage is not the same as a load suited for downloading/processing streaming video is not the same as a load suited for snappy loading of an app is not the same as a load suited for high performance gaming. Every kind of load has different tolerances at which their minimal speed is indistinguishable from their maximal speed.
To understand what's best under a variety of tasks, we have to identify two types of load profiles: nominal clock rates and efficient clock rates.
Nominal Clock Rates
Nominal clock rates are the minimum CPU clock rates that perform a given task smoothly and without stuttering or lag. To find the nominal clock rate for a given task, turn on only the little CPU using the Performance governor and turn them both down incrementally until you find the minimum clock rate that works best for what you're trying to do, without introducing hiccups. (If you have a CPU or kernel that hotplugs individual cores, multiply that clock speed by your number of cores.) Keep the BIG CPU on the Powersave governor with the lowest frequency your kernel supports. (Or turn it off completely if hotplugging allow
For example, on my Idol 3, scrolling (not loading, simply scrolling) through a large webpage smoothly will occur when the first CPU clock rates are no less than 800Mhz. (This is on mine without background tasks taking any CPU. Yours may be different depending on services running, the browser you use, your ROM, kernel, etc.) Thus, the nominal clock rate for scrolling a webpage on my Idol3 is 800Mhz.
Efficient Clock Rates
Efficient clock rates are CPU clock rates that are unique in that they are the most optimal frequency given the range of voltage requirements. If you map out the frequency jump and the voltage requirement jump between each of the available clock rates, you will find that occasionally the voltage requirement will jump significantly without the frequency jumping proportionally to the previous differentials.
Because I cannot find the stock voltages of the Idol 3 clock speeds, this section is INCOMPLETE! If you know the voltages, please post and I can update this guide to include the Idols Efficient Clock Rates.
Clock Rate Biases
Using the information provided above, figure out both your nominal clock rates for the tasks you perform most often and your efficient clock rates depending on your kernel/custom voltage settings. For me, since I cannot determine the efficient clock rates, I use the nominal clock rates listed above. For the tasks I generally perform on my phone, my nominal clock rates are as follows:
Idle - 533Mhz
Page Scrolling - 800Mhz -
Video -960Mhz-
App Loading - 960Mhz-
High Load Processing - 144800Mhz-
(Note that you must calculate the values that are optimal for your phone for best battery and performance! Each phone is different because of the ROM, kernel, background tasks, etc!)
With this done, you will want to start the fine tuning phase! Correlate the efficient clock rates with their closest nominal clock rates, similar to below:
(This section of the guide is INCOMPLETE because I do not know the clock rate voltages for the Idol 3 If you know these, please post in the comments and I will update the guide!)
Idle - ???Mhz efficient / 533Mhz nominal
Page Scrolling - ???Mhz efficient / 533Mhz nominal
Video - ???Mhz efficient / 960Mhz nominal
App Loading - ???Mhz efficient / 960Mhz nominal
High Load - ???Mhz efficient / 1656Mhz nominal
Keep these handy, as they're going to be necessary for...
The Set Up
Now that we know what are the most efficient nominal clock rates we want to focus on and what the most optimal are for what we want to do, we will start low and scale up as necessary. It's always better to begin with underperforming and tweak the settings upward until we're satisfied with the performance of our target tasks.
In its default state, the Interactive governor has a hair trigger that will raise and lower the clock rates, which means it spends too much time at unnecessary clock speeds, wasting power, and scales down too quickly, leading to stuttering performance. We will take advantage of a seldom used feature of the Interactive governor. Specifically, that with which it determines when it is okay to scale up to each higher clock rate, on a frequency by frequency basis.
We have two primary goals: respond as quickly as possible to each load request for a lag free experience and exceed the desired clock rate for a given task as little as possible. To do this, we will instruct the Interactive governor to trigger certain clock rates in different ways depending on our expected load.
I won't explain all of the settings of the Interactive governor--there are plenty of summaries all around. (Go search now if you don't know what any of the settings for Interactive governor do. I'll wait here.) However, I will explain an incredibly powerful feature of the Interactive governor that is rarely included in those summaries: multiple frequency adjustments.
The above_highspeed_delay setting, for example, defines how long the governor should wait before escalating the clock rate beyond what's set in highspeed_freq. However, you can define multiple different delays that the governor should use for any specified frequency.
For example, we want the above_highspeed_delay as low as possible to get the CPU out of the idle state as quickly as possible when a significant load is applied. However, we don't want it to jump immediately to the fastest clock rate once it's gotten out of idle, as that may be overkill for the current task. Our target trigger (which you will later adjust to suit your system and usage profile), will begin at 20000μs. That means 20,000μs (or 20ms) after our idle max load has been reached, we want to assume idle has been broken and we want to perform an actual task. (We want this value as low as possible without false positives, because it is one of a few factors that determine how snappy and lag free the CPU's response is.)
But at this point we're not ready to take on a full processing load. We may just be briefly scrolling a webpage and don't need the full power of the CPU now that we've allowed it to break out of idle. So we need it to reach a particular frequency and then hold it there again until we're sure the load is justified before we allow it to push the frequency even higher. To do that, rather than just setting
above_highspeed_delay - 20000
we will instead use the format "frequency:delay" to set
above_highspeed_delay - 20000 533333:60000 800000:20000
"Waaaait... What does that do?!"
This tells the Interactive governor to hold out 20ms after our target load when it's at our highspeed_freq (which we're actually using as our idle frequency--not a burst frequency as originally intended), but then it tells the governor to hold for 60ms after it's reached 533Mhz. Once it has exceeded 533Mhz, it then has free reign to scale up without limitation. (This will be optimized with the target_loads setting in a minute. And if you don't know what I'm talking about when I say "highspeed_freq" then you didn't go search for the basic Interactive governor settings and read about it! Go do that before you read any further, because I will not explain the basics of this governor!)
These settings are among the most important, because they limit the phone's clock rates when you are not interacting with it. If it needs to do something in the background, chances are it does not need to run full throttle! Background and idle tasks should be limited to the lowest reasonable clock rate. Generally speaking, if you're just looking at your phone (to read something, for example), you want the phone to use as little CPU power as possible. This includes checking in with Google to report your location or fetching some pull data or... whatever. Things that you don't need performance for.
So now that we know how to specify different settings for different frequency ranges, let's finish it all up with...
The Money Shot
If you've made it this far, you're ready to put these strategies into play! If you have not read the previous sections, DO NOT COMPLAIN IF THE DEFAULT SETTINGS DON'T PROVIDE WHAT YOU'RE LOOKING FOR!! These settings are templates only and these need to be adjusted for each case based on your system and usage patterns! IF YOU ARE NOT GETTING THE PERFORMANCE OR BATTERY LIFE PROMISED, ***READ THE SECTIONS ABOVE!!!***
With that out of the way... let's rock!
If you are using a Idol 3, use the following Interactive governor settings for little CPU 1 (with 4 cores) and then tweak with the instructions below:
(If you are using a phone other than a Idol 3, you must read the above sections and replace the frequencies with your own efficient clock rates!)
above_highspeed_delay - 30000 533333:50000 800000:30000
boost - 0
boostpulse_duration - 80000
go_highspeed_load - 99
hispeed_freq - 800000
min_sample_time - 30000
target_loads - 98 533333:5 800000:72 998400:80 1113600:17 1309000:11 1448000:81 1601000:95
timer_rate - 20000
timer_slack - 80000
These defaults work fine for me, but I have otherwise optimized my system fully, so they are at the minimal adequate values. If you have background tasks that consume any somewhat significant amount of CPU on a constant basis, you will most likely see awful, stuttery performance and poor battery life! So you must adjust them to suit your system before you see results!!! Anything more than about 15-20% idle CPU use at any given time will negatively affect the results you see without further tweaking!
Optimize Idle Frequency
Now that you've got the base configuration, we need to tweak it so that the CPU stays at your efficient idle frequency (533Mhz in this case) without spontaneously jumping when your phone is actually idle. To do this, open a CPU monitor that displays the current core frequencies (I like CoolTool, but you can use what you like as long as it doesn't significantly impact the CPU use--you're best off using a passive monitor and checking the results after 30-60 seconds of no activity), watch the frequencies and see how often they go above your efficient idle frequency when you're not doing anything at all, and adjust the following:
timer_rate - If your idle frequency is not being exceeded much, adjust this downward in increments of 5000 until it is, then increase it by 5000. If your idle frequency is being exceeded often, adjust this upward in increments of 5000 until your CPU primarily stays at or below your desired idle frequency.
above_highspeed_delay - Only if your timer_rate has matched or exceeded 50000 and still won't stay at or below your desired idle frequency most of the time, set timer_rate to 50000 and adjust the "30000" portion of the value upwards in increments of 5000 until the idle frequency has stabilized.
The lower these two values are, the more snappy/lag free your system will be. So try to get them as low as possible without the idle frequency being exceeded too much, as this inversely affects the snappiness and efficiency of your phone when you're not doing anything. Lower = snappier but uses more CPU when you're not doing anything (such as reading a webpage); higher = less snappy but stays in a power saving state more often reducing CPU use when you're not interacting with the device. These are the most critical in determining your idle power savings, so keep that in mind if you want the most battery life!
Enhance Task Responsiveness
Now use the efficiency and nominal clock rate correlations you made for your master clock rate list in the section above and adjust your frequencies to suit your usage patterns. For example, I had web page scrolling as my 800Mhz rate, so I will open a web page and scroll and see how everything feels. If it feels sluggish, I will increase all the references to "600000" in both above_highspeed_delay and target_loads upwards to the next available clock rate until that task is smooth. What you are looking for is constant poor/sluggish performance when the task you're testing for is using its highest CPU use. If the task becomes sluggish/stuttery as it winds down (such as a scrolling webpage slowing to a stop), we will address that next, so do not take that behavior into consideration as you adjust these values! If the task is smooth until (or after) it slows down, then you have reached your optimal clock rate and can move on.
Find Optimal Loads
Now here's where we get a little math-heavy to determine what the optimal target_load frequencies are for each clock rate. (Might want to bust out a spreadsheet to do the math for you if you're not using a Idol 3.)
We want to determine 2 values for every available clock rate: the maximal efficient load and the minimal efficient load. To make this determination, we need to bust out our calculators. (Or spreadsheets!)
For the maximal efficient load, we want to correlate a load value no higher than 90% of a given clock rate before it would be more efficient to jump to the next clock rate–to avoid overwhelming a particular rate while avoiding premature jumps to the next. For this value, we calculate it as:
Max. Eff. Load:
Clock rate/next highest clockrate * 90%
533MHz/800MHZ * 90%
Min. Eff. Load:
(Next highest clock rate / clock rate - 1) * 100%
For the minimal efficient load, we want to correlate a load value at which anything higher would be better served by a higher clock rate. To calculate this:
(Next highest clock rate / clock rate - 1) * 100%
(800Mhz/533Mhz-1)*100
For the Idol 3, the maximal efficient loads of little CPU are:
533333:60
800000:72
998400:80
1113600:76
1303000:81
1448000:81
1601000:95
For the Idol 3, the minimal efficient loads of little CPU are:
533333:5
800000:24
998400:11
1113600:17
1303000:10
1448000:10
1601000:0
For the Idol 3, the maximal efficient loads BIG CPU are:
533333:60
800000:75
960000:77
1113600:74
1344000:80
1497600:83
1612800:87
1651200:95
For the Idol 3, the minimal efficient loads BIG CPU are:
533333:5
800000:24
960000:16
1113600:20
1344000:11
1497600:7
1612800:2
1651200:2
Using Optimal Loads
Now, you might be asking, "Why the heck did I do all this math?! WHAT IS IT GOOD FORRRR????!!!!"
Well, we had put some values into target_loads earlier, but those values weren't arbitrary. See, for all of our nominal clock rates, we want the CPU to hang out on them for as long as possible, provided they're doing the job. For each frequency tagged as our nominal clock rate, we want to use the maximal efficient load in target_loads. For every other frequency, we want to use our minimal efficient load value.
We don't care about those other frequencies. We don't want the CPU to hang out in those states for very long, because it just encourages the device to be reluctant to jump to a higher nominal frequency and causes stuttering. We eliminate the desire for the governor to select those frequencies unless it is absolutely efficient to do so. For all the nominal clock rates, we want the CPU to hang out there... but not for too long! So we set those values to the maximal efficient load, so they can escape to the next nominal frequency before they overwhelm the current frequency.
All said and done, this reduces jitter and lag in the device while providing optimal frequency selection for our day-to-day tasks.
Fix Stuttering
Now that you have adjusted your frequencies for optimal high CPU use in each given task, you may notice some stuttering as the task winds down. (Such as a scrolling webpage slowing to a stop.) If this bothers you, you can tweak this at the expense of some (minor) battery life by adjusting min_sample_time up in increments of 5000 until you are satisfied.
If you have exceeded a value of 100000 for the min_sample_time setting and still are not satisfied, change it back to 40000 and increase (and re-optimize) your idle frequency by one step. This will impact battery life more, but less than if you were to keep increasing the value of min_sample_time.
However, this step should not be necessary if you properly calibrated your maximal and minimal efficient loads!
But What About That BIG CPU?!
So we've all but ignored the BIG CPU. The reason? It's a horribly inefficient processor designed for high load tasks that generally don't come into play during normal usage patterns. It's good for gaming and image processing, but not for most moderate tasks a user might employ.
But it is good for one thing that all users do pretty frequently... loading and switching apps.
Fortunately, at least for the Idol, the system is pretty smart about when to employ the power of this inefficient BIG CPU. So it's generally kept at bay most of the time. What we want is to configure it to be our burst processor–we want it to come into play spontaneously and quickly during tasks that necessitate immediate high loads, like loading and switching apps. To do this, we will ignore all but 3 frequencies:
533Mhz
1344Mhz
1651Mhz
In this case, we configure it just as we did with little CPU , but only worry about keeping it idle as much as possible, allow it to jump to 1651Mhz immediately when needed, and encourage it to fall back to 1344Mhz if a sustained load is needed.
These values are ideal for the Idol, so if you have a different phone, choose the lowest clock rate, highest clock rate, and median efficient clock rate, using the instructions previously.
The Money Shot: Part Deux
If you are using a Idol 3, use the following Interactive governor settings for BIG CPU 2. (the one with 2 cores)
above_highspeed_delay - 20000
boost - 0
boostpulse_duration - 80000
go_highspeed_load - 99
hispeed_freq - 1651200
min_sample_time - 20000
target_loads - 98 533333:60 800000:20 960000:16 1113600:20 1344000:80 1497600:7 1612800:2 1651200:95
timer_rate - 20000
timer_slack - 80000
What About Bob Touchboost?
Touchboost is a nifty feature in a lot of kernels that jumps up the frequency so that you experience minimal lag. However, with all the above settings, touchboost is usally detrimental to the efficiency of the device!
We generally want to keep the CPU on the lowest possible frequency as much as possible, and touchboost interferes with that. Further, because we've set up the maximal and minimal efficient clock rates, as well as burst processing from the little CPU core, we don't need touchboost!
If your kernel allows you to shut it off, try to do so and see if the responsiveness of your device is acceptable
The Conclusion
I have achieved unprecedented performance, smoothness, snappiness, and battery life with the default settings I outlined above. However, your mileage may vary, as every phone, ROM, kernel, installed applications, etc are different. This is a very sensitive governor profile and must be tweaked to just meet the requirements of your system and your usage patterns!
If it is not optimally tuned, performance and battery life will suffer! If you're not seeing buttery smooth, snappy performance, you have not correctly tuned it for your system!! However, if you do have superb performance (and you tweaked the values conservatively and not in large steps), then you will also get the aforementioned battery life.
If you're not absolutely satisfied (and trust me, either it'll work out-of-the-box with flying colors and you'll know it works for your system, or it'll be an awful experience which means you must tweak it), then you haven't adequately adjusted the settings to suit your system.
Lemme know what you think, and good luck!
i am currently using it for two days...will report how it goes
DallasCZ said:
i am currently using it for two days...will report how it goes
Click to expand...
Click to collapse
this is still not finished only copy paste thread .i have frequencies and loads on paper ,after i finish trhead i few minutes its for everyone ill upload two kernels with implemeted setting one with min 200 mhz and one with 533 min on your rom,and i was wondering is it posible to disable mpdecision on your stock rom since i have buttiful battery life for some thime but as just as i lock or go to deepsleep min frequencies are revertet to 960 instead of 533
nero curin said:
this is still not finished only copy paste thread .i have frequencies and loads on paper ,after i finish trhead i few minutes its for everyone ill upload two kernels with implemeted setting one with min 200 mhz and one with 533 min on your rom,and i was wondering is it posible to disable mpdecision on your stock rom since i have buttiful battery life for some thime but as just as i lock or go to deepsleep min frequencies are revertet to 960 instead of 533
Click to expand...
Click to collapse
I cant help you with the mpdecision, I am only modder not a dev.
the hernel would be awsome. Please correct the title * [GUIDE] [PERDORMANCE] [BATTERY] Idol 3 (6045x) advanced Interactive gouv settings* is wrong, it should be * [GUIDE] [PERFORMANCE] [BATTERY] Idol 3 (6045x) advanced Interactive gov settings* ..but if you will implement those settings to ARDE DEV kernel, please ask them for permission, or rename this thread to something like this *[KERNEL] 6045x ARDE DEV KERNEL MOD*
I'm using this governors and the battery and perfomance are greater on my personal build flyme os 4.5.4
---------- Post added at 04:19 PM ---------- Previous post was at 04:11 PM ----------
And in Which Rom the governors works best ?
i use Arde OC on Flyme my personal build
Here's mine Screenshoots with this governors on Flyme
charged to 92 %
and the Screentime is 31 min
and the mm-pp-daemon doesn't drains battey
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
DallasCZ said:
i am currently using it for two days...will report how it goes
Click to expand...
Click to collapse
are you using these setting wich I updated just now or you have done your calculations
i am using the calculations you wrote in the cm12. 1 thread.
Odesláno z mého 6045X pomocí Tapatalk
so far it looks great. 3 hours of SoT and 40% battery left.
Odesláno z mého 6045X pomocí Tapatalk
DallasCZ said:
so far it looks great. 3 hours of SoT and 40% battery left.
Odesláno z mého 6045X pomocí Tapatalk
Click to expand...
Click to collapse
Those were rough calculations,these are more precise,I got like 7 hrs sot time it can get more also I got 34750 score on antutu only problem is mpdesicion which raises min CPU freq to 960 and that drains more battery
nero curin said:
Those were rough calculations,these are more precise,I got like 7 hrs sot time it can get more also I got 34750 score on antutu only problem is mpdesicion which raises min CPU freq to 960 and that drains more battery
Click to expand...
Click to collapse
if oyu look on my screens from the LITLLE cluster it is almost all the time on 533 MHz
DallasCZ said:
if oyu look on my screens from the LITLLE cluster it is almost all the time on 533 MHz
Click to expand...
Click to collapse
can you upload screenshot of BIG cluster
Did somebody stock rom for TWRP recovery? ...6045Y
This is a very interesting thread but very in depth, I'm not sure where to start I'd like to tweak interactive for my m8 would you be able to give me some guidance of its not too much trouble thank you in advance.
Sent from my HTC One_M8 using Tapatalk
smeejaytee said:
This is a very interesting thread but very in depth, I'm not sure where to start I'd like to tweak interactive for my m8 would you be able to give me some guidance of its not too much trouble thank you in advance.
Sent from my HTC One_M8 using Tapatalk
Click to expand...
Click to collapse
this is the guide,take a pice of paper wright your frequencies and use the formula above to calculate wich frequencies to use more and wich less,its acttualy real simple
Sent from my 6045X using Tapatalk
nero curin said:
this is the guide,take a pice of paper wright your frequencies and use the formula above to calculate wich frequencies to use more and wich less,its acttualy real simple
Sent from my 6045X using Tapatalk
Click to expand...
Click to collapse
I've been reading for an hour or so mate, what's throwing me is the big CPU and little CPU bit I'm guessing this is referring to octocore but I have a quad core, I've set up according to your template which is quite similar to the interactive settings i had set anyway, but there are parameters missing are they not needed like sync frequency and up threshold. I'll try and do some more reading but it is a lot to take in lol thanks for the reply.
Sent from my HTC One_M8 using Tapatalk
smeejaytee said:
I've been reading for an hour or so mate, what's throwing me is the big CPU and little CPU bit I'm guessing this is referring to octocore but I have a quad core, I've set up according to your template which is quite similar to the interactive settings i had set anyway, but there are parameters missing are they not needed like sync frequency and up threshold. I'll try and do some more reading but it is a lot to take in lol thanks for the reply.
Sent from my HTC One_M8 using Tapatalk
Click to expand...
Click to collapse
then read orginal thread,theere is a guide for dual core wich can be aplyed to quad core,or simply use setting based based my little cores with applyng your frequencies becouse they are doing al the work and big cores only burst.cheers
Sent from my 6045X using Tapatalk
nero curin said:
First of all read orginal thread for Nexus 5
http://forum.xda-developers.com/nexus-5x/general/guide-advanced-interactive-governor-t3269557i
Please read this post in full
For now the tweak is only for ARDE overclocked kernel,Underclocked kernel from @Unjustified Dev in a few days
If you are too lazy to read the post and configure what suites best for your device I made a template kernel with already integrated tweaks working on all Cm based roms and ill upoload it asap
or simply use Kernel Aduitor to input theese settings
Setting for little CPU :
above_highspeed_delay - 30000 533333:50000 800000:30000
boost - 0
boostpulse_duration - 80000
go_highspeed_load - 99
hispeed_freq - 800000
min_sample_time - 30000
target_loads - 98 533333:5 800000:72 998400:80 1113600:17 1309000:11 1448000:81 1601000:95
timer_rate - 20000
timer_slack - 80000
Setting for BIG CPU:
above_highspeed_delay - 20000
boost - 0
boostpulse_duration - 80000
go_highspeed_load - 99
hispeed_freq - 1651200
min_sample_time - 20000
target_loads - 98 533333:60 800000:20 960000:16 1113600:20 1344000:80 1497600:7 1612800:2 1651200:95
timer_rate - 20000
timer_slack - 80000
The Introduction
I'm about to tell you how to get buttery smooth, lag free performance with insanely good battery life, using an old school governor featured in practically every kernel... This tweak is applicable to every phone with any ROM or kernel--stock or custom--that provides the Interactive Governor.
Yeah, yeah... everyone promises good battery with great performance, but who actually delivers? Maybe it isn't as smooth as you want, or maybe it requires something your kernel or ROM don't support. Or maybe the battery life promises just aren't what you expected. There's always some awful compromise. Not here!
This isn't a guide to get 36 hour battery life... provided you never use your phone. That's deep sleep optimization, which is lovely and all, but what good is the phone if you can never use it?! And with the new Marshmallow Doze feature, this strategy is becoming a think of the past. What I'm talking about is 7-14 hour screen on, actual hands-on usage times! Without compromising anything, you can get 7-8 hour screen on usage with regular, no-compromise usage habits: daytime visible screen brightness, both radios on, sync on, network location on, all the regular usage features, the whole kit and kaboodle... all smooth as a baby's butt and snappy as a Slim Jim! (Up to 14+ hours if you can stand minimum brightness and WiFi-only with a custom ROM and other stuff turned off! And this is with stock voltages and full frequency range--you'll likely get even more if you choose to optimize those as well!)
However, it should be noted that this does not apply to gaming, heavy camera use, etc. Anything that is an automatic battery killer in and of itself. There's nothing that can be done about anything that forces the phone to utilize its maximum resources all the time. But you should know that by now. Further, this guide is about optimizing the CPU as much as possible. It does not cover things like eliminating wakelocks so your phone sleeps well, removing unnecessary and battery draining stock apps, keeping your screen brightness down*, and all that stuff that's been covered in other posts ad infinitum. Those optimizations are up to you.
*You shouldn't be turning your screen brightness above about 60%. It should be more than viewable in sunlight at that brightness, and keep in mind that the brightness power requirements increase exponentially, so a 100% bright LCD screen will use about 3.5-4.5x more power than a 60% bright screen. I don't see that fact brought up often, so I thought I'd mention it here.
So, after reading a (nearly identical) guide for the EvoLTE folks over a year ago, I'm now back to update this information to provide strategies for multi-CPU devices, as well as specific settings for the Idol 3
In this guide, I am using the ARDE overclocked and underclocked kernel by @Unjustified Dev Kernel on moded stock rom by @DallasCZ AICP rom by @The Marionette. If you are using a different kernel or device, your available features may vary, so you must determine the appropriate values to use based on the instructions in this guide! If you are too lazy to do this, I will try to keep a running list of compatible settings you can just plug-and-go. But the purpose of this guide is to assist you in discovering the best values to use with your device, so if something doesn't work, it's because you're probably not following the guide and coming up with your own values! specific to your kernel and device combo! You've been warned!
My settings don't show up after I reboot! What am I doing wrong??
If you are using EX Kernel Manager, tap the power icon to the right of the setting after you set it. If you are using a different kernel manager, check with that developer to see how it's implemented. Also, give the kernel manager a few minutes after the device boots. The settings aren't applied immediately, so check back after 3 minutes and you should see the correct values.
Why is one of my CPUs not letting me change a setting or set a certain frequency?
The device may be thermally throttling and had turned off that CPU or limited it. Turn off your device and let it cool for 5 minutes, then try again. (Keep it unplugged and make sure you don't have any apps running that might be trying to use a lot of CPU while the device is off.)
These settings don't work/I'm not getting great screen on time!
You probably haven't disabled touch boost. YOU MUST DISABLE TOUCHBOOST, OR THIS WON'T SAVE YOU JACK SQUAT!!
How do I change governor/kernel settings?
If you're not comfortable or don't know how to do this, search the XDA forums. There are plenty of guides that explain this in great detail.
My kernel editor won't let me set [whatever]Mhz for a value you showed!
Either you have done something wrong, or you're using a kernel/device combo that mpdecision driver. Follow the instructions in the first post to determine the appropriate settings for your own device!
Do I have to be rooted?
Yes. See the fourth question and learn more about your device before trying to change things like governor settings!u can use right away.
Enough long winded preamble! Let's get down to...
The Nitty Gritty
Before I lay out all the settings so you can blindly enter them into your governor control, I should to explain some of the principals I employed to get the results I did. The primary thing to understand before I do is: little might you know, the settings in the Interactive governor can be tweaked on a clock range basis. That is to say, you can finely control how the governor responds at a variety of clock rates, thus better dictating how it should operate under various loads. This is integral to the configuration, because it means the difference between jumping from the slowest speed to the highest speed under load and sustaining lower clock speeds for tasks that don't really require higher clock speeds.
By default, the Interactive governor will jump from lowest speed to a "nominal" speed under load, and then scale up from that speed as load is sustained. That is lovely, but still too twitchy to provide serious efficiency and power savings. It spends most of its time at 2 or 3 clock speeds and barely hits other clock speeds that are ideal for other tasks or usage patterns.
Instead, what we want to do is configure it to handle different types of loads in different ways. A load suited for scrolling through a webpage is not the same as a load suited for downloading/processing streaming video is not the same as a load suited for snappy loading of an app is not the same as a load suited for high performance gaming. Every kind of load has different tolerances at which their minimal speed is indistinguishable from their maximal speed.
To understand what's best under a variety of tasks, we have to identify two types of load profiles: nominal clock rates and efficient clock rates.
Nominal Clock Rates
Nominal clock rates are the minimum CPU clock rates that perform a given task smoothly and without stuttering or lag. To find the nominal clock rate for a given task, turn on only the little CPU using the Performance governor and turn them both down incrementally until you find the minimum clock rate that works best for what you're trying to do, without introducing hiccups. (If you have a CPU or kernel that hotplugs individual cores, multiply that clock speed by your number of cores.) Keep the BIG CPU on the Powersave governor with the lowest frequency your kernel supports. (Or turn it off completely if hotplugging allow
For example, on my Idol 3, scrolling (not loading, simply scrolling) through a large webpage smoothly will occur when the first CPU clock rates are no less than 800Mhz. (This is on mine without background tasks taking any CPU. Yours may be different depending on services running, the browser you use, your ROM, kernel, etc.) Thus, the nominal clock rate for scrolling a webpage on my Idol3 is 800Mhz.
Efficient Clock Rates
Efficient clock rates are CPU clock rates that are unique in that they are the most optimal frequency given the range of voltage requirements. If you map out the frequency jump and the voltage requirement jump between each of the available clock rates, you will find that occasionally the voltage requirement will jump significantly without the frequency jumping proportionally to the previous differentials.
Because I cannot find the stock voltages of the Idol 3 clock speeds, this section is INCOMPLETE! If you know the voltages, please post and I can update this guide to include the Idols Efficient Clock Rates.
Clock Rate Biases
Using the information provided above, figure out both your nominal clock rates for the tasks you perform most often and your efficient clock rates depending on your kernel/custom voltage settings. For me, since I cannot determine the efficient clock rates, I use the nominal clock rates listed above. For the tasks I generally perform on my phone, my nominal clock rates are as follows:
Idle - 533Mhz
Page Scrolling - 800Mhz -
Video -960Mhz-
App Loading - 960Mhz-
High Load Processing - 144800Mhz-
(Note that you must calculate the values that are optimal for your phone for best battery and performance! Each phone is different because of the ROM, kernel, background tasks, etc!)
With this done, you will want to start the fine tuning phase! Correlate the efficient clock rates with their closest nominal clock rates, similar to below:
(This section of the guide is INCOMPLETE because I do not know the clock rate voltages for the Idol 3 If you know these, please post in the comments and I will update the guide!)
Idle - ???Mhz efficient / 533Mhz nominal
Page Scrolling - ???Mhz efficient / 533Mhz nominal
Video - ???Mhz efficient / 960Mhz nominal
App Loading - ???Mhz efficient / 960Mhz nominal
High Load - ???Mhz efficient / 1656Mhz nominal
Keep these handy, as they're going to be necessary for...
The Set Up
Now that we know what are the most efficient nominal clock rates we want to focus on and what the most optimal are for what we want to do, we will start low and scale up as necessary. It's always better to begin with underperforming and tweak the settings upward until we're satisfied with the performance of our target tasks.
In its default state, the Interactive governor has a hair trigger that will raise and lower the clock rates, which means it spends too much time at unnecessary clock speeds, wasting power, and scales down too quickly, leading to stuttering performance. We will take advantage of a seldom used feature of the Interactive governor. Specifically, that with which it determines when it is okay to scale up to each higher clock rate, on a frequency by frequency basis.
We have two primary goals: respond as quickly as possible to each load request for a lag free experience and exceed the desired clock rate for a given task as little as possible. To do this, we will instruct the Interactive governor to trigger certain clock rates in different ways depending on our expected load.
I won't explain all of the settings of the Interactive governor--there are plenty of summaries all around. (Go search now if you don't know what any of the settings for Interactive governor do. I'll wait here.) However, I will explain an incredibly powerful feature of the Interactive governor that is rarely included in those summaries: multiple frequency adjustments.
The above_highspeed_delay setting, for example, defines how long the governor should wait before escalating the clock rate beyond what's set in highspeed_freq. However, you can define multiple different delays that the governor should use for any specified frequency.
For example, we want the above_highspeed_delay as low as possible to get the CPU out of the idle state as quickly as possible when a significant load is applied. However, we don't want it to jump immediately to the fastest clock rate once it's gotten out of idle, as that may be overkill for the current task. Our target trigger (which you will later adjust to suit your system and usage profile), will begin at 20000μs. That means 20,000μs (or 20ms) after our idle max load has been reached, we want to assume idle has been broken and we want to perform an actual task. (We want this value as low as possible without false positives, because it is one of a few factors that determine how snappy and lag free the CPU's response is.)
But at this point we're not ready to take on a full processing load. We may just be briefly scrolling a webpage and don't need the full power of the CPU now that we've allowed it to break out of idle. So we need it to reach a particular frequency and then hold it there again until we're sure the load is justified before we allow it to push the frequency even higher. To do that, rather than just setting
above_highspeed_delay - 20000
we will instead use the format "frequency:delay" to set
above_highspeed_delay - 20000 533333:60000 800000:20000
"Waaaait... What does that do?!"
This tells the Interactive governor to hold out 20ms after our target load when it's at our highspeed_freq (which we're actually using as our idle frequency--not a burst frequency as originally intended), but then it tells the governor to hold for 60ms after it's reached 533Mhz. Once it has exceeded 533Mhz, it then has free reign to scale up without limitation. (This will be optimized with the target_loads setting in a minute. And if you don't know what I'm talking about when I say "highspeed_freq" then you didn't go search for the basic Interactive governor settings and read about it! Go do that before you read any further, because I will not explain the basics of this governor!)
These settings are among the most important, because they limit the phone's clock rates when you are not interacting with it. If it needs to do something in the background, chances are it does not need to run full throttle! Background and idle tasks should be limited to the lowest reasonable clock rate. Generally speaking, if you're just looking at your phone (to read something, for example), you want the phone to use as little CPU power as possible. This includes checking in with Google to report your location or fetching some pull data or... whatever. Things that you don't need performance for.
So now that we know how to specify different settings for different frequency ranges, let's finish it all up with...
The Money Shot
If you've made it this far, you're ready to put these strategies into play! If you have not read the previous sections, DO NOT COMPLAIN IF THE DEFAULT SETTINGS DON'T PROVIDE WHAT YOU'RE LOOKING FOR!! These settings are templates only and these need to be adjusted for each case based on your system and usage patterns! IF YOU ARE NOT GETTING THE PERFORMANCE OR BATTERY LIFE PROMISED, ***READ THE SECTIONS ABOVE!!!***
With that out of the way... let's rock!
If you are using a Idol 3, use the following Interactive governor settings for little CPU 1 (with 4 cores) and then tweak with the instructions below:
(If you are using a phone other than a Idol 3, you must read the above sections and replace the frequencies with your own efficient clock rates!)
above_highspeed_delay - 30000 533333:50000 800000:30000
boost - 0
boostpulse_duration - 80000
go_highspeed_load - 99
hispeed_freq - 800000
min_sample_time - 30000
target_loads - 98 533333:5 800000:72 998400:80 1113600:17 1309000:11 1448000:81 1601000:95
timer_rate - 20000
timer_slack - 80000
These defaults work fine for me, but I have otherwise optimized my system fully, so they are at the minimal adequate values. If you have background tasks that consume any somewhat significant amount of CPU on a constant basis, you will most likely see awful, stuttery performance and poor battery life! So you must adjust them to suit your system before you see results!!! Anything more than about 15-20% idle CPU use at any given time will negatively affect the results you see without further tweaking!
Optimize Idle Frequency
Now that you've got the base configuration, we need to tweak it so that the CPU stays at your efficient idle frequency (533Mhz in this case) without spontaneously jumping when your phone is actually idle. To do this, open a CPU monitor that displays the current core frequencies (I like CoolTool, but you can use what you like as long as it doesn't significantly impact the CPU use--you're best off using a passive monitor and checking the results after 30-60 seconds of no activity), watch the frequencies and see how often they go above your efficient idle frequency when you're not doing anything at all, and adjust the following:
timer_rate - If your idle frequency is not being exceeded much, adjust this downward in increments of 5000 until it is, then increase it by 5000. If your idle frequency is being exceeded often, adjust this upward in increments of 5000 until your CPU primarily stays at or below your desired idle frequency.
above_highspeed_delay - Only if your timer_rate has matched or exceeded 50000 and still won't stay at or below your desired idle frequency most of the time, set timer_rate to 50000 and adjust the "30000" portion of the value upwards in increments of 5000 until the idle frequency has stabilized.
The lower these two values are, the more snappy/lag free your system will be. So try to get them as low as possible without the idle frequency being exceeded too much, as this inversely affects the snappiness and efficiency of your phone when you're not doing anything. Lower = snappier but uses more CPU when you're not doing anything (such as reading a webpage); higher = less snappy but stays in a power saving state more often reducing CPU use when you're not interacting with the device. These are the most critical in determining your idle power savings, so keep that in mind if you want the most battery life!
Enhance Task Responsiveness
Now use the efficiency and nominal clock rate correlations you made for your master clock rate list in the section above and adjust your frequencies to suit your usage patterns. For example, I had web page scrolling as my 800Mhz rate, so I will open a web page and scroll and see how everything feels. If it feels sluggish, I will increase all the references to "600000" in both above_highspeed_delay and target_loads upwards to the next available clock rate until that task is smooth. What you are looking for is constant poor/sluggish performance when the task you're testing for is using its highest CPU use. If the task becomes sluggish/stuttery as it winds down (such as a scrolling webpage slowing to a stop), we will address that next, so do not take that behavior into consideration as you adjust these values! If the task is smooth until (or after) it slows down, then you have reached your optimal clock rate and can move on.
Find Optimal Loads
Now here's where we get a little math-heavy to determine what the optimal target_load frequencies are for each clock rate. (Might want to bust out a spreadsheet to do the math for you if you're not using a Idol 3.)
We want to determine 2 values for every available clock rate: the maximal efficient load and the minimal efficient load. To make this determination, we need to bust out our calculators. (Or spreadsheets!)
For the maximal efficient load, we want to correlate a load value no higher than 90% of a given clock rate before it would be more efficient to jump to the next clock rate–to avoid overwhelming a particular rate while avoiding premature jumps to the next. For this value, we calculate it as:
(clock rate * 0.9) / next highest clock rate
For example, the maximal efficient load for 600Mhz on the Nexus 5X would be caluclated as:
(600000 * 0.9) / 672000 = 80.36% (rounded and normalized: 80)
For the minimal efficient load, we want to correlate a load value at which anything higher would be better served by a higher clock rate. To calculate this:
(1 - next highest clock rate / clock rate) * -1
For example, the minimal efficient load for 600Mhz on the Nexus 5X would be calculated as:
(1 - 672000 / 600000) * -1 = 12.00% (rounded and normalized: 12)
For the Idol 3, the maximal efficient loads of little CPU are:
533333:60
800000:72
998400:80
1113600:76
1303000:81
1448000:81
1601000:95
For the Idol 3, the minimal efficient loads of little CPU are:
533333:5
800000:24
998400:11
1113600:17
1303000:10
1448000:10
1601000:0
For the Idol 3, the maximal efficient loads BIG CPU are:
533333:60
800000:75
960000:77
1113600:74
1344000:80
1497600:83
1612800:87
1651200:95
For the Idol 3, the minimal efficient loads BIG CPU are:
533333:5
800000:24
960000:16
1113600:20
1344000:11
1497600:7
1612800:2
1651200:2
Using Optimal Loads
Now, you might be asking, "Why the heck did I do all this math?! WHAT IS IT GOOD FORRRR????!!!!"
Well, we had put some values into target_loads earlier, but those values weren't arbitrary. See, for all of our nominal clock rates, we want the CPU to hang out on them for as long as possible, provided they're doing the job. For each frequency tagged as our nominal clock rate, we want to use the maximal efficient load in target_loads. For every other frequency, we want to use our minimal efficient load value.
We don't care about those other frequencies. We don't want the CPU to hang out in those states for very long, because it just encourages the device to be reluctant to jump to a higher nominal frequency and causes stuttering. We eliminate the desire for the governor to select those frequencies unless it is absolutely efficient to do so. For all the nominal clock rates, we want the CPU to hang out there... but not for too long! So we set those values to the maximal efficient load, so they can escape to the next nominal frequency before they overwhelm the current frequency.
All said and done, this reduces jitter and lag in the device while providing optimal frequency selection for our day-to-day tasks.
Fix Stuttering
Now that you have adjusted your frequencies for optimal high CPU use in each given task, you may notice some stuttering as the task winds down. (Such as a scrolling webpage slowing to a stop.) If this bothers you, you can tweak this at the expense of some (minor) battery life by adjusting min_sample_time up in increments of 5000 until you are satisfied.
If you have exceeded a value of 100000 for the min_sample_time setting and still are not satisfied, change it back to 40000 and increase (and re-optimize) your idle frequency by one step. This will impact battery life more, but less than if you were to keep increasing the value of min_sample_time.
However, this step should not be necessary if you properly calibrated your maximal and minimal efficient loads!
But What About That BIG CPU?!
So we've all but ignored the BIG CPU. The reason? It's a horribly inefficient processor designed for high load tasks that generally don't come into play during normal usage patterns. It's good for gaming and image processing, but not for most moderate tasks a user might employ.
But it is good for one thing that all users do pretty frequently... loading and switching apps.
Fortunately, at least for the Idol, the system is pretty smart about when to employ the power of this inefficient BIG CPU. So it's generally kept at bay most of the time. What we want is to configure it to be our burst processor–we want it to come into play spontaneously and quickly during tasks that necessitate immediate high loads, like loading and switching apps. To do this, we will ignore all but 3 frequencies:
533Mhz
1344Mhz
1651Mhz
In this case, we configure it just as we did with little CPU , but only worry about keeping it idle as much as possible, allow it to jump to 1651Mhz immediately when needed, and encourage it to fall back to 1344Mhz if a sustained load is needed.
These values are ideal for the Idol, so if you have a different phone, choose the lowest clock rate, highest clock rate, and median efficient clock rate, using the instructions previously.
The Money Shot: Part Deux
If you are using a Idol 3, use the following Interactive governor settings for BIG CPU 2. (the one with 2 cores)
above_highspeed_delay - 20000
boost - 0
boostpulse_duration - 80000
go_highspeed_load - 99
hispeed_freq - 1651200
min_sample_time - 20000
target_loads - 98 533333:60 800000:20 960000:16 1113600:20 1344000:80 1497600:7 1612800:2 1651200:95
timer_rate - 20000
timer_slack - 80000
What About Bob Touchboost?
Touchboost is a nifty feature in a lot of kernels that jumps up the frequency so that you experience minimal lag. However, with all the above settings, touchboost is usally detrimental to the efficiency of the device!
We generally want to keep the CPU on the lowest possible frequency as much as possible, and touchboost interferes with that. Further, because we've set up the maximal and minimal efficient clock rates, as well as burst processing from the little CPU core, we don't need touchboost!
If your kernel allows you to shut it off, try to do so and see if the responsiveness of your device is acceptable
The Conclusion
I have achieved unprecedented performance, smoothness, snappiness, and battery life with the default settings I outlined above. However, your mileage may vary, as every phone, ROM, kernel, installed applications, etc are different. This is a very sensitive governor profile and must be tweaked to just meet the requirements of your system and your usage patterns!
If it is not optimally tuned, performance and battery life will suffer! If you're not seeing buttery smooth, snappy performance, you have not correctly tuned it for your system!! However, if you do have superb performance (and you tweaked the values conservatively and not in large steps), then you will also get the aforementioned battery life.
If you're not absolutely satisfied (and trust me, either it'll work out-of-the-box with flying colors and you'll know it works for your system, or it'll be an awful experience which means you must tweak it), then you haven't adequately adjusted the settings to suit your system.
Lemme know what you think, and good luck!
Click to expand...
Click to collapse
Whick Rom did you USE,and Which kernel ?
Alek Dev said:
Whick Rom did you USE,and Which kernel ?
Click to expand...
Click to collapse
moded stock from @DallasCZ currently with oc kernel already in rom
Sent from my 6045X using Tapatalk
nero curin said:
moded stock from @DallasCZ currently with oc kernel already in rom
Sent from my 6045X using Tapatalk
Click to expand...
Click to collapse
okay,when you will upload new kernel you maded with governors,in the rom made by dallascz i get reboots with this kernel
Alek Dev said:
okay,when you will upload new kernel you maded with governors,in the rom made by dallascz i get reboots with this kernel
Click to expand...
Click to collapse
there is alternative kernel for versions with reboots on his thread also OC kernel,im experimenting with difrent frquencies.when im sure i got the right thing ill upload until then everyone can calculate frequencies for kernel they are using ore use the themplate settings
Sent from my 6045X using Tapatalk