-->
Previous Table of Contents Next


Troubleshooting the Installation and Configuration

As with any device, there can be problems that need to be corrected after installing and configuring your sound card. Of course, your system may be working perfectly, in which case you can skip this section.

If after compiling the new kernel you have no sound card support and there are no messages during the boot sequence about sound cards, chances are high that you’re not booting off the new kernel. The following command displays the details of the kernel that booted.


uname -a

Check the time and date to see if it coincides with the recompilation. If not, you may have to use LILO to install the new kernel on your boot device, or repeat the entire recompilation process again.


Tip:  
The /proc/version file on most Linux systems contains the same information as the uname -a command. You can use either to check the version of the kernel.

Assuming the version of the kernel is the one you just compiled, you need to check that the sound card is linked into the kernel itself. The file /proc/devices lists the character and block mode devices the kernel includes. Look for an entry for “sound” (usually number 14). If it’s not there, the sound card components were not linked into this kernel and you need to redo the config routine.

If the /proc/devices file looks okay and you saw a message during the boot sequence about the sound card (you can replay all those messages using either the dmesg command or by looking at the /var/adm/messages file), chances are you’re using a “compatible” card that isn’t very compatible. This is common with SoundBlaster-compatible cards, where the drivers for the real card don’t find the compatible card. Check the README files with the driver to see if there’s any mention of your specific card and problems with it, and check the manufacturer’s Web or FTP site.

Another way to check the status of your sound card installation is to look at the file /dev/sndstat. If you don’t find this file, you haven’t run the sound card installation script from the end of the file /usr/src/linux/drivers/sound/Readme.Linux. Cut the script from the file, make it executable, and run it. Then you should find a file called /dev/sndstat generated for you.

There are several error messages you may see in /dev/sndstat that help you determine the problem with your sound card. Table 21.2 shows the most common messages, the reason they are generated, and a possible solution. In each case the error message is preceded by the device name.

Table 21.2. /dev/sndstat error messages.

Error message Reason generated and solution

No such device The kernel does not contain the sound card drivers. Rebuild the kernel.
No such device or address The sound card driver couldn’t find the sound card at the configuration you specified. Check the configuration settings.

Applications for Sound Cards

There are quite a number of applications that work with your sound card, depending on what you want to do. Most of these applications are available from FTP sites or may be included with your CD-ROM Linux distribution. To check whether the files are on your system or your CD-ROM, use the find command to look for the executable program’s name.

We’re not going to look at each application that is available for Linux because there are several dozen. Instead, we’ll pick a few representative examples. Checking out the FTP sites will show you all the others that are available.

vplay, vrec, splay, and srec

The vplay utility and its three partners are a suite of sound tools called snd-util developed by Hannu Savolainen and Michael Beck. These are straightforward sound recording and playback utilities developed in the early stages of Linux, but work well even today if you are willing to use a command-line interface instead of a fancy GUI. The srec tool records sounds and splay replays them. (To record, you need either a microphone or other input device such as a feed from a CD.)


Tip:  
The easiest source of the snd-util 3.0 package (the current version as this book went to press) is through FTP:

ftp.sunsite.unc.edu/pub/Linux/apps/sound/snd-util-3.0.tar.gz


The srec utility lets you specify the amount of time to record, as well as the sampling rate. Sound is stored in the raw file format (.raw file extension). To record a twenty second sample of sound using a 21KHz sampling rate and store the output in the file sample.raw, use this command:


srec -t 20 -s 21000 sample.raw

To replay the sound just recorded, you need the splay utility and must specify both the filename and the sampling rate:


splay -s 21000 sample.raw

If you choose the wrong sampling rate you’ll notice right away since the sound will not resemble the original.

The vplay and vrec commands are based on splay and srec respectively, but add the ability to save files in .wav format and .voc format (used by SoundBlaster cards).


Previous Table of Contents Next