feat(realtime): rename feature, make default, and report RT denials#1187
Merged
roderickvd merged 25 commits intomasterfrom May 7, 2026
Merged
feat(realtime): rename feature, make default, and report RT denials#1187roderickvd merged 25 commits intomasterfrom
roderickvd merged 25 commits intomasterfrom
Conversation
- Rename the `audio_thread_priority` feature to `realtime` and make it default. - Gate AAudio PERFORMANCE_MODE_LOW_LATENCY and PipeWire RT_PROCESS. - Rename ErrorKind::RealtimeUnavailable to RealtimeDenied. - Add RealtimeDenied error reporting to AAudio, PipeWire and JACK. - Fix AAudio error_callback not being forwarded to the caller.
0d5b90d to
7d7581e
Compare
knz
added a commit
to knz/cpal
that referenced
this pull request
May 6, 2026
The previous fix queued `DeletePlaybackStream` from `Stream::drop` but returned immediately. Because the delete is processed asynchronously on the reactor and the play_all driver thread only exits *after* the reactor wakes it, a process that exits shortly after dropping the Stream can race the worker threads — the delete may never reach the server, leaving exactly the leak this PR set out to fix. Store the spawned threads' JoinHandles on `Stream` and join them in `Drop` after signalling cancellation. Skip handles whose thread id matches the current thread, since the user's error_callback runs on those workers and may itself drop the Stream; joining ourselves would deadlock. Mirrors the pattern roderickvd is introducing for PipeWire in RustAudio#1187.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
audio_thread_priorityfeature torealtime-dbusand make it default.PERFORMANCE_MODE_LOW_LATENCYand PipeWireRT_PROCESS.ErrorKind::RealtimeUnavailabletoRealtimeDenied.error_callbacknot being forwarded to the caller.