[XPERIA X10 Android Development] viulian:
Hello guys,

I've managed to compile the module from here: http://xdaforums.com/showthread.php?t=1159899 updated by AnDyX for X8 which I updated for X10. Initially the module was offered by erasmux.

It works for 2.3.3 kernel that is: 2.6.29-00054-g5f01537.

You can configure various parameters:

# pwd
pwd
/sys/devices/system/cpu/cpu0/cpufreq/smartass
# ls
ls
debug_mask
up_rate_us
down_rate_us
up_min_freq
sleep_max_freq
sleep_wakeup_freq
awake_min_freq
sample_rate_jiffies
ramp_up_step
ramp_down_step
max_cpu_load
min_cpu_load
sleep_rate_us
#

Install guide:

Copy the cpufreq_smartass.ko to the root of your SD card and then execute the following commands with the phone connected to the PC:

adb shell
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cp /sdcard/cpufreq_smartass.ko /system/lib/modules
cd /system/lib/modules
insmod cpufreq_smartass.ko
echo "smartass" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

You can confirm that installation works either by SetCPU (it will report scaling "smartass") or by executing the following command:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Results:

Below are my 17 hours run:

I was running this governor today and I managed to get 47% of battery in 17 hours (listening to music 2 hours, with screen on at 0% brightness, reading the news in the metro 10-15 minutes, and 4 email accounts syncing every 15 minutes). During the night (6 hours), it only lost 2% of the battery.

As far as I can see, when it goes to deep sleep, it stays there, if you minimally use the phone, it should last a long time. But once you turn on the phone, it will kick into high gear (998Mhz) very fast, to allow for fast response - and won't use any other intermediate frequencies.

Settings:

/*

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

*/

#define DEFAULT_UP_RATE_US 24000;

/*

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

*/

#define DEFAULT_DOWN_RATE_US 49000;

/*

* 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.

*/

#define DEFAULT_UP_MIN_FREQ 0

/*

* 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.

*/

#define DEFAULT_SLEEP_MAX_FREQ 245760

/*

* The frequency to set when waking up from sleep.

* When sleep_max_freq=0 this will have no effect.

*/

#define DEFAULT_SLEEP_WAKEUP_FREQ 998400

/*

* 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.

*/

#define DEFAULT_AWAKE_MIN_FREQ 0

/*

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

*/

#define DEFAULT_SAMPLE_RATE_JIFFIES 2

/*

* Freqeuncy delta when ramping up.

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

*/

#define DEFAULT_RAMP_UP_STEP 220000

/*

* Freqeuncy delta when ramping down.

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

*/

#define DEFAULT_RAMP_DOWN_STEP 160000

/*

* CPU freq will be increased if measured load > max_cpu_load;

*/

#define DEFAULT_MAX_CPU_LOAD 75

/*

* CPU freq will be decreased if measured load < min_cpu_load;

*/

#define DEFAULT_MIN_CPU_LOAD 25

/*

* When screen if off behave like conservative governor;

*/

#define DEFAULT_SLEEP_RATE_US (usecs_to_jiffies(500000))

To update one of the settings, the standard echo command should be executed:

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

(in this example, the max_cpu_load will get the value 80, meaning that the CPU should be 80% at least, before a jump in frequency happens.

User biscoitu has a list of settings here http://xdaforums.com/showpost.php?p=16256835&postcount=161 but for X8 I think. They could be a starting point for X10 tuning :) I will also try to see which settings work best, but it will take a while.

Download:

Use it at your own risk!

cpufreq_smartass.ko

Enjoy!

Special thanks to:

a) wolf which gave me hope with X10

b) all guys that made flashing X10 a reality

c) AnDyX for the source code and the workaround for the missing kernel symbols.