Skip to content

feat(efficiency): add power/memory saving, adaptive FPS, FPS overlay, and appearance controls - #266

Open
Rengwang wants to merge 2 commits into
PlayCover:masterfrom
Rengwang:pr/feat-efficiency-and-adaptive-fps
Open

Rengwang wants to merge 2 commits into
PlayCover:masterfrom
Rengwang:pr/feat-efficiency-and-adaptive-fps

Conversation

@Rengwang

@Rengwang Rengwang commented Nov 27, 2026 •

Copy link
Copy Markdown

Adds per-app power/memory efficiency controls, iOS-semantic adaptive frame rate scheduling (1–60 FPS), an optional lightweight FPS pill overlay, and per-app Light/Dark appearance overrides.

Summary

  • Efficiency & Adaptive FPS (PlayEfficiencyHooks.{h,m}):
    • Caps CADisplayLink / MTKView rates (10–60 FPS) or enables Adaptive (1–60 FPS) scheduling: raises immediately to 60 FPS on user input / CAAnimation / visible scrolling / CoreAnimation layer motion commits, maintains a 30 FPS floor during active AVPlayer media playback or playback-style animations (such as danmaku), and steps down to 10 FPS then 1 FPS (or occluded deep idle) when stationary.
    • Optional click-through FPS Overlay pill in the top-left corner displaying live display/Metal rates and adaptive state.
    • Power Saving Mode: enables reduce-transparency/motion hints, pauses hidden WebView media, throttles occluded display links, and downgrades UIBlurEffect/UIGlassEffect materials to context-aware opaque surfaces (PlayLoader.m).
    • Memory Saving Mode / Metal Memory Saver / AV Media Saver: caps unbounded NSCache/NSURLCache, limits CAMetalLayer/MTKView drawables and EDR backing stores, reclaims memory on pressure or occlusion, and limits idle/paused AVPlayerItem buffering & resolution.
  • Power & Thermal Policy (PlayInfo.swift): selectable Follow System (0), Spoof High Performance (1), or Low Power Mode (2), preserving backwards compatibility with legacy spoofPowerState.
  • Window Appearance & Occlusion Notifications (Plugin.swift, AKPlugin.swift, PlayLoader.m): exposes occlusion/visibility state for efficiency throttling and adds per-app appearanceStyle (Follow System / Light / Dark) with re-entrancy guards on _updateFromSystemAppearance:.
  • Paired with PlayCover UI PR: feat(efficiency): add per-app performance, adaptive FPS, FPS overlay, and appearance settings PlayCover#2298

Verification

  • Built PlayTools (-sdk iphoneos), AKInterface (-sdk macosx), and verified Mac Catalyst Swift + PlayEfficiencyHooks.m compilation (arm64-apple-ios15.0-macabi).
  • swiftlint --strict passed with 0 violations.

@Rengwang

Copy link
Copy Markdown
Author

Updated: skip adaptive display-link motion recording during host live window resize so resizing stays smooth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant