Possible tweak/script/tasker task to conserve battery while on screen off - ZenFone 2 Android Development

Hi everyone,
I have experimented on some commands that i then integrated to my tasker that might help me conserve battery life.
btw, my inspiration to doing this is http://forum.xda-developers.com/showpost.php?p=61994046&postcount=350
In the link above, a user named aziz07 (btw, thanks) was suggesting an app that will put some cores of our ZF2 to offline when screen is OFF. however, the app isn't free, well, at least the updated version of the app. So I've decided to emulate this using tasker, see below...
PROFILE:
Name: CPU Sleep
Trigger: STATE > Display State Off
Task: named CPU OFF
1. Run shell command echo 0 > /sys/devices/system/cpu/cpu3/online
2. Run shell command echo 0 > /sys/devices/system/cpu/cpu2/online
3. Run shell command echo 0 > /sys/devices/system/cpu/cpu1/online
Exit Task: named CPU ON
1. Run shell command echo 1 > /sys/devices/system/cpu/cpu3/online
2. Run shell command echo 1 > /sys/devices/system/cpu/cpu2/online
3. Run shell command echo 1 > /sys/devices/system/cpu/cpu1/online
You need ROOT to achieve this.
Anyway, i've been on this config for the past 3 hours and so far it is working, as seen in 3C toolbox
UPDATE:
1. Observations
1.1. Shutting the 3 cores causes lag during the first few seconds on screen on, so launching apps in gestures sure is laggy. i.e. camera.
1.2. Downloading while screen off(3 cores offline) actually slows down the download process by more than five times the usual speed when all cores are online.
1.3.Once I've turned on the cores again, the cores speed are no longer underclocked(that is if you set it to boot in underclocked mode), hence i needed to issue more commands to revert it to my underclocked mode.
2. Current setup
1.1. This doesn't cause any lag
1.2. download speed while screen on or screen off are the same
1.3. it will reset all cores to my desired underclocked setup.
NOTE: I am using 2.3Ghz with 64GB model.
PROFILE:
Name: On Boot ****(This will set max speed for all cores to 1.5Ghz)
Trigger: EVENT > Device Boot
Task: named Cpu Scalling
1. echo interactive > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
2. echo 1500000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
3. echo interactive > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
4. echo 1500000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
5. echo interactive > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
6. echo 1500000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
7. echo interactive > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
8. echo 1500000 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
Name: CPU Sleep
Trigger: STATE > Display State Off
Task: named CPU OFF ****(This will set max speed of remaining cores to 833MHz)
1. Run shell command echo 0 > /sys/devices/system/cpu/cpu3/online
2. Run shell command echo 0 > /sys/devices/system/cpu/cpu2/online
3. echo 833000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
4. echo 833000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
Exit Task: named CPU ON ****(This will set max speed for all cores to 1.5Ghz)
1. Run shell command echo 1 > /sys/devices/system/cpu/cpu3/online
2. Run shell command echo 1 > /sys/devices/system/cpu/cpu2/online
3. echo interactive > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
4. echo 1500000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
5. echo interactive > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
6. echo 1500000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
7. echo interactive > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
8. echo 1500000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
9. echo interactive > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
10. echo 1500000 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq

I didn't even know that our cpu cores weren't going offline. Thanks for the tip and info. Will give it a go as well.

Well i think in screen off, it will be in deep sleep and not going to consume battery
And second i did this with the hope it will increase screen on time, turned off 2 cores for 2 to 3 days and no use it gave battery life as same as 4 cores battery life and screen on time...

lols The app is 1,86$ but anyway, I see that the cores stay in sleep mode even after screen is on. The app is not working properly so I contacted and donated some funds to its maker.

ansebovi said:
Well i think in screen off, it will be in deep sleep and not going to consume battery
And second i did this with the hope it will increase screen on time, turned off 2 cores for 2 to 3 days and no use it gave battery life as same as 4 cores battery life and screen on time...
Click to expand...
Click to collapse
Well, I have doubts as well that's why i stated might, but I'll observe for the meantime. btw, in sleepmode, are the cores offline or just running on very low frequency?

aziz07 said:
lols The app is 1,86$ but anyway, I see that the cores stay in sleep mode even after screen is on. The app is not working properly so I contacted and donated some funds to its maker.
Click to expand...
Click to collapse
yup. I saw from its reviews that it doesn't work on other device that is why i resorted to this. You are blessed that you can donate.

I am a student on financial aid so I can affort the 1.86$ app + 5$ voluntary donation Waiting for the developer's reply ; Maybe a new governor will surface
Its actually Illegal what you just did , you took his idea/script and post it here saying its now free without posting his OP? I linked his OP thread in my beforehand post that you did not quote here either. If you can't afford 1.86$, how come you are using a pc with internet and I guess living somewhere?
You should link his OP and contact him 1st, otherwise a mod will delete this thread. His app is actually better since you don't need Tasker or any other app in the background

aziz07 said:
I am a student on financial aid so I can affort the 1.86$ app + 5$ voluntary donation Waiting for the developer's reply ; Maybe a new governor will surface
Its actually Illegal what you just did , you took his script and post it here saying its now free without posting his OP? I linked his OP thread in my beforehand post that you did not quote here either. If you can't afford 1.86$, how come you are using a pc with internet and I guess living somewhere?
Click to expand...
Click to collapse
I didn't do anything illegal because i never took any script from anyone. its a simple linux command that is publicly available. Google it if you must. I just automated it using tasker that i purchased.
anyways, i don't mean to disrespect you financial student, but please refrain from accusing people. here it is called slander. and guess what? it can put you behind bars.
by the way, did i say i cannot afford to pay for it? Why do you have so many assumptions?

xgneilx said:
yup. I saw from its reviews that it doesn't work on other device that is why i resorted to this. You are blessed that you can donate.
Click to expand...
Click to collapse
Whats those words then? You can donate any mount you can, e.g. 1$. The rest is on the mods.

aziz07 said:
Whats those words then? You can donate any mount you can, e.g. 1$. The rest is on the mods.
Click to expand...
Click to collapse
simple really... it just tells you that... you are blessed. that's actually a positive thing that you view differently.
yup. the mods have all the right to put this thread down if they found that I've stolen any code/script from someone.

It's been a few years since I've used it but I'm pretty sure you can set up a profile in 3c toolbox's device manager to achieve this. There are probably a lot of other kernel control apps that can achieve similar.
On the other hand I might be completely wrong
Sent from my ASUS_Z00ADA using Tapatalk

corrsea said:
It's been a few years since I've used it but I'm pretty sure you can set up a profile in 3c toolbox's device manager to achieve this. There are probably a lot of other kernel control apps that can achieve similar.
On the other hand I might be completely wrong
Sent from my ASUS_Z00ADA using Tapatalk
Click to expand...
Click to collapse
Hmm, how, I have looked in dev manager but nothing about turning off the cores ? I have tried tons of battery apps e.g. DS Battery and nothing really turned off the cores.
It would be awesome if it was in 3C Tool box Pro since I already have it and don't want lots of apps at boot.

use kernel auditor and u can untick or tick cores..

ansebovi said:
use kernel auditor and u can untick or tick cores..
Click to expand...
Click to collapse
There must be a better way like integrating a new governor or something in the Kernel. I use 400Kb no frill CPU changer, it auto close at boot after doing its job. I don't like heavy double function background apps. Kernel Adiutor and Trick kept running in background.

