Red Hat Linux 6.2: The Official Red Hat Linux Getting Started Guide
Prev | Chapter 15. Q & A: Quick Answers to Common Questions | Next

# Configuring a Sound Card

## Q: How do I configure my sound card?

I can't get any system sounds, and I can't hear my audio CDs. How do I set up my sound card?

## A: Use sndconfig

A tool called sndconfig can help you configure your sound card.

To use sndconfig, you must log in as root.

Once you're root, open an Xterm and type sndconfig at the prompt. This tool will help you configure your card for your Red Hat Linux system. To navigate through the Yes, No or Cancel buttons on the screens, just use your Tab and Enter keys.

| Is it supported?
| While many sound cards are supported for Red Hat Linux, not all are completely compatible -- or compatible at all. If you're having trouble configuring your sound card, check the Hardware Compatibility List at Red Hat's website to see if your card is supported. You'll find the list at http://www.redhat.com/hardware.

With sndconfig, you can probe your system for any cards. If the utility detects a plug and play sound card, it will automatically try to configure the correct settings by playing sound samples. If you can hear the samples, just select Ok when you're instructed and you're all set.

If the probe doesn't find any cards, you'll be presented with a list from which you can pick your card. Use the up and down arrow keys to scroll through the list. If your card is listed, highlight it, then press Enter (or Tab to the Ok button and press Enter).

Your next task will be to select the correct I/O port, IRQ and DMA settings. These settings depend on the jumper settings of the sound card. You can find information about these settings in your sound card documentation. If you share your machine with Windows, you can also find your sound card's settings in the `Device Manager` tab in the `System` section of your `Control Panel`.

Once you've selected the right settings for your card, you'll be presented with sound samples. If you hear the samples, select OK.

You're done. After your card is configured, you'll return to the shell prompt. Just type exit to close the window, then log out of root and log back into your user account.

### If sndconfig doesn't work

When sndconfig doesn't work -- the sample doesn't play and you still don't have audio sounds -- there are alternatives, although they're not quite as simple as sndconfig.

| Be careful!
| The following instructions are not recommended for complete novices.

First, you will need to know the values for your sound card. If you share you machine with Windows, you can find your settings in the `Device Manager` tab in the `System` section of your `Control Panel`. Under Linux, you must also check the following files to make certain that you don't have any devices using the sound card's resources:

- `/proc/pci`

- `/proc/interrupts`

- `/proc/ioports`

- `/proc/dma`

If yours is not a plug and play card, you can manually edit your `/etc/conf.modules` file to include the sound card module that it should use, for example:

    alias sound sb
    alias midi opl3
    options opl3 io=0x388
    options sb io=0x220 irq=7 dma=0,1 mpu_io=0x300

If you do have a plug and play card, the configuration is more complex, and may not work for all cards.

If you have already run sndconfig, you should have the file `/etc/isapnp.conf`. When sndconfig was run, the `isapnp tools` created this template file. This file can be hand edited a text editor, such as `pico`.

To become a little more familiar with the breakdown of this file, take a look at the man page for it by typing:

    man isapnp.conf

There is also a great reference at the `isapnptools` homepage at http://www.roestock.demon.co.uk/isapnptools/

| Using sndconfig
| If you haven't run sndconfig, issue the command (as root): /sbin/pnpdump > /etc/isapnp.conf to create the file `isapnp.conf`, which you can edit.

When you have created the file `/etc/isapnp.conf`, open it with `Pico` by typing pico /etc/isapnp.conf (note that you don't have to actually be in `/etc` to edit the file).

For a little help in the layout of this file, the man page is an excellent guide to keep at hand for this. Each device will have a section that starts with about 4 lines that gives information on what the device is:

    # Card 1: (serial identifier 6d ff ff ff ff f0 00 8c 0e)
    # Vendor Id CTL00f0, No Serial Number (-1), checksum 0x6D.
    # Version 1.0, Vendor version 1.0
    # ANSI string -->Creative ViBRA16X PnP<--

Look for the section containing the sound card device. The lines in this section that you need to pay attention to are the lines within parentheses. These are the lines that need to be adjusted for your card's resources.

You make adjustments by commenting or uncommenting the beginning of the line, indicating that you want to use the resource specified on that line. (When you uncomment, you're making that line visible for use in the file; when you comment, it's invisible, for all intents and purposes.) Uncommenting is performed by removing the hash mark (`#`); to comment, just replace the hash mark. Once you have finished making these changes, look for the line towards the end of the file that says:

    # (ACT Y)

Remove the "`#`," save the changes, and exit from `Pico`.

After setting up the new configuration file, and saving it, you need to activate it. Just type:

    isapnp isapnp.conf

This will reinitialize the card with your newly changed values. If the values that you select the first time don't work, you can edit the file until you find values that don't conflict. Remember to activate the changes each time that you edit this file.

Prev | Home | Next
Using All Available RAM | Up | Removing Red Hat Linux