Skip to content

fix(coreaudio): declare aggregate_device_id as mut and check AudioHardwareCreateProcessTap status#1123

Merged
roderickvd merged 3 commits intoRustAudio:masterfrom
thewh1teagle:fix/loopback-aggregate-device
Mar 16, 2026
Merged

fix(coreaudio): declare aggregate_device_id as mut and check AudioHardwareCreateProcessTap status#1123
roderickvd merged 3 commits intoRustAudio:masterfrom
thewh1teagle:fix/loopback-aggregate-device

Conversation

@thewh1teagle
Copy link
Contributor

I was using cpal 0.17.3 for loopback recording on macOS and getting The requested device is no longer available in release builds.

Two bugs in loopback.rs:

  1. aggregate_device_id was not declared mut — UB when the compiler optimizes away the write in release mode, leaving the device ID as 0.
  2. AudioHardwareCreateProcessTap status was ignored — silent failure leads to invalid tap ID.

Fixed by adding mut to aggregate_device_id, using NonNull::from(&mut aggregate_device_id), and propagating the tap creation status via check_os_status.

Related

@roderickvd
Copy link
Member

Thank you! Merging now.

@roderickvd roderickvd merged commit 405e840 into RustAudio:master Mar 16, 2026
29 checks passed
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