Skip to content

Fix half-speed playback and audio echo on slower machines#130

Merged
dazzatronus merged 1 commit into
mainfrom
derk/eng-716-studio-preview-playback-runs-at-half-speed-with-audio-echo
Jun 26, 2026
Merged

Fix half-speed playback and audio echo on slower machines#130
dazzatronus merged 1 commit into
mainfrom
derk/eng-716-studio-preview-playback-runs-at-half-speed-with-audio-echo

Conversation

@dazzatronus

Copy link
Copy Markdown
Contributor

What

Preview playback now follows real wall-clock time. The playhead previously advanced by accumulating per-frame deltas that were capped to a 60fps budget, so on any machine that could not sustain 60fps it advanced slower than real time: video ran at roughly half speed, and audio (which plays at real time on its own hardware clock) was repeatedly re-synced backwards onto the lagging playhead, producing an echo. One cause, both symptoms.

Behaviour change

  • Playback tracks real elapsed time on every machine. On slow hardware visual frames drop instead of the clock slowing down; audio and video stay in sync.
  • Export is unaffected: it sets the playhead to each exact frame time and remains deterministic.

How

play() anchors performance.now() and the current playback time; each tick sets playbackTime = anchor + (now - anchorWall). The per-frame audio/video re-sync logic becomes a rare safety net rather than a continuous correction loop. Removed the PixiJS ticker.minFPS = 60 line that was capping the frame-time delta.

Verify

DevTools → Performance → CPU throttle (6× or 20×), then play a timeline with audio: a 10s clip takes 10s of real time and audio stays in sync; only the visual frame rate drops. jest is green (1802 tests).

Note for reviewers: a pre-existing typecheck failure unrelated to this change (asset src optionality) is addressed separately; this PR touches only the playback clock.

@dazzatronus dazzatronus self-assigned this Jun 26, 2026
@dazzatronus dazzatronus merged commit 45e1100 into main Jun 26, 2026
1 check passed
@dazzatronus dazzatronus deleted the derk/eng-716-studio-preview-playback-runs-at-half-speed-with-audio-echo branch June 26, 2026 04:20
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.11.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant