Lineage OS 7.1.1 big.LITTLE Scaling Issue (Need help Gurus) - Lenovo Vibe P1 Questions & Answers

Hello XDA. Several days ago I flashed Lineage OS of Firelord. In all honesty, I am not happy with scaling frequency. After the ROM flashing>setup process, I learned that the default governor was set to Performance: Cores 0 and 1 are set to a static frequency of 960mhz. While Cores 2 and 3 are disabled.
Little Cluster 4,5,6,7 are set to a static frequency of 1.1ghZ.
Am not sure if this was a design to begin with or may have been overlooked. Either way, it's giving me intemittent freezes due to higher temp than stock. I tried so many Kernel Managers to manipulate the min/max scaling frequency. Was able to use the 1.46ghz frequency for a day and just reverta to 960mhz. This wasn't the case when I was stock Vibe Ui. 5.1.1 and 6.0.1
Tried this approach too: https://forum.xda-developers.com/vibe-p1/development/frequency-decrease-to-save-power-t3392943/page2 the frequency holds after flashing s272 but iT sometimes overwritten by a conflicting parameter.
I understand CM doesn't normally use mpdecision but I'd be very grateful to anyone who can extend his assistance in resolving this governor/scaling issue. I just need a min_freq of 345000 and use 1340000 frequency while playing MC5. Or stock S272 and S288 scaling frequency which can be ported/applied on this rom on boot and normal use.
I have already tried Exkernel manager, 3c toolbox, kernel adiutor. These 3 don't haveprevent changes from other apps (or system)" option unlike setcpu and nofrills. But unfortunately setcpu and nofrills aren't working on CM14. Not sure if it's due to a systemless root setup.
*

In over simplification, I would like to have a stock Lollipop/MM Interactive/Ondemand Governor be applied here. Thanks.

Related

[GUIDE] Custom Kernels: A Guide on What you Need to Know

I was searching for info about MPDecision and stumbled upon this..it's a very good read specially for beginner and those that want to know more about kernel specifics and how they work..this was written back in 2012:
---What IS a kernel?---
The ELI5 answer: "An analogy: the Kernel is like the Engine, Electrical system and the Transmission to a car. The Library, Framework and the Apps [AKA ROM] are the body frame and the rest of the Car." - faux123
In other words, the kernel is the software that controls the hardware at a very low level.
---The Stock Kernel---
The "stock" kernel is the kernel that comes with your Nexus 4 out of the box. It's compiled directly from Google's kernel source code and shipped on your device with zero modifications. A custom kernel, on the other hand, compiles the stock kernel source and adds various modifications to that code.
What are those modifications that kernel devs employ?
To understand what they mean, you need to understand the features of the stock kernel first!
What are the stock kernel parameters?
CPU min frequency: 384 MHz
CPU max frequency: 1512 MHz
Governor: Ondemand
I/O Scheduler: CFQ
What does each parameter represent?
CPU frequency: you can simply think of this as the "speed" the CPU is running at
Governor: regulates the CPU frequency based on many different parameters such as load and time-in-state. Here is an excellent list of many of the most common CPU governors and how each works. Note that you will only see a couple of the CPU governors on this list in whatever kernel you use. Ondemand and Interactive are by far the most widely used, and are the ones you should look at.
I/O Scheduler: handles how the system makes disk access; Please refer to the previous linked thread and scroll down to the 4th post for a detailed list.
What else do you need to know?
--PowerHAL--
PowerHAL is what makes Project Butter. The powerHAL is a ROM component that tells the kernel to BOOST the CPU frequency to higher values in response to UI inputs. The higher CPU frequencies can better respond to UI demands so the overall experience is smoother than without. - faux123
--mpdecision--
All Qualcomm based phones have Qualcomm prorprietary userspace binary called "mpdecision" aka m(ake)p(oor)decision. Instead of letting the kernel itself to decide what frequencies and how many cores to run, this "mpdecsion" binary polls the kernel run queue statistics and decides for the whole system the "optimal" frequency and the "optimal" number of cores to use. The concept is fine, except the decision making is done in userspace and it's 100% closed source so there's no way to tweak it and there's a latency (because all userspace binaries needs to "poll" the kernel for the latest information which is slightly delayed). - faux123
ELI5: mpdecision is a proprietary Qualcomm daemon that makes calls to the SoC (the entire chip your phone uses) to manage the cores. The OS (PowerHAL) makes a request to mpdecision and then mpdecision makes a request to the first two cores to ramp them up. - _motley
Why do kernel devs mess with these?
In practice, the PowerHAL ramping up trick successfully got rid of a lot of the UI lag since Android 4.1. However, this comes at the cost of battery life (and heat generation!) The reason for this is because the system ramps up its CPU on every touch input, rather than waiting for the kernel to calculate the load and ramp up accordingly. On the Nexus 4, when the PowerHAL makes a call to mpdecision it locks the minimum CPU to 1026 MHz upon touch input for the first two cores. While this DOES give you the buttery-smoothness you would expect, it's a bit overly aggressive. This is part of the reason why stock kernel tends to heat up your phone when you play around with it a lot.
---Custom Kernels---
What changes should I look out for?
--mpdecision--
Many kernel devs don't like Qualcomm's implementation, so they work around or get rid of it. Franco, Faux, Bricked, Matr1x, Motley, and Trinity have gotten rid of it/used their own implementations. Harsh and IntersectRaven's leave it intact. Every kernel dev implements things in their own way, and the only way to tell which is better for you is to try each one. This is by far the biggest change any kernel dev can make, as it completely alters how the system handles hotplugging and CPU scaling. In general, you'll find kernels without mpdecision running cooler, with greater battery life, but with a little more lag (made up for by other tweaks).
--thermald--
A binary that controls how to throttle your CPU based on CPU and battery temperatures. You can find the config file in /system/etc/thermald.conf. Stock configs lead to aggressive thermal throttling (battery temp. at 36 degrees C for example, which is easily achieved). You can look into the file and see the various thresholds and actions that the system takes to lower the temperature of the CPU and battery, but it isn't really necessary. Just know that some kernel devs may have changed this in order to allow your phone to run at higher frequencies for an extended period of time, or to further make your phone run cooler.
--Underclocking--
Quite straightforward, by limiting the max frequency your CPU can use, you use less power (higher frequency results in more power dissipated by the CPU).
P = C(V^2)f where C is capacitance, V is the voltage, and f is the current frequency
..gives you an idea of how underclocking (and undervolting) uses less power.
--Undervolting--
This is all the rage today, with many users trying to get as low as possible stable voltage. It's arguable how much undervolting saves battery life, but there's no doubt it reduces heat dissipated from the CPU (see: the above formula). Your CPU is located on the top half of your phone, which is likely where you've felt the heat before. How much your chip can successfully undervolt depends on what type of binned CPU you have. If you want to undervolt, I recommend checking if the voltages you set are stable by running the StabilityTest app and doing the Scaling Stability Test. The frequencies' voltages definitely don't scale linearly, so don't assume that doing global undervolts will be the best you can do. You'll have to apply voltages one by one if you truly want the lowest your chip can possible handle.
--Overclocking/overvolting--
Bricked, Trinity, and Motley's kernel implement this, because it CAN be dangerous. Overclocking usually requires overvolting the processor (so the overclock is stable) but overvolting carries with it the risk of bricking your phone by frying the CPU. Know that doing this has some risks before you try it. Some kernels like Matr1x and Faux's also allow for the GPU to be overclocked if games run a little slowly for you.
--Hotplugging--
Hotplugging is where the individual cores on your phone switch on/off depending on the load on the CPU. The advantage of hotplugging is a reduction in power used because the cores will only turn on when needed. Kernels that use the auto_hotplug binary by Thalamus (that would be Matr1x, Motley, Trinity, Bricked at the moment) allow you to fine tune the enabling and disabling thresholds. These parameters are generally for advanced users only as they require you to write scripts to control them.
--Color Control--
Gives you the ability to change color multipliers and gamma settings to calibrate your display. If you feel your display is too yellow, or you miss the previous feel of your previous phone, then you can mess around with this to get better color reproduction. You can find some user examples here to give you a good idea of what can be done. Gamma control currently requires either Faux's control app or for certain kernels you can use scripts to control them.
--Wakelock reduction--
Some kernels have reduced the msm_hsic_host wakelock duration so your phone enters deep sleep more often. How much improvement this makes is debatable, and whether or not this wakelock is even an issue is also debatable.
--Kernel modules--
Some kernels make modifications to the low-level drivers that interact with the components of your phone. An explanation of what is commonly touched can be found here. You don't really have to worry about this, just know that something is being improved when a kernel dev mentions it.
---Installing a Custom Kernel---
Just flash the zip in your recovery of choice. No need for wiping cache or anything. However, one thing to note that might save you some headache in the future is: what exactly are you flashing? When you flash a kernel, you are not just flashing the kernel, you are writing to the entire boot partition. The boot partition is made up of the kernel AND the ramdisk (the ramdisk is an image that the kernel mounts read-only at boot, it is basically used by the kernel to mount the rest of the system images). Some kernel devs pack their own ramdisk into their boot.img that you are flashing, so when you try to flash a DIFFERENT kernel, you end up in a bootloop. (An example: flash Franco kernel --> flash Faux kernel on top = bootloop.) To solve this you need to reset the ramdisk by flashing a stock reset kernel with the stock ramdisk.
Click to expand...
Click to collapse
all content taken from [URL="http://www.reddit.com/r/nexus4/related/158t1i/custom_kernels_a_guide_on_what_you_need_to_know/"]a reddit post i found which was originally written [/URL]by reddit user IAmAN00bie

