Releases: JoshuaDoes/ptune
v1.6.1: Pixel 10 experiment!
Donations
All donations are appreciated and help me stay awake at night to work on this more. Even if it's not much, it helps more than not in the long run! You can even become a sponsor of me if you're okay with a recurring monthly charge.
Still not v2, yet, but wow are we getting closer! This is a massive update, but due to unfortunate circumstances the device pool has been reduced to only supporting the new Pixel 10 series of devices. The new v2 update will be device-agnostic and even agnostic to the running Android version, so don't worry for too long if you feel you're missing out!
install:
- Add support for Pixel 10 series
- Drop support for Pixel 6 to 9 series (TEMPORARY UNTIL V2)
- Drop support for Android 15
- Support automatic detection of init_boot as patch target when available next to boot
init:
- Update ptune.rc init service patches to target Pixel 10 series (specifically BD3A.250721.001.E1)
service:
- Lock touched devfs/procfs/sysfs nodes to prevent libperfmgr from writing back to them
- Support tuning the PowerVR GPU scheduler's rate of frequency change
- Expand support for vendor_sched to ensure applied settings, especially for laguna support
- Max out the available DVFS headrooms
- Unlock deeper minimum frequencies for both the CPU (all clusters: 268/177/177/266) and GPU
- Further tune blocksched tunables
- Raise tracked layer count by HWC from 3 to 7 (expanded to fit the 5 used, needs benchmarking)
- Disable the 60Hz frame rate limit for games automatically without requiring manual toggling of dev options
- Fix bootcomplete check to allow manual service runs post-boot
uninstall:
- Update to support automatic init_boot detection
v1.6.0: Android 16, ZRAM, ...
Still not v2 yet... but we're getting closer! This build is intended to maintain compatibility with stock public A16 builds from Google. It also employs a number of other changes, upon which further improvements to overall system stability and other minor adjustments have been made to enhance the user experience.
install:
- Support Android 16 initial release (public stable)
- Continue to support Android 15 (post-November 2024) until further notice
- Support Pixel 9a
- Support Pixel 10 series
- Support Pixel 11 series
- Support Pixel 12 series (with no known codename for 12a, alas
slowltexxas temp) - Stop symlinking service script into Magisk service.d directory, it actually runs fine now from only the module's directory (possibly an old bug in Magisk?)
init:
- Introduce
task_profiles ProcessCapacityMax MaxPerformanceto all patched services - Support 32-bit Zygote on 64-bit systems when present (still no support for 32-bit only systems)
- Support HWC 2.4 for legacy Tensor
- Support Google
radioext - Add missing
cameraserverpatches - Add missing bootloop protection for
keystore2
service:
- Support adjusting size of ZRAM block device
zram0, now changed to be total physical RAM - 1GB (i.e. Pixel 6 Pro with 12GB will now have 11GB of zram, effectively creating 23GB of RAM under lz44eh's max compression ratio of 2x, your mileage may vary) - Drop Pixel scheduler frequency back down to 120Hz
- Allow ZRAM to reach 99% before triggering LMKD (Low Memory Killer Daemon)
- Enable support for transparent huge pages (THP) in the kernel
- Drop swappiness from 1 to 0
- Drop VFS cache pressure from 5 to 1
- Tell SurfaceFlinger to sample regions at 120Hz instead of 240Hz like before
- Adjust all schedgroups to max out their uclamps
- Adjust all cpusets (except for camera sets) to run on all cores
- Read from
/dev/cpuset/cpusto obtain max core range for cpusets running on all cores (fixes the idle 9th core on P8 series) - Fix
camera-daemoncpuset to use all cores (like stock) instead of only little - Log all ptune actions under
/cache/ptune.log(alternatively/data/cache/ptune.logif your device does not bind the cache folder anymore) - Handle execution flow all from the service context, no need for a post-fs-data script
Donations
All donations are appreciated and help me stay awake at night to work on this more. Even if it's not much, it helps more than not in the long run! You can even become a sponsor of me if you're okay with a recurring monthly charge.
v1.5.0: That was kinda important...
Still not v2 yet, but you're gonna want this one. My dev environment made it hard to realize that the Pixels start SurfaceFlinger earlier in the boot chain for a smoother transition to the boot animation earlier on, earlier in relation to when Magisk runs my post-fs-data service. The temporary fix for now is to restart SurfaceFlinger, which gives about a 4 second increase in boot time running on my Pixel 6 Pro. The intended future fix is to set the SF props earlier in the init process while still overriding the values set by the ROM, but with my new job I need some more time before I can sort this out.
service:
- Restart SurfaceFlinger after changing its props
- Change foreground_window group (hOS exclusive) from all cores to little and mid cores (as for gs101 layout)
- Change foreground group from little and mid cores to all cores (as for gs101 layout)
I make mention of the gs101 layout, as with the continued delays of the v2 release we are still operating on the basis of this layout, as it's the only device I have available to test. Once v2 is ready, the core layouts will be appropriately defined for my "PowerPulse" service to calculate the correct cores to assign to each group according to my rule definitions, with user customizability via an app. Until then, I apologize 🫠
This release also drops support for Android 14, as I don't believe that it works anymore after the fixes required for the November security patch on Android 15. Again, nearly all versions of Android should be supported once v2 is ready to roll out, so I don't consider this to be a setback at the moment d:
v1.4.0: Optimize, optimize, optimize...
We still aren't ready for v2, but we're getting closer!
init:
- Add support for Camera Provider (vendor.camera-provider-2-7-google)
- Add support for Virtual Camera (virtual_camera)
service:
- Set async_depth to 100 and nr_requests to 16384 on all block devices
- Set task_spreading on vendor scheduler groups pinned to little cluster
- Decrease adpf_rampup_multiplier from 2 to 1
- Set scheduler latency to precise 240Hz instead of imprecise 120Hz, allowing up to 240 frequency changes per second (2 per 120Hz frame, 4 per 60Hz frame)
- Disable the reduction of idle preferences
- Disable the 5ms delay before reducing scheduler frequencies
- Allow swap to reach 97% instead of the prior 95% before triggering the low memory killer
- Fix setting of utilization threshold for vendor scheduler
New vendor scheduler group parameters:
schedgroup bg 0 158 0 1 1 #0 158
schedgroup cam 0 1024 0 0 0 #0 1024 (?¿?)
schedgroup cam_power 0 1024 0 0 0 #0 1024 (?¿?)
schedgroup dex2oat 0 1024 0 1 0 #0 1024 (?¿?)
schedgroup fg 0 490 0 1 0 #0 490
schedgroup fg_wi 0 1024 0 1 0 #0 757 (?¿?)
schedgroup nnapi 0 1024 0 1 0 #0 1024 (?¿?)
schedgroup ota 0 1024 0 1 0 #0 1024 (?¿?)
schedgroup rt 0 158 0 1 1 #0 158
schedgroup sf 0 158 0 1 1 #0 490 (?¿?)
schedgroup sys 0 1024 0 1 0 #0 490 (?¿?)
schedgroup sys_bg 0 158 0 1 1 #0 158
schedgroup ta 0 1024 0 1 0 #0 1024
New cpuset parameters:
cpuset background 0-3 #0-3
cpuset camera-daemon 0-7 #0-7 (?¿?)
cpuset camera-daemon-high-group 6-7 #0-7 (?¿?)
cpuset camera-daemon-mid-group 4-5 #0-7 (?¿?)
cpuset camera-daemon-mid-high-group 4-7 #0-7 (?¿?)
cpuset foreground 0-5 #0-5
cpuset foreground_window 0-7 #0-6
cpuset restricted 0-3 #0-3
cpuset system 0-7 #0-7 (custom, !sys)
cpuset system-background 0-3 #0-3
cpuset top-app 0-7 #0-7
v1.3.0: December 2024 hOS support
Fixes support for hOS December 2024. Your mileage may vary. May break on November 2024 and earlier versions, won't test. May break on many other ROMs, won't fix until v2.0.0. All that remains are bugfixes until that update.
init:
- Drop hardcoded Zygote32 definition (not used on Pixel)
- Add support for mediametrics
- Fix groups for audioserver
- Drop sockets from surfaceflinger
- Fix groups and drop accidental extra lines for EdgeTPU definition
- Migrate gralloc from V1 to V2
- Set ioprio rt 4 for all services
service:
- Schedule child processes to run first (again, just for now?)
- Revert blocksched to use mq-deadline (Pixel only?)
- Old (run on big | should idle | group):
1 | 0 | cam
0 | 1 | fg
1 | 1 | rt
1 | 1 | sys
0 | 1 | ta - New (run on big | should idle | group):
0 | 0 | cam
1 | 1 | fg
1 | 1 | fg_wi
0 | 1 | rt
0 | 0 | sys
1 | 0 | ta - Comment out logcat logger, useful to leave in for debugging
v1.2.1: Zzzzzzz...
Small update to prefer idle for many tasks.
v1.2.0: HOLY SHIT
This is a rather massive update. But it's not the major update that I've been promising. This is a major bugfix and a few sneak peeks at what's to come with the next update!
- Fix multiple broken service assignment to system cpuset
- Nuke SurfaceFlinger frame dropping, no but for real
- Drop the realtime priority level of some services
- Prefer many less scheduler groups to desire big
- Temporarily drop non-existent support for cpuctl/stune
If you haven't yet, go join the Telegram support channel and report on how your device is doing! I need to know, especially after your device settles into this update after a few days.
v1.1.4: MEMORY PRESSURE‼️‼️‼️‼️😤😤😤😤
Allow swap to reach 99% before triggering low memory killer.
v1.1.3: Service hotfix
Hotfix to allow the service to run properly in post-fs-data.
v1.1.2: SwapBeGone
Yet another small update, this time we signal to the Android userspace low memory killer daemon (also known as LMKD, or LMK) that swap is allowed to grow to 100% usage without triggering low memory checks.
This could be dangerous! To test properly, please try using complex apps, and even multiple apps at once. I have 12GB in the Pixel 6 Pro, but this is nowhere near universal nor the popular option for most casual users.