[Module] SMARTASS,ONDEMANDAX and others for 3.0.x kernels (save battery) | 2012-12-10

Search This thread

AnDyX

Senior Member
May 27, 2008
195
452
Ruda Śląska
As usually I made my ow version of Smartass governor for phone I have. I couldn't break 1 day battery life on stock governor - so I started write my own and finally looks like there will be up to 4 days with this version of smartass governor. But I don't use my phone for listening music etc. So when phone has screen off - I require that it does nothing.
This thread still evolves - now will consist following parts:
  • Governors
  • IO Schedulers

Prerequisites:
- for latest version: any SE based 3.0.x kernel and U8500 based device,
- up to smartass v006 Xperia U with stock 6.1.1.B.1.10 ROM,
- root,
- desire to replace SetCPU - when used only for 'ScreenOff' profile.

Automatic installation using apk:
  • Use app from this post (starting from v003 it is inside zip file),
    After install there is just simple button to run any desired governor and io scheduler.
    When phone boots again- there is service that boots with phone called 'SmartAss v.00x'.
    You can check it on: Settings->Applications->Running - I believe.
    When you click on it - there is details with timer that shows how long this service run. After 1min service will install desired governor and scheduler and run it again and close itself.
  • If you try to upgrade app - reboot phone to load new version. If this not works - remove app - reboot phone and load new one.

GOVERNORS

General info:
- information about governors is here,
- a lot of information about performance, battery draining: Battery, Governors, and...: Tips and Conclusions
- more information about 'smartass' governor is here or here,
- how different governors work is explained here: [Q] SetCPU governors (explained).

ONDEMANDAX
The benefits:
- CPU when screen is off is capped to 200MHz,
- behaves as ondemand governor when screen is on,
- no need for sleep-off profile,
Governor file: axperiau_ondemandax.ko
Governor name: ondemandax

PEGASUSQ
Samsung's own multi-core aware governor. Pegasusq is basically an ondemand based governor which also controls hotplugging.
Information about this governor: Pegasusq Governor
Governor file: axperiau_pegasusq.ko
Governor name: pegasusq

LULZACTIVEQ
Lulzactiveq is a modified lulzactive governor authored by XDA member robertobsc and is adapted in Siyah kernel for GS2 and GS3. Lulzactiveq aims to optimize the second version of luzactive from Tegrak by a) providing an extra parameter (dec_cpu_load) to make scaling down more sensible, and b) incorporating hotplug logic to the governor. Luzactiveq is the first ever interactive based governor with hotplugging logic inbuilt (atleast the first of its kind for the exynos platform). When CPU comes out of idle loop and it's time to make a scaling decision, if load >= inc_cpu_load CPU is scaled up (like original luzactiveq) and if load <dec_cpu_load, CPU is scaled down. This possibly eliminates the strict single cut-off frequency for luzactiveq to make CPU scaling decisions. Also, stand hotplug logic runs as a separate thread with the governor so that external hotplugging logic is not required to control hotplug in and out (turn On and Off) CPU cores in multi core devices like GS2 or GS3. Only a multi core aware governor makes real sense on muti-core devices. Lulzactiveq and pegasusq aims to do that.
Governor file: axperiau_lulzactiveq.ko
Governor name: lulzactiveq

SMARTASSV2
The benefits:
- CPU when screen is off is capped to 200MHz,
- 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),
Governor file: axperiau_smartass2.ko
Governor name: smartassV2

Manual installation:
  • Unzip file
  • Copy 'governor-file' to directory where you have adb
  • Execute
    Code:
    adb push 'governor-file' /data/local/tmp
    - this copies file on phone
  • Run adb shell or terminal - whatever you like
  • Execute following commands:
Code:
su
cd /data/local/tmp
insmod 'governor-file'
echo "governor-name" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "governor-name" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
Now governor should works :)

IO SCHEDULERS

General info:
Information about io schedulers: I/O Schedulers

SIO
Simple I/O scheduler aims to keep minimum overhead to achieve low latency to serve I/O requests. No priority quesues concepts, but only basic merging. Sio is a mix between noop & deadline. No reordering or sorting of requests.

Advantages:
  • Simple, so reliable.
  • Minimized starvation of requests.
