CyanogenMod brightness Issue FIXED - Sony Ericsson Xperia Mini, Mini Pro, Xperia Pro, A

I have installed Cyanogenmod , it is super fast and perfect rom
only one issue that is very major issue for me , is low brightness. I tried many things but no success
Today i got solution , it is very easy
After installing cyanogenmod , install root explorer
go to sysyem/etc directory
Find hw_config.sh file
Tap and hold on this hw_config.sh file , select edit in text viewer option from the menu
Scroll down to the bottom , there you will see this code (i am using FXP054 cyanogenmod , for other versions it may vary)
# LMU AS3676 Configuration
dev=/sys/devices/i2c-0/0-0040/leds
echo 1,65,255,24,24,5,128 > $dev/lcd-backlight/als/curve # ALS curve for group1
echo 2,0,0,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
echo 450 > $dev/button-backlight/max_current
Change above code to
# LMU AS3676 Configuration
dev=/sys/devices/i2c-0/0-0040/leds
echo 0,0,0,0,0,0,0 > $dev/lcd-backlight/als/curve # ALS curve for group1
echo 2,0,0,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
echo 450 > $dev/button-backlight/max_current
Reboot your phone and voila you have fixed brightness problem :
Thanks to xutienan9520
You can also hit thanks button for me

my hero!

10000000000000000000000000000 thanks .... life saver

Many thanks,
I've just tried to do this on FXP106 CM7.2, but the original text in my sh_config.sh is different to yours by a couple of lines so I just want to check what I should be doing before I break something...
It's currently
# LMU AS3676 Configuration
dev=/sys/devices/i2c-0/0-0040/leds/
echo 0,0,0,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
echo 0 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
Should I replace it with this?
# LMU AS3676 Configuration
dev=/sys/devices/i2c-0/0-0040/leds
echo 0,0,0,0,0,0,0 > $dev/lcd-backlight/als/curve # ALS curve for group1
echo 2,0,0,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
echo 450 > $dev/button-backlight/max_current
Any help gratefullly received. I don't really know what this all means so I'm a bit apprehensive to just try it in case it breaks something.

richratt said:
Many thanks,
I've just tried to do this on FXP106 CM7.2, but the original text in my sh_config.sh is different to yours by a couple of lines so I just want to check what I should be doing before I break something...
It's currently
# LMU AS3676 Configuration
dev=/sys/devices/i2c-0/0-0040/leds/
echo 0,0,0,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
echo 0 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
Should I replace it with this?
# LMU AS3676 Configuration
dev=/sys/devices/i2c-0/0-0040/leds
echo 0,0,0,0,0,0,0 > $dev/lcd-backlight/als/curve # ALS curve for group1
echo 2,0,0,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
echo 450 > $dev/button-backlight/max_current
Any help gratefullly received. I don't really know what this all means so I'm a bit apprehensive to just try it in case it breaks something.
Click to expand...
Click to collapse
Yes i have done this and worked fine for me on FXP 106

hi! it is same me.
but it work very well!

Thank a lot!it is work well in fxp 108

will this work on any xperia phone.i want to try it on my xperia mini..

akshay13071990 said:
will this work on any xperia phone.i want to try it on my xperia mini..
Click to expand...
Click to collapse
yes it will work on any xperia phone with cyanogenmod

