Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Advanced Linux Sound Architecture
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Software framework for audio}} {{Infobox software | name = ALSA | logo = | screenshot = Alsa v1.0.14 ubuntu7.1 en.png | caption = Screenshot of [[Alsamixer]] 1.0.14 | collapsible = | author = [[Jaroslav Kysela]]<ref>{{cite web | url=https://www.perex.cz/perex/ | title=Jaroslav Kysela - Perex soft }}</ref> | developer = ALSA team<ref>{{citation | url = http://www.alsa-project.org/main/index.php/Alsa_Team | title = Alsa Team | publisher = alsa-project.org | date = 2008-09-29 | access-date = 2012-01-08}}</ref> | released = {{start date and age|1998}} | latest release version = {{wikidata|property|reference|P348}} | latest release date = {{start date and age|{{wikidata|qualifier|P348|P577}}}} | latest preview date = | programming language = [[C (programming language)|C]]<ref>{{citation |url = http://www.ohloh.net/p/alsa |title = ALSA |work = Analysis Summary |publisher = [[Ohloh]] |access-date = 2012-01-08 |archive-date = 2013-12-20 |archive-url = https://web.archive.org/web/20131220145354/http://www.ohloh.net/p/alsa |url-status = dead }}</ref> | operating system = [[Linux]] | platform = | size = | language = | genre = {{unbulleted list|[[device driver|Audio device drivers]]|[[Loadable kernel module]]}} | license = {{unbulleted list|[[GNU General Public License|GPL-2.0-or-later]]|[[GNU Lesser General Public License|LGPL-2.1-or-later]]<ref name=license/>}} | website = {{url|https://alsa-project.org}} }} [[File:Linux API.svg|thumb|The '''[[Linux API]]''' is composed out of the System Call Interface of the Linux kernel, the [[GNU C Library]] (by [[GNU]]), [[Direct Rendering Manager|libdrm]], libalsa and [[evdev|libevdev]] (by [[freedesktop.org]]).]] [[File:Linux kernel and gaming input-output latency.svg|thumb|300px|'''ALSA''' is part of the [[Linux kernel]], while [[PulseAudio]] is middleware, a part of the lower levels of the desktop stack. So is [[Simple DirectMedia Layer|SDL]].]] '''Advanced Linux Sound Architecture''' ('''ALSA''') is a [[software framework]] and part of the [[Linux kernel]] that provides an [[application programming interface]] (API) for [[sound card]] [[device driver]]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 [[GNU General Public License|GPL-2.0-or-later]] and [[GNU Lesser General Public License|LGPL-2.1-or-later]].<ref name=license>{{cite web |url=http://www.alsa-project.org/main/index.php/Introduction |title=Introduction |publisher=alsa-project.org |access-date=2012-01-08}}</ref> On Linux, [[Sound server|sound servers]], like [[sndio]], [[PulseAudio]], [[JACK Audio Connection Kit|JACK]] (low-latency professional-grade audio editing and mixing) and [[PipeWire]], and higher-level APIs (e.g [[OpenAL]], [[Simple DirectMedia Layer#Subsystems|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]] (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).<ref>{{citation |url=https://www.kernel.org/pub/linux/kernel/v2.5/ChangeLog-2.5.5 |title=Linux 2.5.5 release notes |access-date=2012-01-08}}</ref> In the 2.6 version, it replaced the previous system, [[Open Sound System]] (OSS), by default (although a backwards-compatibility layer does exist).<ref>{{citation|url=http://www.alsa-project.org/~tiwai/OSS-Emulation.html|title=OSS Emulation|access-date=2012-07-07|archive-url=https://web.archive.org/web/20120605094307/http://www.alsa-project.org/~tiwai/OSS-Emulation.html|archive-date=2012-06-05|url-status=dead}}</ref> 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 [[Musical Instrument Digital Interface|MIDI]] synthesis. * [[Hardware mixing]] of multiple channels. * [[Full-duplex]] operation. * Multiprocessor-friendly, [[thread-safe]] device drivers. Besides the sound device drivers, ALSA bundles a [[user-space]] [[Library (computer science)|library]] for application developers who want to use driver features through an interface that is [[High- and low-level|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 [[Plug-in (computing)|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]]" 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<ref>{{cite web | url=https://github.com/alsa-project/alsa-tools | title=Alsa-project/Alsa-tools | website=[[GitHub]] | date=3 April 2022 }}</ref><ref>{{cite web |url=http://alsa.opensrc.org/index.php/Alsa-tools |title=Alsa-tools - ALSA wiki |website=alsa.opensrc.org |access-date=12 January 2022 |archive-url=https://web.archive.org/web/20080318125424/http://alsa.opensrc.org/index.php/Alsa-tools |archive-date=18 March 2008 |url-status=dead}}</ref><ref>{{cite web | url=https://www.alsa-project.org/wiki/ALSA_User_Info | title=ALSA User Info - AlsaProject }}</ref> and utilities<ref>{{cite web | url=https://github.com/alsa-project/alsa-utils | title=Alsa-utils | website=[[GitHub]] | date=4 May 2022 }}</ref> <code>alsactl</code>,<ref>{{cite web |url=http://alsa.opensrc.org/index.php/Category:Alsa-utils |title=Category:Alsa-utils - ALSA wiki |website=alsa.opensrc.org |access-date=12 January 2022 |archive-url=https://web.archive.org/web/20080318125514/http://alsa.opensrc.org/index.php/Category:Alsa-utils |archive-date=18 March 2008 |url-status=dead}}</ref> <code>amixer</code>,<ref name="amixer-alsamixer">{{cite web | url=https://www.maketecheasier.com/alsa-utilities-manage-linux-audio-command-line/ | title=How to Use ALSA Utilities to Manage Linux Audio from the Terminal | date=14 May 2018 }}</ref> <code>arecord/aplay</code> and <code>[[alsamixer]]</code>,<ref name="amixer-alsamixer"/> an [[ncurses]]-based [[text-based user interface|TUI]]. There also are GUIs programmed by [[Third party developer|third-party developer]]s, such as GNOME-ALSAmixer<ref name="alsa.opensrc.org">{{cite web |url=http://alsa.opensrc.org/index.php/AlsaMixers |title=AlsaMixers - ALSA wiki |website=alsa.opensrc.org |access-date=12 January 2022 |archive-url=https://web.archive.org/web/20080404183733/http://alsa.opensrc.org/index.php/AlsaMixers |archive-date=4 April 2008 |url-status=dead}}</ref> (using [[GTK]]), Kmix,<ref name="alsa.opensrc.org"/> XFCE4-mixer, LXpanel, QasHctl, QasMixer, Pavucontrol, AconnectGUI,<ref name="mdeboer-www.iua.upf.es">{{cite web |last1=boer |first1=maarten de |title=maarten's homepage |url=http://www.iua.upf.es/~mdeboer/ |website=iua.upf.es |access-date=18 July 2021 |archive-url=https://web.archive.org/web/20060904023118/http://www.iua.upf.es/~mdeboer/ |archive-date=2006-09-04 |quote=this page will contain a list of my projects, but i need to clean up some things first. for now, use the following links, or browse the ftp: tapiir, alsamixergui, aconnectgui, polarbear}}</ref> tapiir,<ref name="mdeboer-www.iua.upf.es"/> polarbear,<ref name="mdeboer-www.iua.upf.es"/> ALSAmixerGUI<ref>{{cite web |last1=Boer |first1=Maarten de |title=AlsaMixerGui |url=http://www.iua.upf.es/~mdeboer/projects/alsamixergui/ |website=Music Technology Group |publisher=Universitat Pompeu Fabra |access-date=18 July 2021 |archive-url=https://web.archive.org/web/20090205035610/http://www.iua.upf.es/~mdeboer/projects/alsamixergui/ |archive-date=2009-02-05 |location=Barcelona |quote=alsamixergui is a FLTK based frontend for alsamixer. It is written directly on top of the alsamixer source, leaving the original source intact, only adding a couple of ifdefs, and some calls to the gui part, so it provides exactly the same functionality, but with a graphical user interface. (Researcher, 1999-2010)}}<!-- https://web.archive.org/web/20180904215049/http://www.resorama.com/maarten/files https://web.archive.org/web/*/http://www.resorama.com/* https://web.archive.org/web/20000903015527/http://www.iua.upf.es/~mdeboer/ --></ref> (using [[FLTK]]), [[ZynAddSubFX]], [[Yoshimi (synthesizer)|Yoshimi]], and even more. ==Concepts== {{Self-reference|This section provides an overview of basic concepts pertaining to ALSA.}}<ref>{{citation |url=http://www.linuxjournal.com/article/6735 |title=Introduction to Sound Programming with ALSA |last=Tranter |first=Jeff |date=October 2004 |journal=Linux Journal |access-date=2012-01-08}}</ref><ref>{{citation |url=http://www.linuxjournal.com/node/8234/print |title=A User's Guide to ALSA |journal=Linux Journal |last=Phillips |first=Dave |date=June 2005 |access-date=2012-01-08 |archive-url=https://web.archive.org/web/20120109014951/http://www.linuxjournal.com/node/8234/print |archive-date=2012-01-09 |url-status=dead }}</ref><ref>{{citation |url=http://www.alsa-project.org/alsa-doc/alsa-lib/index.html |title=Alsa C library Doxygen documentation |date=October 2007 |access-date=2012-01-08}}</ref> 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 "''[[I/O Controller Hub|ICH]]9''". 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 ''[[Music sequencer|sequencer]]'';<ref>{{Cite web|url=https://www.alsa-project.org/alsa-doc/alsa-lib/seq.html|title=ALSA project - the C library reference: Sequencer interface|website=www.alsa-project.org|access-date=2019-04-30}}</ref> 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'',{{Citation needed|date=May 2013}} which has one of the following forms (which are [[Case sensitivity|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 [[Pulse-code modulation|PCM]] 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]] * ''number of channels'': 1 for mono, 2 for stereo, or 6 for [[Dolby Digital|AC-3]]/[[IEC958]] ==Implementations== The ALSA System on Chip (ASoC) layer aims to provide better support for ALSA on [[embedded system]]s that use a [[system-on-chip]] (SoC) design.<ref>{{citation |url=https://www.kernel.org/doc/html/latest/sound/soc/overview.html |title=ALSA SoC Layer |publisher=[[kernel.org]] |date=2017-07-13}}</ref> [[Open Sound System]] version 4 is able to emulate ALSA.<ref>{{cite web |title=Tips And Tricks - Open Sound System |url=http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ALSA_Emulation |website=ossnext.trueinstruments.com}}</ref> [[QNX]] uses a sound system derived from, but not directly compatible with ALSA. The header file and library names are still "asound", same as the ALSA names.<ref>{{cite web |title=Audio Architecture (QNX 6.4.1) |url=https://www.qnx.com/developers/docs/6.4.1/neutrino/audio/architecture.html |website=www.qnx.com}}</ref> ALSA API uses {{tt|ioctl()}} calls in a way not allowed in the QNX kernel.<ref>{{cite web |url=https://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.audio/topic/copyright_3p.html |title=ALSA and libasound.so |website=www.qnx.com}}</ref> ==See also== {{Portal|Free and open-source software}} * [[Open Sound System]] * [[Disposable Soft Synth Interface|DSSI]] * [[udev]] * [[JACK Audio Connection Kit]] * [[KMid]] * [[LADSPA]] * [[PulseAudio]] * [[Alsamixer]] * [[PipeWire]] ==References== {{Reflist}} ==External links== * {{Official website|https://alsa-project.org}} * {{cite web |last1=Constable |first1=Mark |title=Alsa WIKI |url=https://alsa.opensrc.org/ |website=AlsaOpensrcOrg |access-date=18 July 2021 |archive-url=https://web.archive.org/web/20020329080940/https://alsa.opensrc.org/ |archive-date=29 March 2002 |quote=Some of the reasons this site remains in existence are, no one from the official ALSA site has ever contributed anything to this site (before the official one existed, this one predates the official wiki by quite a few years), no one has officially or formally suggested a merge, no one else has shown any serious interest in helping to merge them, and most importantly there are a significant number of offsite referers and Google hits that come directly to this site because it's been here for so long.}} {{Linux layers}} {{Linux kernel}} [[Category:Advanced Linux Sound Architecture| ]] [[Category:1998 software]] [[Category:Application programming interfaces]] [[Category:Interfaces of the Linux kernel]] [[Category:Linux drivers]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Citation
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite web
(
edit
)
Template:Error
(
edit
)
Template:Hatnote
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:Linux kernel
(
edit
)
Template:Linux layers
(
edit
)
Template:Main other
(
edit
)
Template:Official website
(
edit
)
Template:Portal
(
edit
)
Template:Reflist
(
edit
)
Template:Self-reference
(
edit
)
Template:Short description
(
edit
)
Template:Template other
(
edit
)
Template:Tt
(
edit
)