Disadvantages:
  • Slow random-read speeds on flash drives, compared to other schedulers.
  • Sequential-read speeds on flash drives also not so good.
File name: axperiau_sio-iosched.ko
Scheduler name: sio

V(R)
Unlike other schedulers, synchronous and asynchronous requests are not treated separately, instead a deadline is imposed for fairness. The next request to be served is based on it's distance from last request.

Advantages:
  • May be best for benchmarking because at the peak of it's 'form' VR performs best.
Disadvantages:
  • Performance fluctuation results in below-average performance at times.
  • Least reliable/most unstable.
File name: axperiau_vr-iosched.ko
Scheduler name: vr

Manual installation:
  • Unzip file
  • Copy 'scheduler-file' to directory where you have adb
  • Execute
    Code:
    adb push 'scheduler-file' /data/local/tmp
    - this copies file on phone
  • Run adb shell or terminal - whatever you like
  • Execute following commands:
Code:
su
cd /data/local/tmp
insmod 'scheduler-file'
echo "scheduler-name" > /sys/block/mmcblk0/queue/scheduler
Now scheduler should works.

VERSION INFO
LULZACTIVEQ:
v005:
- based on latest sources of lulzactiveq,
- code cleanup,

v004: in tests,

v003:
- based on latest sources of lulzactiveq,

v002:
- tuned parameters,
- when screen is off - max cpu freq in policy is changed to 200MHz,

v001:
- will load on any SE 3.0.x kernel and any SE devices with U8500 CPU,

PEGASUSQ:
v003:
- code cleanup,

v002:
- tuned parameters,
- when screen is off - max cpu freq in policy is changed to 200MHz,

v001:
- will load on any SE 3.0.x kernel and any SE devices with U8500 CPU,

VR, SIO:
v001:
- will load on any SE 3.0.x kernel and any SE devices with U8500 CPU,

ONDEMANDAX:
v004:
- will load on any SE 3.0.x kernel and any SE devices with U8500 CPU,

v003:
- added all features that I discovered while developing SmartASS to original ondemand code - so it's save battery now as SmartASS and no longer screen-off profile is needed.

SMARTASS:
v008:
- code cleanup,
- should be less laggy then previous version,

v007:
- will load on any SE 3.0.x kernel and any SE devices with U8500 CPU,

v006:
- few parameters tuned,

v005:
- changed logic - so now should work more stable,
- when screen is off - max cpu freq in policy is changed to 200MHz,
- few parameters tuned,

v004:
- minor changes for screen off power saving,

v003:
- fixed logical bug in code,

v002:
- added sleep_max_freq and sleep_rate_jiffies - to change SMARTASSV1 behavior,
- added apk that automates install and run smartass after boot,

v001:
- just initial version fixed to work with Xperia U.

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
 

Attachments

  • axperiau_smartass_6.1.1.B.1.10_v003.zip
    182.6 KB · Views: 629
  • axperiau_smartass_6.1.1.B.1.10_v004.zip
    505.4 KB · Views: 285
  • axperiau_smartass_6.1.1.B.1.10_v005.zip
    502.8 KB · Views: 981
  • axperiau_smartassv006_ondemandv003_6.1.1.B.1.10.zip
    531.3 KB · Views: 432
  • axperiauv002_smartassv007_ondemandaxv004_pegasusqv001_siov001_vrv001.zip
    248.9 KB · Views: 531
  • SmartGovernorsv201.apk
    214.1 KB · Views: 1,273
  • axperiau_governors_v203_smartassv007_ondemandaxv004_pegasusqv002_siov001_vrv001.zip
    601.8 KB · Views: 496
  • axv205_smartassv007_ondemandaxv004_pegasusqv002_lulzactivev003_siov001_vrv001.zip
    651.4 KB · Views: 459
  • axv208_smartassv008_ondemandaxv005_pegasusqv003_lulzactivev005_siov001_vrv001.zip
    644.3 KB · Views: 2,524
  • cpufreq_conservative.zip
    5.6 KB · Views: 230
Last edited:

gengi

Senior Member
Jan 9, 2011
822
163
But were do you install the module ?

Edit: Forget i have seen it. XD

I copied the file to /data/local/tmp and run the comands on terminal but i don´t have smartass governor. Any idea?
 
