[ROOT] core_ctl J510FN better CPU control - Samsung Galaxy J5 Themes, Apps, and Mods

Dear owners,
After buying the J510FN I was frustrated with the way Samsung setup the CPU control for this phone. All 4 cores were on and the minimal freq was 800 Mhz.
This meant worse battery life than possible.
I dig into the kernel to look what was possible. The post boot script /etc/init.qcom.post_boot.sh revealed it all. Our msm8914 soc (Snapdragon 410) could do much better.
I changed the init.qcom.post_boot.sh script to maximize battery life and still get the full performance the Snapdragon 410 offers.
Content of cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies:
Code:
200000 400000 533333 800000 998400 1094400 1190400
Our soc id is 206. In the script I changed these lines to let the cpu use all frequencies and let it switch off CPU cores with Qualcomm core_ctl (like hotplug).
For enable lower cpu freq:
Code:
echo 0 > /sys/module/msm_thermal/core_control/enabled
echo 200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 1 > /sys/module/msm_thermal/core_control/enabled
echo "1 200000:25 400000:50 800000:85 998400:90 1094400:95 1190400:98" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
List of /sys/devices/system/cpu/cpufreq/interactive/:
Code:
above_hispeed_delay:25000 1094400:50000
align_windows:0
boost:0
grep: boostpulse: Permission denied
boostpulse_duration:80000
go_hispeed_load:90
hispeed_freq:998400
io_is_busy:1
max_freq_hysteresis:0
min_sample_time:50000
target_loads:1 200000:25 400000:50 800000:85 998400:90 1094400:95 1190400:98
timer_rate:50000
timer_slack:80000
use_migration_notif:0
use_sched_load:0
List of /sys/devices/system/cpu/cpu0/cpufreq/:
Code:
affected_cpus:0
cpuinfo_cur_freq:998400
cpuinfo_max_freq:1190400
cpuinfo_min_freq:200000
cpuinfo_transition_latency:0
related_cpus:0 1 2 3
scaling_available_frequencies:200000 400000 533333 800000 998400 1094400 1190400
scaling_available_governors:interactive userspace powersave performance
scaling_cur_freq:998400
scaling_driver:msm
scaling_governor:interactive
scaling_max_freq:1190400
scaling_min_freq:200000
scaling_setspeed:<unsupported>
Content of /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state:
Code:
200000 749380
400000 98359
533333 15319
800000 303392
998400 140371
1094400 29387
1190400 207512
For enabling cpu core switching on/off:
Code:
insmod /system/lib/modules/core_ctl.ko
echo 60 > /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres
echo 80 > /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres
Listing of /sys/devices/system/cpu/cpu0/core_ctl:
Code:
additional_cpus:1
busy_down_thres:60 60 60 60
busy_up_thres:80 80 80 80
cpus:CPU0 (Online)
cpus:CPU3 (Offline)
cpus:CPU1 (Offline)
cpus:CPU2 (Offline)
global_state:CPU0
global_state: CPU: 0
global_state: Online: 1
global_state: Rejected: 0
global_state: First CPU: 0
global_state: Busy%: 16
global_state: Is busy: 0
global_state: Avail CPUs: 4
global_state: Need CPUs: 1
global_state:CPU1
global_state: CPU: 1
global_state: Online: 0
global_state: Rejected: 0
global_state: First CPU: 0
global_state: Busy%: 0
global_state: Is busy: 0
global_state:CPU2
global_state: CPU: 2
global_state: Online: 0
global_state: Rejected: 0
global_state: First CPU: 0
global_state: Busy%: 0
global_state: Is busy: 0
global_state:CPU3
global_state: CPU: 3
global_state: Online: 0
global_state: Rejected: 0
global_state: First CPU: 0
global_state: Busy%: 0
global_state: Is busy: 0
max_cpus:4
min_cpus:1
need_cpus:1
offline_delay_ms:100
online_cpus:1
For this to work you need to change these lines in /system/build.prop too:
Code:
#min/max cpu in core control
#ro.core_ctl_min_cpu=2
ro.core_ctl_min_cpu=1
ro.core_ctl_max_cpu=4
#HR add lower freq (else 800000)
#ro.min_freq_4=200000
ro.min_freq_0=200000
ro.qualcomm.perf.cores_online=1
I am running this two weeks now without any problem. I wonder why Samsung didn't do this out of the box.
Enjoy your very good battery life now. (2 hour/day usage it lasts 5-7 days!!!!)
Cheers
EDIT: I added the modified init.qcom.post_boot.sh attachement. To install use these commands on rooted phone:
Code:
adb push init.qcom.post_boot.sh /sdcard
adb shell
su
mount -o remount,rw /system
cd /etc
cp -p init.qcom.post_boot.sh init.qcom.post_boot.sh.ORG
cp /sdcard/init.qcom.post_boot.sh .
chmod 644 init.qcom.post_boot.sh
exit
exit
adb reboot
EDIT2: I forgot the 533330 freq. Right target_loads should be:
Code:
"1 200000:40 400000:50 533333:70 800000:82 998400:90 1094400:95 1190400:99"
This is not a big deal. You will have to change it in the init script yourself if you want it.
Other little changes to script:
Code:
echo 40 > /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres
echo "80 85 90 95" > /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres
echo 500 > /sys/devices/system/cpu/cpu0/core_ctl/offline_delay_ms #100
echo 3 > /proc/sys/kernel/sched_mostly_idle_nr_run #3
echo 30 > /proc/sys/kernel/sched_mostly_idle_load # 20
echo 5 > /proc/sys/kernel/sched_spill_nr_run #3/10
echo 0 > /proc/sys/kernel/sched_prefer_idle #0
echo 20 > /proc/sys/kernel/sched_small_task #10
echo 60 > /proc/sys/kernel/sched_heavy_task #0
echo 20 > /proc/sys/kernel/sched_init_task_load #15
echo 5 > /proc/sys/kernel/sched_ravg_hist_size #5 nr sample
echo 500 > /proc/sys/kernel/sched_time_avg_ms #1000
echo 2 > /proc/sys/kernel/sched_window_stats_policy #3
echo 1 > /proc/sys/kernel/sched_tunable_scaling #0 1=log 2=lin
echo 80 > /proc/sys/kernel/sched_upmigrate #80
echo 70 > /proc/sys/kernel/sched_downmigrate #70
echo 500000 > /proc/sys/kernel/sched_freq_inc_notify #10485760 (10Ghz) 500 Mhz
echo 500000 > /proc/sys/kernel/sched_freq_dec_notify #10485760
echo 1 > /sys/devices/system/cpu/cpufreq/interactive/use_migration_notif #0
echo 1 > /sys/devices/system/cpu/cpufreq/interactive/use_sched_load #0
echo 95 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load #90
#echo 50000 > /sys/devices/system/cpu/cpufreq/interactive/max_freq_hysteresis #0
optional:
echo 1 > /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk
echo 53059 > /sys/module/lowmemorykiller/parameters/vmpressure_file_min
#GPU settings, default pwr level 2 ( max 0 1 2 min)
echo 2 > /sys/class/kgsl/kgsl-3d0/default_pwrlevel #1
Check you CPU with floating Perf monitor from Chainfire
EDIT 25-feb-2017: Added final /etc/init.qcom.post_boot.sh which runs smooth on stock 6.0.1 ROM

Is this better than CM13's kernel?
Can't we optain the same things running CM and Kernel Auditor? If so, can we configure KA to the same paramiters as your kernel?

Have not tried CM or any other kernel. This is stock Samsung kernel with some script tweaks to optimize multi core cpu usage.

Hello
how to get this mod
thank you

I will add my /etc/init.qcom.post_boot.sh script to the OP.
Just copy your init.qcom.post_boot.sh to init.qcom.post_boot.sh.ORG and use my one.
Don't forget to set 644 permissions to it!
Cheers

tweakradje said:
I will add my /etc/init.qcom.post_boot.sh script to the OP.
Just copy your init.qcom.post_boot.sh to init.qcom.post_boot.sh.ORG and use my one.
Don't forget to set 644 permissions to it!
Cheers
Click to expand...
Click to collapse
Thanks!
some time ago i suposed about this file are bloking the cpu to use the lower freq.
but i eliminate it not edit it.
i will test the file and i will post the feedback
thanks again!

CM12.1 doesn't seem to have core_ctl.ko module included, but the frequency scaling should work.
#Down: It won't work. Kernel modules are built with specific kernel version & config in mind and they ain't gonna work between kernels.

Maybe you can try using Samsungs core_ctl.ko?

@tweakradje
Nice. By the way, I see in your screenshot that you've turned off 3 cores. Wouldn't that lead to higher battery drain when there is a high CPU load? Also there might be some lag. The CPU will be stressed more when has only 1 core enabled instead 4 and there is higher load.
I wonder if we can turn on/off cores based on CPU usage. E.g.: if CPU usage is over 50%, then enable 1 core more, just an example.
By the way, I think this should be under apps/mods section.

Cores are hot plugged using core_ctl.ko module.
If mods want to move, be my guest. No problem. I remember next time.

So!
i'm on j500F with custom rom(miui v8 5.1.1) and custom kernel
and i get this with your init.qcom.post_boot.sh:
se the first 6 screenshots
-only 2 core are active
-cant read cpu stats
-cpu performance are on half of it's power
without any init.qcom.post_boot.sh:
see the last 6 screenshots
Ps. the result are not very obiective becouse your init.qcom.post_boot.sh is for j510FN with stok rom and stok kernel
cant say nothing about battery draining, just it was the same on testing
Thanks!

Thank for the feedback. Looks ok. If you look at my sh file you can easily see what parameters I changed. Use that in your own script to check results. Use your phone for a day and check battery usage.
Cheers

Any results?
I am curious if there are users have tried this solution and what the results are. Please let me know.

tweakradje said:
what the results are.
Click to expand...
Click to collapse
what the results are I'll tell you tomorrow.today i say :good:
I make your init.qcom.post_boot.sh J510FN_CPU_control .zip for installation through TWRP
Min_800back.zip-Back stock init.qcom.post_boot.sh
Maybe someone will be needed

To install this, what do I need to do? Just flash in TWRP?

