I was perusing the internets and found a init.d script to change governors based on screen state and I thought "Maybe I can take this one step further."
I originally made it just for a new Bionic Blurry JB update, but then figured I should share it with all of you!
*This script will only set CPU frequencies if Tweakerz OC Modules are installed*
*This script is currently set up with Stock Bionic frequencies.*
What does the script do?
It automatically changes the governor, scheduler, and CPU frequencies based on screen state, current battery level, and battery state. It originally had a CPU slot # check, but the razr doesnt have that problem so I removed it.
How does it work?
Note: There is a 10 second timer when the screen turns off. If turned back on within 10 seconds, it will not apply the screen off frequencies.Infinite While Loop
Battery Discharging
Battery percentage greater than 15%
Screen On
If CPU Slots = 5
Set CPU Frequencies to (300,600,800,1000,1200)
If CPU Slots = 4
Set CPU Frequencies to (300,600,800,1000)
Set Governor to HotplugX
Set Scheduler to Noop
Screen Off
If CPU Slots = 5
Set CPU Frequencies to (300,350,450,525,600)
If CPU Slots = 4
Set CPU Frequencies to (300,400,500,600)
Set Governor to PegasusQ
Set Scheduler to SIO
Battery percentage less than or equal to 15%
Screen On
If CPU Slots = 5
Set CPU Frequencies to (300,450,600,800,1000)
If CPU Slots = 4
Set CPU Frequencies to (300,475,650,800)
Set Governor to PegasusQ
Set Scheduler to SIO
Screen Off
If CPU Slots = 5
Set CPU Frequencies to (300,350,450,525,600)
If CPU Slots = 4
Set CPU Frequencies to (300,400,500,600)
Set Governor to PegasusQ
Set Scheduler to SIO
Battery Charging
Screen On
If CPU Slots = 5
Set CPU Frequencies to (300,600,800,1000,1200)
If CPU Slots = 4
Set CPU Frequencies to (300,600,800,1000)
Set Governor to HotplugX
Set Scheduler to Noop
Screen Off
If CPU Slots = 5
Set CPU Frequencies to (300,350,450,525,600)
If CPU Slots = 4
Set CPU Frequencies to (300,400,500,600)
Set Governor to PegasusQ
Set Scheduler to SIO
End Infinite While Loop
*Its purposely set up to underclock the phone when less than 15% to save battery life till you can get to a charger. Obviously this can be changed with some simple editing.*
What if I dont have the Tweakerz OC Modules Installed?
Dont fret, it will still work. Instead of having 300, 350, 450, 525, and 600Mhz as available frequencies when locked, itll only have 300 and 600Mhz when locked. It wont save as much battery, but itll save more than not having it. Youll have to edit the governor and scheduler options to match the ones that are installed with your rom.
Infinite While Loop... Isnt that bad for the CPU?
Traditionally yes, but this doesnt work like a traditional while loop. Thats because of the way /sys/power/wait_for_fb_wake and /sys/power/wait_for_fb_sleep work. Instead of just checking for the screen state, these files actually pause the script until that screen state is true. Basically, the script sets the awake profile then pauses until the screen turns off. Then it tries to apply the sleep profile. If the sleep profile is applied successfully, it pauses the script until the screen turns back on. Then the process repeats.
Customization:
I tried to set the script up so its fairly easy to understand and customize to your needs. Remember to change the governor, scheduler, and CPU frequencies to match your needs.
Installation:
I would include a link to the tweakerz modules but it wont let me post URLs with under 10 posts
Download the script from below and place it in /system/etc/init.d on your phone and set permissions to 0755 and owner:group to 0:2000. Reboot, and enjoy!
Download:
Attachment at bottom of post
Script Code:
Code:
#!/system/bin/sh
#Custom CPU Profiles
#By MarkusMcNugen
##################################################################################
####################Load Tweakerz Modules and Set Permissions#####################
##################################################################################
# Load Modules
insmod /system/lib/modules/symsearch.ko
insmod /system/lib/modules/cpu_control.ko
insmod /system/lib/modules/sio-iosched.ko
insmod /system/lib/modules/cpufreq_interactiveX.ko
insmod /system/lib/modules/cpufreq_smartass2.ko
insmod /system/lib/modules/cpufreq_pegasusq.ko
insmod /system/lib/modules/cpufreq_boostedASS2.ko
insmod /system/lib/modules/cpufreq_hotplugX.ko
#Scheduler Permissions
chmod 777 /sys/block/mmcblk0/queue/scheduler
chmod 777 /sys/block/mmcblk1/queue/scheduler
##################################################################################
################################Start of options##################################
##################################################################################
###################AWAKE GOVERNORS####################
#AWAKE_GOVERNOR="boostedASSv2"
#AWAKE_GOVERNOR="ondemand"
AWAKE_GOVERNOR="hotplugx"
#AWAKE_GOVERNOR="interactive"
#AWAKE_GOVERNOR="interactiveX"
#AWAKE_GOVERNOR="performance"
#AWAKE_GOVERNOR="smartassV2"
#AWAKE_GOVERNOR="pegasusq"
#AWAKE_GOVERNOR="hotplug"
###################AWAKE SCHEDULERS###################
AWAKE_SCHEDULER="noop"
#AWAKE_SCHEDULER="deadline"
#AWAKE_SCHEDULER="cfq"
#AWAKE_SCHEDULER="sio"
###################SLEEP GOVERNORS####################
#SLEEP_GOVERNOR="boostedASSv2"
SLEEP_GOVERNOR="pegasusq"
#SLEEP_GOVERNOR="ondemand"
#SLEEP_GOVERNOR="hotplugx"
#SLEEP_GOVERNOR="interactive"
#SLEEP_GOVERNOR="interactiveX"
#SLEEP_GOVERNOR="hotplug"
#SLEEP_GOVERNOR="smartassV2"
#SLEEP_GOVERNOR="performance"
#SLEEP_GOVERNOR="userspace"
###################SLEEP SCHEDULERS####################
#SLEEP_SCHEDULER="noop"
#SLEEP_SCHEDULER="deadline"
#SLEEP_SCHEDULER="cfq"
SLEEP_SCHEDULER="sio"
###################BATTERY LIMIT####################
BATTERY_LIMIT="15"
##################4 or 5 SLOT CPU###################
grep -q "4" /proc/cpu_control/opp_table_current
CPUSLOT=$?
##################PAUSE VARIABLES###################
SCREEN_PAUSE=11
ALREADY_AWAKE=0
ALREADY_SLEEP=0
##################################################################################
#################################End of options###################################
##################################################################################
#Infinite while loop to make sure correct governor, scheduler, and frequencies always applied
while [ 1 ]
do
#Read the current battery status
BATTERY_STATE=`cat /sys/class/power_supply/battery/status`
##################################################################################
#####Function to set scheduler, governor, and frequencies based on variables######
##################################################################################
set_cpu_freq() {
if [ $BATTERY_STATE = "Discharging" ]; then
#Read the current battery percentage
BATTERY=`cat /sys/class/power_supply/battery/capacity`
####If current battery percentage greater then BATTERY_LIMIT apply awake and sleep profiles####
if [ $BATTERY -gt $BATTERY_LIMIT ]; then
if [ $ALREADY_AWAKE = 0 ]; then
AWAKE=`cat /sys/power/wait_for_fb_wake`
if [ $AWAKE = "awake" ]; then
awake_overblimit_freq
fi;
AWAKE=;
elif [ $ALREADY_SLEEP = 0 ]; then
SLEEPING=`cat /sys/power/wait_for_fb_sleep`
if [ $SLEEPING = "sleeping" ]; then
sleep_loop
fi;
SLEEP=;
fi;
####If current battery percentage less than or equal BATTERY_LIMIT apply awake and sleep profiles####
elif [ $BATTERY -le $BATTERY_LIMIT ]; then
if [ $ALREADY_AWAKE = 0 ]; then
AWAKE=`cat /sys/power/wait_for_fb_wake`
if [ $AWAKE = "awake" ]; then
awake_underblimit_freq
ALREADY_AWAKE=1
ALREADY_SLEEP=0
fi;
AWAKE=;
elif [ $ALREADY_SLEEP = 0 ]; then
SLEEPING=`cat /sys/power/wait_for_fb_sleep`
if [ $SLEEPING = "sleeping" ]; then
sleep_loop
fi;
SLEEP=;
fi;
fi;
##################################################
####If battery is charging then apply profiles####
##################################################
elif [ $BATTERY_STATE = "Charging" ]; then
if [ $ALREADY_AWAKE = 0 ]; then
AWAKE=`cat /sys/power/wait_for_fb_wake`
if [ $AWAKE = "awake" ]; then
awake_charge_freq
ALREADY_AWAKE=1
ALREADY_SLEEP=0
fi;
AWAKE=;
elif [ $ALREADY_SLEEP = 0 ]; then
SLEEPING=`cat /sys/power/wait_for_fb_sleep`
if [ $SLEEPING = "sleeping" ]; then
sleep_loop
fi;
SLEEP=;
fi;
BATTERY=;
fi;
}
##################################################################################
###############Function to Set Awake and Over Battery Limit Profile###############
##################################################################################
awake_overblimit_freq() {
###################AWAKE CPU FREQUENCY###################
if [ $CPUSLOT -eq "0" ]; then
echo 0 300 1025 > /proc/cpu_control/tweak_cpu
echo 1 600 1200 > /proc/cpu_control/tweak_cpu
echo 2 800 1325 > /proc/cpu_control/tweak_cpu
echo 3 1000 1388 > /proc/cpu_control/tweak_cpu
echo 4 1200 1398 > /proc/cpu_control/tweak_cpu
else
echo 0 300 1025 > /proc/cpu_control/tweak_cpu
echo 1 600 1200 > /proc/cpu_control/tweak_cpu
echo 2 800 1325 > /proc/cpu_control/tweak_cpu
echo 3 1000 1388 > /proc/cpu_control/tweak_cpu
fi;
###################AWAKE CPU GOVERNOR####################
echo $AWAKE_GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
###################AWAKE CPU SCHEDULER###################
echo $AWAKE_SCHEDULER > /sys/block/mmcblk0/queue/scheduler
echo $AWAKE_SCHEDULER > /sys/block/mmcblk1/queue/scheduler
#####################GOVERNOR TWEAKS#####################
if [ -e /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold ]; then
echo "95" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold;
echo "1" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/io_is_busy;
echo "1" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_down_factor;
echo "10000" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate;
elif [ -e /sys/devices/system/cpu/cpu1/cpufreq/ondemand/up_threshold ]; then
echo "95" > /sys/devices/system/cpu/cpu1/cpufreq/ondemand/up_threshold;
echo "1" > /sys/devices/system/cpu/cpu1/cpufreq/ondemand/io_is_busy;
echo "1" > /sys/devices/system/cpu/cpu1/cpufreq/ondemand/sampling_down_factor;
echo "10000" > /sys/devices/system/cpu/cpu1/cpufreq/ondemand/sampling_rate;
elif [ -e /sys/devices/system/cpu/cpufreq/ondemand/up_threshold ]; then
echo "95" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold;
echo "1" > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy;
echo "1" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor;
echo "10000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate;
fi;
ALREADY_AWAKE=1
ALREADY_SLEEP=0
}
awake_underblimit_freq() {
###################AWAKE CPU FREQUENCY###################
if [ $CPUSLOT -eq "0" ]; then
echo 0 300 1025 > /proc/cpu_control/tweak_cpu
echo 1 450 1150 > /proc/cpu_control/tweak_cpu
echo 2 600 1200 > /proc/cpu_control/tweak_cpu
echo 3 800 1325 > /proc/cpu_control/tweak_cpu
echo 4 1000 1388 > /proc/cpu_control/tweak_cpu
else
echo 0 300 1025 > /proc/cpu_control/tweak_cpu
echo 1 475 1150 > /proc/cpu_control/tweak_cpu
echo 2 650 1225 > /proc/cpu_control/tweak_cpu
echo 3 800 1325 > /proc/cpu_control/tweak_cpu
fi;
###################AWAKE CPU GOVERNOR####################
echo $SLEEP_GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
###################AWAKE CPU SCHEDULER###################
echo $SLEEP_SCHEDULER > /sys/block/mmcblk0/queue/scheduler
echo $SLEEP_SCHEDULER > /sys/block/mmcblk1/queue/scheduler
#####################GOVERNOR TWEAKS#####################
if [ -e /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/up_threshold ]; then
echo "85" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/up_threshold;
echo "10" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/down_differential;
echo "1" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/io_is_busy;
echo "1" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/sampling_down_factor;
echo "20000" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/sampling_rate;
echo "100" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/freq_step;
echo "5" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/cpu_up_rate;
echo "20" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/cpu_down_rate;
echo "100000" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/freq_for_responsiveness;
elif [ -e /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/up_threshold ]; then
echo "85" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/up_threshold;
echo "10" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/down_differential;
echo "1" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/io_is_busy;
echo "1" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/sampling_down_factor;
echo "20000" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/sampling_rate;
echo "100" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/freq_step;
echo "5" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/cpu_up_rate;
echo "20" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/cpu_down_rate;
echo "100000" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/freq_for_responsiveness;
elif [ -e /sys/devices/system/cpu/cpufreq/pegasusq/up_threshold ]; then
echo "85" > /sys/devices/system/cpu/cpufreq/pegasusq/up_threshold;
echo "10" > /sys/devices/system/cpu/cpufreq/pegasusq/down_differential;
echo "1" > /sys/devices/system/cpu/cpufreq/pegasusq/io_is_busy;
echo "1" > /sys/devices/system/cpu/cpufreq/pegasusq/sampling_down_factor;
echo "20000" > /sys/devices/system/cpu/cpufreq/pegasusq/sampling_rate;
echo "100" > /sys/devices/system/cpu/cpufreq/pegasusq/freq_step;
echo "5" > /sys/devices/system/cpu/cpufreq/pegasusq/cpu_up_rate;
echo "20" > /sys/devices/system/cpu/cpufreq/pegasusq/cpu_down_rate;
echo "100000" > /sys/devices/system/cpu/cpufreq/pegasusq/freq_for_responsiveness;
fi;
ALREADY_AWAKE=1
ALREADY_SLEEP=0
}
awake_charge_freq() {
###################AWAKE CPU FREQUENCY###################
if [ $CPUSLOT -eq "0" ]; then
echo 0 300 1025 > /proc/cpu_control/tweak_cpu
echo 1 600 1200 > /proc/cpu_control/tweak_cpu
echo 2 800 1325 > /proc/cpu_control/tweak_cpu
echo 3 1000 1388 > /proc/cpu_control/tweak_cpu
echo 4 1200 1398 > /proc/cpu_control/tweak_cpu
else
echo 0 300 1025 > /proc/cpu_control/tweak_cpu
echo 1 600 1200 > /proc/cpu_control/tweak_cpu
echo 2 800 1325 > /proc/cpu_control/tweak_cpu
echo 3 1000 1388 > /proc/cpu_control/tweak_cpu
fi;
###################AWAKE CPU GOVERNOR####################
echo $AWAKE_GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
###################AWAKE CPU SCHEDULER###################
echo $AWAKE_SCHEDULER > /sys/block/mmcblk0/queue/scheduler
echo $AWAKE_SCHEDULER > /sys/block/mmcblk1/queue/scheduler
#####################GOVERNOR TWEAKS#####################
if [ -e /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/up_threshold ]; then
echo "85" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/up_threshold;
echo "10" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/down_differential;
echo "1" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/io_is_busy;
echo "1" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/sampling_down_factor;
echo "20000" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/sampling_rate;
echo "100" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/freq_step;
echo "5" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/cpu_up_rate;
echo "20" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/cpu_down_rate;
echo "100000" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/freq_for_responsiveness;
elif [ -e /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/up_threshold ]; then
echo "85" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/up_threshold;
echo "10" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/down_differential;
echo "1" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/io_is_busy;
echo "1" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/sampling_down_factor;
echo "20000" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/sampling_rate;
echo "100" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/freq_step;
echo "5" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/cpu_up_rate;
echo "20" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/cpu_down_rate;
echo "100000" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/freq_for_responsiveness;
elif [ -e /sys/devices/system/cpu/cpufreq/pegasusq/up_threshold ]; then
echo "85" > /sys/devices/system/cpu/cpufreq/pegasusq/up_threshold;
echo "10" > /sys/devices/system/cpu/cpufreq/pegasusq/down_differential;
echo "1" > /sys/devices/system/cpu/cpufreq/pegasusq/io_is_busy;
echo "1" > /sys/devices/system/cpu/cpufreq/pegasusq/sampling_down_factor;
echo "20000" > /sys/devices/system/cpu/cpufreq/pegasusq/sampling_rate;
echo "100" > /sys/devices/system/cpu/cpufreq/pegasusq/freq_step;
echo "5" > /sys/devices/system/cpu/cpufreq/pegasusq/cpu_up_rate;
echo "20" > /sys/devices/system/cpu/cpufreq/pegasusq/cpu_down_rate;
echo "100000" > /sys/devices/system/cpu/cpufreq/pegasusq/freq_for_responsiveness;
fi;
ALREADY_AWAKE=1
ALREADY_SLEEP=0
}
##################################################################################
###################Function to Initiate the 10 Second Sleep Timer#################
##################################################################################
sleep_loop() {
SEC_COUNT=0
while [ $SEC_COUNT -lt 10 ]
do
sleep 1
SEC_COUNT=$((SEC_COUNT+1))
####Write dumpsys of window policy to /data/governordumpsys####
dumpsys window policy > /data/governordumpsys
grep -q "mScreenOnFully=true" /data/governordumpsys
SCREEN=$?
####If /data/governordumpsys returns Screen On reset set_cpu_freq function and break counter####
if [ $SCREEN -eq "0" ]; then
ALREADY_AWAKE=0
ALREADY_SLEEP=0
set_cpu_freq
SCREEN=;
break
fi;
done
##################################################################################
###########################Function to Set Sleep Profile##########################
##################################################################################
sleep_set_freq() {
###################SLEEP CPU FREQUENCY###################
if [ $CPUSLOT -eq "0" ]; then
echo 0 300 1025 > /proc/cpu_control/tweak_cpu
echo 1 350 1087 > /proc/cpu_control/tweak_cpu
echo 2 450 1150 > /proc/cpu_control/tweak_cpu
echo 3 525 1187 > /proc/cpu_control/tweak_cpu
echo 4 600 1200 > /proc/cpu_control/tweak_cpu
else
echo 0 300 1025 > /proc/cpu_control/tweak_cpu
echo 1 400 1100 > /proc/cpu_control/tweak_cpu
echo 2 500 1175 > /proc/cpu_control/tweak_cpu
echo 3 600 1200 > /proc/cpu_control/tweak_cpu
fi;
###################SLEEP CPU GOVERNOR####################
echo $SLEEP_GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
###################SLEEP CPU SCHEDULER###################
echo $SLEEP_SCHEDULER > /sys/block/mmcblk0/queue/scheduler
echo $SLEEP_SCHEDULER > /sys/block/mmcblk1/queue/scheduler
#####################GOVERNOR TWEAKS#####################
if [ -e /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/up_threshold ]; then
echo "85" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/up_threshold;
echo "10" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/down_differential;
echo "1" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/io_is_busy;
echo "1" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/sampling_down_factor;
echo "20000" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/sampling_rate;
echo "100" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/freq_step;
echo "5" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/cpu_up_rate;
echo "20" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/cpu_down_rate;
echo "100000" > /sys/devices/system/cpu/cpu0/cpufreq/pegasusq/freq_for_responsiveness;
elif [ -e /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/up_threshold ]; then
echo "85" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/up_threshold;
echo "10" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/down_differential;
echo "1" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/io_is_busy;
echo "1" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/sampling_down_factor;
echo "20000" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/sampling_rate;
echo "100" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/freq_step;
echo "5" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/cpu_up_rate;
echo "20" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/cpu_down_rate;
echo "100000" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/freq_for_responsiveness;
elif [ -e /sys/devices/system/cpu/cpufreq/pegasusq/up_threshold ]; then
echo "85" > /sys/devices/system/cpu/cpufreq/pegasusq/up_threshold;
echo "10" > /sys/devices/system/cpu/cpufreq/pegasusq/down_differential;
echo "1" > /sys/devices/system/cpu/cpufreq/pegasusq/io_is_busy;
echo "1" > /sys/devices/system/cpu/cpufreq/pegasusq/sampling_down_factor;
echo "20000" > /sys/devices/system/cpu/cpufreq/pegasusq/sampling_rate;
echo "100" > /sys/devices/system/cpu/cpufreq/pegasusq/freq_step;
echo "5" > /sys/devices/system/cpu/cpufreq/pegasusq/cpu_up_rate;
echo "20" > /sys/devices/system/cpu/cpufreq/pegasusq/cpu_down_rate;
echo "100000" > /sys/devices/system/cpu/cpufreq/pegasusq/freq_for_responsiveness;
fi;
}
####Write dumpsys of window policy to /data/governordumpsys again####
dumpsys window policy > /data/governordumpsys
grep -q "mScreenOnFully=true" /data/governordumpsys
SCREEN=$?
####If /data/governordumpsys returns Screen Off start sleep_set_freq function####
if [ $SCREEN -eq "1" ]; then
sleep_set_freq
ALREADY_AWAKE=0
ALREADY_SLEEP=1
fi;
SCREEN=;
}
#####################Call set_cpu_freq Function#####################
set_cpu_freq
BATTERY_STATE=;
done
I see it says slot 5 one is set over clocked. My phone only allows 4 custom slots and stock ofc. Is ROM slot 4 considered 5? If not. Can I tweak the script so its love clocked in slot 4?
urbanski89 said:
I see it says slot 5 one is set over clocked. My phone only allows 4 custom slots and stock ofc. Is ROM slot 4 considered 5? If not. Can I tweak the script so its love clocked in slot 4?
Click to expand...
Click to collapse
After the ICS upgrade, some CPUs were upgraded to 5 slot cpus and set to 1.2Ghz as the default for the 5th slot. So technically its not overclocked, its the default frequency for a 5 slot. If I understand correctly you want to overclock your 4 slot CPU?
MarkusMcNugen said:
After the ICS upgrade, some CPUs were upgraded to 5 slot cpus and set to 1.2Ghz as the default for the 5th slot. So technically its not overclocked, its the default frequency for a 5 slot. If I understand correctly you want to overclock your 4 slot CPU?
Click to expand...
Click to collapse
Yes.
urbanski89 said:
Yes.
Click to expand...
Click to collapse
Alright, well Im assuming you have the tweakerz OC modules installed. If not google "Official OTA Overclock Modules" without the quotes. First result should be what you are looking for. Im not sure how much you intend to overclock your 4 slot, since they werent officially rated to be upgraded to a 5 slot at 1.2Ghz, but most people I know have had no problems OCing their 4 slots to 1.2.
Since I still cant link to outside urls due to my post count, despite running my own server... Ive attached a zip that has a OC governor. It will OC the CPU of anyone with a bionic running the tweakerz OC modules. 5 Slots will be OCed to 1.25Ghz, and 4 slots will be OCed to 1.2Ghz. Its the same script I use in the Blurry ROM.
If you need any more help just drop a comment.
SetCPU
Hello,
Can someone help me out. I have tried the SetCPU apps in search of any techniques to improve my battery life. I'm here but don't know what to do. I tried to download profiles and script from KTweak but then I stuck as I don't know how to set them to work. In fact, I have completely no idea how to go about playing around with it. Reading won't help since I'm very new to flashing roms and kernel and above all Android.
I'm desperate to solve my battery issue so if anyone can help me I would very grateful. My phone is galaxy s4 gt-i9505.
Thanks.
This is actually built for the Motorola Droid Bionic on an early ICS build I believe. You need to head over to the s4 forum and check there. Battery life is affected by many things, maybe try turning your brightness down for starters while your reading the forums. Good luck
Sent from my XT875 using Tapatalk 2
Related
build.prop is a nice file in our awesome open source OS which can be used to various more awesome purposes and purposely to fool your friends with your android version(if u know what i mean)
How to reach build.prop
1. Get a explorer with root explorer availabliltiy (eg root explorer, es file explorer)
2. Go to system/ and find build.prop file
3. Open and edit!:good:
Note
For larger edits, copy the file to your computer and open with notepad++. Overwrite the new file with previous one on your phone, change permissions to rw,r,r and reboot!
Simple changes
ro.build.display.id=Simplicity V5 Rom (Your ROM name)
ro.build.version.release=2.3.6 (Android version number)
For people porting ROMs and encountering resolution problems
Find this in build.prop
ro.sf.lcd_density=160
You'll have a value other than "160" (most probably this value would be "120")
Change it to 160
You can set different values and see changes(you might like it) but certain apps will crash!
ADDITIONAL TWEAKS:good:
Can be included in ROMs and patches!
Add the tweaks in the end and save the file
debug.sf.nobootanimation = 1
Disable boot animation (faster boot time)
ro.HOME_APP_ADJ = 1
force home launcher into memory(use light launchers only)
windowsmgr.max_events_per_sec=84
ro.max.fling_velocity=12000
ro.min.fling_velocity=8000
More smooth scrolling. The value of windowsmgr.max_events_per_sec can be experimented with. share your results if possible(try 150!)
logcat.live=disable
Disable logcat
ro.telephony.call_ring.delay=0
Decrease dialing out delay
ring.delay=0
Decrease ringing delay
ro.mot.buttonlight.timeout=0
Key lights stay on while screen is on.
profiler.force_disable_err_rpt=1
profiler.force_disable_ulog=1
Disables error reports.
debug.sf.hw = 1
Render UI with GPU
dalvik.vm.heapsize = 64m
Set size of Dalvik VM heap (how much RAM each instance of the VM is allowed); depending on how much RAM that is available to a device, this can be increased.
NOTE: 64m is ideal for our device, experiment at your own risk! Increasing vm heapsize might increase performance in high end games but degrade in low end games!
persist.adb.notify=0
Disable notification while adb is active
ro.config.hwfeature_wakeupkey=0
Phone will not wake up from hitting volume rocker.
ro.config.hw_quickpoweron=true
persist.sys.shutdown.mode=hibernate
dev.bootcomplete=0
Faster boot( disable bootanimation for more fast boot, alternatively can use hot boot)
ro.lge.proximity.delay=25
mot.proximity.delay=25
Disables blackscreen issue after a call.
ro.ril.power_collapse=1
pm.sleep_mode=1
wifi.supplicant_scan_interval=120
ro.mot.eri.losalert.delay=1000 (might break tethering)
Saves battery. wifi supplicant sets time interval (in sec) for scanning of available wifi networks. Change value accordingly!
Use custom kernel and scripts for best battery performance.
Also signal/3G tweaks may create problems with different country carries
For 3G tweaks, i suggest use this app, it worked like charm for me!
https://play.google.com/store/apps/...DEsInByb3Zpc2lvbi5uZXRzcGVlZC5vcHRpbWl6ZXIiXQ..
Thanks to dark_knight35
I'll find and add more tweaks soon...:good:
Reserved
{ Powersave Tweaks }
ro.ril.disable.power.collapse=0
pm.sleep_mode=1
{ Rapid Boot Tweaks }
debug.sf.nobootanimation=0
persist.sys.shutdown.mode=hibernate
{ Mobile BRAVIA® Engine Activator }
ro.service.swiqi.supported=true
persist.service.swiqi.enable=1
{ xLOUD™ Sound Enhancement Technology Enabler }
ro.semc.sound_effects_enabled=true
ro.semc.xloud.supported=true
persist.service.xloud.enable=1
{ 3G Tweaks }
ro.ril.hsxpa=2
ro.ril.gprsclass=10
ro.ril.hsdpa.category=10
ro.ril.hsupa.category=5
ro.ril.enable.a53=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.enable.3g.prefix=1
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.rill.enable.a53=1
{ Network }
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
{JPEG or image quality }
ro.media.dec.jpeg.memcap=20000000
ro.media.enc.jpeg.quality=100
{ Proximity, telephony tweaks }
ro.telephony.call_ring.delay=0
mot.proximity.delay=0
{ Battery tweaks }
debug.performance.tuning=1
video.accelerate.hw=1
windowsmgr.max_events_per_sec=150
wifi.supplicant_scan_interval=180
{ Performance tweaks }
persist.sys.purgeable_assets=1
dalvik.vm.dexopt-flags=m=y
ro.kernel.android.checkjni=0
persist.adb.notify=0
ro.config.hw_menu_unlockscreen=false
persist.sys.use_dithering=0
ro.mot.eri.losalert.delay=1000
{ Megabass Beats activator }
ro.service.swiqi.supported=true
persist.service.swiqi.enable=1
{ Faster Scrolling tweaks }
ro.max.fling_velocity=12000
ro.min.fling_velocity=8000
{ camera }
ro.media.enc.hprof.file.format=3gp
ro.media.enc.lprof.file.format=3gp
ro.media.enc.hprof.codec.vid=m4v
ro.media.enc.lprof.codec.vid=h263
ro.media.enc.hprof.codec.aud=aac
ro.media.enc.lprof.codec.aud=amrnb
ro.media.enc.hprof.vid.width=352
ro.media.enc.lprof.vid.width=176
ro.media.enc.hprof.vid.height=288
ro.media.enc.lprof.vid.height=144
ro.media.enc.hprof.vid.fps=30
ro.media.enc.lprof.vid.fps=30
ro.media.enc.hprof.vid.bps=384000
ro.media.enc.lprof.vid.bps=192000
ro.media.enc.hprof.aud.bps=23450
ro.media.enc.lprof.aud.bps=23450
ro.media.enc.hprof.aud.ch=1
ro.media.enc.lprof.aud.ch=1
ro.media.enc.hprof.aud.hz=8000
ro.media.enc.lprof.aud.hz=8000
ro.media.cam.preview.fps=15
{ MEMORY MANAGEMENT TWEAKS }
ro.FOREGROUND_APP_MEM=1536
ro.VISIBLE_APP_MEM=2048
ro.PERCEPTIBLE_APP_MEM=1024
ro.HEAVY_WEIGHT_APP_MEM=5632
ro.SECONDARY_SERVER_MEM=5632
ro.BACKUP_APP_MEM=6144
ro.HOME_APP_MEM=1024
ro.HIDDEN_APP_MEM=6144
ro.EMPTY_APP_MEM=7168
{ OUT OF MEMORY ADJUSTMENT SETTINGS }
ro.FOREGROUND_APP_ADJ=0
ro.VISIBLE_APP_ADJ=4
ro.PERCEPTIBLE_APP_ADJ=2
ro.HEAVY_WEIGHT_APP_ADJ=5
ro.SECONDARY_SERVER_ADJ=6
ro.BACKUP_APP_ADJ=7
ro.HOME_APP_ADJ=1
ro.HIDDEN_APP_MIN_ADJ=8
ro.EMPTY_APP_ADJ=15
{ KERNEL TWEAKS }
echo "8" > /proc/sys/vm/page-cluster;
echo "64000" > /proc/sys/kernel/msgmni;
echo "64000" > /proc/sys/kernel/msgmax;
echo "10" > /proc/sys/fs/lease-break-time;
echo 500 512000 64 2048 > /proc/sys/kernel/sem;
{ Bravia service enabled }
ro.service.swiqi2.supported=true
persist.service.swiqi2.enable=1
{ Dalvik VM tweaks }
echo "4096" > /proc/sys/vm/min_free_kbytes
echo "0" > /proc/sys/vm/oom_kill_allocating_task
echo "0" > /proc/sys/vm/panic_on_oom
echo "0" > /proc/sys/vm/laptop_mode
echo "0" > /proc/sys/vm/swappiness
echo "50" > /proc/sys/vm/vfs_cache_pressure
echo "90" > /proc/sys/vm/dirty_ratio
echo "70" > /proc/sys/vm/dirty_background_ratio
{ Battery tweaks }
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
{ Gpu ui renderer }
debug.sf.hw=1
{ SCROLLING RESPONSIVENESS TWEAKS }
windowsmgr.max_events_per_sec=150
{ DIALING RINGOUT DELAY }
ro.telephony.call_ring.delay=0
BRAVIA_HACK
ro.service.swiqi.supported = true
persist.service.swiqi.enable = 1
DEBUGGING NOTIFICATION DISABLER
persist.adb.notify=0
{ TOUCH RESPONSIVENESS TWEAKS }
debug.performance.tuning=1
video.accelerate.hw=1
{ APPLICATION FC FIXER }
ro.kernel.android.checkjni=0
{ WAKEUP KEY TWEAK }
ro.config.hwfeature_wakeupkey=0
{ BUTTON LIGHTS FORCED-ENABLER }
ro.mot.buttonlight.timeout=0
{ STAGEFRIGHT TWEAKS }
media.stagefright.enable-player=true
media.stagefright.enable-meta=true
media.stagefright.enable-scan=true
media.stagefright.enable-http=true
{ DISPLAY DITHERING ENABLER }
persist.sys.use_dithering=1
{ PURGEABLE ASSETS ENABLER }
persist.sys.purgeable_assets=1
{ SD CARD MOUNT SOUND DISABLER }
persist.service.mount.playsnd=0
WILL ADD MORE BUILD PROPS. AND A COUPLE OF TWEAK'S
DON'T FORGET TO PRESS THANKS BUTTON
puneeth.007 said:
{ Powersave Tweaks }
ro.ril.disable.power.collapse=0
pm.sleep_mode=1
{ Rapid Boot Tweaks }
debug.sf.nobootanimation=0
persist.sys.shutdown.mode=hibernate
{ Mobile BRAVIA® Engine Activator }
ro.service.swiqi.supported=true
persist.service.swiqi.enable=1
{ xLOUD™ Sound Enhancement Technology Enabler }
ro.semc.sound_effects_enabled=true
ro.semc.xloud.supported=true
persist.service.xloud.enable=1
{ 3G Tweaks }
ro.ril.hsxpa=2
ro.ril.gprsclass=10
ro.ril.hsdpa.category=10
ro.ril.hsupa.category=5
ro.ril.enable.a53=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.enable.3g.prefix=1
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.rill.enable.a53=1
{ Network }
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
{JPEG or image quality }
ro.media.dec.jpeg.memcap=20000000
ro.media.enc.jpeg.quality=100
{ Proximity, telephony tweaks }
ro.telephony.call_ring.delay=0
mot.proximity.delay=0
{ Battery tweaks }
debug.performance.tuning=1
video.accelerate.hw=1
windowsmgr.max_events_per_sec=150
wifi.supplicant_scan_interval=180
{ Performance tweaks }
persist.sys.purgeable_assets=1
dalvik.vm.dexopt-flags=m=y
ro.kernel.android.checkjni=0
persist.adb.notify=0
ro.config.hw_menu_unlockscreen=false
persist.sys.use_dithering=0
ro.mot.eri.losalert.delay=1000
{ Megabass Beats activator }
ro.service.swiqi.supported=true
persist.service.swiqi.enable=1
{ Faster Scrolling tweaks }
ro.max.fling_velocity=12000
ro.min.fling_velocity=8000
{ camera }
ro.media.enc.hprof.file.format=3gp
ro.media.enc.lprof.file.format=3gp
ro.media.enc.hprof.codec.vid=m4v
ro.media.enc.lprof.codec.vid=h263
ro.media.enc.hprof.codec.aud=aac
ro.media.enc.lprof.codec.aud=amrnb
ro.media.enc.hprof.vid.width=352
ro.media.enc.lprof.vid.width=176
ro.media.enc.hprof.vid.height=288
ro.media.enc.lprof.vid.height=144
ro.media.enc.hprof.vid.fps=30
ro.media.enc.lprof.vid.fps=30
ro.media.enc.hprof.vid.bps=384000
ro.media.enc.lprof.vid.bps=192000
ro.media.enc.hprof.aud.bps=23450
ro.media.enc.lprof.aud.bps=23450
ro.media.enc.hprof.aud.ch=1
ro.media.enc.lprof.aud.ch=1
ro.media.enc.hprof.aud.hz=8000
ro.media.enc.lprof.aud.hz=8000
ro.media.cam.preview.fps=15
{ MEMORY MANAGEMENT TWEAKS }
ro.FOREGROUND_APP_MEM=1536
ro.VISIBLE_APP_MEM=2048
ro.PERCEPTIBLE_APP_MEM=1024
ro.HEAVY_WEIGHT_APP_MEM=5632
ro.SECONDARY_SERVER_MEM=5632
ro.BACKUP_APP_MEM=6144
ro.HOME_APP_MEM=1024
ro.HIDDEN_APP_MEM=6144
ro.EMPTY_APP_MEM=7168
{ OUT OF MEMORY ADJUSTMENT SETTINGS }
ro.FOREGROUND_APP_ADJ=0
ro.VISIBLE_APP_ADJ=4
ro.PERCEPTIBLE_APP_ADJ=2
ro.HEAVY_WEIGHT_APP_ADJ=5
ro.SECONDARY_SERVER_ADJ=6
ro.BACKUP_APP_ADJ=7
ro.HOME_APP_ADJ=1
ro.HIDDEN_APP_MIN_ADJ=8
ro.EMPTY_APP_ADJ=15
{ KERNEL TWEAKS }
echo "8" > /proc/sys/vm/page-cluster;
echo "64000" > /proc/sys/kernel/msgmni;
echo "64000" > /proc/sys/kernel/msgmax;
echo "10" > /proc/sys/fs/lease-break-time;
echo 500 512000 64 2048 > /proc/sys/kernel/sem;
{ Bravia service enabled }
ro.service.swiqi2.supported=true
persist.service.swiqi2.enable=1
{ Dalvik VM tweaks }
echo "4096" > /proc/sys/vm/min_free_kbytes
echo "0" > /proc/sys/vm/oom_kill_allocating_task
echo "0" > /proc/sys/vm/panic_on_oom
echo "0" > /proc/sys/vm/laptop_mode
echo "0" > /proc/sys/vm/swappiness
echo "50" > /proc/sys/vm/vfs_cache_pressure
echo "90" > /proc/sys/vm/dirty_ratio
echo "70" > /proc/sys/vm/dirty_background_ratio
Battery tweaks
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
Gpu ui renderer
debug.sf.hw=1
{ SCROLLING RESPONSIVENESS TWEAKS }
windowsmgr.max_events_per_sec=150
{ DIALING RINGOUT DELAY }
ro.telephony.call_ring.delay=0
Click to expand...
Click to collapse
Many of these are included in OP!
perhaps read OP first!
Sent from mass relay
js2892 said:
Many of these are included in OP!
perhaps read OP first!
Sent from mass relay
Click to expand...
Click to collapse
I'd like zeppelinrox to see these MEM and OOM tweaks... Maybe these would conflict for those of us using V6 SuperCharger, Beast, B34ST, 63457, V63457 or Black Dog (Name it yourself )...
Furthermore, many of the tweaks explained here are put in effect by the aforementioned scripts... not all though, I don't think that it includes the Beats or the Bravia tweaks for instance.
I can't find this or should i add this in build.prop?
debug.sf.nobootanimation = 1
El_Dark said:
I'd like zeppelinrox to see these MEM and OOM tweaks... Maybe these would conflict for those of us using V6 SuperCharger, Beast, B34ST, 63457, V63457 or Black Dog (Name it yourself )...
Furthermore, many of the tweaks explained here are put in effect by the aforementioned scripts... not all though, I don't think that it includes the Beats or the Bravia tweaks for instance.
Click to expand...
Click to collapse
Nothing will conflict, they'll just be applied twice in the worse case scenario.
For the build.prop, Supercharger adds entries first and last IIRC. So these values will be ignored.
Also, Supercharger renames other init.d script automatically, so if there are any other init.d scripts that do the same, their values will also be unset.
---------- Post added at 10:49 PM ---------- Previous post was at 10:48 PM ----------
Flamestorm said:
I can't find this or should i add this in build.prop?
debug.sf.nobootanimation = 1
Click to expand...
Click to collapse
Just add it.
Error occurred when trying to save the file. It will not be saved. What should i do?
Just helping
Flamestorm said:
Error occurred when trying to save the file. It will not be saved. What should i do?
Click to expand...
Click to collapse
Yes add the script in build.prop and save the file.
how are you getting an error??
Everything is fine now that error was because i used es file explorer now with root browser is ok
Flamestorm said:
Error occurred when trying to save the file. It will not be saved. What should i do?
Click to expand...
Click to collapse
Ok, here's a tip - I've seen you do this before:
Be descriptive about your errors. What did you do? What are you using?
If you don't care about giving details, nobody will care about helping you in most cases.
Try to figure it out on your own first. Why is it not saving? Could you maybe not have root access? Because that's your problem, you either didn't give ES root access, or didn't enable root in its settings.
I forgot display id and want to revert to the original. on unknown brand Android.
js2892 said:
build.prop is a nice file in our awesome open source OS which can be used to various more awesome purposes and purposely to fool your friends with your android version(if u know what i mean)
How to reach build.prop
1. Get a explorer with root explorer availabliltiy (eg root explorer, es file explorer)
2. Go to system/ and find build.prop file
3. Open and edit!:good:
Note
For larger edits, copy the file to your computer and open with notepad++. Overwrite the new file with previous one on your phone, change permissions to rw,r,r and reboot!
Simple changes
ro.build.display.id=Simplicity V5 Rom (Your ROM name)
ro.build.version.release=2.3.6 (Android version number)
For people porting ROMs and encountering resolution problems
Find this in build.prop
ro.sf.lcd_density=160
You'll have a value other than "160" (most probably this value would be "120")
Change it to 160
You can set different values and see changes(you might like it) but certain apps will crash!
ADDITIONAL TWEAKS:good:
Can be included in ROMs and patches!
Add the tweaks in the end and save the file
debug.sf.nobootanimation = 1
Disable boot animation (faster boot time)
ro.HOME_APP_ADJ = 1
force home launcher into memory(use light launchers only)
windowsmgr.max_events_per_sec=84
ro.max.fling_velocity=12000
ro.min.fling_velocity=8000
More smooth scrolling. The value of windowsmgr.max_events_per_sec can be experimented with. share your results if possible(try 150!)
logcat.live=disable
Disable logcat
ro.telephony.call_ring.delay=0
Decrease dialing out delay
ring.delay=0
Decrease ringing delay
ro.mot.buttonlight.timeout=0
Key lights stay on while screen is on.
profiler.force_disable_err_rpt=1
profiler.force_disable_ulog=1
Disables error reports.
debug.sf.hw = 1
Render UI with GPU
dalvik.vm.heapsize = 64m
Set size of Dalvik VM heap (how much RAM each instance of the VM is allowed); depending on how much RAM that is available to a device, this can be increased.
NOTE: 64m is ideal for our device, experiment at your own risk! Increasing vm heapsize might increase performance in high end games but degrade in low end games!
persist.adb.notify=0
Disable notification while adb is active
ro.config.hwfeature_wakeupkey=0
Phone will not wake up from hitting volume rocker.
ro.config.hw_quickpoweron=true
persist.sys.shutdown.mode=hibernate
dev.bootcomplete=0
Faster boot( disable bootanimation for more fast boot, alternatively can use hot boot)
ro.lge.proximity.delay=25
mot.proximity.delay=25
Disables blackscreen issue after a call.
ro.ril.power_collapse=1
pm.sleep_mode=1
wifi.supplicant_scan_interval=120
ro.mot.eri.losalert.delay=1000 (might break tethering)
Saves battery. wifi supplicant sets time interval (in sec) for scanning of available wifi networks. Change value accordingly!
Use custom kernel and scripts for best battery performance.
Also signal/3G tweaks may create problems with different country carries
For 3G tweaks, i suggest use this app, it worked like charm for me!
https://play.google.com/store/apps/...DEsInByb3Zpc2lvbi5uZXRzcGVlZC5vcHRpbWl6ZXIiXQ..
Thanks to dark_knight35
I'll find and add more tweaks soon...:good:
Click to expand...
Click to collapse
Please help i want to revert back the original details in build.prop file.but forgotton the old entries,also i have cheap china unknown brand... is there any file in the system which keep original details to identify the phone.and its values in build.prop. Informationn on the back side of phone is not reliable..
mayank.rudolf said:
Please help i want to revert back the original details in build.prop file.but forgotton the old entries,also i have cheap china unknown brand... is there any file in the system which keep original details to identify the phone.and its values in build.prop. Informationn on the back side of phone is not reliable..
Click to expand...
Click to collapse
Original build.prop must to be in original firmware.
Get first original firmware.
Unzip. Is a .tar archive
Then open with an application the file that contains /system folder, the file name is system.rfs in S5830.
There is build.prop.
Right bit of a dev question - but I want to understand this further. On previous transformers the user could manually choose one of three performance modes - power saving, balanced or normal. THere were also two hidden modes that never got used. These were controlled by the cpu1.sh, cpu2.sh, cpu3.sh, cpu4.sh and cpu5.sh files.
On the TF700T this is done somewhat differently. It seems the system determines what performance is required on behalf of the user depending upon what they are doing.
Is there anyway of controlling this manually or does anyone know what triggers the selection?
They are:
power saving
normal
balanced
videoplay
web browsing
The files are made up like this:
pwr-saving.sh
Code:
#!/bin/sh -x
#This is pwr-saving mode!
echo 1 > /sys/module/cpu_tegra/parameters/system_mode
echo 1 > /sys/class/graphics/fb0/device/smartdimmer/enable
echo 25 > /sys/class/graphics/fb0/device/smartdimmer/aggressiveness
am broadcast -a asus.splendid.powersaver.intent.action.CHANGE_MODE --ei asus.splendid.powersaver.intent.extra.CHANGE_MODE 25
pwr-balance.sh
Code:
#!/bin/sh -x
#This is pwr-balance mode!
echo 1 > /sys/module/cpu_tegra/parameters/system_mode
echo 1 > /sys/class/graphics/fb0/device/smartdimmer/enable
echo 25 > /sys/class/graphics/fb0/device/smartdimmer/aggressiveness
am broadcast -a asus.splendid.powersaver.intent.action.CHANGE_MODE --ei asus.splendid.powersaver.intent.extra.CHANGE_MODE 25
pwr-normal.sh
Code:
#!/bin/sh -x
#This is pwr-normal mode!
echo 0 > /sys/module/cpu_tegra/parameters/system_mode
echo 0 > /sys/class/graphics/fb0/device/smartdimmer/enable
am broadcast -a asus.splendid.powersaver.intent.action.CHANGE_MODE --ei asus.splendid.powersaver.intent.extra.CHANGE_MODE 0
pwr-videoplay.sh
Code:
#!/bin/sh -x
#This is pwr-videoplay mode!
echo 1 > /sys/module/cpu_tegra/parameters/system_mode
echo 1 > /sys/class/graphics/fb0/device/smartdimmer/enable
echo 29 > /sys/class/graphics/fb0/device/smartdimmer/aggressiveness
am broadcast -a asus.splendid.powersaver.intent.action.CHANGE_MODE --ei asus.splendid.powersaver.intent.extra.CHANGE_MODE 29
pwr-web_browsing.sh
Code:
#!/bin/sh -x
#This is pwr-web_browsing mode!
echo 1 > /sys/module/cpu_tegra/parameters/system_mode
echo 1 > /sys/class/graphics/fb0/device/smartdimmer/enable
echo 25 > /sys/class/graphics/fb0/device/smartdimmer/aggressiveness
am broadcast -a asus.splendid.powersaver.intent.action.CHANGE_MODE --ei asus.splendid.powersaver.intent.extra.CHANGE_MODE 25
So I can see how to disable smartdimmer. Easy enough Agressiveness to 0 presumably to turn that off just in case.
But what would call these? I.e., how does the system know which is required. I'll have a look through the kernel to see if there is anything obvious. Anyone seen any documentation from nvidia on this? There is one final file called power.macallan.rc which also looks very interesting:
Code:
# FORMAT:
# panelresolution=[xres]X[yres], such as panelresolution=1280X720
# powernode1 normal balanced maxbatterylife
# powernode2 normal balanced maxbatterylife
# ......
# powernoden normal balanced maxbatterylife
# panelresolution=[xres]X[yres], such as panelresolution=1920X1080
# powernode1 normal balanced maxbatterylife
# powernode2 normal balanced maxbatterylife
# ......
# powernoden normal balanced maxbatterylife
# ......
# ......
# panelresolution=[xres]X[yres], such as panelresolution=1920X1200
# powernode1 normal balanced maxbatterylife
# powernode2 normal balanced maxbatterylife
# ......
# powernoden normal balanced maxbatterylife
#
# NOTES:
# The panelresolution is the lcd panel resolution.
# No space should exist in panelresolution=[xres]X[yres].
# panelresolution=720X1280 equals with panelresolution=1280X720.
# For panelresolution=-1X-1, it should be the last set of power settings in this file.
# When your panel resolution is found in this file,
# it will use the set of power settings followed by your panel resolution.
# When your panel resolution is not found in this file, it will use the default power settings.
# The power settings followed by panelresolution=-1X-1 is the default power settings.
# powernode is the sysfs or variable we need to write and it is followed by three ints.
# normal, balanced, maxbatterylife are the three ints for different power modes.
#
panelresolution=1920X1200
NV_FPSLIMIT 0 30 30
NV_MAX_CORES 0 0 2
/sys/module/cpu_tegra/parameters/cpu_user_cap 0 900000 900000
/sys/class/graphics/fb0/device/smartdimmer/aggressiveness 29 29 29
/sys/class/graphics/fb0/device/smartdimmer/enable 1 1 1
panelresolution=2560X1600
NV_FPSLIMIT 0 30 30
NV_MAX_CORES 0 0 2
/sys/module/cpu_tegra/parameters/cpu_user_cap 0 1000000 1000000
/sys/class/graphics/fb0/device/smartdimmer/aggressiveness 29 29 29
/sys/class/graphics/fb0/device/smartdimmer/enable 1 1 1
panelresolution=-1X-1
NV_FPSLIMIT 0 30 30
NV_MAX_CORES 0 0 2
/sys/module/cpu_tegra/parameters/cpu_user_cap 0 1000000 1000000
/sys/class/graphics/fb0/device/smartdimmer/aggressiveness 29 29 29
/sys/class/graphics/fb0/device/smartdimmer/enable 1 1 1
I have ASUS Fonepad Note 6
There is such files and smartdimmer does not work
The content of the file is quite another
https://www.dropbox.com/s/9k65kdmq5i8wjt4/pwr-balance-normal-saving-videplay-web.rar?dl=0
I also have ASUS Fonepad 8
Smartdimmer there is a big problem
but it only have
pwr-balance.sh
pwr-normal.sh
-------------------------------------
#!/bin/sh -x
#This is balance mode
echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo 1333000 > /sys/devices/system/cpu/cpufreq/interactive/touchboost_freq
echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/touchboostpulse_duration
echo 65 1000000:75 1500000:95 > /sys/devices/system/cpu/cpufreq/interactive/target_loads
------------------------------------
#!/bin/sh -x
#This is normal mode
echo 95 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
echo 1333000 > /sys/devices/system/cpu/cpufreq/interactive/touchboost_freq
echo 60000 > /sys/devices/system/cpu/cpufreq/interactive/touchboostpulse_duration
echo 45 1000000:65 1500000:90 > /sys/devices/system/cpu/cpufreq/interactive/target_loads
------------------------------------
Help me please.
I really want to disable SmartDimmer
This project sets Raspberry Pi on wheels (tracks in fact), allows to control tank remotely and get streamed video over internet.
Electronchik said:
This project sets Raspberry Pi on wheels (tracks in fact), allows to control tank remotely and get streamed video over internet.
Click to expand...
Click to collapse
Do you have a specific question about your project that you would like to ask?
How to set on raspberry pi 2 two pwm to control two motor ?
I have this code but one motor runing in 100% and one in ~ 60%
RobotControl.py
#!/usr/bin/python
# coding: utf-8
# Poczatek programu
import sys, tty, termios, os
import L298NHBridge as HBridge
speedleft = 0
speedright = 0
# Instrukcja wyswietlana uzytkownikowi
print("w/s: direction")
print("a/d: steering")
print("q: stops the motors")
print("p: print motor speed (L/R)")
print("x: exit")
# Przechwycenie przycisku wciśniętego przez uzytkownika
def getch():
import sys, tty, termios
old_settings = termios.tcgetattr(0)
new_settings = old_settings[:]
new_settings[3] &= ~termios.ICANON
try:
termios.tcsetattr(0, termios.TCSANOW, new_settings)
ch = sys.stdin.read(1)
finally:
termios.tcsetattr(0, termios.TCSANOW, old_settings)
return ch
print("\nchar is '" + getch() + "'\n")
# Inicjacja zapetlenia
# Zapetlenie zostaje przerwane, gdy uzytkownik wcisnie klawisz x
def printscreen():
os.system('clear')
print("w/s: direction")
print("a/d: steering")
print("q: stops the motors")
print("x: exit")
print("========== Speed Control ==========")
print("left motor: ", speedleft)
print("right motor: ", speedright)
print(char)
while True:
char = getch()
if(char == "\x1b[A"):
printscreen()
# Pojazd pojedzie do przodu, jesli uzytkownik wcisnie klawisz w
if(char == "w"):
# Synchronizacja predkosci silnikow
# Start pojazdu
speedleft = speedleft + 0.1
speedright = speedright + 0.1
if speedleft > 1:
speedleft = 1
if speedright > 1:
speedright = 1
HBridge.setMotorLeft(speedleft)
HBridge.setMotorRight(speedright)
printscreen()
# Pojazd pojedzie do tylu, jesli uzytkownik wcisnie klawisz w
if(char == "s"):
# Synchronizacja predkosci silnikow
# Obnizenie predkosci pojazdu
speedleft = speedleft - 0.1
speedright = speedright - 0.1
if speedleft < -1:
speedleft = -1
if speedright < -1:
speedright = -1
HBridge.setMotorLeft(speedleft)
HBridge.setMotorRight(speedright)
printscreen()
# Zatrzymanie silnikow
if(char == "q"):
speedleft = 0
speedright = 0
HBridge.setMotorLeft(speedleft)
HBridge.setMotorRight(speedright)
printscreen()
# Pojazd pojedzie w prawo, jesli uzytkownik wcisnie klawisz d
if(char == "d"):
speedright = speedright - 0.1
speedleft = speedleft + 0.1
if speedright < -1:
speedright = -1
if speedleft > 1:
speedleft = 1
HBridge.setMotorLeft(speedleft)
HBridge.setMotorRight(speedright)
printscreen()
# Pojazd pojedzie w lewo, jesli uzytkownik wcisnie klawisz a
if(char == "a"):
speedleft = speedleft - 0.1
speedright = speedright + 0.1
if speedleft < -1:
speedleft = -1
if speedright > 1:
speedright = 1
HBridge.setMotorLeft(speedleft)
HBridge.setMotorRight(speedright)
printscreen()
# Przerwanie wykonywania petli, zamkniecie programu i stop silnikow
if(char == "x"):
HBridge.setMotorLeft(0)
HBridge.setMotorRight(0)
HBridge.exit()
print("Program Ended")
break
# Wybrany przez uzytkownika klawisz zostaje zapisany jako pusty, jest to potrzebne
# do zapisania nastepnego wybranego przez uzytkownika klawisza
char = ""
# Koniec programu
Click to expand...
Click to collapse
L298NHbridge.py
# Import the libraries the class needs
import RPi.GPIO as io
import time
io.setmode(io.BCM)
# Constant values to set the max pwm speed.
# 40 will set the motor speed to 40% max.
PWM_MAX = 50
# Disable warning from GPIO
io.setwarnings(False)
# Motor Driver Dual H-Bridge connection configuration.
# Here you can change the wiring between the H-Bridge IN pins and the Raspberry Pi GPIO out pins.
# --- START CONFIG ---
# H-Bridge pin = GPIO
ENA = 4
IN1 = 27
IN2 = 22
IN3 = 24
IN4 = 25
ENB = 17
# --- END CONFIG ---
# Here we configure the GPIO settings for the left and right motors spinning direction.
# It defines the four GPIO pins used as input on the L298 H-Bridge to set the motor mode (forward, reverse and stopp).
leftmotor_in1_pin = IN1
leftmotor_in2_pin = IN2
io.setup(leftmotor_in1_pin, iUT)
io.setup(leftmotor_in2_pin, iUT)
rightmotor_in1_pin = IN3
rightmotor_in2_pin = IN4
io.setup(rightmotor_in1_pin, iUT)
io.setup(rightmotor_in2_pin, iUT)
io.output(leftmotor_in1_pin, False)
io.output(leftmotor_in2_pin, False)
io.output(rightmotor_in1_pin, False)
io.output(rightmotor_in2_pin, False)
# Here we configure the GPIO settings for the left and right motors spinning speed.
# It defines the two GPIO pins used as input on the L298 H-Bridge to set the motor speed with a PWM signal.
leftmotorpwm_pin = ENA
rightmotorpwm_pin = ENB
io.setup(leftmotorpwm_pin, iUT)
io.setup(rightmotorpwm_pin, iUT)
leftmotorpwm = io.PWM(leftmotorpwm_pin,100)
rightmotorpwm = io.PWM(rightmotorpwm_pin,100)
leftmotorpwm.start(0)
leftmotorpwm.ChangeDutyCycle(0)
rightmotorpwm.start(0)
rightmotorpwm.ChangeDutyCycle(0)
def setMotorMode(motor, mode):
# setMotorMode()
# Sets the mode for the L298 H-Bridge which motor is in which mode.
# This is a short explanation for a better understanding:
# motor -> which motor is selected left motor or right motor
# mode -> mode explains what action should be performed by the H-Bridge
# setMotorMode(leftmotor, reverse) -> The left motor is called by a function and set into reverse mode
# setMotorMode(rightmotor, stopp) -> The right motor is called by a function and set into stopp mode
if motor == "leftmotor":
if mode == "reverse":
io.output(leftmotor_in1_pin, True)
io.output(leftmotor_in2_pin, False)
elif mode == "forward":
io.output(leftmotor_in1_pin, False)
io.output(leftmotor_in2_pin, True)
else:
io.output(leftmotor_in1_pin, False)
io.output(leftmotor_in2_pin, False)
elif motor == "rightmotor":
if mode == "reverse":
io.output(rightmotor_in1_pin, False)
io.output(rightmotor_in2_pin, True)
elif mode == "forward":
io.output(rightmotor_in1_pin, True)
io.output(rightmotor_in2_pin, False)
else:
io.output(rightmotor_in1_pin, False)
io.output(rightmotor_in2_pin, False)
else:
io.output(leftmotor_in1_pin, False)
io.output(leftmotor_in2_pin, False)
io.output(rightmotor_in1_pin, False)
io.output(rightmotor_in2_pin, False)
def setMotorLeft(power):
# SetMotorLeft(power)
# Sets the drive level for the left motor, from +1 (max) to -1 (min).
# This is a short explanation for a better understanding:
# SetMotorLeft(0) -> left motor is stopped
# SetMotorLeft(0.75) -> left motor moving forward at 75% power
# SetMotorLeft(-0.5) -> left motor moving reverse at 50% power
# SetMotorLeft(1) -> left motor moving forward at 100% power
int(power)
if power < 0:
# Reverse mode for the left motor
setMotorMode("leftmotor", "reverse")
pwm = -int(PWM_MAX * power)
if pwm > PWM_MAX:
pwm = PWM_MAX
elif power > 0:
# Forward mode for the left motor
setMotorMode("leftmotor", "forward")
pwm = int(PWM_MAX * power)
if pwm > PWM_MAX:
pwm = PWM_MAX
else:
# Stopp mode for the left motor
setMotorMode("leftmotor", "stopp")
pwm = 0
leftmotorpwm.ChangeDutyCycle(pwm)
def setMotorRight(power):
# SetMotorRight(power)
# Sets the drive level for the right motor, from +1 (max) to -1 (min).
# This is a short explanation for a better understanding:
# SetMotorRight(0) -> right motor is stopped
# SetMotorRight(0.75) -> right motor moving forward at 75% power
# SetMotorRight(-0.5) -> right motor moving reverse at 50% power
# SetMotorRight(1) -> right motor moving forward at 100% power
int(power)
if power < 0:
# Reverse mode for the right motor
setMotorMode("rightmotor", "reverse")
pwm = -int(PWM_MAX * power)
if pwm > PWM_MAX:
pwm = PWM_MAX
elif power > 0:
# Forward mode for the right motor
setMotorMode("rightmotor", "forward")
pwm = int(PWM_MAX * power)
if pwm > PWM_MAX:
pwm = PWM_MAX
else:
# Stopp mode for the right motor
setMotorMode("rightmotor", "stopp")
pwm = 0
rightmotorpwm.ChangeDutyCycle(pwm)
def exit():
# Program will clean up all GPIO settings and terminates
io.output(leftmotor_in1_pin, False)
io.output(leftmotor_in2_pin, False)
io.output(rightmotor_in1_pin, False)
io.output(rightmotor_in2_pin, False)
io.cleanup()
Click to expand...
Click to collapse
Hello, I actually made one ,,tank,, when I was on school. Here is link with all instructions I used.
Hey everyone,
I recently installed Cm12.1 on my z3c and I can't get a gps lock ever. When using the app called gps status, I'm only getting an average of 4/20 satellite locks. Could someone be so kind and extract the /etc/gps.conf from your stock rom for me? The latest the better. Thank you!
i couldnt upload on phone please copy below and save as conf file
#Uncommenting these urls would only enable
#the power up auto injection and force injection(test case).
XTRA_SERVER_1=http://xtrapath1.izatcloud.net/xtra3grc.bin
XTRA_SERVER_2=http://xtrapath2.izatcloud.net/xtra3grc.bin
XTRA_SERVER_3=http://xtrapath3.izatcloud.net/xtra3grc.bin
#Version check for XTRA
#DISABLE = 0
#AUTO = 1
#XTRA2 = 2
#XTRA3 = 3
XTRA_VERSION_CHECK=0
# Error Estimate
# _SET = 1
# _CLEAR = 0
ERR_ESTIMATE=0
#Test
NTP_SERVER=time.gpsonextra.net
#Asia
# NTP_SERVER=asia.pool.ntp.org
#Europe
# NTP_SERVER=europe.pool.ntp.org
#North America
# NTP_SERVER=north-america.pool.ntp.org
# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info
# 4 - Debug, 5 - Verbose
# If DEBUG_LEVEL is commented, Android's logging levels will be used
DEBUG_LEVEL = 2
# Intermediate position report, 1=enable, 0=disable
INTERMEDIATE_POS=0
# Below bit mask configures how GPS functionalities
# should be locked when user turns off GPS on Settings
# Set bit 0x1 if MO GPS functionalities are to be locked
# Set bit 0x2 if NI GPS functionalities are to be locked
# default - non is locked for backward compatibility
#GPS_LOCK = 0
# supl version 2.0
SUPL_VER=0x20000
# Emergency SUPL, 1=enable, 0=disable
SUPL_ES=1
#Choose PDN for Emergency SUPL
#1 - Use emergency PDN
#0 - Use regular SUPL PDN for Emergency SUPL
USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1
#SUPL_MODE is a bit mask set in config.xml per carrier by default.
#If it is uncommented here, this value will over write the value from
#config.xml.
#MSA=0X2
#MSB=0X1
#SUPL_MODE=
# GPS Capabilities bit mask
# SCHEDULING = 0x01
# MSB = 0x02
# MSA = 0x04
# ON_DEMAND_TIME = 0x10
# GEOFENCE = 0x20
# default = ON_DEMAND_TIME | MSA | MSB | SCHEDULING | GEOFENCE
CAPABILITIES=0x13
# Accuracy threshold for intermediate positions
# less accurate positions are ignored, 0 for passing all positions
# ACCURACY_THRES=5000
################################
##### AGPS server settings #####
################################
# FOR SUPL SUPPORT, set the following
SUPL_HOST=supl.sonyericsson.com
SUPL_PORT=7275
# FOR C2K PDE SUPPORT, set the following
# C2K_HOST=c2k.pde.com or IP
# C2K_PORT=1234
# Bitmask of slots that are available
# for write/install to, where 1s indicate writable,
# and the default value is 0 where no slots
# are writable. For example, AGPS_CERT_WRITABLE_MASK
# of b1000001010 makes 3 slots available
# and the remaining 7 slots unwritable.
#AGPS_CERT_WRITABLE_MASK=0
####################################
# LTE Positioning Profile Settings
####################################
# 0: Enable RRLP on LTE(Default)
# 1: Enable LPP_User_Plane on LTE
# 2: Enable LPP_Control_Plane
# 3: Enable both LPP_User_Plane and LPP_Control_Plane
LPP_PROFILE = 0
################################
# EXTRA SETTINGS
################################
# NMEA provider (1=Modem Processor, 0=Application Processor)
NMEA_PROVIDER=0
# Mark if it is a SGLTE target (1=SGLTE, 0=nonSGLTE)
SGLTE_TARGET=0
##################################################
# Select Positioning Protocol on A-GLONASS system
##################################################
# 0x1: RRC CPlane
# 0x2: RRLP UPlane
# 0x4: LLP Uplane
A_GLONASS_POS_PROTOCOL_SELECT = 0x2
###########################################
# Enable/Disable reading H-SLP address and
# certificates from the SIM card
###########################################
# 0: Disable (Default)
# 1: Enable
ENABLE_READ_FROM_SIM = 0
Thank you!
Hello,
can anybody check this please? Something is wrong because task doesn't work for me.
I want to check my watch battery between 6.00 - 22.00 only if watch has battery below 60%.
Thank you so much.
Code:
Profile: Watch Battery
Time: Every 5m
Enter Task: Watch Battery
A1: Variable Set [
Name: %Watchbattery
To: %awmessage
Max Rounding Digits: 3
Structure Output (JSON, etc): On ]
A2: If [ %Watchbattery < 60 & %TIME > 06.00 & %TIME < 22.00 ]
A3: AutoWear App [
Configuration: Execute Now: true
Trigger Event: true
Name: App
Command: <battery>
Timeout (Seconds): 60
Structure Output (JSON, etc): On ]
A4: Wait [
MS: 250
Seconds: 0
Minutes: 0
Hours: 0
Days: 0 ]
A5: Notify [
Title: Watch Battery
Text: Watch Battery is %Watchbattery%
Icon: mw_hardware_watch
Number: 0
Priority: 3
LED Colour: Red
LED Rate: 0 Actions:(1) ]
A6: End If