Chapter 18. Sound in Linux

Table of Contents

Basic ALSA PCM Types
Mixers
gamix
qamix
KMix
The GNOME Mixer Applet
alsamixer
Mixer Parameters of Soundblaster Live! and Audigy
The Mixer for the Sound Chip Envy24
Configuration of the S/PDIF Channels
Players
XMMS — An MP3, WAV, OGG, and Stream Player
kscd — Audio CD Player
The Audio CD Player WorkMan
GNOME CD Player Applet
Buffering and Latencies
The JACK Audio Connection Kit
Hard Disk Recording with Audacity
Recording WAV Files and Importing Files
Editing Audio Files
Saving and Exporting
Direct Recording and Playback of WAV Files
Compressing Audio Data
ALSA and MIDI
Loading Sound Fonts: SB Live! and AWE
vkeybd — Virtual MIDI Keyboard
Establishing Connections Between MIDI Ports
kmid — The KDE MIDI Player
MIDI Playback without a WaveTable Card
The Sound Font Synthesizer fluidsynth
Configuration of timidity++
Starting timidity++ with the Graphical Interface
The ALSA Server Mode of timidity++
AlsaModularSynth — Synthesizer and Effect Processor
Randomly Playing Patches
AlsaModularSynth as an Effect Processor
Synthesizer Patches
Keeping Track with the Control Center
The MIDI Out Module
Writing WAV Files with the WAV Out Module
NoteEdit and MIDI Sequencers

Abstract

Linux offers a wide range of sound applications in various stages of development. This chapter provides an overview of a wide range of applications for various multimedia tasks together with some technical background information. Applications that are not part of the standard installation can be installed with YaST.

Basic ALSA PCM Types

As of version 0.9 of the Advanced Linux Sound Architecture (ALSA), the concept for PCM devices was substantially modified and expanded. The user can now influence the way ALSA addresses the sound card by selecting a specific PCM type. The main PCM types are hw and plughw.

To understand the difference between the two types, consider how a PCM device is opened. It must be opened with specific settings for at least the following parameters: sample format, sample frequency, number of channels, number of periods (previously referred to as fragments), and size of a period. For example, an application may attempt to play a WAV file with a sample frequency of 44.1 kHz although the sound card does not support this frequency. In this case, ALSA can automatically convert the data in the plug-in layer to a format supported by the sound card. The conversion affects the following parameters: sample format, sample frequency, and number of channels.

Activate the plug-in layer by selecting the PCM type plughw. If the PCM type hw is selected, ALSA tries to open the PCM devices directly with the parameters required by the application. The complete designator for a PCM device consists of the PCM type followed by a colon, the card number, and the device number, for example, plughw:0,0.