FORUMS

Analysis & Opinion

Top Forum Discussions

[Module] SmartassV2/ondemandX governors for Rooted/stock ROM | 2012-02-24

194 posts
Thanks Meter: 459
 
By AnDyX, Senior Member on 24th February 2012, 09:00 AM
Post Reply Subscribe to Thread Email Thread
This modules are for people with stock kernels because they don't have 'smartass' or ondemandX' governors.

EASY ENGLISH:
Differences between this modules and build in stock kernels:
- 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 for smartassv2 governor.

Each governor has some predefinied values - more info in "Available settings".

If governors works or not on other version then 4.0.2.A.0.42 let me know.

Start:
The goal was bring 'smartassv2' and 'ondemandX' governor to work with stock kernel on Neo V.

Most information is in my thread on 'XPERIA X8 Android Development': [Module] | X8 | X10 mini/pro | AX8_SMARTASS v002 | 'smartass' governor | [2011-07-19]

To remind:
Quote:

SmartassV2 (informal description and comparison with the first smartass)

SmartassV2 is a governor (controls the frequency of the CPU at each give moment) which like the first smartass is generally based on the implementation of interactive with some major changes and the addition of a built in sleep profile (behaves a bit differently when screen is off vs. on).

The smartassV2 improves the very naive scheme which the first smartass had: The first smartass (with the values I set for the hero), would cap the max frequency at 352Mhz for sleep and when screen is on, would do the opposite and keep the frequency at 518Mhz or above. For sleep this was very effective but a bit crude and unclean, and there could be some cases where you would need processing power even when screen is off (something is updating and music is playing and etc.). For screen on, smartass1 was too quick to jump to the max available frequency and again would never go below the 518Mhz, so in a nutshell its was using "too high" frequencies.

SmartassV2, introduce (internally) an "ideal" frequency which is the frequency we are "aiming" for, in some sense. The way I see it is that the "ideal" frequency is a hint to the governor what is a good balance between performance and battery life. Now when screen is on, I set (on the hero) the ideal frequency to 518Mhz which will ensure nice responsiveness but limit unnecessary use of higher frequencies when they are not needed. When screen is off, I set the ideal frequency to 352Mhz (0 will disable the screen state tracking all together). From my testing this will "convince" the governor to spend most of the its time during sleep at the lowest available frequencies. Note, that both during sleep and when awake the entire frequency range (as defined by the "user" - i.e. selected with SetCPU) is used by smartassV2. For example, when the CPU is loaded heavily, the highest available frequency will be used regardless if screen is on or off.

Quote:

ondemandX - ondemand governor code from latest linux (3.0 at the moment) source *plus* the suspend/wake logic described above. No further optimization is done.

Info:
- information about governors is here,
- more information about 'smartass' governor is here or here,
- how different governors work is explained here: [Q] SetCPU governors (explained).


Prerequisites:
- Neo V (if works on Neo - let me know),
- root,
- ondemandX should work on any version,
- smartass was compiled against 4.0.2.A.0.42 version, how run on other version will be explained in manuall installation section,
- desire to replace SetCPU - when used only for 'ScreenOff' profile.

Manual installation:
  1. Unzip file
  2. Run copy.cmd file - this should copy modules to /system/lib/modules
  3. run adb shell or terminal - whatever you like and execute su
    Code:
    su
  4. If you have 4.0.2.A.0.42 version proceed to step 6
  5. For smartass governor you need to know address for 'kallsyms_lookup_name'
    run following command:
    Code:
    cat /proc/kallsyms | grep kallsyms_lookup_name
    result should be as follows:
    Code:
    80101aec T module_kallsyms_lookup_name
    801056f0 T kallsyms_lookup_name
    Bolded value (801056f0) is address which we need.
  6. Optional step: lower min CPU freq:
    Code:
    echo 122880 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
  7. Insert ondemandX module:
    Code:
    insmod /system/lib/modules/aneov_ondemandx.ko
    in dmesg command should be line:
    Code:
    <6>[  431.711517] aneov_ondemandX: module v001 for device Xperia Neo V loaded
  8. Insert smartassV2 module:
    • for version 4.0.2.A.0.42 just run command:
      Code:
      insmod /system/lib/modules/aneov_smartass2.ko
      in dmesg command should be line:
      Code:
      <6>[  420.308380] aneov_smartass2: module v001 for device Xperia Neo V loaded
    • for other use 'address' and use following command:
      Code:
      insmod /system/lib/modules/aneov_smartass2.ko lookup_address=0x801056f0
      in dmesg command should be line:
      Code:
      <6>[  420.308380] aneov_smartass2: module v001 for device Xperia Neo V loaded
  9. Now you can enable desired governor. Execute:
    Code:
    echo "smartassV2" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
