[Miscellaneous Android Development] Luiz Paulo Damaceno:
Hello people, I'm an A6020 user and i've maked some mods to custom and stock roms for our device. This device have a very little temperature Thermal Engine and throttle a lot because CPUs core reach the 50ºC temperature instantly when is in hard use. I maked some mods with thermal engine to try to correct bug on LCD brightness in PAC-ROM and CM12/13, incrase some performance and powersave, it's separated in three files: thermal-engine.conf (replace it on /system/etc), 100Tweaks (Replace it on /system/etc), and init.qcom.post_boot.sh (Replace it on /system/etc) these mods includes:

-> thermal-engine.conf :

* Slight LCD brightness reduce to decrase board temperature when sensor "xo_therm" reaches 55ºC, and returns when is in 48ºC;

* Battery charging current decrement start when temperature in "xo_therm" sensor reaches 43ºC and charges it in ~200mA/h when is in 50ºC, all returns to normal when temperature is in 42ºC, you can see the control working in the pictures with my "super" "ultra" usb charging monitor ^_^;

* CPU Smart Frequency Scaling by temperature (Throttling) when reaches 60ºC/55ºC (BIG/LITTLE) on full stress;

* CPU Frequency lock at 1344MHz (BIG cores) and 1113MHz (LITTLE) by temperature (Throttling) when reaches 55ºC / 53ºC respectively on full stress, this temperature is the temperature of SOC (pm8916_tz, you can see in monitoring softwares like HWMonitor) ;

* VDD Restriction to decrase temperature when temperature reaches 75ºC in pop_mem(ALL CLUSTERS WILL BE UNDERVOLTED), but, only a little performance will drop.

->100Tweaks

*msm-adreno-tz GPU Governor to best performance and power saving setting;

*default gpu power level set to 3 (220MHz) to reduce consumption when hardware isn't in use, quickly go to 550MHz when graphics load incrases;

*memory read and I/O scheduler tweaks to incrase overall speed;

*SOC Temperature control enabled;

*Fast charging tweaks;

*Little LCD Backlight decrase to reduce heating and power consumption;

->init.qcom.post_boot.sh

*Interactive governor tweaks, adding more frequency steps and incrasing load response;

*Core control applied to all clusters, making 2 of 4 core hotplug in performance cluster and 3 of 4 core hotplug in powersave cluster (With this, the cores turn up and down automatically when load incrase or decrase, but for now only working on CM12 (in anothers need some kernel modules that are not installed).

I've tested only in A6020L36, please, someone test in L40 and if possible, integrate it in PAC-ROM.

Instructions:

Replace "thermal-engine.conf" in /system/etc - Permissions: RW-R-R (I THINK THERMAL ENGINE WILL WORK FINE ON STOCK ROMs);

Put "100Tweaks" in /system/etc/init.d - Permissions: RWXR-XR-X - Remove 100CPUGPUIO if you already have (THIS WILL NOT WORK FINE ON STOCK BECAUSE STOCK HAVEN'T init.d SUPPORT!);

Replace"init.qcom.post_boot.sh" in /system/etc - Permissions: RW-R-R (MAYBE THIS WILL WORK FINE ON STOCK TOO);

If you wanna try you can add this lines in end of build.prop:

#Extra Tweaks
ro.config.hw_power_saving=true
persist.sys.use_dithering=0
ro.ril.enable.amr.wideband=1
ro.vold.umsdirtyratio=20
ro.min_pointer_dur=1
windowsmgr.max_events_per_sec=3000
ro.max.fling_velocity=14000
ro.min.fling_velocity=8000
ro.config.hw_fast_dormancy=1
persist.cust.tel.eons=1
persist.sys.purgeable_assets=1
dalvik.vm.dexopt-flags=m=v,o=y

#Qualcomm specific
debug.qc.hardware=true
com.qc.hardware=true

#Graphics
ro.config.disable.hw_accel=false
video.accelerate.hw=1
hwui.disable_vsync=true
debug.performance.tuning=1
persist.sys.use_16bpp_alpha=0
ro.product.gpu.driver=1

#Battery
persist.sys.purgeable_assets=1
ro.ril.disable.power.collapse=0
ro.ril.power_collapse=1
pm.sleep_mode=1
ro.config.hw_power_saving=1
ro.ril.sensor.sleep.control=1
wifi.supplicant_scan_interval=300000
ro.mot.eri.losalert.delay=1000
ro.ril.enable.a53=1
persist.sys.shutdown.mode=hibernate

#Network Tweaks
net.ipv4.ip_no_pmtu_disc=0
net.ipv4.route.flush=1
net.ipv4.tcp_ecn=0
net.ipv4.tcp_fack=1
net.ipv4.tcp_mem=187000 187000 187000
net.ipv4.tcp_moderate_rcvbuf=1
net.ipv4.tcp_no_metrics_save=1
net.ipv4.tcp_rfc1337=1
net.ipv4.tcp_rmem=4096 39000 187000
net.ipv4.tcp_sack=1
net.ipv4.tcp_timestamps=1
net.ipv4.tcp_window_scaling=1
net.ipv4.tcp_wmem=4096 39000 187000

#Image Quality
ro.media.dec.jpeg.memcap=16000000
ro.media.enc.hprof.vid.bps=16000000
ro.media.enc.hprof.vid.fps=60
ro.media.enc.jpeg.quality=100
ro.media.dec.aud.wma.enabled=1
ro.media.dec.vid.wmv.enabled=1
ro.media.cam.preview.fps=0
ro.media.codec_priority_for_thumb=hw

#LMK
ro.sys.fw.mOomMinFree4=146880
ro.sys.fw.mOomMinFree5=215000
ro.sys.fw.mOomMinFree6=398048

Reboot completly two times (two times) and benchmark it!! Post your results!! -> 42000 point is with PAC/CM13, these roms have newer EGL drivers for Adreno 405 and the 3D score is big, performance on games really great too!! 39000 is with CM12.

Thanks!

CHANGELOG 30/08/2016

*Improved Thermal Engine response;

*Tweaks on Quick Charge 2.0

*Frequency scaling targets for battery save

*Build.prop Tweaks for more battery save

*Zipalign apk (system and /data) on boot

CHANGELOG 25/09/2016

*Improved Thermal Engine response / Added PID Algorythm to cluster0, cluster1 and GPU;

*Added Thermal Hotplug on Thermal Engine;

*Improved VDD Restriction (undervoltage) when temperatures is high (per thermal zone temperature detection and undervolting);

*Improved Frequency scaling to throttling and with system loads;

*Improved current throttle in charging with temperature;

*Shuttdown system if some temp in CPU cores reaches 90ºC;

->Now, you can choose thermal config by you daily use - Performance / Ballanced or Powersave;

->Improved migrate rate on clusters (cluster0 or cluster1 of CPUs, preffering cluster 0 (little) to lower loads and cluster 1 (BIG) to high loads to save some power);

->Added pm8916_tz sensor pack to decrase frequency of both clusters and GPU when SOC temperature incrases.

CHANGELOG 09/10/2016

*minor changes in thermal engine and in init.qcom.post_boot.sh;

*included in zip zipalign file (put in /system/xbin - permissions: RWXR-XR-X-);

*included in zip mixer_paths_qrd_skuh file to make some changes in audio.

Remind: 100Tweaks will not work on stock roms because haven't init.d support, if you add some init.d support will work!