[Galaxy S II Original Android Development] bgx:
Hello out there!

Have tweaked fenomeno83 script to my supposes! Means when battery falls under 50% the stepping is changed! In interaction with tasker I have a time profil for the night where stepping is changed too and after wake up stepping is rised to normal level.

Perhabs somebody find it useful and want do use it to?

Here my tweaked script:

#!/system/bin/sh

#CPU Frequencies
AWAKE_MIN="25000"
AWAKE_MAX="1000000"
AWAKE_LOW="800000"
AWAKE_GOV="lulzactive"

SLEEP_MIN="25000"
SLEEP_MAX="500000"
SLEEP_GOV="conservative"

#CPU Frequency
FREQ_MANUAL="true"
FREQ_STEP_1="1600"
FREQ_STEP_2="1400"
FREQ_STEP_3="1200"
FREQ_STEP_4="1000"
FREQ_STEP_5="800"
FREQ_STEP_6="500"
FREQ_STEP_7="200"
FREQ_STEP_8="25"
FREQLOW_STEP_1="1401"
FREQLOW_STEP_2="1201"
FREQLOW_STEP_3="1001"
FREQLOW_STEP_4="801"
FREQLOW_STEP_5="650"
FREQLOW_STEP_6="350"
FREQLOW_STEP_7="150"
FREQLOW_STEP_8="25"

#Misc
PROFILE="true"
LOGFILE="/sdcard/external_sd/sysvalues.log"
LOGMODE="1" # Logmode 0=Console only | 1=Startup | 2=Every Change #

#================================================= ===============================================#

if [ -f $LOGFILE ] ; then
rm -f $LOGFILE
fi
if [ "$LOGMODE" = "1" ] || [ "$LOGMODE" = "2" ] ; then
touch $LOGFILE
fi
###########################
# Setting CPU Frequencies #
###########################
if [ "$FREQ_MANUAL" = "true" ] ; then
if [ "$LOGMODE" = "1" ] || [ "$LOGMODE" = "2" ] ; then
echo "Set Frequency Table" | tee -a $LOG_FILE;
fi
echo "Set Frequency Table"
echo $FREQ_STEP_1" "$FREQ_STEP_2" "$FREQ_STEP_3" "$FREQ_STEP_4" "$FREQ_STEP_5" "$FREQ_STEP_6" "$FREQ_STEP_7" "$FREQ_STEP_8 > /sys/devices/system/cpu/cpu0/cpufreq/freq_table
fi
echo "Setting CPU to "$AWAKE_MIN"-"$AWAKE_MAX
echo $AWAKE_MIN > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo $AWAKE_MAX > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
####################
# Setting Governor #
####################
echo $AWAKE_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
####################
# Setting BusSpeed #
####################
echo "enabled" > /sys/devices/system/cpu/cpu0/cpufreq/busfreq_static
echo "0 0 0 0 1 2 2 2" > /sys/devices/system/cpu/cpu0/cpufreq/busfreq_static
####################
# Starting Profile #
####################
if [ "$PROFILE" = "true" ]; then
if [ "$LOGMODE" = "1" ] || [ "$LOGMODE" = "2" ] ; then
echo `date +%X`" - Profile activated" | tee -a $LOGFILE
fi
echo "Profile activated"
(while [ 1 ] ; do
AWAKE=`cat /sys/power/wait_for_fb_wake`
LOWFREQUENCY=`cat /sys/devices/system/cpu/cpu0/cpufreq/freq_table | cut -c1-4`
if [ "$LOWFREQUENCY" = "1400" ]; then
AWAKE_MIN="25000"
AWAKE_MAX="800000"
AWAKE_LOW="648000"
SLEEP_MIN="25000"
SLEEP_MAX="350000"
else
AWAKE_MIN="25000"
AWAKE_MAX="1000000"
AWAKE_LOW="800000"
SLEEP_MIN="25000"
SLEEP_MAX="500000"
fi
if [ "$AWAKE" = "awake" ]; then
chmod 644 /sys/devices/system/cpu/cpu1/online
echo "1" > /sys/devices/system/cpu/cpu1/online
chmod 444 /sys/devices/system/cpu/cpu1/online
echo $AWAKE_MIN > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
BAT=`dumpsys battery | grep 'level' | cut -c10-12`
if [ "$BAT" -lt "50" ]; then
echo $AWAKE_LOW > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
else
echo $AWAKE_MAX > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
fi
echo $AWAKE_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
fi
SLEEPING=`cat /sys/power/wait_for_fb_sleep`
if [ "$SLEEPING" = "sleeping" ]; then
chmod 644 /sys/devices/system/cpu/cpu1/online
echo "0" > /sys/devices/system/cpu/cpu1/online
chmod 444 /sys/devices/system/cpu/cpu1/online
echo $SLEEP_MIN > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo $SLEEP_MAX > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo $SLEEP_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

fi
done &)
fi