yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] grey77:
I thought about it the same way before. But it doesn't enable cores in fact. Proof of concept: in harfix4 set offline delay to 5000 ms (5 sec is enuf to watch) and see for urself - input boost never brings affected cores online.

---------- Post added at 05:16 PM ---------- Previous post was at 05:05 PM ----------

Thats the first thing Ive done before. The same sequence as in init.qcom.power.rc but applied to a bash script doesn't work as intended e.g. some commands like core_ctl/not_preferred seem to have no effect. Do I have to stop core_ctl and perf (perfprofd or watever daemon name) in order to re-initialize it successfully?
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] nijel8:
If you add something like this in your .sh script you can use .rc lines as is:

################################################################################
# helper functions to allow Android init like script

function write() {
echo -n $2 > $1
}

function copy() {
cat $1 > $2
}

function get-set-forall() {
for f in $1 ; do
cat $f
write $f $2
done
}

################################################################################

You should stop core_ctl first by setting min_cpus to 4/2, do what you do, set min_cpus back. perfd shouldn't be a problem
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] mat9v:
I know that, but it's much easier to just change to "echo" if I want to use init.d style commands.

As nijel8 pointed, for some commands to affect all cpus you must bring them all online first.

---------- Post added at 06:50 PM ---------- Previous post was at 06:32 PM ----------

Offline delay has nothing to do witch touch boost or hotplug boost, it works on situations when cores are online and working, task has ended and this is how long should they remain idle but active before going offline.

Input boost or touch boost timeout length are controlled by "input boost" timer. This setting will not bring cores online BUT if they are online it will boost them to defined frequency for defined period of time. I do not want that, I want only one core to boost, hence "0:1382400 1:0 2:0 3:0 4:0 5:0 6:0 7:0"

Read again what I stated before: "I can't do it that way as it would bring all online small cores to 1.3Ghz and I don't want that." - it means that it would bring all cores that are already online to set frequency, not that it would bring cores online and then set them to stated frequency. It's overkill to just handle small input from user, one core boosted is just enough and core0 is always online in my config. I could also boost core4, but .... more overkill.
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] Tysovwik:
btw, in your setup, 400 mhz freq for perh and power clusters almost useless, cores doesnt use it (not more than 1-2%) and going Up to next freq (691 mhz/883 mhz).

Mb best choice to disable 400 mhz freq for both clusters? :)
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] mat9v:
Let the screenshot below be a commentary on your post:

I don't know what you are doing on your phone but on mine 400Mhz is, aside from deep sleep, the most used frequency on both small and big cluster. I think 45 hours is a long enough testing period?

And yes, this is with the settings I published.
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] Tysovwik:
you are right :( for some reason, ex kernel manager stuck min freq at 691/883, now i manually setup it for 400/400 and magic is happen, 400 mhz is working now

It's init'd problems, which could be happen :)
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] pawwaap:
As seen on your screenshots you use KernelAuditor, supposedly without setting "on boot" anything in this app as you have put your setting in ths ramdisk from the link (to rely on it fully), and you use KernelAuditor just to see results, is this right?

If one sets values within KernelAuditor differently than these from (lets assume) having already flashed your boot-20170315-1911-Helium-Harfix.img

then what happens?

HELIUM 364GB ;) locked BL, Nijel's LineageOS
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] mat9v:
Yes and no. I use KA to set things that I don't need to set in ramdisk, like for example screen colors and entropy. Only CPU, GPU, I/O and LMK changes are configured in ramdisk.
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] grey77:
Last week when I tested it didnt work.

Snippet for the little cores cluster:

# Make sure core_ctl does not hotplug little cluster
chmod "644" > /sys/devices/system/cpu/cpu0/core_ctl/max_cpus
echo 4 > /sys/devices/system/cpu/cpu0/core_ctl/max_cpus
chmod "644" /sys/devices/system/cpu/cpu0/core_ctl/min_cpus
echo 4 > /sys/devices/system/cpu/cpu0/core_ctl/min_cpus
# Make sure CPU0 is online for config
chmod "644" > /sys/devices/system/cpu/cpu0/online
echo 1 > /sys/devices/system/cpu/cpu0/online

echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 78000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay
echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load
echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate
echo 1017600 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy
echo "1 400000:50" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time
echo 400000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

echo 65 > /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres
echo 40 > /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres
echo 1 > /sys/devices/system/cpu/cpu0/core_ctl/min_cpus

As u can observe the script tries to set minimum online cpus to max value and even enables cpu0 unconditionally. Also I tried adding chmod "644" to each line, tried to copycat the exact order of lines as in kernel .rc file. All to no avail.

Some parameters reset to default like /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

Others may reset to some weird values like /sys/devices/system/cpu/cpu0/core_ctl/min_cpus setting to "2".

the script does work if I duplicate its start multiple times via init.d at boot time, init.d emulation in kernel adiutor after boot, etc.

I analyzed other devices scripts and It makes me believe we need a ritual of proper re-initialization of governor/hotplug in bash scripts.
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] mat9v:
I have stumbled on the problem of various utilities not being able to permanently alter some settings, like min and max active cores - they were reverting to defaults set in .rc file - I don't know if it is because after leaving deep sleep the core control re-reads those values from .rc file or something else but it did happen. That is mostly why I decided to skip experimenting with Kernel Adiutor and other utilities and went straight to ramdisk.

I think i will try to remove all core control and governor settings from .rc and try to define them in KA - just to test this theory.

Ok, did the test, with core control disabled in .rc min cores for small and big are set to 1 and max cores for small and big are set to 4 (in case of Helium like mine).

I can easily edit files in root explorer and values stick even after 10 minutes of deep sleep.
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] grey77:
Sorry I paid no attention. I meant input boost timer ofc - thats the parameter u can set upto 5000ms I mentioned in the previous posts. Yeah I see u dont like having all the little cores input-boosted, neither do I.

BTW, it seems we cannot disable Touchboost while keeping enabled Wakeboost. If I set /sys/module/msm_performance/parameters/touchboost to 0

and then set any meaning value for Input Boost Freq., touchboost will be engaged.

It definitely happens right after the boot w/o entering low power mode. If they set they keep being set surviving Deep sleep. Pls have a look at the snippet for xiaomi mi4c re-initialization I posted 2-3 pages before - we might need to port it for our case.
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] grey77:
And for ur convinience, here is Custom Controls for Kernel Adiutor I created to monitor and change additional harfix/nijel8 Mi Max related settings. U can import .json Custom Controls one by one or import them all at once by replacing /data/data/com.grarak.kerneladiutor/files/controls.json
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] mat9v:
Nah, I'm lazy, I much prefer editing on PC and then flashing phone :)

But at least in case of min and max big cores, the value in KA did not survive deep sleep (not to mention reboot). Oh, it was set correctly in KA right after boot if I were to toggle "on boot" but if I let the phone sleep for some time it would revert to what was in .rc file. That was about a month ago? Unless they fixed some error in LAOS or KA it would happen.

Shame really you can't set custom controls in KA to restore on boot (or I have not found a way to do that).
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] Tysovwik:
One more question - what GPU freq you have at IDLE?

By harfix rc 2.1 kernel, min gpu freq should be 133 mhz, but almost time i check it at kernel auditor, it has 266 mhz at idle.

Only after touching the screen?! it went down to 133 mhz for a while and went back after a sec to 266 mhz.

Do you have the same? or what should i do, to make it 133 mhz idle all the time?

Kernel auditor min GPU settings set as 133 mhz by default.

P.S. your setup is amazing :)
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] pawwaap:
And could one apply it over given earlier ramdisk settings, would they complement each other or this one would overwrite and override?