for smartassV2 or
Code:
echo "ondemandX" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
for ondemandX governor.

Lower min cpu freq a bit:
Code:
echo 122880 >  /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
Until you're sure that it works with your hardware, don't install it to hw_config.sh.

Available settings:
Will be added later

v001:
- just initial version fixed to work with Neo V.

Disclaimer
I'm not responsible if this module damages your lovely phone. Use it at your own risk! Think before you do something!

Sources at: GitHub
Last edited by AnDyX; 16th May 2012 at 07:47 AM.
The Following 7 Users Say Thank You to AnDyX For This Useful Post: [ View ]
 
 
24th February 2012, 11:50 AM |#2  
kriko's Avatar
Senior Member
Thanks Meter: 93
 
More
Thank you!

On .62 firmware, I didn't have to specify lookup_address, since it didn't recognise that option, but it seems to work.

Also a good full article about governors:
http://forum.xda-developers.com/show...76&postcount=1
24th February 2012, 12:28 PM |#3  
Member
Thanks Meter: 20
 
More
is there any chance to get this as a zip for cwm?


edit:yay! just put it manually into system/lib/modules and changed permissions and it works!
Last edited by Venael; 24th February 2012 at 12:48 PM.
24th February 2012, 02:46 PM |#4  
mpiekp's Avatar
Senior Member
Thanks Meter: 619
 
More
Working .62.


Could you also build an OC module please, that would be awesome.

Sent from my MT11i using Tapatalk
24th February 2012, 08:59 PM |#5  
AnDyX's Avatar
OP Senior Member
Flag Ruda Śląska
Thanks Meter: 459
 
More
Quote:
Originally Posted by mpiekp

Working .62.


Could you also build an OC module please, that would be awesome.

Sent from my MT11i using Tapatalk

If I find source somewhere - or someone point me to sources - I can try.
The Following User Says Thank You to AnDyX For This Useful Post: [ View ]
24th February 2012, 10:10 PM |#6  
mpiekp's Avatar
Senior Member
Thanks Meter: 619
 
More
Sources from any custom kernel, just compile against stock.

Thank you

Sent from my MT11i using Tapatalk
2nd March 2012, 01:51 PM |#7  
Senior Member
Flag Wojcieszyce
Thanks Meter: 119
 
Donate to Me
More
Hell yea, OC module for locked BL would be awesome!
7th March 2012, 03:48 PM |#8  
Member
Thanks Meter: 20
 
More
Any news about OC or UV modes?

Wysłano z MT11i z użyciem Tapatalk
27th May 2012, 06:34 AM |#9  
chitoka's Avatar
Senior Member
Flag guatemala
Thanks Meter: 23
 
More
Will this work with my x8

Sent from my E15i using XDA
27th May 2012, 09:04 AM |#10  
shardul_seth's Avatar
Senior Member
Thanks Meter: 1,721
 
More
Intellidemand please!
Could you please make an intellidemand governor also..

Also please see these commits for some changes to smartass2 (more stable) and working lulzactive
27th May 2012, 07:51 PM |#11  
Member
Thanks Meter: 20
 
More
thread dead for more than 2 months...

Read More
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes