OpenBSD audio in virtualisation

While some use the documentation correctly and search the mailing lists, sometimes the answers don’t come up correctly due to formatting or google having issues indexing.

As I use OpenBSD more and more as a daily driver (be it still in VMWare Workstation on one machine and Virtual Box on the other), I still don’t have it on raw workstation hardware.  I want my audio and video to work but out of the box on the above platforms, but my audio was either sketchy or non-existent.

I knew the audio device was working correctly through some of the standard tests and getting garbage out of speakers, but software still wasn’t playing nicely.  After a bit of searching and reading the man page, a simple addition to the /etc/rc.conf.local file of:

sndiod_flags=-m play

Fixed the issue.  After adding the above, don’t forget to /etc/rc.d/sndiod restart so the flags take effect.

Some suggestions were to disable sndiod – which does work – but the OpenBSD developers advise against this and still recommend the above flag.