Skip to content

Keep full-quality playback near 60 FPS with live preview - #135

Merged
sshcrack merged 2 commits into
masterfrom
perf/bulk-framebuffer-cadence
Nov 9, 2026
Merged

sshcrack merged 2 commits into
masterfrom
perf/bulk-framebuffer-cadence

Conversation

@sshcrack

@sshcrack sshcrack commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Full-quality desktop playback loses frames when a visible live preview requests hardware readback. On the deployed Pi, this change keeps the same Metablob scene near 60 presentation FPS with preview active while preserving the exact GPIO bitplanes.

  • Consume published rpi-rgb-led-matrix v0.1.12, released from the actual library checkout through library PR #11. The grouped converter, lazy exact inverse-color lookups, Windows compatibility fix and hardware equivalence tests live there. Both app overlay patches are removed.
  • Route offload, video, shader streams and AudioKit buffers through the library's packed-RGB bulk converter. Brightness, gamma, RGB ordering, PWM depth, mapper behavior and visual output are preserved.
  • Keep automatic preview strictly viewer-driven, coalesced and inactive while hidden; idle sockets do no capture work.
  • Update a reused worker session's target FPS without restarting its scene, timeline, sequence or transition. The optional state field remains compatible with protocol 4; updated desktop workers gain the rate correction.
  • Pace Pi frames against absolute fractional deadlines, filling only the remainder left by VSync and skipping missed slots after stalls.

Validation against the published library release:

  • Full emulator build: 51 tests passed, including visual regressions and preview demand coverage.
  • Full Linux desktop build: 48 tests passed, including worker rendering, state continuity and saved contract fixtures.
  • ARM build passed. Library hardware/SDL configurations passed 5/8 tests; its native Windows emulator and both Python configurations passed CI before release.
  • Hardware bitplane equivalence and the original readback fingerprint were verified on the laptop and Pi with the same library conversion code.
  • Controlled Pi A/B/A trials, about 30 seconds per condition, desktop placement and quality 1.0 throughout retained samples:
    • No preview: installed 58.66–58.72 FPS; candidate 59.81 FPS.
    • Automatic preview: installed 53.26–53.36 FPS; candidate 59.96 FPS.
    • Daemon CPU reduced about 7.7%; throttling remained 0x0 at 1.2 GHz.
  • Isolated Pi RGB blits: 7.226 ms scalar → 4.428 ms bulk; requested readback: 11.760 → 7.020 ms.
  • Presentation counts can include repeated fresh remote frames; these averages do not establish 60 unique, evenly spaced frames per second. Preliminary runs with incomplete plugin upload or a placement change were excluded.

See docs/pi-frame-pacing.md for measurements and test details. The installed service, original 13 presets and Automatic Mode were restored after benchmarking.

Screenshots and scene preview GIF regeneration are skipped: this changes performance and scheduling, with byte-identical panel output and no UI, scene look or default property change. Build outputs, profiles and benchmark artifacts are not committed.


📦 Build artifacts

Built from 2580dae · CI run

Platform Download Archive size
desktop-linux-build Download 263 MiB
desktop-windows-build Download 40 MiB
led-matrix-build Download 356 MiB
web-build Download 0 MiB

@sshcrack
sshcrack merged commit 6891e09 into master Nov 9, 2026
11 checks passed
@sshcrack
sshcrack deleted the perf/bulk-framebuffer-cadence branch November 9, 2026 21:54
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