Overview
Unlike Qualcomm Snapdragon chipsets—which benefit from ubiquitous custom kernel development and standardized energy-aware scheduling—MediaTek Dimensity and Helio platforms rely on proprietary OEM drivers such as MediaTek Game Boost Engine (GBE), GED HAL, DVFSRC memory controllers, and the fpsgo frame prediction subsystem. Generic Android performance scripts frequently fail on MediaTek silicon because they attempt to tune non-existent Qualcomm sysfs nodes.
Developed by JUANIMAN, PerfMTK is an engineering-grade performance and energy orchestration daemon created specifically for MediaTek SoCs. PerfMTK taps directly into low-level MediaTek kernel drivers, unlocking digitizer polling rates, managing memory bus scaling up to 8533 MHz, and providing hardware charge bypass to protect battery longevity during competitive 120 FPS gaming.
Core Hardware Subsystems & Capabilities
1. 4-Tier Foreground Detection
PerfMTK dynamically switches profiles between Performance, Balanced, Powersave, and Powersave+ by monitoring the active foreground application. It implements a prioritized detection cascade:
- LSPosed Hook (
PerfMTK-Hook): Instantaneous in-process window manager hook. - Netlink Process Connector (
cn_proc): Kernel-level socket listener tracking process fork and exec events. - cgroup.procs inotify: File-descriptor polling on kernel cgroup hierarchies.
- Adaptive Debounced Fallback: Polling loop for non-standard environments.
2. Touch Digitizer & IRQ Isolation
- Touch Sampling Unlock: Directly interfaces with digitizer drivers (
/dev/xiaomi-touch,/proc/touchpanel,/sys/class/touch/touch_dev, Samsung TSP) to engage maximum sampling rates (480Hz to 2160Hz). - IRQ Affinity Unpinning: Prevents touch input interrupts from clustering onto efficiency cores, preventing thread preemption and micro-stutters during high-cadence touch gestures.
3. Thermal Bypass & Battery Care
- Gaming Charge Bypass: Permits full-speed charging during gaming sessions while intelligently managing current thresholds to hold battery temperatures between 31°C and 36°C.
- Configurable Cutoff Guard: Enforces an emergency hardware cutoff (default 52°C).
- Battery Care: Sets an upper charge ceiling (e.g., stopping charging automatically at 80%) to minimize battery degradation over time.
4. MediaTek Specific Hardware Knobs
- DRAM DVFSRC: Dynamically scales LPDDR5X RAM clock frequencies up to 8533 MHz during texture-heavy workloads.
- Mali GPU & GED Tuning: Adjusts
dvfs_margin_valueandgpu_boost_levelon Linux 5.x and 6.x kernels. - FPSGO Optimization: Adaptive configuration of
/sys/kernel/fpsgogovernor nodes on Android 14 through Android 16.
Terminal CLI Usage (perfmtk)
Launch the interactive dashboard or execute profile changes via root terminal (su -c perfmtk):
# Apply operating profiles manually
su -c perfmtk performance
su -c perfmtk balanced
su -c perfmtk powersave
# Manage Smart Fast Charge Bypass
su -c perfmtk --charge-bypass on # Force charging bypass during gaming
su -c perfmtk --charge-bypass off # Revert to standard charging
su -c perfmtk --charge-bypass status # Query current thermal bypass state
# Configure Battery Care charge limiter (e.g., cap at 80%)
su -c perfmtk --battery-care on 80
su -c perfmtk --battery-care off
# Manage Predictive Thermal Guardian
su -c perfmtk --tg on 75 2 # Target 75°C with max 2 clamp steps
su -c perfmtk --tg status # Display real-time thermal slope
# Telemetry streaming
su -c perfmtk -s # Live formatted status snapshot
su -c perfmtk --stream 1000 # Stream telemetry as JSON every 1000ms
Configuration & Profile Customization
Profiles are defined in plain-text configuration files stored under /data/adb/modules/perfmtk/config/:
app_profiles.conf: Maps package identifiers to performance profiles and flags (e.g.,com.tencent.ig=performance;thermal=off;touch=game).performance.conf/balanced.conf: Houses raw CPU governor definitions, frequency boundaries, and UCLAMP minimum/maximum scheduling weights.
