Skip to content

fix(coreaudio): aggregate-device uuid collision + auto start to true#1198

Merged
roderickvd merged 2 commits into
RustAudio:masterfrom
umerhd:fix/coreaudio-loopback
May 11, 2026
Merged

fix(coreaudio): aggregate-device uuid collision + auto start to true#1198
roderickvd merged 2 commits into
RustAudio:masterfrom
umerhd:fix/coreaudio-loopback

Conversation

@umerhd
Copy link
Copy Markdown
Contributor

@umerhd umerhd commented May 11, 2026

Two independent bugs in macOS LoopbackDevice, one commit each.

  1. The aggregate-device UID was a hardcoded string literal, so concurrent LoopbackDevice instances collide on the same identity, and a crash before Drop leaves a stale registration that blocks the next launch. Suffix the UID with PID and a per-process atomic counter.
  2. kAudioAggregateDeviceTapAutoStartKey was set to false, so the sub-tap is not engaged when the aggregate device opens. The input stream looks live (valid sample rate, valid timestamps) but every buffer is silence. Flip to true.

@umerhd umerhd changed the title Fix/coreaudio loopback fix(coreaudio): aggregate-device uuid collision + auto start to true May 11, 2026
Copy link
Copy Markdown
Member

@roderickvd roderickvd left a comment

Choose a reason for hiding this comment

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

Thanks for catching and fixing this! Two minor points if you'd take a look at them. And if you would also add a short entry to CHANGELOG.md?

Comment thread src/host/coreaudio/macos/loopback.rs Outdated
Comment thread src/host/coreaudio/macos/loopback.rs Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should become @YES then?

@umerhd umerhd force-pushed the fix/coreaudio-loopback branch from 7f1e74d to fe25cad Compare May 11, 2026 18:48
@umerhd umerhd requested a review from roderickvd May 11, 2026 18:52
Comment thread src/host/coreaudio/macos/loopback.rs Outdated
/// @kAudioAggregateDeviceTapListKey : taps,
/// @kAudioAggregateDeviceTapAutoStartKey : @NO,
/// @kAudioAggregateDeviceTapAutoStartKey : @YES,
/// // If we set this to NO then I believe we need to make the Tap public as
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This comment can then be deleted, right?

@umerhd umerhd force-pushed the fix/coreaudio-loopback branch from fe25cad to b665a5a Compare May 11, 2026 19:16
@roderickvd roderickvd merged commit 2c7acf8 into RustAudio:master May 11, 2026
33 of 34 checks passed
@roderickvd
Copy link
Copy Markdown
Member

Thank you!

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