ALSA (Linux)
Encyclopedia
Advanced Linux Sound Architecture (known by the acronym ALSA) is a software framework
Software framework
In computer programming, a software framework is an abstraction in which software providing generic functionality can be selectively changed by user code, thus providing application specific software...

 providing an API
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...

 for device driver
Device driver
In computing, a device driver or software driver is a computer program allowing higher-level computer programs to interact with a hardware device....

s for sound card
Sound card
A sound card is an internal computer expansion card that facilitates the input and output of audio signals to and from a computer under control of computer programs. The term sound card is also applied to external audio interfaces that use software to generate sound, as opposed to using hardware...

s. As such, it is a Linux kernel
Linux kernel
The Linux kernel is an operating system kernel used by the Linux family of Unix-like operating systems. It is one of the most prominent examples of free and open source software....

 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
JACK Audio Connection Kit
JACK is a professional sound server daemon that provides real-time, low latency connections for both audio and MIDI data between applications that implement its API...

, use ALSA to allow performing low-latency professional-grade audio editing and mixing.
Led by Jaroslav Kysela
Jaroslav Kysela
Jaroslav Kysela is the creator of the ALSA project for sound drivers in the Linux operating system. He now works at Red Hat.-External links:*...

, the project started from a Linux device driver for the Gravis Ultrasound
Gravis Ultrasound
Gravis UltraSound or GUS is a sound card for the IBM PC compatible system platform, made by Canada-based Advanced Gravis Computer Technology Ltd...

 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). In the 2.6 version it replaced the previous system, Open Sound System
Open Sound System
The Open Sound System is an interface for making and capturing sound in Unix or Unix-like operating systems. It is based on standard Unix devices...

 (OSS), by default (although a backwards-compatibility layer does exist).

Features

ALSA was designed to use some features which were not, at the time of its conception, supported by OSS
Open Sound System
The Open Sound System is an interface for making and capturing sound in Unix or Unix-like operating systems. It is based on standard Unix devices...

:
  • Hardware-based MIDI
    Musical Instrument Digital Interface
    MIDI is an industry-standard protocol, first defined in 1982 by Gordon Hall, that enables electronic musical instruments , computers and other electronic equipment to communicate and synchronize with each other...

     synthesis.
  • Hardware mixing
    Hardware mixing
    Hardware mixing is a performance feature of computer audio hardware which enables sound cards to receive multiple audio streams and play them all at the same time. Hardware mixing improves performance by offloading audio mixing operations from the CPU and performing them at hardware speeds...

     of multiple channels.
  • Full-duplex operation.
  • Multiprocessor-friendly, thread-safe
    Thread-safe
    Thread safety is a computer programming concept applicable in the context of multi-threaded programs. A piece of code is thread-safe if it only manipulates shared data structures in a thread-safe manner, which enables safe execution by multiple threads at the same time...

     device drivers.


ALSA has a larger and more complex API
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...

 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
User space
A conventional computer operating system usually segregates virtual memory into kernel space and user space. Kernel space is strictly reserved for running the kernel, kernel extensions, and most device drivers...

 library
Library (computer science)
In computer science, a library is a collection of resources used to develop software. These may include pre-written code and subroutines, classes, values or type specifications....

 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.

Concepts

This section provides an overview of basic concepts pertaining to ALSA.

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
Case sensitivity
Text sometimes exhibits case sensitivity; that is, words can differ in meaning based on differing use of uppercase and lowercase letters. Words with capital letters do not always have the same meaning when written with lowercase letters....

):
  • 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
Pulse-code modulation
Pulse-code modulation is a method used to digitally represent sampled analog signals. It is the standard form for digital audio in computers and various Blu-ray, Compact Disc and DVD formats, as well as other uses such as digital telephone systems...

 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
    Dolby Digital
    Dolby Digital is the name for audio compression technologies developed by Dolby Laboratories. It was originally called Dolby Stereo Digital until 1994. Except for Dolby TrueHD, the audio compression is lossy. The first use of Dolby Digital was to provide digital sound in cinemas from 35mm film prints...

    /IEC958

Also, ALSA needs a buffer parameter that determines how often CPU attention is required to supply sound data.

Implementations

The ALSA System on Chip (ASoC) layer aims to provide better support for ALSA on embedded system
Embedded system
An embedded system is a computer system designed for specific control functions within a larger system. often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts. By contrast, a general-purpose computer, such as a personal...

s which use a system-on-chip (SoC) design.

See also

  • Open Sound System
    Open Sound System
    The Open Sound System is an interface for making and capturing sound in Unix or Unix-like operating systems. It is based on standard Unix devices...

  • DSSI
    DSSI
    DSSI is a virtual instrument plugin architecture for use by music sequencer applications. It was designed for applications running under Linux, although there is nothing specific to Linux in the interface itself...

  • udev
    Udev
    udev is the device manager for the Linux kernel. Primarily, it manages device nodes in /dev. It is the successor of devfs and hotplug, which means that it handles the /dev directory and all user space actions when adding/removing devices, including firmware load.-History:udev was new in Linux...

  • JACK Audio Connection Kit
    JACK Audio Connection Kit
    JACK is a professional sound server daemon that provides real-time, low latency connections for both audio and MIDI data between applications that implement its API...

  • KMid
    KMID
    KMID is the ABC affiliated television station in Midland-Odessa, Texas, owned and operated by Nexstar Broadcasting Group, which is headquartered in Irving, Texas. KMID ABC2 was acquired by Nexstar in 2000...

  • LADSPA
    LADSPA
    LADSPA is an acronym for Linux Audio Developers Simple Plugin API. It is a standard for handling filters and effects, licensed under the GNU LGPL. It was originally designed for Linux through consensus on the Linux Audio Developers Mailing List, but works on a variety of other platforms...

  • PulseAudio
    PulseAudio
    PulseAudio is a cross-platform, networked sound server commonly used on the Linux-based and FreeBSD operating systems.PulseAudio runs under Microsoft Windows, Mac OS X, and POSIX-compliant platforms, such as Linux and FreeBSD...

  • Alsamixer
    Alsamixer
    alsamixer is a graphical mixer program for the Advanced Linux Sound Architecture . It is used to configure sound settings and to adjust the volume. It has an ncurses user interface and does not require the X Window System...

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK