ClusterTune

Project Url: AurelioB/ClusterTune
Introduction: ClusterTune is an Android utility for tuning CPU frequency limits on supported handheld devices. It lets you adjust CPU clusters, save performance profiles, and access quick controls from an Android Quick Settings tile.
More: Author   ReportBugs   
Tags:

ClusterTune

GitHub Downloads (all assets, all releases) GitHub Release

Support me on Ko-fi

ClusterTune controls CPU frequency ranges, GPU frequency limits, and supported frequency governors on Android handhelds.

[!WARNING] Changing CPU or GPU limits can affect stability, performance, temperature, and battery life. Start with tested values and use Stock to restore normal limits.

[!NOTE] Note for AYN users

The AYN Thor performance overlay can incorrectly display 3.19 GHz when the CPU drops below 1 GHz. ClusterTune 1.3.0 and later keep lower frequencies available under light load, making this display bug more noticeable. Check CPU-Z’s individual CPU readings before assuming underclocking has failed. See issue #32 for details.

Lower CPU limits can reduce power use, heat, fan noise, and battery drain. Games limited by the GPU may also gain thermal or power headroom. Frequency limits do not undervolt the CPU. Profiles can also select a governor when the device exposes that option; leaving it at Default keeps the system governor.

Features

  • Support for rooted Android 12+ devices through su
  • A two-handle slider for each CPU cluster, with an optional minimum and a maximum
  • Maximum frequency controls for supported GPUs
  • Optional CPU and GPU governors, using the choices reported by the device
  • Profiles that can be created, reordered, imported, and exported
  • Bundled presets and a Stock profile for supported processors
  • Automatic app profiles using saved profiles or custom frequency values across one or more displays
  • Per-app Auto Tune targets in a dedicated overlay tab, with a slider capped to the app display's current refresh mode, using SurfaceFlinger frame statistics and device load to lower available CPU/GPU ceilings safely
  • An Android API and ADB commands to list/apply profiles, read current limits, and set supported CPU/GPU controls
  • Quick Settings access to pick, tune, or cycle profiles
  • A left edge gesture that opens profile controls over the current app
  • Optional profile automation after boot and while asleep
  • A history of automatic profile switches

Compatibility

Version 1.0 adds support for rooted devices, expanding compatibility beyond AYN and Retroid hardware.

Method Devices
PServer AYN and Retroid devices with the built in PServer service, except Odin 2 Mini
Root Any Android 12+ device with a working su shell

Detection tries PServer first, then Root. The Odin 2 Mini must use Root. If neither method is available, tuning cannot be applied.

App detection uses Android task-change notifications inside the same privileged service. Automatic profiles, Auto Tune, the HUD, and app pickers do not require Accessibility or Usage Access. Detection checks visible apps after events, startup, reconnect, and screen/display changes; it does not continuously poll apps. Recent-app sorting reads the past week's history through PServer or Root when the app list is loaded or refreshed. See the implementation and validation.

Install

Download v1.3.0 and install ClusterTune-v1.3.0.apk.

Android may ask the browser or file manager for permission to install the APK. Install downloaded updates is separate and optional. It is only needed for updates installed from inside the app.

Setup

Execution method detection runs on first launch. Approve the su request if Root is selected. Any missing access is listed with a shortcut to the correct Android settings page.

Access Purpose
Display over other apps Opens profile controls over the current app.
Notifications Keeps app profile and sleep automation active.

Background features share one persistent ClusterTune is tuning your clusters notification. It remains while app detection, an overlay, the HUD, sleep monitoring, or boot restoration is active.

History records profile changes and the events that explain them: relevant app switches, sleep/wake, boot, Auto Tune start/stop, service connections, and failures. It uses the existing history entry limit, suppresses repeated identical failures until recovery, and adds no monitoring timer or extra hardware reads. Share exports the retained entries as a .txt file through Android's share sheet; the export is created only when requested.

Other apps, scripts and automations can control ClusterTune through its external API, documented in the wiki: an overview, every method, the command line, the Tasker plugin and the Java library. Like a root manager, ClusterTune asks "Allow App to control ClusterTune?" the first time an app, an automation app or ADB uses it, and remembers the answer under App access in Settings, where each can be allowed, denied or removed (asked again). Over ADB, the built-in command line takes commands such as clustertune profile apply medium or clustertune tuning set cpu6.max=2.4GHz gpu.max=600 (run as adb shell sh /sdcard/Android/data/com.aure.clustertune/files/clustertune …) and is removed together with the app. Profiles can be named, and frequencies are given in MHz (or with a unit) and snap to the nearest supported step. Client developers can copy the dependency-free contract file.

Choose a bundled profile or create one. Drag either handle on a CPU slider to set its frequency range. Move the minimum handle fully left for min: Stock, which keeps the existing automatic floor behavior; move it right to choose an explicit minimum. Move the maximum handle fully right for max: Stock. The editor shows min above max, and profile cards show both ends when a minimum is set. The GPU keeps its maximum slider.

CPU and GPU governor menus appear only where the device reports available governors. Default releases ClusterTune's governor override and restores the governor it found before that override, unless another privileged tool has since changed it. Ranges and governors are saved in profiles, custom app assignments, and profile exports, and follow sleep/wake and boot restoration. Older profiles keep Stock minimums (the existing automatic floor behavior) and default governors. While an assigned app is visible, a minimum left at Stock or a governor left at Default in its profile or custom values keeps the normal profile's minimum and governor; an inherited minimum above the app's maximum is not applied.

Stock restores the device's normal maximum frequencies, releases explicit CPU minimums, and restores owned governor overrides. See the frequency range implementation and emulator checks.

On compatible devices, manual CPU underclocks also protect the selected minimum frequency (or the lowest supported floor in Auto mode) against system services overwriting it. Protection requires a root-owned privileged host, supported CPU frequency controls, and access to manage their permissions; it is not restricted by device model or firmware fingerprint. Returning a cluster to a Stock maximum with an automatic minimum releases minimum write protection; an explicit minimum remains protected even at the Stock maximum. The system can then reapply its chosen minimum; devices without a service that does this retain the lowest supported floor until it is changed. ClusterTune does not replay a captured effective minimum, which could include a temporary boost. Closing the main window keeps the background services and protection active. Protection is released if the app process actually ends or the privileged host is explicitly stopped. If the privileged service is forcibly killed, its replacement recovers the original permissions when ClusterTune reconnects; reboot also resets them. Independent system boosts can still raise the effective minimum. Physical validation so far used an AYN Thor; see the implementation and device test results.

Fixed profiles have no background recovery poll. If firmware restores an owned minimum node's original writable permissions, the next intentional profile apply can reacquire it. Auto Tune samples FPS and applies clock changes in one loop only while enabled and running. Its privileged host keeps a separate session timeout for stalled-client cleanup; no recurring watchdog or timer thread runs while the host is idle or only a fixed profile is active. See the permission repair and session timeout checks.

Auto Tune is experimental and disabled by default. Turn on Enable autotune settings (experimental) in Settings to show the Auto Tune tab in app-profile dialogs and the overlay, and the Performance HUD option for the Quick Settings tile. Turning it off hides both options, closes an open HUD, stops active automatic tuning with the usual frequency restoration, and keeps saved Auto Tune assignments inactive until re-enabled. If the tile was set to the HUD, it opens the quick tuner while the option is disabled; re-enabling restores the saved HUD choice.

For an app profile, open the overlay's Auto Tune tab and use the target slider to let ClusterTune search for lower maximum frequencies while that app owns the focused window. The slider follows the current refresh mode of the display hosting the app, so a device switching between 60 and 120 Hz never asks Auto Tune to chase frames the panel cannot present. Saved targets accept any positive FPS value for portability; at runtime ClusterTune uses the lower of that value and the app display's current refresh rate without rewriting the saved preference. The target is a performance floor, not a frame-rate limiter; for best efficiency, set the app's own frame-rate cap to the same value.

