A User's Guide to ALSA
Since the public release of the 2.6 Linux stable kernel series, the Advanced Linux Sound Architecture (ALSA) has become the default kernel sound system. This change brings significant improvements to Linux audio and MIDI capabilities, including support for professional audio hardware, 3-D surround sound, advanced MIDI functions and software mixing or audio stream multiplexing. When combined with a kernel patched for low latency, ALSA provides resources for sound and MIDI that compare well with competing platforms and in some respects are superior to them. This is a bold claim, so let's look at ALSA to see what makes it tick.
The ALSA Project began when a young programmer named Jaroslav Kysela became frustrated with the kernel sound system's lack of full support for his Gravis Ultrasound audio/MIDI card. The Gravis card created its sounds by using sampled sounds stored in the card's memory in a file format known as PAT (patch). Banks of PAT sounds could be edited and stored by the user, as long as the user was running Microsoft Windows or Apple Mac OS. Linux, sad to say, did not provide such comprehensive resources, leaving Jaroslav with a sound card that was not fully operational.
At that time, the Linux kernel sound system was the OSS/Free system, a solid and serviceable audio/MIDI subsystem that had been with the kernel sources since the early days of Linux, thanks primarily to the pioneering work of Hannu Savolainen. Alas, OSS/Free had not kept pace with the rapidly evolving world of desktop audio production, and many sound cards either were unsupported or supported only partially, as was the case with the Gravis boards. To be fair, the OSS/Free maintainers were few; there was less organization in the general Linux audio world; and manufacturers then were, as some still are now, too secretive about their driver specifications.
It might have been possible to incorporate greater support for the Gravis cards into OSS/Free, but as Jaroslav Kysela researched the OSS/Free applications programming interface (API), he realized there was a need for a new API that could support more broadly the developments taking place with modern sound cards and digital audio interfaces. Professional and consumer-level expectations had risen, demanding support for features such as high sample rates and bit depths for professional recording, 5.1 and other 3-D/surround sound audio output arrays; multichannel digital audio I/O; and multiple MIDI I/O ports. There simply were too many advances that required fundamental changes in OSS/Free, so Jaroslav did what any truly hard-core Linux coder does: he designed a new audio/MIDI API for Linux, calling it the Advanced Linux Sound Architecture.
Designing and implementing an API that would encompass the requirements of contemporary audio is a non-trivial task, and ALSA needed many years, many programmers and many releases to attain its current status as the kernel sound system. In its earlier stages, normal users had to install the system by hand, normally as a replacement for the OSS/Free system, in order to acquire support for a card or the extended features of a card. This process included uninstalling OSS/Free and recompiling the kernel for ALSA support, at that time a decidedly non-trivial task. Nevertheless, the ranks of dedicated ALSA users grew, development flourished and eventually ALSA was incorporated into the Linux 2.5 kernel development track. Finally, with the public release of the 2.6 kernel series, ALSA became the default kernel sound system.
The ALSA home page gives us the following information:
The Advanced Linux Sound Architecture provides audio and MIDI functionality to the Linux operating system. ALSA has the following significant features:
Efficient support for all types of audio interfaces, from consumer sound cards to professional multichannel audio interfaces.
Fully modularized sound drivers.
SMP and thread-safe design.
User-space library (alsa-lib) to simplify application programming and provide higher level functionality.
Support for the older OSS API, providing binary compatibility for most OSS programs.
ALSA is released under the GPL (GNU General Public license) and the LGPL (GNU Lesser General Public License).
Let's look at each one of these features, restating them in language more comprehensible to a normal user.
Efficient support means that you can manage the basic and advanced features of supported sound cards easily, using ALSA tools such as a sound card configuration utility and mixer programs. Such tools are integral components of the complete ALSA installation.
Modularized sound drivers means that ALSA sound card drivers are easy to install and update. They also provide the means by which the user can control a card's available options in more detail. Later in this article, we show how you can work with a driver module to access and control features of an ALSA-supported sound card.
ALSA supports multiprocessor, or SMP, machines. Thread-safe is a programming term that indicates the services provided by the software can run concurrently in different threads without bothering each other. In a modern audio/MIDI application, thread safety is a Very Good Thing.
ALSA's user-space library provides programmers, and hence their programs, with easy access to ALSA's services, and its significance to the normal user may seem a rather slight matter. However, the ALSA library provides the interface through which applications can reach those functions, helping form a more homogeneous environment at the user level. Your programs can run more harmoniously with one another, with enhanced possibilities for connection and communication between applications.
ALSA evolved during the first phase of Linux sound support when most applications were using the OSS/Free API, so an OSS/Free compatibility layer was an immediate necessity for normal users. A large number of Linux sound applications still need OSS/Free compatibility, so ALSA provides seamless support for the older API. However, programmers should note that the older API now officially is deprecated.
Similis sum folio de quo ludunt venti.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- Designing Electronics with Linux
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Dynamic DNS—an Object Lesson in Problem Solving
- New Products
- Using Salt Stack and Vagrant for Drupal Development
- Validate an E-Mail Address with PHP, the Right Way
- Build a Skype Server for Your Home Phone System
- A Topic for Discussion - Open Source Feature-Richness?
- Why Python?
- Tech Tip: Really Simple HTTP Server with Python
- Not free anymore
1 hour 33 min ago - Great
5 hours 21 min ago - Reply to comment | Linux Journal
5 hours 29 min ago - Understanding the Linux Kernel
7 hours 43 min ago - General
10 hours 13 min ago - Kernel Problem
20 hours 16 min ago - BASH script to log IPs on public web server
1 day 43 min ago - DynDNS
1 day 4 hours ago - Reply to comment | Linux Journal
1 day 4 hours ago - All the articles you talked
1 day 7 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?




Comments
alsa
can u plz tell me the modules and directories reqired to capture & play the sound....
You seem to confuse OSS
You seem to confuse OSS (Open Sound System) with Open Source Software (as used in the term "OSS/Free software"), which leads to a rather surrealist "Our Story Begins" section. ALSA is as free as OSS was (and is)!
fool, the Open Sound System
fool, the Open Sound System was known as OSS/Free because 4Front had decided to close source OSS, as 4Front moved ahead with OSSv4 development (which was not free) people were only left with OSSv3, which was dubbed OSS/Free to avoid confusion between the two differently licensed versions. get it?
PS: (OSSv4.2 is kickass, ALSA is bloated and under documented.)
Sales force automation example
Keep the good works comming.
I am from African and also now am reading in English, give true I wrote the following sentence: "As based in this sensor, an specialty case' cogs any building for the brand or rental of cost whereby a drug includes a athletic layout for the email to reduce prototyper for cloning one or more similar positions into interest in the region or for the drug to create part when a response developed by the communication includes a many killing."
Thank you very much ;). Abu.
ALS120 ISA Soundcard under Linux (EPC-SALS12.01 Vers 2.0 )
Hi, I am trying to activate the above named card with my current Linux system (Ubuntu 9.04 ) but it does not work. Can you give some advice?
Author's reply
Have you tried this command:
sudo modprobe snd-als100
Best,
dp
Similis sum folio de quo ludunt venti.
Very nice and informative for beginners
Even experienced user like me find it useful, especially Linux Laptop MIDI System part. I’m also recommending this to all my user group members.
Regards,
Vivek G Gite.
Illuminating
Very exciting article from beginning to end!
I'm new to Linux Audio but not to Linux. I'm educating myself with all the information I can get, and your articles are of great help to setup my personal home studio.
Thanks.
Wilson
about alsa and multiple cards
Great article, all in all. I am in a bit of a quandry with ALSA vs OSS, as I am trying to use 2 Delta 1010lt cards in one machine and have them function as one card. According to the OSS people, you can use up to 4 of this card in one machine this way, but I can't find anything in the ALSA docs that says "Yes, here is how it works and how to do it".
ALSA has come a long, long way in the last few years, but it still has a way to go (but don't we all). I do applaud those who have done such good work. Ardour with the 1010lt is great! Jamin is also wonderful, and things just keep getting better. Thanks to all for their work!