Skip to content

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

Open
thewh1teagle wants to merge 1 commit intoRustAudio:masterfrom
thewh1teagle:fix/loopback-aggregate-device
Open

fix(coreaudio): declare aggregate_device_id as mut and check AudioHardwareCreateProcessTap status#1123
thewh1teagle wants to merge 1 commit intoRustAudio:masterfrom
thewh1teagle:fix/loopback-aggregate-device

Conversation

@thewh1teagle
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant