Use new QEMU -audiodev to setup audio devices

Migrate to the new `-audiodev` . This also clearly labels the audio inputs and outputs in audio mixers on the host.
This commit is contained in:
Martin Wimpress 2020-03-20 13:46:18 +00:00
parent 2690663b3b
commit c4bea19bf2
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3
2 changed files with 5 additions and 4 deletions

View File

@ -94,4 +94,5 @@ You can also pass optional parameters
- [x] Improve stdout presentation
- [x] Make disk image optionally size configurable
- [ ] Improve snapshot management
- [ ] Create desktop launcher for a VM
- [ ] Create desktop launcher for a VM
- [x] Get QEMU `-audiodev` working for audio input, something like:

View File

@ -183,18 +183,17 @@ function vm_boot() {
-net user"${NET}" \
-rtc base=localtime,clock=host \
-serial mon:stdio \
-soundhw hda \
-audiodev pa,id=pa,server=unix:$XDG_RUNTIME_DIR/pulse/native,out.stream-name=${LAUNCHER}-${VMNAME},in.stream-name=${LAUNCHER}-${VMNAME} \
-device intel-hda -device hda-duplex,audiodev=pa \
-usb -device usb-kbd -device usb-tablet \
-object rng-random,id=rng0,filename=/dev/urandom \
-device virtio-rng-pci,rng=rng0 \
-device qemu-xhci \
-device virtio-vga,virgl=${VIRGL},xres=${xres},yres=${yres} \
${display} \
"$@"
}
function usage() {
local LAUNCHER=$(basename $0)
echo
echo "Usage"
echo " ${LAUNCHER} --vm ubuntu.conf"
@ -211,6 +210,7 @@ DELETE=0
ENABLE_EFI=0
readonly QEMU="/snap/bin/qemu-virgil"
readonly QEMU_IMG="/snap/bin/qemu-virgil.qemu-img"
readonly LAUNCHER=$(basename $0)
RESTORE=0
SNAPSHOT=0
VM=""