Skip to content

config(apple): give Linux guests a sound device for each stream - #8128

Open
UTMapp-bot wants to merge 1 commit into
utmapp:mainfrom
UTMapp-bot:fix/apple-linux-audio-output
Open

UTMapp-bot wants to merge 1 commit into
utmapp:mainfrom
UTMapp-bot:fix/apple-linux-audio-output

Conversation

@UTMapp-bot

Copy link
Copy Markdown

A Linux guest on the Apple Virtualization backend has had no sound output since 5.0.3: GNOME shows a "Dummy Output" and nothing is played, while the microphone works.

#7692 put the microphone and the speaker on one sound device, input first, to stop coreaudiod from syncing two clocks with macOS guests. In a Linux guest that one device is one sound card with two PCM devices (0 = capture, 1 = playback), and the sound server (PipeWire, PulseAudio) only uses the first one. So it finds a microphone and no output.

macOS guests keep the single device. Other guests get one device for each stream again, as before #7692: two sound cards, each with one PCM device, which the sound server uses both.

Resolves #8105

Testing

Tested by an AI agent on a MacBook Pro M2 Max, macOS 27.2 (26B123), with a Debug build of the macOS scheme.

Guest: Ubuntu 26.04 server (arm64 cloud image, kernel 7.0.0-38) on the Apple Virtualization backend, with PipeWire 1.4, WirePlumber and alsa-utils installed, driven over SSH. The VM was made by scripting, which cannot turn sound on, so for these runs a temporary change (not in this PR) read the sound device layout from an environment variable.

Layout /proc/asound/pcm wpctl status
one device, input then output (5.0.8) 00-00 capture, 00-01 playback Sinks: Dummy Output; Sources: Virtio 1.0 sound
one device, output then input 00-00 playback, 00-01 capture Sinks: Virtio 1.0 sound; Sources: none
two devices (this PR) 00-00 capture, 01-00 playback Sinks: Virtio 1.0 sound; Sources: Virtio 1.0 sound
  • Before (the first row): the default sink is auto_null, as in the issue.
  • After (the code of this PR, with sound forced on): the default sink is alsa_output.pci-0000_00_09.0.stereo-fallback. While speaker-test plays a tone in the guest, the Mac's pmset -g assertions shows coreaudiod holding audio-out BuiltInSpeakerDevice, and it showed none before the tone. pw-record records from the default source.

The new UTMAppleConfigurationAudioTests checks the devices the configuration creates: a device for each stream for a Linux guest, one device with both streams for a macOS guest, and only the enabled streams for both. testLinuxGuestGetsADeviceForEachStream fails without the fix ([["input", "output"]] is not equal to [["input"], ["output"]]) and passes with it. The static checks pass.

Not tested: listening to the output, a macOS guest (its device layout is unchanged, which the unit test checks), and Debian (the issue also names it; it uses the same sound server).

Since the microphone and the speaker of an Apple Virtualization VM were
put on one sound device (4784026), a Linux guest has had no sound
output: the device's first stream is the input, the Linux sound server
(PipeWire, PulseAudio) only uses the first stream of a sound device, so
the guest gets a microphone and a "Dummy Output".

That change was made for macOS guests, where two devices made
coreaudiod busy keeping two clocks in sync. Keep one device there, and
give other guests one device for each stream, as before that change.

Resolves utmapp#8105

Assisted-by: Claude:claude-fable-5-2
@osy
osy force-pushed the fix/apple-linux-audio-output branch from 3976bb4 to af6ca30 Compare November 12, 2026 06:46
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.

Apple Virtualization, Linux guest: no audio output

2 participants