FORUMS

[MOD] [A10+, Magisk 20.4+] PK's Tuning Script v5 [2020-05-14]

919 posts
Thanks Meter: 1,101
 
By pkgnex, Senior Member on 2nd May 2020, 02:32 AM
Post Reply Email Thread
Hey Coral / Flame Gang!

First off, I'm glad to be here. I just came from Pixel 2 XL after my phone died from hardware issues and I needed to upgrade!

Anyway, here's a script that I put together for my own use, but still develop occasionally; tuned especially for our Coral / Flame devices.

Enjoy!

The Back-Story:
I helped some good guys out with developing the awesome Franco.Kernel tuning parameters "back in the day" (Franco's Dev Team - you can look us up, the great osm0sis still hosts the original file set - but they won't even run on Android Pie later). What is still applicable to Android 10 is in this file; trimmed and consolidated into a single script, along with some other goodies I've come across since.

Philosophy:
- I don't write untested BS or questionable crap in my scripts. If a given tweak doesn't show an objective improvement in benchmarks or battery life or a subjective improvement in performance that can be turned on or off by running or not running the script in a blind test - it doesn't get added.
- If I do not believe a given tweak is safe to run on everyone's daily driver device, I also won't include it my script, regardless of the benefit.
- This script is biased toward increasing performance - but it takes advantage of battery saving opportunities that don't affect performance. If your preferences are not aligned with this philosophy, I recommend trying xFirefly93's BlackenedMod script (also in this section), which is much more aggressive in trying to increase battery life.

