Advanced Linux Sound Architecture
Screenshot of Alsamixer 1.0.14 |
|
| Original author(s) | Jaroslav Kysela |
|---|---|
| Developer(s) | ALSA team[1] |
| Initial release | 1998 |
| Stable release | 1.0.25 / January 25, 2012[2] |
| Written in | C[3] |
| Operating system | Linux |
| Type | Audio |
| License | GPL and LGPL[4] |
| Website | www.alsa-project.org |
Advanced Linux Sound Architecture (known by the acronym ALSA) is a free and open source software framework providing an API for device drivers for sound cards. As such, it is a Linux kernel component. Some of the goals of the ALSA project at its inception were automatic configuration of sound-card hardware, and graceful handling of multiple sound devices in a system, goals which it has largely met. A couple of different frameworks, such as JACK, use ALSA to allow performing low-latency professional-grade audio editing and mixing. Released under the terms of the GNU GPL and the GNU LGPL, ALSA is free software.[4]
Contents |
[edit] History
Led by Jaroslav Kysela, the project started from a Linux device driver for the Gravis Ultrasound sound card in 1998, and was developed separately from the Linux kernel until it was introduced in the 2.5 development series in 2002 (2.5.4–2.5.5).[5]
In the 2.6 version, it replaced the previous system, Open Sound System (OSS), by default (although a backwards-compatibility layer does exist).[citation needed]
[edit] Features
ALSA was designed to use some features which were not, at the time of its conception, supported by OSS:
- Hardware-based MIDI synthesis.
- Hardware mixing of multiple channels.
- Full-duplex operation.
- Multiprocessor-friendly, thread-safe device drivers.
ALSA has a larger and more complex API than OSS, so it can be harder to develop an application that uses ALSA as its sound technology. While ALSA may be configured to provide an OSS emulation layer, such functionality is no longer available in many Linux distributions.
Besides the sound device drivers, ALSA bundles a user space library for application developers who want to use driver features through an interface that is higher level than the interface provided for direct interaction with the kernel drivers; unlike the kernel API, which tries to reflect the capabilities of the hardware directly, ALSA's user space library presents an abstraction which remains as standardized as possible across disparate underlying hardware. This goal is achieved in part by using software plugins. For example, many modern soundcards or built-in sound chips don't have a "master volume" control; for these devices, the user space library instead provides a software volume control using the "softvol" plugin, and ordinary application software need not care whether such a control is implemented by actual underlying hardware or software emulation of such underlying hardware.
[edit] Concepts
This section provides an overview of basic concepts pertaining to ALSA.[6][7][8]
Typically, ALSA supports up to eight cards, numbered 0 through 7; each card is a physical or logical kernel device capable of input, output, or control of sound, and card number 0 is used by default when no particular card is specified. Furthermore, each card may also be addressed by its id, which is an explanatory string such as "Headset" or "ICH9".
A card has devices, numbered starting at 0; a device may be of playback type, meaning it outputs sound from the computer, or some other type such as capture, control, timer, or sequencer; device number 0 is used by default when no particular device is specified.
A device may have subdevices, numbered starting at 0; a subdevice represents some relevant sound endpoint for the device, such as a speaker pair. If the subdevice is not specified, or if subdevice number -1 is specified, then any available subdevice is used.
A card's interface is a description of an ALSA protocol for accessing the card; possible interfaces include: hw, plughw, default, and plug:dmix. The hw interface provides direct access to the kernel device, but no software mixing or stream adaptation support. The plughw and default enable sound output where the hw interface would produce an error.
An application typically describes sound output by combining all of the aforementioned specifications together in a device string, which has one of the following forms (which are case sensitive):
- interface:card,device,subdevice
- interface:CARD=1,DEV=3,SUBDEV=2.
An ALSA stream is a data flow representing sound; the most common stream format is PCM that must be produced in such a way as to match the characteristics or parameters of the hardware, including:
- sampling rate: 44.1 kHz on home stereos, and 48 kHz on home theaters
- sample width: measured in some number of bits per sample (such as 8, 16, 24, or 32 bits/sample)
- sample encoding
- number of channels: 1 for mono, 2 for stereo, or 6 for AC-3/IEC958
Also, ALSA needs a buffer parameter that determines how often CPU attention is required to supply sound data.
[edit] Implementations
The ALSA System on Chip (ASoC) layer aims to provide better support for ALSA on embedded systems which use a system-on-chip (SoC) design.[9]
[edit] See also
[edit] References
- ^ Alsa Team, alsa-project.org, 2008-09-29, http://www.alsa-project.org/main/index.php/Alsa_Team, retrieved 2012-01-08
- ^ Main Page News, alsa-project.org, http://www.alsa-project.org/main/index.php/Main_Page_News, retrieved 2012-01-08
- ^ "ALSA", Analysis Summary (Ohloh), http://www.ohloh.net/p/alsa, retrieved 2012-01-08
- ^ a b Introduction, alsa-project.org, http://www.alsa-project.org/main/index.php/Introduction, retrieved 2012-01-08
- ^ Linux 2.5.5 release notes, http://www.kernel.org/pub/linux/kernel/v2.5/ChangeLog-2.5.5, retrieved 2012-01-08
- ^ Tranter, Jeff (October 2004), "Introduction to Sound Programming with ALSA", Linux Journal, http://www.linuxjournal.com/article/6735, retrieved 2012-01-08
- ^ Phillips, Dave (June 2005), "A User's Guide to ALSA", Linux Journal, http://www.linuxjournal.com/node/8234/print, retrieved 2012-01-08
- ^ Alsa C library Doxygen documentation, October 2007, http://www.alsa-project.org/alsa-doc/alsa-lib/index.html, retrieved 2012-01-08
- ^ ALSA SoC Layer, Rpsys.net, 2006-09-15, http://www.rpsys.net/openzaurus/patches/alsa/info.html, retrieved 2012-01-08
[edit] External links
|
||||||||||||||||||||||||||||||||||||||||