here is my hw_config.sh:
Code:
# Audio jack configuration
dev=/sys/devices/platform/simple_remote.0
echo 0,201,1600 > $dev/accessory_min_vals # default = 0,200,1600
echo 200,1599 > $dev/accessory_max_vals # default = 200,1600
echo 0,100,280,500,700 > $dev/button_min_vals # default = 0,100,300,600,700
echo 99,199,399,699,5000 > $dev/button_max_vals # default = 99,199,399,699,5000
echo 512 > $dev/btn_trig_period_freq # Button Period Freq(Hz) default = 512
echo 16 > $dev/btn_trig_period_time # Button Period Time(cycle) default = 16
echo 512 > $dev/btn_trig_hyst_freq # Button Hysteresis Freq(Hz) default = 512
echo 16 > $dev/btn_trig_hyst_time # Button Hysteresis Time(Cycle) default = 16
echo 500 > $dev/btn_trig_level # default = 500
# Proximity sensor configuration
dev=/sys/bus/i2c/devices/0-0054/
val_cycle=0
val_nburst=26
val_freq=0
val_threshold=2
val_filter=0
nv_param_loader 60240 prox_cal
val_calibrated=$?
case $val_calibrated in
1)
nv_param_loader 60240 threshold
val_threshold=$?
nv_param_loader 60240 rfilter
val_filter=$?
;;
esac
echo $val_cycle > $dev/cycle # Duration Cycle. Valid range is 0 - 3.
echo $val_nburst > $dev/nburst # Number of pulses in burst. Valid range is 0 - 15. 16 - 31 is a special range for smultron only (SP)
echo $val_freq > $dev/freq # Burst frequency. Valid range is 0 - 3.
echo $val_threshold > $dev/threshold # sensor threshold. Valid range is 0 - 15 (0.12V - 0.87V)
echo $val_filter > $dev/filter # RFilter. Valid range is 0 - 3.
# LMU AS3676 Configuration
dev=/sys/devices/i2c-0/0-0040/leds
echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
echo 3,2,2,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
echo 8000 > $dev/button-backlight-rgb1/max_current
echo 8000 > $dev/button-backlight-rgb2/max_current
echo 1,30,255,54,52,1,65 > $dev/lcd-backlight/als/curve # ALS curve display BL [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 2,48,0,128,128,4,10 > $dev/button-backlight-rgb1/als/curve # ALS curve key LED 1 [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 2,48,0,128,128,4,10 > $dev/button-backlight-rgb2/als/curve # ALS curve key LED 2 [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 3,71,255,64,32,5,37 > $dev/red/als/curve # ALS curve RGB(red) [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 3,71,255,64,32,5,37 > $dev/green/als/curve # ALS curve RGB(green) [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 3,71,255,64,32,5,37 > $dev/blue/als/curve # ALS curve RGB(blue) [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
# Touch panel
dev=/sys/devices/platform/spi_qsd.0/spi0.0
app_id=`cat $dev/appid`
case "$app_id" in
"0x0505")
fw=touch_smultron_innolux.hex
;;
"0x0105")
fw=touch_smultron_sony.hex
;;
"0x0015")
fw=touch_smultron_sony.hex
;;
*)
fw=touch_smultron_sony.hex
;;
esac
cyttsp_fwloader -dev $dev -fw /system/etc/firmware/$fw
# TI BQ275xx firmware loader
bq275xx_fwloader
I'm using cyanogenmod 7.1.0.1, i would like to upgrade to 7.1.0.2 but cyanogenmod just hangs on the animation booting so i've had to stick to this, i don't know which version of FXP i have but i'd like to upgrade to the latest if someone could help with that too.
What should i change to allow me to increase the brightness as it is rather dull?
I'm using Xperia mini btw, not xperia mini pro.
EDIT: just tried changing:
echo 1,30,255,54,52,1,65 > $dev/lcd-backlight/als/curve # ALS curve display BL [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
to:
echo 0,0,0,0,0,0,0 > $dev/lcd-backlight/als/curve # ALS curve display BL [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
but that didn't work, not sure which version of FXP i'm using i'm using cyanogenmod 7.1.0.1.

Hi, congratulations for the fix!! It solved my problem \o! But I'm curious, what is the hw_config.sh file and what the changing into 0 values we did do to the system? THankss!

Maudiefech said:
Hi, congratulations for the fix!! It solved my problem \o! But I'm curious, what is the hw_config.sh file and what the changing into 0 values we did do to the system? THankss!
Click to expand...
Click to collapse
yeah, I really want to try, but before I do, I kinda what to know why it works and what I am actually doing to the phone to achieve the fix?

Auto brightness working
I think putting the Ambient Light Sensor(als) parameters to 0 effectively disactivates it setting brightness to static aka what's in the configuration app/brightness.
I've gotten the auto brightness working by changing the # LMU AS3676 Configuration to reflect arcatarc's work on his post here :
http://forum.xda-developers.com/showpost.php?p=20001136&postcount=1.
Here's my section:
Code:
# LMU AS3676 Configuration
dev=/sys/devices/i2c-0/0-0040/leds/
echo 3,2,2,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
echo 12900 > $dev/button-backlight/max_current
I also copied in his als_curve.conf as attached.

solve backlight fix
http://forum.xda-developers.com/showthread.php?t=1662819 easily flasch with cwm

xperia ray said:
I have installed Cyanogenmod , it is super fast and perfect rom
only one issue that is very major issue for me , is low brightness. I tried many things but no success
Today i got solution , it is very easy
After installing cyanogenmod , install root explorer
go to sysyem/etc directory
Find hw_config.sh file
Tap and hold on this hw_config.sh file , select edit in text viewer option from the menu
Scroll down to the bottom , there you will see this code (i am using FXP054 cyanogenmod , for other versions it may vary)
# LMU AS3676 Configuration
dev=/sys/devices/i2c-0/0-0040/leds
echo 1,65,255,24,24,5,128 > $dev/lcd-backlight/als/curve # ALS curve for group1
echo 2,0,0,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
echo 450 > $dev/button-backlight/max_current
Change above code to
# LMU AS3676 Configuration
dev=/sys/devices/i2c-0/0-0040/leds
echo 0,0,0,0,0,0,0 > $dev/lcd-backlight/als/curve # ALS curve for group1
echo 2,0,0,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
echo 450 > $dev/button-backlight/max_current
Reboot your phone and voila you have fixed brightness problem :
Thanks to xutienan9520
You can also hit thanks button for me
Click to expand...
Click to collapse
thanx a lot..... you are awesome
its working on CM9.1 and CM10

Is this fix working for FXP137
aq_aq said:
thanx a lot..... you are awesome
its working on CM9.1 and CM10
Click to expand...
Click to collapse
Hi aq_aq,
I am running CM 9.1 FXP137. and i am facing the same brightness issue will this fix work for FXP 138?
thanks in advance!

it will work.
take note that what you will see there now is this :
Change above code to
# LMU AS3676 Configuration
dev=/sys/devices/i2c-0/0-0040/leds
echo 0,0,0,0,0,0,0 > $dev/lcd-backlight/als/curve # ALS curve for group1
echo 2,0,0,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
echo 450 > $dev/button-backlight/max_current
Change
echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
To
echo 0 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h

There is an easier way to do it!
OR you can download this file http://www.mediafire.com/?t619gplc0x0tex7
And flash it with CWM (recovery mode).
It solved my issue

Here's my file:
# LMU AS3676 Configuration
dev=/sys/devices/i2c-0/0-0040/leds
echo 0 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
echo 0 > $dev/button-backlight-rgb1/als/enable #Sensor on/off. 1 = on, reg 90h
echo 0 > $dev/button-backlight-rgb2/als/enable #Sensor on/off. 1 = on, reg 90h
echo 0 > $dev/button-backlight/als/enable
echo 0 > $dev/keyboard-backlight/als/enable
echo 0 > $dev/red/als/enable #Sensor on/off. 1 = on, reg 90h
echo 0 > $dev/green/als/enable #Sensor on/off. 1 = on, reg 90h
echo 0 > $dev/blue/als/enable #Sensor on/off. 1 = on, reg 90h
echo 3,2,2,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
echo 8000 > $dev/button-backlight-rgb1/max_current
echo 8000 > $dev/button-backlight-rgb2/max_current
echo 1,30,255,54,52,1,65 > $dev/lcd-backlight/als/curve # ALS curve display BL [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 2,48,0,128,128,4,10 > $dev/button-backlight-rgb1/als/curve # ALS curve key LED 1 [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 2,48,0,128,128,4,10 > $dev/button-backlight-rgb2/als/curve # ALS curve key LED 2 [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 3,71,255,64,32,5,37 > $dev/red/als/curve # ALS curve RGB(red) [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 3,71,255,64,32,5,37 > $dev/green/als/curve # ALS curve RGB(green) [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 3,71,255,64,32,5,37 > $dev/blue/als/curve # ALS curve RGB(blue) [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
What should I change? Thanks!