Last edited:
  • Like
Reactions: esgie

Tonhos

Senior Member
Dec 23, 2011
56
8
Same here, I followed the tutorial twice, but it dint't work.
No smartassV2 showed on SetCPU.

Ps. Did the tutorial using adb on windows
 

AnDyX

Senior Member
May 27, 2008
195
452
Ruda Śląska
Same here, I followed the tutorial twice, but it dint't work.
Ps. Did the tutorial using adb on windows

When you do this right (I assume that phone is rooted of course ) - following things should happens:

after
Code:
adb push axperiau_smartass2.ko /data/local/tmp
console should show speed of copied file to phone.

after following commands in phone shell:
Code:
su
cd /data/local/tmp
insmod axperiau_smartass2.ko

you can run following command:
Code:
dmesg

and one of last lines should contains:
Code:
<6>[  420.308380] axperiau_smartass2: module v001 for device Xperia U loaded

This means that module is loaded and ready to run.

last two command enables smartass in phone
Code:
echo "smartassV2" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "smartassV2" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor

No smartassV2 showed on SetCPU.
Ps. Did the tutorial using adb on windows

I don't know if SetCPU shows smartass but OS Monitor shows it.

You will never get it.

You will never know - the only problem is time :)
 

AnDyX

Senior Member
May 27, 2008
195
452
Ruda Śląska
Andyx, is possible gets CWM fully working with locked bootloader, only bug is mount the system

I really don't know because I'm not involved in any CWM related stuff. But on the other hand - apk with smartass service is ready - I need to test it on my Xperia U but this happens when I will be know battery life on current version of Smartass.

Stay focused.
 
  • Like
Reactions: dlac

aca89

Senior Member
Oct 6, 2009
500
128
Redmi K20 Pro
Google Pixel 7 Pro
How can we tweak those settings you mentioned in first post. Can you list them all? Just flashed this, monitoring battery right now.

Can this coexist with setcpu or do we have to uninstall setcpu?

Sent from my ST25i using Tapatalk 2
 

AnDyX

Senior Member
May 27, 2008
195
452
Ruda Śląska
Can you make a cwm flashable version?
Thx

As I'm said - I prepared apk version - just need to be tested.

How can we tweak those settings you mentioned in first post. Can you list them all? Just flashed this, monitoring battery right now.

Can this coexist with setcpu or do we have to uninstall setcpu?

Sent from my ST25i using Tapatalk 2

Settings described in 1st post. I don't know if SetCpu detects smartassv2 at all.

I don't use SetCPU.
 
  • Like
Reactions: aca89

AlenKing

Senior Member
Dec 7, 2011
235
201
Sarajevo
You will never get it.

Sent from my ST25i using xda app-developers app

hhahahhahahahahhah :good:

