Merge pull request #446 from ddowse/sound

Add HD Audio device to guest via config
This commit is contained in:
Matt Churchyard
2022-02-15 15:38:07 +00:00
committed by GitHub
2 changed files with 20 additions and 0 deletions

View File

@@ -192,6 +192,7 @@ vm::run(){
vm::bhyve_device_passthru
vm::bhyve_device_fbuf
vm::bhyve_device_mouse
vm::bhyve_device_sound
vm::bhyve_device_console
vm::lock
@@ -718,6 +719,16 @@ vm::bhyve_device_mouse(){
fi
}
vm::bhyve_device_sound(){
local _play
config::get "_play" "sound_play" "/dev/dsp0"
if config::yesno "sound"; then
_devices="${_devices} -s ${_slot}:0,hda,play=${_play}"
_slot=$((_slot + 1))
fi
}
# add virtio_console devices to the guest
#
# @modifies _devices _slot

9
vm.8
View File

@@ -1457,6 +1457,15 @@ Set this option to
in order to provide an XHCI mouse device to the guest.
This tracks much better than the default PS2 mouse in VNC settings, although
this mouse may not supported by older guests.
.It sound
Set this option to
.Sy yes
in order to provide HD Audio Emulation to the guest. Please see
.Sy bhyve(8)
for details.
.It sound_play
Set this to the desired audio output device of the host to the guest. Defaults to
.Sy '/dev/dsp0'
.It virt_consoleX
Allows the creation of up to 16 virtio-console devices in the guest. The value
to this option can be