System or Kernel chages cpu frequencies itself!!?

Hey guys,
i got a problem adjusting the cpu frequencies on my Galaxy S4 mini GT9195.
For example, i change it to 162mhz minimum and 1026mhz maximum and the smartassV2 govenor. Then that changes ramdomly to some weird frequencies automaticly and out of a sudden. Like 1458mhz minimum and maximum.
I use the cyanogenmod11 M7 rom and the f4ktion 1.5.0 Kernel (the cyanogen kernel does the same btw)
As App for adjusting i use the Kernel Tweaker, but even if i do it in the System settings its doing the same...
I did some undervolting, this stays as i set it.
I hope you guys can help me its annoying to check it every houre and see that it changed again and drains my battery
Sebastian
Devices using a modern qualcomm cpu, relies on two userspace daemons (mpdecision and thermald) to manage frequency and thermal throttling. So mpdecision takes care of the frequencies and cpu hot-plugging (when to engage additional cores or not), and thermald lowers the frequency if the temperature gets too high, in order to protect the cpu from overheating. This is not compatible with the frequency settings in CM or any third party app with similar functionality, as they will always override whatever you set there.
arco68 said:
Devices using a modern qualcomm cpu, relies on two userspace daemons (mpdecision and thermald) to manage frequency and thermal throttling. So mpdecision takes care of the frequencies and cpu hot-plugging (when to engage additional cores or not), and thermald lowers the frequency if the temperature gets too high, in order to protect the cpu from overheating. This is not compatible with the frequency settings in CM or any third party app with similar functionality, as they will always override whatever you set there.
Click to expand...
Click to collapse
I see.. Thanks for the answer mate, so there's no way to save battery like this? It just seems sometimes that it's stuck at some frequencies...
Well, you could make a custom boot image that disables those daemons, but it could cause more harm than good.
Sebastianm1989 said:
Hey guys,
i got a problem adjusting the cpu frequencies on my Galaxy S4 mini GT9195.
For example, i change it to 162mhz minimum and 1026mhz maximum and the smartassV2 govenor. Then that changes ramdomly to some weird frequencies automaticly and out of a sudden. Like 1458mhz minimum and maximum.
I use the cyanogenmod11 M7 rom and the f4ktion 1.5.0 Kernel (the cyanogen kernel does the same btw)
As App for adjusting i use the Kernel Tweaker, but even if i do it in the System settings its doing the same...
I did some undervolting, this stays as i set it.
I hope you guys can help me its annoying to check it every houre and see that it changed again and drains my battery
Sebastian
Click to expand...
Click to collapse
f4ktion kernel 1.5.0 is not designed for M7. For M7 use 1.4.5.
I'm right now with nightly 0703, kernel 1.5.0, mpdecision disable and MSM Hotplug enable (performance control). With this settings that bug disapeared. 162 mhz - 1728 mhz; smartassh3; ROW.
In M7, and 1.4.5 kernel, the only governor that works with 162 mhz and don't change to 1458 mhz is the Ondemand.

