
Advanced Linux Sound Architecture (ALSA) is a
software framework
In computer programming, a software framework is an abstraction in which software, providing generic functionality, can be selectively changed by additional user-written code, thus providing application-specific software. It provides a standard ...
and part of the
Linux kernel
The Linux kernel is a free and open-source, monolithic, modular, multitasking, Unix-like operating system kernel. It was originally authored in 1991 by Linus Torvalds for his i386-based PC, and it was soon adopted as the kernel for the GNU ope ...
that provides an
application programming interface
An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how t ...
(API) for
sound card
A sound card (also known as an audio card) is an internal expansion card that provides input and output of audio signals to and from a computer under the control of computer programs. The term ''sound card'' is also applied to external audio i ...
device driver
In computing, a device driver is a computer program that operates or controls a particular type of device that is attached to a computer or automaton. A driver provides a software interface to hardware devices, enabling operating systems and ot ...
s.
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. ALSA is released under
GPL-2.0-or-later and
LGPL-2.1-or-later.
On Linux, sound servers, like
sndio
sndio is the software layer of the OpenBSD operating system that manages sound cards and MIDI ports. It provides an optional sound server and a documented application programming interface to access either the server or the audio and MIDI hard ...
,
PulseAudio
PulseAudio is a network-capable sound server program distributed via the freedesktop.org project. It runs mainly on Linux, various BSD distributions such as FreeBSD and OpenBSD, macOS, as well as Illumos distributions and the Solaris operating ...
,
JACK
Jack may refer to:
Places
* Jack, Alabama, US, an unincorporated community
* Jack, Missouri, US, an unincorporated community
* Jack County, Texas, a county in Texas, USA
People and fictional characters
* Jack (given name), a male given name, ...
(low-latency professional-grade audio editing and mixing) and
PipeWire
PipeWire is a server for handling audio, video streams, and hardware on Linux. It was created by Wim Taymans at Red Hat. It handles multimedia routing and pipeline processing.
History
In 2015, Taymans started work on PipeWire. It was based on ...
, and higher-level APIs (e.g
OpenAL
OpenAL (Open Audio Library) is a cross-platform audio application programming interface (API). It is designed for efficient rendering of multichannel three-dimensional positional audio. Its API style and conventions deliberately resemble those ...
,
SDL audio, etc.) work on top of ALSA and its sound card device drivers. ALSA succeeded the older Linux port of the
Open Sound System
The Open Sound System (OSS) is an interface for making and capturing sound in Unix and Unix-like operating systems. It is based on standard Unix devices system calls (i.e. POSIX read, write, ioctl, etc.). The term also sometimes refers to the ...
(OSS).
History
The project to develop ALSA was led by Jaroslav Kysela, and was based on the Linux device driver for the
Gravis Ultrasound sound card. It started 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
The Open Sound System (OSS) is an interface for making and capturing sound in Unix and Unix-like operating systems. It is based on standard Unix devices system calls (i.e. POSIX read, write, ioctl, etc.). The term also sometimes refers to the ...
(OSS), by default (although a backwards-compatibility layer does exist).
ALSA has a larger and more complex API than OSS, so it can be more difficult 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 or is not installed by default in many Linux distributions.
Features
ALSA was designed with some features which were not, at the time of its conception, supported by OSS:
* Hardware-based
MIDI
MIDI (; Musical Instrument Digital Interface) is a technical standard that describes a communications protocol, digital interface, and electrical connectors that connect a wide variety of electronic musical instruments, computers, and re ...
synthesis.
*
Hardware mixing
Hardware acceleration is the use of computer hardware designed to perform specific functions more efficiently when compared to software running on a general-purpose central processing unit (CPU). Any transformation of data that can be calculat ...
of multiple channels.
*
Full-duplex
A duplex communication system is a point-to-point system composed of two or more connected parties or devices that can communicate with one another in both directions. Duplex systems are employed in many communications networks, either to allow ...
operation.
* Multiprocessor-friendly,
thread-safe Thread safety is a computer programming concept applicable to multi-threaded code. Thread-safe code only manipulates shared data structures in a manner that ensures that all threads behave properly and fulfill their design specifications without uni ...
device drivers.
Besides the sound device drivers, ALSA bundles a
user-space
A modern computer operating system usually segregates virtual memory into user space and kernel space. Primarily, this separation serves to provide memory protection and hardware protection from malicious or errant software behaviour.
Kernel ...
library
A library is a collection of materials, books or media that are accessible for use and not just for display purposes. A library provides physical (hard copies) or digital access (soft copies) materials, and may be a physical location or a vir ...
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 that remains as standardized as possible across disparate underlying hardware elements. This goal is achieved in part by using
software plug-ins; for example, many modern sound cards or built-in sound chips do not have a "master volume" control. Instead, for these devices, the user space library provides a software volume control using the "
softvol Softvol is an Advanced Linux Sound Architecture (ALSA) Plug-in (computing), plugin that adds a software based Loudness, volume control to the ALSA audio mixer (alsamixer). This is helpful when a sound card does not have a computer hardware, hardwar ...
" plug-in, and ordinary application software need not care whether such a control is implemented by underlying hardware or software emulation of such underlying hardware.
Applications
Additional to the software framework internal to the Linux kernel, the ALSA project also provides the command-line tools and utilities
alsactl
,
amixer
,
arecord/aplay
and
alsamixer
,
[ an ]ncurses
ncurses (new curses) is a programming library providing an application programming interface (API) that allows the programmer to write text-based user interfaces (TUI) in a terminal-independent manner. It is a toolkit for developing "GUI-like" ...
-based TUI.
There also are GUIs programmed by third-party developer
A video game developer is a broad term for a software developer specializing in video game development – the process and related disciplines of creating video games. A game developer can range from one person who undertakes all tasks to a large ...
s, such as GNOME-ALSAmixer (using GTK), Kmix,[ XFCE4-mixer, LXpanel, QasHctl, QasMixer, Pavucontrol, AconnectGUI,] tapiir,[ polarbear,][ ALSAmixerGUI (using FLTK), ]ZynAddSubFX
ZynAddSubFX (also now called Zyn-Fusion) is a free and open-source software synthesizer for Linux, Mac OS X and Microsoft Windows. As of version 3, the completely new user interface is being released under proprietary terms with an open-source-ev ...
, Yoshimi
Yoshimi is a unisex Japanese given name and can also be used as a surname.
Possible writings
*佳美, meaning "excellent, beautiful"
*良美, meaning "good, beautiful"
*好美, meaning "like, beautiful"
*芳美, meaning "fragrant, beautiful"
P ...
, and even more.
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 and output. 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
Sequencer may refer to:
Technology
* Drum sequencer (controller), an electromechanical system for controlling a sequence of events automatically
* DNA sequencer, a machine used to automatically produce a sequence readout from a biological DNA sam ...
''; 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
Pulse-code modulation (PCM) is a method used to digitally represent sampled analog signals. It is the standard form of digital audio in computers, compact discs, digital telephony and other digital audio applications. In a PCM stream, the amp ...
that must be produced in such a way as to match the characteristics or parameters of the hardware, including:
* ''sampling rate'': often 44.1 kHz on home stereos, or 48 kHz on home theaters, yet up to 88.2 kHz, 96 kHz, or even 192 kHz for hi-fi audio production or reproduction.
* ''sample width'': measured in some number of bits per sample (such as 8, 16, 24, or 32 bits/sample)
* ''sample encoding'': such as endianness
In computing, endianness, also known as byte sex, is the order or sequence of bytes of a word of digital data in computer memory. Endianness is primarily expressed as big-endian (BE) or little-endian (LE). A big-endian system stores the most sig ...
* ''number of channels'': 1 for mono, 2 for stereo, or 6 for AC-3/ IEC958
Implementations
The ALSA System on Chip (ASoC) layer aims to provide better support for ALSA on embedded system
An embedded system is a computer system—a combination of a computer processor, computer memory, and input/output peripheral devices—that has a dedicated function within a larger mechanical or electronic system. It is ''embedded'' as ...
s that use a system-on-chip
A system on a chip or system-on-chip (SoC ; pl. ''SoCs'' ) is an integrated circuit that integrates most or all components of a computer or other electronic system. These components almost always include a central processing unit (CPU), memory ...
(SoC) design.
See also
* Open Sound System
The Open Sound System (OSS) is an interface for making and capturing sound in Unix and Unix-like operating systems. It is based on standard Unix devices system calls (i.e. POSIX read, write, ioctl, etc.). The term also sometimes refers to the ...
* DSSI
* udev
udev (userspace ) is a device manager for the Linux kernel. As the successor of devfsd and hotplug, udev primarily manages device nodes in the directory. At the same time, udev also handles all user space events raised when hardware devices ar ...
* JACK Audio Connection Kit
* KMid
* LADSPA
LADSPA is an acronym for Linux Audio Developer's Simple Plugin API. It is an application programming interface (API) standard for handling audio filters and audio signal processing effects, licensed under LGPL-2.1-or-later. It was originally de ...
* PulseAudio
PulseAudio is a network-capable sound server program distributed via the freedesktop.org project. It runs mainly on Linux, various BSD distributions such as FreeBSD and OpenBSD, macOS, as well as Illumos distributions and the Solaris operating ...
* Alsamixer
alsamixer is a graphical mixer program for the Advanced Linux Sound Architecture (ALSA) that is used to configure sound settings and adjust the volume. It has an ncurses user interface and does not require the X Window System. It supports multip ...
* PipeWire
PipeWire is a server for handling audio, video streams, and hardware on Linux. It was created by Wim Taymans at Red Hat. It handles multimedia routing and pipeline processing.
History
In 2015, Taymans started work on PipeWire. It was based on ...
References
External links
*
*
{{Linux kernel
1998 software
Application programming interfaces
Interfaces of the Linux kernel
Linux drivers