Getting the Sound Back
The first step is finding out what type of sound card you have. Hopefully you remember, but if not, try looking at the physical card; there is usually a manufacturer's name printed somewhere on it. Otherwise, you should have either a box or your computer specs, if the card was included. If you are lazy and want to continue sitting in your comfy chair and typing on the keyboard, then you can try running sndconfig, a RedHat utility for detecting and installing a sound card. If you do not have a sound card and are trying to configure for on-board sound, you're probably not going to have much luck. If this is your situation, do not run sndconfig because it may freeze your computer and not allow you to re-boot, (getting out of this mess is a whole other article, so don't do it). The explanation for on-board sound problems is related to sound blaster compatibility, discussed later in this article. If you have sound working on an old kernel, a last ditch effort would be to find which module was installed to enable the sound. You can locate this information in your etc/modules.conf file.
alias eth0 tulip alias parport_lowlevel parport_pc alias usb-controller usb-uhci alias sound-slot-0 ymfsb options sb support=1
Just after the "alias sound-slot-0" entry is the name of the current sound module. This can be used as a clue and crossed referenced with module/card match-ups to yield which card the new kernel needs to compile for.
As always, before experimenting with kernel options, first compile a standard kernel you know works--debugging is so much easier this way. Compiling for sound has two methods of approach; compiling the sound support into the kernel itself, or loading the support as a module during boot up. I personally recommend the latter. This saves you from having to recompile the kernel each time you need a new module. Be sure that your kernel is configured to load modules upon start up, so that all of this work does not go to waste. With this is done, locate the sound section of the kernel configuration. If possible, use xconfigurator. The menu contains a "help" button that often states which module will be compiled for that particular option. Select the module button corresponding to your sound card and exit out. Unfortunately, just selecting "sound blaster" does not always work here in Linux. If you have a supposed sound blaster compatible card, it may not work, because the drivers are written for specific cards and chips on those cards. The sound blaster cards have Creative Labs components the soundblaster drivers may look for with the sound blaster module. This is what causes the problem with on-board sound. (You should try it though, and if SoundBlaster doesn't work, try MSS/WSS or MAD16.) Click on "help", and note the name of the module as it may come in handy later. Hopefully, you have already compiled your kernel, and the only change was the selection of the card. Run make modules and then make modules_install. This will build your modules and put them in the right places. If the commands error out, you have another problem on your hands. Maybe your distribution didn't come with all of the driver files ( did you get it from kernel.org? ), or perhaps you selected too many module options. After you are done with module configuration, re-boot and cross your fingers.
If you are as lucky as I am, then you don't have sound at this point and everything is out of whack. Here's where you'll be: running off of your new kernel that is compiled to load modules with everything functional, minus sound, and with your modules compiled (from make modules). Look inside of your /usr/src/linux/drivers/sound/ directory and make sure your modules did, in fact, compile. This is where the name of the module comes in handy. You are looking for the file "yoursoundmodule.o" If it is there, you are still in good shape; if it isn't, try rerunning make modules and make modules_install. If it still doesn't appear, make sure that you didn't unset the option by accident before compiling. Next, check your libraries. Change directories to /lib/modules/uname -r/ (uname -r is the command to show which kernel is currently running; I will use it in place of a kernel version number.) There should be a misc/ directory. If not, then the modules are not located where the kernel is looking for them. Solve this problem with the following command:
mkdir /lib/modules/uname -r/misc cp /usr/src/linux/drivers/sound/*.o /lib/modules/uname-r/misc/
This will create the misc directory and move the kernel's modules into it. With that done, change directories to /etc/. Take a look at your modules.conf file and see if the module listed as your sound module exists in the /lib/modules/uname -r/misc/ directory. If not, it is possible that the name of the module has changed, (mine did; in 2.2.16 it was ymfsb, and in the new kernel ymf_sb). Change the name in the modules.conf file to the module you installed and save. Re-boot.
You should be all set. If it still doesn't work, walk through the steps and make sure you haven't missed anything. The important files to check and cross-reference are in /etc/modules.conf, and confirm the existence of /lib/modules/uname -r/misc/yoursoundmodule.o
Matthew Shannon is a Jr. Software Developer at Paycom, Inc., an on-line transaction company. His work is largely Linux-based, including network and systems administration. He welcomes your questions, comments and gripes to firstname.lastname@example.org.