From e53021d0294d9118a3c975aa2380c88e95ded9e2 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Sat, 13 Nov 2021 16:30:56 +0000 Subject: [PATCH] When SPICE is requested, also use SPICE for audio. Close #209 --- quickemu | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/quickemu b/quickemu index 711cace..73f0b3b 100755 --- a/quickemu +++ b/quickemu @@ -191,6 +191,7 @@ function efi_vars() { } function vm_boot() { + local AUDIO_DEV="" local BALLOON="-device virtio-balloon" local BOOT_STATUS="" local CPU="" @@ -591,6 +592,12 @@ function vm_boot() { echo " - CD-ROM: ${fixed_iso}" fi + # Setup the appropriate audio device based on the display output + case ${OUTPUT} in + spice|spice-app|none) AUDIO_DEV="spice,id=audio0,out.mixing-engine=off";; + *) AUDIO_DEV="pa,id=audio0,out.mixing-engine=off,out.stream-name=${LAUNCHER}-${VMNAME},in.stream-name=${LAUNCHER}-${VMNAME}";; + esac + # Determine a sane resolution for Linux guests. if [ "${guest_os}" == "linux" ]; then local X_RES=1152 @@ -806,7 +813,7 @@ function vm_boot() { -device usb-ehci,id=input -device usb-kbd,bus=input.0 -device ${MOUSE},bus=input.0 - -audiodev pa,id=audio0,out.mixing-engine=off,out.stream-name=${LAUNCHER}-${VMNAME},in.stream-name=${LAUNCHER}-${VMNAME} + -audiodev ${AUDIO_DEV} -device intel-hda -device hda-duplex,audiodev=audio0 -rtc base=localtime,clock=host,driftfix=slew -spice ${SPICE}