Writing an ALSA Driver (2007)
This doc is pretty old, but still was invaluable for actually writing a sound card driver when I was tasked to do so. Frankly, ALSA is one of the most over convoluted interfaces I&#x27;ve ever had the displeasure to work with when writing one.<p>Unfortunately, I wasn&#x27;t writing a PCI driver -- I was writing an I2C&#x2F;I2S driver that used the ASoC subsystem and its insane DAPM and audio routing. Most of ALSA seems to have been abandoned by its creators, and conventions are not adhered to in 99% of the routing and DAPM graphs. Since they&#x27;re all stringly typed and the userland vs. the kernel naming is completely disjoint, this means that its practically a black art to get those graphs right.<p>Add pulseaudio&#x27;s complete insanity with regard to hardware parameters and audio routing, and you have one of the most toxic development experiences of my life.<p>Frankly, I&#x27;m amazed anybody can get anything done with this system at all, and I&#x27;m amazed Linus hasn&#x27;t ripped it all out by now. This is the one subsystem that should have been the easiest to implement and get right.<p>Audio on Linux is such a total shitshow that Android replaced ALSA with a total workaround called &quot;tinyalsa&quot; and ChromeOS replaced pulse and half of ALSA&#x27;s routing behaviors with cras.