If you have stock Samsung J510 rom you can flash it from post above.
Else follow adb instructions from OP. Make a copy of your original sh file first.

I have the note 7 hybrid rom, will it work??

Think so. Check /etc/init.qcom.post_boot.sh with "adb shell cat /etc/init.qcom.post_boot.sh" from your PC.
Code:
adb push init.qcom.post_boot.sh /sdcard
adb shell
su
mount -o remount,rw /system
cd /etc
cp -p init.qcom.post_boot.sh init.qcom.post_boot.sh.ORG
cp /sdcard/init.qcom.post_boot.sh .
chmod 644 init.qcom.post_boot.sh
exit
exit
adb reboot

I flashed the file above..the phone actually seems slower

Rather than so much editing, it is not possible to do the same using some sort of app that adjusts CPU Governor?

Related

[Q] Modifying Gideonx's OC/UV script

Since my values for the CPU would never stick with System Tuner, I decided to learn how to modify scripts to get the desired effect. I decided that I wanted to modify Gideonx's OC/UV script.
I want to use the GideonX_OC_UV_VM_Tweaked_for_Battery.zip - CPUs @ 384/918Mhz | -75mV | OnDemand | VM tweaked | Not all phones can take -75mV.
Except rather than having a 918Mhz max, I want to use 1.35Ghz max. I heard the script makes your CPU really slow and I'm hoping increasing the max will make it smoother (I don't know too much about this, haha).
I opened up the script with notepad and changed the values from 918000 to 1350000. It now looks like this:
#########################
# GideonX kernel tweaks #
#########################
# Set CPU voltage in microvolts
echo "-75000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels
# Set min/max and governor for CPU0
echo 384000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 1350000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
# Set min/max and governor for CPU0
echo 1 > /sys/devices/system/cpu/cpu1/online
echo 384000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo 1350000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
# Set kernel dirty data writes. Dirty just means changed data, don't freak out.
# By setting writeout times to be longer, there are less writes which may save more battery for you.
#
# /proc/sys/vm/dirty_expire_centisecs = how old is the data before kernel writes
# /proc/sys/vm/dirty_writeback_centisecs = how often should the kernel check for dirty data
# /proc/sys/vm/dirty_ratio = max memory in percent of data storage
# /proc/sys/vm/dirty_background_ratio = amount of memory in percent for a data writeout to stop
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
echo "90" > /proc/sys/vm/dirty_ratio
echo "5" > /proc/sys/vm/dirty_background_ratio
When I zipped it back up and tried to install the zip, however, it crashed and didn't install. What did I do wrong? (Total newbie here)
Link to the script: http://forum.xda-developers.com/showpost.php?p=20946429&postcount=574
bump
Anyone have any idea why it's not working?
The way I did it was by using 7zip and notepad++
I didn't unzip the zip file. I juat openes it qith 7zip and draged the file onto my desktop. Then opened it with notepad++ and made the changes I wanted. After that I just draged that file back into the opened zip closed the program ans flashed it. Maybe the way you zipped it back messed up something.
Sent from my SAMSUNG-SGH-T989 using xda premium

[SOLVED]Ondemand tweaks using init.d scripts

I want to tweak these settings for ondemand(found in sys/devices/system/cpu/cpufreq)
up_threshold
sampling_down_factor
sampling_rate
powersave_bias
To these values:
85
2
50000
1
The defaults
90
4
10000
0
Problem is I don't know what the init.d script is missing for it to work, as it shows errors in script manager. Here's what I have so far:
#!/system/bin/sh
echo 85 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo 2 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
echo 50000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
My question is how do I get the script to work so that on every boot the defaults for ondemand change to those?
What do I have add to the script?
I'm using voltage control btw.
This is for my personal use and experimenting purposes.
Just in case you say "search" I did and when I was doing this, here's the guide I followed:
http://forum.xda-developers.com/showthread.php?t=1369817

Control your Ascend P6 through Init.d

Control your Ascend P6 through Init.d
In this Thread i will provide you Guys an small Init.d Package, that will let you control the important stuff on your Device without using Third Party Applications. I created this Zip for private use, but i like to share it with you.
This is mainly for advanced Users, so if you're not confirmed with Scripts etc., please DON'T touch the Scripts!
I only tested on Stock Firmware!
I take no Credits for the Tweaks contained in the Zip. They goes out to all the Tweakers here @ xDa!
{
"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"
}
Installation
! PLEASE MAKE AN NANDROID IN RECOVERY, BEVORE YOU FLASH THE ZIP !
! YOU'LL FLASH THIS @ YOUR OWN RISK !
I suggest you Guys to use TWRP by Surdu Petru, because it has Init.d Support by default.
Reboot in Recovery
Backup your Rom
Flash the Ascend_P6_Init.d_Control.zip
Wipe Cache & Dalvik Cache
Reboot
The Logger
I added an Logging System into the Zip, that will check and show you, if the Tweaks applied sucessfully and give you an positive (+) or negative (-) output. That way you don't have to check them manually.
You'll find it in /data/00_init.d_control_log
It should give you an Output like this
(Which also is an Overview about the Stuff you can handle with this ZIP)
>>> SetPerm
+ Init.d Permissions set to 755
@ 01-22-2014 00:55:36
>>> FileSystem
+ EXT4 Partitions present
+ Cache Partition optimized
+ Cust Partition optimized
+ Data Partition optimized
+ System Partition optimized
+ Remount Done
Please check the Remount.log! If this Script works, you'll see most of your Mounts being Noatime
+ Logger removed
+ File System cleaned
@ 01-22-2014 00:55:39
>>> SQLite -48 Hour Delay-
+ Wifi Sleep is active
+ SQLite Database VACUUM and REINDEX finished
Check the Sqlit.log to see, if SQLite was successful
@ 01-22-2014 00:57:13
>>> DarkyZipalign & Zipalign -48 Hour Delay-
+ DarkyZipalign applied
Check the DarkyZipalign.log to see, if everything was aligned
+ Zipalign finished
Check the Zipalign.log to see, if everything was completed
@ 01-22-2014 00:57:39
>>> Entropy
+ Haveged Binary is active
+ Entropy is active
@ 01-22-2014 00:57:40
>>> Alternative Scheduler & Governor by Surdu_Petru
+ SIO Scheduler present
+ SIOPLUS Scheduler present
+ VR Scheduler present
+ ZEN Scheduler present
+ MINMAX Governor present
@ 01-22-2014 00:57:41
>>> CPUconfig
+ Governor is set to k3hotplug
+ I/O Scheduler is set to zen
+ I/O Settings active
+ SD Cache is set to 2048 kb
+ MIN Frequency is set to 200000 mhz
+ MAX Frequency is set to 1500000 mhz
+ CPU Frequency locked @ 0
+ MIN CORES set to 1
+ MAX CORES set to 4
+ Active Cores locked @ 0
+ MIN GPU Frequency is set to 58000
+ MAX GPU Frequency is set to 480000
+ GPU Frequency locked @ 0
+ MIN DDR Frequency is set to 58000
+ MAX DDR Frequency is set to 450000
+ DDR Frequency locked @ 0
@ 01-22-2014 00:57:54
>>> SCREEN ON / OFF Profile
+ Screen On / Off Profile active
@ 01-22-2014 00:57:54
>>> Kernel
+ Kernel Values applied
+ VM Values applied
@ 01-22-2014 00:57:56
>>> Lowmemorykiller
+ Minfree Adj Values applied
+ Minfree Cost Values applied
+ Minfree Debug_Level Values applied
+ Minfree Values applied
@ 01-22-2014 00:57:57
The CPU Script
Probaply the most interessting Script 4 us is the 60CPUconfig - Script. It will let you:
Set CPU Governor
Set I/O Scheduler
Set SDCache
Set MIN/MAX CPU Frequencys
Lock active CPU Frequency
Set MIN/MAX abvailable Cores
Lock active Cores
Set MIN/MAX GPU Frequencys
Lock active GPU Frequency
Set MIN/MAX DDR Frequencys
Lock active DDR Frequency
Set Screen ON / OFF Profiles
I tried to keep it easy to handle, so all you have to do, is to set your Values on Top (one time for Screen On & one time for Screen Off)!
#---------------------------------------------#
# Configure your SCREEN ON Values #
#---------------------------------------------#
# Set Scaling Governor
# k3hotplug minmax ondemand performance
GOVERNOR=k3hotplug
#---------------------------------------------#
# Set I/O Scheduler
# cfq deadline noop sio sioplus vr zen
SCHEDULER=cfq
#---------------------------------------------#
# SDCache
# 128 256 512 1024 2048 4096
READ_AHEAD_KB=2048
#---------------------------------------------#
# Set MIN/MAX CPU Frequency
# 200000 400000 600000 800000 1000000 1200000 1399000 1400000 1500000
CPU_MIN=200000
CPU_MAX=1500000
#---------------------------------------------#
# Lock CPU Frequency
# 200000 400000 600000 800000 1000000 1200000 1399000 1400000 1500000
# Stock 0
CPU_FREQ=0
#---------------------------------------------#
# Set MIN/MAX available Cores
# 1-4
CORE_MIN=1
CORE_MAX=4
#---------------------------------------------#
# Lock active CPU Cores
# 0 - 4
# Stock 0
CORE_LOCK=0
#---------------------------------------------#
# Set MIN/MAX GPU Frequency
# 58000 120000 240000 360000 480000
GPU_MIN=58000
GPU_MAX=480000
#---------------------------------------------#
# Lock GPU Frequency
# 58000 120000 240000 360000 480000
# Stock 0
GPU_FREQ=0
#---------------------------------------------#
# Set MIN/MAX DDR Frequency
# 58000 120000 360000 450000
DDR_MIN=58000
DDR_MAX=450000
#---------------------------------------------#
# Lock DDR Frequency
# 58000 120000 360000 450000
# Stock 0
DDR_FREQ=0
#---------------------------------------------#
# Configure your SCREEN OFF Values #
#---------------------------------------------#
# Set Scaling Governor
# k3hotplug minmax ondemand performance
SLEEP_GOVERNOR=ondemand
#---------------------------------------------#
# Set I/O Scheduler
# cfq deadline noop sio sioplus vr zen
SLEEP_SCHEDULER=noop
#---------------------------------------------#
# Set MIN/MAX CPU Frequency
# 200000 400000 600000 800000 1000000 1200000 1399000 1400000 1500000
SLEEP_CPU_MIN=200000
SLEEP_CPU_MAX=600000
#---------------------------------------------#
# Lock CPU Frequency
# 200000 400000 600000 800000 1000000 1200000 1399000 1400000 1500000
# Stock 0
SLEEP_CPU_FREQ=0
#---------------------------------------------#
# Set Min/Max available Cores
# 1-4
SLEEP_CORE_MIN=1
SLEEP_CORE_MAX=1
#---------------------------------------------#
# Lock active CPU Cores
# 0 - 4
# Stock 0
SLEEP_CORE_LOCK=0
#---------------------------------------------#
# Set MIN/MAX GPU Frequency
# 58000 120000 240000 360000 480000
SLEEP_GPU_MIN=58000
SLEEP_GPU_MAX=120000
#---------------------------------------------#
# Lock GPU Frequency
# 58000 120000 240000 360000 480000
# Stock 0
SLEEP_GPU_FREQ=0
#---------------------------------------------#
# Set MIN/MAX DDR Frequency
# 58000 120000 360000 450000
SLEEP_DDR_MIN=58000
SLEEP_DDR_MAX=120000
#---------------------------------------------#
# Lock DDR Frequency
# 58000 120000 360000 450000
# Stock 0
SLEEP_DDR_FREQ=0
If you're not sure, that your Values are stable, let your modified Script run through SManager without the on Boot option for at least 24 Hours. After that you can add it back into the /system/etc/init.d - Folder.
I'll take care about the right Permissions, if you forgot to set them.
Uninstallation
The Zip contains an Uninstaller, so to get back to Stock you simply have to type this commands in the included Terminal Emulator
su [enter]
uninstall [enter]
and confirm your choice.
With v1.1 i added 3 CPU Profiles, that can be applied with the Terminal Emulator.
Simply type
su [enter]
battery, game or default[enter]
to switch between them. Of course you can edit them, to fit your needs. You'll find them in
/system/bin/
Alright, that's it for now. I'll edit this Post as soon as i got more Time.
Feel free to play around with the Scripts / Values and share your experience with us.
If you notice any Errors, let me know.
DOWNLOAD [ Official Huawei FW ]
DOWNLOAD [ Official Huawei FW + [URL="http://forum.xda-developers.com/showthread.php?t=2620421"]HA P6 Custom Kernel ][/URL]
DOWNLOAD [CM10 ]
​
Hallo HSD-Pilot,
I install yesterday the one for the CLEANROM_V1 from Petru.
Now the Software run very smooth. The Systemstart is very fast now!
But i have no possibility to start in to the Twrp-Recovery.
Need help.
Clean Rom replaces the Stock Recovery with TWRP. So to boot into Recovery you have to hold both Vol. Keys while Power on your Device. Just like you usually flash Stock Firmwares out of the dload Folder.
Gesendet von meinem HUAWEI P6-U06 mit Tapatalk
HSD-Pilot said:
Clean Rom replaces the Stock Recovery with TWRP. So to boot into Recovery you have to hold both Vol. Keys while Power on your Device. Just like you usually flash Stock Firmwares out of the dload Folder.
Gesendet von meinem HUAWEI P6-U06 mit Tapatalk
Click to expand...
Click to collapse
No! After Script install it don't do it.
But i have a solution.
Install ROM Manager v.5.5.3.4. Of course it is primay for cwm but there is the option "reboot into recovery system".
This function is a way to start into twrp.
The Zip shouldn't effect the Recovery Partition, so TWRP should boot. There's nothing contained, that touches the Recovery. You tried to uninstall the Pack (su > uninstall) ?
Gesendet von meinem HUAWEI P6-U06 mit Tapatalk
so I see it setsbthe freeq of the cpu. what willbhapen if I use setcpu now?
can you please provide us the coding of the scripts? I would like to paste them manualy in my inid.t folder. please
benna said:
so I see it setsbthe freeq of the cpu. what willbhapen if I use setcpu now?
can you please provide us the coding of the scripts? I would like to paste them manualy in my inid.t folder. please
Click to expand...
Click to collapse
SetCPU usually kicks in after the init. d Scripts, so it will overwrite the Values.
The Zip contains an Script called 80SetCPU, this will do the same like the App.
#!/system/bin/sh
LOG_FILE=/data/00_init.d_control_log/01Init.d_Control.log
echo ">>> SetCPU" | tee -a $LOG_FILE;
#---------------------------------------------#
# Configure your Values #
#---------------------------------------------#
# Set Scaling Governor
# k3hotplug minmax ondemand performance
GOVERNOR="k3hotplug"
#---------------------------------------------#
# Set IO Scheduler
# cfq deadline noop sio sioplus vr zen
SCHEDULER="zen"
#---------------------------------------------#
# Set Min & Max Frequency
# 200000 400000 600000 800000 1000000 1200000 1399000 1400000 1500000
CPU_MIN=200000
CPU_MAX=1500000
#---------------------------------------------#
# Apply Configuration #
#---------------------------------------------#
#Set CPU Governor
if [ -e /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ]; then
echo $GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor; else
echo "- Unable to set CPU Governor. File NOT found!" | tee -a $LOG_FILE;
fi;
if [ -e /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor ]; then
echo $GOVERNOR > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor;
fi;
if [ -e /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor ]; then
echo $GOVERNOR > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor;
fi;
if [ -e /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor ]; then
echo $GOVERNOR > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor;
fi;
sleep 1
if [ /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor=$GOVERNOR ]; then
echo "+ $GOVERNOR Governor is running" | tee -a $LOG_FILE; else
echo "- $GOVERNOR Governor is NOT running" | tee -a $LOG_FILE;
fi;
#---------------------------------------------#
# Set Scheduler
dm=/sys/block/dm-*
loop=/sys/block/loop*
mmc=/sys/block/mmc*
mtd=/sys/block/mtd*
nbd=/sys/block/nbd*
ram=/sys/block/ram*
zram=/sys/block/zram*
for a in $dm $loop $mmc $mtd $nbd $ram $zram; do
if [ -e ${a}/queue ]; then
echo $SCHEDULER >> ${a}/queue/scheduler;
fi; done
sleep 1
if [ /sys/block/mmcblk0/queue/scheduler=$SCHEDULER ]; then
echo "+ $SCHEDULER Scheduler is running" | tee -a $LOG_FILE; else
echo "- $SCHEDULER Scheduler is NOT running" | tee -a $LOG_FILE;
fi;
#---------------------------------------------#
# Set MIN/MAX Frequency
if [ -e /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq ]; then
echo $CPU_MIN > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq; else
echo "- Unable to set MIN Frequency. File NOT found!" | tee -a $LOG_FILE;
fi;
if [ -e /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq ]; then
echo $CPU_MIN > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq;
fi;
if [ -e /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq ]; then
echo $CPU_MIN > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq;
fi;
if [ -e /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq ]; then
echo $CPU_MIN > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq;
fi;
if [ -e /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq ]; then
echo $CPU_MAX > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq; else
echo "- Unable to set MAX Frequency. File NOT found!" | tee -a $LOG_FILE;
fi;
if [ -e /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq ]; then
echo $CPU_MAX > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq;
fi;
if [ -e /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq ]; then
echo $CPU_MAX > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq;
fi;
if [ -e /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq ]; then
echo $CPU_MAX > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq;
fi;
sleep 1
if [ /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq=$CPU_MIN ]; then
echo "+ MIN Frequency is set to $CPU_MIN mhz" | tee -a $LOG_FILE; else
echo "- MIN Frequency is NOT set to $CPU_MIN mhz" | tee -a $LOG_FILE;
fi;
if [ /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq=$CPU_MAX ]; then
echo "+ MAX Frequency is set to $CPU_MAX mhz" | tee -a $LOG_FILE; else
echo "- MAX Frequency is NOT set to $CPU_MAX mhz" | tee -a $LOG_FILE;
fi;
#---------------------------------------------#
echo "@ $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
echo " " | tee -a $LOG_FILE;
Just set your Values on top and reboot :thumbup:
Gesendet von meinem HUAWEI P6-U06 mit Tapatalk
Works flawlessly!!!
HUAWEIAscendP6
Uploaded an small Update
- cleaned some scripts
- added CPU / GPU LOCK Script
- rearranged the Build.prop Tweaks
- replaced Bootanimation (Nexus)
Use the uninstaller to revert back to Stock! It will handle everything 4 ya (incl. restore Stock Bootanimation).
Gesendet von meinem HUAWEI P6-U06 mit Tapatalk
HSD-Pilot said:
Uploaded an small Update
- cleaned some scripts
- added CPU / GPU LOCK Script
- rearranged the Build.prop Tweaks
- replaced Bootanimation (Nexus)
Use the uninstaller to revert back to Stock! It will handle everything 4 ya (incl. restore Stock Bootanimation).
Gesendet von meinem HUAWEI P6-U06 mit Tapatalk
Click to expand...
Click to collapse
hi
which app works best with this script
nARDOs said:
hi
which app works best with this script
Click to expand...
Click to collapse
What do you mean with "which App"¿
The meaning of this package is to avoid 3rd Party Apps.
To Edit the Scripts you can use any Root Explorer that contains an Text Editor and on an PC use Notepad++
Btw. I will release an Update as soon as i got time. I noticed, that the Max GPU / DDR frequencys and DDR lock are gettin overwritten by the system to the default values. I added an lil workaround to avoid that.
Also i added 3 CPU/GPU Profiles (Battery, Game & Default) that can easily gettin activated via Terminal Emulator.
Gesendet von meinem HUAWEI P6-U06 mit Tapatalk
HSD-Pilot said:
What do you mean with "which App"¿
The meaning of this package is to avoid 3rd Party Apps.
To Edit the Scripts you can use any Root Explorer that contains an Text Editor and on an PC use Notepad++
Btw. I will release an Update as soon as i got time. I noticed, that the Max GPU / DDR frequencys and DDR lock are gettin overwritten by the system to the default values. I added an lil workaround to avoid that.
Also i added 3 CPU/GPU Profiles (Battery, Game & Default) that can easily gettin activated via Terminal Emulator.
Gesendet von meinem HUAWEI P6-U06 mit Tapatalk
Click to expand...
Click to collapse
This package improves game performance significantly must i see. Big Thanks. :good:
Adding preset profiles will help alot
Question:
MIN/MAX GPU DDR frequency is higher than ur output on my phone. Is this because of the overwritting u mentioned ?
Nope, that's an typo. Max DDR should be 450000, it's already fixed in the next Update.
I guess i'm back @ home tomorrow, to upload it.
Edit: About the Min GPU & DDR Frequencys
They usually set to 360000 by default and we can't lower them through Scripts. The only way to lower the Min Freq is to lower the Max Freq! I couldn't find another solution :thumbdown:
So, when you set min 240000 & max 360000, min will always be 360000.
To set it lower you have to set min 240000 & max 240000.
The workaround i'm currently using is to make the max 240000 stick (by default it will not go/stick below 360000).
Gesendet von meinem HUAWEI P6-U06 mit Tapatalk
HSD-Pilot said:
Nope, that's an typo. Max DDR should be 450000, it's already fixed in the next Update.
I guess i'm back @ home tomorrow, to upload it.
Gesendet von meinem HUAWEI P6-U06 mit Tapatalk
Click to expand...
Click to collapse
Waiting for the update :fingers-crossed:
Me too!
Sent from my P6-U06
Update is up. Let me know how it works 4 ya :highfive:
HSD-Pilot said:
Update is up. Let me know how it works 4 ya :highfive:
Click to expand...
Click to collapse
can we just flash it over the previous version or do we need to unistall the previous one ?
will give feedback after installing it.
Just flash om top, the Update-Script will do everything 4 ya :good:
Btw: I finally had the time to switch to Surdu's Stock CM Version and will add an CM Edition after the Testflash of the Uploaded Zip :good:
And remember, to get back to Stock always use the uninstaller. After that your Device will reboot, like you had never flashed this Mod.
HSD-Pilot said:
Update is up. Let me know how it works 4 ya :highfive:
Click to expand...
Click to collapse
Many thanks, work good!
But I have a question.
I use smanager widget app.
How can I make a script that the toast notification list the set values like smanager?
Sorry for my bad english...
Sent from my P6-U06
Creating an Toast Notification out of an Script is not that easy, if even possible. As far as i know it needs some Java Stuff to create toasts.
Gesendet von meinem P6-U06 mit Tapatalk 2

