Skip to content

fix: re-anchor instead of Clear on static-delay change (kills offset-tuning silence)#54

Merged
chrisuthe merged 2 commits into
masterfrom
fix/static-delay-reanchor
Jun 16, 2026
Merged

fix: re-anchor instead of Clear on static-delay change (kills offset-tuning silence)#54
chrisuthe merged 2 commits into
masterfrom
fix/static-delay-reanchor

Conversation

@chrisuthe

Copy link
Copy Markdown
Owner

Problem

Adjusting the static-delay slider blanked the audio for tens of seconds on every nudge — making the offset impossible to tune by ear.

OnSettingsStaticDelayMsChanged called _audioPipeline.Clear(), which dumps the entire buffer. With a server that transmits far ahead of playback (30–44s observed), the only audio that refills is future-timestamped, so the buffer waits that whole transmit-ahead window in silence before playing again.

Fix

Swap Clear() for the new IAudioPipeline.ReanchorTiming() (Sendspin.SDK 9.0.5, #57 upstream), which forwards to the device-switch-proven TimedAudioBuffer.ResetSyncTracking(). It re-anchors timing — so the next callback re-derives the scheduled start with the new StaticDelayMs — while preserving the buffered audio. The delay applies in place, no refill, no silence.

Bumps Sendspin.SDK 9.0.4 → 9.0.5.

Tests

StaticDelayReanchorTests exercises the buffer primitive directly:

  • ResetSyncTracking → buffer preserved (>1000ms retained), audio flows on the next read.
  • Clear → buffer emptied (<1ms), output silence — the old behavior.

Build green, full suite 96/96.

Verify

Merging publishes a dev build: move the offset slider mid-playback — the change should apply immediately with no audio dropout.

…tuning silence)

Moving the static-delay slider called _audioPipeline.Clear(), which dumps the
entire buffer. With a server that transmits far ahead of playback (30-44s), the
only audio that refills is future-timestamped, so the buffer waited that whole
window in silence on every nudge — making the offset impossible to tune by ear.

Swap Clear() for IAudioPipeline.ReanchorTiming(), which forwards to the
device-switch-proven TimedAudioBuffer.ResetSyncTracking(): it re-anchors timing
(picking up the new StaticDelayMs) while preserving buffered audio, so the delay
applies in place with no refill wait.

Requires Sendspin.SDK 9.0.5 (adds IAudioPipeline.ReanchorTiming) — lands with
that bump. Adds StaticDelayReanchorTests proving ResetSyncTracking preserves the
buffer and keeps audio flowing, whereas Clear empties it (silence).
@chrisuthe
chrisuthe merged commit ef7f715 into master Jun 16, 2026
2 checks passed
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