Using ALSA to Control Linux Audio
ALSA User ToolsLast week I wrote how to configure PulseAudio on Ubuntu so you could easily stop and start it when you wanted to, instead of being stuck with it being on all the time, or having to remove it just to get it out of your way. Today I'm going to show how to use ALSA, which has been the default Linux audio subsystem for many years. ALSA has its limitations, but it's perfectly fine for controlling both playback and recording volume.
ALSA User ToolsMost likely your chosen Linux distribution comes with ALSA, because even with new sound servers and managers like Phonon, PulseAudio, and JACK, they still need ALSA. ALSA has two parts: the base which provides sound card drivers and firmware, and alsa-utils for user tools. alsa-utils may not be installed on your system; you'll need it to follow this howto.
The main application in alsa-utils we are interested in is alsamixer. alsamixer is an ncurses-based mixer for controlling your audio interfaces, both playback and recording. To open it just type alsamixer at any command prompt. It looks like Figure 1.
You might think it's not very pretty, and because it is ncurses-based it does not support a mouse, so all of its functions are keyboard-controlled. The advantage of ncurses is it doesn't need X windows, and it is very lightweight and won't bog down your system like the current crop of fashionable special video effects do. It's the same on all Linuxes, so you don't have to learn distro-specific weird stuff. It's perfect for running a headless audio server.
Figure 1 is for my 5.1 onboard surround chipset, so it has many control sliders. Use the right and left arrow keys to navigate through the sliders. At the bottom of each slider you see either 00 or MM. Toggle these with the
spacebar M key. MM means muted, 00 is enabled.
Sound card drivers are funny things, inconsistent in quality and features, so you'll probably need to do a bit of trial and error to learn what all the different sliders do. For example, I need to have all the playback sliders un-muted even to enable two-channel stereo playback.
The two key sliders for controlling playback volume are the Master and PCM sliders. Usually you need both to enable playback, but sometimes just the PCM slider will do the job. When the Master slider has no effect it means one of two things: your soundcard has no hardware volume controller, which is typical of the lowest-end chipsets, or the driver does not support the hardware volume controller. PCM stands for "Pulse Code Modulation"; just think of it as a virtual sound card.
Use the up and down arrow keys or the Page Up/Page Down keys to control the sliders. Page Up/Page Down move the sliders in increments of five, and the End key resets to zero. When there are two channels controlled by one slider, Q increases the left channel and Z decreases. E increases the right channel, and C decreases. Figure 2 shows how this looks in the Master slider, and the caption at the top displays the numeric values.
Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.
- 1Linux Top 3: GNOME 3.12 and New Betas for Ubuntu 14.04 and OpenMandriva Lx 2014.0
- 2Linux Top 3: Linus Lashes out, Linux 3.14 Gets PIE and Ubuntu One is Done.
- 3Linux Top 3: Ubuntu 14.04, Debian Gives Squeeze More Life and Red Hat Goes Atomic
- 4Linux Top 3: Linux 3.11, Kubuntu Goes Commercial
- 5Linux Top 3: RHEL 6.5, Debian 7.2 and EOL for Linux 3.0.x