前言
当前手机硬件日新月异,在某种程度上手机硬件性能已经过剩,手机的性能反而在于软件上的优化。比如小米4搭载的高通801这款cpu四核2.5GHZ,性能已经不错,但是由于MIUI对cpu进行无脑的限频,均衡模式下,关闭两个核心,其他两个核心频率限制在1036MHz,1036MHz!这样无异于杀鸡用牛刀,而且用的是刀柄,连鸡都搞不定。估计把性能压得如此底,厂商也有自己的考虑吧。
正题
下面介绍要修改的cpu配置文件的含义
主要文件有
1、thermal-engine-8974.conf(system/etc目录下 )
2、changepowermode.sh(system/bin目录下)
####1、thermal-engine-8974.conf
用于设定cpu在指定条件下触发的动作的算法
其中各个属性含义:
sampling:取样时间
[CPU_MONITOR]:算法实例标签
algo_type:算法类型,共有4种: monitor, pid, ss, virtual
sensor:传感器
thresholds: 觉阈值(触发条件)
thresholds_clr:清除觉阈值(取消触发的动作的条件)
actions:动作
action_info:动作值
###changepowermode.sh
顾名思义,这个文件就是MIUI切换均衡模式和性能模式的命令文件。
target=`getprop ro.product.model`
powermode=`getprop persist.sys.aries.power_profile`
dev_governor=`ls /sys/class/devfreq/qcom,cpubw*/governor`
case "$target" in
"MI 3W" | "MI 3C")
case "$powermode" in
"high")
echo 2265600 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 2265600 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo 2265600 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
echo 2265600 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
echo 60 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
echo 1190400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
echo 70 > /sys/devices/system/cpu/cpufreq/interactive/target_loads
echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
echo 20 > /sys/module/cpu_boost/parameters/boost_ms
echo 1728000 > /sys/module/cpu_boost/parameters/sync_threshold
echo 1497600 > /sys/module/cpu_boost/parameters/input_boost_freq
echo 40 > /sys/module/cpu_boost/parameters/input_boost_ms
echo 255 > /sys/cl