[Q] Stock kernel - bugs and behavior

Did anybody noticed the following bugs and behavior in stock kernel CPU controls ? If not, can you please post your ROM/build/kernel versions or even firmware version? Maybe some firmwares are fixed?
- Setting max CPU frequency actually change kernel internal min CPU frequency! eg if I set 1GHz max frequency, all cores jump to 1GHz minimum! Setting min CPU frequency seems to have no effect. Only a reboot can recover from this, sadly.
- Setting governor to interactive_eglinteractive freezes the phone which then reboots after a while.
- There doesn't seem to be any mpdecision module running, so all cores are always online, except maybe second CPU cores are turned-off in standby.
On the positive side, it appears that controlling online states of individual cores works well, good to turn off cores when screen's off for example.
I'm running latest received OTA: Android 4.3, kernel 3.4.39-2641344, build version JSS15J.N7505POUBND2.
Most of the features you are talking will not work correctly without a custom OC kernel....So let it be like it is untill we get a custom kernel....

[LG D855] CPU Frequency doesn't stick

Why doesn't the max cpu remain constant in kernel audiutor??
I have cm 13 and I have tried flashing the Nebula kernel, used their modded kernel audiutor app and max frequency doesn't stick, after I put it at 2457 MHz and try out a benchmark I would get sh**ty scores and go back to Kernel Audiutor app to find out that my new max frequency was 800 MHz (or another, max frequency was totally random) , why??? I tried flashing the 777 Kernel (maybe the kernel was the issue?) and got the same result! Cpu frequency changes after a while, am I doing something wrong? I have disabled hotplug cpu and the thermal to see if it was the case, didnt work... Any solution?
Settings > Battery > Set mode to performance - you can set this in kernel audiutor i believe (sorry my spelling is crap) but i'm not sure what section it's in.
Still doesn't work
I just tried your suggestion after a little bit of googling and finding this thread. What else could I try? I see my CPU change instantly after applying the changes ..... My phone is really lagging so that's why I need to change this stupid setting.

Is there a kernel for cpu underclock on oreo?

