Smooth section switches and first row moves on weaker TVs
All checks were successful
Validate and publish Kaleido / android (push) Successful in 2m16s
All checks were successful
Validate and publish Kaleido / android (push) Successful in 2m16s
Measured every browse transition on the onn, a Fire TV Stick 4K and a TCL TV with a new framestats harness and atrace breakdowns. - Stage card artwork and titles a few cards per frame while a section enters, so its first frame no longer composes every card at once. - Give every discovery list the lookahead cache window and nudge it once after a section settles, so the first move down composes nothing. - Activate a focused top tab two frames later, so its highlight responds before the section switches; start the page entrance after composition settles, using per-draw alpha instead of an offscreen layer. - Limit Coil to two concurrent decodes, drop the redundant window background, size card image requests explicitly, and skip a coroutine per card for focus restoration. Home -> Movies UI stalls drop from 150-200 ms to 70-90 ms and Movies row moves no longer skip frames. Device scripts can now target any authorized serial and tolerate the TCL's flaky network ADB link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
0f926c0435
commit
629546a50c
14 changed files with 282 additions and 30 deletions
|
|
@ -22,8 +22,8 @@ The interface gives artwork priority. App chrome uses neutral near-black, charco
|
|||
- Navigation focus changes use Android's native UI tick. Settings > Interface > Navigation sounds toggles it immediately and persists across process restarts; it defaults to On and follows the TV's global sound-effects setting. Initial startup focus and repeated notifications for the same target are silent. The shared focus observer covers navigation, cards, buttons, dialogs, playback options and the timeline without changing key handling.
|
||||
- Navigation contrast comes from a gradient extending past the controls and fading to transparent. Home/Movies/TV activate on focus. Explicit row and column links prevent beyond-bounds focus searches when holding a remote direction.
|
||||
- A D-pad move predicts the actual row/column destination before starting its scroll or focus change. The target backdrop is fetched and contrast-processed through the same Coil request/cache as the visible scene. Speculative artwork uses one low-priority worker so it cannot flood normal decode workers during a burst of input. Metadata starts in parallel; the visible preview and details page share that in-flight request. Rapid navigation replaces the queued metadata target and cancels superseded artwork prefetches. Full metadata uses a 64-item LRU with a 30-second lifetime, cleared on account/server changes and refreshed after watched updates. Neutral library/search grids prefetch metadata without fetching an unused full-screen backdrop.
|
||||
- Home's vertical list prepares content within one viewport ahead and retains one viewport behind, using Compose's bounded lazy-layout cache window. This keeps the hero and nearby rows ready when moving between them, rather than repeatedly composing and measuring the exposed image cards during the animation. Movies/TV retain their existing list strategy. Card sizes, row targets and the large cinematic Home layout are unchanged.
|
||||
- Section previews settle for 120 ms (Home artwork for 90 ms), overlapping the navigation animation, and retain previous artwork until replacement data is ready. Contrast gradients are baked into a cached bitmap on a worker thread, reducing GPU overdraw. Hero recommendation changes crossfade the artwork over 220 ms, including cache hits, and fade the title/summary out for 100 ms and back in over 180 ms. Rotation pauses on the information/next controls and preserves their focus. Vertical row changes animate to explicit row/column targets; page entrances fade and slide 28 dp over 280 ms. The cold-start sequence lasts 2.9 seconds. The six exact facets begin as a closed, overlapping iris lit from behind; it holds there (at most 700 ms) until startup data has arrived and frames are steady, so cold-start hitches never interrupt the motion. The iris then twists 44° open and locks with a slight overshoot while light leaks through the six gaps, a single sheen crosses the settled mark, and the mark shrinks into a lockup scaled from the header brand as KALEIDO slides out from behind it. Once loading finishes (up to 600 ms extra) the camera flies through the aperture's dark center over 640 ms, revealing the app beneath as it settles from 114 percent scale. The completed mark itself is never redesigned. Android animation duration scale is honored, including animations off. It does not replay when returning from background.
|
||||
- Home's vertical list prepares content within one viewport ahead and retains one viewport behind, using Compose's bounded lazy-layout cache window. This keeps the hero and nearby rows ready when moving between them, rather than repeatedly composing and measuring the exposed image cards during the animation. Movies/TV use the same window. The window only fills ahead after the list has scrolled, so once a section settles it is nudged 1 px and back, letting the next rows compose in idle frames instead of during the first move down. Card sizes, row targets and the large cinematic Home layout are unchanged.
|
||||
- Section previews settle for 120 ms (Home artwork for 90 ms), overlapping the navigation animation, and retain previous artwork until replacement data is ready. Contrast gradients are baked into a cached bitmap on a worker thread, reducing GPU overdraw. Hero recommendation changes crossfade the artwork over 220 ms, including cache hits, and fade the title/summary out for 100 ms and back in over 180 ms. Rotation pauses on the information/next controls and preserves their focus. Vertical row changes animate to explicit row/column targets; page entrances fade and slide 28 dp over 280 ms, using per-draw alpha rather than an offscreen layer, and start once the new section's composition frames have passed (at most 300 ms). While a section enters, its cards lay out at their fixed size first and fill in artwork and titles three per frame under the fade, so the section's first frame stays short. Focusing a top tab lets its highlight draw before the section switches. The cold-start sequence lasts 2.9 seconds. The six exact facets begin as a closed, overlapping iris lit from behind; it holds there (at most 700 ms) until startup data has arrived and frames are steady, so cold-start hitches never interrupt the motion. The iris then twists 44° open and locks with a slight overshoot while light leaks through the six gaps, a single sheen crosses the settled mark, and the mark shrinks into a lockup scaled from the header brand as KALEIDO slides out from behind it. Once loading finishes (up to 600 ms extra) the camera flies through the aperture's dark center over 640 ms, revealing the app beneath as it settles from 114 percent scale. The completed mark itself is never redesigned. Android animation duration scale is honored, including animations off. It does not replay when returning from background.
|
||||
- Returning from details restores the library's mode, scroll position, and previously focused title.
|
||||
|
||||
## Player
|
||||
|
|
|
|||
|
|
@ -78,3 +78,29 @@ The cold-start splash was prototyped as a dp-accurate canvas page (ignored `evid
|
|||
Frame statistics from three profiled release cold starts (`dumpsys gfxinfo framestats`, bucketed per 250 ms) first showed 100–125 ms frames about 0.3–0.7 s after launch: startup data arriving and Home composing beneath the splash, with high UI-thread time. Starting the animation a few frames late did not avoid them because they follow the data, not the first frame. Skipping the hidden app's draw until the exit made no measurable difference and was reverted. The final sequence instead runs a 260 ms light-gathering phase on the nearly still closed iris, then holds until `busy` clears and four consecutive frames arrive within 24 ms (capped at 700 ms). On the final build every frame from the iris opening through the start of the exit completed within 25 ms in all three runs, at 15 frames per 250 ms. Frames after the reveal include Home itself and show higher latency without dropping below 15 frames per bucket. These are device samples, not a guarantee.
|
||||
|
||||
The hold adds roughly 0.5 s before the iris opens when Plex data takes that long; loading previously overlapped the animation. `Build.ps1 -Release -Test` passed; `repro_runtime.py sections` passed and all six `verify_ui.py browse` checks passed on the final release. A screen recording of the actual cold start (`kaleido-aperture-startup.mp4`, contact sheet `aperture-sheet.png`) was inspected. The optimized release was left on Home.
|
||||
|
||||
## Browsing transitions on three devices - 2026-10-24
|
||||
|
||||
The user authorized two weaker devices alongside the onn: a Fire TV Stick 4K (AFTKM, Fire OS 8 / Android 11, 32-bit, 1.7 GB) and a TCL Smart TV Pro (MT5896, Android 14, 1080p UI on a 4K panel, slowest GPU). Each was provisioned with `device.py seed` on a debug build, then the optimized release was installed over it with `speed-profile` compilation. `scripts/profile_transitions.py` measures skipped vsyncs and UI-thread time for each D-pad transition from `gfxinfo framestats`; its first cycle is the first pass after launch, and gaps after fast frames or longer than 300 ms count as idle. `scripts/trace_transition.py` breaks a transition's slow UI frames into their nested atrace slices.
|
||||
|
||||
Findings:
|
||||
|
||||
- Top-tab switches were the worst stall everywhere: about 30 ms disposing the old section, then one 150 ms+ measure pass composing every visible card (Coil painters about 3 ms per card, text layout about 1.4 ms per label), while four Coil decoders and a young GC competed for four cores.
|
||||
- Home's lookahead cache only fills after the list has scrolled, so the first hero → row move after launch composed the lower rows mid-animation. A screen recording on the onn showed a 204 ms freeze. Movies/TV had no cache window and skipped 1–2 frames on each row move.
|
||||
- The onn runs two accessibility services (Button Mapper, Luma launcher), adding 1–3 ms of Compose semantics work per frame. Its steady frames are render-bound but drop nothing. These device settings were not changed.
|
||||
- Converting contrast-baked backdrops to hardware bitmaps removed render-thread uploads but made the TCL's GPU skip 9–14 frames on Home row moves (0 with software bitmaps), so it was reverted. Explicit card image sizes and a staged-card build were also A/B tested.
|
||||
|
||||
Changes: staged card fill-in while a section enters, a cache window and one-time 1 px nudge on every discovery list, tab activation two frames after focus, the page entrance starting after composition settles with per-draw alpha, Coil decode parallelism 2, no redundant window background, explicit card image sizes, and no per-card restoration coroutine.
|
||||
|
||||
Results (skipped frames per cycle; UI-thread maximum):
|
||||
|
||||
| Transition | onn before → after | Fire Stick before → after |
|
||||
| --- | --- | --- |
|
||||
| Home → Movies | 11/7/8, 160 ms → 9/3/6/6, 88 ms | 12/5/5, 153 ms → 8/3/2/2, 69 ms |
|
||||
| Movies → Home | 7/6/5, 104 ms → 3/4/5/3, 67 ms | 4/3/4, 61 ms → 2/2/2/1, 52 ms |
|
||||
| Movies row → row | 2/2/1 → 0/0/0/0 | 1/1/0 → 0/0/0/0 |
|
||||
| Home hero/row moves | 0–1 per move, both before and after | 0 per move, both before and after |
|
||||
|
||||
On the TCL, Home → Movies measured 196 ms of UI time before and 88 ms in the one completed final sample. Its final full run was skipped at the user's request because its ADB link kept dropping; the partial final run and the A/B runs showed no regressions. Movies row ← row still skips two frames on the onn. Returning from Movies still disposes and composes whole sections. Retaining sections across tabs would remove that cost but needs per-section navigation state.
|
||||
|
||||
`Build.ps1 -Release -Test` passed. On the onn, all six `verify_ui.py browse` checks and `repro_runtime.py sections` passed. A recording confirmed the staged cards fill in under the fade without bound changes. The final release was left installed on all three devices. Private evidence: `transitions-*.json`, `transitions-*-frames.txt`, `trace-*.txt` and the `onn-*` recordings in `evidence/private/`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue