Optimize cinematic rendering for integrated Android TVs

This commit is contained in:
Elijah Kuntz 2026-10-19 09:49:08 -07:00
parent dc5908cb3b
commit 1f69422354
15 changed files with 366 additions and 153 deletions

View file

@ -1 +1 @@
Adds scheduled update checks, TV notifications, and downloading/installing Luma updates directly from Settings. Includes the fix for missing app images and wallpaper after TV wake. Your appearance, screensaver, app order, and Home routing settings are preserved.
Improves navigation performance on integrated Android TVs by precomposing cinematic backgrounds off the main thread. Reduces redundant tile shadows while keeping focus animations, dynamic colors, and the existing spacious layout. Image work and caches are released when leaving Home.

View file

@ -48,7 +48,7 @@ No launcher application was disabled or uninstalled. Screensaver selection at th
Build validation uses aapt2, javac, D8, zipalign, and apksigner signature verification. There are no third-party runtime libraries.
Final APK (1.1.5): 2,753,622 bytes. SHA-256: `9556c053f5c1ebb7e7b9414596ee2b2185a37161044538617490713bb9dd8228`.
Final APK (1.1.6): 2,753,622 bytes. SHA-256: `59527fde9ca270d76864406dadbdad219905fbfdf75e853b536ca09e51811cdd`.
## Updater regression — October 18, 2026
@ -65,3 +65,34 @@ Testing exposed a device-specific consequence of legacy APK/file installation: A
The final real upgrade, **1.1.4 → 1.1.5**, was downloaded from production Git and approved with the TV remote. The complete enabled-accessibility-service list matched before and after, including Luma Home, Projectivy, and Button Mapper. Restricted-settings authorization remained allowed, and the TV returned directly to Luma. No ADB install or accessibility repair was used for that final upgrade. Prior temporary configuration changes from failed installation-method tests were restored.
The source classification follows Android's [PackageInstaller source definitions](https://developer.android.com/reference/android/content/pm/PackageInstaller#PACKAGE_SOURCE_OTHER); the platform's [file-source restriction implementation](https://android.googlesource.com/platform/frameworks/base/+/143db55921dd%5E%21/) explains the behavior encountered during the earlier file-install tests.
## Integrated TV rendering — October 19, 2026
The authorized second device (`192.168.50.200:5555`) is a TCL Smart TV Pro / G08, Android 14 (API 34), ARM Cortex-A73 cores, Mali-G52 OpenGL renderer, approximately 2.34 GiB physical RAM. Its existing 1920 × 1080 render override and density 320 were retained. About 1 GiB was available at diagnosis; Android reported no thermal throttling. The original installed version was 1.1.5.
A repeatable ADB D-pad sequence on 1.1.5 reported 627 rendered frames, 310 missed frame deadlines (49.44%), median 57 ms and 90th percentile 69 ms in `dumpsys gfxinfo`. Frame timing was recorded on the TV itself and is independent of ADB/Tailscale latency.
A separate same-signature `PerformanceInstrumentation` diagnostic isolates the scene and tile shadows. It requests the same first-six-tile sequence 36 times with 350 ms between selections; this includes moving to/from the next row. Android `FrameMetrics.TOTAL_DURATION` includes renderer/queue waits and differs from the histogram summary in `gfxinfo`. These are comparable A/B samples from the same TV, rather than benchmarks across different devices:
| Rendering variant | Frames | Median | 90th percentile | Frames over 16.7 ms |
| --- | ---: | ---: | ---: | ---: |
| 1.1.5 unchanged | 433 | 85.97 ms | 89.50 ms | 433 (100%) |
| 1.1.5 background hidden | 366 | 9.22 ms | 10.46 ms | 0 |
| 1.1.5 tile shadows removed, background restored | 433 | 84.90 ms | 87.39 ms | 433 (100%) |
| Precomposed background, original shadows | 638 | 14.40 ms | 25.79 ms | 185 (29.0%) |
| 1.1.6 background and focused shadow enabled | 639 | 12.99 ms | 17.00 ms | 64 (10.0%) |
| 1.1.6 shadows removed for diagnosis only | 640 | 12.67 ms | 13.59 ms | 0 |
The full-screen shader/transparency passes were the dominant bottleneck on this renderer. Removing redundant shadows after fixing that bottleneck reduced the remaining tail latency. This supports an application rendering optimization issue exposed by this TV's graphics implementation; there is no evidence here that replacing the TV or adding RAM is necessary. This is a short controlled navigation sample, not a claim of universally perfect 60 fps.
Version 1.1.6 composes the original artwork, accent glow, darkening, and gradient protection on one background worker into opaque textures no larger than 960 × 540. Each texture is about 1.98 MiB. The worker has one pending-request slot, discards stale results, and times out after two idle seconds. Navigation crossfades the finished textures rather than regenerating full-screen shaders each frame. Only the focused tile casts a shadow, and its parent no longer casts a duplicate shadow. Focus enlargement, smooth scrolling, app-colored accents, and user preferences remain enabled. This follows Android's guidance on [reducing overdraw](https://developer.android.com/topic/performance/rendering/overdraw).
The enhanced wake regression passed cold launch, interrupted loading followed by pause/resume, memory trim recovery, existing-image reuse, partial-grid recovery, composed-texture resolution/nonblank checks, release of all composed/source textures on stop, screensaver dismissal resuming rendering, and five stop/start cycles. No preferences were rewritten by the diagnostic. Temporary test APKs are not part of the published launcher.
Raw local captures are in `output/performance/` (ignored by Git), including the original screenshot, A/B timings, final navigation frames, memory/idle samples, and final screenshot.
The original D-pad workload was then repeated against the final installed APK: **853 frames, 12 missed deadlines (1.41%)**, median 13 ms, 90th percentile 24 ms, and no slow bitmap uploads. The original missed-deadline rate was 49.44%. Screenshots retain the mountain artwork, focus enlargement, five-column layout, and partial second row. The difference from the isolated benchmark reflects using actual D-pad input and more repeated scrolling.
Foreground PSS was 43,742 KiB (42.7 MiB), and background PSS was 35,803 KiB (35.0 MiB). The launcher consumed zero CPU ticks over five seconds while Android settings was foreground. Source/composite caches are cleared when stopped; actual heap reclamation remains Android's responsibility. These short samples do not establish overnight endurance.
The TV's Home override was already off (no enabled accessibility services) and was retained. A physical Home-key injection returns to Google Home on this TV; opening Luma directly and repeated Back stays in Luma. No default-launcher, picture, power, resolution, or accessibility settings were changed. The optimized APK was installed only on the authorized TV at `.200`; the onn was not operated during this investigation. Version 1.1.6 is published in the existing Git update feed for the other devices.