Notes:
- This script is lean and mean, but it's not rocket science.
- I didn't invent anything here. Feel free to use it (or not), distribute, alter, whatever; to your satisfaction, giving credit for redistribution only to "Franco's Dev Team", and maybe me if you're feeling generous.
- I have verified it works well on my personal Pixel 4 XL, and is compatible with all Android versions, Kernels, and Magisk versions applicable to the device.
- It won't make your phone run any worse, and it should make it feel a bit "snappier", but YMMV.
- Most benchmark scores improve marginally (1% - 4%) on my device with stock or EX kernel. Again, YMMV.
- I do not plan to do heavy maintenance on this, but I will keep it up to date so it at least safely runs on the Pixel 4 / 4 XL as long as I own one. I will post updates with a minimal change log (it's a script, you can read it!). If I stumble across something that helps the community, I'll share it!

Disclaimer:
I can't see how this could possibly cause irreparable harm to any android device on which it is run.
However, I suppose untested configurations may (rarely) have slow-downs, reboots, or other effects.
REGARDLESS, it is offered as-is with no warranty, and you choose to run this at your own risk.
If you do encounter issues, let me know and stop using the script. I may ask you for further help with debugging.

Requirements:
Root
BusyBox installation (I recommend the Magisk module by osm0sis)
Knowledge of how to execute a linux script and/or where to place it / allow permissions to run on boot

Usage:
Download attachment to your device
Place file in /data/adb/service.d (for Magisk-rooted devices, using Magisk 19.4+)
remove ".txt" extension (leaving the .sh extension)
Ensure permissions are correct (0755)
Reboot and wait 2 minutes

NOTE: The script will generate a text file called "pksp4_script_result" in the base of your "external storage" directory (/storage/emulated/0). This file will have a time/date of last execution (it will over-write each time the script is run) as well as either "Success!" or "Failure..." indicating if the script completed.

Credits:
Franco's Dev Team, esp. osm0sis
Others as noted in the script file header
Attached Files
File Type: txt 94pksp4v1.sh.txt - [Click for QR Code] (4.3 KB, 214 views)
File Type: txt 94pksp4v2.sh.txt - [Click for QR Code] (4.6 KB, 124 views)
File Type: txt 94pksp4v3.sh.txt - [Click for QR Code] (4.9 KB, 104 views)
File Type: txt 94pksp4v4.sh.txt - [Click for QR Code] (5.0 KB, 216 views)
File Type: txt 94pksp4v5.sh.txt - [Click for QR Code] (4.3 KB, 156 views)
The Following 22 Users Say Thank You to pkgnex For This Useful Post: [ View ] Gift pkgnex Ad-Free
2nd May 2020, 02:33 AM |#2  
OP Senior Member
Thanks Meter: 1,101
 
More
Change Log
V5:
- A minor kernel overhead reduction from scheduler statistics
- Force CFQ as scheduler (just in case non-stock kernel isn't already set that way)
- Two CFQ tweaks, one that eliminated backward seeking penalty (makes no sense on non-rotational storage) and one that my testing showed sped up throughput and in theory should also reduce latency (so a true win-win!).

V4:
- Reverted foreground app schedtune boost, swappiness, vfs_cache_pressure, and dirty_ratio to stock
- Reverted IO scheduler to CFQ
- Removed wakelock blocking - verified no / minimal effect on deep sleep (I got 0.12%/hr idle drain overnight)
(for all of the above, thanks to @Freak07 for the advice / education!)
- Re-verified tx_queue_len (512) and tcp_congestion_control (westwood+) are optimized for WiFi and LTE networks

V3:
- Remove fstrim commands for /data and /cache since device is F2FS and fstrim doesn't apply (thanks to @woundman for pointing this out to me)
- Changed to Deadline scheduler with Franco Dev Team tunables - I just verified still benchmarks better after all these years
- If your kernel does not have Deadline available (e.g. stock kernel), the script will still keep you on Noop, as before.

V2:
- Reduce schedutil downrate limit to increase battery life.
- Block some safe wakelocks to increase battery life.
- Oh yeah, and a magic trick to turn off vm dirty write back timer (it still happens, just memory based and not every 5 seconds), to also increase battery life.

V1:
- Initial Pixel-4/XL release.
The Following 4 Users Say Thank You to pkgnex For This Useful Post: [ View ] Gift pkgnex Ad-Free
2nd May 2020, 06:54 AM |#3  
Senior Member
New Orleans
Thanks Meter: 34
 
More
ooh interesting! would this play nice with the blackened mod found in this forum?
2nd May 2020, 08:56 AM |#4  
xFirefly93's Avatar
Senior Member
Flag Timrå
Thanks Meter: 2,290
 
Donate to Me
More
Quote:
Originally Posted by pwnsicle

ooh interesting! would this play nice with the blackened mod found in this forum?

I wouldn't recommend you to mix stuff together because it can introduce values that conflicts with each other to some possible very random extent. Though it's your device - try it out and report back with accurate feedback on how it does perform.

2nd May 2020, 09:53 AM |#5  
MarcoG:'s Avatar
Senior Member
Flag Herford Germany(NRW)
Thanks Meter: 2,427
 
More
I use this Script with fsociety Kernel 1.27 and it works fine.

Thx for it

Gesendet von meinem Pixel 4 XL mit Tapatalk
The Following User Says Thank You to MarcoG: For This Useful Post: [ View ] Gift MarcoG: Ad-Free
2nd May 2020, 10:15 AM |#6  
Senior Member
Flag Philadelphia
Thanks Meter: 986
 
More
Welcome to the Pixel 4 XL community. Also coming from the Pixel 2 XL as well, looking forward to testing this out. 😎
The Following 2 Users Say Thank You to Curiousn00b For This Useful Post: [ View ] Gift Curiousn00b Ad-Free
2nd May 2020, 01:13 PM |#7  
2WildFirE's Avatar
Senior Member
Flag Borken (Hessen)
Thanks Meter: 2,655
 
Donate to Me
More
I'm on flame using this script and seems to work fine here.
It feels a bit snappier.
Thanks for your work.
The Following 2 Users Say Thank You to 2WildFirE For This Useful Post: [ View ] Gift 2WildFirE Ad-Free
2nd May 2020, 08:48 PM |#8  
CyberpodS2's Avatar
Senior Member
Flag NE Pennsylvania Boonies
Thanks Meter: 1,232
 
More
Welcome brother... Nice to see another Taimen dev jump into the pool here!
The Following User Says Thank You to CyberpodS2 For This Useful Post: [ View ] Gift CyberpodS2 Ad-Free
3rd May 2020, 12:02 AM |#9  
Member
Thanks Meter: 8
 
More
I'm on p4 with kiri, so good so far, let's see how will this improve battery life, thanks
The Following User Says Thank You to bl4dy_pt For This Useful Post: [ View ] Gift bl4dy_pt Ad-Free
3rd May 2020, 09:33 PM |#11  
chopt51's Avatar
Senior Member
Thanks Meter: 371
 
More
Stock ROM only? Or will it work in pixeldust too.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes