DroidForums.net is the original Verizon Android Forum! Registered Users do not see these ads. Please Register - It's Free!

Thread: new set speed script for bugless!

1. Droid Ninja
Member #
5148
Join Date
Nov 2009
Posts
1,263
Liked
6 times
Phone
Samsung Galaxy Nexus

new set speed script for bugless!

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 by Se7enLC; 06-30-2010 at 10:00 AM.
Join Date
Nov 2008
Location
DroidForums.net

3. Droid
Member #
71070
Join Date
May 2010
Posts
38
Phone
Enter Current Phone Model Here
This is great, but I can't find the /system/xbin/pete file.
4. Droid Ninja
Member #
5148
Join Date
Nov 2009
Posts
1,263
Liked
6 times
Phone
Samsung Galaxy Nexus
This is great, but I can't find the /system/xbin/pete file.
The BB Froyo release candidate doesn't have that script - previous BB releases do, and I assume future froyo releases will, eventually, as well.
5. Developer
Member #
49451
Join Date
Mar 2010
Location
delaware
Posts
1,069
Liked
27 times
Phone
motorola droid
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
6. budmonster
Guest
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?
7. Droid Ninja
Member #
5148
Join Date
Nov 2009
Posts
1,263
Liked
6 times
Phone
Samsung Galaxy Nexus
Originally Posted by budmonster
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?
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 by Se7enLC; 06-10-2010 at 09:49 PM.
8. Droid Ninja
Member #
5148
Join Date
Nov 2009
Posts
1,263
Liked
6 times
Phone
Samsung Galaxy Nexus
Originally Posted by actngrezy
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
I had a few examples in the first post right after the part where I said you need to make the symlinks :-)
9. budmonster
Guest
Originally Posted by Se7enLC
Originally Posted by budmonster
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?
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
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?
10. Droid Sensei
Member #
22335
Join Date
Jan 2010
Posts
4,850
Liked
103 times
Phone
OG Droid UD 3.0 -- GB :)
Originally Posted by Se7enLC
Originally Posted by budmonster
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?
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
gotta love grep
11. Droid Ninja
Member #
5148
Join Date
Nov 2009
Posts
1,263
Liked
6 times
Phone
Samsung Galaxy Nexus
Originally Posted by budmonster
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?
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.
Page 1 of 8 1 2 3 ... Last

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

,
,
,
,
,
,

,

,
,
,
,
,

,
,