Getting the Sound Back

February 20th, 2001 by Matthew Shannon in

I like to bop around with my MP3 player while I deal with the ones and zeros of the computer world. When I upgraded to the 2.4 kernel, I lost my sound for no apparent reason. I took this as a personal insult and made it my mission to conquer the computer. The audience for this article is mainly those who have had sound but lost it during a kernel upgrade. For first-timers, I recommend the sound HO
Your rating: None
Card type

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.

/etc/modules.conf

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.

Compiling the Kernel

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.

Trouble Shooting

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 matt@paycom.net.

__________________________


Special Magazine Offer -- Free Gift with Subscription
Receive a free digital copy of Linux Journal's System Administration Special Edition as well as instant online access to current and past issues. CLICK HERE for offer

Linux Journal: delivering readers the advice and inspiration they need to get the most out of their Linux systems since 1994.

Post new comment

Please note that comments may not appear immediately, so there is no need to repost your comment.
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <pre> <ul> <ol> <li> <dl> <dt> <dd> <i> <b>
  • Lines and paragraphs break automatically.

More information about formatting options

Newsletter

Each week Linux Journal editors will tell you what's hot in the world of Linux. You will receive late breaking news, technical tips and tricks, and links to in-depth stories featured on www.linuxjournal.com.
Sign up for our Email Newsletter

Tech Tip Videos

From the Magazine

December 2009, #188

If last month's Infrastrucuture issue was too "big" for you then try on this month's Embedded issue. Find out how to use Player for programming mobile robots, build a humidity controller for your root cellar, find out how to reduce the boot time of your embedded system, and if you're new to embedded systems find out the basics that go into one. You can also read about the Beagle Board, the Mesh Potato and a spate of other interestingly named items. And along with our regular columns don't miss our new monthly column: Economy Size Geek.







Read this issue