aziz07 said:
There must be a better way like integrating a new governor or something in the Kernel. I use 400Kb no frill CPU changer, it auto close at boot after doing its job. I don't like heavy double function background apps. Kernel Adiutor and Trick kept running in background.
Click to expand...
Click to collapse
no really it wont run in background[it doesnt need to run actually],if u have doubt use greenify and hibernate..

aziz07 said:
Hmm, how, I have looked in dev manager but nothing about turning off the cores ? I have tried tons of battery apps e.g. DS Battery and nothing really turned off the cores.
It would be awesome if it was in 3C Tool box Pro since I already have it and don't want lots of apps at boot.
Click to expand...
Click to collapse
Check out the screenshots. You can set the individual cores to go offline when screen is off.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Sent from my ASUS_Z00ADA using Tapatalk

The app works. I can't vouch for the script version, but the paid app on Google Play turns off the cores. https://dl.pushbulletusercontent.co...sMepy1yzDO/Screenshot_2015-07-23-06-53-38.png Cores went offline automatically, I never turned them off.

corrsea said:
Check out the screenshots. You can set the individual cores to go offline when screen is off.View attachment 3415607View attachment 3415610View attachment 3415611
Sent from my ASUS_Z00ADA using Tapatalk
Click to expand...
Click to collapse
I have tried this but it will keep 3 cores off even when screen is on. Did you try to check with 3C Toolbox if cores came back online after screen wakeup?
@ansebovi, both apps will run in backgound, check in app manager. They come back after I kill them. No-frill app will autoclose after boot just like 3C Toolbox. Changing CPU governors result in freezing in 3C Toolbox, that is why I use no-frill CPU changer.
Thanks

I tried the tasker version last night. It works but for whatever reason my core 3 doesn't seem to be waking anymore. Will try to find cause.
Sent from my ASUS_Z00AD using Tapatalk

aziz07 said:
I have tried this but it will keep 3 cores off even when screen is on. Did you try to check with 3C Toolbox if cores came back online after screen wakeup?
@ansebovi, both apps will run in backgound, check in app manager. They come back after I kill them. No-frill app will autoclose after boot just like 3C Toolbox. Changing CPU governors result in freezing in 3C Toolbox, that is why I use no-frill CPU changer.
Thanks
Click to expand...
Click to collapse
i am using,see the att...u can see it didnt even wake my device

Related

[Q] RAM became a monster, system stuffs become "restarting"

