|
|
||
|
||
![]() |
| Red Hat Documentation |
4. Installation
Configuring Linux to support sound involves the following steps:
If you are running Red Hat Linux there is a utility called
If
4.1 Installing the Sound Card
Follow the manufacturer's instructions for installing the hardware or have your dealer perform the installation. Older sound cards usually have switch or jumper settings for IRQ, DMA channel, etc; note down the values used. If you are unsure, use the factory defaults. Try to avoid conflicts with other devices (e.g. ethernet cards, SCSI host adaptors, serial and parallel ports) if possible. Usually you should use the same I/O port, IRQ, and DMA settings that work under DOS. In some cases though (particularly with PnP cards) you may need to use different settings to get things to work under Linux. Some experimentation may be needed.
4.2 Configuring Plug and Play
Most sound cards now use the Plug and Play protocol to configure settings for i/o addresses, interrupts, and DMA channels. If you have one of the older sound cards that uses fixed settings or jumpers, then you can skip this section. As of version 2.2 Linux does not yet have full Plug and Play support in the kernel. The preferred solution is to use the isapnp tools which ship with most Linux distributions (or you can download them from Red Hat's web site http://www.redhat.com/). First check the documentation for your Linux distribution. It may already have Plug and Play support set up for you or it may work slightly differently than described here. If you need to configure it yourself,the details can be found in the man pages for the isapnp tools. Briefly the process you would normally follow is:
If for some reason you cannot or do not wish to use the isapnp tools, there are a couple of other options. If you use the card under Microsoft Windows 95 or 98, you can use the device manager to set up the card, then soft boot into Linux using the LOADLIN program. Make sure Windows and Linux use the same card setup parameters. If you use the card under DOS, you can use the A few of the sound card drivers include the necessary software to initialize Plug and Play for the card. Check the documentation for that card's driver for details.
4.3 Configuring the Kernel
When initially installing Linux you likely used a precompiled kernel. These kernels often do not provide sound support. It is best to recompile the kernel yourself with the drivers you need. You may also want to recompile the kernel in order to upgrade to a newer version or to free up memory resources by minimizing the size of the kernel. Later, when your sound card is working, you may wish to rebuild the kernel sound drivers as modules. The Linux Kernel HOWTO should be consulted for the details of building a kernel. I will just mention here some issues that are specific to sound cards. If you have never configured the kernel for sound support before it is a good idea to read the relevant documentation included with the kernel sound drivers, particularly information specific to your card type. The files can be found in the kernel documentation directory, usually installed in /usr/src/linux/Documentation/sound. If this directory is missing you likely either have a very old kernel version or you have not installed the kernel source code. Follow the usual procedure for building the kernel. There are
currently three interfaces to the configuration process. A graphical
user interface that runs under X11 can be invoked using When configuring the kernel there will be many choices for selecting the type of sound card you have and the driver options to use. The on-line help within the configuration tool should provide an explanation of what each option is for. Select the appropriate options to the best of your knowledge. After configuring the options you should compile and install the new kernel as per the Kernel HOWTO.
4.4 Creating the Device Files
For proper operation, device file entries must be created for the sound devices. These are normally created for you during installation of your Linux system. A quick check can be made using the command listed below. If the output is as shown (the date stamp will vary) then the device files are almost certainly okay.
Note that having the right device files there doesn't guarantee anything on its own. The kernel driver must also be loaded or compiled in before the devices will work (more on that later). In rare cases, if you believe the device files are wrong, you can
recreate them. Most Linux distributions have a
4.5 Booting Linux and Testing the Installation
You should now be ready to boot the new kernel and test the sound drivers. Follow your usual procedure for installing and rebooting the new kernel (keep the old kernel around in case of problems, of course). During booting, check for a message such as the following on powerup
(if they scroll by too quickly to read, you may be able to retrieve
them with the
This should match your sound card type and jumper settings (if any). Note that the above messages are not displayed when using loadable
sound driver module (unless you enable it, e.g. using When the sound driver is linked into the kernel, the If nothing is printed between the The driver may also display some error messages and warnings during boot. Watch for these when booting the first time after configuring the sound driver. Next you should check the device file /dev/sndstat. Reading the sound driver status device file should provide additional information on whether the sound card driver initialized properly. Sample output should look something like this:
The command above can report some error messages. "No such file or directory" indicates that you need to create the device files (see section 4.3). "No such device" means that sound driver is not loaded or linked into kernel. Go back to section 4.2 to correct this. If lines in the "Card config:" section of Now you should be ready to play a simple sound file. Get hold of a sound sample file, and send it to the sound device as a basic check of sound output, e.g.
(Make sure you don't omit the ">" in the commands above). Note that, in general, using This command will work only if there is at least one device listed in
the audio devices section of If the above commands return "I/O error", you should look at the end of the kernel messages listed using the "dmesg" command. It's likely that an error message is printed there. Very often the message is "Sound: DMA (output) timed out - IRQ/DRQ config error?". The above message means that the driver didn't get the expected interrupt from the sound card. In most cases it means that the IRQ or the DMA channel configured to the driver doesn't work. The best way to get it working is to try with all possible DMAs and IRQs supported by the device. Another possible reason is that the device is not compatible with the device the driver is configured for. This is almost certainly the case when a supposedly "SoundBlaster (Pro/16) compatible" sound card doesn't work with the SoundBlaster driver. In this case you should try to find out the device your sound card is compatible with (by posting to the comp.os.linux.hardware newsgroup, for example). Some sample sound files can be obtained from ftp://tsx-11.mit.edu/pub/linux/packages/sound/snd-data-0.1.tar.Z Now you can verify sound recording. If you have sound input capability, you can do a quick test of this using commands such as the following:
Obviously for this to work you need a microphone connected to the sound card and you should speak into it. You may also need to obtain a mixer program to set the microphone as the input device and adjust the recording gain level. If these tests pass, you can be reasonably confident that the sound D/A and A/D hardware and software are working. If you experience problems, refer to the next section of this document.
4.6 Troubleshooting
If you still encounter problems after following the instructions in the HOWTO, here are some things to check. The checks are listed in increasing order of complexity. If a check fails, solve the problem before moving to the next stage.
Step 1: Make sure you are really running the kernel you compiled.
You can check the date stamp on the kernel to see if you are running
the one that you compiled with sound support. You can do this with the
or by displaying the file /proc/version:
If the date stamp doesn't seem to match when you compiled the kernel, then you are running an old kernel. Did you really reboot? If you use LILO, did you re-install it (typically by running lilo)? If booting from floppy, did you create a new boot floppy and use it when booting?
Step 2: Make sure the kernel sound drivers are compiled in.
The easiest way to do this is to check the output of
Step 3: Did the kernel detect your sound card during booting?
Make sure that the sound card was detected when the kernel booted. You
should have seen a message on bootup. If the messages scrolled off the
screen, you can usually recall them using the
or
If your sound card was not found then something is wrong. Make sure it really is installed. If the sound card works under DOS then you can be reasonably confident that the hardware is working, so it is likely a problem with the kernel configuration. Either you configured your sound card as the wrong type or wrong parameters, or your sound card is not compatible with any of the Linux kernel sound card drivers. One possibility is that your sound card is one of the
compatible type that requires initialization by the DOS
driver. Try booting DOS and loading the vendor supplied sound card
driver. Then soft boot Linux using If your sound card is not listed in this document, it is possible that the Linux drivers do not support it. You can check with some of the references listed at the end of this document for assistance.
Step 4: Can you read data from the dsp device?
Try reading from the /dev/audio device using the If it doesn't work, then chances are that the problem is an IRQ or DMA conflict or some kind of hardware incompatibility (the device is not supported by Linux or the driver is configured for a wrong device). A remote possibility is broken hardware. Try testing the sound card under DOS, if possible, to eliminate that as a possibility.
When All Else Fails
If you still have problems, here are some final suggestions for things to try:
Next Previous Contents |
|
|