A Chinese-localized & enhanced fork of FrankBarretta/LSFG-Android. 简体中文说明请看 README_zh-CN.md。
LSFG-Android brings the lsfg-vk
Vulkan frame-generation pipeline to Android. Because Android 12+ blocks
loading external code into non-debuggable processes, the layer can't hook
another app's swapchain the way the Linux implicit layer does. Instead, the
app runs frame interpolation on a MediaProjection capture and composites
the generated frames in a system overlay sitting on top of the target game.
End-to-end frame generation works today on Adreno 7xx-class GPUs and newer.
Important
Lock the display refresh rate to its maximum (e.g. 120/144 Hz) before using this app. Some systems (ColorOS and others) drop the refresh rate back to 60 Hz when no touch input is detected, to save power. Frame generation depends on a stable high refresh rate output — a drop to 60 Hz will break interpolation and cause stutter or dropped frames. Set the highest refresh rate manually in the system display settings (not "Auto"/"Adaptive") and make sure the game also runs at that rate.
Everything from upstream works as before; on top of it, this fork adds:
- Requires Android 14 or newer — minSdk raised from 29 (Android 10) to 34 (Android 14); the privileged capture / timing paths target modern Android 14–16 releases (ColorOS included). Older Android versions are not supported.
- Simplified-Chinese localization + English i18n — ~125 previously hard-coded UI strings extracted to resources. The app follows the system language: Chinese systems get Chinese, everything else gets English.
- Pause frame generation on touch — hold or tap the screen while the
overlay is up and frame generation pauses until you let go. Shizuku/Root
capture modes listen to
/dev/inputfor precise touch detection (long-press or tap both work); MediaProjection mode falls back to a 1 px transparent window that catches touches outside the overlay (tap only). Must be disabled while gaming — otherwise every touch would pause frame generation mid-game. - Millisecond-level overlay recovery after rotation — the native render
loop now aborts immediately when a stop is requested instead of draining
queued frames with 500 ms acquire timeouts, and framegen persists its
compute pipelines to a
VkPipelineCachefile (framegen_pcache_<uuid>.bin) so the ~2 s first-compile cost is paid once, not on every re-init. - Auto session end in freeform / floating windows — a watcher detects when the target app's window leaves fullscreen (window bounds ≠ display max bounds, the reliable signal on ColorOS) and ends the session with a toast, since UID-filtered capture can only show the target window anyway.
- Overlay-permission entry on the home screen — a green/orange permission chip with a one-tap jump to the system overlay-permission page, plus an automatic prompt on first launch when the permission is missing.
- Home-screen rework — capture mode and pacing presets moved to the home screen as selectable chips; redundant info cards removed; switching the frame multiplier no longer freezes the overlay (re-init now falls back to the active target package).
- FPS Guard — when frame generation is running, a guard polls the source frame rate and ends the session automatically if it exceeds a customizable threshold (default 62, configurable 30–240 on the home screen), so junk readings from menu screens / 90–120 Hz sources don't get interpolated. Shizuku/Root capture modes only.
- HDR content detection (in-app HDR mode removed) — HDR10 / Dolby Vision / HLG content on screen makes SurfaceFlinger drop our SDR overlay from composition; frame generation cannot survive HDR content with the overlay approach, so the session ends automatically with a toast (~3 s). The upstream-style in-app "HDR mode" toggle was removed as it cannot help. Shizuku/Root capture modes only (MediaProjection falls back to the watchdog below).
- Output-stall watchdog — if the overlay is dropped from composition and
vkAcquiretimes out indefinitely (HDR color-mode switch being the known trigger), the app detects the dead output within ~5 s and ends the session gracefully instead of freezing until the system low-memory killer reaps it. - Stability fixes — a zombie overlay window that swallowed all touch input after a session ended (removal now retries with the touchable region kept cleared), a SIGSEGV race in the CPU fallback blit path, swapchain recreation after repeated acquire timeouts, and an ImageReader callback crash are all fixed.
| Path | What it is |
|---|---|
LSFG-Android-Application/ |
Android Studio project — Kotlin + Jetpack Compose UI, JNI/C++ render loop. The user-facing app. |
lsfg-vk-android/ |
Submodule. Branch of lsfg-vk 1.0.0 with Android-specific patches added on top (AHardwareBuffer-based image sharing, createContextFromAHB, waitIdle). All patches are guarded by #ifdef __ANDROID__, so the original Linux build path still works unchanged. |
The Android app pulls framegen/ directly from the submodule via CMake
add_subdirectory(). There is no separate prebuilt .so to ship — building
the app builds the framegen library transparently for arm64-v8a and
x86_64.
- Frame generation (LSFG_3_1 / LSFG_3_1P) running on-GPU via AHardwareBuffer sharing between the app's Vulkan session and framegen's internal device.
- Live in-game settings drawer: multiplier (2×–8×), flow scale (0.25–1.0), performance mode, anti-artifacts, bypass, vsync alignment with slack control, pacing presets, target FPS cap, queue depth, EMA jitter smoothing. Most parameters re-init the native context on the fly; bypass / pacing / Shizuku timing have hot-apply paths that don't drop the session.
- Automatic per-app overlay — pick target apps and the overlay arms when one of them comes to the foreground. Two entry modes: a draggable launcher dot or an icon button on the configurable edge of the screen.
- First-launch tutorial that walks through the Accessibility setup (the touch-passthrough service and the Restricted-Settings unblock that sideloaded apps trigger on Android 13+).
- Touch passthrough at full opacity. The overlay can be hosted as a
SYSTEM_ALERT_WINDOWor, when the user enablesLsfgAccessibilityService, as aTYPE_ACCESSIBILITY_OVERLAY— the latter is the opt-in path for OEMs with strict untrusted-touch filters. - Capture sources: MediaProjection (default, used for the visible frames on every session) and Shizuku metrics mode, which adds a privileged target-UID-filtered timing side channel for pacing diagnostics without ever feeding Shizuku buffers into the visible video path.
- Post-processing pipelines: NPU presets via NNAPI (sharpen, detail boost, chroma clean, game crisp), GPU upscaling stage, and CPU enhancement (LUT, vibrance, saturation, vignette).
- Frame graph HUD with real-vs-total FPS counter, frame-time graph, and pacing diagnostics.
- Crash reporter capturing both Java/Kotlin uncaught exceptions and
native signals (SIGSEGV, SIGABRT, …) with stack-walking; one-tap share via
ACTION_SENDfor bug reports. - Vulkan swapchain output path for efficient frame presentation on top of the CPU-blit fallback.
- Rotation and immersive-mode aware overlay components.
Important
You need a legitimately purchased copy of Lossless Scaling. The Lossless.dll
is not shipped, downloaded, or bundled by anything in this repository.
The user picks their own DLL via the Storage Access Framework, the app
extracts the shaders on-device into its private storage, then deletes the
DLL copy. Nothing about this project distributes Lossless Scaling assets.
cd LSFG-Android-Application
./gradlew :app:assembleDebug # or :app:assembleReleaseThe APK lands in
LSFG-Android-Application/app/build/outputs/apk/debug/app-debug.apk.
Install with adb install.
Toolchain: Android Studio Ladybug+, NDK 27.0.12077973, CMake 3.22.1, JDK 17,
C++20. ABIs: arm64-v8a (production) and x86_64 (emulator only).
minSdk=34 (Android 14), targetSdk=35 (Android 15). Android 14 or newer is required.
CMake automatically resolves the submodule via the relative path
../../../../../lsfg-vk-android from the JNI sources. Keep both folders
side-by-side as in this repository's layout — moving or renaming either one
breaks the native build.
For the standalone Linux build of the patched lsfg-vk, see
lsfg-vk-android/README.md. The Android-specific
patches are no-ops on non-Android targets, so the upstream build commands
work unchanged.
On non-rooted Android there is no equivalent to Linux's Vulkan implicit
layer mechanism. Android 12+ explicitly blocks loading external code into
non-debuggable processes, so this app cannot hook another app's Vulkan
swapchain. Frame generation runs on a MediaProjection screen-capture stream
instead, and the result is composited in a system overlay over the target.
That adds roughly 50–80 ms of latency versus the Linux Vulkan layer. It is a
platform constraint, not a bug. MediaProjection also requires explicit user
consent on every session start and surfaces a persistent system indicator.
The combination of SYSTEM_ALERT_WINDOW + screen capture + AccessibilityService
violates Google Play policy, so this app is distributable only as a sideloaded
APK. A Magisk module installing a Vulkan implicit layer into
/system/etc/vulkan/implicit_layer.d/ would be the only realistic path to
match the Linux experience, and is out of scope here.
LSFG-Android-Application/README.md— app architecture, feature breakdown, device requirements, native module layout.lsfg-vk-android/README.md— the framegen library, the Android patch set, and the precise diff against upstreamlsfg-vk1.0.0.
This project would not exist without the work of:
- PancakeTAS and the lsfg-vk contributors —
authors of the original
lsfg-vkVulkan frame-generation layer, which is the entire backbone of this port. - THS / Lossless Scaling — original authors of the Lossless Scaling
frame-generation shaders. The shaders are extracted on-device from the
user's own legitimately purchased copy of
Lossless.dlland are never redistributed by this project. - FrankBarretta — Android port
(upstream repository): JNI/Vulkan glue, AHardwareBuffer-based image sharing,
MediaProjection capture pipeline, overlay/foreground service, accessibility-
overlay touch passthrough, Compose UI, settings drawer, automatic overlay,
draggable launcher dot, first-run tutorial, Shizuku integration, frame graph HUD,
crash reporter, Vulkan swapchain output, and the upstream patches added
under
#ifdef __ANDROID__in thelsfg-vk-androidsubmodule.
Third-party libraries used by the native build: volk,
pe-parse, DXVK's dxbc translator,
and Shizuku for the privileged timing
side channel.
If you fork this project or build something on top of it, please keep both
the upstream lsfg-vk attribution and the LSFG-Android port attribution
intact (this is also a requirement of the licenses below).
The top-level files of this repository are released under the MIT License —
see LICENSE. The two main subdirectories carry their own
licenses, which prevail over the root MIT license within their respective
trees:
| Subdirectory | License | File |
|---|---|---|
LSFG-Android-Application/ |
Custom License — No Play Store, No Commercial Use | LSFG-Android-Application/LICENSE |
lsfg-vk-android/ |
MIT (inherited from upstream lsfg-vk) |
lsfg-vk-android/LICENSE.md |
If you redistribute the repository as a whole, reproduce all three license files and respect the most restrictive terms applicable to each subtree — in particular, the LSFG-Android app may not be published on Google Play or any other commercial app store, and may not be used commercially.
Lossless.dll is the property of THS / Lossless Scaling and is not
distributed by this project under any circumstances.