Skip to content

feat(realtime): rename feature, make default, and report RT denials#1187

Merged
roderickvd merged 25 commits intomasterfrom
feat/update-thread-priority
May 7, 2026
Merged

feat(realtime): rename feature, make default, and report RT denials#1187
roderickvd merged 25 commits intomasterfrom
feat/update-thread-priority

Conversation

@roderickvd
Copy link
Copy Markdown
Member

@roderickvd roderickvd commented May 2, 2026

  • Rename the audio_thread_priority feature to realtime-dbus 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.

- 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.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

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 comment was marked as resolved.

This comment was marked as resolved.

@roderickvd roderickvd merged commit dccd6b4 into master May 7, 2026
30 of 31 checks passed
@roderickvd roderickvd deleted the feat/update-thread-priority branch May 7, 2026 21:02
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