HELIUM 364GB ;) locked BL, Nijel's LineageOS
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] mat9v:
GPU governor msm-adreno is kind of stupid with frequencies, it prefers 266Mhz and only dips down to 133Mhz occasionally. So I use simple-ondemand and it works better.

I doubt there is a big difference in power use but since 133Mhz is perfectly smooth, I don't see any reason not to use it.

Kernel Adiutor does only allow setting min_freq (default 266) but not target_freq (also default 266), so a governor tries to keep target frequency that is 266 :(

Target_freq must be set in init.d or ramdisk, you can do it in custom settings in Kernel Adiutor, but for now I have not found a way to set it on boot - not that I was trying much.

---------- Post added at 10:06 AM ---------- Previous post was at 09:45 AM ----------

You know, I have been thinking....

"init.qcom.power.rc" in ramdisk has the heading "on enable-low-power" under which all governor and core controls are configured. If we take that literally that it means to execute the settings every time phone enters low power (screen off?) then it would overwrite our configs. On the other hand governor settings in KA seems to be persistent even aster screen off and deep sleep.

Heh, you can try to chmod 444 all those settings after you set them. If root can't change them, system should not be able to (unless changing permission on files is included in something that changes them).

[MENTION=4399618]nijel8[/MENTION] - can you shine some light on this question? are those settings mentioned above executed only once on boot or every time conditions are met during normal use?
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] Tysovwik:
Trying to use it as part of my init'd script - no succes.

have error while applying this strings - no such file or directory

So i manually change gpu governor in kernel auditor to simple ondemand,

50% time GPU it works as 133 mhz, 50% time it works as 266 mhz, they are changing every second at IDLE state, screen on.

Is it normal?
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] mat9v:
Well, you must set "min_freq" and "target_freq" to 133Mhz. But remember that we have no way to tell those governors (like we can tell cpu governors) at what gpu load they are supposed to increase frequency, it is hardcoded in kernel at the moment (until someone takes care to expose those settings as user configurable variables).

Also, I am not certain if "/sys/class/kgsl/kgsl-3d0/devfreq/" is the correct directory if you are using some other rom then LAOS (ignore that if you are using nijel8's rom).
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] E90 Commie:
I just want to thank [MENTION=2473722]mat9v[/MENTION] for this excellent and very interesting work with the kernel tuning. I haven't tried it yet since I am still waiting for a new RR build, which is the reason why my testing is a bit delayed.

It feels like our Max is starting to close in on the Lenovo P2 (5100 mAh and reported SOTs of 17-20 hours) with your kernel tweaking and optimization, which is awesome.
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] nijel8:
.rs files are init scripts so they are executed only on cold boot once. They are not touched anymore even on soft restart.
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] pawwaap:
If we need power savings then should take care of some apps inbuild into the ROM, specifically FileManager. Just turning off its services (through 3Ctools) made big difference (as I can see in readings of Ampere in real time), however FileManager has administratve rights (why?) and turning off its services freezes hardware keys so phone needs rebooting.

And please say how about the options:

Force GPU rendering, and

Disable HW overlays,

in Developers options?

HELIUM 364GB ;) locked BL, Nijel's LineageOS
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] Zola III:
Well bad apps always eat a lot & among worst ones is: Facebook, Google Chrome & cetera. I don't know what Lineage did regarding it's in built file manager as I don't follow that. File manager need administrative rights so that it can access root privileges something we all actually need (most of us at least). GPU rendering is already forced (as its not DYN set) anyway & you do want to keep hardware overlays. How ever you may want to enable tile rendering & buffer preservation along with it in build.prop. Tile rendering is faster at rendering but slower at loading textures in most cases it will lead to some power saving (as it updates only part of the rendered surface as it's dynamically changed) how ever there are still some software (apps & games) that will brick the chain.

