[FUTURE APP] Overclocking/Undervolting stability test & power efficiency optimizer

Is my mobile device CPU overclocked or undervolted

  • I don't want to or I cannot

    Votes: 21 5.5%
  • No because its potentially unstable but I would

    Votes: 65 17.1%
  • Yes but it's not 100% stable

    Votes: 96 25.2%
  • Yes and it's rock solid

    Votes: 199 52.2%

  • Total voters
    381
Search This thread

ytt3r

Retired Recognized Developer
Dec 7, 2010
557
321
GA
do a quick mockup, I'm interested to see

Sent from my SGH-I897 using XDA App
 

suntzu123

Senior Member
Nov 20, 2010
190
17
Im always OC... When I need it.

UV is very usefull tool.... But Stability Tester from market is "s...". I know one thing, if it crash I have to rise 0,5V voltage. The best stability test for CPU I think is a browser.


We need good tool. And there is no good tool for GPU. SGX540 works with 400MHz, not in Galaxy S (200MHz)... But is it possible to OC GPU? I mean this is SoC, and there is much more related controlers here. Is possible to make it (ofc not save), but "not 100%" bricking phones tool.

There is only one game that need souch a power. Dungeon Defenders, and only CPU is here bottleneck (you can addjust grpahics).
But I hope there will be some.... And I hope there will be no limits like now. Nvidia sponsoring developers to make games only for Tegra 2.
 
Last edited:

zacharias.maladroit

Recognized Developer
Hi guys,

here's a repost from my kernel thread listing the steps I do to make sure it's at least 95-99.999999% stable for me:

I was running zach's kernel when my GS with MIUI started rebooting even with most common operation.
I managed to get it working disabling every UV setting from Pimp MY CPU.
Do you have the same problem?
I'm new in OC/OV operations so please could you explain to me how to set it in the best way?
Thankyou :)

Mini Overclocking Guide


My approach:

start with -50 mV (delta from default value) other values probably are too low

my testing includes:

- Angry Birds Rio (several missions)
- Gun Bros (for some time)
- mp3 playback, (flac playback - optional)
- surfing the web via browser, opening up bit.ly links from cmsgsteam twitter feed
- watching youtube video
- watching video via rockplayer lite or mobo video player
- running benchmarks (Smartbench 2011, quadrant standard, an3dbenchXL, anTutuBench)
- Labyrinth Lite (for gravity sensor), auto-rotation (also for sensor)


when 1 GHz (1,2 or 1,3) is OK - go lower with undervolt value (e.g. -75 mV)


after it gets un-stable - go back to last known stable value


then you can limit max frequency to lower one, e.g. 800 MHz

and repeat testing for that frequency

Angry Birds Rio from my experience seems more challenging since I already had 2 hangs & reboots with it whereas there were none with Gun Bros

there are probably more challenging games but currently I don't know much - and it should be free




all of these steps would be needed to be incorporated in the stability testing app in some sort :confused:
 

aweaver33

Senior Member
Apr 17, 2011
109
12
Palm Bay, FL
[*]the changing of states is definitely a huge thing to work into the tests, as this is where some of the more subtle problems between the voltage/freq steps seems to manifest themselves.
I agree. One of the problems with most (all?) of the existing stability/stress tests out there is that they peg the processor and thus really only test the max frequency. Users are then left with a manual process of testing each frequency individually and are unable to test the transitional dynamics. While I don't have the time or the Android development experience to make a meaningful contribution to the app, I figure I could at least share a small shell script I hacked together to randomly cycle scaling_max_freq (I would have used the scaling_setspeed, but my kernel of choice doesn't have the userspace governor). I kick this script off before running StabilityTest when I'm testing my UV settings. Anyway, I doubt many of you will find this all that useful as-is, but it is an interesting proof of concept.
Code:
#!/system/bin/bash

# Cleanup function to restore original max frequency
function cleanup()
{
   echo $maxfreq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
   exit
}

# Get the list of frequencies that we want to cycle through
typeset -a allfreqs;
allfreqs=(`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies`)
minfreq=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq`
maxfreq=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq`
numfreqs=0
typeset -a freqs
for i in ${allfreqs[@]}; do
   if [ $i -ge $minfreq ] &&  [ $i -le $maxfreq ]; then
      freqs[$numfreqs]=$i
      numfreqs=$(($numfreqs + 1))
   fi
done

# Restore max frequency if we're interrupted
trap cleanup SIGHUP SIGINT SIGTERM

# Get number of loops from command-line with a default if not specified
numloops=500
if [ $# -ge 1 ]; then
   numloops=$1
fi

# A single pass through this outer loop sets all the frequencies
for ((i=0; $i < $numloops; ++i)); do

   # Shuffle the frequency order
   for ((j=0; $j < $numfreqs; j++)); do
      randPos=$(($RANDOM % $numfreqs))
      tmp=${freqs[$j]}
      freqs[$j]=${freqs[$randPos]}
      freqs[$randPos]=$tmp
   done
   
   # Set the max freq to each frequency in the list for a while
   # If userspace governer were enabled, we'd set the target freq instead
   for j in ${freqs[@]}; do
      echo -n "."
      echo $j > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      usleep 100000
   done
   
   echo " $(($i+1))"
   
done

cleanup
 

dog77k

Senior Member
Nov 1, 2010
192
96
Texas
The stabilitytest app mentioned in the OP is now in v2 which allows a frequency scaling stability test...very useful and well on its way.
 

lordofazeroth

Senior Member
Nov 28, 2010
537
26
I installed Stab. Test but it tells me with the root testing (name forgotten) that only 1000 MHz max are tested.
I have an overclocking kernel which should go to 1200.
How can I test 1200 with this app?
 

dog77k

Senior Member
Nov 1, 2010
192
96
Texas
You have to have 1200 set as your current max freq. The app tests between whatever your current clock settings are, not what the kernel supports.

Sent from my Inspire 4G
 

leperousdust

Member
Jul 17, 2006
20
0
This sounds like exactly something i'd be after. Something i could essentially leave to automatically undervolt and rigorously test my phone to find it's limits. I don't need any more bleeding edge performance per se, but jumping through the hoops and undervolting would be well worth it battery wise i'm sure. The problem being that there are SO SO many values and different ways of testing "stability" that it's largely sensibly impossible to ever get the "perfect". An automated process that could do this if i left it (i wouldn't care if it took hours just once!) would be an absolute god send. With yours and other popular dev names behind it, it also seems like something you can trust :)

I will wait patiently for this! My i9000 honestly never seems to get old. I have on and off thought about getting an i9100 and i just can't justify the slight improvement compared to unsurpassed dev support of the i9000, between everyone here the i9000 have super-polished an fairly decent phone, one which we can thank Samsung for innovating so much with yet leaving "us" to finish...
 

loonieryan

Senior Member
Nov 29, 2010
340
76
Is this project still alive?
Cuz i'd love to see the real app.

+1

I am running StabilityTest for over 40 minutes without any issues, but my GPU is still crashing every now and then while using my phone. My phone is overclocked, and it's evident that StabilityTest just isn't stressing my GPU enough.
 

Stannieman

Senior Member
Sep 5, 2011
170
65
The problem with the stability test from the market is that it focuses on one operation only.

I guess their approach was: "How can we let the cpu work? Aah yes, calculate prime numbers, that will make it sweat. Let's calculate lots of prime numbers and check if the result is good!"

But when you compile a prime calc app, not all ARM instructions available are used, only those required for the prime calculation algorithm.

A better approach would be: "What are all available ARM instructions on this ARM version? Lets do a run for each ARM instruction where that instruction is extensively tested. Then do some runs with all instructions mixed up."
The thing is that you need to write some ASM, cause otherwise the compiler chooses what he thinks are the best instructions, and some might not be tested good enough.


With stability test as it is now, you are sure your cpu runs stable with the instructions used by the test. It might very well be however that if some app uses an untested instruction, the phone crashes because that instruction causes problems.
 
  • Like
Reactions: lu94sca

