You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8fc258a
Browse filesBrowse the repository at this point in the historyBrowse files
fix(core): assess memory after reduced allocations render
Keep confirmed allocation reductions at their current height until the new generation releases old textures. Continue full budget checks for growth or pending allocations, and preserve visibility-resume checks. Cover marginal headroom, persistent pressure and unknown pending memory.
Copy file name to clipboardExpand all lines: AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@ Avoid blocking work on latency-sensitive threads, unnecessary polling, duplicate
107
107
108
108
-**Threads** ([ARCHITECTURE §5 *Threads*](docs/ARCHITECTURE.md)): GL thread (`THREAD_PRIORITY_DISPLAY`) owns the projectM handle (create, render, load, settings) and output measurement; `AudioCapture` HandlerThread (`THREAD_PRIORITY_AUDIO`); a native worker for preset indexing and prefetch; a background shader-compile `std::thread` started from the GL thread (`preset_prewarm`); the UI polls status every 500 ms. Other entry points only write atomics or mutex-protected buffers; keep it that way.
109
109
-**Visibility and cleanup:**`MainActivity.onPause` stops the track watcher, UI refresh, updater and audio, then calls `visualizerView.onPause()`; `onResume` restarts them and re-checks notification access. `onDestroy` releases projectM on the GL thread (`queueEvent(renderer::release)`); after context loss the next `onSurfaceCreated` cleans up.
110
-
- **Frame pacing/quality:** half-refresh-rate pacing uses Choreographer. QualityController always uses Auto up to the detected panel, with FPS hysteresis/CPU-bound probe checks and a live ActivityManager memory budget initialized from application context in ProjectMCore.init. Standard is the Native trails default; Medium/High add the same passes with different gain. No user-facing fixed-resolution/static-RAM controls remain. Use `QualityController.setRenderAllocationSettings(trails, transitionSeconds)` to review the final tuple atomically. Reductions retain resident credit, while net growth and pending/context-recreated allocations require a full review. Managed clients publish dimensions/trails/transition as one generation-tagged rendering configuration; GL holds allocation settings until surface-size acknowledgement. Revalidate preserved/context-recreated resumes, reject stale generations, and base FPS on completed frames tagged with context/size. When an applied size change has `wasLastChangeForMemoryPressure()`, call the existing native pressure hook to flush pooled textures and pause prewarming. Do not claim a universal music-process survival guarantee from heuristic headroom.
110
+
- **Frame pacing/quality:** half-refresh-rate pacing uses Choreographer. QualityController always uses Auto up to the detected panel, with FPS hysteresis/CPU-bound probe checks and a live ActivityManager memory budget initialized from application context in ProjectMCore.init. Standard is the Native trails default; Medium/High add the same passes with different gain. No user-facing fixed-resolution/static-RAM controls remain. Use `QualityController.setRenderAllocationSettings(trails, transitionSeconds)` to review the final tuple atomically. After renewing the FPS generation, use `revalidateForAllocationChange(growing)`: confirmed reductions defer memory sampling until the new tuple renders and releases old textures, while net growth and pending allocations require a full review. Managed clients publish dimensions/trails/transition as one generation-tagged rendering configuration; GL holds allocation settings until surface-size acknowledgement. Use `revalidateForResume` for preserved/context-recreated resumes, reject stale generations, and base FPS on completed frames tagged with context/size. When an applied size change has `wasLastChangeForMemoryPressure()`, call the existing native pressure hook to flush pooled textures and pause prewarming. Do not claim a universal music-process survival guarantee from heuristic headroom.
111
111
-**No measured universal frame-time or memory bound is defined. Automatic memory uses documented conservative footprint/reserve estimates; see `docs/superpowers/specs/2026-10-05-native-trails.md`.** Compare before/after on the same TV, preset, render height and audio (PR template).
112
112
-**Measurement tools:** profile build + simpleperf ([docs/PROFILING.md](docs/PROFILING.md)); pin a preset with `adb shell setprop debug.projectmtv.preset '<name prefix>'` and clear it afterwards (`debug.projectmtv.update_from` also exists); `tools/tv-diagnostics.sh <tv-ip>:5555 --no-install --duration 180` ([docs/DIAGNOSTICS.md](docs/DIAGNOSTICS.md); profile builds require `--package nl.neerdael.projectmtv.profile` with a matching `--apk` or `--no-install`; build/`--release` modes reject alternate package IDs before connecting); Record actual Auto render sizes and compare target-FPS/trails workloads rather than forcing a resolution sweep. Preset Lab provides offline rendering comparisons (desktop timings do not establish TV performance).
113
113
-**Documented device coverage:** NVIDIA SHIELD TV 2019 (`sif`, 2 GB, 32-bit) and SHIELD TV Pro 2019 (`mdarcy`, 3 GB), Android 11; Ugoos AM6 (Amlogic S922X, Mali-G52 MP6, Android 9). No emulator configuration is committed.
Copy file name to clipboardExpand all lines: docs/ARCHITECTURE.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,6 +174,13 @@ The GL surface buffer is resized with `SurfaceHolder.setFixedSize(w, h)`. The di
174
174
175
175
On the historical2GB SHIELD, 1440p-and-above rendering caused Android’s low-memory killer to close SoundCloud and other processes. That observation motivates proactive headroom checks and cache/prewarm cleanup; it does not prove that any reserve guarantees survival under every vendor policy. Live music-process and memory validation remains necessary.
176
176
177
+
Managed hosts review trails/transition settings atomically, invalidate the old FPS generation,
178
+
then call `revalidateForAllocationChange(growing)`. A confirmed reduction publishes its current
179
+
height before sampling memory: the next new-generation rendered-frame sample observes the
180
+
texture release and still lowers resolution if pressure persists. Growth and unconfirmed
181
+
allocations require a fresh full budget. Visibility/context resumes independently use
182
+
`revalidateForResume` and always sample current memory before rendering.
183
+
177
184
### Frame pacing
178
185
Full rate renders continuously (`RENDERMODE_CONTINUOUSLY`). Half rate switches to `RENDERMODE_WHEN_DIRTY` and a `Choreographer` callback calls `requestRender()` on every second vsync: 30 fps at 60 Hz, 25 fps at 50 Hz. A steady half rate looks smoother than an uneven 40–50 fps and leaves the GPU room for heavy presets. projectM animates on wall-clock time, so the speed of the visuals doesn't change.
0 commit comments