Related

My script makes my phone unbootable :(

Code:
#!/system/bin/sh
AWAKE_CORE_STATUS="on";
SLEEP_CORE_STATUS="off";
AWAKE_GOVERNOR="pegasusq";
SLEEP_GOVERNOR="lulzactive";
(while [ 1 ];
do
AWAKE=`cat /sys/power/wait_for_fb_wake`;
if [ $AWAKE = "awake" ]; then
sleep 2 && {
echo $AWAKE_GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor;
echo $AWAKE_CORE_STATUS > /sys/devices/virtual/misc/second_core/hotplug_on;
}
# ==============================================================
# Pegasusq
# ==============================================================
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;
fi;
if [ -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/down_rate;
echo "100000" > /sys/devices/system/cpu/cpu1/cpufreq/pegasusq/freq_for_responsiveness;
fi;
if [ -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;
AWAKE=;
fi;
SLEEPING=`cat /sys/power/wait_for_fb_sleep`;
if [ $SLEEPING = "sleeping" ]; then
sleep 2 && {
echo $SLEEP_GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor;
echo $SLEEP_CORE_STATUS > /sys/devices/virtual/misc/second_core/hotplug_on;
echo $SLEEP_CORE_STATUS > /sys/devices/virtual/misc/second_core/second_core_on;
}
# ==============================================================
# lulzactive
# ==============================================================
if [ -e /sys/devices/system/cpu/cpufreq/lulzactive/inc_cpu_load ]; then
echo "95" > /sys/devices/system/cpu/cpufreq/lulzactive/inc_cpu_load;
#echo "1" > /sys/devices/system/cpu/cpufreq/lulzactive/pump_up_step;
echo "1" > /sys/devices/system/cpu/cpufreq/lulzactive/pump_down_step;
echo "100000" > /sys/devices/system/cpu/cpufreq/lulzactive/up_sample_time;
echo "100000" > /sys/devices/system/cpu/cpufreq/lulzactive/down_sample_time;
#echo "4" > /sys/devices/system/cpu/cpufreq/lulzactive/screen_off_min_step;
fi;
SLEEPING=;
fi;
done &);
I made this to exchange the status of hotplug and cpu governor between awake and sleepling.
I'll apply with pushing this script as init.d on latest siyah kernel.
It works well when executing manually after boot, but this makes phone unbootable when I put this in init.d.
Phone stays bootlogo and can't go to bootanimation
What should I change in this code to boots the phone and executes itself well?

Undervoltage for Evo3D

don't know if under-voltage helps for battery consumption
Done the Stress test with antutu and 'stress test' from market for 2hours, after each under voltage test for each clock rate
and here is my result for 6days testing
#! 700000 712500 725000 737500 750000 762500 787500 800000 812500 825000 837500 850000 887500 900000 912500 937500 962500 987500 1000000 1012500 1037500 1062500 1087500 1112500 1125000 1162500 1200000 1250000 1275000 1325000
echo "192000 700000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "310500 712500" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "384000 725000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "432000 737500" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "486000 750000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "540000 762500" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "594000 787500" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "648000 800000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "702000 812500" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "756000 825000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "810000 837500" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "864000 850000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "918000 887500" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "972000 900000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "1026000 912500" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "1080000 937500" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "1134000 962500" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "1188000 987500" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "1242000 1000000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "1296000 1012500" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "1350000 1037500" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "1404000 1062500" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "1458000 1087500" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "1512000 1112500" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "1566000 1125000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "1620000 1162500" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "1674000 1200000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "1728000 1250000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "1782000 1275000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
echo "1836000 1325000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
What kernel are you using?
Sent from my PG86100 using Tapatalk 2
bayp4amd said:
What kernel are you using?
Sent from my PG86100 using Tapatalk 2
Click to expand...
Click to collapse
CoolZ EvoG v2.3 by coolexe

[INIT.D][SCRIPT] SetCPU like Profiles with init.d!

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
Set CPU Frequencies to (300,600,800,1000,1200)
Set Governor to HotplugX
Set Scheduler to Noop
Screen Off
Set CPU Frequencies to (300,350,450,525,600)
Set Governor to PegasusQ
Set Scheduler to SIO
Battery percentage less than or equal to 15%
Screen On
Set CPU Frequencies to (300,450,600,800,1000)
Set Governor to PegasusQ
Set Scheduler to SIO
Screen Off
Set CPU Frequencies to (300,350,450,525,600)
Set Governor to PegasusQ
Set Scheduler to SIO
Battery Charging
Screen On
Set CPU Frequencies to (300,600,800,1000,1200)
Set Governor to HotplugX
Set Scheduler to Noop
Screen Off
Set CPU Frequencies to (300,350,450,525,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.
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"
##################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###################
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
###################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###################
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
###################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###################
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
###################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###################
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
###################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
awesome work.thanks

[Solved] [Q] Cyanogen mod 9.1 backlight issue

Hello,
I just installed cyanogen mod 9.1.0 on neo V. I need to dim the backlight of the hardware key. I try to edit the hw_config.sh, but I was not successful. I also consulted free xperia threads, but I didn't get the working method. I don't want any third part apps to do this. Can any one explain the exact process?
I would like to have the backlight config as same as the stock ICS 4.0.4 ROM.
My hw_config.sh
Code:
# Audio jack configuration
dev=/sys/devices/platform/simple_remote.0
echo 0,201,1600 > $dev/accessory_min_vals # default = 0,200,1600
echo 200,1599 > $dev/accessory_max_vals # default = 200,1600
echo 0,100,280,500,770 > $dev/button_min_vals # default = 0,100,300,600,700
echo 99,199,470,769,5000 > $dev/button_max_vals # default = 99,199,399,699,5000
echo 512 > $dev/btn_trig_period_freq # Button Period Freq(Hz) default = 512
echo 16 > $dev/btn_trig_period_time # Button Period Time(cycle) default = 16
echo 512 > $dev/btn_trig_hyst_freq # Button Hysteresis Freq(Hz) default = 512
echo 16 > $dev/btn_trig_hyst_time # Button Hysteresis Time(Cycle) default = 16
echo 500 > $dev/btn_trig_level # default = 500
# Proximity sensor configuration
dev=/sys/bus/i2c/devices/0-0054/
val_cycle=0
val_nburst=1
val_freq=0
val_threshold=4
val_filter=0
nv_param_loader 60240 prox_cal
val_calibrated=$?
case $val_calibrated in
1)
nv_param_loader 60240 threshold
val_threshold=$?
nv_param_loader 60240 rfilter
val_filter=$?
;;
esac
echo $val_cycle > $dev/cycle # Duration Cycle. Valid range is 0 - 3.
echo $val_nburst > $dev/nburst # Number of pulses in burst. Valid range is 0 - 15.
echo $val_freq > $dev/freq # Burst frequency. Valid range is 0 - 3.
echo $val_threshold > $dev/threshold # sensor threshold. Valid range is 0 - 15 (0.12V - 0.87V)
echo $val_filter > $dev/filter # RFilter. Valid range is 0 - 3.
# LMU AS3676 Configuration
dev=/sys/devices/i2c-0/0-0040/leds
echo 1,40,255,35,35,1,100 > $dev/lcd-backlight/als/curve # ALS curve display BL [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 2,85,0,128,128,200,201 > $dev/button-backlight-rgb1/als/curve # ALS curve key LED 1 [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 2,85,0,128,128,200,201 > $dev/button-backlight-rgb2/als/curve # ALS curve key LED 2 [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 3,100,255,21,21,10,100 > $dev/red/als/curve # ALS curve RGB(red) [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 3,100,255,21,21,10,100 > $dev/green/als/curve # ALS curve RGB(green) [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 3,100,255,21,21,10,100 > $dev/blue/als/curve # ALS curve RGB(blue) [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 1,2,2,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
echo 1 > $dev/button-backlight-rgb1/als/enable #Sensor on/off. 1 = on, reg 90h
echo 1 > $dev/button-backlight-rgb2/als/enable #Sensor on/off. 1 = on, reg 90h
echo 1 > $dev/red/als/enable #Sensor on/off. 1 = on, reg 90h
echo 1 > $dev/green/als/enable #Sensor on/off. 1 = on, reg 90h
echo 1 > $dev/blue/als/enable #Sensor on/off. 1 = on, reg 90h
echo 900 > $dev/button-backlight-rgb1/max_current #Max current in uA
echo 900 > $dev/button-backlight-rgb2/max_current #Max current in uA
# TI BQ275xx firmware loader
bq275xx_fwloader
Thanks
https://www.box.com/shared/te0azf921aius28uv7tz
Here is the fix. It will restore the current value to original. Flash it via recovery!
Enjoy!

Padfone S WW 12.2.2.43 SKU Battery Tweaks

Here i publish my every day battery tweaks.
I use a Tasker Device Boot Task to apply these tweaks.
You need root, busybox and tasker or init.d support to use these tweaks.
I prefer the Tasker way because it is handier to modify or disable these tweaks.
You DO NOT NEED to factory reset your phone or wipe dalvik cache also a reboot is NOT REQUIRED.
Code:
setenforce 0 &
/system/xbin/daemonsu --auto-daemon &
# io scheduler
# default: noop deadline [row] cfq
echo "cfq" > /sys/block/mmcblk0/queue/scheduler
echo "cfq" > /sys/block/mmcblk1/queue/scheduler
echo ####
echo CPU Governor
echo default: interactive
echo ####
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ####
echo Scheduler Queue Deep
echo default: 128
echo ####
echo "192" > /sys/block/mmcblk0/queue/nr_requests
echo "192" > /sys/block/mmcblk1/queue/nr_requests
echo ####
echo Virtual memory management tweaks
echo ####
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
echo ####
echo Strict minfree handler tweak
echo nothing changed
echo ####
#echo "256,768,1024,1792,2048,2560" > /sys/module/lowmemorykiller/parameters/minfree
#echo "1536,2048,4096,5120,5632,6144" > /sys/module/lowmemorykiller/parameters/minfree
#echo "2048,3072,6144,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
#echo "1024,2048,4096,8192,12288,16384" > /sys/module/lowmemorykiller/parameters/minfree
#echo "1024,2048,2560,4096,6144,8192" > /sys/module/lowmemorykiller/parameters/minfree
echo ####
echo Internet speed tweaks
echo ####
echo "0" > /proc/sys/net/ipv4/tcp_timestamps
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse
echo "1" > /proc/sys/net/ipv4/tcp_sack
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout
echo "404480" > /proc/sys/net/core/wmem_max
echo "404480" > /proc/sys/net/core/rmem_max
echo "256960" > /proc/sys/net/core/rmem_default
echo "256960" > /proc/sys/net/core/wmem_default
echo "4096 16384 404480" > /proc/sys/net/ipv4/tcp_wmem
echo "4096 87380 404480" > /proc/sys/net/ipv4/tcp_rmem
echo ####
echo Battery Tweaks
echo ####
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
echo ####
echo stop market if running
echo ####
busybox killall com.android.vending

Categories

Resources