CoCore-Z Kernel for Power Users
POST#1 Introduction & Installation & Credits & Source & Mirror Downloads
POST#2 Notes
POST#3 HOW-TO
POST#4 Change-log
Click to expand...
Click to collapse
I'M IN NO WAY RESPONSIBLE OF ANY DAMAGE CAUSED BY USING THIS CUSTOM KERNEL.
Click to expand...
Click to collapse
Devices: Sony Xperia Z1 C6902/L39h/C6903/C6906
ROM: Stock KitKat 4.4.4 14.4.A.0.108 +
Bootloader: *Unlocked*
Click to expand...
Click to collapse
Features:
Based on Sony 14.4.A.0.133 Opensource
Linaro GCC Toolchain 4.9.3
Sony RIC security module disabled
TWRP Recovery 2.8
Philz Recovery 6
Flash-Friendly-Filesystem (F2FS)
Optimized memutils from MOTO-G
Taiko sound control
UHQA(Ultra High Quality Audio) mode
Louder speaker
Color control (thanks Doomlord)
Vibrator intensity control (thanks Kali-)
Vibrator enable control
Thermel temperturing control
Charger current control
Real EOC (End-of-Charging) LED notification
PowerOn key emulator
Auto readahead according to disk-size
2-ways recording support
Sweep2wake wake-up gesture
Fast random (frandom) module
Some kernel patches from Con Kolivas
Kernel scheduler moire avoided
Unaligned memory access for decompressor
Optimized AES and SHA1 routines
zRAM supported
init.d scripts supported
More IO schedulers
More CPU governors
More and Lower CPU frequencies
CPU VDD control
Android logger disabled by default
For more details please check github source below.
Click to expand...
Click to collapse
Installation:
fastboot:
1. Extract boot.img file from zip package into somewhere
2. Use commands below to flash kernel and reboot
Code:
fastboot flash boot boot.img
fastboot reboot
recovery:
1. You need to have a kernel with custom recovery or installed dual recovery mods.
2. Go recovery and flash the zip in download selection.
dd: (*Not recommended*)
1. Put boot.img somewhere you like
2. Open terminal, `cd` to the folder which has kernel, use the command:
Code:
busybox dd if=boot.img of=/dev/block/platform/msm_sdcc.1/by-name/boot
Click to expand...
Click to collapse
[Download]
[Mirror Download]
Click to expand...
Click to collapse
Credits:
[MENTION]zwliew[/MENTION]
[MENTION]doomlord[/MENTION]
[MENTION]faux123[/MENTION]
[MENTION]fransicofranco[/MENTION]
Sony for opening kernel source
And many developers for their awesome patches
Click to expand...
Click to collapse
Source code: github
Click to expand...
Click to collapse
XDA:DevDB Information
CoCore-Z, Kernel for the Sony Xperia Z1
Contributors
cocafe, cocafe
Source Code: http://github.com/cocafe/c6902_kernel_CoCore-Z
Kernel Special Features:
Version Information
Status: Stable
Current Stable Version: r25
Stable Release Date: 2015-02-25
Created 2014-10-01
Last Updated 2015-02-25
Notes
If the kernel crashed (freezed and rebooted), please fetch last_kmsg file after the crash reboot and post in the thread.
Code:
su -c cat /proc/last_kmsg > /sdcard/last_kmsg
Click to expand...
Click to collapse
Why no overclocking?
1. Overclocking makes phone overheated and SoC will be cooled (use lower frequency) down forcely or it will reboot.
2. We have a fast SoC, it can run most of apps/games smoothly. Like GPU OC, it improves several fps only.
3. So what i need is stable and user experience, instead of improving boring benchmark results.
Click to expand...
Click to collapse
If you flashed other custom kernels before, make sure that wifi modules in /system/lib/modules/pronto
and wifi firmware in /system/etc/firmware/wlan/prima are stock. Or WLAN can not be enabled properly.
Click to expand...
Click to collapse
..
HOW-TO
It's a good idea to use some apps like script manager to put a widget in launcher to execute commands.
Recovery:
When kernel logo displays, PRESS:
- Vol.UP : Philz Recovery
- Vol.DN : TWRP Recovery
Click to expand...
Click to collapse
Click to expand...
Click to collapse
logger/logcat: If you wanna use logcat, just create a empty file named logger (permission 0777) in /data.
If this file exists, kernel will load logger module during boot.
Click to expand...
Click to collapse
CPU Governors: pegasusq interactive conservative userspace powersave ondemand(default) performance
Click to expand...
Click to collapse
IO schedulers: noop deadline row(default, recommended) cfq bfq fiops sio sioplus zen vr
Click to expand...
Click to collapse
Touch booster:
Our touch booster is implemented in Android level not kernel.
It will lock CPU frequency at 1190MHz and wake up 2 cores when touching.
Disabling it can save battery.
Code:
Edit /system/build.prop and change:
sys.somc.touch_perf_kick=[B]0[/B]
Click to expand...
Click to collapse
Thermal:
On stock kitkat, thermal is using system thermal solution not kernel.
But we can disable it in kernel level, namely, disabling temperature reporting.
Disabling temperature reporting can cause overheated protection (reboot) when SoC is too hot.
Code:
echo 0 > /sys/module/msm8974_tsens/parameters/temp_enable
Click to expand...
Click to collapse
Color control:
Code:
echo R G B > /sys/devices/platform/kcal_ctrl.0/kcal
echo 1 > /sys/devices/platform/kcal_ctrl.0/kcal_ctrl
Or
Code:
echo R G B > /sys/kernel/kcal_color/rgb
echo update > /sys/kernel/kcal_color/rgb
Or
Use compatible kernel app to control the color, or use the system white balance app.
Click to expand...
Click to collapse
POnKey emulator:
Code:
#Using this emulator can simulate power key
#For screen off
echo 10 > /sys/kernel/ponkey/ponkey_emu
#For power menu
echo 600 > /sys/kernel/ponkey/ponkey_emu
Click to expand...
Click to collapse
Taiko sound control:
Headset analog gain:
Code:
#Enable/Disable:
echo on/off > /sys/kernel/wcd9320/hplana_gain
echo on/off > /sys/kernel/wcd9320/hprana_gain
#Gain: Max=0 Default=5 (Lower is louder)
echo 5 > /sys/kernel/wcd9320/hplana_gain
echo 5 > /sys/kernel/wcd9320/hprana_gain
Headset digital gain:
Code:
#Enable/Disable
echo on/off > /sys/kernel/wcd9320/hpldig_gain
echo on/off > /sys/kernel/wcd9320/hprdig_gain
#Gain: Default=0 , Don't set this value too high, 24 is the maximum recommended
echo 16 > /sys/kernel/wcd9320/hpldig_gain
echo 16 > /sys/kernel/wcd9320/hprdig_gain
Speaker on/off:
Code:
#You can turn off speaker only instead of muting all sound in system.
echo off > /sys/kernel/wcd9320/spkdrv
Speaker digital gain:
Code:
#Enable/Disable
echo on/off > /sys/kernel/wcd9320/spkdig_gain
#Do not set this value too high, in order to protect the speaker,
#enabled booster by default
echo 3 > /sys/kernel/wcd9320/spkdig_gain
Headphone UHQA(Ultra High Quality Audio) mode:
UHQA mode allows to have high performance audio, and it's enabled by default.
Have better turn off/on music to switch the amplifier for HPH path.
Code:
#Enable/Disable
echo on/off > /sys/kernel/wcd9320/hph_uhqa
Click to expand...
Click to collapse
Sweep2wake:
This feature allows you to wake up device by sweeping the screen.
But remember, it will keep your device waking, namely, no deep sleep.
Enable/Disable:
Code:
echo on > /sys/kernel/clearpad/sweep2wake
echo off > /sys/kernel/clearpad/sweep2wake
Change wake-up threshold:
Code:
echo threshold_x=??? > /sys/kernel/clearpad/sweep2wake
echo threshold_y=??? > /sys/kernel/clearpad/sweep2wake
S2W LED: (To notice you that S2W is on)
Code:
echo led=0 > /sys/kernel/clearpad/sweep2wake
echo led=1 > /sys/kernel/clearpad/sweep2wake
echo rgb=??? ??? ??? > /sys/kernel/clearpad/sweep2wake
Click to expand...
Click to collapse
Real End-of-Charge notification:
When system UI shows you 100% charged, it might have not been fully charged.
When real EOC reached, charging is actually finished. So let it notice us.
Enable/Disable:
Code:
echo on > /sys/kernel/qpnp-charger/eoc_led
echo off > /sys/kernel/qpnp-charger/eoc_led
Change the color:
Code:
echo led=??? ??? ??? > /sys/kernel/qpnp-charger/eoc_led
Check EOC status (if the LED is changed by other stuffs)
Code:
cat /sys/kernel/qpnp-charger/eoc_led
Click to expand...
Click to collapse
LED Torch:
We can enable and change the torch brightness via sysfs.
Enable/Disable
Code:
echo 2 > /sys/class/misc/pm8941-flash/device/mode
echo 0 > /sys/class/misc/pm8941-flash/device/mode
Change the brightness: (bigger value is brighter)
Code:
echo ?? > /sys/class/misc/pm8941-flash/device/current1
echo ?? > /sys/class/misc/pm8941-flash/device/current2
Click to expand...
Click to collapse
Screen brightness:
We can change the max current of panel to make it night mode or boost the brightness.
Code:
#night mode
echo 1 > /sys/class/leds/wled:backlight/max_current
#boost max brightness
echo 25 > /sys/class/leds/wled:backlight/max_current
Click to expand...
Click to collapse
zRAM:
Using zRAM can compress RAM.
For instance, we compress 600MB RAM here:
Code:
echo $((400 * 1024 * 1024)) > /sys/block/zram0/disksize
mkswap /dev/block/zram0
swapon /dev/block/zram0
Click to expand...
Click to collapse
Vibrator:
Adjust vibrator intensity: ( 0 ~ 31 )
Code:
echo number > /sys/kernel/qpnp-vibrator/vtg_level
Enable/Disable vibrator: ( 0 / 1 )
Code:
echo 0/1 > /sys/kernel/qpnp-vibrator/enable
Click to expand...
Click to collapse
F2FS:
Now userdata partition (/data) supports mounting by F2FS.
F2FS is designed and optimized for nand flash, normally, it is faster than EXT4 filesystem.
A backup in Recovery is recommended!!
Make sure that your SD card has enough space!!
Click to expand...
Click to collapse
Recommended for experienced users, be careful, don't type a wrong partition number.
Click to expand...
Click to collapse
HOW-TO: Make a full backup
Click to expand...
Click to collapse
1. Reboot to recovery, mount external sdcard in mount option. In ADB console:
Code:
[B]
#Mount external sdcard in mount options first
#TWRP external sdcard: /external_sd
#Philz externl sdcard: /storage/sdcard1 [/B]
cd /data
tar -cvf /THE_EXTERNAL_SDCARD_MOUNT_POINT/data-backup.tar *
Be aware that internal storage is in /data, and a TWRP backup of data partition do not include internal storage (/data/media)
Click to expand...
Click to collapse
!!!!Important!!!! Some busybox tar command cannot extract the tarball which is over 2GB.
At least the one in TWRP can not, and I have not replaced it. Recommended covert filesystems in Philz recovery,
Or use the busybox you installed in /system/xbin
Click to expand...
Click to collapse
Anyway, do on your own risk.
Click to expand...
Click to collapse
HOW-TO: EXT4 to F2FS
Click to expand...
Click to collapse
1. Reboot to recovery (I use Philz here), connect to PC, use ADB commands:
2. Mount EXTERNAL SD in mount options, Backup the data partition as a tarball
Code:
cd /data
tar -cvf /storage/sdcard1/data.tar *
3. Now umount /data, we gonna format it (umount all mount points of /dev/block/platform/msm_sdcc.1/by-name/userdata)
Code:
umount /data /sdcard
4. Format the data partition
Code:
cd /dev/block/platform/msm_sdcc.1/by-name
mkfs.f2fs -l userdata userdata
5. Now restore the data tarball
Code:
mount -t f2fs -o rw /dev/block/platform/msm_sdcc.1/by-name/userdata /data
cd /data
tar -xvf /storage/sdcard1/data.tar
umount /data
6. Then reboot system
HOW-TO: F2FS to EXT4
Click to expand...
Click to collapse
1. Reboot to recovery, connect to PC, use ADB commands:
2. Backup the data partition as a tarball
Code:
#[B]Philz recovery cannot mount f2fs automatically, we need to mount it manually[/B]
[B]mount -t f2fs -o rw /dev/block/platform/msm_sdcc.1/by-name/userdata /data[/B]
cd /data
tar -cvf /storage/sdcard1/data.tar *
3. Now umount /data, we gonna format it (umount all mount points of /dev/block/platform/msm_sdcc.1/by-name/userdata)
Code:
umount /data /sdcard
4. Format the userdata partition
Code:
mke2fs -T ext4 -L userdata /dev/block/platform/msm_sdcc.1/by-name/userdata
5. Mount the userdata partition, and restore the data tarball
Code:
mount -t ext4 -o rw /dev/block/platform/msm_sdcc.1/by-name/userdata /data
cd /data
tar -xvf /storage/sdcard1/data.tar
umount /data
6. Reboot system
When kernel logo displays, press camera-shot key to check filesystem manually.
Click to expand...
Click to collapse
Click to expand...
Click to collapse
CPU VDD Control
Click to expand...
Click to collapse
In /sys/kernel/krait_vdd, you can adjust krait voltage table by commands:
Code:
echo +5mV > /sys/kernel/krait_vdd/krait_uV
Code:
echo -5mV > /sys/kernel/krait_vdd/krait_uV
Code:
echo +10mV > /sys/kernel/krait_vdd/krait_uV
Code:
echo -10mV > /sys/kernel/krait_vdd/krait_uV
* The number needs to be multiplier of 5.
* Lower or higher voltage might cause unstable.
* Do it on your own risk.
Click to expand...
Click to collapse
Change-log
For more, please check github commits history.
2015-02-25 - r25
- Adjusted ondemand governor to fix heating issue
- Built with Linaro 2015.01 toolchain
Click to expand...
Click to collapse
2015-02-14 - r24
- Added, optimized CPU governors
- Allowed to set all CPU governors during start-up
- Added CPU VDD control
- Under clocked 192MHz
- Adjusted CPU frequency table
Click to expand...
Click to collapse
2015-01-13 - r20
- F2FS
- Add Philz recovery
- BFQ v7r7
- Reduced Krait CPU retention voltage
- Optimzed Low memory allocator
Click to expand...
Click to collapse
2014-11-02 - r16
- Applied upstream patches for wcd9320
- Taiko control r02
- Disabled low power mode for headphone path
- Enabled UHQA mode for headphone
- Some fixes about writeback
- Disabled 268MHz (as it can make audio choppy), undervolted 300MHz 25mV
- Updated BFQ io scheduler
- And some other patches about network and memory management
Click to expand...
Click to collapse
2014-10-08 - r14
- Removed memutils
- Fixed Android logger
- Added more cpufreq steps
Click to expand...
Click to collapse
2014-10-01 - r12
Initial release
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Reserved
I just say Wow..
Any plans for CM support?
What does the power button emulation do? And does threshold adjust the length of sweep?
Awesome work, man, good to see new development for the Z1!
Awesome. So much detail put into this. Good work!
abbychauhan said:
I just say Wow..
Any plans for CM support?
Click to expand...
Click to collapse
Maybe in the future, currently, i am using stock rom.
AnrgKrshn said:
What does the power button emulation do? And does threshold adjust the length of sweep?
Awesome work, man, good to see new development for the Z1!
Click to expand...
Click to collapse
Emulator allows you to turn off screen and get power menu by tapping the script widget on the launcher.
As we know, the power key is the most busiest hardware key of our device. I wanna save its life.
Yep, threshold adjust the range of waking up.
LeParkour012 said:
Awesome. So much detail put into this. Good work!
Click to expand...
Click to collapse
Thanks.
@cocafe thanks for your work
Possibility to add gamma control or contrast control on you kernel?
Is Fauxclock compatible with this kernel? Or something else? Terminal/init is unconfortable when I wanna change some settings.
cocafe said:
For more, please check github commits history.
Click to expand...
Click to collapse
Is this kernel performance or battery tuned?
How can I set sound control setting on boot? init.d can't.
RyTekk said:
Is Fauxclock compatible with this kernel? Or something else? Terminal/init is unconfortable when I wanna change some settings.
Click to expand...
Click to collapse
Dunno, never used such stuff, i liking writing shell scripts and putting them in launcher.
Destroyedbeauty said:
Is this kernel performance or battery tuned?
Click to expand...
Click to collapse
In fact, i have restarted the kernel. Several months ago i added some battery saving mods, like 268Mhz and UV...
But removed now, will test and add later.
RyTekk said:
How can I set sound control setting on boot? init.d can't.
Click to expand...
Click to collapse
Init.d is supported. Check /system/etc/init.d (this folder exists?) and scripts permissions
cocafe said:
Dunno, never used such stuff, i liking writing shell scripts and putting them in launcher.
Init.d is supported. Check /system/etc/init.d (this folder exists?) and scripts permissions
Click to expand...
Click to collapse
init.d is supported, yes, but I wrote an init.d scripts and set 755 perm but it can't set. Am I wrong?
#!/system/bin/sh
#Headset analog gain:
#Enable/Disable:
echo on > /sys/kernel/wcd9320/hplanagain
echo on > /sys/kernel/wcd9320/hpranagain
#Gain: Max=5 Default=0
echo 5 > /sys/kernel/wcd9320/hplanagain
echo 5 > /sys/kernel/wcd9320/hpranagain
#Headset digital gain:
#Enable/Disable
echo on > /sys/kernel/wcd9320/hpldiggain
echo on > /sys/kernel/wcd9320/hprdiggain
#Gain: Default=0 , Don't set this value too high, 24 is the maximum recommended
echo 8 > /sys/kernel/wcd9320/hpldiggain
echo 8 > /sys/kernel/wcd9320/hprdiggain
#Speaker on/off:
#You can turn off speaker only instead of muting all sound in system.
#echo off > /sys/kernel/wcd9320/spkdrv
#Speaker digital gain:
#Enable/Disable
echo on > /sys/kernel/wcd9320/spkdiggain
#Do not set this value too high, in order to protect the speaker,
#enabled booster by default
echo 2 > /sys/kernel/wcd9320/spkdiggain
Click to expand...
Click to collapse
RyTekk said:
init.d is supported, yes, but I wrote an init.d scripts and set 755 perm but it can't set. Am I wrong?
[QUOTE#!/system/bin/sh
#Headset analog gain:
#Enable/Disable:
echo on > /sys/kernel/wcd9320/hplanagain
echo on > /sys/kernel/wcd9320/hpranagain
#Gain: Max=5 Default=0
echo 5 > /sys/kernel/wcd9320/hplanagain
echo 5 > /sys/kernel/wcd9320/hpranagain
#Headset digital gain:
#Enable/Disable
echo on > /sys/kernel/wcd9320/hpldiggain
echo on > /sys/kernel/wcd9320/hprdiggain
#Gain: Default=0 , Don't set this value too high, 24 is the maximum recommended
echo 8 > /sys/kernel/wcd9320/hpldiggain
echo 8 > /sys/kernel/wcd9320/hprdiggain
#Speaker on/off:
#You can turn off speaker only instead of muting all sound in system.
#echo off > /sys/kernel/wcd9320/spkdrv
#Speaker digital gain:
#Enable/Disable
echo on > /sys/kernel/wcd9320/spkdiggain
#Do not set this value too high, in order to protect the speaker,
#enabled booster by default
echo 2 > /sys/kernel/wcd9320/spkdiggain
]
Click to expand...
Click to collapse
[/QUOTE]
You should execute the script in terminal to debug...
su
cd /etc/init.d
sh YOUR_SCRIPT
See what will terminal say
cocafe said:
You should execute the script in terminal to debug...
su
cd /etc/init.d
sh YOUR_SCRIPT
See what will terminal say
Click to expand...
Click to collapse
RyTekk said:
Click to expand...
Click to collapse
I can not check your pic clearly.
And excuse me, my Z1 is not available now... (i am unable to use it until several days later)
cocafe said:
I can not check your pic clearly.
And excuse me, my Z1 is not available now... (i am unable to use it until several days later)
Click to expand...
Click to collapse
Sr, I have reuploaded the full-size photo that you can check clearly.
Sorry, but where is the download link
Related
Hi guys,
UPDATE: Over time, I've modified some of these values in my SpeedMod kernel. The values here may not be the best ones.
NOTE: These tweaks are now included in kernels based on sztupy's Universal Lagfix, for example:
http://forum.xda-developers.com/showthread.php?t=822756
But they must be manually activated from the recovery menu.
I've been using Linux kernel tweaks in a startup script to make the phone smoother.
With these tweaks, the phone is quite smooth and fast even without using the filesystem lagfixes.
These settings are only useful for you if you know how to create and modify a startup script. I use the old playlogos hack myself, but I'm sure there are many new ways to do it now.
Code:
# Tweak cfq io scheduler
for i in $(ls -1 /sys/block/stl*) $(ls -1 /sys/block/mmc*) $(ls -1 /sys/block/bml*) $(ls -1 /sys/block/tfsr*)
do echo "0" > $i/queue/rotational
echo "1" > $i/queue/iosched/low_latency
echo "1" > $i/queue/iosched/back_seek_penalty
echo "1000000000" > $i/queue/iosched/back_seek_max
echo "3" > $i/queue/iosched/slice_idle
done
# Remount all partitions with noatime
for k in $(busybox mount | grep relatime | cut -d " " -f3)
do
sync
busybox mount -o remount,noatime $k
done
# Tweak kernel VM management
echo "0" > /proc/sys/vm/swappiness
#echo "10" > /proc/sys/vm/dirty_ratio
#echo "4096" > /proc/sys/vm/min_free_kbytes
# Tweak kernel scheduler, less aggressive settings
echo "18000000" > /proc/sys/kernel/sched_latency_ns
echo "3000000" > /proc/sys/kernel/sched_wakeup_granularity_ns
echo "1500000" > /proc/sys/kernel/sched_min_granularity_ns
# Misc tweaks for battery life
echo "2000" > /proc/sys/vm/dirty_writeback_centisecs
echo "1000" > /proc/sys/vm/dirty_expire_centisecs
EDIT: Explanations:
# Remount all partitions with noatime
atime is a setting where the filesystem updates the access time of a file. This creates a write-after-every-read which slows things down. By default all partitions are mounted with relatime, which is an optimized version of atime. noatime is the fastest, and afaik we don't need atime.
# Tweak cfq io scheduler
Tweaked settings of the disk io scheduler more for flash memory. Defaults are optimized for spinning harddisks. Lowered the idle wait, re-enable the low latency mode of cfq, removed the penalty for back-seeks and explicitly tell the kernel the storage is not a spinning disk.
# Tweak kernel VM management
Set tendency of kernel to swap to minimum, since we don't use swap anyway.
Lower the amount of unwritten write cache to reduce lags when a huge write is required.
Increase tendency of kernel to keep block-cache to help with slower RFS filesystem.
Increase minimum free memory, in theory this should make the kernel less likely to suddenly run out of memory.
# Tweak kernel scheduler
Make the task scheduler more 'fair' when multiple tasks are running. This has a huge effect on UI and App responsiveness. These values (less aggressive settings) are 20% of the Linux defaults, and about half of the Android defaults.
# Miscellaneous tweaks
Increase the write flush timeouts to save some battery life.
___________________________________
EDIT: How to create/use a startup script:
You need root and busybox for this.
This procedure is adapted from the old OCLF which used this method to create a startup script in /system/userinit.sh
Check if the file /system/userinit.sh exists. If it does, u should just edit that file as the startup script and DO NOT do the procedure below.
Here's how to do it manually. Do this only if some other lagfix/patch has not already done the playlogos hack, otherwise u might overwrite the other script!
Create the startup script on your PC. Use adb to push it to /sdcard/userinit.sh
adb push userinit.sh /sdcard/userinit.sh
On your PC, create a file called playlogos1 with this content:
#!/system/bin/sh
sh /data/userinit.sh
playlogosnow
Use adb to push the playlogos1 file to /sdcard/playlogos1
adb push playlogos1 /sdcard/playlogos1
Now use adb shell, su and do this:
busybox mount -o remount,rw /system;
busybox cp /sdcard/userinit.sh /data/userinit.sh;
busybox mv /system/bin/playlogos1 /system/bin/playlogosnow;
busybox cp /sdcard/playlogos1 /system/bin/playlogos1;
chmod 755 /system/bin/playlogos1;
chmod 755 /data/userinit.sh;
The startup script will be /data/userinit.sh
The reason I put the startup script in /data is so that if you mess up the startup script and get stuck during boot, you can do a "clear data" from recovery, and the startup script will be erased.
Could you explain what this actually does for the non linux savvy, also maybe you could make a script/app for this so everyone else can try it ?
hardcore said:
Hi guys,
I've been using Linux kernel tweaks in a startup script to make the phone smoother.
With these tweaks, the phone is quite smooth and fast even without using the filesystem lagfixes.
These settings are only useful for you if you know how to create and modify a startup script. I use the old playlogos hack myself, but I'm sure there are many new ways to do it now.
Code:
# Remount all partitions with noatime
for k in $(mount | cut -d " " -f3)
do
sync
mount -o remount,noatime $k
done
# Tweak cfq io scheduler
for i in $(ls -1 /sys/block/stl*) $(ls -1 /sys/block/mmc*) $(ls -1 /sys/block/bml*) $(ls -1 /sys/block/tfsr*)
do echo "0" > $i/queue/rotational
echo "1" > $i/queue/iosched/low_latency
echo "1" > $i/queue/iosched/back_seek_penalty
echo "1000000000" > $i/queue/iosched/back_seek_max
echo "3" > $i/queue/iosched/slice_idle
done
# Tweak kernel VM management
echo "0" > /proc/sys/vm/swappiness
echo "10" > /proc/sys/vm/dirty_ratio
echo "1000" > /proc/sys/vm/vfs_cache_pressure
echo "4096" > /proc/sys/vm/min_free_kbytes
# Tweak kernel scheduler
echo "2000000" > /proc/sys/kernel/sched_latency_ns
echo "500000" > /proc/sys/kernel/sched_wakeup_granularity_ns
echo "400000" > /proc/sys/kernel/sched_min_granularity_ns
# Miscellaneous tweaks
setprop dalvik.vm.startheapsize 8m
setprop wifi.supplicant_scan_interval 90
setprop windowsmgr.max_events_per_sec 68
Click to expand...
Click to collapse
VERY interesting
EarlZ said:
you could make a script/app for this so everyone else can try it ?
Click to expand...
Click to collapse
+1, pretty plz, also, is this compatible with voodoo?
INeedYourHelp said:
+1, pretty plz, also, is this compatible with voodoo?
Click to expand...
Click to collapse
Should be compatible, although u need to know how to add it into voodoo's startup script.
Hello
Values description for each one and why is welcome
supercurio said:
Hello
Values description for each one and why is welcome
Click to expand...
Click to collapse
Hey supercurio! Great job on Voodoo, I am particularly keen on the Sharpness, Video and future Sound fixes. I think its very cool that you found out how to modify the sharpness (S-AMOLED's PenTile matrix software algorithms?).
Edited the starting post with explanations. Most of them should be documented somewhere in the Linux sources / documents.
I've been using them for a while, tweaking values here n there. I think I've finally reached a stage where I'm confident enough to recommend them to others to try. There could be more optimum values with further testing, but these work well for me with Froyo.
hardcore said:
Hey supercurio! Great job on Voodoo, I am particularly keen on the Sharpness, Video and future Sound fixes. I think its very cool that you found out how to modify the sharpness (S-AMOLED's PenTile matrix software algorithms?).
Edited the starting post with explanations. Most of them should be documented somewhere in the Linux sources / documents.
I've been using them for a while, tweaking values here n there. I think I've finally reached a stage where I'm confident enough to recommend them to others to try. There could be more optimum values with further testing, but these work good for me so far with Froyo.
Click to expand...
Click to collapse
Yeah thank you so much for taking the time and sharing, i'll integrate them after a bit of testing
About the sharpness filter yes this is the main difference between S-AMOLED and AMOLED panel wise.
It's a hardware sharpness filter which is here to fight the fuzziness introduced by the pentile pattern but.. they overdid it a bit.
The "perfect" values are of course closer than the one with the same radius that the one of the blur introduced itself with the pixel pattern.
I feel it can maybe be improved a hair
I'll soon publish a version that allow write to the mDNIe register so you'll be able to play *live* with it too
Nice, could these be modified post-startup? like I go adb and copy paste some of them for testing?
I've tested setprop windowsmgr.max_events_per_sec 68, no difference. Set it to
setprop windowsmgr.max_events_per_sec 10 and still, no difference.
xan said:
Nice, could these be modified post-startup? like I go adb and copy paste some of them for testing?
I've tested setprop windowsmgr.max_events_per_sec 68, no difference. Set it to
setprop windowsmgr.max_events_per_sec 10 and still, no difference.
Click to expand...
Click to collapse
hey xan, you made me remember to add run-parts support.
i'll do that and you'll be able to set it without special hack very soon with voodoo
xan said:
Nice, could these be modified post-startup? like I go adb and copy paste some of them for testing?
I've tested setprop windowsmgr.max_events_per_sec 68, no difference. Set it to
setprop windowsmgr.max_events_per_sec 10 and still, no difference.
Click to expand...
Click to collapse
I don't think the setprop values can be modified post-startup. You can check if the value was modified by doing a getprop. (The default value for that prop is 55.)
The rest of them can be modified post-startup though.
Excuse my noobiness on Android, I would like an explanation on this command:
hardcore said:
# Tweak kernel VM management
echo "0" > /proc/sys/vm/swappiness
Click to expand...
Click to collapse
On my GNU/Linux system I've set vm.swappiness to 10, because I've got plenty MiB of RAM and I don't want my system to swap a lot. Is this swappiness the same as Linux? Because that would mean having the system to use more RAM, and since we don't have much of that available by default, I'm just surprised you didn't set a higher value. (I'm not saying you don't know what you're doing, I just want to learn how it works!)
By the way, this script is going to be a must-have, I think you've put an excellent effort on i9000 Android development! Thanks for sharing!
xan said:
Nice, could these be modified post-startup? like I go adb and copy paste some of them for testing?
I've tested setprop windowsmgr.max_events_per_sec 68, no difference. Set it to
setprop windowsmgr.max_events_per_sec 10 and still, no difference.
Click to expand...
Click to collapse
The aosp windowmanager (android framework) ignores values <35. (Samsung could have changed something here, but that is very unlikely).
That value does not affect the framerate, but how many touch events are reported to the apps; this saves some cpu if the user keeps touching the screen.
Fr4gg0r said:
The aosp windowmanager (android framework) ignores values <35. (Samsung could have changed something here, but that is very unlikely).
That value does not effect the framerate, but how many touch events are reported to the apps; this saves some cpu if the user keeps touching the screen.
Click to expand...
Click to collapse
Yes, i tried on Eclair to set it to 56fps (real fps is 55.5555555555555) but touch scrolling were not smoother.
I hope it can be improved in some way!
Fr4gg0r said:
The aosp windowmanager (android framework) ignores values <35. (Samsung could have changed something here, but that is very unlikely).
That value does not affect the framerate, but how many touch events are reported to the apps; this saves some cpu if the user keeps touching the screen.
Click to expand...
Click to collapse
Thanks for the info. Looks like default settings are best unless we can actually change the refresh rate.
supercurio said:
Yeah thank you so much for taking the time and sharing, i'll integrate them after a bit of testing
Click to expand...
Click to collapse
We are eagerly waiting for it =) I don't know when you manage to sleep since you have so many things to do in voodoo =)
hardcore said:
Hi guys,
I've been using Linux kernel tweaks in a startup script to make the phone smoother.
With these tweaks, the phone is quite smooth and fast even without using the filesystem lagfixes.
These settings are only useful for you if you know how to create and modify a startup script. I use the old playlogos hack myself, but I'm sure there are many new ways to do it now.
Code:
# Remount all partitions with noatime
for k in $(mount | cut -d " " -f3)
do
sync
mount -o remount,noatime $k
done
# Tweak cfq io scheduler
for i in $(ls -1 /sys/block/stl*) $(ls -1 /sys/block/mmc*) $(ls -1 /sys/block/bml*) $(ls -1 /sys/block/tfsr*)
do echo "0" > $i/queue/rotational
echo "1" > $i/queue/iosched/low_latency
echo "1" > $i/queue/iosched/back_seek_penalty
echo "1000000000" > $i/queue/iosched/back_seek_max
echo "3" > $i/queue/iosched/slice_idle
done
# Tweak kernel VM management
echo "0" > /proc/sys/vm/swappiness
echo "10" > /proc/sys/vm/dirty_ratio
echo "1000" > /proc/sys/vm/vfs_cache_pressure
echo "4096" > /proc/sys/vm/min_free_kbytes
# Tweak kernel scheduler
echo "2000000" > /proc/sys/kernel/sched_latency_ns
echo "500000" > /proc/sys/kernel/sched_wakeup_granularity_ns
echo "400000" > /proc/sys/kernel/sched_min_granularity_ns
# Miscellaneous tweaks
setprop dalvik.vm.startheapsize 8m
setprop wifi.supplicant_scan_interval 90
EDIT: Explanations:
# Remount all partitions with noatime
atime is a setting where the filesystem updates the access time of a file. This creates a write-after-every-read which slows things down. By default all partitions are mounted with relatime, which is an optimized version of atime. noatime is the fastest, and afaik we don't need atime.
# Tweak cfq io scheduler
Tweaked settings of the disk io scheduler more for flash memory. Defaults are optimized for spinning harddisks. Lowered the idle wait, re-enable the low latency mode of cfq, removed the penalty for back-seeks and explicitly tell the kernel the storage is not a spinning disk.
# Tweak kernel VM management
Set tendency of kernel to swap to minimum, since we don't use swap anyway.
Lower the amount of unwritten write cache to reduce lags when a huge write is required.
Increase tendency of kernel to keep block-cache to help with slower RFS filesystem.
Increase minimum free memory, in theory this should make the kernel less likely to suddenly run out of memory.
# Tweak kernel scheduler
Make the task scheduler more 'fair' when multiple tasks are running. This has a huge effect on UI and App responsiveness. These values are 10% of the Linux defaults, and about half of the Android defaults.
# Miscellaneous tweaks
Manually set the starting dalvik heap size.
Increase wifi scanning gap to reduce battery usage.
Click to expand...
Click to collapse
I'm interested in doing this but I'm not sure where should I put the file. I checked playlogos1 from /system/bin but it's a binary file.. Tried to find playlogos hack on the forum but can't really find anything...
i have a jpm with voodoo, and i have copy this code into /voodoo/scripts/init.sh
just simplely add to the end of it, of course, before the last line.
the system reboot is ok, but i havent see the effects yet.
btw, "ls -1 /sys/block/mmc*" in adb give us:
Code:
ls -1 /sys/block/mmc*
-1: No such file or directory
/sys/block/mmcblk0
/sys/block/mmcblk1
so, "-1" key is useless
[kab] said:
btw, "ls -1 /sys/block/mmc*" in adb give us:
Code:
ls -1 /sys/block/mmc*
-1: No such file or directory
/sys/block/mmcblk0
/sys/block/mmcblk1
so, "-1" key is useless
Click to expand...
Click to collapse
it should be -l, not one
I've adapted the original performance tweaks by 'hardcore' @ XDA for my overclocked/undervolted Galaxy Tab. The tweaked values are pretty much the same as the ones recommended by the original poster, but my simple init.d/ script allows me to log default system values when pushing new values, which is useful for debugging. The script also contains comments to describe the role of each setting. Note that if you don't have init.d/ support in your kernel / initramfs, you can still run the script manually at each system start (use an app like GScript).
Code:
#!/system/bin/sh
#
# Original tweaks by 'hardcore' @ XDA
# http://forum.xda-developers.com/showthread.php?t=813309
# This is a startup script designed for /system/etc/init.d/.
# Note that "run-parts" support (for init.d/ scripts) is normally provided by custom a initramfs,
# which should bundle busybox in /sbin/. The /sbin/run-parts.sh script should take care of
# running init scripts (by calling /sbin/runparts), and it should subsequently trigger
# the device startup (using "setprop filesystem.ready 1", or similar).
# Note that the recovery mode typically doesn't run /system/etc/init.d/ startup scripts.
# Ensure /sbin/busybox takes precedence.
# Normally this is redundant, because the /init.rc startup script already sets the correct path.
export PATH=/sbin:$PATH
# Logging of old/new sysfs values, useful for double-checking.
logFile=/data/local/tmp/S_perf_tweaks.log
if [ -f $logFile ]
then
rm $logFile
fi
touch $logFile
# This function logs the old value and writes the new value.
echo_()
{
echo '' >> $logFile
echo -n "${2}${3} (${1}): " >> $logFile
#head -1 ${2}${3} >> $logFile
#read $firstLine < ${2}${3}
#echo -n $firstLine >> $logFile
contents=`echo -n $(cat ${2}${3})`
echo -n $contents >> $logFile
echo -n " ---> " >> $logFile
echo $1 > ${2}${3}
contents=`echo -n $(cat ${2}${3})`
echo -n $contents >> $logFile
}
# Note that the settings pushed by VoltageControl.apk
# could also be managed here (this only applies to kernels with clock/frequency tables and undervolt sysfs support):
#echo_ "50 50 50 25 25 25 25 " "/sys/devices/system/cpu/cpu0/cpufreq" "/UV_mV_table"
#echo_ 1400000 "/sys/devices/system/cpu/cpu0/cpufreq" "/scaling_max_freq"
echo "---------" >> $logFile
# Remount all partitions that use relatime with noatime and nodiratime instead.
# Note: atime generates a write-after-every-read, relatime is an optimized version of atime.
for k in $(mount | grep relatime | cut -d " " -f3)
do
echo "mount -o remount,noatime,nodiratime $k" >> $logFile
sync
mount -o remount,noatime $k
done
# Here is a sample test to measure read/write performance on rfs partitions:
### test for write: dd if=/dev/zero of=/data/test count=30000
### test for read: dd if=/data/test of=/dev/zero
echo "---------" >> $logFile
# Log the mount table
mount >> $logFile
echo "---------" >> $logFile
# Optimize the cfq/bfq I/O scheduler for flash memory (defaults are designed for spinning harddisks).
# Lower the idle wait, re-enable the low latency mode, remove the penalty for back-seeks,
# and explicitly tell the kernel that the storage is not a spinning disk.
for i in $(ls -1 /sys/block/stl*) $(ls -1 /sys/block/mmc*) $(ls -1 /sys/block/bml*) $(ls -1 -d /sys/block/tfsr*)
#for i in `ls /sys/block/stl* /sys/block/mmc* /sys/block/bml* /sys/block/tfsr*`;
do
# DEF noop anticipatory deadline cfq [bfq]
echo_ "bfq" $i "/queue/scheduler"
# DEF 1 ?
echo_ "0" $i "/queue/rotational"
# DEF 1 ?
echo_ "1" $i "/queue/iosched/low_latency"
# DEF 2 ?
echo_ "1" $i "/queue/iosched/back_seek_penalty"
# DEF 16384 ?
echo_ "1000000000" $i "/queue/iosched/back_seek_max"
# DEF 6 ?
echo_ "3" $i "/queue/iosched/slice_idle"
sync
done
# Set tendency of kernel to swap to minimum, since swap isn't used anyway.
# (swap = move portions of RAM data to disk partition or file, to free-up RAM)
# (a value of 0 means "do not swap unless out of free RAM", a value of 100 means "swap whenever possible")
# (the default is 60 which is okay for normal Linux installations)
# DEF 60
echo_ "0" "/proc/sys/vm" "/swappiness"
# Lower the amount of unwritten write cache to reduce lags when a huge write is required.
# DEF 20
echo_ "10" "/proc/sys/vm" "/dirty_ratio"
# Increase minimum free memory, in theory this should make the kernel less likely to suddenly run out of memory.
# DEF 3102
echo_ "4096" "/proc/sys/vm" "/min_free_kbytes"
# Increase tendency of kernel to keep block-cache to help with slower RFS filesystem.
# DEF 100
echo_ "1000" "/proc/sys/vm" "/vfs_cache_pressure"
# Increase the write flush timeouts to save some battery life.
# DEF 250
echo_ "2000" "/proc/sys/vm" "/dirty_writeback_centisecs"
# DEF 200
echo_ "1000" "/proc/sys/vm" "/dirty_expire_centisecs"
# Make the task scheduler more 'fair' when multiple tasks are running,
# which improves user-interface and application responsiveness.
# DEF 10000000
echo_ "20000000" "/proc/sys/kernel" "/sched_latency_ns"
# DEF 2000000
echo_ "2000000" "/proc/sys/kernel" "/sched_wakeup_granularity_ns"
# DEF 1000000
echo_ "1000000" "/proc/sys/kernel" "/sched_min_granularity_ns"
sync
# Miscellaneous tweaks
setprop dalvik.vm.startheapsize 8m
#setprop wifi.supplicant_scan_interval 90
echo '' >> $logFile
echo "---------" >> $logFile
#This apply a tweaked deadline scheduler to all RFS (and ext2/3/4, if existent) partitions.
#for i in /sys/block/*
#do
# DEF noop anticipatory deadline cfq [bfq]
#echo deadline > $i/queue/scheduler
#echo 4 > $i/queue/iosched/writes_starved
#echo 1 > $i/queue/iosched/fifo_batch
#echo 256 > $i/queue/nr_requests
#done
Thanks for this Daniel - since I know absolutely nothing about anything Android, all I can say is that I have 2 questions
1 - Would this script be any benefit to someone running a custom ROM (Overcome 1.1.3 in my case) and a custom kernel (Richard Trip's 1.4gHz EXT4)? I ask because I don't know if these guys have already including these tweaks or not... but maybe I should ask them instead...
2 - Is there any way you could put that script - in its most efficient, non-debugging form - in to a script file that us speed-freaks can just toss in to init.d and reboot?
Please do forgive me for any newbishness I have displayed here.
So should I put this script in /system/etc/init.d/ ?
UPDATE: Ok, I've done the script(without extension at the back of the file name) and put it in ~/init.d/, it runs well. I comment out the remount and logging function tho Tested it on some games that required load time like gangstar which lags alot previously, now just dnt have any lag time in it! Thanks!
Anyway, im running Overcome rom with richard's kernel, other than voltage script, i saw 2 more script that does the following:
10fixsh does:
"#!/system/bin/sh
busybox mount -o remount,rw /
find /sbin -maxdepth 1 -type l -exec rm {} \;
busybox mount -o remount,ro /
"
99done does:
"#!/system/bin/sh
sync;
setprop mcr.filesystem.ready 1;
"
So I just add your script as userinit since they do not have conflicting calls
Personally thinks that similar tweaks should be included in custom kernels so that those who wish to do more extreme settings can go with it while those who just wants increased performance as it is can still have the boost provided by such init script.
fastcx said:
Personally thinks that similar tweaks should be included in custom kernels so that those who wish to do more extreme settings can go with it while those who just wants increased performance as it is can still have the boost provided by such init script.
Click to expand...
Click to collapse
so basically just copy and paste the whole "code" in the first post, and create it as userinit.sh and put the userinit.sh file in /system/etc/init.d ?
am i right?
kay_kiat88 said:
so basically just copy and paste the whole "code" in the first post, and create it as userinit.sh and put the userinit.sh file in /system/etc/init.d ?
am i right?
Click to expand...
Click to collapse
still need more time to test, after some verification, none of the "/proc/sys/kernel" setting works with any of the kernel i'm using. thats y i need more time to rectify..
used richard's kernel and overcome kernel, both dont do anything now..perhaps wrong command in the script? Cause run-parts.sh does specify where to run script, and init.d does have 2 script in there that runs. So i'll need more time to make sure it works now..
Dont need to have .sh as extension, just a name for your script like the other 2 script that i posted in previous reply. And I did not copy the whole script to run, as the script seems questionable in some part..
fastcx said:
still need more time to test, after some verification, none of the "/proc/sys/kernel" setting works with any of the kernel i'm using. thats y i need more time to rectify..
used richard's kernel and overcome kernel, both dont do anything now..perhaps wrong command in the script? Cause run-parts.sh does specify where to run script, and init.d does have 2 script in there that runs. So i'll need more time to make sure it works now..
Dont need to have .sh as extension, just a name for your script like the other 2 script that i posted in previous reply. And I did not copy the whole script to run, as the script seems questionable in some part..
Click to expand...
Click to collapse
okay.. so basically just copy everything under the "code" and create it as userinit?
edit: hmmm okay thanks for you help. i don't think it's of any use for me now as my tab is quite fast and i don't do any intensive stuff on it. thanks anyway!
kay_kiat88 said:
okay.. so basically just copy everything under the "code" and create it as userinit?
edit: hmmm okay thanks for you help. i don't think it's of any use for me now as my tab is quite fast and i don't do any intensive stuff on it. thanks anyway!
Click to expand...
Click to collapse
Now i'm editing init.rc file instead, but it's not the safest thing to do
Wow all the best.. lol.
Sent from my GT-P1000 using Tapatalk
fastcx said:
Now i'm editing init.rc file instead, but it's not the safest thing to do
Click to expand...
Click to collapse
The init.rc file gets extracted from the initramfs ramdisc (packaged inside the zImage kernel) at each device startup. Changing this file's content is not a good idea. Regards, Dan
fastcx said:
So should I put this script in /system/etc/init.d/ ?
UPDATE: Ok, I've done the script(without extension at the back of the file name) and put it in ~/init.d/, it runs well.
Click to expand...
Click to collapse
Yes, the filename of the startup script must start with "S_" and must not end with ".sh". This is standard Linux stuff.
fastcx said:
find /sbin -maxdepth 1 -type l -exec rm {}
Click to expand...
Click to collapse
Removing the symlinks from "/sbin/" ... why ?
Normally Busybox should be installed properly in "/sbin/" by your kernel provider, you shouldn't have to touch this folder.
fastcx said:
99done does:
"#!/system/bin/sh
sync;
setprop mcr.filesystem.ready 1;
"
Click to expand...
Click to collapse
The "mcr.filesystem.ready" is only relevant if the "init.rc" file in the kernel zImage's initramfs ramdisc responds to a change to the "mcr.filesystem.ready" property (for example, when its value changes from 0 to 1). This is typically used to start the device normally, after *all* of the "/system/etc/init.d/" startup scripts have been executed.
The line of code "setprop mcr.filesystem.ready 1" is therefore typically included in "/sbin/runparts.sh", not in one of the "S_startup_scripts" (as this may trigger the device normal startup prematurely).
It really depends on your kernel, so it should be documented by your kernel provider.
daniel.weck said:
Yes, the filename of the startup script must start with "S_" and must not end with ".sh". This is standard Linux stuff.
It really depends on your kernel, so it should be documented by your kernel provider.
Click to expand...
Click to collapse
Great! thanks for clarifying! Sadly none of the kernel provider states any info on such matter. Will try your script again, as previously running thru gscript not all command works..
Copied your script 100%, put it in init.d with chmod 755, named it S_userinit, doesnt run..i double checked by cat value that I stated to change in the script.
Help? It obviously runs the UV script in init.d tho.
EDIT: Got it to work by editing the UV script, now settings are in! Great! Time to test anyway, nodiratime is not needed, noatime already has it
So how can I use this script - I want to
Hi, Just connected to my galaxy tab running froyo, and went looking in my filesystem for the init.d folder and yeah there isn't one
do i create one? where? and what permissions?
I try to keep this brief and not waste too much of your time.
many thanks for the script
Ttime & effort ++
andytof46 said:
Hi, Just connected to my galaxy tab running froyo, and went looking in my filesystem for the init.d folder and yeah there isn't one
do i create one? where? and what permissions?
I try to keep this brief and not waste too much of your time.
many thanks for the script
Ttime & effort ++
Click to expand...
Click to collapse
you will need a kernel that support init script, after that, /etc/init.d(or /system/etc/init.d) will be created
fastcx said:
Copied your script 100%, put it in init.d with chmod 755, named it S_userinit, doesnt run..i double checked by cat value that I stated to change in the script.
Help? It obviously runs the UV script in init.d tho.
EDIT: Got it to work by editing the UV script, now settings are in! Great! Time to test anyway, nodiratime is not needed, noatime already has it
Click to expand...
Click to collapse
Don't suppose you could post a copy of your trimmed & tweaked version of Daniel's script for us to use?
Cuz I, for example, have no idea what's useful in the original script, and what's not useful. But I at least know how to edit the UV script, heh.
jeebspawnshop said:
Don't suppose you could post a copy of your trimmed & tweaked version of Daniel's script for us to use?
Cuz I, for example, have no idea what's useful in the original script, and what's not useful. But I at least know how to edit the UV script, heh.
Click to expand...
Click to collapse
LOL here it goes
Code:
#!/system/bin/sh
#set UV
echo "0 0 0 0 0 0 0 0 " > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
echo 1000000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
#select enabled states
echo "0 0 0 0 0 0 0 0 " > /sys/devices/system/cpu/cpu0/cpufreq/states_enabled_table
#set scheduler for stl, bml and mmc
for i in `ls /sys/block/stl*` /sys/block/bml* /sys/block/mmcblk*
do
echo "bfq" > $i/queue/scheduler
echo "0" > $i/queue/rotational
echo "1" > $i/queue/iosched/low_latency
echo "1" > $i/queue/iosched/back_seek_penalty
echo "1000000000" > $i/queue/iosched/back_seek_max
echo "3" > $i/queue/iosched/slice_idle
done
# Remount all partitions with noatime
for k in $(busybox mount | grep relatime | cut -d " " -f3)
do
sync
busybox mount -o remount,noatime $k
done
# Tweak kernel VM management
echo "0" > /proc/sys/vm/swappiness
echo "10" > /proc/sys/vm/dirty_ratio
echo "4096" > /proc/sys/vm/min_free_kbytes
# Tweak kernel scheduler, less aggressive settings
echo "18000000" > /proc/sys/kernel/sched_latency_ns
echo "3000000" > /proc/sys/kernel/sched_wakeup_granularity_ns
echo "1500000" > /proc/sys/kernel/sched_min_granularity_ns
# Misc tweaks for battery life
echo "2000" > /proc/sys/vm/dirty_writeback_centisecs
echo "1000" > /proc/sys/vm/dirty_expire_centisecs
# Miscellaneous tweaks
setprop dalvik.vm.startheapsize 8m
done
NOTE: If you change any settings in uv app, u'll revert S_volt_scheduler to ONLY UV settings, so It's recommended to edit your UV setting on this file instead of using uv app from now on if you wants to keep your other settings
Thanks dude!
I hit your Thanks Button too.
jeebspawnshop said:
Thanks dude!
I hit your Thanks Button too.
Click to expand...
Click to collapse
Thanks U should thanks the thread starter too U should just take it as reference, modify any that you feels ok, and perhaps post here as feedback on which makes things better, especially disc scheduler and task scheduler settings.
UPDATE: Made some changes to suggested value by daniel for "fairness", these setting really deals with multitasking better
echo "20000000" > /proc/sys/kernel/sched_latency_ns
echo "2000000" > /proc/sys/kernel/sched_wakeup_granularity_ns
echo "1000000" > /proc/sys/kernel/sched_min_granularity_ns
hey fastcx, i copied and pasted your script in the UV scheduler file in init.d but it seems that it's not working as the values don't apply. any ideas why?
What is Skinny Pro?
This is not for NOOBS - it breaks functionality in Xiaomi apps that try to communicate back to head office. This is an intentional feature and is for people who are not interested in being part of the Xiaomi ecosphere. LEAVE NOW if you have, or intend to log on to Xiaomi and use their services!!!!
Skinny does not magically fix poor choice of ROMs, Apps or lack of knowledge.
It is not a custom Kernel - it is a custom boot.img containing modified initialization scripts for the stock kernel.
There are 2 distinct versions:
Based on 7.1.4.0 - Use for 7.1.xx to 7.3.20 (MIUI7) Support discontinued since V7 (O.P no longer applies to this version)
Based on MIUI8 - use for MIUI7.5.x and MIUI8
Design Brief:
No Placebos
To overcome the limitations of Stock MIUI being:
Poor battery life
Poor performance
Chronic invasion of privacy
Boot.img mods:
Disable starting of non-present devices and services
Disable stock recovery overwriting TWRP
Disable OTA services (no use on a modified ROM)
Disable starting of invasive (spying) services
Disable fingerprint sensor infrastructure (not for our device)
Disable find device infrastructure
Disable second space infrastructure
Build in init.d support
Enable zram swap creation (disable conflicting "mcd" service infrastructure)
Mass Storage Device mode added for external SDCard
Improved TCP Buffer values
Reconfigured internal SDCard suppport to remove uneccessary symlinks
Reduce cpu scheduler, foreground and background tasks deadtime (throttling)
Add some Android 6.0 TCP tweaks
Expose LMK and HPS settings for user configuration
What you will see:
Faster boot
Less background activity at idle
Less RAM usage
Less spying/reporting activity
Better battery life
Better Performance
More reliable and faster data speeds
Install your chosen ROM and get it past the first setup screens before flashing a Skinny Boot image.
If you really must install Xposed, install this after the Skinny boot image.
Do not install "kernel" tweaking apps - they will conflict with the inherent settings in Skinny!
No wipes are necessary after installing the boot.img
What else do I need to do?
First, an explanation as to why we need to set everything the way it is:
The cpu is controlled by 4 separate mechanisms:
1. Thermal throttling - will limit frequencies and shut down cores to stay within safe operating temperatures - will override all other mechanisms. Settings available: High Performance (less strict) or Balanced (default)
2. Performance Server - will temporarily boost freqs and cores depending on detected conditions such as screen touch, screen update or rotate, app open. Limited settings available via /etc/perfservscntbl.txt
3. Hotplugging Service - will add or remove cpu cores as load requires. Some settings are accessible through /proc/hps/
4. Interactive Governor - will throttle freqs up and down based on load and add or remove cores also. Some settings are accessible through /sys/devices/system/cpu/cpufreq/interactive/
You will notice there are competing and often contradicting mechanisms. The factory defaults essentially disable the Interactive governor as being the primary source of initial boosting cpu freqs. The "boost" setting normally found in the governor is non-functional - instead, the Perf Server will boost to 2 cores @ 1183MHz when a potential demand for processing power is detected apart from a simple screen touch. The interactive governor will take over scaling the freq and number of cores after the perf server boost period expires or load demands more cpu power than the boost caters for.
Since the Performance Server tends to over-react, setting 2 cores @ 1183MHz for the smallest of events, we disable it completely by manually editing the existing line in /system/build.prop from:
ro.mtk_perfservice_support=1 to ro.mtk_perfservice_support=0
You must do this yourself - this is vital since all further Governor and Hotplug settings rely upon it being disabled.
Editing /etc/perfservscntbl.txt is not required since this file will no longer be processed.
The settings for the Interactive Governor and Hotplug are modified from factory default to correct a couple of serious problems:
1. The cpu will not reliably throttle back to idle at 403MHz. This has a huge impact on battery.
This is caused by the timer_rate setting being too short allowing transient background activities to trigger scaling the freq up. Increasing the time effectively averages out the transient load spikes so the cpu will not break idle unnecessarily.
2. The cpu does not respond to increasing or decreasing load fast enough creating micro-lags and consuming battery. Reducing the min_sample_time will shorten the time taken for the cpu to lower in freq when load drops off. Reducing the above_hispeed_delay will reduce the response time to increase the cpu freq in response to a load. Both of these settings also compensate for the longer than standard timer_rate that introduces some sluggishness by necessity.
All other values are set to encourage the frequency and number of cores to rapidly and reliably return to idle to save battery while still providing sufficient responsiveness to sudden load demands.
Create an init.d script exactly as follows: (premade file 01_init also available to download)
Code:
#!/system/bin/sh
### CPU freqs standard RN2: 403000, 806000, 1183000, 1326000, 1469000, 1625000, 1781000, 1950000
### CPU freqs PRIME RN2: 403000, 806000, 1183000, 1326000, 1482000, 1664000, 1885000, 2158000
### GPU freqs standard RN2: 253500, 299000, 390000, 442000, 546000
### GPU freqs PRIME RN2: 253500, 338000, 390000, 546000, 676000
# Stop running boot-time services (enable the lines for services you want to stop)
#stop sn # USB serial number allocation
#stop wifi2agps # WiFi assisted GPS (for fine location)
#stop agpsd # Mobile Network assisted GPS (for fine locastion)
#stop emsvr_user # Engineering Mode server
#stop PPLAgent # Privacy Protection Lock
#stop mtkbt # MTK Bluetooth
#stop batterywarning # Battery warning service
#stop debuggerd64 # debug logging
#stop debuggerd # debug logging
#stop logd # logging
#stop autokd # autotune for WiFi
#Set to permissive (enable this line if SE permissive mode is required)
# setenforce 0
# Tweak Interactive Governor (now set in boot.img - enable here to override values)
#echo 403000 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq # factory default 1183000
#echo 99 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load # factory default 99
#echo 99 > /sys/devices/system/cpu/cpufreq/interactive/target_loads # factory default 90
#echo 25000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate # factory default 20000
#echo 10000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time # factory default 20000
#echo 5000 > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay # factory default 20000
#echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/timer_slack # factory default 80000
# Limit CPU max freqs (To limit the maximum cpu freq, enable both of these lines. Select a valid freq for your device from table at start)
#echo 1781000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
#echo 1781000 > /proc/cpufreq/cpufreq_limited_max_freq_by_user
# Limit foreground CPU cores (set in boot.img - enable here to override values) 0-1 min, 0-7 max Example shows 5 cores (also needs to be set in Hotplug)
#echo 0-4 > /dev/cpuset/foreground/cpus
# Hotplug settings (set in boot.img - enable here to override values) Note: num_limit values are 1-8
#echo 5 > /proc/hps/num_limit_low_battery # factory default 8
#echo 5 > /proc/hps/num_limit_power_serv # factory default 8
#echo 5 > /proc/hps/num_limit_thermal # factory default 8
#echo 5 > /proc/hps/num_limit_ultra_power_saving # factory default 8
#echo 99 > /proc/hps/up_threshold # factory default 95
#echo 87 > /proc/hps/down_threshold # factory default 85
#echo 0 > /proc/hps/rush_boost_enabled # factory default 1
#echo 0 > /proc/hps/input_boost_enabled # factory default 1
# Tweak GPU Settings (Look in /proc/gpufreq/gpufreq_power_dump for power usage at different freqs)
# To disable GPU touch boost:
#echo 0 > /proc/gpufreq/gpufreq_input_boost # factory default 1 (enabled)
# To limit max GPU freq: (Select a valid freq for your device from table at start)
#echo 442000 > /proc/gpufreq/gpufreq_opp_max_freq # factory default 0 (disabled)
# Tweak VM (set in boot.img - enable here to override values)
#echo 300 > /proc/sys/vm/dirty_expire_centisecs # factory default 200
#echo 500 > /proc/sys/vm/dirty_writeback_centisecs # factory default 300
# Tweak LMK (set in boot.img - enable here to override values) 18 37 56 75 93 112MB # factory default 72 90 108 126 219 317MB (MB x 256 = value)
#echo 4608,9472,14336,19200,23808,28672 > /sys/module/lowmemorykiller/parameters/minfree
#Enable zram (no zram set by default, enable first 4 lines if 1 zram required, all 7 lines if 2 zram required)
#echo 40 > /proc/sys/vm/swappiness
#echo 268435456 > /sys/block/zram0/disksize # for single zram: 536870912 = 512MB (for non-prime version) 1073741824=1GB (for prime version)
#/system/xbin/busybox mkswap /dev/block/zram0
#/system/xbin/busybox swapon /dev/block/zram0
#echo 268435456 > /sys/block/zram1/disksize # for 2 zrams: 268435456 = 256MB (for non-prime version) 536870912 = 512MB (for prime version)
#/system/xbin/busybox mkswap /dev/block/zram1
#/system/xbin/busybox swapon /dev/block/zram1
# Tweak IO Scheduler (set in boot.img - enable here to override values)
#echo deadline > /sys/block/mmcblk0/queue/scheduler # factory default cfq (choice: noop deadline cfq)
#echo 128 > /sys/block/mmcblk0/queue/read_ahead_kb # factory default 128 Choose between 128, 256, 512, 1024, 2048
#echo 0 > /sys/block/mmcblk0/queue/add_random # factory default 1
#echo 0 > /sys/block/mmcblk0/queue/iostats # factory default 1
#echo deadline > /sys/block/mmcblk1/queue/scheduler # for ext sdcard (sdcard1)
#echo 2048 > /sys/block/mmcblk1/queue/read_ahead_kb # for ext sdcard (sdcard1)
#echo 0 > /sys/block/mmcblk1/queue/add_random # for ext sdcard (sdcard1)
#echo 0 > /sys/block/mmcblk1/queue/iostats # for ext sdcard (sdcard1)
#Tweak Entropy (set in boot.img - enable here to override values)
#echo 384 > /proc/sys/kernel/random/read_wakeup_threshold # factory default 64
#echo 448 > /proc/sys/kernel/random/write_wakeup_threshold # factory default 128
#Tweak for wifi router connection issues
#echo 1 > /proc/sys/net/ipv6/conf/wlan0/disable_ipv6
# Disable debugging on some modules (set in boot.img - enable here to override values)
#echo 0 > /sys/module/alarm_dev/parameters/debug_mask;
#echo 0 > /sys/module/alarmtimer/parameters/debug_mask;
#echo 0 > /sys/module/binder/parameters/debug_mask;
#echo 0 > /sys/module/earlysuspend/parameters/debug_mask;
#echo 0 > /sys/module/sbsuspend/parameters/sbsuspend_debug_mask;
#echo 0 > /sys/module/snd/parameters/debug;
#echo 0 > /sys/module/pvrsrvkm/parameters/gPVRDebugLevel;
#echo 0 > /sys/module/musb_hdrc/parameters/debug_level;
#echo 0 > /sys/module/lowmemorykiller/parameters/debug_level;
#FSTRIM
busybox fstrim /data
busybox fstrim /system
busybox fstrim /cache
Update BusyBox to version 1.25.1-1 (available to download)
Reduce the number of apps and services needlessly starting automatically at boot. Uninstall or freeze bloat apps. Replace "noisy" apps with better written ones.
Use BetterBatteryStats, WakelockDetector Root or similar to understand what invisible activities are consuming battery.
Use SDMaid, DisableServices, MyAndroidTools or similar to disable autostarts (receivers)and app related services. Use with caution.
To see what boot services are running, type getprop in Terminal. You will see a bunch of entries like [init.svc.66xx_launcher]: [running]
These service must remain running do not stop!:
Code:
[init.svc.66xx_launcher]: [running]
[init.svc.MtkCodecService]: [running]
[init.svc.NvRAMAgent]: [running]
[init.svc.aal]: [running]
[init.svc.ccci_fsd]: [running]
[init.svc.ccci_mdinit]: [running]
[init.svc.drm]: [running]
[init.svc.fuelgauged]: [running]
[init.svc.gsm0710muxd]: [running]
[init.svc.guiext-server]: [running]
[init.svc.healthd]: [running]
[init.svc.installd]: [running]
[init.svc.keystore]: [running]
[init.svc.lmkd]: [running]
[init.svc.media]: [running]
[init.svc.mnld]: [running]
[init.svc.netd]: [running]
[init.svc.ril-daemon-mtk]: [running]
[init.svc.sdcard]: [running]
[init.svc.servicemanager]: [running]
[init.svc.shelld]: [running]
[init.svc.surfaceflinger]: [running]
[init.svc.thermal]: [running]
[init.svc.thermald]: [running]
[init.svc.ueventd]: [running]
[init.svc.vold]: [running]
[init.svc.zygote]: [running]
[init.svc.zygote_secondary]: [running]
[init.svc.bmi160d]: [running]
If you only have 1 SIM, it is highly recommended to go into single SIM mode to turn off the second modem service. Edit build.prop existing line from:
persist.radio.multisim.config=dsds to persist.radio.multisim.config=ss
Turn off Developer Options/Memory Optimization and MIUI Optimization. This is a legacy of the mcd service zram configuration that is disabled.
Removal of Apps that are created by symlinks: (Updated information for any ROM version can be found in ROM \META-INF\com\google\android\updater-script)
Uninstall the app where possible and then delete the leftover libs if they exist.
Code:
[B]MAB[/B]
/system/lib/libDToken.so
/system/lib/libNative.so
/system/lib/libShopSigned.so
/system/lib/libentryexpro.so
/system/lib/libsecuritysdk-3.1.27.so
[B]Jeejen[/B]
/system/lib/libJeejenAisound.so
/system/lib/libbspatch.so
/system/lib/libfamily_jni.so
/system/lib/libgetuiext.so
/system/lib/libjeejenmsc.so
[B]MIUI Video[/B]
/system/lib/libDecRes_sdk.so
/system/lib/libminivenus.so
/system/lib/libmresearch.so
/system/lib/libsecurities_sdk.so
[B]Cleanmaster[/B]
/system/lib/libTmsdk-2.0.9-mfr.so
/system/lib64/libTmsdk-2.0.9-mfr.so
/system/lib/libdce-1.1.14-mfr.so
/system/lib64/libdce-1.1.14-mfr.so
/system/lib/libkcmutil.so
/system/lib/libkcmutilex.so
/system/lib/libsic_helper.so
[B]SecondSpace[/B]
/system/lib/libspaces_jni.so
[B]Sogou Input[/B]
/system/lib/libwebp.so
/system/lib/libweibosdkcore_sogou.so
[B]AMAP Network Location[/B]
/system/lib64/libapssdk.so
[B]YellowPage[/B]
/system/lib64/libdidi_secure.so
[B]XMPass[/B]
/system/lib64/libxmpass_sdk_patcher.so
/system/lib64/xmpass_libweibosdkcore.so
[B]PicoTTS[/B]
/system/lib64/libttscompat.so
/system/lib64/libttspico.so
[B]Miui Gallery[/B]
/system/lib64/libwrapnexpcmcalbody.so
/system/lib64/libnexralbody_audio.so
/system/lib64/libnexcralbody_mc_jb.so
/system/lib64/libnexeditorsdk.so
/system/lib64/libPinguoImageSDK.so
/system/lib64/libMiuiGalleryNSGIF.so
/system/lib/libMiuiGalleryNSGIF.so
/system/lib64/libDexHelper.so
[B]MIUI Scanner[/B]
/system/lib64/libQuadrangleRecognizer.so
/system/lib64/libhw_instanttrans.so
/system/lib64/libhwocr_cntools_shared.so
/system/lib64/libsgmain.so
/system/lib64/libsgmainso-5.1.2011.so
/system/lib64/libtbdecode.so
Remove inbuilt virus scanner(s)
Remove GuardProvider.apk and SecurityAdd.apk plus:
Code:
/system/lib64/libams-1.1.7-m-mfr.so
/system/lib64/libams-1.1.7-mfr.so
/system/lib64/libavast-utils.so
/system/lib64/libavast-vps-interface.so
/system/lib64/libavlasys.so
/system/lib64/libavlm.so
/system/lib64/libavlurl.so
Extra libs that can be removed: (if associated apps are removed)
Code:
[B]Lib:[/B]
libfdpp.so Find Device
libfdpp_jni.so Find Device
libffmpeg-miplayer.so Music / MIUIVideo
libhotknot.so
libhotknot_vendor.so
libnfc_ndef.so
libpatcher_game_jni.so
libpatcher_jni.so
libvoicerecognition.so Voice Extensions
libvoicerecognition_jni.so Voice Extensions
libwhetstone_jni.so
libwhetstone_sdk.so
libxiaomimediaplayer.so Music / MIUIVideo
libxiaomiplayerwrapper.so Music / MIUIVideo
[B]Lib64:[/B]
libBaiduMapSDK_base_v4_0_0.so
libBaiduMapSDK_search_v4_0_0.so
libBaiduMapSDK_util_v4_0_0.so
libBankCardRecognizer.so
libduokantext.so
libfdpp.so Find Device
libfdpp_jni.so Find Device
libhotknot.so
libhotknot_vendor.so
libidcardquality_v1.0.3.so
libjni_latinimegoogle.so Google Keyboard
libjni_pacprocessor.so
libjni_unbundled_latinimegoogle.so Stock Keyboard
libnfc_ndef.so
libpatcher_game_jni.so
libpatcher_jni.so
libprintspooler_jni.so Print Spooler
libtbtv3312.so
libTrafficRadar.so
libttscompat.so Pico TTS
libttspico.so Pico TTS
libunipaychsec.so
libweibosdkcore.so
libwhetstone_jni.so
libwhetstone_sdk.so
[B]/vendor/lib64:[/B]
libcom_fingerprints_productiontestmanager.so
libcom_fingerprints_sensor.so
Skinny Pro All versions:
https://drive.google.com/folderview?id=0BwdRTuyj12_yRk9Kcm1pZkxuZzg&usp=sharing
Enjoy
@jajk Awesome work! Do you intend to work on the aosp boot.img much or are you more invested in the miui one (or is it mostly the same project with not many differences between the two types)?
@Sleepy_Augie There is little difference between the 2 flavors so it is easy to keep them in sync
All,
I cannot possibly know what customization other devs are adding to their boot.imgs and whether or not that will make their ROMs incompatible with my boot.imgs. I will try to keep the AOSP version up with current developments while still keeping it "Generic".
Could you include Selinux: Permissive? Zram is better than swap built-in miui ?
@efr07 The beauty of not embedding tweaks - you can choose to be permissive or enforcing in your init.d script rather than me dictating it to all.
setenforce=0 or 1
and to answer the second part....
MIUI uses what could be called a "dynamic swap" system utilizing 4 zram swaps of variable size. The system prioritizes what gets access to that extra memory and what doesn't. No surprises - Xiaomi apps get priority over your own apps. The complexity of this system is so great, it would negate any performance advantage completely but it does make the Xiaomi apps more tenacious than other apps.
@jajk
First things first thank you so much for the effort you have done improving Redmi Note 2,
But I have some question if you please,
I have Miui 7.2.2.0 Lite on my Redmi Note 2 Prime (2.2 ghz) (Rom Link http://en.miui.com/thread-244684-1-1.html)
I have flashed the file as img to boot, and I have done as you said until the int.d thing, I went to #/system/bin/ and I found sh file and opened it in text editor, deleted everything in it and paste what you mentioned, till now we are ok with the device.
I did not find the files that you said I should delete from /vendor/lib, so I went to /vendor/lib64 and deleted the first file, After I deleted it suddenly Root Explorer shut off and whenever I open it again I cant find anything, just blank screen with its symbol and name above and nothing else. Tried to delete Root Explorer and install again and nothing new. Please help, Have I done everything okay? and what should I do to fix this thing and continue deleting the remaining files?
Thank you.
@jajk delete folder /system/etc/radv <- do you mean radvd?
@aghr11 I think that you did not understand the method to create the init.d script and modified an important file instead. You will have to replace that script file you blanked with the original or restore from a good backup and try again. The list of files for deletion is only if they exist in the location as described. If you have enabled any fingerprint settings for some obscure reason, you will probably get locked out of your phone.
Now to creating the script.
Using a text editor, create a file named 01tweaks in /system/etc/init.d folder.
Paste the text (including the first line #!/system/bin/sh) into this file. Leave a blank line at the bottom of the file and make sure your editor is set to Unix end-of-line characters (not Windows)
Save the file and give it 0755 permissions (rwxr-xr-x)
@tonydeli7 Yes, typo I will fix..... done It is a folder to receive advertising pushed to your phone courtesy of Xiaomi!!!!
jajk said:
@tonydeli7 Yes, typo I will fix..... done It is a folder to receive advertising pushed to your phone courtesy of Xiaomi!!!!
Click to expand...
Click to collapse
Yeap, just saw the conf file... WTF are they doing?!
By the way, thanks a lot for this kernel! Nice work!:good::good:
UPDATE:
I edited the latest Multirom Stable (7.2.1.0) and added your kernel&tweaks,deleted the files and everything works great!
I only changed the touchboost value to 806000
jajk, many thanks for this brilliant work!
IIRC, your personal preference for a base ROM with the best behavior and performance with these tweaks was v7.1.4.0 (or was it 7.1.3.0). Is this so or has anything changed? My RN2p is long overdue for an update, still on dev 5.10.29!
If a have a weekly miui based on Miui V 7.3 beta, will it work?
@tonydeli7 Did you give it some time on touchboost 403? I find it does not contribute to lags perceptibly.
@algida79 The most bug free ROM I have come across is MR7.2.30 ID (ported from reno3). I think I had a link to that in the Skinny thread.
Don't load the preloader, uboot or logo from this ROM - edit the updater-script to remove flashing of these. You will need to do an intermediate flash of 7.1.3 or 7.1.4 using SP Flash tool to get all the partitions the way they need to be if coming from an ancient ROM.
@Dnxss Yes it will still work.
@jajk Half an hour I think. I had no lag,just my preference
The phone usage is mostly surfing,facebook,twitter,music playback etc etc with no gaming.
GPS SYNC 3G all on..
Installed app count is around 120..
Includes six reboots while testing ZRAM(disabled it), and if it's good to deactivate Whetstone app.
I also used the app Autostarts to disable useless receivers for many apps like FB etc,and disabled Mail,Voice Unlock,PicoTTS.
I am satisfied..[emoji14]
Sent from my Redmi Note 2 using Tapatalk
@tonydeli7 Whetstone app is a source of a lot of spyware but is not a straight forward removal but you will find that out...
can then also delete:
/etc/WhetstonePermission folder
/system/lib
libwhetstone_jni.so
libwhetstone_sdk.so
/system/lib64
libwhetstone_jni.so
libwhetstone_sdk.so
Yeap, I searched a bit. I am using the Multirom Stable and after flashing the kernel,Whetstone crashes sometimes.
Didn't notice anything weird after freezing it..
This rom doesn't have the line
persist.sys.whetstone.level=2
in the build.prop for some reason.
Sent from my Redmi Note 2 using Tapatalk
@tonydeli7 Whetstone is linked to the mcd service to make things harder to unravel as in all Xiaomi apps. The boot.img disables mcd which is why you will see Whetsone having a fit sometimes. Completely removing Whetstone is a very good thing to do - it may give you an FC on Battery app, delete that too - it chews battery and does not affect normal operation!!!
Anyone wanting to increase their privacy, rename /system/xbin/tunman to tunmanbak. This is the Xunlei data saver/spyware tunneling manager. It is disabled from starting in the boot.img but will still run if called upon like all of the disabled services - they still exist, but not started by default. Make sure it is disabled in the Download Manager Settings
There is another service /sbin/mdbd that appears to be a method of tunneling over usb connections to gain access to a network and on to P.R.C. It is disabled in the boot.img already but I will rename this one in a next revision to be doubly sure it will not start.
Discovered an issue of some apps not recognizing internal sdcard so new versions posted to fix this plus rename /sbin/mdbd to mdbdbak to prevent it from being started after boot. See previous post for the reason.
Back up your internal sdcard contents if you flashed the original images - you will loose everything on sdcard0.
No action needs to be taken if this is a first-time flash.
@jajk How come this version doesn't just dump sd to folder 0? What was merged between miui and pro boot images?
@Sleepy_Augie It is a very complex issue how Android provides a virtual filesystem for SDCards. I thought I could implement it in a simpler fashion as per Android 5.1 which worked well except apps like the stock Contacts are stuck in the dark ages and are hard-coded to still look for the emulated/0 folder for the internal sdcard - not storage/sdcard0.
So going from stock to my original mod leaves an orphaned folder which becomes named 0 because it belonged to user 0. Going back the other way the folder representing access to sdcard0 simply disappears.
The real location of files that appear on the internal emulated sdcard is always /data/media. All other folders that appear to be the same thing are only symlinks to this. Make sense:silly:
Hey @jajk ,
Thanks for the reply, but I have done exactly everything you said and followed all of your steps, but after one day using it, I do not notice any change on battery life, it is still so bad, I have tried everyrom (and every way that was suggested from other users on XDA and MIUI forums including every battery calibration thing) I came across since I bought my RN2p and the maximum battery life I got is nearly 4:30 hours on screen!! After I flashed the boot.img I noticed a slightly more speed booting up the device, the performance is the same (which is good because am all satisfied about the performance except for the battery life).
I have flashed smiui today and it's slightly better consuming energy than the previous ones...
Maybe I have done something wrong doing the 01tweaks thing, if you can upload me yours so I can try paste it in /system/etc/int.d folder, if that will work, then I will be so thankful to you. And if you have any suggestions that I could do to improve and enhance the crazy energy draining then I will be more thankful.
Here are a few tricks that work with stock ROM and some apps I use. Maybe you find something you like to use too.
Little note on text here, sometimes you see " " (spaces) appear in text/code. They shouldn't be there. You will know when you see them. Ignore!
A very quick summary.
What type of values can you find/change in Android?
0) Linux sysclt values, use sysctl -a to list them (stored in /proc/sys/...)
1) Android properties, use getprop en setprop, you find them in /etc/build.prop
2) Android Settings databases, use settings list [system][global][secure] etc
3) Samsung CSC values, specific for Samsung to hide or show extra GUI elements in /system/csc/feature.xml or /etc/feauture_default.xml
4) Samsung Floating features, like above in /etc/floating_feature.xml
How to find them (1+3)?
- root your phone (install busybox on Android 4 or less)
- goto adb shell and su
- find /system -type f -exec strings -f {} \; | grep "persist\."
if you are looking for perstist. variables. Or to find CSC values use "CscFeature_"
Caveats: some "persist." values are stored in /data/property folder. Keep that in mind.
For some you need to change /system/build.prop, some are Samsung CSC features with the /system/csc/feauture.xml file or Android system settings db.
For some I cannot remember if it was already visible without tweaks. Anyway lets go
I put feature.xml (with a lot of nonworking csc features too!!!), build.prop and disabled_services.txt in attachement.
Reboot after putting new feature.xml in /system/csc folder. Permissions of the file: root.root 644, same for build.prop
If your Samsung ROM has no csc feature create /system/csc and put content in other.xml instead of feature.xml
Call Recording: <CscFeature_VoiceCall_ConfigRecording>RecordingAllowed</CscFeature_VoiceCall_ConfigRecording>
Call blocking: <CscFeature_Setting_EnableMenuBlockCallMsg>TRUE</CscFeature_Setting_EnableMenuBlockCallMsg>
Voice Recorder Quality: <CscFeature_VoiceRecorder_SupportRecordingQualitySetting>TRUE</CscFeature_VoiceRecorder_SupportRecordingQualitySetting>
Camera Shutter Sound:
build.prop ro.camera.sound.forced=0
<CscFeature_Camera_ShutterSoundMenu>TRUE</CscFeature_Camera_ShutterSoundMenu>
Data Usage on Quickpanel: <CscFeature_SystemUI_SupportDataUsageViewOnQuickPanel>TRUE</CscFeature_SystemUI_SupportDataUsageViewOnQuickPanel>
Multi Window: (sort of working, use recent apps button to see effect, landscape and portrait)
build.prop persist.sys.debug.multi_window=1 or setprop persist.sys.debug.multi_window 1
<CscFeature_Framework_ConfigMultiWindowTrayBarFunction>TRUE</CscFeature_Framework_ConfigMultiWindowTrayBarFunction>
Smart Manager:
<CscFeature_SmartManager_ConfigDashboard>dual_dashboard</CscFeature_SmartManager_ConfigDashboard>
<CscFeature_SmartManager_ConfigSubFeatures>autoclean|trafficmanager|trafficmanager_auto|storageclean|devicesecurity|autolaunch|cstyle|powerplanning</CscFeature_SmartManager_ConfigSubFeatures>
<CscFeature_SmartManager_DisableAntiMalware>TRUE</CscFeature_SmartManager_DisableAntiMalware>
ps: don't use "backgroundapp", it will FC RAM Management button
FM Radio Hybrid mode (inet) and EPG
Add support for Auto Follow and inet Hybryd support. Edit /etc/floating_feature.xml
<SEC_FLOATING_FEATURE_FMRADIO_REMOVE_AF_MENU>FALSE</SEC_FLOATING_FEATURE_FMRADIO_REMOVE_AF_MENU><SEC_FLOATING_FEATURE_FMRADIO_SUPPORT_HYBRID_RADIO>TRUE</SEC_FLOATING_FEATURE_FMRADIO_SUPPORT_HYBRID_RADIO>
<SEC_FLOATING_FEATURE_FMRADIO_SUPPORT_RDS>TRUE</SEC_FLOATING_FEATURE_FMRADIO_SUPPORT_RDS>
Smooth scroll of surface flinger
In /etc/floating_feature.xml
<SEC_FLOATING_FEATURE_FRAMEWORK_SUPPORT_SMOOTH_SCROLL>TRUE</SEC_FLOATING_FEATURE_FRAMEWORK_SUPPORT_SMOOTH_SCROLL>
Google installer overlay permission fix
For annoying overlay warning if using Lux for example (only for 6.0.1): here on xda
Apps that I use:
Xperia Keyboard: https://forum.xda-developers.com/android/apps-games/app-sony-xperia-keyboard-phones-t3346736
ZenUI Weather: http://www.apkmirror.com/apk/zenui-asus-computer-inc/
Samsung Apps: https://www.sammobile.com/apk/
Next Camera: https://forum.xda-developers.com/oneplus-one/themes-apps/app-cameranext-gallery-cm13-t3305917/page12
See attachement for comparisson Stock, Next and OpenCam.
Dalvik JIT for dex: build.prop: [size=+2]debug.usejit=true[/size]
adb commands: stop cd /data/dal*/arm rm * sync reboot
RIL wakelock optimalisation: build.prop: [size=+2]ro.ril.wake_lock_timeout=10000[/size]
Edit Quick Menu:
settings put secure sysui_qs_tiles "Wifi,Location,SilentMode,Flashlight,Bluetooth,MobileData,PowerSaving,UltraPowerSaving,RotationLock,AirplaneMode,DormantMode,WifiHotspot,Nfc,Sync,SFinder"
Tried to add SmartStay,MultiWindow,PersonalMode,AllShareCast but no tiles in Framework res.
I disabled a lot of bloatware using the pm disable command (too much for you I guess). Also in attachment.
Some hidden Activities you can find with QuickShortcutMaker (playstore):
- GPS Satellites (search for gps)
- SoundAlive Equalizer (search for alive) EDIT: not working for other than gmusic. SA will bypass for others. Need edit in SoundAlive apk.
Cheers
EDIT 19-01-2016: Added stock Camera from J7 which produces better quality picture.
Code:
- download SamsungCamera4_ESS_J7.apk
- adb push SamsungCamera4_ESS_J7.apk /sdcard/
- adb shell
- su
- mount -o remount,rw /system
- cd /system/priv-app/SamsungCamera4_ESS
- mv SamsungCamera4_ESS.apk SamsungCamera4_ESS.apk.J5
- mv oat oat.J5
- cp /sdcard/SamsungCamera4_ESS_J7.apk .
- chmod 644 SamsungCamera4_ESS_J7.apk
- stop
- sync
- reboot
After reboot start camera and clear settings first! Then do camera settings.
Remove Knox
To disable all Samsung Knox packages:
Code:
for p in $(pm list packages |grep nox) ; do echo $p | busybox awk -F ":" '{print $2}' | xargs pm disable ; done
pm disable com.samsung.klmsagent
pm disable com.policydm
To remove all Samsung Knox packages:
Code:
for p in $(pm list packages -f|grep nox) ; do echo $p | busybox awk -F "/" '{print "/"$2"/"$3"/"$4}' | xargs rm -r ; done
To remove all data from disabled packages:
Code:
for p in $(pm list packages -d) ; do echo $p | busybox awk -F ':' '{print "/data/data/" $2}' | xargs rm -r ; done
Disable Knox (hidden) services
Code:
stop
mv /system/container /system/container.OFF
rm /data/dal*/arm/*
sync
reboot
EDIT 09-02-2017: Added /etc/mixer-paths.xml for increased volume on speaker, headphone and handset speaker.
Finding the proper loudness values can be done from the shell command line with tinymix command.
example:
Code:
tinymix (see all audio objects)
tinymix "RX1 Digital Volume" (see all possible values for this audio object)
tinymix "RX1 Digital Volume" 86
Note that a value of 83 represents 0dB.
Some extra settings for system, global and secure db (/data/system/users/0/settings_system.xml etc)
Find yours with settings list system, global or secure. These settings are Android version (API23 in this case)
related. Beware of that when copying it from xda or anywhere else.
Code:
settings put system enable_mtp_settings 1
settings put system intelligent_sleep_mode 1
settings put system white_lockscreen_statusbar 0
#settings put system white_lockscreen_wallpaper 1
settings put system lockscreen_wallpaper_transparent 0 (1=hard to see statusbar)
settings put system adaptive_fast_charging 1
settings put system simple_status_bar 0
settings put system data_powersaving_mode 0
settings put system data_usage_on_lockscreen_sim1 1
settings put system min_minder 1
settings put system csc_pref_camera_quality_key 0
settings put system csc_pref_camera_videoquality_key 0
settings put system csc_pref_camera_burstshot_key 1
settings put system csc_pref_camera_autonightdetection_key 1
settings put system csc_pref_camera_forced_shuttersound_key 0
settings put global ble_scan_always_enabled 0
settings put global bluetooth_discoverable_timeout 120
settings put global wifi_watchdog_poor_network_test_enabled 0
settings put global wifi_scan_always_enabled 0 (0)
settings put global wifi_idle_ms 1800000 (def is 900000=15min)
settings put global wifi_suspend_optimizations_enabled 1
settings put global wifi_networks_available_notification_on 0
settings put global wifi_max_dhcp_retry_count 3
settings put global wifi_mobile_data_transition_wakelock_timeout_ms 5000
#settings put global heads_up_snooze_length_ms 2000
#settings delete global heads_up_snooze_length_ms
settings put global heads_up_notifications_enabled 1
settings put global low_power_back_data_off 1 (drop data conn if low pwr
settings put global low_power_trigger_level 5 (5% batt is low pwr)
settings put secure button_key_light 0
settings put secure long_press_timeout 300
settings put secure location_mode 2
#0 = LOCATION_MODE_OFF
#1 = LOCATION_MODE_SENSORS_ONLY
#2 = LOCATION_MODE_BATTERY_SAVING
#3 = LOCATION_MODE_HIGH_ACCURACY
PS: Don't quote this post. Is is considered useless and annoying.
PS2: more Samsung MM mods/tweaks can be found in this xda thread.
PS3: added meizu camera mod apk with very good image quality (Smaller version here https://forum.xda-developers.com/moto-g/themes-apps/camera-app-t3283962)
tweakradje said:
Here are a few tricks that work with stock ROM. For some you need to change /system/build.prop, some are Samsung CSC features with the /system/csc/feauture.xml file or Android system settings db.
For some I cannot remember if it was already visible without tweaks. Anyway lets go
I put feature.xml (with a lot of nonworking csc features too!!!), build.prop and disabled_services.txt in attachement.
Reboot after putting new feature.xml in /system/csc folder. Permissions of the file: root.root 644, same for build.prop
Call Recording: <CscFeature_VoiceCall_ConfigRecording>RecordingAllowed</CscFeature_VoiceCall_ConfigRecording>
Call blocking: <CscFeature_Setting_EnableMenuBlockCallMsg>TRUE</CscFeature_Setting_EnableMenuBlockCallMsg>
Voice Recorder Quality: <CscFeature_VoiceRecorder_SupportRecordingQualitySetting>TRUE</CscFeature_VoiceRecorder_SupportRecordingQualitySetting>
Camera Shutter Sound:
build.prop ro.camera.sound.forced=0
<CscFeature_Camera_ShutterSoundMenu>TRUE</CscFeature_Camera_ShutterSoundMenu>
Data Usage on Quickpanel: <CscFeature_SystemUI_SupportDataUsageViewOnQuickPanel>TRUE</CscFeature_SystemUI_SupportDataUsageViewOnQuickPanel>
Multi Window: (sort of working, use recent apps button to see effect, landscape and portrait)
build.prop persist.sys.debug.multi_window=1
<CscFeature_Framework_ConfigMultiWindowTrayBarFunction>TRUE</CscFeature_Framework_ConfigMultiWindowTrayBarFunction>
I disabled a lot of bloatware using the pm disable command (too much for you I guess). Also in attachement.
Cheers
Click to expand...
Click to collapse
Cool, but when multi window is enabled, don.t you get the scroll bug in recents apps? (especially in the bottom part of the screen)
Yes the bug is there. Pull down notifications corrects it shortly. Multi Window on small screens is not my thing anyway.
Can I enable multi-window in J500F the same way? Would love to have two apps on screen simultaneously.
Perhaps, what's the scroll bug?
Added information of how to increase volume on different audio outputs with /etc/mixer-paths.xml and test it with the tinymix command.
tweakradje said:
Added information of how to increase volume on different audio outputs with /etc/mixer-paths.xml and test it with the tinymix command.
Click to expand...
Click to collapse
tinymix "RX1 Digital Volume" 86 gives me tinymix is not executable.
chmod 755 does not return error but still not executable.
putting <ctl name="RX1/2/3 Digital Volume" value="86"/> or even 90 in the mixer_paths.xml and reboot does't increase the volume.
I'm missing something ?
What ROM are you on then? I have stock.
Dude I don't understand how to use this. Please help me. I really want these features.
Added my latest build.prop and init.qcom.post_boot.sh
Antutu score with stock ROM and Cherry Kernel 3.10.94
Hi how to remove "system unauthorised action "when i'am instal custom kernel on stockrom
adf18224 said:
Hi how to remove "system unauthorised action "when i'am instal custom kernel on stockrom
Click to expand...
Click to collapse
The notification or smart manager alert?
Wizardlysense said:
The notification or smart manager alert?
Click to expand...
Click to collapse
Smart manager sir
Hey Guys, i've made a script to debloat MIUI and to install some Kernel optimizations at the INIT.D folder plus anti Google Play Services Wakelock Script (at INIT.D as well).
Usually i use it on mi-globe and MIUI-MIX but it should work for Xiaomi.eu, Global and Chinese ROMs too (both beta and stable).
Thanks to @kevp75 for the line:
Code:
ifelse(
(is_mounted("/system")), (
assert(run_program("/sbin/mount", "-o", "remount,rw", "/system"));
), (
assert(run_program("/sbin/mount", "-o", "rw", "/dev/block/bootdevice/by-name/system", "/system_root"));
)
);
ATTENTION!! I ONLY RECOMMEND USING THE OFFICIAL TWRP, ORANGEFOX AND MAURONO UNOFFICIAL DOES NOT WORK!!
https://twrp.me/xiaomi/xiaomimi9t.html
Instalation:
1 - Reboot in to TWRP after first boot and setup.
2 - Make a nanodroid full system Backup for safety.
3 - Go to Mount and make sure SYSTEM is mounted!
4 - Run the script.
5 - Reboot in to system.
6 - Profit.
If you wipe the system partition, you will need to reboot in to the OS and back to TWRP before flash the debloat script.
Download:
https://androidfilehost.com/?fid=4349826312261796697
What will it debloat:
Code:
delete_recursive("/system/app/AiAsstVision");
delete_recursive("/system/app/AnalyticsCore");
delete_recursive("/system/app/BTProductionLineTool");
delete_recursive("/system/app/BasicDreams");
delete_recursive("/system/app/BookmarkProvider");
delete_recursive("/system/app/BuiltInPrintService");
delete_recursive("/system/app/CatchLog");
delete_recursive("/system/app/Cit");
delete_recursive("/system/app/CloudPrint2");
delete_recursive("/system/app/Email");
delete_recursive("/system/app/FM");
delete_recursive("/system/app/GooglePrintRecommendationService");
delete_recursive("/system/app/GoogleTTS");
delete_recursive("/system/app/GuardProvider");
delete_recursive("/system/app/Health");
delete_recursive("/system/app/Joyose");
delete_recursive("/system/app/KSICibaEngine");
delete_recursive("/system/app/Lens");
delete_recursive("/system/app/MarkupGoogle");
delete_recursive("/system/app/MiLinkService");
delete_recursive("/system/app/MiPlayClient");
delete_recursive("/system/app/MiRadio");
delete_recursive("/system/app/MiuiBugReport");
delete_recursive("/system/app/MiuiCompass");
delete_recursive("/system/app/MiuiContentCatcher");
delete_recursive("/system/app/MiuiDaemon");
delete_recursive("/system/app/MiuiAccessibility");
delete_recursive("/system/app/MiuiSuperMarket");
delete_recursive("/system/app/MiuiVideoGlobal");
delete_recursive("/system/app/NextPay");
delete_recursive("/system/app/PartnerBookmarksProvider");
delete_recursive("/system/app/PaymentService");
delete_recursive("/system/app/PrintRecommendationService");
delete_recursive("/system/app/PrintSpooler");
delete_recursive("/system/app/SoundPickerPrebuilt");
delete_recursive("/system/app/Stk");
delete_recursive("/system/app/WPS_lite");
delete_recursive("/system/app/XMCloudEngine");
delete_recursive("/system/app/YellowPage");
delete_recursive("/system/app/YouDaoEngine");
delete_recursive("/system/app/greenguard");
delete_recursive("/system/app/lens");
delete_recursive("/system/app/mi_connect_service");
delete_recursive("/system/app/wps_lite");
delete_recursive("/system/app/Zman");
delete_recursive("/system/data-app/");
delete_recursive("/system/data-app/BaiduIME");
delete_recursive("/system/data-app/Email");
delete_recursive("/system/data-app/MiFinance");
delete_recursive("/system/data-app/MiMobileNoti");
delete_recursive("/system/data-app/MiShop");
delete_recursive("/system/data-app/XiaomiSpeechEngine");
delete_recursive("/system/data-app/cn.wps.moffice_eng");
delete_recursive("/system/data-app/com.eg.android.AlipayGphone");
delete_recursive("/system/data-app/com.taobao.taobao");
delete_recursive("/system/data-app/com.xunmeng.pinduoduo");
delete_recursive("/system/priv-app/BATestApp");
delete_recursive("/system/priv-app/CleanMaster");
delete_recursive("/system/priv-app/DynamicSystemInstallationService");
delete_recursive("/system/priv-app/GoogleFeedback");
delete_recursive("/system/priv-app/GooglePartnerSetup");
delete_recursive("/system/priv-app/HotwordEnrollmentOKGoogleWCD9340");
delete_recursive("/system/priv-app/HotwordEnrollmentXGoogleWCD9340");
delete_recursive("/system/priv-app/MiMoverGlobal");
delete_recursive("/system/priv-app/MiRecycle");
delete_recursive("/system/priv-app/MiService");
delete_recursive("/system/priv-app/MiShare");
delete_recursive("/system/priv-app/PersonalAssistant");
delete_recursive("/system/priv-app/QuickSearchBox");
delete_recursive("/system/priv-app/Updater");
delete_recursive("/system/priv-app/Velvet");
delete_recursive("/system/priv-app/VpnDialogs");
delete_recursive("/system/priv-app/WellbeingPrebuilt");
delete_recursive("/system/priv-app/YellowPage");
delete_recursive("/system/product/app/GoogleLocationHistory");
delete_recursive("/system/product/app/GoogleTTS");
delete_recursive("/system/product/app/SoundPickerPrebuilt");
delete_recursive("/system/product/app/uceShimService");
delete_recursive("/system/product/app/xdivert");
delete_recursive("/system/product/priv-app/CarrierServices");
delete_recursive("/system/product/priv-app/GoogleAssistant");
delete_recursive("/system/product/priv-app/GoogleFeedback");
delete_recursive("/system/product/priv-app/HotwordEnrollmentOKGoogleHEXAGON");
delete_recursive("/system/product/priv-app/HotwordEnrollmentXGoogleHEXAGON");
delete_recursive("/system/product/priv-app/Launcher3QuickStep");
delete_recursive("/system/product/priv-app/Velvet");
delete_recursive("/system/vendor/app/CneApp");
delete_recursive("/system/vendor/app/aiasst_service");
delete_recursive("/system/vendor/data-app/");
delete_recursive("/system/vendor/data-app/SmartHome");
delete_recursive("/system/vendor/data-app/aiasst_service");
delete_recursive("/system/vendor/data-app/wps-lite");
Kernel Optimization Script:
Code:
#!/system/bin/sh
setenforce 0
set enforce 0
echo 'Y' > /sys/module/sync/parameters/fsync_enabled
sysctl -w net.ipv4.tcp_congestion_control=cubic
#echo '254 255 256' > /sys/devices/platform/kcal_ctrl.0/kcal
#echo '1' > /sys/devices/platform/kcal_ctrl.0/kcal_enable
#echo '290' > /sys/devices/platform/kcal_ctrl.0/kcal_sat
#echo '261' > /sys/devices/platform/kcal_ctrl.0/kcal_val
#echo '264' > /sys/devices/platform/kcal_ctrl.0/kcal_cont
#echo '35' > /sys/devices/platform/kcal_ctrl.0/kcal_min
#echo '0' > /sys/devices/platform/kcal_ctrl.0/kcal_hue
echo 'Y' > /sys/module/wakeup/parameters/enable_timerfd_ws
echo 'Y' > /sys/module/wakeup/parameters/enable_qcom_rx_wakelock_ws
echo 'Y' > /sys/module/wakeup/parameters/enable_netlink_ws
echo 'Y' > /sys/module/wakeup/parameters/enable_ipa_ws
echo 'Y' > /sys/module/wakeup/parameters/enable_wlan_wake_ws
echo 'Y' > /sys/module/wakeup/parameters/enable_wlan_ctrl_wake_ws
echo 'Y' > /sys/module/wakeup/parameters/enable_wlan_rx_wake_ws
echo 'Y' > /sys/module/wakeup/parameters/enable_msm_hsic_ws
echo 'Y' > /sys/module/wakeup/parameters/enable_si_ws
echo 'Y' > /sys/module/wakeup/parameters/enable_smb135x_wake_ws
#echo '0' > /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk
#chmod 666 /sys/module/lowmemorykiller/parameters/minfree
#chown root /sys/module/lowmemorykiller/parameters/minfree
echo '16384,20736,24576,32256,85296,120640' > /sys/module/lowmemorykiller/parameters/minfree
echo '75' > /proc/sys/vm/swappiness
echo '17' > /proc/sys/vm/dirty_ratio
#echo '0' > /sys/kernel/sched/gentle_fair_sleepers
#echo '2830' > /sys/class/timed_output/vibrator/vtg_level
echo '3' > /sys/kernel/power_suspend/power_suspend_mode
echo '1' > /sys/kernel/fast_charge/force_fast_charge
Google Play Services Anti-Wakelock Script:
Code:
#!/system/bin/sh
setenforce 0
powerService.goToSleep(SystemClock.uptimeMillis() + 1);
echo disable_pm_suspend > /sys/power/wake_unlock
android.permission.WAKE_UNLOCK
/sys/power/wake_unlock
killall -9 android.process.media
killall -9 mediaserver
for apk in $(pm list packages -3 | sed 's/package://g' | sort); do
# Analytics
pm disable $apk/com.google.android.gms.analytics.AnalyticsService
pm disable $apk/com.google.android.gms.analytics.AnalyticsJobService
pm disable $apk/com.google.android.gms.analytics.CampaignTrackingService
pm disable $apk/com.google.android.gms.measurement.AppMeasurementService
pm disable $apk/com.google.android.gms.measurement.AppMeasurementJobService
pm disable $apk/com.google.android.gms.analytics.AnalyticsReceiver
pm disable $apk/com.google.android.gms.analytics.CampaignTrackingReceiver
pm disable $apk/com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver
pm disable $apk/com.google.android.gms.measurement.AppMeasurementReceiver
pm disable $apk/com.google.android.gms.measurement.AppMeasurementContentProvider
pm disable $apk/com.crashlytics.android.CrashlyticsInitProvider
# Ads
pm disable $apk/com.google.android.gms.ads.AdActivity
# Firebase
pm disable $apk/com.google.firebase.iid.FirebaseInstanceIdService
done
exit 0
"I don't want to debloat an app that it does"
To fix that, you will need to update the script your self, but it's quite easy.
1 - Download the script on a Windows based PC that has 7zip and notepad++ installed.
2 - Open the script with zip and navigate to: "META-INF\com\google\android"
3 - Extract the file "updater-script"
4 - Edit it with notepad++ and look at the app you wish it would not debloat (for example, Clean Master)
5 - The delete the line that says "delete_recursive" and the app path (ex: delete_recursive("/system/priv-app/CleanMaster"); )
6 - Save the script and push it back to the zip file
Some apps such as maps, Google Assistant and Android Auto may be debloated on the script, but if you install it via the playstore after, the script will not debloat it, as it wont be a system app anymore.
Current version: v10 (05/03/2020)
Seems to work but phone gets a bit laggy sometimes...
mejgs said:
Seems to work but phone gets a bit laggy sometimes...
Click to expand...
Click to collapse
It may be the VM and OOM, i'll take off those "optimizations" on the next release tomorrow.
What TWRP did you use, if you don't mind me asking.
New Build Up!
Lag should stop now that i disable the VM and OOM custom parameters, plus i added CatchLog to uninstall.
Pupet_Master said:
It may be the VM and OOM, i'll take off those "optimizations" on the next release tomorrow.
What TWRP did you use, if you don't mind me asking.
Click to expand...
Click to collapse
I used 4pda's
Pupet_Master said:
Hey Guys, i've made a script to debloat MIUI and to install some Kernel optimizations at the INIT.D folder plus anti Google Play Services Wakelock Script (at INIT.D as well) and full hosts for adblock without any external app.
Now, i may add more things to debloat since this script was optimized for Redmi Note 5 Pro Whyred and even though it work on that device, on the Redmi 4X Santoni and even on a Moto G LTE Peregrine.. on 4PA TWRP it didn't work. I'm still troubleshooting why. Once i figure out another TWRP that allow me to flash it or what i'm doing wrong (since it isn't a script issue, it's a recovery problem) i'll test other system apps to debloat specific from our Mi9t DaVinci.
That being said, i would like you guys to test it, see if it work for you guys and give me a feedback to what TWRP do you guys use/ what version of MIUI you guys debloated.
Usually i use it on mi-globe but it should work for Xiaomi.eu, Global and Chinese ROMs too (both beta and stable).
Instalation:
1 - Reboot in to TWRP after first boot and setup.
2 - Make a nanodroid full system Backup for safety.
3 - Run the script.
4 - Reboot in to system.
5 - Profit.
Download:
https://androidfilehost.com/?fid=1899786940962594365
What will it debloat:
Code:
"/system/app/AnalyticsCore"
"/system/app/BasicDreams"
"/system/app/BuiltInPrintService"
"/system/app/CatchLog"
"/system/app/CloudPrint2"
"/system/app/Email"
"/system/app/GooglePrintRecommendationService"
"/system/app/greenguard"
"/system/app/KSICibaEngine"
"/system/app/Lens"
"/system/app/MarkupGoogle"
"/system/app/MiDrive"
"/system/app/MiuiBugReport"
"/system/app/MiuiDaemon"
"/system/app/MiuiSuperMarket"
"/system/app/PrintRecommendationService"
"/system/app/PrintSpooler"
"/system/app/SoundPickerPrebuilt"
"/system/app/Stk"
"/system/app/YellowPage"
"/system/app/YouDaoEngine"
"/system/data-app/"
"/system/data-app/BaiduIME"
"/system/data-app/cn.wps.moffice_eng"
"/system/data-app/com.eg.android.AlipayGphone"
"/system/data-app/com.taobao.taobao"
"/system/data-app/com.xunmeng.pinduoduo"
"/system/data-app/Email"
"/system/data-app/MiFinance"
"/system/data-app/MiMobileNoti"
"/system/data-app/MiShop"
"/system/data-app/XiaomiSpeechEngine"
"/system/priv-app/BATestApp"
"/system/priv-app/Browser"
"/system/priv-app/GoogleBackupTransport"
"/system/priv-app/GoogleFeedback"
"/system/priv-app/MiRecycle"
"/system/priv-app/MusicFX"
"/system/priv-app/HotwordEnrollmentOKGoogleWCD9340"
"/system/priv-app/HotwordEnrollmentXGoogleWCD9340"
"/system/priv-app/Velvet"
"/system/priv-app/WellbeingPrebuilt"
"/system/priv-app/YellowPage"
"/system/vendor/data-app/"
"/system/vendor/data-app/SmartHome"
"/system/vendor/data-app/wps-lite"
"/system/vendor/data-app/aiasst_service"
"/system/vendor/app/aiasst_service"
"/system/app/lens"
"/vendor/data-app/SmartHome"
"/vendor/data-app/wps-lite"
"/data/app/SmartHome"
"/data/app/wps-lite"
"/data/app/aiasst_service"
Full Hosts by Masik ROM (thank Masik Devs)
Kernel Optimization Script:
Code:
#!/system/bin/sh
setenforce 0
set enforce 0
echo 'Y' > /sys/module/sync/parameters/fsync_enabled
sysctl -w net.ipv4.tcp_congestion_control=westwood
#echo '254 255 256' > /sys/devices/platform/kcal_ctrl.0/kcal
#echo '1' > /sys/devices/platform/kcal_ctrl.0/kcal_enable
#echo '290' > /sys/devices/platform/kcal_ctrl.0/kcal_sat
#echo '261' > /sys/devices/platform/kcal_ctrl.0/kcal_val
#echo '264' > /sys/devices/platform/kcal_ctrl.0/kcal_cont
#echo '35' > /sys/devices/platform/kcal_ctrl.0/kcal_min
#echo '0' > /sys/devices/platform/kcal_ctrl.0/kcal_hue
echo 'Y' > /sys/module/wakeup/parameters/enable_timerfd_ws
echo 'Y' > /sys/module/wakeup/parameters/enable_qcom_rx_wakelock_ws
echo 'Y' > /sys/module/wakeup/parameters/enable_netlink_ws
echo 'Y' > /sys/module/wakeup/parameters/enable_ipa_ws
echo 'Y' > /sys/module/wakeup/parameters/enable_wlan_wake_ws
echo 'Y' > /sys/module/wakeup/parameters/enable_wlan_ctrl_wake_ws
echo 'Y' > /sys/module/wakeup/parameters/enable_wlan_rx_wake_ws
echo 'Y' > /sys/module/wakeup/parameters/enable_msm_hsic_ws
echo 'Y' > /sys/module/wakeup/parameters/enable_si_ws
echo 'Y' > /sys/module/wakeup/parameters/enable_smb135x_wake_ws
#echo '0' > /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk
#chmod 666 /sys/module/lowmemorykiller/parameters/minfree
#chown root /sys/module/lowmemorykiller/parameters/minfree
#echo '19712,22272,36864,58368,65792,108494' > /sys/module/lowmemorykiller/parameters/minfree
#echo '0' > /sys/kernel/sched/gentle_fair_sleepers
#echo '2830' > /sys/class/timed_output/vibrator/vtg_level
echo '3' > /sys/kernel/power_suspend/power_suspend_mode
echo '1' > /sys/kernel/fast_charge/force_fast_charge
Google Play Services Anti-Wakelock Script:
Code:
#!/system/bin/sh
setenforce 0
powerService.goToSleep(SystemClock.uptimeMillis() + 1);
echo disable_pm_suspend > /sys/power/wake_unlock
android.permission.WAKE_UNLOCK
/sys/power/wake_unlock
killall -9 android.process.media
killall -9 mediaserver
for apk in $(pm list packages -3 | sed 's/package://g' | sort); do
# Analytics
pm disable $apk/com.google.android.gms.analytics.AnalyticsService
pm disable $apk/com.google.android.gms.analytics.AnalyticsJobService
pm disable $apk/com.google.android.gms.analytics.CampaignTrackingService
pm disable $apk/com.google.android.gms.measurement.AppMeasurementService
pm disable $apk/com.google.android.gms.measurement.AppMeasurementJobService
pm disable $apk/com.google.android.gms.analytics.AnalyticsReceiver
pm disable $apk/com.google.android.gms.analytics.CampaignTrackingReceiver
pm disable $apk/com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver
pm disable $apk/com.google.android.gms.measurement.AppMeasurementReceiver
pm disable $apk/com.google.android.gms.measurement.AppMeasurementContentProvider
pm disable $apk/com.crashlytics.android.CrashlyticsInitProvider
# Ads
pm disable $apk/com.google.android.gms.ads.AdActivity
# Firebase
pm disable $apk/com.google.firebase.iid.FirebaseInstanceIdService
done
exit 0
Click to expand...
Click to collapse
Seems very nice I will test it. I think it's like L-Speed, NFS, FDE.AI or LKT kernel improvements but for MIUI while You are debloating stuff.
Is it working on MIUI 11?
Ky0sHiR0 said:
Seems very nice I will test it. I think it's like L-Speed, NFS, FDE.AI or LKT kernel improvements but for MIUI while You are debloating stuff.
Is it working on MIUI 11?
Click to expand...
Click to collapse
First, thanks for the feedback guys
Yes, you got it right but it go beyond lkt once se get kcal on our device as i tune the colors too (currently disabled though).
And yes it work on miui11
New Build Up!!
Added these apps on the list to be debloated:
/system/app/XMCloudEngine
/system/app/MiLinkService
Re Enabled the OOM setting for memory Management (report if phone get sluggish or not please, as it should not).
echo '19712,22272,36864,58368,65792,108494' > /sys/module/lowmemorykiller/parameters/minfree
The transitions is getting slower. (EU ROM 10.3.15)
someone tested the script with the latest weekly miui 11, EU 9.9.26 ?
stefano alegnini said:
someone tested the script with the latest weekly miui 11, EU 9.9.26 ?
Click to expand...
Click to collapse
Should work fine as it don't mod the rom, just debloat and add scripts
I'm testing new parameters for ram management and virtual memory. Next new build should be smoother
New Build Up!
Changes on Kernel tuneup:
sysctl -w net.ipv4.tcp_congestion_control=cubic
echo '16384,20736,24576,32256,85296,120640' > /sys/module/lowmemorykiller/parameters/minfree
echo '75' > /proc/sys/vm/swappiness
echo '17' > /proc/sys/vm/dirty_ratio
Successfully installed on EU 9.9.26 everything is ok, let's show the battery statistics in a couple of days, thanks for your work
Pupet_Master said:
Hey Guys, i've made a script to debloat MIUI and to install some Kernel optimizations at the INIT.D folder plus anti Google Play Services Wakelock Script (at INIT.D as well) and full hosts for adblock without any external app.
Now, i may add more things to debloat since this script was optimized for Redmi Note 5 Pro Whyred and even though it work on that device, on the Redmi 4X Santoni and even on a Moto G LTE Peregrine.. on 4PA TWRP it didn't work. I'm still troubleshooting why. Once i figure out another TWRP that allow me to flash it or what i'm doing wrong (since it isn't a script issue, it's a recovery problem) i'll test other system apps to debloat specific from our Mi9t DaVinci.
That being said, i would like you guys to test it, see if it work for you guys and give me a feedback to what TWRP do you guys use/ what version of MIUI you guys debloated.
Usually i use it on mi-globe but it should work for Xiaomi.eu, Global and Chinese ROMs too (both beta and stable).
Instalation:
1 - Reboot in to TWRP after first boot and setup.
2 - Make a nanodroid full system Backup for safety.
3 - Run the script.
4 - Reboot in to system.
5 - Profit.
Download:
https://androidfilehost.com/?fid=1899786940962596493
Click to expand...
Click to collapse
Could you kindly drop a version without the hosts file?
ah.kh.ali1 said:
Could you kindly drop a version without the hosts file?
Click to expand...
Click to collapse
Sure I'll so it.in a couple of hours and I'll quote.you
ah.kh.ali1 said:
Could you kindly drop a version without the hosts file?
Click to expand...
Click to collapse
No hosts build up
https://androidfilehost.com/?fid=1899786940962597127
Pupet_Master said:
No hosts build up
https://androidfilehost.com/?fid=1899786940962597127
Click to expand...
Click to collapse
Thanks Alot.
Just flashed V4. I don't know what you did, but it's much smoother now
What does the no host means? Edit... No need I got it now