Next Previous Contents

## 7. Configuring Sound.

In the past, when analog frame buffer video capture cards were the primary means of obtaining video, many did not include audio capture circuitry, so a sound card was required to record the audio. Now that most users will have a hardware capture device which multiplexes the audio and video into a single stream this is not as great a concern as it once was.

NOTE: This portion of the HOWTO will be removed in MythTV v0.23.

See the Troubleshooting Audio section for more information if you're having issues with sound. Also, ensure that no other programs are grabbing the audio output, like arts or esd.

You must mute the "line-in" of your sound card and also set it as the recording source. Muting the line-in will ensure that you don't hear a time-delayed version of any live programs you may be watching if you have a combined frontend/backend system.

There are two ways to do this. Graphically, and from the command line.

## 7.1 Graphically setting up the mixer

### Mandriva and Red Hat Linux/Fedora Core

Open Kmix by clicking K->Multimedia->Sound->Kmix for Mandriva, or

    RedHat Menu>Sound & Video>Volume Control

on Red Hat/Fedora.

Click on Settings->Configure Make sure that "Tick Marks" and "Show labels" have "X"'s in them. This will make it easier to find the correct audio source. Click OK.

On the mixer page, look for Line-In on your sound card. You should see two LED's - a green one at the top, and a red one at the bottom. The green one at the top is for muting; you want to make sure that the green LED is a dark green, meaning that it's "off". You also want to click on the red LED so that it turns bright red, indicating that it's "ON"; this insures that the Line-in is used as the source. Click OK, and make sure that you save the settings so that this is your default.

### Using ALSA.

To use ALSA, you'll need to correctly setup your `asoundrc` file. Configuring this file is beyond the scope of this HOWTO. Once ALSA is working correctly, change the output sound device in mythfrontend->setup->Audio from `/dev/dsp` to `ALSA:default`. This field may be edited to suit your ALSA requirements.

## 7.2 Setting the mixer from the command line

If you have installed the alsa-utils package, then the amixer program can be used to setup the mixer. The "Master" volume setting is only required on a frontend machine to ensure that the sound channels are unmuted and configured for outputting sound. The "Line" and "Capture" controls are required for your sound card to actually capture audio from the external Line-in if it's connected to an analog frame grabber. Not all sound cards have a "Capture" control, but if yours does and you don't set it then MythTV will not capture audio.

    Note the spelling in the following commands.

> `

>     $ amixer set Master,0 100%,100% unmute
>     $ amixer set PCM,0 100%,100% unmute
>     $ amixer set Line,0 75%,75% mute captur
>     $ amixer set Capture,0 100%,100% captur
>     $ su
>     # alsactl store
>     # exit
>     $

> `

If you have multiple sound cards, then use the `-c` parameter to specify which card to adjust. Note that the first card will be "0", the second will be "1", etc.

That takes care of setting the volume correctly, and the ALSA startup script will restore the volume after a reboot. If you find that your sound is distorted, it's possible that the levels in the above examples are too high for your particular hardware combination. Try reducing the percentages by 5-10% and checking again. Once you're satisfied, re-run the `alsactl store` command.

You may also use the alsamixer program to set the volume. If you are using an ALSA version after 1.0.6, use alsamixer -V all First, start alsamixer from the command line. You should start out on the "Master" volume control slider. Use the up and down cursor to set the master volume to around 75%. Next, use the left and right cursor keys to move around on the screen until you find the "Line" slider. Press SPACE to set it as the capture source, set the level to around 50-75% and press "M" to mute it. You can now press ESC to exit out of the alsamixer program. You can also have MythTV manage all volume and mute settings, but this will only affect the "Master" or PCM volume, not the capture volume. See the mythfrontend setup page for options.

Finally, if you've performed all of the above steps, and you still don't seem to have any sound, it's possible that your video capture device is muting the audio output.

> `

>     $ v4lctl -c /dev/video0 setattr mute off

> `

Next Previous Contents