bhyve guest HD audio in FreeBSD 12.1

HD audio works now on FreeBSD 12.1 bhyve guests, than to the following work https://wiki.freebsd.org/SummerOfCode2016/HDAudioEmulationForBhyve

In order to use it under FreeBSD 12.1, you need commit 349335 and 350255 from FreeBSD head, that you can get at the following two links, https://reviews.freebsd.org/rS349335, https://reviews.freebsd.org/rS350255.

Alternatively, you can get them by using svn

$ cd $HOME
$ svn co https://svn.FreeBSD.org/base/head freebsd-head
$ cd  freebsd-head
$ svn diff -c 349335 > patch1.diff
$ svn diff -c 350255 > patch2.diff

Now we proceed in patching FreeBSD 12.1 bhyve source code (if you didn’t install the base source code when installing FreeBSD, you can always get it the source code ftp://ftp.freebsd.org/pub/FreeBSD/releases/arm64/12.1-RELEASE/src.txz and unpack it as root with ‘tar -C / -xvf src.txz’)

# cd /usr/src/usr.sbin/bhyve
# patch -Np2 -i $HOME/freebsd-head/patch1.diff
# patch -Np2 -i $HOME/freebsd-head/patch2.diff
# make
# make install

After installing the patched bhyve version, you can add the following command line option for bhyve when you start your VM to get HD sound

-s 6,hda,play=/dev/dsp0,rec=/dev/dsp0

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.