Enable the Hidden Notification LED on the Google Nexus 6!

LED notification lights have existed on Android devices since the very beginnings … more

MX Player Ready to Rock on Lollipop

A good video player should be reliable and free. One of the XDA Community Apps, MX Player, meets both of … more

How to Disable Data Encryption on Nexus 6

In late September, Google decided to step on NSA’s toes and turn on encryption by default in … more

DJI Phantom 2 Vision+ Review – XDA TV

The holidays will be here in no time, so why not start thinking about gifts now? Youll be ahead … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP AnDyX

24th February 2012, 10:00 AM   |  #1  
AnDyX's Avatar
OP Senior Member
Flag Ruda Śląska
Thanks Meter: 459
 
193 posts
Join Date:Joined: May 2008
More
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 08:47 AM.
The Following 7 Users Say Thank You to AnDyX For This Useful Post: [ View ]
24th February 2012, 12:50 PM   |  #2  
kriko's Avatar
Senior Member
Thanks Meter: 90
 
333 posts
Join Date:Joined: Apr 2008
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, 01:28 PM   |  #3  
Member
Thanks Meter: 19
 
67 posts
Join Date:Joined: Feb 2012
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 01:48 PM.
24th February 2012, 03:46 PM   |  #4  
mpiekp's Avatar
Senior Member
Thanks Meter: 610
 
1,293 posts
Join Date:Joined: Mar 2011
More
Working .62.


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

Sent from my MT11i using Tapatalk
24th February 2012, 09:59 PM   |  #5  
AnDyX's Avatar
OP Senior Member
Flag Ruda Śląska
Thanks Meter: 459
 
193 posts
Join Date:Joined: May 2008
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, 11:10 PM   |  #6  
mpiekp's Avatar
Senior Member
Thanks Meter: 610
 
1,293 posts
Join Date:Joined: Mar 2011
More
Sources from any custom kernel, just compile against stock.

Thank you

Sent from my MT11i using Tapatalk
2nd March 2012, 02:51 PM   |  #7  
Senior Member
Flag Wojcieszyce
Thanks Meter: 119
 
405 posts
Join Date:Joined: Sep 2011
Donate to Me
More
Hell yea, OC module for locked BL would be awesome!
7th March 2012, 04:48 PM   |  #8  
Member
Thanks Meter: 19
 
67 posts
Join Date:Joined: Feb 2012
Any news about OC or UV modes?

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

Sent from my E15i using XDA
27th May 2012, 10:04 AM   |  #10  
shardul_seth's Avatar
Senior Member
Thanks Meter: 1,707
 
1,098 posts
Join Date:Joined: Jul 2011
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

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

Advanced Search
Display Modes