Repository navigation
API Methods
Every method of API version 1. Names, replies, errors and the settings syntax are explained in the API overview. Examples show the command line (clustertune …, run through adb shell sh /sdcard/Android/data/com.aure.clustertune/files/clustertune) and an app call; content call and the plugin take the same method and argument.
Example values come from an AYN Odin 3 (CPU policies 0 and 6, Adreno GPU). Yours differ: read them from device.get.
| Method | Shortcut | Argument | Changes something |
|---|---|---|---|
state.get |
state |
— | |
tuning.get |
tuning |
— | |
tuning.set |
settings | yes | |
profile.list |
profile |
— | |
profile.apply |
profile name or ID | yes | |
app.list |
app |
— | |
app.set |
package and profile, settings or Auto Tune target | yes | |
app.clear |
package | yes | |
device.get |
device |
— | |
api.info |
api |
— |
Methods that read live or saved CPU/GPU values (state.get, tuning.get) and all CPU/GPU changes fail with unavailable while the privileged host cannot be used; profile.list and device.get still answer with what they can, plus available: false.
What is applied right now, and who applied it. Shortcut: state.
clustertune statecontentResolver.call(uri, "state.get", null, null)| Field | Meaning |
|---|---|
profile |
{id, name} when the live values match a profile; null for custom values or while Auto Tune is active |
execution_method |
pserver, root or null |
cpu[] |
Per policy: id, effective min_khz, max_khz and governor, plus requested_min_khz and requested_governor, the overrides this ClusterTune process last applied (null after ClusterTune restarts; use tuning.get for the saved request) |
gpu |
max_hz, governor, requested_governor; null without GPU tuning |
effective |
Who applied the settings: source (normal, app, combined, sleep, manual or stock), id, name, contributing packages; null before ClusterTune records one |
auto_tune |
enabled (the experimental setting), active, target_fps, the tuned package while active, and diagnostics from the latest session: status, reason, measured_fps, frame_backend, message
|
app_detection |
connected, and the last connection error. Assignments and Auto Tune act only while connected |
These are frequency limits, not instantaneous clock speeds. Firmware boosts can hold the effective minimum above the requested one. Unreadable values are null.
{
"profile": {"id": "bundled_cq8725s_medium", "name": "Medium Underclock"},
"execution_method": "pserver",
"cpu": [
{"id": 0, "min_khz": 1996800, "max_khz": 2227200, "governor": "walt", "requested_min_khz": null, "requested_governor": null},
{"id": 6, "min_khz": 1017600, "max_khz": 2246400, "governor": "walt", "requested_min_khz": null, "requested_governor": null}
],
"gpu": {"max_hz": 1100000000, "governor": "msm-adreno-tz", "requested_governor": null},
"effective": {"source": "normal", "id": "bundled_cq8725s_medium", "name": "Medium Underclock", "packages": []},
"auto_tune": {"enabled": false, "active": false, "target_fps": null, "package": null, "status": null, "reason": null,
"measured_fps": null, "frame_backend": null, "message": null},
"app_detection": {"connected": true, "error": null}
}The saved settings ClusterTune applies and restores after app assignments, the sleep profile and Auto Tune, and their revision. Shortcut: tuning.
clustertune tuningcontentResolver.call(uri, "tuning.get", null, null)| Field | Meaning |
|---|---|
revision |
Identifies these saved settings; pass it as if_revision for a conditional write
|
profile |
{id, name} when the tuning came from a profile; null for custom values |
cpu[] |
Per policy: id, min_khz (null: Stock minimum), max_khz, governor (null: Default) |
gpu |
max_hz, governor; null without GPU tuning |
Values are resolved exactly as ClusterTune's own restores resolve them: missing or invalid saved settings read as Stock, and an unset GPU value as the Stock GPU maximum.
{
"revision": "7e5f24cdc5c80ef4",
"profile": {"id": "bundled_cq8725s_medium", "name": "Medium Underclock"},
"cpu": [
{"id": 0, "min_khz": null, "max_khz": 2227200, "governor": null},
{"id": 6, "min_khz": null, "max_khz": 2246400, "governor": null}
],
"gpu": {"max_hz": 1100000000, "governor": null}
}Changes part of the saved tuning and applies it. Settings not mentioned keep their saved values. The argument uses the short settings syntax or JSON. Extra: if_revision.
clustertune tuning set cpu6.max=2.4GHz gpu.max=600
clustertune tuning set cpu.gov=schedutil
clustertune tuning set cpu0.min=1GHz cpu0.max=stock
clustertune tuning set cpu6.max=2438.4 --if-revision 7e5f24cdc5c80ef4contentResolver.call(uri, "tuning.set", "cpu6.max=2.4GHz gpu.max=600", null)
contentResolver.call(uri, "tuning.set", """{"cpu":[{"id":6,"max_khz":2246400}]}""", null)It changes the saved tuning, not whatever happens to be live: building on temporary Auto Tune ceilings or an app override would save those temporary values. A change preempts active Auto Tune and is saved for later restores; it does not create a profile or disable app/sleep automation.
| Field | Meaning |
|---|---|
applied |
true |
profile |
null (the tuning now holds custom values) |
cpu[] |
{id, max_khz} per policy, read back and verified by the host |
gpu |
{max_hz} read back, or null |
revision |
The new saved revision |
adjusted |
Present when a short-form value was snapped to a supported step: setting, requested, applied_khz or applied_hz
|
{
"applied": true, "profile": null,
"cpu": [{"id": 0, "max_khz": 2227200}, {"id": 6, "max_khz": 2246400}],
"gpu": {"max_hz": 525000000},
"revision": "0ef8bb99a0bc1aca",
"adjusted": [
{"setting": "cpu6.max", "requested": "2.4GHz", "applied_khz": 2246400},
{"setting": "gpu.max", "requested": "600", "applied_hz": 525000000}
]
}Errors: invalid_argument (syntax, unknown policy or governor, minimum above maximum…), unsupported (GPU setting without GPU tuning), conflict, apply_failed, superseded, persistence_failed, unavailable.
All profiles in the app's order, including Stock when CPU policies are known. Shortcut: profile.
clustertune profilecontentResolver.call(uri, "profile.list", null, null)| Field | Meaning |
|---|---|
available, unavailable_reason, execution_method
|
Whether tuning works right now, and why not |
profiles[] |
id, name, source (user, bundled or virtual for Stock), cpu[] with id/min_khz/max_khz/governor, gpu with max_hz/governor
|
In a profile, a null minimum means Stock, a null governor Default, and a null GPU maximum leaves the GPU maximum unchanged.
{
"available": true, "unavailable_reason": null, "execution_method": "pserver",
"profiles": [
{"id": "bundled_cq8725s_medium", "name": "Medium Underclock", "source": "bundled",
"cpu": [{"id": 0, "min_khz": null, "max_khz": 2227200, "governor": null},
{"id": 6, "min_khz": null, "max_khz": 2246400, "governor": null}],
"gpu": {"max_hz": 1100000000, "governor": null}},
{"id": "virtual_stock", "name": "Stock", "source": "virtual",
"cpu": [{"id": 0, "min_khz": null, "max_khz": 3532800, "governor": null},
{"id": 6, "min_khz": null, "max_khz": 4320000, "governor": null}],
"gpu": {"max_hz": 1100000000, "governor": null}}
]
}Applies a profile and saves it as the tuning. The argument is a profile ID or name. Extra: if_revision.
clustertune profile apply medium
clustertune profile apply "Large Underclock"
clustertune profile apply stock
clustertune profile apply bundled_cq8725s_small --if-revision 7e5f24cdc5c80ef4contentResolver.call(uri, "profile.apply", "medium", null)The reply has the same fields as tuning.set, with profile set to {id, name} and no adjusted. Applying a profile applies all its declared values; values it does not declare return to Stock/Default.
Errors: profile_not_found, ambiguous_profile (with matches), unsupported (the profile's own values are not supported on this device), conflict, apply_failed, superseded, persistence_failed, unavailable.
Per-app assignments. Shortcut: app.
clustertune appcontentResolver.call(uri, "app.list", null, null)| Field | Meaning |
|---|---|
auto_tune_enabled |
The experimental Auto Tune setting |
app_detection |
connected, error
|
assignments[] |
package, label, type (profile, custom or auto_tune), profile ({id, name}), custom (cpu[], gpu like a profile), auto_tune ({target_fps}), and active (false for Auto Tune assignments while the setting is off) |
{
"auto_tune_enabled": false,
"app_detection": {"connected": true, "error": null},
"assignments": [
{"package": "dev.kitcatkode.totk", "label": "Tears of the Kingdom", "type": "profile",
"profile": {"id": "bundled_cq8725s_medium", "name": "Medium Underclock"}, "custom": null, "auto_tune": null, "active": true}
]
}Makes ClusterTune apply settings while an app is visible, like the app-profile dialog. Each package has at most one assignment; app.set replaces it, so repeating a call is safe.
The argument is the package followed by one of:
| After the package | Assigns |
|---|---|
| A profile name or ID | That profile |
| Short settings | Custom values |
autotune=FPS |
An Auto Tune target, 1–1000 FPS |
clustertune app set com.example.game medium
clustertune app set com.example.game cpu6.max=2.4GHz gpu.max=607 cpu6.gov=schedutil
clustertune app set com.example.game autotune=60contentResolver.call(uri, "app.set", "com.example.game medium", null)JSON also works: {"package": "com.example.game", "profile_id": "medium"}, {"package": "…", "auto_tune": {"target_fps": 60}} or {"package": "…", "custom": {"cpu": [{"id": 6, "max_khz": 2438400}], "gpu": {"max_hz": 607000000}}}, with exactly one of profile_id, custom or auto_tune.
- The package must be installed and visible to ClusterTune; ClusterTune itself cannot be assigned. The label comes from Android.
- While the app is visible, anything the assignment does not set keeps the saved tuning, including minimums and governors. An inherited minimum above the app's maximum is dropped.
- Custom values snap like
tuning.set, but custom maximums only snap to real firmware steps;stockanddefaultare rejected (leave a setting out instead). Custom values need tuning to be available. - Auto Tune targets need Enable autotune settings (experimental) in ClusterTune's Settings (otherwise
unsupported); the target never exceeds the display's refresh rate. - Assignments act only while app detection is connected.
app.setasks Android to start it if needed, but Android 12+ can refuse while ClusterTune is in the background; the assignment is saved anyway and takes effect when ClusterTune is opened or the device restarts.
Reply: the stored assignment (as in app.list), app_detection, and adjusted when a value was snapped.
Removes an app's assignment. The argument is the package name. Clearing an app without an assignment succeeds.
clustertune app clear com.example.gamecontentResolver.call(uri, "app.clear", "com.example.game", null)Reply: {"removed": true}, or false if there was no assignment.
The device's CPU policies, frequency steps, governors and GPU. Shortcut: device.
clustertune devicecontentResolver.call(uri, "device.get", null, null)| Field | Meaning |
|---|---|
available, unavailable_reason, execution_method
|
As in profile.list
|
cpu[] |
id (the policy ID used in settings), cores, min_khz[] and max_khz[] (supported steps), stock_min_khz, stock_max_khz, governors[]
|
gpu |
max_hz[], stock_max_hz, governors[]; null without GPU tuning |
An empty governor list means the governor cannot be changed through the API. The Stock maximum may be above the highest selectable step; settings accept it as stock.
{
"available": true, "unavailable_reason": null, "execution_method": "pserver",
"cpu": [
{"id": 0, "cores": [0], "min_khz": [384000, 556800, "…", 3532800], "max_khz": [384000, 556800, "…", 3532800],
"stock_min_khz": 384000, "stock_max_khz": 3532800, "governors": ["walt", "conservative", "powersave", "performance", "schedutil"]},
{"id": 6, "cores": [6], "min_khz": [1017600, "…", 4320000], "max_khz": [1017600, "…", 4320000],
"stock_min_khz": 1017600, "stock_max_khz": 4320000, "governors": ["walt", "conservative", "powersave", "performance", "schedutil"]}
],
"gpu": {"max_hz": [160000000, 222000000, "…", 1100000000], "stock_max_hz": 1100000000, "governors": ["msm-adreno-tz"]}
}The API version, method names, shortcuts, units, extras and notification URIs. It reads nothing from the device. Shortcut: api.
clustertune apicontentResolver.call(uri, "api.info", null, null){
"api_version": 1,
"methods": ["api.info", "state.get", "tuning.get", "tuning.set", "profile.list", "profile.apply",
"app.list", "app.set", "app.clear", "device.get"],
"shortcuts": {"state": "state.get", "tuning": "tuning.get", "profile": "profile.list",
"app": "app.list", "device": "device.get", "api": "api.info"},
"cpu_frequency_unit": "kHz",
"gpu_frequency_unit": "Hz",
"extras": ["api_version", "if_revision"],
"notification_uris": ["content://com.aure.clustertune.api/state", "content://com.aure.clustertune.api/tuning",
"content://com.aure.clustertune.api/profile", "content://com.aure.clustertune.api/app"]
}Like every method, it needs access: an app or ADB that has not been allowed is asked first.
External API
Project