and am going to test this gov and BTW am using antutu cpu master pro and probably it will recognize this gov and do i have permission to change some things in govs core for those of us who want and need some things actually working when screen is off ( like music, wifi etc) OR COULD YOU DO THAT PLEASE I MEAN JUST TO BE CLASIC SMARTASS V2 CAUSE YOU KNOW YOUR WORK BETTER THEN ME AND YOU WILL GET IT BACK TO CLASSIC EASIER AND FASTER hhehe thanks in advance bro ;)
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 83
    As usually I made my ow version of Smartass governor for phone I have. I couldn't break 1 day battery life on stock governor - so I started write my own and finally looks like there will be up to 4 days with this version of smartass governor. But I don't use my phone for listening music etc. So when phone has screen off - I require that it does nothing.
    This thread still evolves - now will consist following parts:
    • Governors
    • IO Schedulers

    Prerequisites:
    - for latest version: any SE based 3.0.x kernel and U8500 based device,
    - up to smartass v006 Xperia U with stock 6.1.1.B.1.10 ROM,
    - root,
    - desire to replace SetCPU - when used only for 'ScreenOff' profile.

    Automatic installation using apk:
    • Use app from this post (starting from v003 it is inside zip file),
      After install there is just simple button to run any desired governor and io scheduler.
      When phone boots again- there is service that boots with phone called 'SmartAss v.00x'.
      You can check it on: Settings->Applications->Running - I believe.
      When you click on it - there is details with timer that shows how long this service run. After 1min service will install desired governor and scheduler and run it again and close itself.
    • If you try to upgrade app - reboot phone to load new version. If this not works - remove app - reboot phone and load new one.

    GOVERNORS

    General info:
    - information about governors is here,
    - a lot of information about performance, battery draining: Battery, Governors, and...: Tips and Conclusions
    - more information about 'smartass' governor is here or here,
    - how different governors work is explained here: [Q] SetCPU governors (explained).

    ONDEMANDAX
    The benefits:
    - CPU when screen is off is capped to 200MHz,
    - behaves as ondemand governor when screen is on,
    - no need for sleep-off profile,
    Governor file: axperiau_ondemandax.ko
    Governor name: ondemandax

    PEGASUSQ
    Samsung's own multi-core aware governor. Pegasusq is basically an ondemand based governor which also controls hotplugging.
    Information about this governor: Pegasusq Governor
    Governor file: axperiau_pegasusq.ko
    Governor name: pegasusq

    LULZACTIVEQ
    Lulzactiveq is a modified lulzactive governor authored by XDA member robertobsc and is adapted in Siyah kernel for GS2 and GS3. Lulzactiveq aims to optimize the second version of luzactive from Tegrak by a) providing an extra parameter (dec_cpu_load) to make scaling down more sensible, and b) incorporating hotplug logic to the governor. Luzactiveq is the first ever interactive based governor with hotplugging logic inbuilt (atleast the first of its kind for the exynos platform). When CPU comes out of idle loop and it's time to make a scaling decision, if load >= inc_cpu_load CPU is scaled up (like original luzactiveq) and if load <dec_cpu_load, CPU is scaled down. This possibly eliminates the strict single cut-off frequency for luzactiveq to make CPU scaling decisions. Also, stand hotplug logic runs as a separate thread with the governor so that external hotplugging logic is not required to control hotplug in and out (turn On and Off) CPU cores in multi core devices like GS2 or GS3. Only a multi core aware governor makes real sense on muti-core devices. Lulzactiveq and pegasusq aims to do that.
    Governor file: axperiau_lulzactiveq.ko
    Governor name: lulzactiveq

    SMARTASSV2
    The benefits:
    - CPU when screen is off is capped to 200MHz,
    - 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),
    Governor file: axperiau_smartass2.ko
    Governor name: smartassV2

    Manual installation:
    • Unzip file
    • Copy 'governor-file' to directory where you have adb
    • Execute
      Code:
      adb push 'governor-file' /data/local/tmp
      - this copies file on phone
    • Run adb shell or terminal - whatever you like
    • Execute following commands:
    Code:
    su
    cd /data/local/tmp
    insmod 'governor-file'
    echo "governor-name" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    echo "governor-name" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
    Now governor should works :)

    IO SCHEDULERS

    General info:
    Information about io schedulers: I/O Schedulers

    SIO
    Simple I/O scheduler aims to keep minimum overhead to achieve low latency to serve I/O requests. No priority quesues concepts, but only basic merging. Sio is a mix between noop & deadline. No reordering or sorting of requests.

    Advantages:
    • Simple, so reliable.
    • Minimized starvation of requests.
    Disadvantages:
    • Slow random-read speeds on flash drives, compared to other schedulers.
    • Sequential-read speeds on flash drives also not so good.
    File name: axperiau_sio-iosched.ko
    Scheduler name: sio

    V(R)
    Unlike other schedulers, synchronous and asynchronous requests are not treated separately, instead a deadline is imposed for fairness. The next request to be served is based on it's distance from last request.

    Advantages:
    • May be best for benchmarking because at the peak of it's 'form' VR performs best.
    Disadvantages:
    • Performance fluctuation results in below-average performance at times.
    • Least reliable/most unstable.
    File name: axperiau_vr-iosched.ko
    Scheduler name: vr

    Manual installation:
    • Unzip file
    • Copy 'scheduler-file' to directory where you have adb
    • Execute
      Code:
      adb push 'scheduler-file' /data/local/tmp
      - this copies file on phone
    • Run adb shell or terminal - whatever you like
    • Execute following commands:
    Code:
    su
    cd /data/local/tmp
    insmod 'scheduler-file'
    echo "scheduler-name" > /sys/block/mmcblk0/queue/scheduler
    Now scheduler should works.

    VERSION INFO
    LULZACTIVEQ:
    v005:
    - based on latest sources of lulzactiveq,
    - code cleanup,

    v004: in tests,

    v003:
    - based on latest sources of lulzactiveq,

    v002:
    - tuned parameters,
    - when screen is off - max cpu freq in policy is changed to 200MHz,

    v001:
    - will load on any SE 3.0.x kernel and any SE devices with U8500 CPU,

    PEGASUSQ:
    v003:
    - code cleanup,

    v002:
    - tuned parameters,
    - when screen is off - max cpu freq in policy is changed to 200MHz,

    v001:
    - will load on any SE 3.0.x kernel and any SE devices with U8500 CPU,

    VR, SIO:
    v001:
    - will load on any SE 3.0.x kernel and any SE devices with U8500 CPU,

    ONDEMANDAX:
    v004:
    - will load on any SE 3.0.x kernel and any SE devices with U8500 CPU,

    v003:
    - added all features that I discovered while developing SmartASS to original ondemand code - so it's save battery now as SmartASS and no longer screen-off profile is needed.

    SMARTASS:
    v008:
    - code cleanup,
    - should be less laggy then previous version,

    v007:
    - will load on any SE 3.0.x kernel and any SE devices with U8500 CPU,

    v006:
    - few parameters tuned,

    v005:
    - changed logic - so now should work more stable,
    - when screen is off - max cpu freq in policy is changed to 200MHz,
    - few parameters tuned,

    v004:
    - minor changes for screen off power saving,

    v003:
    - fixed logical bug in code,

    v002:
    - added sleep_max_freq and sleep_rate_jiffies - to change SMARTASSV1 behavior,
    - added apk that automates install and run smartass after boot,

    v001:
    - just initial version fixed to work with Xperia U.

    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
    7
    can you make this flashable for cwm?

    Choose smartassV1 with SetCPU.
    6
    I left my phone for 10 hours and with new version of pegasusq governor battery drops only for 4%. It is quite impressive and the same result has smartass on my phone. I added new version in 1st post with following changes for pegasusq governor:
    - tuned parameters - I found it on xda,
    - when screen is off - max cpu freq in policy is changed to 200MHz.
    5
    I added simple app that automates use of smartass governor (ScreenShoots are in 1st post too). After install there is just simple button to run smartass. After restarting phone - there is service that boots with phone called 'SmartAss v.002'. You can check it on: Settings->Applications->Running - I believe. When you click on it - there is details with timer that shows how long this service run. After 1min service will install smartass governor and run it again and close itself. Hopefully I will have enough time to make application that allow to change all settings in governor - so no other app will be required :)
    3
    OndemandAX now

    i'm user Xperia U with Stock ROM+root=v6 superchager
    please Explain to use if instal via cwm and manual?
    i don't understand
    and i hear to more user after using smartass (via cwm) experience lag and flash again with flashtool
    please

    users says that there is a lag in phone menu - but this depends on personal feelings

    should I set profiles or is it build in automatically?
    It depends what you want:
    - if you want have smartass when screen if off and ondemand when screen is on - use profiles,
    - otherwise profiles are not required,

    I know this Module is for rooted 6.1.1.B.1.10 (ICS), anyone knows if it works in GB? Thanks
    nope - currently only 6.1.1.B.1.10 is supported,

    I cannot upgrade smartass. flashing via cmw of smartv5 didn't work, still remain v3. how can i upgrade without install setcpu? because i use rom toolbox pro for everything, cpu governor included. but i wish upgrade the version of smartass !!

    If you know how to mount system partision in rw - you can copy smartass over existing one.



    After all - I managed to merge all power saving features from smartass into ondemand governor. After 9h over night - governor took only 5% so its quite good comparing to original one. If you want to try - use zip from this post - there is only kernel module now - so you can only install it manually.

    Unpack from zip and then copy on phone:
    Code:
    adb push axperiau_ondemandax.ko /data/local/tmp

    And then run it:
    Code:
    cd /data/local/tmp
    insmod axperiau_ondemandax.ko
    echo "ondemandAX" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    echo "ondemandAX" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor

    Note: Don't use screen-off profile - this governor has build in screen-off feature.