Top Liked Posts

  • There are no posts matching your filters.
  • 22
    [FUTURE APP] Overclocking/Undervolting stability test & power efficiency optimizer

    Hi !
    Here is the description of a potential app that might be developed under an open source license by united developers.

    The app has several intents we may discuss:

    1/ Validate the CPU stability

    - Rare defective devices are not stable with manufacturer's Frequency, voltage and governor configuration.
    - With overclocked devices, stability is far more challenging and as difficult to verify.

    CPU stability is influenced by a lot of parameters, like
    - Frequency table
    - Voltage table
    - Governor used
    - Quality of the voltage regulation & switching implementation (hardware and software)
    - Environmental heat, by other components (GPU, battery, screen) or the external temperature especially with black devices under the sun.


    2/ Validate the GPU stability

    Same thing here, most of our devices GPU can be overclocked but so far there is no good tool to validate its stability.


    3/ Validate the system stability

    Torture test: CPU + GPU + screen at 100% stability & charging at the same time :eek:
    This is quite a common scenario when phone or tablets are used as gaming devices.


    4/ Provide help to optimize the power efficiency

    Today many OC users tend also to reduce the power efficiency of their device by setting inappropriate minimal and maximal frequencies (reduces efficiency) or by configuring too high voltages.

    The best OC in general, or at least the most energy efficient consist of increasing the frequencies without changing the voltages.
    Even if a higher frequency increases the power envelope, it only improve the power efficiency.
    Also, undervolting for reduced frequency / power energy states improve power efficiency.


    Future: automatic OC optimizer with profiles

    Profiles:
    - Best power efficiency without overclocking (undervolting only)
    - Best power efficiency
    - Balanced
    - Max performance

    With this feature, It could become the master of every OC tool.
    Of course it will require the ability to speak to each existing sysfs controls formats, which is not such a big deal as most are quite cleanly implemented!
    However it would make a few apps obsolete & also few people mad, which is definitely a negative point.

    Another idea for this optimizer could be to allow for other OC apps to use the stability test engine and do the optimization themselves.


    Implementation details

    Good old stability stability test traditionally has been trying to make your CPU hot. As hot as possible, consume the most power, see if it crashes, and that's pretty much all.
    While this approach could work with old PC CPU, it's now totally outdated.

    Even if an excess of heat is still capable of making a CPU crash, modern CPU have quite complex usage behaviors like
    - Switching Frequency and Voltage all the time.
    - Entering and leaving sleep over and over, each time you lock/unlock your device, of the baseband wake it up by receiving a message, etc.

    Like in every low level hardware stuff, the most delicate operations are switch of states, so, what a stress-test needs to do contains:

    For me the reference test is "Intel Linpack" x86 implementation like you see in IntelBurnTest. I heard linpack binary is what they use in factory to determine which is the frequency rating of each CPU.
    I don't know if it's true but I've always been impressed by the short time needed to detect an unstable PC system reliably where other tools like "prime95" could run for hours without giving usable result.

    The ability to let the CPU (or GPU) switch frequencies
    It can be done:
    - by varying the CPU load. CPU governor will do its thing all alone.
    - by "force" modifying the CPU frequency directly

    Let the device enter sleep and wake it up

    Many OC devices seems to work well but suffer from "sleep of death" issue. IE never wake up.
    Sometimes even non-OC device have the same problem if you use ondemand governor instead of conservative.

    I guess this is definitely something that can be implemented in the stability test:)

    Detect non-fatal calculation errors

    Like Intel Linpack test, errors detecting before a crash is smart and much safer.
    It also allow to reduce dramatically the required test run time.


    Existing apps

    @SnakeHaveYou told me about the existing app named StabilityTest.
    In the description the implementation looks very good, with the ability to detect non-crashing calculation errors.
    However after about 20 minutes of test at a known unstable frequency on my phone, I get no error.
    However if I keep the same OC'ed frequency, starting an OpenGL game, or let the phone enter sleep and waking it up a bit later leads to an unrecoverable freeze.

    So, this app looks good but its implementation seems to lack the full stress ability required to simulate a real usage pattern.
    6
    Who

    After running the app idea on twitter, several developers showed interest in the idea.
    I have no plan to write or promote this application by myself.

    However I'm interested into acting as a host, incubator or something like that, and also contributor.

    Who showed interest right away (developers)

    @bvalosek
    @BFGarzilla9k
    @ytt3r
    @ogdobber
    @KhasMek
    @TheEscapist_xda

    And also a few people before the the the idea was described publicly.

    I guess this app can have a very large user base quite fast, especially since it will be promoted by about every kernel developer here on XDA.

    How

    I propose a shared git repository on https://github.com/project-voodoo with plenty of contributors with write access to the App SDK & NDK code.
    Maybe forks all over the place could do also, but if it enhance freedom I'm not sure it would favor collaboration so much :D

    Hey, your turn guys!
    1
    nice posts bud-- good to see you starting the ball rolling from your idea on Twitter earlier. Just some quick info before I head out... more tonight probably

    Some thoughts on the app:
    • the changing of states is definitely a huge thing to work into the tests, as this is where some of the more subtle problems between the voltage/freq steps seems to manifest themselves.
    • I have yet to find a synthetic test that can fail/detect problems as quickly as say launching a game like Cordy.., so there are ways to bash the system harder than the current tests it seems

    what i can bring to the table
    • No experience with the NDK but pretty solid C experience for embedded systems
    • Can probably help the most on UI/metrics/feedback parts of the app. Creating views to reflect test status, sysfs state info, etc. Example of an app that shows time_in_state info i wrote a few weekends ago -> CPU Spy

    my dev environment
    • Arch Linux
    • vim + android SDK command line tools
    • git for VCS (github for the few opensource projects I've done)

    I'll be watching this thread to see what sort of dev activity we have going on over the next few days... looking forward to working with some of yall fellow XDA guys
    1
    The problem with the stability test from the market is that it focuses on one operation only.

    I guess their approach was: "How can we let the cpu work? Aah yes, calculate prime numbers, that will make it sweat. Let's calculate lots of prime numbers and check if the result is good!"

    But when you compile a prime calc app, not all ARM instructions available are used, only those required for the prime calculation algorithm.

    A better approach would be: "What are all available ARM instructions on this ARM version? Lets do a run for each ARM instruction where that instruction is extensively tested. Then do some runs with all instructions mixed up."
    The thing is that you need to write some ASM, cause otherwise the compiler chooses what he thinks are the best instructions, and some might not be tested good enough.


    With stability test as it is now, you are sure your cpu runs stable with the instructions used by the test. It might very well be however that if some app uses an untested instruction, the phone crashes because that instruction causes problems.