Skip to content

Expose Virtio output stream configuration without a host sink #222

Description

@shreyas-blacksmith

Is your feature request related to a problem? Please describe.

The package exposes NewVirtioSoundDeviceHostOutputStreamConfiguration, which constructs a VZVirtioSoundDeviceOutputStreamConfiguration and assigns a VZHostAudioOutputStreamSink. It does not currently expose the underlying output-stream configuration without a host sink, even though the Objective-C bridge already contains newVZVirtioSoundDeviceOutputStreamConfiguration.

This prevents headless VM callers from attaching a guest-visible Virtio playback device without also routing samples to the host's default output device. Apple documents that the output stream's sink defaults to nil and that omitting a sink suppresses the audio:

https://developer.apple.com/documentation/virtualization/vzvirtiosounddeviceoutputstreamconfiguration/sink

Describe the solution you'd like

Export a VirtioSoundDeviceOutputStreamConfiguration Go wrapper and a NewVirtioSoundDeviceOutputStreamConfiguration constructor that uses the existing Objective-C constructor without assigning a host sink.

The API mirrors Apple's VZVirtioSoundDeviceOutputStreamConfiguration name and the package's existing input/output stream wrapper conventions. It is available on macOS 12 and newer, matching the native API.

Describe alternatives you've considered

  • Use NewVirtioSoundDeviceHostOutputStreamConfiguration: this routes guest audio to the host and introduces host device, login-session, and permission dependencies that headless VMs do not need.
  • Install a virtual audio driver in every guest image: this adds guest-image state and maintenance for behavior already supported by Virtualization.framework.
  • Maintain the wrapper in a downstream fork: workable as a short-term bridge, but undesirable as a permanent dependency fork for a generally useful API.

Additional context

In downstream end-to-end testing, a headless macOS VM initially exposed no CoreAudio output device. With the proposed output stream attached, macOS 15 and macOS 26 guests both discovered a default output device and received render callbacks.

The proposed patch is limited to the Go wrapper and the existing macOS-availability test table. It does not change the Objective-C bridge or the behavior of existing host-audio constructors.

This issue and the proposed patch were prepared with AI assistance and reviewed and validated against the native API and downstream end-to-end results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions