FreeBSD The Power to Serve

nv(9)-based audio device enumeration

Contact: Ka Ho Ng <khng@FreeBSD.org>

This work presents a number of ioctl commands on /dev/sndstat using nv(9) to expose all available audio device nodes. nv(9) is used to generate a serialized binary stream representation of the information of audio device nodes presented in the running system. The documented nvlist structure in sndstat(4) manual page is stable for programming use.

For a long time, enumerating the audio device node interface required parsing content of /dev/sndstat. It is tedious to write such a parser and handle different hw.snd.verbose levels correctly. Using nv(9) eliminates the need to write a text parser to do audio device nodes enumeration.

This work has been committed and is available in FreeBSD 14-CURRENT.

Sponsor: The FreeBSD Foundation


Last modified on: May 1, 2021 by Daniel Ebdrup Jensen