AudioObjectSetPropertyData with bluetooth devices on macOS Monterey (12.0.1)

In previous versions of macOS (Catalina & Big Sur) I used the following code in my app to mute the system Input device (assuming a good inputDeviceId):

let inputDeviceId = input.id
            
var address = AudioObjectPropertyAddress(
    mSelector: AudioObjectPropertySelector(kAudioDevicePropertyMute),
    mScope: AudioObjectPropertyScope(kAudioDevicePropertyScopeInput),
    mElement: AudioObjectPropertyElement(kAudioObjectPropertyElementMaster))

let size = UInt32(MemoryLayout<UInt32>.size)
var mute: UInt32 = muted ? 1 : 0

AudioObjectSetPropertyData(inputDeviceId, &address, 0, nil, size, &mute)

This worked great in both previous operating systems across all input devices I tested.

However, in macOS 12.0.1 this no longer works specifically for bluetooth devices. And, beyond that, it instead mutes the Output volume of these bluetooth devices. On the system microphone or via a line-in, this still works as expected.

I'm trying to determined what changed in Monterey that caused bluetooth devices to start behaving the opposite as they were before with respect to this API? Is there a new recommended approach for muting microphone input from Bluetooth devices?

Any help, guidance, or context here is appreciated.

Replies

Enabling/disabling mute in bluetooth input in Monterey Audio MIDI Setup app enables/disables mute in the output, so looks like this is new behaviour. Whether it's intentional or not is another matter. Log a bug I guess.

I’m seeing the same behavior. Apparently when AirPods or another Bluetooth headset is connected and being used as input, the output volume control becomes unavailable and the input mute controls both. Filed as FB9778272.

  • Thank you for your response and for filing a bug. That feedback doesn't seem to exist to me by searching or using your link, is it just private or was there some other issue filing? Just wanted to follow up because I'll be watching if a feedback was indeed followed.

  • I also filed a feedback (FB9574062) for this back in August. If you'd like to reference it in your issue or anything, maybe that will help? I'm pretty new to filing Feedback issues with Apple so unclear on the process—thus far it seems unanswered but I've been seeing the same behaviour (as have users of one of my apps that deals with microphone muting).

  • FWIW, I've also filed a bug about this same issue (FB9869817)

Add a Comment

@Apple, please fix this very annoying bug!

Same result when using AppleScript set volume input volume 0, which works fine without Airpods. Very annoying for WFH meetings.

This was fixed in MacOS 12.4

Add a Comment