Advanced Linux Sound Architecture

from Wikipedia, the free encyclopedia
Advanced Linux Sound Architecture

Alsa v1.0.14 ubuntu7.1 de.png
AlsaMixer 1.0.14 on Ubuntu 7.10
Basic data

Maintainer The ALSA team
developer Jaroslav Kysela
Publishing year November 4, 1998
Current  version 1.2.3
( June 8, 2020 )
operating system Linux
programming language C.
category Sound driver
License GPL and LGPL
German speaking No

The Advanced Linux Sound Architecture ( ALSA ) is a free sound architecture for Linux systems that has ( PCM ) audio and MIDI functionality. ALSA is licensed under the GPL (Drivers & Utilities) and LGPL (Application Libraries).

ALSA consists of Linux kernel modules that provide various kernel drivers for sound cards . Different tasks (general sound; midi, wave, synthesizer; hardware) are abstracted by individual device drivers in the sound stack. Playback of Dolby Digital is possible. The goals of the ALSA project were in particular to support the automatic configuration of the sound cards and the elegant handling of several sound devices in one system. These goals were largely achieved. Various frameworks such as JACK and PulseAudio use ALSA for audio processing and mixing at a professional level with low latency .

The poorly maintained drivers for the OSS 3 architecture are marked as deprecated (out of date) in the current kernel versions in favor of ALSA .

The system was also ported to OS / 2-based operating systems ( eComStation and Arca-OS).


The project arose in August 1998 from a driver for the UltraSound sound card from Gravis under the direction of Jaroslav Kysela . Kysela was annoyed about the bad driver of the Open Sound System for his card and wrote a replacement for it, which other owners of the card also used enthusiastically.

ALSA was developed separately from the Linux kernel until it was added to the development branch of kernel version 2.5.5 in 2002. It has been the standard sound system since kernel version 2.6.

With ALSA version 1.0.17 the version control system was changed from Mercurial to Git and many new drivers for System-on-a-Chip were added. Support for high-end audio cards and I²C was also added.


If programs use the ALSA Userspace Library , software mixing is possible through ALSA's PCM plug-in interface, e.g. B. through the Dmix plugin . This means that different sound streams, e.g. B. can be played by different programs at the same time without having to use a sound server such as PulseAudio , ESD or aRts .

ALSA and especially the drivers for sound hardware are fully modularized. ALSA needs its own drivers for the devices to be addressed, which is why OSS drivers can no longer be used. From end-user devices to professional multi-channel cards, a wide variety of devices are supported.

What is relevant for developers is that ALSA is fully multithreaded and SMP capable. As programming interfaces serve the ALSA API that provides an interface to the ALSA kernel module and the ALSA userspace library , libasound that has the full functionality of the ALSA API, but significantly improves the usability. The use of the userspace library is also more advantageous for reasons of software mixing.

ALSA contains an emulation, the libaoss library, for OSS programs so that they can continue to be used.

It supports an unlimited number of channels, unlimited full duplex operation and contains a loopback device.


From version 2.6 of the Linux kernel, the drivers for ALSA are located directly in it. They are divided into several levels. The top one is the ALSA sound kernel, which gives access to the middle level. The hardware interfaces such as B. Mixer, Sequencer, MIDI and hardware-dependent components. The lower level contains the card and chip-specific code. If available, the modules for OSS compatibility are located between the middle and lower levels.

The interface between the drivers and the applications is then formed by the libraries in the alsa-lib package. So that several programs can use the sound card at the same time, a so-called sound server is used.


This paragraph provides an overview of the basic concepts behind ALSA.

Typically, ALSA supports up to eight cards , numbered 0 through 7; each card is either a physical or a logical kernel device that can record, output or control sound. Each card can be addressed via its string ID, e.g. B. " Headset " or " ICH9 ".

A card has devices whose numbering also starts with 0; There are several device types / types, e.g. B. playback , capture , control , timer or sequencer . The default is 0.

A device can have subdevices whose numbering starts with 0; a subdevice represents any relevant sound endpoint for that device , e.g. B. a pair of speakers. If no particular subdevice is specified, or the number -1, all available subdevices are activated.

The interface of a card is the description of an ALSA protocol for accessing it; Available interfaces are: hw , plughw , default , and plug: dmix . The hw interface allows direct access to the kernel device without software mixing or stream adaptation. The plughw and default interfaces allow sound to be output in cases where the hw interface produces an error message.

An application specifies the output of sound by transferring the parameters described above together in a device string . It has one of the following syntaxes (they are case sensitive ):

  • interface: card, device, subdevice
  • interface: CARD = 1, DEV = 3, SUBDEV = 2 .

An ALSA stream is a flow of data that represents sound; the most common format is PCM . The generated stream must match the hardware exactly with regard to:

  • sampling rate : e.g. B. 44.1 kHz or 48 kHz
  • sample width : e.g. B. 8, 16, 24, or 32 bits / sample
  • sample encoding
  • number of channels : 1 for mono, 2 for stereo or 6 for AC-3 / IEC958

ALSA also requires a buffer parameter; this determines how often the CPU has to be addressed in order to deliver new sound data.


Alsamixer with settings for volume and individual channels

The ALSA project provides many tools for configuring the sound system. This includes many setting programs for setting ALSA and the sound card used, such as alsaconf and for the sound such as alsamixer and amixer .

Simple playback programs for WAVE and MIDI files are also available.

Web links

Individual evidence

  1. - Alsa Team
  2. . June 8, 2020.
  3. . June 8, 2020.
  4. ^ Ohloh Analysis Summary - ALSA
  5. AC3 AVI test file. ( RAR ) (No longer available online.) Archived from the original on October 4, 2007 ; accessed on August 14, 2019 . Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot /
  7. a b c
  8. Release notes for v2.5.5
  12. ^ Jeff Tranter: Introduction to Sound Programming with ALSA . October 2004. Retrieved January 8, 2012.
  13. Dave Phillips: A User's Guide to ALSA . June 2005. Archived from the original on January 9, 2012. Retrieved on August 14, 2019.
  14. ^ Alsa C library Doxygen documentation . October 2007. Retrieved January 8, 2012.
  15. ^ Alsa-utils ( Memento of March 6, 2013 in the Internet Archive )