SetCPU Step by Step Instructions

Last Updated:

  1. thetomlin2

    thetomlin2 Guest This Topic's Starter

    Nov 23, 2009
    Likes Received:
    I fould this online and thought it may come in handy for some people ...

    SetCPU for Root Users
    SetCPU for Root Users allows you to manage the CPU frequency settings of your Android device. It works with most commercial Android devices that have root access enabled for applications. Combined with custom profiles, SetCPU can help you manage your CPU settings to optimize performance and battery life. On many phones, oftentimes with the help of custom kernels, SetCPU can also manage overclocking on your device. SetCPU is currently available on the Android Market and the SlideME Market.
    SetCPU works on most devices running Android 1.5 to Android 2.2, with Android 1.6 and above recommended. If you have an HTC device, you may need to disable perflock (see 10) depending on your kernel.

    1. Benefits
    The CPU drains more power if it is running at a higher frequency. If the processor is running faster, the phone will be faster and more responsive, but the battery may drain more quickly. If the processor is running more slowly, the phone will be less responsive and take longer to complete tasks, but battery life will be increased. With SetCPU, you can set up profiles to manage the CPU speed based on certain conditions.
    2. Main Tab and Basic Usage
    To get started with SetCPU, start the app, read the introduction, and pick "autodetect frequencies." If you ever need to access this screen again, press the Menu button in SetCPU's Main tab, then choose Device Selection.
    If your kernel doesn't support autodetect, you won't see it choose the device that best matches your phone from the list. After you've passed the introduction screen, you may get a request from Superuser Permissions. Depending on your version of Superuser Permissions, either check the box for "remember" and press "allow" or press the "always allow" button.
    The sliders here allow you to manually control the CPU scaling bounds. The CPU frequency will always be between these two values. By default, the CPU should scale between the max and min frequencies based on need. The sliders also control the "main" profile as explained later.
    The "scaling" drop-down list is an advanced feature that allows you to control the behavior of the CPU scaling mechanism. See explanations for the different governors in the CPU Scaling Governors section.
    SetCPU also includes a widget for your home screen. Add SetCPU's widget like you would any other widget: long press on your home screen, select Widgets, and select the SetCPU widget. A screen will pop up so you can configure the widget's appearance. If you would like it to show current CPU speed, set the Active Refresh Interval to something other than "Passive," though a passive refresh interval is recommended to save battery.
    HTC device users: If the green "current" display doesn't change as you change the sliders, you may be using an incompatible HTC kernel with a driver called "perflock" that prevents SetCPU from changing frequencies. To enable SetCPU, press the "Menu" button in SetCPU's main tab and select "disable perflock." Read through the notice and then press the button in the dialog. If successful, you should be able to change the frequency with SetCPU. If this process fails, please e-mail the developer with your kernel version and device so support can be added. For more details, see the perflock section below.


    3. Profiles
    Profiles allow you to configure SetCPU to set your CPU speed under certain conditions. This is useful to manage battery savings. To get started with profiles, check the "Enable" button in the Profiles tab and press "Add Profile" to add your first profile.

    Your profile settings will be triggered if the condition you set in the profile is met. For example, if you choose "Screen Off," the profile settings will be set when the screen is off. If no profiles are met, SetCPU reverts to the default profile specified in the Main tab. Several conditions are available:
    • Charging/Full - Set when the phone is charging from any source and when the battery is full while charging.
    • Charging AC/Full - Set only when the phone is charging from a wall plug (AC adapter) and when the battery is full while charging from a wall plug.
    • Charging USB/Full - Set only when the phone is charging from a computer (USB port) and when the battery is full while charging from the USB port.
    • Screen Off - Set when the phone's screen is turned off.
    • Battery < - Set when the battery falls below a certain point. You will also be able to specifiy battery level for this profile.
    • Temp > - Set when the battery or system temperature rises above a certain point. SetCPU will notify you with a ringtone notification if you check the "Audible Warning" checkbox here. You will also be able to specify a temperature for this profile.
    • CPU Temp > - Limited to phones whose hardware and kernels support it. Set when the CPU temperature rises above a certain point. SetCPU will notify you with a ringtone notification if you check the "Audible Warning" checkbox here. You will also be able to specify a temperature for this profile.
    The priority of each profile specifies the order in which it will be evaluated. If the conditions of two profiles are both true, the one with the higher priority will be set. For example, if you have both a Screen Off and a Charging profile and the screen is off and charging at the same time, the one with the higher priority will be set.

    You can add as many profiles as you want, and selectively enable and disable profiles by using the checkbox next to them. To edit profiles, click on them, make the necessary changes, and press "save." To remove profiles, click on it to edit, and press "delete."
    Some things to keep in mind: For multiple battery level profiles, assign the profiles with lower percentages higher priorities. For multiple temperature profiles, assign the profiles with higher temperatures higher priories. Generally, battery level profiles should have lower priorities than other profiles, and temperature profiles should have higher priorites than other profiles.
    Check the "Notifications" box to enable a persistent notification in the top bar showing exactly which profile is currently active.


    4. Advanced Tab

    The Advanced menu allows you to tweak the finer aspects of certain CPU governors. It is only activated when you choose the ondemand or conservative governors.
    • Sampling Rate - An interval (in microseconds) at which the governor will poll for updates. When this happens, the governor will decide whether to scale the CPU up or down.
    • Up Threshold - Defines a percentage from 1% to 100%. When the CPU load reaches this point, the governor will scale the CPU up.
    • Down Threshold (conservative only) - Defines a percentage from 1% to 100%. When the CPU load reaches this point, the governor will scale the CPU down.
    • Ignore Nice Load - If this value is "1," the system will ignore "Nice" processes when deciding to scale up or down.
    • Powersave Bias (ondemand only) - Setting this value higher will "bias" the governor toward lower frequencies. This is a percentage, where 1000 is 100%, 100 is 10%, and 0 is 0%. The ondemand governor will scale the CPU to a frequency lower than its "target" speed according to this value.
    • Freq Step (conservative only) - Defines how much (as a percentage of the maximum CPU speed) the conservative governor will increase the CPU speed by each time the CPU load reaches the Up Threshold.
    Choose the "Set on Boot" checkbox to apply advanced settings when the phone boots. This option is completely independent of the similar option in the Main tab.
    5. System Info
    The System Info tab allows you to view information about your kernel, CPU, battery, phone, and memory status. It also includes a few tools for benchmarking the speed of the phone.
    The lower the benchmark score, the faster the phone is running. Keep in mind that this score can only be used to accurately compare different frequencies across the same ROM and kernel. The score may fluctuate between runs due to interference by background processes. For best results, use the "performance" governor.
    There is also a "stress test" function. Stress testing allows you to test the stability of undervolted kernels or higher overclocks. The stress test will peg your CPU usage to 100% The phone may be somewhat unresponsive during this time. The stress test will continue forever, so you have to manually end it after some time. To do this, simply press the back button.
    To copy the text of the System Info menu to the clipboard, press the Menu button on your device and press "Copy to Clipboard."
    6. About
    The About menu prints information about SetCPU, including the current version. You can change the theme of the Main tab from using the drop down box. Restart SetCPU to apply it.
    7. CPU Scaling Governors
    CPU governors control exactly how the CPU scales between your "max" and "min" set frequencies. Most kernels have "ondemand" and "performance." The availability

    • ondemand - Available in most kernels, and the default governor in most kernels. When the CPU load reaches a certain point (see "up threshold" in Advanced Settings), ondemand will rapidly scale the CPU up to meet demand, then gradually scale the CPU down when it isn't needed.
    • conservative - Available in some kernels. It is similar to the ondemand governor, but will scale the CPU up more gradually to better fit demand. Conservative provides a less responsive experience than ondemand, but can save battery.
    • performance - Available in most kernels. It will keep the CPU running at the "max" set value at all times. This is a bit more efficient than simply setting "max" and "min" to the same value and using ondemand because the system will not waste resources scanning for the CPU load. This governor is recommended for stable benchmarking.
    • powersave - Available in some kernels. It will keep the CPU running at the "min" set value at all times.
    • userspace- A method for controlling the CPU speed that isn't currently used by SetCPU. For best results, do not use the userspace governor.
    8. Custom Frequency Config
    In rare situations and in older kernels, SetCPU may not be able to autodetect the full range of speeds supported by the kernel. If this is the case, you can configure SetCPU to use custom frequencies. To get started, you'll need the list of frequencies your kernel can support in kHz (not MHz!). Only certain frequencies work, so be sure you know which speeds your kernel supports before using the custom option.
    Create a plain text file called "setcpu.txt" and place it on the root directory of your SD card or on your SD card's ext partition (/sdcard/ or /system/sd/). The text files should sort the frequencies on one line by comma, from lowest to highest. For example, the following is a valid config file for some Motorola Droid kernels:
    To store the custom frequency list on your phone, save it as "setcpu" with no extension and put it in /data/local/. SetCPU reads from the SD card first and uses that text file if present, then tries to read from /data/local/.
    To configure SetCPU to read your custom frequencies, go back to the device selection screen (in the Main tab, press Menu > Device Selection), choose "show other frequencies" if necessary, and choose the custom config option at the very bottom.

    9. Task Managers
    SetCPU does not run a background service unless profiles or the widget are enabled. Due to how multitasking works on Android, the Android system will automatically free up SetCPU if memory is needed and SetCPU isn't being used.
    If either profiles or the widget are enabled, SetCPU does run background processes that keep them running. It's important that you add SetCPU to your task manager's "ignore" list, or otherwise avoid disabling the SetCPU process, if you have either profiles or the widget enabled. You should not have to use task managers to disable SetCPU at any time.
    To disable all SetCPU background processes, remove the widget from the home screen and uncheck the "enable" box in the profiles menu. Anything else should be taken care of the Android system when memory is needed, just like any other app. Note that SetCPU briefly runs (and then immediately disables) a service upon startup to perform its "start on boot" duties. This is normal and should not add to memory usage.
    10. Disabling Perflock
    On most stock HTC kernels and some custom kernels, HTC has enabled a driver called "perflock" that constantly resets SetCPU's Max and Min settings. This does not apply to mostly "Google experience" HTC devices such as the T-Mobile G1, the myTouch 3G, any Google development device, or the Nexus One. It does, however, apply to "HTC Sense" devices such as the HTC Hero, Droid Eris, HTC Desire, HTC Incredible, EVO 4G, and myTouch Slide. Non-HTC devices never have perflock enabled.
    SetCPU can disable perflock on newer HTC kernels, giving you control of the Max and Min settings of the CPU. To do this, press the Menu button on your device in the Main tab and choose "Disable Perflock." Read through the notice and then press the button in the dialog. If successful, you should be able to change the frequency with SetCPU. If this process fails, please e-mail the developer with your kernel version and device so support can be added.
    Keep in mind that disabling perflock does not enable overclocking, though some overclocked kernels may require perflock to be disabled. Overclocking, in most cases, requires a custom kernel.

    SetCPU for Root Users

  2. scary alien

    scary alien not really so scary Moderator

    Mar 5, 2010
    Likes Received:
    Dude, this is awesome! I will definitely be referencing this and referring folks to it. Great post! Thank you.
  3. Frisco

    Frisco =Luceat Lux Vestra= VIP Member

    Jan 19, 2010
    Likes Received:
    Now that rooting is not just a fringe group of geeky types or brave adventuring souls, SetCPU will be seeing a lot of use.. especially as Froyo becomes better and better developed and finds its way into more Erises.

    Good to have that in here, thetomlin2.
  4. lukesdiesel

    lukesdiesel Well-Known Member

    Jun 13, 2010
    Likes Received:
    Awsome Post
  5. Peter123

    Peter123 Well-Known Member

    Nov 20, 2009
    Likes Received:
    Sticky it!
    lukesdiesel likes this.

Share This Page