new set speed script for bugless!

Discussion in 'Bugless' started by Se7enLC, Jun 10, 2010.

  1. Se7enLC
    Offline

    Se7enLC Active Member

    Joined:
    Nov 16, 2009
    Messages:
    1,262
    Likes Received:
    0
    Trophy Points:
    36
    Ratings:
    +0
    NOTE: BuglessBeast Experimental Froyo 0.2.1 now does automatic Max frequency scaling using the same method I use here! If you just want it to always scale to the max supported and min speed of 250Mhz using the ondemand governor, there is no need to use this script. If you want to adjust the speed and have those changes persist after a reboot, however, read on...

    I wrote a little script to make it easier to adjust the maximum frequency scaling without using SetCPU. USE AT YOUR OWN RISK, THIS IS A WORK IN PROGRESS! That being said, I'm writing it to be as robust as possible, so it shouldn't screw anything up. Let me know if it does, I'll fix it.

    You can use this script to easily switch your maximum and minimum speed, as well as governor.

    To install:
    First, copy setspeed.txt to your sd card. I'm assuming you put it in the root and called it "setspeed.txt"
    Code:
    su
    sh /sdcard/setspeed.txt
    
    Once you have done this, you can delete the file off the sdcard if you like. On the first run, it will install itself into /system/xbin/setspeed, create links for the setmax, setmin, and setgov commands, and install itself into the startup script install-recovery.sh

    How To Use:
    To set your max speed, type "setmax 600" or "setmax 800" or whatever speed you want. If you type "setmax" by itself, it will list off your available speeds, including the virtual speed of "max", which will automatically determine the maximum supported speed and set that.

    To set your min speed, it's the same as setting the maximum, but with "setmin", and with the virtual speed of "min" in addition to normal speeds.

    To set your governor, type "setgov ondemand" or "setgov conservative". Those are probably the only governors you will want to play with. powersave, performance, and userspace really don't make sense to use on the droid.

    With any of these three settings, your choice will be applied immediately and saved and re-applied on every reboot.

    NOTE: When you are plugged into AC, the Droid will ignore any frequency scaling settings below 500Mhz, so don't be alarmed if it just sits at 500 instead of scaling down to 400,250,125, etc.
    NOTE: You can set unsupported speeds as the minimum. The Droid will scale down to whatever step is equal to or greater than that minimum.
    NOTE: Tested with BB Froyo 0.1, 0.2, and 0.2.1, and it works with all of them

    ChangeLog
    3.2
    Fixed a bug where setmin wasn't working at all
    3.1
    Script has been updated to work with BB 0.3 - the busybox binary was moved to /system/bin
    3.0
    Script is now "setspeed", supports governors, and is easier to use.
    2.0
    Added md5sum check so that new versions will auto-install and overwrite when you install them.
    1.9
    Fixed a bug where filenames that end with a non-integer (ie, things with a .txt extension) won't run. Invalid speeds are now replaced with "600".
    1.8
    Script is now self-installing. speed000 will now set the maximum speed at boot time, rather than storing the maximum speed to set at boot time.
    1.7

    Now allows you to optionally specify a minimum frequency as well, by typing it on the command-line after the script. "speed600 250" will set the max to 600, and the minimum to 250. The minimum will also be restored on a reboot.
     
    Last edited: Jun 30, 2010
  2. chadamir
    Offline

    chadamir Member

    Joined:
    May 23, 2010
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +0
    This is great, but I can't find the /system/xbin/pete file.
     
  3. Se7enLC
    Offline

    Se7enLC Active Member

    Joined:
    Nov 16, 2009
    Messages:
    1,262
    Likes Received:
    0
    Trophy Points:
    36
    Ratings:
    +0
    The BB Froyo release candidate doesn't have that script - previous BB releases do, and I assume future froyo releases will, eventually, as well.
     
  4. actngrezy
    Offline

    actngrezy Active Member Developer

    Joined:
    Mar 21, 2010
    Messages:
    1,074
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    delaware
    Ratings:
    +2
    Thats awesome. You could help me in my scripting class lol. but im sorry how do you create a symlink. Sorry for the newb question
     
  5. budmonster
    Online

    budmonster Guest

    Ratings:
    +0
    so this doesnt work on froyo yet, correct? could you take the pete script from bb v1.1 and place it in the xbin folder on froyo bb?
     
  6. Se7enLC
    Offline

    Se7enLC Active Member

    Joined:
    Nov 16, 2009
    Messages:
    1,262
    Likes Received:
    0
    Trophy Points:
    36
    Ratings:
    +0
    It does work on froyo - it just doesn't set the CPU speed on bootup. Setting the max CPU speed in real time works fine - once you run that command, your CPU will be set until the next reboot.

    You could take the pete script from 1.1, but I don't think it will execute on boot. If it did, I suspect pete would have put it there himself :)

    EDIT: Oh, clever! Pete stuck the contents of his script into install-recovery.sh. That script gets run automatically on every boot, regardless of kernel!

    To apply the change to allow my speedXXX scripts to work, you will want to edit that file. Look for this line:
    Code:
    echo "800000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
    
    and replace it with this:
    Code:
    cat /system/etc/bb_scaling_max_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
    
     
    Last edited: Jun 10, 2010
  7. Se7enLC
    Offline

    Se7enLC Active Member

    Joined:
    Nov 16, 2009
    Messages:
    1,262
    Likes Received:
    0
    Trophy Points:
    36
    Ratings:
    +0
    I had a few examples in the first post right after the part where I said you need to make the symlinks :)
     
  8. budmonster
    Online

    budmonster Guest

    Ratings:
    +0
    Do you have GTALK? I might need some help on this...

    BTW, what is the benefit of using this rather than just removing Petes script and just using setCPU?
     
  9. czerdrill
    Offline

    czerdrill Silver Member

    Joined:
    Jan 2, 2010
    Messages:
    4,825
    Likes Received:
    12
    Trophy Points:
    153
    Ratings:
    +12
    gotta love grep
     
  10. Se7enLC
    Offline

    Se7enLC Active Member

    Joined:
    Nov 16, 2009
    Messages:
    1,262
    Likes Received:
    0
    Trophy Points:
    36
    Ratings:
    +0
    I just uploaded a new version to the first post - it will automatically modify the startup script once you run it the first time. How's that for snazzy?

    Honestly, I'm not sure what the benefit really is. SetCPU supposedly uses a lot of unnecessary resources, whereas setting your max scaling frequency on boot uses NO resources.
     
  11. Se7enLC
    Offline

    Se7enLC Active Member

    Joined:
    Nov 16, 2009
    Messages:
    1,262
    Likes Received:
    0
    Trophy Points:
    36
    Ratings:
    +0
    You sed it!

    (ohh, I went there....)
     
  12. kodiak799
    Offline

    kodiak799 Silver Member

    Joined:
    Feb 20, 2010
    Messages:
    4,961
    Likes Received:
    283
    Trophy Points:
    198
    Ratings:
    +293
    According to Systempanel, the SetCPU service uses 9.0mgs of active memory.

    I run a lot of widgets, so getting rid of unnecessary/redundant services is key for me.

    Going to try your script. Thanks!
     
  13. Se7enLC
    Offline

    Se7enLC Active Member

    Joined:
    Nov 16, 2009
    Messages:
    1,262
    Likes Received:
    0
    Trophy Points:
    36
    Ratings:
    +0
    If anyone is using this script, please let me know if it's working for you and what you think of it! The latest version is auto-installing, all you have to do is run it and it will automatically generate the rest of the necessary speedXXX scripts for you.
     
  14. FSRBIKER
    Offline

    FSRBIKER Member

    Joined:
    Dec 12, 2009
    Messages:
    645
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oak Ridge, NJ
    Ratings:
    +0
    So download the file to the SD card and rename it to speed600(no extension) and then using Terminal Emulator type this:
    sysrw
    cp /sdcard/speed000 /system/xbin
    chmod 755 /system/xbin/speed000
    speed000
    Now anytime I install a new kernel it will automatically use Pete's autoscaling script up to the max of the installed kernel?
    Does this file need to be on the root of the SD card or can it be in a folder?
     
  15. YellowTwo
    Offline

    YellowTwo New Member

    Joined:
    Feb 4, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Santa Barbara, CA
    Ratings:
    +0
    More speed options would be nice. It generates 700mhz then jumps up to 1000mhz... Thanks!
     
Search tags for this page
android /sys/devices/system/cpu/cpu0/cpufreq/scaling max fre
,
android connectbot set min freq
,
android cpu scaling
,

droid 4 speedscript

,
manually set android governor minimum frequency
,
scaling setspeed unsupported android problem
,
scripts android scalling cpu max
,
set min frequency script android
,
setting cpu speed
,

speed scripts for android