I wanted to know the audio subsystem in OpenBSD (more specifically all the components beetween user applications and hardware), then I created an ASCII graph to describe it.

We could split the subsystem into 2 layers:

  • sndio implements and provides a library for the user space layer
  • OpenBSD audio/midi drivers implement the kernel space layer.

The links are below.



   +------+	+------+	     +------+
   | app1 |	| app2 |    ....     | appN |
   +------+	+------+	     +------+
      |		   |			 |
      v            v			 v
+-----------------------------------------------+
|		     sndio.h			|
|	    sio_open(3)/mio_open(3)		|
| interface to audio devices and MIDI streams	|
+-----------------------------------------------+
       |		|	       |
       |	        v	       | 
       |    +-----------------------+  |
       |    |	     sndiod(8)	    |  |
       |    |   audio/midi server   |  |
       |    +-----------------------+  |
       |        |	         |     |  User
       |        |	         |     |  space
-------------------------------------------------
       |        |	         |     |  Kernel
       |        |	         |     |  space
       v        v	         v     v
   +--------------------+   +-------------+
   |     audio(4) 	|   |   midi(4)   |
   | device-independent |   | raw device  |
   |   driver layer	|   | independent |
   +--------------------+   |  interface  |
    	      |	            +-------------+
	      |		          |
	      v		          v
       +---------------------------------+  
       |    device dependent driver      |
       |   (azalia(4), ac97(4), ...)	 |
       +---------------------------------+
			|
		        v
    +--------------------------------------+
    | 	           audio or MIDI    	   |
    |					   |
    |		     Hardware		   |
    +--------------------------------------+

Links:

  • sndio official page
  • sndio(7) interface to audio and MIDI
  • sio_open(3) sndio interface to audio devices
  • mio_open(3) sndio interface to MIDI streams
  • sndiod(8) audio/MIDI server
  • audio(4) device-independent audio driver layer
  • midi(4) raw device independent interface to MIDI ports
  • Some hardware-specific driver:
    • azalia(4) generic High Definition Audio device
    • ac97(4) generic AC’97 codec driver