apple: allow sound input and output to be enabled separately - #7902
Merged
Merged
Conversation
Since the input and output streams were merged into a single virtio-sound device, playing audio in the guest also opens the host microphone, which switches Bluetooth headphones into headset mode. Replace the "Enable Sound" toggle with a choice of input only, output only, or both so users can avoid opening the microphone. The existing "Audio" key keeps meaning output and a new "AudioInput" key is added. When "AudioInput" is missing it defaults to "Audio", so existing configs keep both streams and new configs still load on older versions of UTM. Resolves #7875 Assisted-by: Claude:claude-opus-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #7692 merged the Apple backend's sound input and output streams into a single virtio-sound device, playing audio in the guest also opens the host microphone. This switches Bluetooth headphones such as AirPods into headset mode (lower quality audio) whenever the guest plays sound, even if microphone access is denied.
This replaces the "Enable Sound" toggle in the Apple VM settings with a Sound picker: Disabled, Input Only, Output Only, Input and Output. The host microphone stream is only added to the device when input is enabled, so "Output Only" never opens the microphone. The single-device layout from #7692 is kept.
For compatibility, the existing
Audiokey keeps meaning output and a newAudioInputkey is added. WhenAudioInputis missing it defaults to the value ofAudio, so existing VMs keep both input and output, and configs saved by this version still load on older UTM releases. New VMs from the wizard and scripting still default to Input and Output.Resolves #7875
Testing: Tested by a human on macOS 27.0 host (MacBook Air 15-inch, M3) with a macOS 26 guest, using Bluetooth headphones:
The author acknowledges that this change has been tested and/or reviewed by a human in accordance with UTM's AI contribution guidelines.