Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Your pulseaudio method appears to be rather complex. I've found a oneliner modification to the XML generated by default by virt-manager (at least for my FreeBSD VM and ArchLinux host) that gets pulseaudio working.
- So, my very first configuration used to be:
- <qemu:commandline>
- <qemu:env name="QEMU_AUDIO_DRV" value="pa"/>
- <qemu:env name="QEMU_PA_SERVER" value="unix:/tmp/pulse-socket-for-freebsd-on-kvm"/>
- </qemu:commandline>
- This^^^ was not necessarily for "4.1 and below"; it actually worked until 5.2.x and the legacy support for these environment variables got ultimately dropped in 6.0. Which brought me to your blogpost. ;-)
- For the record, your solution worked fine for me. It gave me audio on FreeBSD in KDE:
- <qemu:commandline>
- <qemu:arg value="-device"/>
- <qemu:arg value="ich9-intel-hda,bus=pcie.0,addr=0x1b"/>
- <qemu:arg value="-device"/>
- <qemu:arg value="hda-micro,audiodev=hda"/>
- <qemu:arg value="-audiodev"/>
- <qemu:arg value="pa,id=hda,server=unix:/tmp/pulse-socket-for-freebsd-on-kvm"/>
- </qemu:commandline>
- However, this^^^ low-level configuration does *not* resemble the audio devices configured by default by virt-manager, which is quite confusing, because it doesn't appear in the left configuration bar in virt-manager etc.
- So ultimately my solution was to create a "default" ICH9 audio card in virt-manager, which translates into something like this:
- <devices>
- <sound model="ich9">
- <address type="pci" domain="0x0000" bus="0x00" slot="0x1b" function="0x0"/>
- </sound>
- <audio id="1" type="none"/>
- </devices>
- Now this^^^ won't work by default, presumably, because sound goes to nowhere. But it suffices to replace the <audio> element with this:
- <audio id="1" type="pulseaudio" serverName="unix:/tmp/pulse-socket-for-freebsd-on-kvm"/>
- There. That makes audio work. One can (presumably) set the ID to something else (instead of the default), say 7, and then set <audio id="7"/> inside <sound>. But with just one sound card the default is the shortest option.
- Here's the trick in /etc/pulse/default.pa:
- load-module module-native-protocol-unix auth-group=kvm socket=/tmp/pulse-socket-for-freebsd-on-kvm
- The last bit of the puzzle is that my qemu runs under the kvm group.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement