Skip to content
Open
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
1824972
feat: Add Experimental CPU / GPU power control to AYN, Retroid Pocket…
joshuatam Jul 11, 2026
26937d5
implement save / restore current performance profile
joshuatam Jul 14, 2026
b638139
feat: add RAM frequency slider for samsung devices (#6)
AndreVto Jul 16, 2026
35678a4
update translations
joshuatam Jul 16, 2026
ea23561
Update app/src/main/java/app/gamenative/powercontrol/README.md
joshuatam Jul 16, 2026
392648c
Update app/src/main/java/app/gamenative/powercontrol/drivers/PServerD…
joshuatam Jul 16, 2026
1c6d040
refactor PerformanceDriver to avoid unnecessary override
joshuatam Jul 19, 2026
9a2ba2a
add Policy based CPU control to PServerDriver
joshuatam Jul 19, 2026
932ebd5
Add CPU affinity and process pinning for performance
joshuatam Jul 19, 2026
cefbdb5
update README
joshuatam Jul 19, 2026
576d057
Update app/src/main/java/app/gamenative/ui/screen/xserver/XServerScre…
joshuatam Jul 19, 2026
35ec9d7
Add experimental auto-tuning for dynamic performance control
joshuatam Jul 24, 2026
6c46268
update readme for auto-tuning features
joshuatam Jul 24, 2026
dae73fd
addressed AI comments
joshuatam Jul 24, 2026
ee31654
addressed AI comments
joshuatam Jul 24, 2026
8782fad
Optimize auto-tuner with adaptive tuning intervals
joshuatam Jul 24, 2026
e648968
Revert "Optimize auto-tuner with adaptive tuning intervals"
joshuatam Jul 24, 2026
e381c99
fix quick menu logic
joshuatam Jul 24, 2026
cbeb8e2
set custom profile when toggling auto tuning option
joshuatam Jul 24, 2026
f6959a5
fix saving PowerProfile include default values
joshuatam Jul 24, 2026
52fca4c
add bus tuning to PerformanceAutoTuner
joshuatam Jul 24, 2026
704979a
fallback to default profile when json parsing failed, rename functions
joshuatam Jul 25, 2026
4a73099
update pinning logic based on cpu cluster count
joshuatam Jul 25, 2026
500f7ec
Update app/src/main/java/app/gamenative/powercontrol/PowerManager.kt
joshuatam Jul 25, 2026
31b25da
Update app/src/main/java/app/gamenative/powercontrol/README.md
joshuatam Jul 25, 2026
d19ed4c
Merge remote-tracking branch 'utkarshdalal/master' into feat/experime…
joshuatam Jul 25, 2026
aa28dd3
Refactor background process pinning for improved reliability and comp…
joshuatam Jul 26, 2026
e18b4e3
update tasksetMaskFormat detection
joshuatam Jul 26, 2026
919729e
Merge branch 'master' into feat/experimental-power-control
joshuatam Jul 28, 2026
e3cb0a4
do not pin main app process to any cores to avoid ANR
joshuatam Jul 28, 2026
de8944e
add tuning strategy option (default balanced), start tuning fps count…
joshuatam Jul 28, 2026
bfb277a
address AI comments
joshuatam Jul 28, 2026
95d75eb
update chinese translation
joshuatam Jul 28, 2026
9d5214d
Merge remote-tracking branch 'utkarshdalal/master' into feat/experime…
joshuatam Jul 29, 2026
94c977a
fix QuickMenu
joshuatam Jul 29, 2026
ac76594
update game process detection, add more delay to pinGameWithRetry
joshuatam Jul 29, 2026
d7fe29d
Merge remote-tracking branch 'utkarshdalal/master' into feat/experime…
joshuatam Jul 30, 2026
943630b
Merge remote-tracking branch 'utkarshdalal/master' into feat/experime…
joshuatam Jul 30, 2026
cead5cc
move power control tab after stats tab
joshuatam Jul 30, 2026
f924d3c
reset driver on PowerManager initialize
joshuatam Jul 30, 2026
c4c9706
remove samsung driver reset function
joshuatam Jul 30, 2026
f9eaaea
refactor PServerDriver reset logic
joshuatam Jul 30, 2026
f1d1eea
put PServerDriver reset into background to avoid blocking
joshuatam Jul 30, 2026
dd12de2
Update app/src/main/java/app/gamenative/powercontrol/drivers/PServerD…
joshuatam Jul 30, 2026
805afd1
fix ai code error
joshuatam Jul 30, 2026
1d7ef46
add pause / rersume logic to PowerManager
joshuatam Jul 30, 2026
a16ee9c
remove unnecessary app process reset
joshuatam Jul 30, 2026
a52c182
preserve powerprofile on pause / resume
joshuatam Jul 30, 2026
d72127f
move PowerManager pause / resume to MainActivity
joshuatam Jul 30, 2026
ddad6c4
add isGameStarted to guard pause / resume
joshuatam Jul 30, 2026
2c32408
Update app/src/main/java/app/gamenative/powercontrol/PowerManager.kt
joshuatam Jul 30, 2026
37b7a61
update third part notices for samsung sdk and update proguard for sam…
joshuatam Jul 31, 2026
72a840f
refactor PServer driver for robustness and asynchronous execution
joshuatam Jul 31, 2026
e0cfbd1
handle race condition of start / stop rapidly
joshuatam Jul 31, 2026
e311e6a
remove unnecessary catch in stop
joshuatam Jul 31, 2026
6106782
speed up stop by wrapping beginUpdate / commitInternal
joshuatam Jul 31, 2026
6a335dc
check interrupted in stop, add skipWarmupCycles to skip on resume
joshuatam Jul 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@ dependencies {

implementation("com.auth0.android:jwtdecode:2.0.2")

// Samsung Performance SDK
implementation(files("src/main/lib/perfsdk-v1.0.0.jar"))

"modernXrImplementation"("com.meta.horizon.platform.sdk:core-kotlin:0.2.2")
"modernXrImplementation"("com.meta.horizon.platform.sdk:iap-kotlin:0.2.2")
}
5 changes: 5 additions & 0 deletions app/src/main/java/app/gamenative/PluviaApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.navigation.NavController
import app.gamenative.db.dao.AmazonGameDao
import app.gamenative.db.dao.GOGGameDao
import app.gamenative.events.EventDispatcher
import app.gamenative.powercontrol.PowerManager
import app.gamenative.service.ActiveGameRegistry
import app.gamenative.service.DownloadService
import app.gamenative.service.SteamService
Expand Down Expand Up @@ -127,6 +128,7 @@ class PluviaApp : SplitCompatApplication() {

PlayIntegrity.warmUp(this)

PowerManager.initialize(this)
}

/**
Expand Down Expand Up @@ -239,6 +241,9 @@ class PluviaApp : SplitCompatApplication() {
runCatching { env?.stopEnvironmentComponents() }
.onFailure { Timber.e(it, "shutdownEnvironment: stopEnvironmentComponents") }

// Stop performance driver
PowerManager.stop()
Comment on lines +244 to +245

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Wrap PowerManager.stop() in runCatching for consistency with the teardown design.

The comment at line 233 states "per-step catch so one failing teardown doesn't prevent the rest from running," yet PowerManager.stop() is the only cleanup step not wrapped in runCatching. If it throws, the remaining cleanup (nulling xEnvironment, clearing ActiveGameRegistry, resetting SteamService state) is skipped. Current driver implementations catch their own exceptions, but a future driver might not.

🛡️ Proposed fix
-            // Stop performance driver
-            PowerManager.stop()
+            runCatching { PowerManager.stop() }
+                .onFailure { Timber.e(it, "shutdownEnvironment: PowerManager.stop") }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Stop performance driver
PowerManager.stop()
// Stop performance driver
runCatching { PowerManager.stop() }
.onFailure { Timber.e(it, "shutdownEnvironment: PowerManager.stop") }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/main/java/app/gamenative/PluviaApp.kt` around lines 243 - 244, Wrap
the PowerManager.stop() call in the teardown sequence with runCatching, matching
the per-step failure isolation described by the nearby comment. Keep the
subsequent cleanup steps—nulling xEnvironment, clearing ActiveGameRegistry, and
resetting SteamService state—executing even if stopping the performance driver
throws.


xEnvironment = null
inputControlsView = null
inputControlsManager = null
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/java/app/gamenative/PrefManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1418,4 +1418,12 @@ object PrefManager {
setPref(NEXUS_LAST_PLACEMENT_JSON, value)
}
}

// Power Control Profile (JSON string)
private val POWER_CONTROL_PROFILE = stringPreferencesKey("power_control_profile")
var powerControlProfile: String
get() = getPref(POWER_CONTROL_PROFILE, "")
set(value) {
setPref(POWER_CONTROL_PROFILE, value)
}
}
Loading
Loading