You can't use Ampere to measure per app power consumption nor does it have "real-time" monitoring (unfortunately nothing does). Use either Tarpon profiler or Tune Up Kit (I prefer second one) for that & still with a grain of salt regarding results. Google for answers more in the future...
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] IndDoc:
If you are so bothered about it, why don't you do it yourself instead of butting in between a civil and constructive conversation about kernel fine tuning. Please understand this is a hobby for people. Don't acting so demanding all the time. You didn't pay for any of this and noone owes you sh*t.
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] mat9v:
That's what ignore list is for. Don't want to read then ignore.
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] pawwaap:
Why "demanding", just sharing my observations on an power consuming application, maybe someone finds it helpful.

And very kind answer by [MENTION=4232632]Zola III[/MENTION] - everyone finds it as very useful (especially on enabling tile rendering & buffer preservation in build.prop) thank you very much [MENTION=423285]zola[/MENTION]!

The application is inbuilt into the ROM and the thread is about the ROM, where can you see abusing?

HELIUM 364GB ;) locked BL, Nijel's LineageOS
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] nijel8:
Lineage don't have builtin file manager for some time now. Saying File Manager in regards to Lineage means nothing...
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] pawwaap:
Yes indeed, so please forgive the lack of precision, I meant:

com.filemanager.org

or

/data/app/com.filemanager.org-2/base.apk

Is it included into LineageOS?

If you love purity so much then what about this manner here of citing a complete post from right before the answer, don't you have anything against it? ;)

HELIUM 364GB ;) locked BL, Nijel's LineageOS
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] grey77:
On the CC needed to be auto-set on reboot: click 3-dots > check "on Boot". =)

PS: There is a complete guide (in russian, I can rewrite it in english if needed), link in the readme file in the archive.
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] mat9v:
Thanks for the tip :)
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] grey77:
they dont overwrite ramdisk .rc file settings but change the current settings the kernel uses for the respective parameters. Actually one might use CC to re-write kernel .rc settings as well, but its another story.

U can use CC in KA just to monitor the current values the kernel uses. The values u see r read but not applied unless u start changing them. They r not applied on reboot unless u check "on Boot" for the respective CC.

---------- Post added at 08:32 PM ---------- Previous post was at 08:22 PM ----------

Yeah. 133Mhz is enuf for 1080P screen 2D accelerations. And AFAIK hardware codecs module uses its own freq.
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] jpph:
Hi, I use this rom since the begining, flashed almost all versions :) the only crash I have (since several version) is when I swap sim for data in preferences... Anyone else have the same crash?

Attached logcat... http://cloud.tapatalk.com/s/58cc3cb0ce670/2017-03-17-20-39-19.txt

Edit:it is the parameter app that crash.

