Red Hat Linux 7 Unleashed

Red Hat Linux 7 Unleashed

By William Ball

Configuring Sound

The sndconfig command is the Red Hat configuration tool to use to get Linux to work with your computer's sound system. This command, which may be launched without running X11, can automatically probe your computer's audio hardware, configure the card to work with Linux, then save the settings so that sound is enabled every time you boot Linux.

Start the sndconfig command from the command line of the console or an X11 terminal window by typing this:


   # sndconfig

After you press Enter, you should see a dialog, as shown in Figure 8.11.

08fig11.gif

Figure 8.11 Red Hat's sndconfig command will probe your sound card.

If the probe is successful, sndconfig will then test your card. If the probe is not successful, you may have to proceed with a manual configuration. If you'd prefer to start with a manual configuration (no probe), use sndconfig's --noprobe command-line option. And if you don't want sndconfig to configure Linux to use the sound card (perhaps if you're testing a new sound card), use the --noautoconfig option.

If you manually configure your sound card, you'll see a dialog, as shown in Figure 8.12, that you can use to scroll and select your sound card.

08fig12.gif

Figure 8.12 Red Hat's sndconfig command also offers manual configuration.

Scroll through the list of sound cards to highlight your card (or a compatible card), then use the Tab key to highlight the OK button and press Enter. You'll then have to use the next dialog, shown in Figure 8.13, to specify the correct I/O port addresses, IRQ settings, and DMA settings.

Use the Tab and spacebar to enable the specific settings, then tab to the OK button and press Enter. The command will update your /etc/modules.conf file (and back up an existing one). The command will then (after you click OK) play a sound sample. You'll then be asked if you were able to hear the sound sample, as shown in Figure 8.14.

Click Yes if sound was heard (Linus pronouncing "Linux" from the file sample.au under the /usr/share/sndconfig directory). If you click No, you can again attempt to configure your sound card. Upon success, the sndconfig will then try to play a MIDI sound, and you can again verify success. The program will then exit.

Sound support under Linux is generally in the form of loadable kernel modules, found under the /lib/modules/2. X.X /misc directory, where XX is the version of your kernel. Sound settings will be saved in the file soundcard under the /etc/sysconfig directory.

08fig13.gif

Figure 8.13 Manual sound card configuration may require specific hardware settings.

08fig14.gif

Figure 8.14 The sndconfig command will play a sound sample and ask about its success.

You may also find that sndconfig has altered settings in your system's /etc/modules.conf file (these settings will cause the Linux kernel to load the proper sound modules upon startup).

For the examples shown in Figures 8.11 through 8.14, sndconfig created the following entry in /etc/sysconfig/soundcard:

# THIS FILE IS WRITTEN BY SNDCONFIG
# PLEASE USE SNDCONFIG TO MODIFY
# TO CHANGE THIS FILE!
# There should be no spaces at the start of a line
# or around the '='sign
CARDTYPE=SB16

The corresponding entry in /etc/modules.conf looks like this:

alias sound-slot-0 sb
options sound dmabuf=1
alias midi opl3
options opl3 io=0x388
options sb io=0x220 irq=5 dma=0 dma16=5 mpu_io=0x330

These examples are for a SoundBlaster 16–compatible card, and the kernel module options create the settings for proper initialization of the card when Linux boots. After configuring your sound card and ensuring that it works with Linux, you should then launch an audio mixer to choose proper settings for different audio devices offered by your sound system. This may include volume, bass, treble, synthesizer, MIDI, line in, line out, microphone, and audio CD settings. Red Hat Linux comes with a number of audio mixers:

All mixers provide the same functions, but you'll most likely use the one available in your desktop's panel. If you do not use X11, the aumix command can be used from the console. Interestingly, if you've properly configured the gpm or mouse daemon so that you can use your mouse for copying and pasting under the console, you can use your mouse to control the aumix slider controls (otherwise you'll need to use the cursor keys).

Share ThisShare This

Informit Network