|Audio APIs for Linux
||[Dec. 5th, 2007|11:20 pm]
Some observations on Linux desktop audio APIs.
- ALSA is a nice driver framework. ALSA sucks as a high-level audio API. Stop coding your general desktop use app in it. It is hard to configure and finicky, and most apps that claim to support it (e.g. ZSNES) don't actually support it very well.
- OSS is great if you are living in the days when a Sound Blaster 16 was a high-level audio card. Unfortunately, these days we need more than one program to be able to play sound at one time. More often than not, ESounD or aRts will be hogging /dev/dsp, resulting in incredibly confusing error messages to the end user. If your app (I'm looking at you, Praat and VMware) still uses OSS, please do us all a favor and upgrade.
- ESounD is GNOME only and basically works, but for real time apps it is slooooooow.
- aRts is KDE only, and since Ubuntu is the way things are increasingly going, it's more likely than not not installed on your users' machines.
What does that leave? It's an option that is all too often forgotten:
- SDL. SDL is simple and it has a remarkable tendency to just work. There are bindings to every language in existence, it's a mature codebase, and it embodies the Unix design philosophy well. Plus, if you write in SDL, you're portable to Windows and Mac OS X too!
I write this after fiddling with audio setting after audio setting in various programs, trying to get them to all work properly together, but to no avail. Then I set all the programs' audio output to SDL, and every single program worked.
If you're writing a Linux audio program, do your users a favor and use SDL by default.