Changes in qemu 4.0 for passthrough (particularly for pulseaudio + ac97)
Version
1 | QEMU emulator version 4.0.0 |
1 | Installed versions: 4.0.0(05:38:52 PM 05/04/2019)(aio alsa bzip2 caps curl fdt filecaps gtk iscsi jpeg ncurses nls opengl pin-upstream-blobs png pulseaudio sdl seccomp usb vhost-net vnc xattr -accessibi |
Machine Type
To integrate a few audio patches I upgraded the machine type from 3.0 to 4.0.
Turns out when you upgrade the machine type you also need kernel_irqchip=on
or
the nvidia driver wont work.
1 | - -machine pc-q35-3.0,accel=kvm \ |
Audio dev
With the previous patch I had to do
1 | export QEMU_AUDIO_DRV=pa |
which will now cause qemu to abort immediately on launch with -soundhw ac97
.
Instead we should do
1 | + -audiodev pa,id=pa1,server=`pactl info | grep 'Server String' | awk '{print $3}'` |
Note how I’ve to get the pulse socket dynamically from pactl
on my
systemd free Gentoo installation. If it’s on a systemd machine it can be
replaced with server=/run/user/1000/pulse/native
.
Thanks to /u/spheenik (reddit announcement) whose audio patches I’ve been using for a long time.