No big deal anyway...
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] grey77:
BTW GPU gov`s behaviour seems strange yet. Even after having set min freq. and target down to 133Mhz, even with simple-on-demand chosen, GPU freq. tends to sit at 266Mhz most of time. :(

---------- Post added at 09:25 PM ---------- Previous post was at 09:08 PM ----------

I did that too (wrapped each line in chmod "644" / chmod "444" pairs). Some settings might not set even w/o entering LPM. I do think of stopping core_ctl daemon before/restarting it after the setting and doing all that funny stuff disabling thermal/bcl (I need more research into it).
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] mat9v:
As I said, we can't set up and down threshold for GPU governor, probably displaying some moving graphs is enough to trigger jumping to 266?

Please do test :) I'm interested in your results, flashing kernel every time I want to test something is a bit troublesome :)
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] pawwaap:
Indeed, after adding:

debug.qctwa.preservebuf=1
debug.enabletr=true

readings show signifficant improvement now.

If it confims well then it means GPU consumes the most of power, doesent it?

HELIUM 364GB ;) locked BL, Nijel's LineageOS
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] Ranomez:
I think I found a bug: when using Bluetooth headphones the volume difference between steps 3 and 4 is way too big, the other steps are OK but when going from 4 to 3 it first drops normally as it would between the other steps and then a second later it drops again as if you would have moved 2 steps down instead of 1, same for increasing volume from 3 to 4, it's normal for a second then increases 1 more step.
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] Zola III:
Well GPU consumes the largest part of the die on SoC so it's natural that it can consume and most power but luckily A510 is efficient and droves max 2.4W (compared to top ones that easily eat 4~5W). Switch either to Adreno idler or simple on demand (simple om demand is my choice) for a GPU governor as MSM Adreno has problems with overflow & thats why it doesn't downscale as it should.

I see you started Googling instead harassing other folks around hire. Tell you what cary on, I will give you hints & and tips from time to time.
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] lckjosh:
I'm using this ROM now and i notice that under bright light, when the light sensor detects very bright light, the colours displayed on screen become lighter. For example, black becomes grey etc. Anyone else having this issue and found a solution?
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] ktsak:
Yesterday tried to flash Lineage 14.1 on my Hellium device (4/128).

Performed wipe, flashed ROM and during the process I've got Error 7 and the flashing stopped.

I gave up, it was possible to install Lineage. Restored to previous backup.

Previous ROM was MIUI 8.3 (xiaomi-miui.gr XTRV 7.3.16, based on Nugat).

Any suggestions ?
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] mat9v:
There on Anandtech are very interesting tests concerning CPU and GPU power use. The article is basically a test of Kirin 960 but Snapdragon 820/821 is also included. Since we have Adreno 510 instead of 530 we can cut GPU power use by 2. Anyway, a good read altogether.

http://www.anandtech.com/show/11088/hisilicon-kirin-960-performance-and-power/4

and

http://www.anandtech.com/show/11088/hisilicon-kirin-960-performance-and-power/5

---------- Post added at 08:57 AM ---------- Previous post was at 08:50 AM ----------

There are 2 reasons for that.

1. Crystals in LCD are not 100% effective and can't block all the light from coming from backlight so when it is operating at max brightness, some light will get through.

2. Display layers are perfectly light absorbing (matte) and a strong outside light source will create reflections between layers, especially if you have any screen protection layers installed.

Can't get around that, even AMOLED displays that have no (1) problem still suffer from (2). - well you can minimize it by not using any screen protection.
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] lckjosh:
Interesting. Maybe I should clarify. I do not use auto brightness and I only experience the issue when the light sensor detects light. So, under bright sunlight, if I cover the light sensor, colours are displayed normally. If i expose the light sensor to light, the colours become brighter as I mentioned. So I don't think it has anything to do with the LCD but rather the software.
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] panzerpig:
Isnt that just xiaomis sunlight display feature? Dont like it myself. https://www.youtube.com/watch?v=N4J0gmR-iQI
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] mat9v:
Yes, that leaves the second part where reflected strong light influences colors and brightness making them bleak. It is normal on any LCD, be it phone or computer screen and even AMOLED suffers from it.

Remember also that human eye perceives colors differently in stron light. Did you ever look at the street in very strong light at midday and wonder why colors are so weak? The same you can observe when leaving dark room into the light - human eye have definitive limits to accommodating to strong light and colors will look washed out by comparison.
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] Zola III:
[MENTION=2473722]mat9v[/MENTION]

Yes I know I read that article same day it whose published. ?
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] lckjosh:
I have tried under the same strong light covering and uncovering the light sensor and the colours display differently. So, it is not the reflection of the light or a hardware issue as the variables in my experiment were all kept constant except the covering of only the light sensor and not the whole screen. I think it is xiaomi's sunlight display feature as mentioned by [MENTION=3068510]panzerpig[/MENTION]. Thanks for your help anyway! There are certainly new things to learn everyday ;)
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] panzerpig:
yeah, the first time I noticed it on my rn3 I thought my LCD was failing. when my mi max did the same, I knew what it was... very nice feature ;)
[Xiaomi Mi Max ROMs, Kernels, Recoveries, & Other D] nijel8:
Don't use TWRP for hydrogen.