Is there an oreo-based kernel to perform cpu underclocking? Or maybe a way to be able to do the underclock on android 8? Because most of them are only on android nougat, but on oreo no one has developed anything yet ...
AntoKemz said:
Is there an oreo-based kernel to perform cpu underclocking? Or maybe a way to be able to do the underclock on android 8? Because most of them are only on android nougat, but on oreo no one has developed anything yet ...
Click to expand...
Click to collapse
There is an app I used on my old phone: https://play.google.com/store/apps/details?id=com.grarak.kerneladiutor
Sent from my Samsung SM-A520W using XDA Labs
AntoKemz said:
Is there an oreo-based kernel to perform cpu underclocking? Or maybe a way to be able to do the underclock on android 8? Because most of them are only on android nougat, but on oreo no one has developed anything yet ...
Click to expand...
Click to collapse
You can underclock with stock kernel if I know correctly.
The stock oreo kernel of a520f supports these features and it should apply to (Exynos) most custom kernels, all devices across A 2017, and most related devices.
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq - Max clock of cluster 0, reduce to underclock the CPU.
/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq - Max clock of cluster 1, reduce to underclock the CPU.
/sys/power/cpufreq_max_limit - Max clock of both clusters, more forced once permissions are set, watch device temperatures.
/sys/power/cpuhotplug/max_online_cpu - write a number 1 to 8, it is the CPU cores that are online.
Maybe relevant:
/sys/class/misc/mali0/device/dvfs_max_lock - GPU clock, more forced once permissions are set, watch device temperatures.
/sys/class/misc/mali0/device/core_mask - The GPU core combination in use, write a number 1 to 7.
/sys/class/misc/mali0/device/dvfs_governor - GPU governor, write a number 1 to 3.
/sys/class/devfreq/17000010.devfreq_mif/max_freq - could affect cellular and wifi
/sys/class/devfreq/17000020.devfreq_int/max_freq
/sys/class/devfreq/17000030.devfreq_disp/max_freq
/sys/class/devfreq/17000040.devfreq_cam/max_freq
The CPU governor is with scaling_max_freq though only userspace performance interactive.
Reboot to undo changes.
Edit:
/sys/devices/system/cpu/cpufreq/mp-cpufreq/cluster0_max_freq
/sys/devices/system/cpu/cpufreq/mp-cpufreq/cluster1_max_freq
Though this should not exceed the max clock, in addition to the governor's settings(/sys/devices/system/cpu/cpu[0-7]/cpufreq/interactive/...), the CPU clock is boosted temporarily when the screen is touched, the activity is changed, etc, even when it might not be needed. It's often "touchboost", and could be disabled by enabling medium power saving, or,
/sys/power/cpufreq_min_limit (home, gesture, scroll, app change, unlock)
"644 permissions" - disabled
"664 permissions" - default
check its contents after changing, should be the CPU min clock.
/sys/class/input_booster/level (touch, long touch, multiple fingers, etc)
0 - disabled touchboost
1 - low
2 - default
3 - high
might need the permissions being 464
CPU 4-7 needs to be powered on before cpufreq becomes available in its folder.
sheepkill15 said:
You can underclock with stock kernel if I know correctly.
Click to expand...
Click to collapse
Instead of what I understand, with the normal app type cpu master, or no frills cpu you can not change the clock of the CPU and the governor, but with the app Kernel Adiutor, recommended by @iloveoreos is possible, it is very strange this thing. However, despite the underclock of the CPU you can not then earn so much battery, it seems void
AntoKemz said:
Instead of what I understand, with the normal app type cpu master, or no frills cpu you can not change the clock of the CPU and the governor, but with the app Kernel Adiutor, recommended by @iloveoreos is possible, it is very strange this thing. However, despite the underclock of the CPU you can not then earn so much battery, it seems void
Click to expand...
Click to collapse
It doesn't count that much because you rarely use the cpu max freq. Maybe try underclocking the gpu too, if you can but probably not and there's not much else to do
AntoKemz said:
Instead of what I understand, with the normal app type cpu master, or no frills cpu you can not change the clock of the CPU and the governor, but with the app Kernel Adiutor, recommended by @iloveoreos is possible, it is very strange this thing. However, despite the underclock of the CPU you can not then earn so much battery, it seems void
Click to expand...
Click to collapse
The cpu and gpu are managed by the OS and its resepective governor settings. Little will be gained by reducing cpu cylcles unless it's correctly managed.
The single biggest battery user is the screen. Either reduce the brightness to the lowest you can stand and limit its on time or use powersave mode which will reduce both screen and cpu/gpu frequency.
Also selecting a more suitable governor helps.
If you frequently use high cpu usage apps its pointless using a conservative governor as you'll just lag the device. An ondemand governor would be better suited.
You can also set apps to be killed the moment you leave them in the developer settings.
ashyx said:
The cpu and gpu are managed by the OS and its resepective governor settings. Little will be gained by reducing cpu cylcles unless it's correctly managed.
The single biggest battery user is the screen. Either reduce the brightness to the lowest you can stand and limit its on time or use powersave mode which will reduce both screen and cpu/gpu frequency.
Also selecting a more suitable governor helps.
If you frequently use high cpu usage apps its pointless using a conservative governor as you'll just lag the device. An ondemand governor would be better suited.
You can also set apps to be killed the moment you leave them in the developer settings.
Click to expand...
Click to collapse
The problem is that with the only governors we have in stock are interactive, performance and userspace. The kernel allows me to just adjust the cpu, and on android oreo we do not have custom kernels that allow me to do anything. So in addition to lowering the brightness, really there is nothing that thanks to xposed and the root that allows me to do at least 5 hours of screen? The upgrade to oreo ruined everything, Nougat was too perfect

Categories

Resources