[Xperia Arc 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 Arc. Initially the module was offered by erasmux.

It works for 2.3.3 / 2.3.4 stock kernel that is: 2.6.32.9-perf (so if you're running stock kernel, and not a modded one).

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/mtdblock0 /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

Screenshot:

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 (1Ghz) 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 122880

/*

* The frequency to set when waking up from sleep.

* When sleep_max_freq=0 this will have no effect.

*/

#define DEFAULT_SLEEP_WAKEUP_FREQ 1024000

/*

* 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_arc_2.3.3.zip

cpufreq_smartass_arc_2.3.4.zip

Enjoy!

Special thanks to:

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