Skip to content

fix(wasapi): racy timestamp callback padding#1246

Open
roderickvd wants to merge 5 commits into
masterfrom
fix/wasapi-racy-callback-padding
Open

fix(wasapi): racy timestamp callback padding#1246
roderickvd wants to merge 5 commits into
masterfrom
fix/wasapi-racy-callback-padding

Conversation

@roderickvd

@roderickvd roderickvd commented Jun 9, 2026

Copy link
Copy Markdown
Member

Pre-v0.18 the WASAPI playback timestamps were not monotonic because the padding calculation was backward. v0.18 made that go away for the most part here, but still keeps a tiny window between two syscalls that could make it go awry.

This PR does an atomic read on the callback timestamp and playback position instead of those two syscalls.

Fixes BillyDM/Firewheel#43

This comment was marked as outdated.

@roderickvd roderickvd force-pushed the fix/wasapi-racy-callback-padding branch from 0cf8034 to 582d5e7 Compare June 11, 2026 19:17
@roderickvd roderickvd requested a review from Copilot June 11, 2026 19:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread src/host/wasapi/stream.rs
Comment thread src/host/wasapi/stream.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error: CPAL and/or the system audio API returned invalid timestamp.

2 participants