Skip to content

feat: report xrun via CallbackInfo instead of ErrorKind#1270

Merged
roderickvd merged 10 commits into
developfrom
feat/xrun-in-data-callback
Jul 13, 2026
Merged

feat: report xrun via CallbackInfo instead of ErrorKind#1270
roderickvd merged 10 commits into
developfrom
feat/xrun-in-data-callback

Conversation

@roderickvd

Copy link
Copy Markdown
Member

This PR came out of a Discord discussion with @BillyDM and @edwloef about where xrun status belongs.

Currently xruns are reported in the error callback, which have no ordering guarantee relative to the data callback. The issue with this is that for engines to skip forward to stay in sync with something else needs to know which data callback followed a glitch. That only works if the flag rides along with the data itself, not through a side channel.

RtAudio does the same thing.

With this PR:

  • ErrorKind::Xrun is gone in favor of CallbackInfo::xrun().
  • InputCallbackInfo/OutputCallbackInfo are unified into CallbackInfo, InputStreamTimestamp/OutputStreamTimestamp into StreamTimestamp.
  • DuplexCallbackInfo is now { input: CallbackInfo, output: CallbackInfo }.
  • PulseAudio's NoData is now more accurately mapped to BackendError instead of guessing it's an xrun.

@roderickvd roderickvd force-pushed the feat/xrun-in-data-callback branch from dee2ec7 to 3d8439b Compare July 13, 2026 19:22
@roderickvd

Copy link
Copy Markdown
Member Author

cc @Decodetalkers for the duplex API improvement.

@roderickvd

Copy link
Copy Markdown
Member Author

As this one touches so many files, I'm gonna commit it and apply fixes as necessary later.

@roderickvd roderickvd merged commit 10c78af into develop Jul 13, 2026
32 checks passed
@roderickvd roderickvd deleted the feat/xrun-in-data-callback branch July 13, 2026 20:46
@Decodetalkers

Decodetalkers commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

I haven't follow develop for a long time.. what is xrun for?

I will start working on duplex for it.

@roderickvd

Copy link
Copy Markdown
Member Author

Sorry for the confusion, I meant to tag @gulbrand who has been working on the duplex API.

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.

2 participants