[XPERIA X8 Original Android Development] AnDyX:
EASY ENGLISH: Differences between this module and the others:

- allows to set max CPU freq when screen is off (to save battery),

- allows to set starting CPU freq when phone awakes (to speed up awake process),

- allows set/change almost all aspects of governor (to suite needs),

- should be a bit more responsive when parameters are well chosen.

Note: Don't use DSP Manager when this governor is enabled (it consumes more CPU then player itself). When screen goes off - sound will be distorted. Use player with equalizer build-in instead.

Governor have some predefinied values - more info in "Available settings".

Start:

The goal was bring 'smartass' governor to work with X8 and also make some improvements.

Info:

- information about governors is here,

- more information about 'smartass' governor is here,

- how different governors work is explained here: [Q] SetCPU governors (explained).

Prerequisites:

- X8,

- Baseband x15

- desire to replace SetCPU - when used only for 'ScreenOff' profile.

Manual installation:

- push ax8_smartass.ko to /system/lib/modules

- run the following command

insmod /system/lib/modules/ax8_smartass.ko
echo "smartass" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Available settings:

Note: there is no need to add following commands without changed value. The values are already implemented in module.

- up_rate_us:

The minimum amount of time to spend at a frequency before we can ramp up.

Default value:

echo "24000" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/up_rate_us

- down_rate_us:

The minimum amount of time to spend at a frequency before we can ramp down. Default value:

echo "49000" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/down_rate_us

- up_min_freq:

When ramping up frequency with no idle cycles jump to at least this frequency.

Zero disables. Set a very high value to jump to policy max freqeuncy.

echo "0" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/up_min_freq

- sleep_max_freq:

When sleep_max_freq>0 the frequency when suspended will be capped by this frequency. Also will wake up at max frequency of policy to minimize wakeup issues.

Set sleep_max_freq=0 to disable this behavior.

Default value:

echo "122880" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/sleep_max_freq

- sleep_wakeup_freq:

The frequency to set when waking up from sleep.

When sleep_max_freq=0 this will have no effect.

Default value:

echo "600000" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/sleep_wakeup_freq

- awake_min_freq: When awake_min_freq>0 the frequency when not suspended will not go below this frequency.

Set awake_min_freq=0 to disable this behavior.

Default value:

echo "0" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/awake_min_freq

- sample_rate_jiffies:

Sampling rate, I highly recommend to leave it at 2.

- ramp_up_step:

Freqeuncy delta when ramping up.

zero disables and causes to always jump straight to max frequency.

Default value:

echo "220000" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/ramp_up_step

- ramp_down_step:

Freqeuncy delta when ramping down.

zero disables and will calculate ramp down according to load heuristic.

Default value:

echo "160000" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/ramp_down_step

- max_cpu_load:

CPU freq will be increased if measured load > max_cpu_load.

Default value:

echo "75" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/max_cpu_load

- min_cpu_load: CPU freq will be decreased if measured load < min_cpu_load.

Default value:

echo "25" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/min_cpu_load

- sleep_rate_us: Sleep rate when screen is off

echo "500000" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/sleep_rate_us

Release history:

v002:

- sleep_max_freq set to 122880 - more battery saving,

- sleep_wakeup_freq set to 600000 - faster wake up,

- ramp_down_step set to 160000 - to slow down decreasing CPU freq,

- when screen is off - governor acts like its 'conservative' version, just checks CPU loads using 500ms rate,

- added sleep_rate_us parameter - sleep rate when screen is off can be changed using this parameter.

v001:

- just initial version fixed to work with X8.

Sources at: GitHub