Hello guys!
I would like to share something weird I encountered and to me, I feel weird about it. Any clarification would be appreciated!
You see, whenever I intensively uses my phone, that is when I use my browser to do everything (manage my site post to forums bla bla bla), I found out that my phone seems to be lacking memory, well you know that event where some apps are closed and does not run in background. After checking the running apps section in settings I found out 4 system process shown to be restarting without being actually restarted!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Qualcomm.atfwd makes me more afraid about this problem!
Can someone give me a thorough explanation? I faced this once on DoomLord's advanced stock kernel, however (flashed and) being on the stock (Sony) kernel does relieves this problem but at some point in time I got this problem again. The difference between now and then is that then, the free RAM is merely 20MB (DoomLord's kernel) but gladly now the free RAM is about 170MB (Stock kernel). However this problem still bugs me out. Sometimes it throws me into an unexpected soft reboot!
There is a fix - a reboot turns the system back into its calm state. However, I want to know more about this and if there is a workaround, I would really appreciate it!
UPDATE
If I experience this problem for only less processes (eg 2), the processes will return to be okay after leaving the phone without use.
Test supercharger
Gesendet von meinem Xperia SP
Main post updated. For easy understanding....
joke19 said:
Test supercharger
Gesendet von meinem Xperia SP
Click to expand...
Click to collapse
I will look into that, but at the time being, I want to know what actually causes this to happen
This happens when you use Chrome, is it?
And.. can you post what are values you get when doing following command in a terminal emulator..
Code:
cat /sys/module/lowmemorykiller/parameters/minfree
mrhnet said:
This happens when you use Chrome, is it?
And.. can you post what are values you get when doing following command in a terminal emulator..
Code:
cat /sys/module/lowmemorykiller/parameters/minfree
Click to expand...
Click to collapse
No, I use Firefox... Here is the terminal output:
15000,17532,20065,22598,25131,30263
(## This post got longer than I thought.. apologies mate.. )
TechnoSparks said:
No, I use Firefox... Here is the terminal output:
15000,17532,20065,22598,25131,30263
Click to expand...
Click to collapse
I haven't used Firefox much.. is it a memory hog? I'm assuming you're on stock kernel.
Those output values indicate minfree values of low memory killer (LMK) driver, as you may already know. It's in pages, 1 page=4K, so those values in MB:
58,68,78,88,98,118
These stock rom values don't make much sense.. it means that when "free ram" goes below 58mb, LMK driver should kill the Foreground app, which is in the foreground and which we're interacting with! Why do we need to kill that?? So, these values were causing problems for me (I think ) eg. Asphalt8 shutting down in the middle of the game [it's memory intensive, so ram might be going down to that level]. What might be happening in your case is that when using Firefox with many web pages open, if free ram goes quite low, apps might be shutting down. Some techie things about that below.. skip if boring
As you may already know, apps/processes in Android are assigned an oom_adj value, which indicates the likelihood of it being killed when an out of memory (OOM) situation occurs. More higher it's value, more likelihood of it getting killed. Valid range -17 to +15. (-17 range means it won't get killed). According to that, there are six groups, into which apps/processes will be assigned:
1. Foreground app
2. Visible app
3. Secondary server
4. Hidden app
5. Content provider
6. Empty app
Read details about them here: http://forum.xda-developers.com/showthread.php?t=622666
Foreground apps usually have an oom_adj value of 0 or less, so they are the least killable. Empty apps have a higher oom_adj and they are killed early. Also, oom_adj value changes according to the state of the user app; 0 when it's at foreground and assigned a higher value when the app goes to the background.
Above 6 categories correspond with the 6 memory limits which are set in LMK minfree values. Practically in your case, Empty apps will get killed when ram goes below 118mb, content providers when 98mb, and so on.. lastly killing foreground apps when ram goes below 58mb. So, what you see being killed belong to one of the groups, which might have got killed accordingly when ram went low.
[Highlight]Note:[/highlight] In our SP (and newer kernels), oom_score_adj is used instead of old oom_adj. (oom_score_adj valid range is -1000 to 1000). But oom_adj is maintained for compatibility I think. End of boring stuff..
##You can check the minfree values (also change them) and see the app states with this Memory Manager app easily:
If you click on an app in the list and select 'more info', you can see it's oom_adj value. In my case, System UI has -12 (foreground), Home Launcher has 1 (visible group) etc.. You can check this manually in a terminal too.. but boring.. : (commands with output posted below)
E.g. take home launcher. Find out it's PID (process ID) like this..
Code:
$ ps |grep home
u0_a26 1653 721 471408 78076 ffffffff 00000000 S com.sonyericsson.home
It's pid is 1653. To see it's oom_adj value..
Code:
$ cat /proc/1653/oom_adj
1
It's 1 (foreground). You might get 6 (hidden). So, your home is easily killed than my home . See below why..
At the same time you can see the new oom_score_adj..
Code:
$ cat /proc/1653/oom_score_adj
58
To convert it to old oom_adj value..
oom_adj=(oom_score_adj x 17)/1000
So, 58 x 17 /1000 = ~1
*There's another value (0-1000) of oom_score (cat /proc/1653/oom_score), which is THE actual indicator of how likely a process will get killed. It changes according to the tunable oom_score_adj and other factors..? something like that.. forget it!
[Highlight]So, the things you can do..[/highlight]
1. Change the minfree values to suit your needs. Use lower values if you want more multitasking. Higher values if need more "free ram" for gaming etc.. (see below.. what's this "free ram"?). I use 8,12,45,65,95,165 for more multitasking and for foreground apps to stay until ram becomes much lower. Asphalt8 never crashed with this!
You can set those values with the above Memory Manager app (and tick 'apply at boot'). Need root access..
Or do the boring manual way..
Code:
echo "2048,3072,11520,16640,24320,42240" > /sys/module/lowmemorykiller/parameters/minfree
(after "su" command of course; need root for that).
This won't survive reboot. You can run this command as a script with init.d every boot. (For init.d support, check this). If you have init.d support, you can use Minfree Manager app to set minfree values, and it saves a script under init.d. No hassle.
2. Use 'App Settings' xposed module to make any app "stay" in memory (make it "Resident"). It possibly reduces the oom_adj value so it won't get killed. That's why you can see Opera Mini in the Foreground app list above in my screenshot. It's oom_adj is 0. You can do this for your home launcher and any app you wan't to stay un-killed in the background.
3. Use zeppelinrox's jar patcher tools to patch services.jar, where it changes Home Launcher priority and many other LMK related tweaks. This is why you see my home launcher is under visible apps (oom_adj 1). No launcher redraws even after asphalt8! See the particular thread for details.
4. With the above jar patching, you can use zeppelinrox's supercharger script to change the minfrees and re-group the OOM categories. It has tons of other tweaks. But for me, this OOM regrouping made some task killings much difficult and didn't relese ram readily when needed for heavy games.. So I'm not using it. I'm setting up minfrees as described above. There are some boring techie stuff about this OOM grouping thing.. but no need here.
5. Override the "Hidden app limit" of Android. In addition to the LMK thing described above, this is another mechanism that kills hidden and empty apps. Apps are killed when hidden app numbers go beyond the specified limit. Traditionally it's 15, so no more than 15 hidden apps will stay in the background even if there's plenty of ram. There's a build.prop setting which can control that in our SP. (Btw, jar patching mentioned above makes that limit to 70). With the build.prop setting mentioned below, we could make it to 150 ! (This way, we can maximize multitasking and app killing is fully handed over to LMK minfrees, which we can control).
Code:
ro.sys.fw.bg_apps_limit=150
Add this line to end of build.prop file and leave another blank line below that, and reboot. Use 70, if 150 looks scary [Highlight](Always keep cwm backups before doing these kind of things).[/highlight]
Credits to @zeppelinrox for finding that setting. You can read what happens and how to test it here in his thread.
One last thing about "free ram"..
What's reported in many apps as "free ram" is actually not free/empty. Linux/Android always tries to utilise the whole ram in some way.. So the ram is not wasted. Ram which is not used by active apps, is used for caching apps and for some buffers. You can see the ram usage with this.. "cat /proc/meminfo"
Code:
$ cat /proc/meminfo
MemTotal: 859764 kB
[B]MemFree: 26380 kB
Buffers: 2008 kB
Cached: 136600 kB[/b]
SwapCached: 0 kB
Active: 557312 kB
Inactive: 70520 kB
...blah.. ..blah...
....
Reported "free ram" was ~150mb when this was taken. ["Free RAM"=MemFree+Cached]. Out of that, most (135mb) is already cached. Actual free is very little. So, increasing "free ram" makes the phone much snappier because a larger part of the ram is used for caching things.
** I'd be more than glad if anyone points out shortcomings/improvements.
@TechnoSparks, Do you think it's useful if I organize this into a thread?

Changing CM11S Performance profiles with Tasker - Can it be done?

Note: I'm not referring to the CM Profiles such as Home, Work, etc.
I haven't purchased Tasker, nor have I used the program before. Is it possible to get Tasker to change CM11S kernel profile to Performance when screen comes on, and Power-saving profile during night hours? I am preferring Performance instead of Balanced at the moment because it makes quite a difference in responsiveness and smoothing out scrolling, but it's probably eating away at battery during non-use.
Or am I just better off waiting for a non-mpdecision custom kernel to be more stable and just use that instead? Franco for e.g.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
U can modify the highest and lowest CPU frequency with tasker which is sort of what you're looking for
Yes, you can modify the performance profile using Tasker but I you need to be rooted to change it. This is how I am using Tasker to change my CPU profile when my screen is on and off. Obviously you can change CPU settings on your own accord.
Screen off (powersave mode):
(leave CPU at 0)
CPU governor to powersave
max frequency to 1036800
(everything else leave alone)
Screen on (balanced mode):
(leave CPU at 0)
CPU governor to interactive
max frequency to 2457600
(everything else leave alone)
You don't have to limit the CPU frequency, but I figured it would be the best way to maximize the benefits of powersave mode, not to mention restricting any apps to crank up the CPU while phone is sleeping.
I would not recommend using powersave mode normally. The phone will become very unresponsive. However, I am setting my phone to screen off setting if battery is between 0-15%. That may change to 10% if if ever becomes troublesome.
Here are all the different governor settings: http://tasker.dinglisch.net/userguide/en/cpu.html
So I just updated my OPO to 30O and now Tasker says the CPU option is not available one my device.
Anyone know what is going on? Is there another option to use?
[UPDATE] Oops, I lost root.
Bump! I want this too...
I've used this but i noticed battery drain.
128
hmm i consider if it's needed to use Tasker on Lollipop
butro said:
Yes, you can modify the performance profile using Tasker but I you need to be rooted to change it. This is how I am using Tasker to change my CPU profile when my screen is on and off. Obviously you can change CPU settings on your own accord.
Screen off (powersave mode):
(leave CPU at 0)
CPU governor to powersave
max frequency to 1036800
(everything else leave alone)
Screen on (balanced mode):
(leave CPU at 0)
CPU governor to interactive
max frequency to 2457600
(everything else leave alone)
You don't have to limit the CPU frequency, but I figured it would be the best way to maximize the benefits of powersave mode, not to mention restricting any apps to crank up the CPU while phone is sleeping.
I would not recommend using powersave mode normally. The phone will become very unresponsive. However, I am setting my phone to screen off setting if battery is between 0-15%. That may change to 10% if if ever becomes troublesome.
Here are all the different governor settings: http://tasker.dinglisch.net/userguide/en/cpu.html
Click to expand...
Click to collapse
What about having one profile to set the CPU to Balanced mode when the screen is on, and having an exit task to set it to powersave?
I think I'll try that, but maybe with a delay of a minute or two before running the exit task.
Frankyg said:
What about having one profile to set the CPU to Balanced mode when the screen is on, and having an exit task to set it to powersave?
I think I'll try that, but maybe with a delay of a minute or two before running the exit task.
Click to expand...
Click to collapse
That's how I have it set up but my profile is screen off. powersave when off, exit task (screen on) is back to balanced. I do like your wait a minute after screen off idea. I just implemented that. Thanks!
Thanks, this is what I was looking for. But why only CPU 0, do we not have to repeat the same for CPU 1,2,3. I guess CPU number refers to respective cores.
And how much is tasker effecting the battery discharge being in background.
I had up and downs using Tasker to set CPU Governor, so ended up using Boeffla kernel which supports this kind of management natively as described in the FAQ page: http://www.boeffla-kernel.de/index.php/faq.
Boeffla kernel has both CM 11s and CM 12 versions, so you are covered whichever ROM you are running.
it is possible, but not with tasker!
i will write an app therefore
it's just a hour task or so, will upload it to the playstore later this week.
i don't know exactly but i think you need to be rooted, but maybe i'm wrong, will look into it later
butro said:
Yes, you can modify the performance profile using Tasker but I you need to be rooted to change it. This is how I am using Tasker to change my CPU profile when my screen is on and off. Obviously you can change CPU settings on your own accord.
Screen off (powersave mode):
(leave CPU at 0)
CPU governor to powersave
max frequency to 1036800
(everything else leave alone)
Screen on (balanced mode):
(leave CPU at 0)
CPU governor to interactive
max frequency to 2457600
(everything else leave alone)
You don't have to limit the CPU frequency, but I figured it would be the best way to maximize the benefits of powersave mode, not to mention restricting any apps to crank up the CPU while phone is sleeping.
I would not recommend using powersave mode normally. The phone will become very unresponsive. However, I am setting my phone to screen off setting if battery is between 0-15%. That may change to 10% if if ever becomes troublesome.
Here are all the different governor settings: http://tasker.dinglisch.net/userguide/en/cpu.html
Click to expand...
Click to collapse
i have set cpu , i have set governor to ondemand but don't know what to do with scheduler. Also is there screen off and on setting in it ?
AAA118 said:
i have set cpu , i have set governor to ondemand but don't know what to do with scheduler. Also is there screen off and on setting in it ?
Click to expand...
Click to collapse
Not sure what you mean about the scheduler. But the screen off and on is controlled by a new profile. Add a profile and select event, then display off. When display off is active, you select your powersave task. The exit action of display off profile, or screen on, should be activating the ondemand task, returning the device to full speed.
I did it like this to have one profile to control that one action. More efficient than two profiles, one for screen on and off.
k.harish.r said:
Thanks, this is what I was looking for. But why only CPU 0, do we not have to repeat the same for CPU 1,2,3. I guess CPU number refers to respective cores.
And how much is tasker effecting the battery discharge being in background.
Click to expand...
Click to collapse
I'd like to know that, too.
Time delay for task... how?
Frankyg said:
What about having one profile to set the CPU to Balanced mode when the screen is on, and having an exit task to set it to powersave?
I think I'll try that, but maybe with a delay of a minute or two before running the exit task.
Click to expand...
Click to collapse
Hi there! How do you set the 1 minute delay to start task?? Thanks
For example, i have it set to display off, governor battery saving and 1036800 max freq and min 300000 freq, but i want it to start the task about 1 min later, becouse sometimes rigth away we go tether again, for some reason...
Anyone knows more about this nowadays?
aussieglis said:
Anyone knows more about this nowadays?
Click to expand...
Click to collapse
user boeffla kernel + tasker. just follow the guide from boeffla site.

[KERNEL][5 Dec] T700/T705 Exynos TW Oloendithas Kernel v1.5

Hello.
Here is something I've made for myself, but I think it might be useful for someone else.
Here are some major features list:
Based on T700ANG2
CPU - 1900-250MHz, voltage control
Simple hotplug governor integrated into Interactive governor
GPU - 677-100MHz (default to 480-100), governor control, voltage control
BFQ I/O governor
FIOPS I/O governor (default)
Async fsync, dynamic fsync, dynamic read-ahead, dynamic vfs_cache_preassure
- /proc/sys/vm/[dynamic_dirty_writeback | dirty_expire_centisecs | dirty_writeback_centisecs | dirty_writeback_suspend_centisecs | dirty_writeback_suspend_centisecs]
- /sys/kernel/dyn_fsync/Dyn_fsync_active
New Google's POWERSUSPEND driver
SELinux disabled (still present in ROM)
mDNIe tunning profiles moved to /data partition to make them stick across screen off/on cycles
mDNIe brightness dependency correction mechanism (it's complicated, will be explained later in this post)
Wolfson Audio Control (thanks to AndreiLux and UpInTheAir)
- stereo DRC
- stereo EQ for both headphones and stereo speakers
- controlling EQ frequency bands explained next in this post
Init.d
Frandom random number generator
Haveged - even faster then Frandom
printk and logcat on/off interfaces (/sys/kernel/...)
Alot of debug noise removed
hundreds of performance and battery saving patches
Changelog in 2-nd post
Attention! Kernel has SELinux disabled, so you might have trouble with installed user apps if returning to kernel with SELinux enabled from this one. Thus, as always it's a good idea to make a backup.
Downloads in attachment
Source here
Now the tricky parts
Color correction
If you are not interested in waisting your life fighting for color correction, just skip this part
There are two features regarding mDNIe color correction gonna need explanation:
First one is about profiles themselves. It was explained here, but the difference now is that profiles folder was moved from /sdcard/mdnie to /data/mdnie to make loaded tunning profile stick across screen off/on cycles, so it needs to be loaded only once on boot.
To work, profile need to be copied to /data/mdnie folder and loaded as follows:
echo 1 > /sys/devices/platform/s5p-mipi-dsim.1/lcd/panel/mdnie/tuning
echo "CUSTOM1" > /sys/devices/platform/s5p-mipi-dsim.1/lcd/panel/mdnie/tuning
It's explained in details in aformentioned thread.
The second one is really tricky. It is related to non-linear color distortion. I've seen it on my previous Tab 7.7, now I see it here, so I guess true for all AMOLED screens (or maybe only Samsung's, or even maybe only SuperAMOLED). Anyway, on low brightness levels screen goes really green. It can be seen clearly on grayscale images.
So the "solution" implemented here is another one profile, which gets loaded ontop of the primary one. Assuming that the primary profile is made for maximum brightness condition, when colors are most correct, this "secondary" profile contains not actual, but shift values, the corrections, need to be applied to primary profile in lowest brightness conditions.
Example:
Suppose you have a value 0x05(5) in line 151 (red in black) of your primary profile, and you figured out that for lowest brightness you need to set that value to 0x14(20) to keep the tint visually same or close to the one in highest brightness condition. So now you just need to substract base value from corrected value and you'll get the shift:
0x14(20) - 0x05(5) = 0x0F(15)
So the value 0x0F is the one you need to have at line 150 in your secondary profile. And when you'll have the implemented algorithm can calculate corrected color values for all brightness levels in between.
Now make deep breath and please be patient a couple of minutes more. Since that mDNIe thing only supports a positive values in profiles, when it comes to addition correction value to the base value you can't just set something like -0x0F or 1x0F. So I've had to use another dirty trick.
Thus, shift values from 1 to 127 are added to base value, like in example above -- base 0x05 + shift 0x0F = corrected value 0x14.
While shift values from 128 to 255 are lowered by 127 and then substracted from the base value like this -- base 0xFD - (shift 0x8A - 0x7F(127)) = 0xF2 corrected value for lowest brightness condition.
I'll attach my personal profiles to help you understand all this better. TUNNING is for primary profile, CORRECTION is for secondary.
Script to load them on boot:
Code:
sleep 40;
echo 1 > /sys/devices/platform/s5p-mipi-dsim.1/lcd/panel/mdnie/tuning
echo "TUNING" > /sys/devices/platform/s5p-mipi-dsim.1/lcd/panel/mdnie/tuning
sleep 5;
echo "CORRECTION" > /sys/devices/platform/s5p-mipi-dsim.1/lcd/panel/mdnie/tuning_correction
PS: you can use Windows(c) calculator for hexadecimal calculations, just switch it to "Programmer" mode - Alt+3.
Parametric equalizer settings
For people not aware of what parametric equalizer is, here is a plain explanation:
It's like any regular graphic equalizer you can see in any consumer audio player or application with a difference that in regular graphic equalizer you have predefined bands like 100Hz - 400Hz - 1kHz - 6kHz - 14kHz, while for parametric equalizer you can set those bands manually.
Default values here are might be alright for external speakers, but not quite useful for a headphones.
Now, to the point.
We have a folder /sys/devices/virtual/misc/wolfson_control/ with the following EQ-related attributes:
Code:
/sys/devices/virtual/misc/wolfson_control/switch_eq_headphone
/sys/devices/virtual/misc/wolfson_control/eq_hp_freqs
/sys/devices/virtual/misc/wolfson_control/eq_hp_gain_1
/sys/devices/virtual/misc/wolfson_control/eq_hp_gain_2
/sys/devices/virtual/misc/wolfson_control/eq_hp_gain_3
/sys/devices/virtual/misc/wolfson_control/eq_hp_gain_4
/sys/devices/virtual/misc/wolfson_control/eq_hp_gain_5
Code:
/sys/devices/virtual/misc/wolfson_control/switch_eq_speaker
/sys/devices/virtual/misc/wolfson_control/eq_sp_freqs
/sys/devices/virtual/misc/wolfson_control/eq_sp_gain_1
/sys/devices/virtual/misc/wolfson_control/eq_sp_gain_2
/sys/devices/virtual/misc/wolfson_control/eq_sp_gain_3
/sys/devices/virtual/misc/wolfson_control/eq_sp_gain_4
/sys/devices/virtual/misc/wolfson_control/eq_sp_gain_5
And while it's all pretty simple with switch_eq_headphone and switch_eq_speaker, you just set 1 to on, 0 to off, so as for eq_[hp/sp]_gain_[1-5] you can set values from -12 to 12 dB.
But eq_[hp/sp]_freqs attribs are showing us some weird hex values.
So the bad news is we don't have the algorithm to generate custom values for this. The official documentation states "use WISCE software to get..." those magic values. So be brave, it's not that terrifying as you might imagine.
First you have to download that WISCE software, thankfully it's free:
http://www.wolfsonmicro.com/products/software-licence-agreement/?dl=WISCESetup.zip
http://www.wolfsonmicro.com/products/software-licence-agreement/?did=5273
Install them both.
Than start it from WM5102 shortcut.
There you'll see an "Add new system" dialog (do as on screenshots):
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
In the opened window from the tree on left select Tuning->EQ1 (or any of four EQs)
There you'll see an equalizer window
You can setup bands as you prefer
Now select "Registers" from tree on left and scroll right pane till Address RE12h.
There you'll see the values we are looking for:
You need to wright them down and you are ready load them to tablet:
Code:
echo "0x0fc6 0x03ff 0x00e8 0x1ed9 0xf11a 0x040a 0x045d 0x1e60 0xf150 0x040a 0x64cc 0x0b46 0xfed3 0x040a 0x3ab5 0xfc8f 0x0400 0x323c" > /sys/devices/virtual/misc/wolfson_control/eq_hp_freqs
.
That's pretty much it.
I'll attach a script for speaker to make them sound more bassy and sample for headphones with settings from tutorial above.
For speakers
Code:
#!/system/bin/sh
echo 1 > /sys/devices/virtual/misc/wolfson_control/switch_eq_speaker
echo 6 > /sys/devices/virtual/misc/wolfson_control/eq_sp_gain_1
echo 10 > /sys/devices/virtual/misc/wolfson_control/eq_sp_gain_2
echo -2 > /sys/devices/virtual/misc/wolfson_control/eq_sp_gain_3
echo -1 > /sys/devices/virtual/misc/wolfson_control/eq_sp_gain_4
echo -2 > /sys/devices/virtual/misc/wolfson_control/eq_sp_gain_5
For headphones
Code:
#!/system/bin/sh
echo 1 > /sys/devices/virtual/misc/wolfson_control/switch_eq_headphone
echo "0x0fc6 0x03ff 0x00e8 0x1ed9 0xf11a 0x040a 0x045d 0x1e60 0xf150 0x040a 0x64cc 0x0b46 0xfed3 0x040a 0x3ab5 0xfc8f 0x0400 0x323c" > /sys/devices/virtual/misc/wolfson_control/eq_hp_freqs
echo 5 > /sys/devices/virtual/misc/wolfson_control/eq_hp_gain_1
echo 3 > /sys/devices/virtual/misc/wolfson_control/eq_hp_gain_2
echo 0 > /sys/devices/virtual/misc/wolfson_control/eq_hp_gain_3
echo 1 > /sys/devices/virtual/misc/wolfson_control/eq_hp_gain_4
echo 3 > /sys/devices/virtual/misc/wolfson_control/eq_hp_gain_5
That's pretty much it for now.
Special thanks to
Faux123
Yank555
Halaszk
Changelog
1.5
- Updated to Samsung's ANJ5 source drop
- Stability fix
1.4
- Stability and performance improvements
1.3
- Stability and performance improvements
1.2
- Hotplug integrated into Interactive governor
- Interactive governor performance optimizations
- Stability fixes
1.1
- Disabled Intelli-Plug (luggy and unstable)
- Latest Interactive governor source from Google
- Interactive governor short circuits to optimize for IKCS cluster
- Simple hotplug governor
1.0
- Initial release
Click to expand...
Click to collapse
Tried this kernel last night, am running twrp which could be the reason, but installed fine but the OS wouldn't hold long enough to get a catlog as to why crashing.
As I say could well be twrp issue as the download says cwm... Nice to see some fresh deving in the thread though. Need to get my nose into the xda university pages
Edit: Am running Super Samsung V2, Not that TW is that super!
chrispgibbs81 said:
Tried this kernel last night, am running twrp which could be the reason, but installed fine but the OS wouldn't hold long enough to get a catlog as to why crashing.
As I say could well be twrp issue as the download says cwm... Nice to see some fresh deving in the thread though. Need to get my nose into the xda university pages
Edit: Am running Super Samsung V2, Not that TW is that super!
Click to expand...
Click to collapse
Can you please describe, how did that crash looked like?
And also have you tried to clear the dalvik-cache?
heyjoe66 said:
Can you please describe, how did that crash looked like?
And also have you tried to clear the dalvik-cache?
Click to expand...
Click to collapse
I installed it but had a screen lock issue (would not unlock-simple swipe unlock) (phone had been charging for some time with screen off). After some pressing home and power buttons, it rebooted (have taken it off for now..was using the Synapse kernel earlier..no mods or anything in kernel was being used either on Synapse or your kernel) thanks will use in future (using the Devious SuperSamsung v2 ROM on T705 LTE, rooted and flashed through twrp 2.8.0.1...did I need to do any dalvik and/or cache wipe after installation before rebooting?)
(resolved)
heyjoe66 said:
Can you please describe, how did that crash looked like?
And also have you tried to clear the dalvik-cache?
Click to expand...
Click to collapse
Hi, yes I always wipe dalvik/cache as a matter of habit...
I was experiencing crash almost as soon as android booted up, I barely had time to open the app drawer, then device just died and reboot... When I think it could be a trickster MOD conflict? I have that apply settings on boot! Will do a full backup tonight and remove to check... If that doesn't help I shall try those packages to see if they make any differences.
Cheers
Thanks! will try them
Sent from my SM-T705 using XDA Free mobile app
Have reinstaled the original file with Trickster uninstalled and all appears to be running smoothly, will try to reinstall Trickster and see how I go with that. Hopefully it was just a setting conflict...
Good work
Edit: Seemingly there was a setting conflict in trickster from stock kernel to yours which caused the system to choke! All running smooth as a touch wiz system can be expected to run... roll on AOSP rollout for this device, as I said earlier in a post, need to get the xda university pages out to try to get my own head around such a feat!
Again, nice work heyJoe66!
So for the mentally codely challenged, can we just flash each zip you have one by oneand should be awesome? Lol. And will this work for the Cyanogenmod port?
TehJorge said:
So for the mentally codely challenged, can we just flash each zip you have one by oneand should be awesome? Lol. And will this work for the Cyanogenmod port?
Click to expand...
Click to collapse
It's not necessary, if build from the first post works for you. If it's not, feel free to try, but please make a backup.
I'm pretty sure that TW kernels don't work with CM.
Thanks..it was the dalvik+cache wipe....runs well. One question..do not know if this requires kernel work but was wondering if the task manager hard key could be remapped to a menu key instead. Asked this on general forum as have seen this done for like camera and power button. Thanks (anyone)
mac231us said:
Thanks..it was the dalvik+cache wipe....runs well. One question..do not know if this requires kernel work but was wondering if the task manager hard key could be remapped to a menu key instead. Asked this on general forum as have seen this done for like camera and power button. Thanks (anyone)
Click to expand...
Click to collapse
Indeed, remaping it through /system/usr/keylayout/gpio-keys.kl file is magically useless, but if you're using Xposed Framework, there is a nice little extension called Xposed Additions, with which you can easily accomplish what you're looking for.
remapped app switcher to menu
heyjoe66 said:
Indeed, remaping it through /system/usr/keylayout/gpio-keys.kl file is magically useless, but if you're using Xposed Framework, there is a nice little extension called Xposed Additions, with which you can easily accomplish what you're looking for.
Click to expand...
Click to collapse
Well I did it...remapped
Key 254 is the app switcher...reassigned to menu and wake
commented out the original
dusted off some from n7000 days (forgotten it)
won't let me attach the .kl files but anyway
in generic.kl
# samsung
#key 254 APP_SWITCH
key 254 MENU WAKE
in gpio-keys.kl
just added
key 254 MENU WAKE
not sure if both needed that statement
now I am happier (gg)
Note..the xposed mod needed the codes anyway so I went into the system keylayout files and thought well I can just do it here
mac231us said:
Well I did it...remapped
Key 254 is the app switcher...reassigned to menu and wake
commented out the original
dusted off some from n7000 days (forgotten it)
won't let me attach the .kl files but anyway
in generic.kl
# samsung
#key 254 APP_SWITCH
key 254 MENU WAKE
in gpio-keys.kl
just added
key 254 MENU WAKE
not sure if both needed that statement
now I am happier (gg)
Note..the xposed mod needed the codes anyway so I went into the system keylayout files and thought well I can just do it here
Click to expand...
Click to collapse
Ha! So generic.kl still does something. When I was playing with HOME button remaping, I was doing it in gpio-keys.kl, so as people over web think that gpio-keys.kl does the actual mappings.
Anyway, good to know that you have what was looking for.
Hello!
I wonder if you can include the kexec-hardboot patch into your kernel?
That would be great if you could do it.
svardman said:
Hello!
I wonder if you can include the kexec-hardboot patch into your kernel?
That would be great if you could do it.
Click to expand...
Click to collapse
No problem, but gonna have to test recent changes for stability. After that will try to add this one.
I know this says its for t705 but will it work on a t700? Are the kernels compatible?
svardman said:
Hello!
I wonder if you can include the kexec-hardboot patch into your kernel?
That would be great if you could do it.
Click to expand...
Click to collapse
I've investigated this topic deeper and it couldn't find a patch for Exsynos.
So, alas, I guess I can't add it for now. Sorry.
NerdFurgison said:
I know this says its for t705 but will it work on a t700? Are the kernels compatible?
Click to expand...
Click to collapse
I can try to build it for T700, but I have no any chance to test it, so if you can try this and say if it's working, I would much appreciate that.

Battery Life Saving Tricks With Tasker

Great
Best Battery Saving Profiles For Tasker
Best Battery Saving Profiles For Tasker
Battery saving mode when battery is low on your Android
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Steps:
Go to Profile, then State and select “Power“. Choose “Battery Level” and set the desired range (let’s say from 0-20).
Create new Task and tap the “+” icon. Select “Net” and turn Bluetooth off, auto sync off, Wi-Fi off and Mobile data off (if its available on your device).
Dim Brightness at specific times
Steps:
Create new profile. Go to “Time” and select the time range in which you want to lower (or increase) the brightness.
Create a new task and tap the “+” icon. Go to “Display” and then “Display Brightness“. Select your preferred value.
Night mode or Quiet time
Steps:
Create a new profile and select time. Choose the desired time range (for example, from 00:00 – 06:30).
Create a new task and tap the “+” icon.
Go to “Audio” then set Silent mode ON or vibrate.
Go to “Net” and turn auto sync OFF and Wi-Fi OFF.
Battery saver
If you run lollipop and above you can toggle the battery saver without purchasing any app or even without rooting you phone.
ADPL said:
If you run lollipop and above you can toggle the battery saver without purchasing any app or even without rooting you phone.
Click to expand...
Click to collapse
Is it possible to toggle the battery saver from within Tasker without root?
D0rd said:
Is it possible to toggle the battery saver from within Tasker without root?
Click to expand...
Click to collapse
Yes it is possible but only above lollipop and works for marshmallow too
ADPL said:
Yes it is possible but only above lollipop and it is not tested for marshmallow.
Click to expand...
Click to collapse
I'm on Lollipop at the moment. Do you have any further information or links on this? I've been looking but can't see any that work without root.
D0rd said:
I'm on Lollipop at the moment. Do you have any further information or links on this? I've been looking but can't see any that work without root.
Click to expand...
Click to collapse
It doesn't look like this is possible unless you have root.
D0rd said:
I'm on Lollipop at the moment. Do you have any further information or links on this? I've been looking but can't see any that work without root.
Click to expand...
Click to collapse
It's a small task but very long to explain. If possible could you send me your email id. I will email you the procedure with some screenshots
I an looking to use tasker or automatic to create the following rule, incoming call=turn on BT, connect to headset, answer call; end call, turn off BT after 30 seconds. Is this wishful thinking or can it b done with one of these apps. The BT wakelock is killing me. If it matters I'm running Pure Nexus 12/19 with latest ElementalX kernel. Thanks in advance.
worth on lollipop?
nero8762 said:
I an looking to use tasker or automatic to create the following rule, incoming call=turn on BT, connect to headset, answer call; end call, turn off BT after 30 seconds. Is this wishful thinking or can it b done with one of these apps. The BT wakelock is killing me. If it matters I'm running Pure Nexus 12/19 with latest ElementalX kernel. Thanks in advance.
Click to expand...
Click to collapse
Honestly, by the time the call is received, bluetooth turned on, made a connection to your headset, and answer the call it would probably just go to voice mail. It's doable for sure but probably wouldn't help out any.
As for battery saving, here's my addition,
Quiet Time -> toggle all sounds off and set brightness to low @ 2130 until the next morning (I could probably turn off data as well)
Sync modes -> Toggle auto sync to off > enable every 30 minutes for 5 minutes > Sync> turn off sync
Thanks. I actually got it to work with Automagic app. BT turns on with incoming call or when I make a call, then turns BT off after I hang up.
My favorite battery saving tip for AMOLED device (provided you have a kernel with KCAL enabled) mimics Samsung's Ultra Power Saving mode by turning your device grayscale.
Just run this shell command to turn it grayscale:
Code:
echo "0" > /sys/devices/platform/kcal_ctrl.0/kcal_enable
echo "255 255 255" > /sys/devices/platform/kcal_ctrl.0/kcal
echo "255" > /sys/devices/platform/kcal_ctrl.0/kcal_cont
echo "0" > /sys/devices/platform/kcal_ctrl.0/kcal_hue
echo "35" > /sys/devices/platform/kcal_ctrl.0/kcal_min
echo "128" > /sys/devices/platform/kcal_ctrl.0/kcal_sat
echo "255" > /sys/devices/platform/kcal_ctrl.0/kcal_val
echo "1" > /sys/devices/platform/kcal_ctrl.0/kcal_enable
You can combine this with any context to make it run whenever you want.
Here's another battery saving tip - automatically set tasker to turn on airplane mode at say ... 1am and turn it of at ..6am. GSM modules are notorious for eating a noticeable amount of battery. There you go:
Tasker Auto Airplane Mode On/Off - http://forum.xda-developers.com/u/tasker-tips-tricks/tasker-auto-airplane-mode-off-t3316767
I can recommend an plugin for Tasker, name is Autoinput. It is very simple and awesome plugin that let you automate commands that in other cases needs root. You can for example toggle Power saving mode, Mobile data, NFC... whatever your want.
I use it daily for all different tasks since im not rooted (yet).
Hello friendz
My spend most of time in reading on cell, so the screen is the biggest sucker of my batt juice because i set screen timeout @ max(30min).
I wish any way that will increase my screen dim time(the time taken b4 screen goes to completely black) . So that I can save some amount of juice without affected my reading (hobby)
Any help would be highly appreciated.
TIA
Sent from my Lenovo P1a42 using XDA-Developers mobile app
@MishaalRahman
Try:
echo X > /sys/devices/virtual/mdnie/mdnie/accessibility
X:
0 - normalne
1 - negative
2 - greyscale
3 - Screen off but not locked and touchscreen is still working
frrancuz. said:
@MishaalRahman
Try:
echo X > /sys/devices/virtual/mdnie/mdnie/accessibility
X:
0 - normalne
1 - negative
2 - greyscale
3 - Screen off but not locked and touchscreen is still working
Click to expand...
Click to collapse
I think that only works for Samsung devices, unfortunately.
I use following profiles/tasks for battery saving;
Auto-off Unpaired bluetooth (shuts off bluetooth after 2 min IF no BT device connected)
Autosync schedule Home (sync is off 20min, turns on for 3 min, then turns off. Repeat every 20 min)
Autosync schedule Work (sync is off 2 hours, turns on for 5 min, then turns off. Repeat every 2 hour)
Switch to 2G/3G when Wifi connected (no wifi = 4G/LTE)
NFC turns OFF if not connected to my home-Wifi (NFC battery drain is negligible though..)
Turn ON high accuracy GPS when opening Google Maps (back to balanced/power saving when Maps is closed)
Nightmode = Samsung power saving mode, Wifi OFF, Mobile data OFF, Sync OFF (since not Wifi connected). All these modes activated through tap of NFC tag (about 2% battery is drained on 8-9 hours)
Is auto sync for Google?
Sent from my SM-N920T using Tapatalk

[Guide][Discussion] Advanced Interactive Governor Tweak/Config - Kirin 970 CPU

As all we know, our phone has one of the newest & most powerful CPU in the market : Kirin 970
together with a huge 4000mAh battery, this phone theoritically should deliver an extremely good battery life. And from what i experienced, this phone perform quite admirably.
That being said, when being compared to other flagships in the market (as can be seen here : https://www.youtube.com/watch?v=lXp-4QyJpmo), Mate 10 still fall short to the like of Oneplus 5 which actually has a smaller battery,
biggest factor that might affect that result , aside from the screen resolution difference, is of course, software & kernel optimisation,
in an attempt to get a better battery life out of this device, but without impacting performance, i remember one of the guide made by @soniCron i used to stumbled upon few years ago. This Guide give a very detail insight on how to optimize the interactive governor on almost any device/any kernel/any rom (as long as you have root), and thats what i gonna try to apply to our device - if you want to check the guide yourself : HERE
so i take a look into Huawei Mate 10 Kernel Sources to see the voltage values being used by this processor for each frequency step. And here's the table :
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
from that table, we can see which frequencies are using most power, and where is the most jump in voltage usage happen when switching between frequency.
Higher voltage jump will cost more power, means less battery life.
in conclusion, i found few frequencies which are unfavorable, which is
A53 CPU :
1210Mhz - because it use same power (850000µV) as 1402Mhz, so we better use 1402Mhz instead for better performance with same power cost
1556Mhz - same story, it use same power (950000µV) as 1690Mhz
and
1844Mhz - it use most power, but since this is the top freq, we can neglect it
A72CPU :
1018&1210Mhz - use same power (780000µV) as 1364Mhz, so we better off jump directly to 1364Mhz
1498Mhz - same case, it use same amount of juice (900000µV) as 1863Mhz
and
2362Mhz - it use most power, but since this is the top freq, we can neglect it
_____________________________________________________________________________________________________________________________________________________
Now we take into account of the minimum frequency needed to ensure smooth task (if you dont know what am talking about, read the GUIDE i mention in my opening paragraph) :fingers-crossed:
For Mate 10, i've found the best frequency is as following :
Idle = 509MHz
Scrolling = 1018MHz (Use Chrome browser to scroll Facebook in desktop mode)
Video = 1402MHz (Play 1080p*60fps videos in Youtube app)
App load = 1690MHz (Use any app really)
High load = 1844MHz (Max out just in case)
Using the formula take from soniCron guide, i tried calculate optimum CPU load (this will be used as target load config) config for each frequencies
If you want to see the formulas :
Code:
We want to determine 2 values for every available clock rate: the maximal efficient load and the minimal efficient load. To make this determination, we need to bust out our calculators. (Or spreadsheets!)
For the maximal efficient load, we want to correlate a load value no higher than 90% of a given clock rate before it would be more efficient to jump to the next clock rate–to avoid overwhelming a particular rate while avoiding premature jumps to the next. For this value, we calculate it as:
(clock rate * 0.9) / next highest clock rate
For example, the maximal efficient load for 600Mhz on the Nexus 5X would be caluclated as:
(600000 * 0.9) / 672000 = 80.36% (rounded and normalized: 80)
For the minimal efficient load, we want to correlate a load value at which anything higher would be better served by a higher clock rate. To calculate this:
(1 - next highest clock rate / clock rate) * -1
For example, the minimal efficient load for 600Mhz on the Nexus 5X would be calculated as:
(1 - 672000 / 600000) * -1 = 12.00% (rounded and normalized: 12)
with this config, logically speaking we want to make the Governor to favour the "best" frequencies above, and minimize the usage of unfavourable freqs.
A53
Code:
509Mhz : 45
1018Mhz : 76
1210Mhz : 15
1402Mhz : 81
1556Mhz : 8
1690Mhz : 82
1844Mhz : 90
A72
Code:
682Mhz : 60
1018Mhz : 19
1210Mhz : 13
1364Mhz : 81
1498Mhz : 24
1652Mhz :12
1863Mhz : 80
2093Mhz : 12
2362Mhz : 90
Now that we already get the optimum number, time to apply it
Use your favorite Kernel Manager, in my case, am using Kernel Adiutor, and go to CPU Config - CPU Governor Tunables and input these value (am using Hawktail profile from soniCron thread, as it seems it work best for most of devices, and i already do trial & error with some other value like timer rate as well ) :
A53 (LITTLE)
Code:
go_hispeed_load: 99
above_hispeed_delay: 20000 509000:60000 1018000:25000
timer_rate: 28000
hispeed_freq: 509000
timer_slack: 80000
target_loads: 98 509000:45 1018000:76 1210000:15 1402000:81 1556000:9 1690000:82 1884000:90
min_sample_time: 30000
boost: 0
boostpulse_duration: 80000
A72 (BIG)
Code:
go_hispeed_load: 99
above_hispeed_delay: 20000
timer_rate: 20000
hispeed_freq: 1863000
timer_slack: 80000
target_loads: 98 682000:60 1018000:18 1210000:12 1364000:81 1498000:24 1652000:12 1863000:80 2093000:12
min_sample_time: 20000
boost: 0
boostpulse_duration: 80000
Now you can test it. Do full charge and use it normally, see whether you can see the improvement or not,
Hopefully it helps you as it seems to help me (you can expect no less than 7Hrs to 10 Hrs SoT, am quite heavy user myself, with 2 WhatsApp account and 1 LINE account constantly active. YouTube & Gaming at least hour/day as well). Discussion is more than welcome here, as these are considered an initial calculations that still yet to furtherly fine tuned for our CPU.
I'm not comfortable doing this on my phone yet, but I'm looking forward to hearing from people who are!
Results so far :
Used it and didnt notice any issues. Performance was perfect.
However, I just updated so I lost root.
Does anyone know if I can just root again without wiping stuff or not?
markvd90 said:
Used it and didnt notice any issues. Performance was perfect.
However, I just updated so I lost root.
Does anyone know if I can just root again without wiping stuff or not?
Click to expand...
Click to collapse
Try this one : https://forum.xda-developers.com/mate-10/how-to/guide-mate-10-root-preserve-user-data-t3716547
@otonieru
Isn't it Min Sample Rate value for Small Cores too extreme (30 000)?
On my Kirin960 I use Min Sample Rate valuse on Big and Small Cores at 90 000 and everything is still smooth, I am not gaming though. Huawei on Kirin960 uses Min Sample Rate at 80 000 stock...
Also I am turning on the Fast Ramp Down for Big Cores and Small Cores.
But my setting are more battery oriented and still I don't loose smoothness mate.
Tried the settings on my Mate 10. I see noticeable improvement on battery and performance. I haven't noticed any issue so far. Thanks for sharing.
This thread is underrated, therefore bump.
Tweaked my CPU settings a few days ago, and the difference in battery life is very noticeable, without any obvious loss of performance or fluidity.
Not gonna talk about numbers, because every single user has a different usage scenario, but if you are interested, I recommend you to at least try it, there's nothing to lose.
I can't understand why biggest OEM's won't put a bigger emphasis on optimizations of the existing, rather than on user unfriendly "innovations".
otonieru said:
I am using Hawktail profile from soniCron thread
Click to expand...
Click to collapse
Are you talking about Hawktail from here? https://androidfilehost.com/?w=files&flid=96527
Hawktail, Hawktail1.1 or Hawktail1.2 ?
badmania98 said:
Are you talking about Hawktail from here? https://androidfilehost.com/?w=files&flid=96527
Hawktail, Hawktail1.1 or Hawktail1.2 ?
Click to expand...
Click to collapse
I can say, none of it.
The base is hawktail indeed, but a mix of all those three + an adaptation to suit our 970 cpu better
You can go to sonicron thread to read more about each specific governor parameter and the hawktail profile itself
ytgbg said:
@otonieru
Isn't it Min Sample Rate value for Small Cores too extreme (30 000)?
On my Kirin960 I use Min Sample Rate valuse on Big and Small Cores at 90 000 and everything is still smooth, I am not gaming though. Huawei on Kirin960 uses Min Sample Rate at 80 000 stock...
Also I am turning on the Fast Ramp Down for Big Cores and Small Cores.
But my setting are more battery oriented and still I don't loose smoothness mate.
Click to expand...
Click to collapse
Well, it could be, but maybe not as well, LoL
I didnt really set those number to be a really battery oriented, as this phone already have huge battery to begin with, so even small improvement can do bigger impact.
i tried bigger number, but found it stutter a bit (at least to my liking) so, those are numbers that serve me best.
But of course everyone can re-tweak it to their liking
otonieru said:
I can say, none of it.
The base is hawktail indeed, but a mix of all those three + an adaptation to suit our 970 cpu better
You can go to sonicron thread to read more about each specific governor parameter and the hawktail profile itself
Click to expand...
Click to collapse
So, I have to download hawktail profile and modify it according to your values. Where do I copy the file and how I load it in Kernel Adiutor?
or
I have to modify the interactive governor with these values?
badmania98 said:
So, I have to download hawktail profile and modify it according to your values. Where do I copy the file and how I load it in Kernel Adiutor?
or
I have to modify the interactive governor with these values?
Click to expand...
Click to collapse
No no no, no need to download anything
You can simply input the governor value in the kernel adiutor. You need donate version btw.
On a new profile or over the interactive governor?
badmania98 said:
On a new profile or over the interactive governor?
Click to expand...
Click to collapse
Over the interactive,
Then you can save it as user custom profile
Done. Lets see the result.
applied it and now charging the phone. however one doubt tho. im using kernel adiutor as a user app and applied these settings. will these settings stay even if EMUI closes the kernel adiutor? (not talking about reboot since after reboot the profile needs to be applied again(?))
already selected kernel adiutor to run in background btw.
Saadkhalid786 said:
applied it and now charging the phone. however one doubt tho. im using kernel adiutor as a user app and applied these settings. will these settings stay even if EMUI closes the kernel adiutor? (not talking about reboot since after reboot the profile needs to be applied again(?))
already selected kernel adiutor to run in background btw.
Click to expand...
Click to collapse
It will stay until reboot even if you uninstall Kernel Adiutor. Just dont apply any setting that will affect CPU, like battery saver etc
It best to allow Kernel Adiutor to launch automatically, ignore batt optimisation and run in the background though.

			
				
otonieru said:
It will stay until reboot even if you uninstall Kernel Adiutor. Just dont apply any setting that will affect CPU, like battery saver etc
It best to allow Kernel Adiutor to launch automatically, ignore batt optimisation and run in the background though.
Click to expand...
Click to collapse
thanks. can i just turn power saver on from battery setting and then apply these values? just curious.

Categories

Resources