Product SiteDocumentation Site

Chapter 2. Software for Sound Cards

2.1. How Linux Deals with Audio Hardware
2.2. Sound Servers
2.2.1. PulseAudio
2.2.2. JACK Audio Connection Kit
2.2.3. Phonon
2.3. Use the JACK Audio Connection Kit
2.3.1. Install and Configure JACK
2.3.2. Using QjackCtl
2.3.3. Integrate PulseAudio with JACK
One of the techniques consistently used in computer science is abstraction. Abstraction is the process of creating a generic model for something (or some things) that are actually unique. The "driver" for a hardware device in a computer is one form of dealing with abstraction: the computer's software interacts with all sound cards in a similar way, and it is the driver which translates the universal instructions given by the software into specific instructions for operating that hardware device. Consider this real-world comparison: you know how to operate doors because of abstracted instructions. You don't know how to open and close every door that exists, but from the ones that you do know how to operate, your brain automatically creates abstracted instructions, like "turn the handle," and "push the door," which apply with all or most doors. When you see a new door, you have certain expectations about how it works, based on the abstract behavior of doors, and you quickly figure out how to operate that specific door with a simple visual inspection. The principle is the same with computer hardware drivers: since the computer already knows how to operate "sound cards," it just needs a few simple instructions (the driver) in order to know how to operate any particular sound card.

2.1. How Linux Deals with Audio Hardware

In Linux, the core of the operating system provides hardware drivers for most audio hardware. The hardware drivers, and the instructions that other software can use to connect to those drivers, are collectively called "ALSA," which stands for "Advanced Linux Sound Architecture." ALSA is the most direct way that software applications can interact with audio and MIDI hardware, and it used to be the most common way. However, in order to include all the features that a software application might want to use, ALSA is quite complex, and can be error-prone. For this and many other reasons, another level of abstraction is normally used, and this makes it easier for software applications to take advantage of the features they need.