Easy set Vsel and instant wakeup for CM11(recent nightly built by Quarx) & TWRP 2.8

Easy set Vsel and instant wakeup for CM11(recent nightly built by Quarx) & TWRP 2.8
Hi,all
Recently,I‘ve upgrade defy to CM11 nightly built that Qurax released everyday.And I'm using cm-11-20160628-NIGHTLY-mb52x.zip such a great rom works almost everything and smooth.
MANY THANKS to Quarx!
The rom is using TWRP 2.8.0.0, so I can't find setting CPU Vsel at boot.After some search,it can be done by adding some scripts to /system/etc/init.d/09overclock .(or using AeroControl )
Also,the rom delays to wakeup up to 3 seconds when you click the power button .
And I tried the same CPU governor & I/O schedul that used with 4.1.2 & 4.3.1,and it worked.These two settings built in the rom setting are sometimes failed to work and back to default, so I added them to script too.
Add these scripts to /system/etc/init.d/09overclock ,remember to leave a blank line at the end and set the same right (555) to the file.
Code:
#!/system/bin/sh
#
# Module location
MODULE_DIR="/system/lib/modules"
MODULE="/system/lib/modules/overclock_defy.ko"
SYMSEARCH_MODULE="/system/lib/modules/symsearch.ko"
/system/xbin/insmod $SYMSEARCH_MODULE
/system/xbin/insmod $MODULE_DIR/cpufreq_stats.ko
cpufreq_table=`grep -e omap2_clk_init_cpufreq_table /proc/kallsyms | sed -e "s/\([0-9A-Fa-f]\{8\}\).*/\1/"`
stats_update=`grep -e cpufreq_stats_freq_update /proc/kallsyms | sed -e "s/\([0-9A-Fa-f]\{8\}\).*/\1/"`
/system/xbin/insmod $MODULE omap2_clk_init_cpufreq_table_addr=0x$cpufreq_table
echo 0x$stats_update > /proc/overclock/cpufreq_stats_update_addr
# setVsel at boot,BACKUP your ROM first and use it caution with the stable vsel of your phone!
/system/xbin/busybox echo 55 > /proc/overclock/max_vsel
/system/xbin/busybox echo 1000000 > /proc/overclock/max_rate
/system/xbin/busybox echo 1 300000000 25 > /proc/overclock/mpu_opps
/system/xbin/busybox echo 2 600000000 35 > /proc/overclock/mpu_opps
/system/xbin/busybox echo 3 800000000 45 > /proc/overclock/mpu_opps
/system/xbin/busybox echo 4 1000000000 55 > /proc/overclock/mpu_opps
/system/xbin/busybox echo 0 1000000 > /proc/overclock/freq_table
/system/xbin/busybox echo 1 800000 > /proc/overclock/freq_table
/system/xbin/busybox echo 2 600000 > /proc/overclock/freq_table
/system/xbin/busybox echo 3 300000 > /proc/overclock/freq_table
# avoid wakeup delay when your settings fails sometime in /Settings/Performance/Processor & I/O scheduler.
sleep 60
/system/xbin/busybox echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
/system/xbin/busybox echo sio > /sys/block/mmcblk0/queue/scheduler
# Always check /Settings/Performance/Memory management/Allow purging of assets.
# While select ART runtime in Developer options and check Allow purging of assets ,using following minfree to max performance .
# Should put them below sleep 60,use as your choice.
# /system/xbin/busybox echo "0,1,2,4,7,15" > /sys/module/lowmemorykiller/parameters/adj
# /system/xbin/busybox echo "2464,3712,5632,7392,8608,9856" > /sys/module/lowmemorykiller/parameters/minfree
Also,set this to /system/build.prop ,to bring up income call interface much more fast.
ro.telephony.call_ring.delay=0
FYI,
about the last minfree part(other VM sets are ok by default ),I've done some test below.
ALL tested under ART runtime (its bugfree to me and ART is way much better than Dalvik,using Dalvik,browser crashed at 11-12 gifs no matter what ).
1.uncheck Allow purging of assets ,browser crashed loading 7 - 8 gifs picture in the webpage
2.check Allow purging of assets ,browser crashed loading 14 - 15 gifs picture (including the gifs above) in the webpage
3.check Allow purging of assets ,and using the minfree above ,browser crashed up to 24 gifs picture (including the gifs above) in the webpage(browser using nearly 320M ram...)
All behaviors the same delay switching to other apps when browser approaching to crash.
After done above ,there are only left 2 bugs to me
1.the menu & search button remap.(menu button can't be remapped to other function in the launcher ,and search button only works as search )
2.call recording not working (still searching method)

KFinally found the answer to bad battery life on our beloved htc 10's/works with Oreo

Save much reading and go to page 61. Answers to bad battery on the HTC 10 are worked out there. It's simplifies everything. Many posts here are works in progress kind of back and forth.
Guides I used for amplify are at the bottom of page 13.
(Remember to thank me in the op if anything here helped.)
After numerous hours of research and testing . Just wanted to reveal what I found. This is made for the OP-3 which is also a snapdragon 820 chipset device.
Ive been using on my Verizon HTC 10 with zero issues so far/ Lee-droid oreo rom/Elemental X -3.02 kernel. Much copy and pasting going on, just wanted to share my find.I take no credit for any of this : other than being willing to test on my device. After flashing the final version of (AKT.V1.6/FinalZIP )through twrp/ located on next page I ticked for the Op3 OR SNAPDRAGON 820 DEVICE from a terminul emilator, then I choose "Project Zhana battery" . I used rom toolbox pro's terminal emulator. Choose whatever profile you desire but the one I picked works fine/zero lag. Our other options (as of now) are soilwork scripts made for the HTC 10 or the helix engine now that pnpmgr has been disabled.
. First link is a huge thread on profiles from AKT. Go find which ever works best for your situation.
( I'm not telling you to flash anything. I'm showing you possible routes that have been tested by me. If you do not like results simply Ruu back to stock or dirty flash rom being used to get rid of it all.)
I'm about to tell you how to get buttery smooth, lag-free performance with insanely good battery life, using an old school governor featured in practically every kernel... This tweak is applicable to every phone with any ROM or kernel--stock or custom--that provides the Interactive Governor.
Yeah, yeah... everyone promises good battery with great performance, but who actually delivers? Maybe it isn't as smooth as you want, or maybe it requires something your kernel or ROM don't support. Or maybe the battery life promises just aren't what you expected. There's always some awful compromise. Not here!
This isn't a guide to get 36 hour battery life... provided you never use your phone. That's deep sleep optimization, which is lovely and all, but what good is the phone if you can never use it?! And with the new Marshmallow Doze feature, this strategy is becoming a thing of the past. What I'm talking about is 7-14 hour screen on, actual hands-on usage times! Without compromising anything, you can get 7-8 hour screen on usage with regular, no-compromise usage habits: daytime visible screen brightness, both radios on, sync on, network location on, all the regular usage features, the whole kit and kaboodle... all smooth as a baby's butt and snappy as a Slim Jim! (Up to 14+ hours if you can stand minimum brightness and WiFi-only with a custom ROM and other stuff turned off! And this is with stock voltages and full frequency range--you'll likely get even more if you choose to optimize those as well!)
However, it should be noted that this does not apply to gaming, heavy camera use, etc. Anything that is an automatic battery killer in and of itself. There's nothing that can be done about anything that forces the phone to utilize its maximum resources all the time. But you should know that by now. Further, this guide is about optimizing the CPU as much as possible. It does not cover things like eliminating wakelocks so your phone sleeps well, removing unnecessary and battery draining stock apps, keeping your screen brightness down*, and all that stuff that's been covered in other posts ad infinitum. Those optimizations are up to you.
If you really want to know the principles of this tweaks, please go to this thread since there everything is really well explained and I know you guys just want to apply the tweak and forget about everything behind it, so just keep scrolling!
Voltages and Frequencies:
So recently I have been investigating about the Voltages of our device (since that is a really useful information to know) before that we only have the Nominal frequencies (If you don't know what I am talking about go ahead and read @soniCron thread because I won't explain it) we could develop some tweaks with that, but we were pretty much making blind shots, guessing and hoping that all will be right. Well, now that we have all this information we can optimize our tweaks even more so expect new updates and rework for the current tweaks and of course new ones.
What About Touchboost?
Since I've noticed that a lot of people was asking about Touchboost, I decided to add this little explanation from @soniCron
" Touchboost is a nifty feature in a lot of kernels (including stock on Nexus 5X) that jumps up the frequency so that you experience minimal lag. However, with all the above settings, touchboost is usually detrimental to the efficiency of the device!
We generally want to keep the CPU on the lowest possible frequency as much as possible, and touchboost interferes with that. Further, because we've set up the maximal and minimal efficient clock rates, as well as burst processing from the 2nd CPU core, we don't need touchboost!
If your kernel allows you to shut it off, try to do so and see if the responsiveness of your device is acceptable. On the OP3 (and pretty much all the devices), touchboost adds no perceptual performance gain and only hurts efficiency and battery life. If your kernel doesn't allow you to turn off touchboost, try another one.
Your battery life will thank you! "
With all that been said, you shouldn't confuse Touchboost with CPU Boost and more specifically Input boost. Both are used to boost the clock speed of our device whenever we touch the touchscreen, so we don't suffer any lags.
The difference is that Input boost can be configured and Touchboost cannot, making it a really inefficient.
MY DEVICE LAGS!!! WHY?!?!
First of all, it's a "normal" thing, as I have stated before, all these tweaks have been done for fit my usage or certain usage which is most likely not the same as yours. Because this, when the are put on a certain scenario the might stutter or lag just a bit (If you are experimenting huge lags, you have done something wrong)
And yes, this can be fixed. We have a couple of ways of fixing it:
First of all, Check If the tweaks have been applied correctly
Our first one is modifying the Input boost (not touchboost) most of our tweaks have an already established Input boost clock speeds and time, you can incise does too a bit. For example, we have 960(Mhz) for all the CPU at 40ms you could bump it up to ~1036(Mhz) and 42ms, don't modify too much this values since it will potentially increase your battery drain.
Our second tool for fixing lags is min_sample_time , my recommendation is to increase the value by 5000 each time till you no longer suffer any stutter or lag.
Try another tweak, for example;
If you are using Project X.A.N.A Battery, try using Balanced option...
Still having lag?
Get rid of unnecessary (background-)apps
Try a different IO-Scheduler
Try another profile
My phone still uses too much battery
First of all, Check If the tweaks have been applied correctly
Make sure that you have disabled touchboost.
Set brightness to a lower level.
Use a dark / black theme
Don't play games all day
Try other tweak, for example;
If you are using Project Zhana Balanced, try using Battery option...
How to install:
A flashable zip to be flashed via recovery, which installs scripts of the latest iterations of most profiles (some legacy profiles had to be eliminated for more convenience) and a master script that takes control of all the installed scripts and applies your desired profile at will as soon as you recall it via Terminal Emulator app and get guided by the on-screen instructions.
So to wrap it up:
1- Download the latest AKT_Profile_vX.x.zip file
2- Reboot into TWRP recovery and flash the .zip file
3- After you boot up the phone, leave it to settle for a minute
4- Open up your favorite Terminal Emulator app
5- Grant it superuser permissions by typing in "su" without the quotes
6- After superuser permissions are granted, type in "AKT" without the quotes (yes capitalized)
Download link for AKT
https://forum.xda-developers.com/showpost.php?p=70352820&postcount=2146
Xposed with magic information and downloads.
This is where the rubber meets the road. Amplify and greenify for Oreo!!!
https://forum.xda-developers.com/xposed/unofficial-systemless-xposed-t3388268
(Save yourself some time and jump to page 61 Finally found the answers there. Long live the HTC 10. My device is finally a beast.)
Sounds interesting - might give it a try
It's running like a totally different phone. I'm amazed almost 2 hours of screen on time and still at 70% battery. And I'm casting to my living room TV as well. Still zero lag. So phone is running tasks as well. And I'm back and forth on here. Works nicely.
mattie_49 said:
It's running like a totally different phone. I'm amazed almost 2 hours of screen on time and still at 70% battery. And I'm casting to my living room TV as well. Still zero lag. So phone is running tasks as well. And I'm back and forth on here. Works nicely.
Click to expand...
Click to collapse
Are you using stock elemental x settings or other ?
Code:
#!/system/bin/sh
#Author: Asiier
#Settings By: Asiier
#Device: One Plus 3
#Codename: Project Zhana (BT)
#Build Status: Stable
#Version: 4.2
#Last Updated: 22/01/2017
#Notes: Please give credit when using this in your work!
#TWEAKS_BEGIN
echo ""
echo --------------------------------------------------------
echo Applying 'Project Zhana (Battery variant)' v4.3
echo Advanced Kernel Settings
echo --------------------------------------------------------
sleep 0.5
echo Author: Asiier
echo Settings By: Asiier
echo "Device: One Plus 3 & SD820 Devices"
echo Codename: 'Project Zhana (BT)'
echo Build Status: Stable
echo Last Updated: 19/09/2017
echo For more information go to the XDA theard
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sleep 0.3
echo Checking Android version...
if grep -q 'ro.build.version.sdk=25' /system/build.prop; then
echo Android Nougat 7.1.X detected!
sleep 0.3
echo N detected... Applying proper settings
fi
if grep -q 'ro.build.version.sdk=24' /system/build.prop; then
echo Android Nougat 7.0.X detected!
sleep 0.3
echo N detected... Applying proper settings
fi
if grep -q 'ro.build.version.sdk=23' /system/build.prop; then
echo Android Marshmallow 6.0.1 detected!
sleep 0.3
echo MM detected... Applying proper settings
fi
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sleep 0.3
#Apply settings to LITTLE cluster
echo Applying settings to LITTLE Cluster...
sleep 0.5
#Temporarily change permissions to governor files for the LITTLE cluster to enable Interactive governor
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo interactive > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
#Grab Maximum Achievable Frequency for the LITTLE Cluster
maxfreq=$(cat "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq")
if test "$maxfreq" -eq 1593600; then
#Temporarily change permissions to governor files for the Big cluster to set the maximum frequency to 1593MHz
echo No LITTLE Cluster Overclocking detected.
echo Applying appropriate values.
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1593600 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #Core 0 Maximum Frequency = 1593MHz
chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
echo 70 480000:65 556800:75 729600:82 960000:86 1036800:2 1228800:99 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
fi
if test "$maxfreq" -eq 1728000; then
#Temporarily change permissions to governor files for the Little cluster to set the maximum frequency to 1728MHz
echo LITTLE Cluster Overclocking detected.
echo Applying appropriate values.
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1728000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #Core 0 Maximum Frequency = 1728MHz
chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
echo 70 480000:65 556800:75 729600:82 960000:86 1036800:2 1228800:99 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
maxfreq=$(cat "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq")
fi
if test "$maxfreq" -lt 1593600; then
#Temporarily change permissions to governor files for the Big cluster to set the maximum frequency to 1593MHz
echo LITTLE Cluster Underclocking detected!!
sleep 1
echo We recommend not to UnderClock the CPU as the tweaks already will take care of that If needed
echo The tweaks will continue getting applied but we recommend setting the CPU to Max frequency!
sleep 4
#chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
#echo 1593600 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #Core 0 Maximum Frequency = 1593MHz
#chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
echo 70 480000:65 556800:75 729600:82 960000:86 1036800:2 1228800:99 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
elif test $maxfreq -gt 1728000; then
#Temporarily change permissions to governor files for the Little cluster to set the maximum frequency to 1728MHz
echo LITTLE Cluster Overclocking detected.
sleep 1
echo This OverClock is higher than normal and only possible on Xceed Kernel
echo The tweak will continue getting applyed
echo " Althought it might no reach the maximum frequency you have setted as it haven't been made to work with frecuencies higher than 1728 Mhz "
#chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
#echo 1728000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq #Core 0 Maximum Frequency = 1728MHz
#chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
echo 70 480000:65 556800:75 729600:82 960000:86 1036800:2 1228800:99 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
fi
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/*
echo 220000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_slack
echo 307200 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq
echo 100000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate
echo 0 729600:76000 960000:99000 1228800:150000 1478400:170000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay
echo 155 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load
echo 22000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/ignore_hispeed_on_notif
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/boost
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/fast_ramp_down
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/align_windows
echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/boostpulse_duration
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy
if [ -e "/sys/devices/system/cpu/cpu0/cpufreq/interactive/enable_prediction" ]; then
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/enable_prediction
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/enable_prediction
fi
sleep 0.5
#Apply settings to Big cluster
echo Applying settings to BIG Cluster
sleep 0.2
#Temporarily change permissions to governor files for the LITTLE cluster to enable Interactive governor
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo interactive > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
#Grab Maximum Achievable Frequency for the Big Cluster
maxfreq=$(cat "/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_max_freq")
if test $maxfreq -eq 2150400; then
#Temporarily change permissions to governor files for the Big cluster to set the maximum frequency to 2150MHz
echo No BIG Cluster Overclocking detected.
echo Applying appropriate values.
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
echo 2150400 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq #Core 2 Maximum Frequency = 2150MHz
chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
echo 65 940800:80 1036800:2 1401600:95 1824000:98 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
#Set overclock max frequency compatible target_loads
elif test $maxfreq -eq 2265600; then
#Temporarily change permissions to governor files for the Big cluster to set the maximum frequency to 2265MHz
echo BIG Cluster Overclocking detected.
echo Applying appropriate values.
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
echo 2265600 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq #Core 2 Maximum Frequency = 2265MHz
chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
echo 65 940800:80 1036800:2 1401600:95 1824000:98 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
fi
if test $maxfreq -lt 2150400; then
#Temporarily change permissions to governor files for the Big cluster to set the maximum frequency to 1593MHz
echo BIG Cluster Underclocking detected!!
sleep 1
echo We recommend not to UnderClock the CPU as the tweaks already will take care of that If needed
echo The tweaks will continue getting applied but we recommend setting the CPU to Max frequency!
sleep 4
#chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
#echo 1593600 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq #Core 0 Maximum Frequency = 1593MHz
#chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
echo 65 940800:80 1036800:2 1401600:95 1824000:98 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
elif test $maxfreq -gt 2265600; then
#Temporarily change permissions to governor files for the Little cluster to set the maximum frequency to 1728MHz
echo BIG Cluster Overclocking detected.
sleep 1
echo This OverClock is higher than normal and only possible on Xceed Kernel
echo The tweak will continue getting applyed
echo " Althought it might no reach the maximum frequency you have setted as it haven't been made to work with frecuencies higher than 2265600 Mhz "
sleep 4
#chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
#echo 1728000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq #Core 0 Maximum Frequency = 1728MHz
#chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
echo 65 940800:80 1036800:99 1401600:95 1824000:98 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
fi
sleep 0.5
#Tweak Interactive Governor
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/*
echo 140000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/timer_slack
echo 1401600 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/hispeed_freq
echo 65000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/timer_rate
echo 32000 940800:85000 1248000:96000 1401600:88000 1632000:80000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/above_hispeed_delay
echo 99 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/go_hispeed_load
echo 11000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/min_sample_time
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/max_freq_hysteresis
echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/ignore_hispeed_on_notif
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/boost
echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/fast_ramp_down
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/align_windows
echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_migration_notif
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_sched_load
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/boostpulse_duration
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/io_is_busy
if [ -e "/sys/devices/system/cpu/cpu2/cpufreq/interactive/enable_prediction" ]; then
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/interactive/enable_prediction
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/enable_prediction
fi
echo "=========================================="
echo Checking whether you are using a Sultanxda based ROM or not
echo "=========================================="
#Checking whether you are using a Sultanxda based ROM or not
echo Checking ROM...
sleep 0.2
echo Applying appropriate values.
if [ -e "/sys/kernel/cpu_input_boost/enabled" ]; then
echo Enabling Input Boost for the LITTLE cluster @556 MHz and for the BIG Cluster @0Mhz and Custom thermal driver of Sultanxda
chmod 644 /sys/kernel/cpu_input_boost/*
echo 1 > /sys/kernel/cpu_input_boost/enabled
echo 66 > /sys/kernel/cpu_input_boost/ib_duration_ms
echo 556800 0 > /sys/kernel/cpu_input_boost/ib_freqs
chmod 444 /sys/kernel/cpu_input_boost/*
chmod 644 /sys/kernel/msm_thermal/enabled
echo 0 > /sys/kernel/msm_thermal/enabled
chmod 444 /sys/kernel/msm_thermal/enabled
else
#Checking whether you are using a Lineage based ROM or not
echo Checking ROM...
sleep 0.2
if grep -q 'ro.build.flavor=lineage_oneplus3-userdebug' /system/build.prop; then
#Enable Input Boost for LITTLE cluster @556MHz and for BIG cluster @729MHz for 66ms
echo Lineage Based ROM detected
echo Applying appropriate values.
echo Enabling Input Boost at 556 MHz for the LITTLE cluster and at 0 MHz for the BIG Cluster
if [ -e "/sys/module/cpu_boost/parameters/input_boost_freq" ]; then
chmod 644 /sys/module/cpu_boost/parameters/input_boost_freq
echo 0:556800 1:0 2:0 3:0 > /sys/module/cpu_boost/parameters/input_boost_freq
chmod 644 /sys/module/cpu_boost/parameters/input_boost_ms
echo 55 > /sys/module/cpu_boost/parameters/input_boost_ms
else
echo "*Input Boost is not avalible for your Kernel*"
fi
if [ -e "/sys/module/cpu_boost/parameters/boost_ms" ]; then
chmod 644 /sys/module/cpu_boost/parameters/boost_ms
echo 0 > /sys/module/cpu_boost/parameters/boost_ms
else
echo "*Cpu_Boost is not avalible for your Kernel*"
fi
else
#Enable Input Boost for LITTLE cluster @729MHz and for BIG cluster @729Hz for 100ms
echo Non-Lineage ROM detected
echo Applying appropriate values.
echo Enabling Input Boost at 729 MHz for the LITTLE cluster and at 0 MHz for the BIG Cluster
if [ -e "/sys/module/cpu_boost/parameters/input_boost_freq" ]; then
chmod 644 /sys/module/cpu_boost/parameters/input_boost_freq
echo 0:729600 1:0 2:0 3:0 > /sys/module/cpu_boost/parameters/input_boost_freq
chmod 644 /sys/module/cpu_boost/parameters/input_boost_ms
echo 77 > /sys/module/cpu_boost/parameters/input_boost_ms
else
echo "*Input Boost is not avalible for your Kernel*"
fi
if [ -e "/sys/module/cpu_boost/parameters/boost_ms" ]; then
chmod 644 /sys/module/cpu_boost/parameters/boost_ms
echo 0 > /sys/module/cpu_boost/parameters/boost_ms
else
echo "*Cpu_Boost is not avalible for your Kernel*"
fi
fi
fi
sleep 0.3
echo "=========================================="
#Disable TouchBoost
echo Disabling TouchBoost
if [ -e "/sys/module/msm_performance/parameters/touchboost" ]; then
chmod 644 /sys/module/msm_performance/parameters/touchboost
echo 0 > /sys/module/msm_performance/parameters/touchboost
else
echo "*Not supported for your current Kernel*"
fi
#Disable BCL
echo Disabling BCL and Removing Perfd
if [ -e "/sys/devices/soc/soc:qcom,bcl/mode" ]; then
echo -n disable > /sys/devices/soc/soc:qcom,bcl/mode
fi
#Enable Core Control and Disable MSM Thermal Throttling allowing for longer sustained performance
echo Disabling Aggressive CPU Thermal Throttling
if [ -e "/sys/module/msm_thermal/core_control/enabled" ]; then
echo 1 > /sys/module/msm_thermal/core_control/enabled
fi
if [ -e "/sys/module/msm_thermal/parameters/enabled" ]; then
echo N > /sys/module/msm_thermal/parameters/enabled
fi
#Tweak HMP Scheduler to feed the Big cluster more tasks
sleep 0.3
#echo Tweaking HMP Scheduler for correcting BIG Cluster utilization
echo 2 > /proc/sys/kernel/sched_window_stats_policy
echo 85 > /proc/sys/kernel/sched_upmigrate
echo 62 > /proc/sys/kernel/sched_downmigrate
echo 5 > /proc/sys/kernel/sched_spill_nr_run
echo 100 > /proc/sys/kernel/sched_spill_load
echo 30 > /proc/sys/kernel/sched_init_task_load
if [ -e "/proc/sys/kernel/sched_heavy_task" ]; then
echo 65 > /proc/sys/kernel/sched_heavy_task
fi
if [ -e "/proc/sys/kernel/sched_enable_power_aware" ]; then
echo 1 > /proc/sys/kernel/sched_enable_power_aware
fi
echo 10 > /proc/sys/kernel/sched_upmigrate_min_nice
echo 4 > /proc/sys/kernel/sched_ravg_hist_size
if [ -e "/proc/sys/kernel/sched_small_wakee_task_load" ]; then
echo 7 > /proc/sys/kernel/sched_small_wakee_task_load
fi
if [ -e "/proc/sys/kernel/sched_wakeup_load_threshold" ]; then
echo 110 > /proc/sys/kernel/sched_wakeup_load_threshold
fi
if [ -e "/proc/sys/kernel/sched_small_task" ]; then
echo 7 > /proc/sys/kernel/sched_small_task
fi
if [ -e "/proc/sys/kernel/sched_big_waker_task_load" ]; then
echo 35 > /proc/sys/kernel/sched_big_waker_task_load
fi
echo 950000 > /proc/sys/kernel/sched_rt_runtime_us
echo 1000000 > /proc/sys/kernel/sched_rt_period_us
if [ -e "/proc/sys/kernel/sched_migration_fixup" ]; then
echo 1 > /proc/sys/kernel/sched_migration_fixup
fi
if [ -e "/proc/sys/kernel/sched_freq_dec_notify" ]; then
echo 410000 > /proc/sys/kernel/sched_freq_dec_notify
fi
if [ -e "/proc/sys/kernel/sched_freq_inc_notify" ]; then
echo 600000 > /proc/sys/kernel/sched_freq_inc_notify
fi
if [ -e "/proc/sys/kernel/sched_boost" ]; then
echo 0 > /proc/sys/kernel/sched_boost
fi
#Tweaks for other various Settings
sleep 0.5
echo "=========================================="
echo Tweaking other various Settings
echo ·I/O Values
if [ -d /sys/block/dm-0 ] || [ -d /sys/devices/virtual/block/dm-0 ]; then
if [ -e /sys/devices/virtual/block/dm-0/queue/scheduler ]; then
DM_PATH=/sys/devices/virtual/block/dm-0/queue
fi
if [ -e /sys/block/dm-0/queue/scheduler ]; then
DM_PATH=/sys/block/dm-0/queue
fi
string=/sys/devices/virtual/block/dm-0/queue/scheduler;
Zen_Available=false;
if $BB grep 'zen' $string; then
Zen_Available=true;
fi
if [ "$Zen_Available" == "true" ]; then
if [ -e $DM_PATH/scheduler_hard ]; then
echo zen > $DM_PATH/scheduler_hard
fi
echo zen > $DM_PATH/scheduler
sleep 2
echo 300 > $DM_PATH/iosched/sync_expire
echo 2800 > $DM_PATH/iosched/async_expire
echo 14 > $DM_PATH/iosched/fifo_batch
chmod 644 $DM_PATH/iosched/sync_expire
echo 300 > $DM_PATH/iosched/sync_expire
fi
if [ "$Zen_Available" = "false" ]; then
if grep -q 'ro.build.flavor=lineage_oneplus3-userdebug' /system/build.prop; then
echo ZEN not avalible, setting 'Noop' instead...
if [ -e $DM_PATH/scheduler_hard ]; then
echo noop > $DM_PATH/scheduler_hard
fi
echo noop > $DM_PATH/scheduler
else
echo ZEN not avalible, setting 'CFQ' instead...
if [ -e $DM_PATH/scheduler_hard ]; then
echo cfq > $DM_PATH/scheduler_hard
fi
echo cfq > $DM_PATH/scheduler
fi
fi
fi
for i in /sys/block/../devices/soc/624000.ufshc/host0/target0:0:0/0:0:0:[0-4]/block/*/queue; do
string4=$($BB readlink -f $i/scheduler | cut -d 'q' -f1 | cut -d 'k' -f2 | cut -d '/' -f2 | tr a-z A-Z)
string5=$($BB cat $i/scheduler | cut -d ']' -f1 | cut -d '[' -f2 | $BB tr a-z A-Z)
if [ "$string5" == "NOOP" ]; then
echo "Leaving $string4 block at default $string5"
echo ""
sleep 0.1
fi
if [ "$string5" != "NOOP" ]; then
echo "Changing $string4 block I/O scheduler"
if [ -e $i/scheduler_hard ]; then
echo zen > $i/scheduler_hard
fi
echo zen > $i/scheduler
echo ""
sleep 2
# Initialize string 6 to avoid reference conflicts
string6=$($BB cat $i/scheduler | cut -d ']' -f1 | cut -d '[' -f2)
if [ "$string6" == "zen" ]; then
echo 300 > $i/iosched/sync_expire
echo 2800 > $i/iosched/async_expire
echo 14 > $i/iosched/fifo_batch
chmod 644 $i/iosched/sync_expire
echo 300 > $i/iosched/sync_expire
fi
fi
done
if [ -e "$DM_PATH/iostats" ]; then
echo 0 > $DM_PATH/iostats
fi
if [ -e "$DM_PATH/rq_affinity" ]; then
echo 1 > $DM_PATH/rq_affinity
fi
if [ -e "/sys/block/dm-0/bdi/read_ahead_kb" ]; then
echo 512 > /sys/devices/virtual/block/dm-0/bdi/read_ahead_kb
fi
if [ -e "/sys/block/sda/bdi/read_ahead_kb" ]; then
echo 512 > /sys/block/sda/bdi/read_ahead_kb
fi
echo ·Memory Values
echo 0 > /proc/sys/vm/swappiness
echo 100 > /proc/sys/vm/vfs_cache_pressure
echo 80 > /proc/sys/vm/dirty_ratio
echo 20 > /proc/sys/vm/dirty_background_ratio
echo 4096 > /proc/sys/vm/min_free_kbytes
echo 100 > /proc/sys/vm/dirty_expire_centisecs
echo 250 > /proc/sys/vm/dirty_writeback_centisecs
echo 0 > /proc/sys/vm/oom_kill_allocating_task
echo 3 > /proc/sys/vm/page-cluster
if [ -e "/sys/module/lowmemorykiller/parameters/enable_adaptive_lmk" ]; then
chmod 666 /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk
chown root /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk
echo 0 > /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk
fi
if [ -e "/sys/module/lowmemorykiller/parameters/enable_adaptive_lmk" ]; then
echo 0 > /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk
else
echo ' *Adaptive LMK is not present on your Kernel* '
fi
if [ -e "/sys/module/lowmemorykiller/parameters/minfree" ]; then
echo 23939,44091,58788,73485,88182,102879 > /sys/module/lowmemorykiller/parameters/minfree
else
echo ' *LMK cannot currently be modified on your Kernel* '
fi
echo ·TCP Values
string2=/proc/sys/net/ipv4/tcp_available_congestion_control
if grep 'westwood' $string2; then
echo westwood > /proc/sys/net/ipv4/tcp_congestion_control
else
echo Westwood not avilable, using Cubic
echo cubic > /proc/sys/net/ipv4/tcp_congestion_control
fi
#Tweaking GPU
sleep 0.4
echo GPU Tweaking
echo msm-adreno-tz > /sys/devices/soc/b00000.qcom,kgsl-3d0/devfreq/b00000.qcom,kgsl-3d0/governor
if grep -q 'ro.build.version.sdk=25' /system/build.prop; then
if grep -q 'ro.build.flavor=lineage_oneplus3-userdebug' /system/build.prop; then
echo 510000000 > /sys/class/kgsl/kgsl-3d0/max_gpuclk
else
echo 560000000 > /sys/class/kgsl/kgsl-3d0/max_gpuclk
fi
fi
if grep -q 'ro.build.version.sdk=24' /system/build.prop; then
if grep -q 'ro.build.flavor=lineage_oneplus3-userdebug' /system/build.prop; then
echo 510000000 > /sys/class/kgsl/kgsl-3d0/max_gpuclk
else
echo 560000000 > /sys/class/kgsl/kgsl-3d0/max_gpuclk
fi
fi
if grep -q 'ro.build.version.sdk=23' /system/build.prop; then
if grep -q 'ro.build.flavor=lineage_oneplus3-userdebug' /system/build.prop; then
echo 560000000 > /sys/devices/soc/b00000.qcom,kgsl-3d0/devfreq/b00000.qcom,kgsl-3d0/max_freq
else
echo 560000000 > /sys/devices/soc/b00000.qcom,kgsl-3d0/devfreq/b00000.qcom,kgsl-3d0/max_freq
fi
else
if grep -q 'ro.build.flavor=lineage_oneplus3-userdebug' /system/build.prop; then
echo 510000000 > /sys/devices/soc/b00000.qcom,kgsl-3d0/devfreq/b00000.qcom,kgsl-3d0/max_freq
else
echo 560000000 > /sys/devices/soc/b00000.qcom,kgsl-3d0/devfreq/b00000.qcom,kgsl-3d0/max_freq
fi
fi
sleep 1
echo ------------------------------------------------------------
echo 'Project Zhana v4.3' Successfully Applied!
echo "Project Zhana Battery" > /data/system/current_profile
echo You may now tweak them further
echo using EXKM or Kernel Adiutor
echo ------------------------------------------------------------
echo ""
echo " Done, this will be automatically closed..."
sleep 4
#################################################
#Modded by Asiier
#Please say thanks and give proper credits if you're using this profile.
#Credits
#*soniCron *Alcolawl *RogerF81 *Patalao *Mostafa Wael *Senthil360 and all of those that have share their profiles on Nexus 5X/6P Advanced Interactive Tweaks respective threads.
Important are:
Small Cores Tweaks.
echo 70 480000:65 556800:75 729600:82 960000:86 1036800:2 1228800:99 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
echo 220000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_slack
echo 307200 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq
echo 100000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate
echo 0 729600:76000 960000:99000 1228800:150000 1478400:170000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay
echo 155 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load
echo 22000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/ignore_hispeed_on_notif
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/boost
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/fast_ramp_down
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/align_windows
echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/boostpulse_duration
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy
if [ -e "/sys/devices/system/cpu/cpu0/cpufreq/interactive/enable_prediction" ]; then
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/enable_prediction
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/enable_prediction
fi
Big Cores Tweaks:
echo 65 940800:80 1036800:2 1401600:95 1824000:98 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
echo 140000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/timer_slack
echo 1401600 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/hispeed_freq
echo 65000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/timer_rate
echo 32000 940800:85000 1248000:96000 1401600:88000 1632000:80000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/above_hispeed_delay
echo 99 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/go_hispeed_load
echo 11000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/min_sample_time
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/max_freq_hysteresis
echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/ignore_hispeed_on_notif
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/boost
echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/fast_ramp_down
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/align_windows
echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_migration_notif
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_sched_load
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/boostpulse_duration
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/io_is_busy
if [ -e "/sys/devices/system/cpu/cpu2/cpufreq/interactive/enable_prediction" ]; then
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/interactive/enable_prediction
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/enable_prediction
fi
#Enable Input Boost for LITTLE cluster @729MHz and for BIG cluster @729Hz for 100ms
echo Non-Lineage ROM detected
echo Applying appropriate values.
echo Enabling Input Boost at 729 MHz for the LITTLE cluster and at 0 MHz for the BIG Cluster
if [ -e "/sys/module/cpu_boost/parameters/input_boost_freq" ]; then
chmod 644 /sys/module/cpu_boost/parameters/input_boost_freq
echo 0:729600 1:0 2:0 3:0 > /sys/module/cpu_boost/parameters/input_boost_freq
chmod 644 /sys/module/cpu_boost/parameters/input_boost_ms
echo 77 > /sys/module/cpu_boost/parameters/input_boost_ms
else
echo "*Input Boost is not avalible for your Kernel*"
fi
#echo Tweaking HMP Scheduler for correcting BIG Cluster utilization
echo 2 > /proc/sys/kernel/sched_window_stats_policy
echo 85 > /proc/sys/kernel/sched_upmigrate
echo 62 > /proc/sys/kernel/sched_downmigrate
echo 5 > /proc/sys/kernel/sched_spill_nr_run
echo 100 > /proc/sys/kernel/sched_spill_load
echo 30 > /proc/sys/kernel/sched_init_task_load
it prefers Zen, if not available goes to noop or CFQ
Some Memory tweaks..
cho ·Memory Values
echo 0 > /proc/sys/vm/swappiness
echo 100 > /proc/sys/vm/vfs_cache_pressure
echo 80 > /proc/sys/vm/dirty_ratio
echo 20 > /proc/sys/vm/dirty_background_ratio
echo 4096 > /proc/sys/vm/min_free_kbytes
echo 100 > /proc/sys/vm/dirty_expire_centisecs
echo 250 > /proc/sys/vm/dirty_writeback_centisecs
echo 0 > /proc/sys/vm/oom_kill_allocating_task
echo 3 > /proc/sys/vm/page-cluster
tries to set TCP to westwood if not cubic.
echo msm-adreno-tz > /sys/devices/soc/b00000.qcom,kgsl-3d0/devfreq/b00000.qcom,kgsl-3d0/governor
Oh... and the whole zip is made for SDK25 or lower so not really O compatible.
So yeah... you'd better set the values you'd want manually instead of relying on a outdated all in one wonder script.
timbohobbs said:
Are you using stock elemental x settings or other ?
Click to expand...
Click to collapse
Stock
Haldi4803 said:
Important are:
Small Cores Tweaks.
echo 70 480000:65 556800:75 729600:82 960000:86 1036800:2 1228800:99 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
echo 220000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_slack
echo 307200 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq
echo 100000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate
echo 0 729600:76000 960000:99000 1228800:150000 1478400:170000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay
echo 155 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load
echo 22000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/ignore_hispeed_on_notif
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/boost
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/fast_ramp_down
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/align_windows
echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/boostpulse_duration
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy
if [ -e "/sys/devices/system/cpu/cpu0/cpufreq/interactive/enable_prediction" ]; then
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/enable_prediction
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/enable_prediction
fi
Big Cores Tweaks:
echo 65 940800:80 1036800:2 1401600:95 1824000:98 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
echo 140000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/timer_slack
echo 1401600 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/hispeed_freq
echo 65000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/timer_rate
echo 32000 940800:85000 1248000:96000 1401600:88000 1632000:80000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/above_hispeed_delay
echo 99 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/go_hispeed_load
echo 11000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/min_sample_time
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/max_freq_hysteresis
echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/ignore_hispeed_on_notif
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/boost
echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/fast_ramp_down
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/align_windows
echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_migration_notif
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_sched_load
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/boostpulse_duration
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/io_is_busy
if [ -e "/sys/devices/system/cpu/cpu2/cpufreq/interactive/enable_prediction" ]; then
chmod 644 /sys/devices/system/cpu/cpu2/cpufreq/interactive/enable_prediction
echo 0 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/enable_prediction
fi
#Enable Input Boost for LITTLE cluster @729MHz and for BIG cluster @729Hz for 100ms
echo Non-Lineage ROM detected
echo Applying appropriate values.
echo Enabling Input Boost at 729 MHz for the LITTLE cluster and at 0 MHz for the BIG Cluster
if [ -e "/sys/module/cpu_boost/parameters/input_boost_freq" ]; then
chmod 644 /sys/module/cpu_boost/parameters/input_boost_freq
echo 0:729600 1:0 2:0 3:0 > /sys/module/cpu_boost/parameters/input_boost_freq
chmod 644 /sys/module/cpu_boost/parameters/input_boost_ms
echo 77 > /sys/module/cpu_boost/parameters/input_boost_ms
else
echo "*Input Boost is not avalible for your Kernel*"
fi
#echo Tweaking HMP Scheduler for correcting BIG Cluster utilization
echo 2 > /proc/sys/kernel/sched_window_stats_policy
echo 85 > /proc/sys/kernel/sched_upmigrate
echo 62 > /proc/sys/kernel/sched_downmigrate
echo 5 > /proc/sys/kernel/sched_spill_nr_run
echo 100 > /proc/sys/kernel/sched_spill_load
echo 30 > /proc/sys/kernel/sched_init_task_load
it prefers Zen, if not available goes to noop or CFQ
Some Memory tweaks..
cho ·Memory Values
echo 0 > /proc/sys/vm/swappiness
echo 100 > /proc/sys/vm/vfs_cache_pressure
echo 80 > /proc/sys/vm/dirty_ratio
echo 20 > /proc/sys/vm/dirty_background_ratio
echo 4096 > /proc/sys/vm/min_free_kbytes
echo 100 > /proc/sys/vm/dirty_expire_centisecs
echo 250 > /proc/sys/vm/dirty_writeback_centisecs
echo 0 > /proc/sys/vm/oom_kill_allocating_task
echo 3 > /proc/sys/vm/page-cluster
tries to set TCP to westwood if not cubic.
echo msm-adreno-tz > /sys/devices/soc/b00000.qcom,kgsl-3d0/devfreq/b00000.qcom,kgsl-3d0/governor
Oh... and the whole zip is made for SDK25 or lower so not really O compatible.
So yeah... you'd better set the values you'd want manually instead of relying on a outdated all in one wonder script.
Click to expand...
Click to collapse
That would work if I knew how to set all those values. For me though I do not.
So i was checking this out and in the FAQ thread here: https://forum.xda-developers.com/showpost.php?p=69037152&postcount=3
Near the top it mentions the HTC10 with a link that explains why it doesn't work or doesn't work as well on an HTC device, linked here: https://forum.xda-developers.com/showpost.php?p=70815496&postcount=2864
The long and short of it is I guess HTC uses there own proprietary pnp manager. But it does go on to say that someone else took the work being done with AKT and made a unified kernel tweak, linked here: https://forum.xda-developers.com/htc-10/development/advanced-interactive-governor-tweaks-t3543589 Which i guess works for anything including HTC's stock kernel.
whew........ So i guess my question first of all is are you using AKT, or are you using Soilwork: Unified kernel-tweaks?
I guess the next question is those of us using modded kernel (cleanslate and Elemental X) Do those kernels have HTC's proprietary pnp manager turned on and they are just tweaking it, or do they shut it off completely and go there own route.
If they shut it off completely then it sounds like AKT is the way to go, but if they don't are are just tweaking HTC's pnp manager, it sounds like the Soilwork tweak is the way to go.
BTW i also use Leedoird, but i'm rocking the CleanSlate kernel atm.
Void4ever
void4ever said:
So i was checking this out and in the FAQ thread here: https://forum.xda-developers.com/showpost.php?p=69037152&postcount=3
Near the top it mentions the HTC10 with a link that explains why it doesn't work or doesn't work as well on an HTC device, linked here: https://forum.xda-developers.com/showpost.php?p=70815496&postcount=2864
The long and short of it is I guess HTC uses there own proprietary pnp manager. But it does go on to say that someone else took the work being done with AKT and made a unified kernel tweak, linked here: https://forum.xda-developers.com/htc-10/development/advanced-interactive-governor-tweaks-t3543589 Which i guess works for anything including HTC's stock kernel.
whew........ So i guess my question first of all is are you using AKT, or are you using Soilwork: Unified kernel-tweaks?
I guess the next question is those of us using modded kernel (cleanslate and Elemental X) Do those kernels have HTC's proprietary pnp manager turned on and they are just tweaking it, or do they shut it off completely and go there own route.
If they shut it off completely then it sounds like AKT is the way to go, but if they don't are are just tweaking HTC's pnp manager, it sounds like the Soilwork tweak is the way to go.
BTW i also use Leedoird, but i'm rocking the CleanSlate kernel atm.
Void4ever
Click to expand...
Click to collapse
Using AKT. And enabled through terminal.And no I didn't disable pnp mgr, I'm guessing it overrides it. And soilwork won't flash. Akt is working fine for me no reboots or massive drains or wakelocks.No excessive heat either running cool as a cucumber,so until pnp is updated I chose to use this route. I'm getting better averages than I was on Nougat. 4.5 hrs on screen currently 27% battery remaining and 16 hours off charger. Try it and see what you think.
mattie_49 said:
Using AKT. And enabled through terminal.And no I didn't disable pnp mgr, I'm guessing it overrides it. And soilwork won't flash. Akt is working fine for me no reboots or massive drains or wakelocks.No excessive heat either running cool as a cucumber,so until pnp is updated I chose to use this route. I'm getting better averages than I was on Nougat. 4.5 hrs on screen currently 27% battery remaining and 16 hours off charger. Try it and see what you think.
Click to expand...
Click to collapse
Hi, do you think this would work on Nougat? I have random reboots at 40% battery left.
NickDVS said:
Hi, do you think this would work on Nougat? I have random reboots at 40% battery left.
Click to expand...
Click to collapse
I'm sure. Try and see
I've done all of this before & it only helps slightly. The drain is related to HTC's framework & it's dialer, and the only way to truly stop the drain is to use airplane mode...which kind of defeats the purpose of it being a phone.
This battery issue is non-existent with LineageOS 15.1 & AOSiP 8.1, running on Oreo firmware. Both of those ROMs work fine, but still have bugs: bottom speaker barely works & Bluetooth issues.
mattie_49 said:
Using AKT. And enabled through terminal.And no I didn't disable pnp mgr, I'm guessing it overrides it. And soilwork won't flash. Akt is working fine for me no reboots or massive drains or wakelocks.No excessive heat either running cool as a cucumber,so until pnp is updated I chose to use this route. I'm getting better averages than I was on Nougat. 4.5 hrs on screen currently 27% battery remaining and 16 hours off charger. Try it and see what you think.
Click to expand...
Click to collapse
I am o. Leedroid 5.2 with stock kernel tweaked by leedroid, can I install a stock stock kernel and what rom do you have?
Is this AKT still work after reboot? Or we must re-enable it after reboot?
fresh777 said:
Is this AKT still work after reboot? Or we must re-enable it after reboot?
Click to expand...
Click to collapse
Must use a terminal emulator. Type su enter
Then type AKT then it's self explainable, choose your profile.
mattie_49 said:
Must use a terminal emulator. Type su enter
Then type AKT then it's self explainable, choose your profile.
Click to expand...
Click to collapse
Thanks for the reply. I mean after run AKT from terminal and done. For the next reboot, i must repeat the step or not?
fresh777 said:
Thanks for the reply. I mean after run AKT from terminal and done. For the next reboot, i must repeat the step or not?
Click to expand...
Click to collapse
No. All done till you wanna change profiles if at all. Terminal will tell you what profile is active after AKT enter
mattie_49 said:
No. All done till you wanna change profiles if at all. Terminal will tell you what profile is active after AKT enter
Click to expand...
Click to collapse
Thank you. I just use this in aosip 8.1 rom. Don't see any improvement for battery life. But for hot issue, i didn't got this issue when use AKT.
Ninja X said:
I am o. Leedroid 5.2 with stock kernel tweaked by leedroid, can I install a stock stock kernel and what rom do you have?
Click to expand...
Click to collapse
the stock kernel in leedroid is not tweaked, you either have the actual stock kernel or the cleanslate kernel.
Oooh.

Categories

Resources