Development thread is here :: ch33kyMod [ckMod] kernels + tweaks for CM ::
SSSwitch (Screen State Switch) v0.6E :: ckMod.SSSwitch.v06E.zip (from mediafire)
This script provides balance between performance and economy. I came up with it as I couldn't find any battery saving app which didn't negatively affect performance.
:: Adapted from screenstate_scaling (florian.schaefer@gmail.com) & battery tweak (collin_ph@xda)
:: Auto-switch settings for virtual memory, cpu scheduler, cpufreq and undervolting based on screen state
:: Will override any existing CM speed tweaks with a combination of the best of XDA and FE tweaks
:: Screen-ON >> PERFORMANCE Mode | Screen-OFF >> ECONOMY Mode
:: Works on both Eclair and Froyo (only for kernels with sysinit service for /etc/init.d scripts)
:: SetCPU and SSSwitch modify the same parameters, so DO NOT USE SSSwitch with SetCPU
Changelog for v0.6D > v0.6E
+ enabled oom_kill_allocating_task to prevent 98ssswitch from being killed
+ moved SLEEP_UV to execute at end of SLEEP_MODE function (thx 2 mambrino)
# =========
# changelog
# =========
# v0.2
# + changed ondemand governor up_threshold from 50 to 90
# + added boot-up tweaks for tcp buffers
#
# v0.3
# + reduced vm.min_free_kbytes from 4096 to 3072
# + added tuning tcp/ip parameters for faster network access
# + change to check power source when sleeping[(sleeping & battery)->SAVEmode | (sleeping & AC/USB)->PERFmode)]
#
# v0.4
# + reverted from checking power source, back to checking only screen state
# + added optimizations for non-rotating storage and i/o schedulers
# + added optimizations for BFS
# + reduced SLEEP_MAX_FREQ=266000
# + renamed SAVE mode to ECON mode
#
# v0.5
# + used pixiebob's settings for CFS parameters
# + added read dynamic undervolting set in recovery for AWAKE_UV & SLEEP_UV=AWAKE_UV+150
#
# v0.6
# + added allow user configuration via adb/terminal by running "ssscfg"
# + initialized settings from /system/etc/ssswitch.conf
# + added user customizable settings for io scheduler, and AWAKE & SLEEP mode
# + added preset usage profiles (LOW/NORMAL/HIGH/DEFAULT)
# + added preset audio/video profile (NORMAL/MUSIC/MOVIE)
# + added display statistics on cpu, filesystem, memory, modules, tasks, etc.
# + added save/load custom settings to/from sdcard
#
# v0.6A
# + added allow customization for only IO scheduler, Awake or Sleep modes
# + added option to view saved settings on sdcard
#
# v0.6B
# + adjusted oom_adj value to -17 to exclude process from oom-killer
# + fixed incorrect reading of enabled/disabled status
#
# v0.6C
# + simplified while loop (thx to Frremu)
# + renamed PERF_MODE to AWAKE_MODE & ECON_MODE to SLEEP_MODE
# + added function to remove lag when answering phone calls
#
# v0.6D
# + adjusted nice value of process to -10 for higher processing priority
# + removed io schduler optimizations for sd-card due to instability when copying large files
# + added more optimizations for CFS scheduler
# + disabled undervolting in default preset
#
# v0.6E
# + enabled oom_kill_allocating_task to prevent 98ssswitch from being killed
# + moved SLEEP_UV to execute at end of SLEEP_MODE function (thx 2 mambrino)
UNDO for SSSwitch v0.6 :: ckMod.SSSwitch.v06_UNDO.zip
How to CONFIGURE CUSTOM SETTINGS
Using CKZTools written by zyr3x
CKZTools
From PHONE using terminal emulator
1. Run any terminal emulator on phone
2. Enter "ssscfg"
3. Press Enter to get super-user access (1st run only: select Allow for Superuser Request)
4. Follow on-screen prompts
5. Change your custom settings or load preset profiles
6. Apply changes and exit
From PC using adb shell
1. Connect phone to PC using mini-USB cable
2. Open up an adb shell
3. Run "ssscfg"
4. Follow on screen prompts
5. Change your custom settings or load preset profiles
6. Apply changes and exit
How to check that SSSwitch is working
:: Check logcat for the following entries whenever you lock/unlock screen ...
Code:
I/SSSwitch_v0.6C( 2010): *** BOOT tweaks ***: applied miscellaneous performance tweaks
I/SSSwitch_v0.6C( 2024): *** AWAKE Mode *** : undervolt=100, governor=ondemand, max_freq=800000, up_threshold=90
I/SSSwitch_v0.6C( 2263): *** MAX phone *** set oom_adj(-17) and nice(-20) for com.android.phone
I/SSSwitch_v0.6C( 2761): *** SLEEP mode *** undervolt=200, governor=conservative, max_freq=266000, up_threshold=90
Screenshots







How to INSTALL / UNDO
1. Download the provided recovery zip
2. Save to sdcard
3. Reboot to recovery
4. Install zip from sdcard
5. Reboot
And always remember the 3 golden rules of modding ...
Rule#1 - Always backup
Rule#2 - Always check your backup
Rule#3 - Always backup your backup (somewhere safe)
Bookmarks