Auto Tune establishes the saved normal profile's minimums and governors once when needed before starting. Its FPS loop writes only maximum-frequency ceilings and respects the effective minimums. On a confidently identified three-cluster topology it leaves the efficiency CPU policy at its assigned baseline and tunes the performance, prime, and GPU domains; ambiguous and one/two-policy devices keep every discovered CPU policy available. The FPS loop does not adjust minimum frequencies or governors. If an OEM performance mode holds a minimum above the selected ceiling, that domain may temporarily run pinned at the ceiling while it is busy. ClusterTune never requests a ceiling above the saved normal profile and restores only the maximum ceilings and permissions it still owns when the session ends. If an OEM restores a ceiling upward to a recognized hardware Stock value, Auto Tune stays active and its next normal tuning step can apply the complete adaptive envelope again; a lower, unknown, or permission-changing external override still stops the session. SurfaceFlinger frame statistics are required. Auto Tune bases its decisions on frame performance and CPU/GPU utilization; temperature readings remain observational, while the device's own thermal management controls protection and throttling.

CPU and GPU ceilings are device-wide. In multi-window or multi-display use, the focused Auto Tune app owns the adaptive session; fixed assignments on other visible displays do not constrain that session. Applying a profile manually pauses Auto Tune for the current foreground ownership; it can start again after the focused app or its assignment changes.

Auto Tune waits through static menus or loading screens that produce no fresh frames and resumes when rendering returns. It raises ceilings promptly when performance falls short, while checking reductions for regressions. Quick Settings shows the active profile or Auto Tune FPS target.

Screenshots

Main app Profile editor
Main profiles view Profile editor
Quick tuner overlay Settings
Quick tuner and profile picker Settings view

Troubleshooting and support

  • No execution method found: confirm that PServer is available or that the root manager provides su, then run detection again from Settings.
  • Profile controls missing: check Display over other apps.
  • Assigned app not switching profiles: confirm its assignment, the selected PServer/Root execution method, and Notifications.
  • App automation needs attention: app detection could not connect to the privileged service. ClusterTune retries automatically. Check the execution method and background activity restrictions if it continues. History records connection and failure events; use Share to include them with an issue report.
  • Auto Tune stops while an app is open: check the Auto Tune status card. Some vendor builds do not expose usable SurfaceFlinger frame statistics or GPU telemetry; include the reported frame backend and error when filing an issue.

For help, open a GitHub issue with your device model, Android version, execution method, and the relevant log details. Please do not include private data.

Build and test

Building uses the configured JDK 21 daemon toolchain and Android SDK 34 (the app targets Java 17 bytecode):

./gradlew :app:testDebugUnitTest
./gradlew :app:lintDebug
./gradlew :app:assembleDebug

The debug APK is written to app/build/outputs/apk/debug/.

The separate letter test apps provide A, B, C, and D on black backgrounds for repeatable app-switching and two-screen tests. They are not included in ClusterTune. See the physical-device test scenarios and results.

License and attribution

ClusterTune is distributed under the MIT License. Third-party libraries, the bundled Material Symbols font, and the Gradle wrapper retain their own licenses; see third-party notices. License texts and notices are also included in the APK under assets/licenses/. Dependency notice resources, when supplied, are retained in META-INF/.

Earlier revisions were distributed under GPLv2 and used RootExec code from O2P Tweaks by FeralAI, originally from jdsp4rp5 by kokoko3k. That implementation has been replaced with a launch-only PServer client using the documented firmware protocol. The license change applies to this revision onward; earlier releases and historical source revisions retain their original licensing.

Thanks to Mau0x80 for contributing and testing the QCS8550 Small Underclock frequency values.

The project was inspired by the Odin 3 CPU Underclock scripts and the original idea shared by Reddit users u/twoohfive205 and u/JoaozaoS.

Unless explicitly stated otherwise, contributions submitted for inclusion in ClusterTune are offered under the project's MIT License. Preserve the license and attribution of any third-party material included in a contribution.

AI assistance disclosure

AI assistance was used while building this project. I reviewed the code throughout development and understand how the app works and what it does.

Apps
About Me
GitHub: Trinea
Facebook: Dev Tools
AI Daily Digest