Chapter 13. Sound in Linux

Table of Contents

13.1. Mixers
13.2. Multimedia Players
13.3. CDs: Playback and Ripping
13.4. Hard Disk Recording with Audacity
13.5. Direct Recording and Playback of WAV Files

Abstract

Linux includes a wide range of sound and multimedia applications. Some of these applications are part of one of the main desktop environments. With the applications described here, control the volume and balance of playback, play CDs and music files, and record and compress your own audio data.

13.1. Mixers

Mixers provide a convenient means of controlling the volume and balance of the sound output and input of computers. The main difference between the various mixers is the outer appearance of the user interface. However, there are a number of mixers that are designed for specific hardware. One example is envy24control, a mixer for the Envy 24 sound chip. Another one is hdspmixer, which is for RME Hammerfall cards. From the mixers available, select the one that best suits your needs.

Generally, it is advisable to open a mixer application before opening other sound applications. Use the mixer to test and adjust the control settings for the input and output of the sound card.

13.1.1. KMix

KMix is the KDE mixer application. It is integrated into the KDE panel as a small panel applet located in the system tray. Click the panel icon to control the volume of your speakers with a control slider. If you right-click the icon, the context menu of KMix appears. Select Mute to switch off the sound output. The panel icon then changes its appearance. Clicking Mute again unmutes the volume. To fine-tune your sound settings, select Show Mixer Window and configure Output, Input, and Switches. Each of the devices featured there has its own context menu that is opened by a right-clicking the device icon. You can mute or hide each one of them separately.

Figure 13.1. The Mixer KMix

The Mixer KMix

13.1.2. The GNOME Mixer Applet

GMix, the volume control applet for the GNOME desktop, is integrated into the GNOME panel. Click the panel icon to control the volume of your speakers with a simple control slider. To switch off the sound output, right-click the icon and select Mute. The volume control icon then changes its appearance. To unmute the sound output, right-click the icon again and select Mute from the menu. Select Open Volume Control to access the more advanced mixer features, shown in Figure 13.2, “The GNOME Mixer Applet”. Each sound device has its own mixer tab.

Figure 13.2. The GNOME Mixer Applet

The GNOME Mixer Applet

13.1.3. alsamixer

alsamixer can be run from the command line without the X environment, so is entirely controlled via keyboard shortcuts. An alsamixer window always consists of the following elements: a top row holding basic information on card and chip type, the selected view type, and the mixer item then the volume bars below the information area. Use and to scroll left or right if the controls cannot be displayed in one screen. The names of the controls appear below the controls and the currently selected control is colored in red. Toggle between muted and unmuted state of any mixer control using M. A muted control has MM written below its name. Any control that has capture (recording) capabilities has a red capture flag.

alsamixer has three different view modes: Playback, Capture, and All. By default, alsamixer is started in playback mode, displaying only those mixer controls relevant for playback (Master Volume, PCM, CD, etc.). Capture displays only those controls used for recording. All displays all controls available. Switch the view modes using F3, F4, and F5.

Select channels with and or N and P. Use and or + and - to increase and decrease the volume. Stereo channels can be controlled independently, using Q, W, and E for increasing the volume and Z, X, and C for decreasing the volume. The number keys between 0 and 9 can be used to change the absolute volume quickly. These correspond to zero to ninety percent of full volume.

13.1.4. Look and Feel of Mixer Applications

The look and feel of mixer applications depends on the type of sound card used. Some drivers, like SB Live!, have many controllable (tunable) mixer elements while the drivers for professional sound cards may have elements with totally different names.

13.1.4.1. On-Board Sound Chip

Most of the PCI on-board sound chips are based on AC97 codec. Master controls the main volume from the front speakers. Surround, Center, and LFE control the rear, center, and bass-boost speakers. Each of them has a mute switch. In addition to that, some boards have individual Headphone and Master Mono volumes. The latter is used for the built-in speaker on some laptops.

PCM controls the internal volume level of digital WAVE playback. PCM is an acronym for Pulse Code Modulation, one of the digital signal formats. This control has also an individual mute switch.

Other volumes, like CD, Line, Mic, and Aux, control the loopback volume from the corresponding input to the main output. They do not influence the recording level, only the playback volumes.

For recording, turn on the Capture switch. This is the master recording switch. The Capture volume is the input gain for recording. By default, this switch is set to zero. Choose a recording source like Line or Mic. The recording source is exclusive, so you cannot choose two of them at the same time. Mix is a special recording source. You can record the currently played signal from this source.

Depending on the AC97 codec chip, special effects, like 3D or bass/treble, are available, too.

13.1.4.2.  SoundBlaster Live! and Audigy Family

SoundBlaster Live! and SB Audigy1 have numerous mixer controls for their AC97 codec chip and DSP engine. In addition to the controls already described, they have Wave, Music, and AC97 volumes to control the internal signal routing and attenuation for PCM, WaveTable MIDI, and AC97 mixing. Keep the volume at 100% to hear all of them. SB Audigy2 (depending on the model) has less controls than SB Live, but still has Wave and Music controls.

The recording on SB Live is similar to on-board chip. You can choose Wave and Music as the additional recording source to record the played PCM and WaveTable signals.

13.1.4.3. USB Audio Devices

USB audio devices usually have a small number of mixer controls. Sometimes they even have none at all. Most devices either have a Master or PCM control switch to control the playback volume.

13.1.5. The Mixer for the Sound Chip Envy24

Figure 13.3. Monitor and Digital Mixer of envy24control

Monitor and Digital Mixer of envy24control

envy24control is a mixer application for sound cards using the Envy24 (ice1712) chip. The flexibility of the Envy24 chip can result in varying functionalities in different sound cards. The latest details on this sound chip are available in /usr/share/doc/packages/alsa-tools/envy24control.

The Monitor Mixer of envy24control shows the signal levels that can be mixed digitally in the sound card. The signals designated as PCM Out are generated by applications that send PCM data to the sound card. The signals of the analog inputs are shown under H/W In. The S/PDIF inputs are shown to the right. Set the input and output levels of the analog channels under Analog Volume.

Use the Monitor Mixer sliders for digital mixing. The respective levels are displayed in the Digital Mixer. For each output channel, the Patchbay contains a row of radio buttons for selecting the desired channel source.

Adjust the amplification for the analog-to-digital and digital-to-analog converters under Analog Volume. Use the DAC sliders for the output channels and the ADC sliders for the input channels.

The S/PDIF channel settings are made under Hardware Settings. The Envy24 chip reacts to volume changes with a delay that can be configured with Volume Change.


SUSE LINUX User Guide 9.3