Learn Linux for Beginner

Friday, April 15, 2005

Getting Linux to make sounds

Getting Linux to make sounds

The hills are alive....

If you're like me, the first thing that interests you in setting up your computer is making it play sounds, particularly music. When I installed Slackware so many years ago (1997 seems like an eternity for Linux) I think I was more interested in making my sound card work than making the modem work to get connected. Music has always been pretty important in my life long before the World Wide Web even existed, so that was pretty logical.

Sound Cards

When I bought my first sound card in December of 1992, it came in a big box that Creative Labs sold me and it was a Sound Blaster. In that big box there was a bunch of stuff - software (for Windows 3.1), a CD-ROM drive (with an insert-able cartridge that my 2 year old just managed to break after all these years!) and some Midi gadget which never interested me and is still in the same box in my attic. I had good luck with that sound card (I still do because it still works). Due to this, I have always bought Sound Blaster cards. These cards have usually configured fairly easily under Linux. I was once bought a machine that did not have a Sound Blaster brand card in it and I was not able to get it configured under Linux. I honestly don't remember the name of the card and I promptly paid a little bit more money and exchanged that one for a real Sound Blaster and quickly got it running under Linux.

Sound Blaster uses the Alsa drivers to make sound come out of your Linux machine. These people have made my life much richer as I can listen to lovely music as I write this lesson of the beginner's course. There are a lot of other supported cards. My eternal gratitude to the people working on the Alsa Driver project. You might want to have a look at their list. And see if your sound card is on their list. The nasty hardware manufacturers who do *not* share their information (and therefore, their cards do *not* work) are listed in red.

If you use the SoundBlaster card, you may also want to check out Creative Lab's page

Configuration tools

Before I go into the tools to use to get the sound card working, it's important to point out that the Linux kernel needs to be configured to use a sound card. If your kernel doesn't have a clue about what to do with a one, there is precious little tools like sndconfig can do to help you. Luckily, every install I have done in the past year and a half or so of a major Linux distribution has come with a kernel that has sound support in it by default. If you're installing "Joe's Home-brew Linux" distribution (where you must compile your own kernel), then you might be beyond this beginner's Linux course and you probably already know how to make the kernel you want. But if you are a true beginner (that's who this course is for) then you're probably going to get a "made for sound" kernel. The latest versions of Red Hat, SuSE, Mandrake and Debian that I have installed are all sound enabled from the beginning, depending on, of course, whether or not the hardware is mainstream enough to be detected on install. I wrote in a review of Mandrake 7.2 in the Spring of this year (2001) about how it didn't detect my very mainstream Sound Blaster 16 card. The good thing is that Mandrake 7.2 is very much a thing of the past. They're on version 8.1 at the time of this writing and on that same machine, I did a "clean" install (I did not update - I removed 7.2 and installed 8.0 new) and it found and configured my Sound Blaster 16 card without the slightest problem. If the distribution you have installed (or are planning to install) is up-to-date, you should not have a problem.

It is also important to know what type of sound card it is in terms of the slots that it uses on your mother board in your computer. On my machines, the motherboard (that big thing inside a PC that you plug all the cards into) or mainboard as it is also known, will accept ISA Plug and Play cards (bigger slots) and PCI cards (smaller slots). I'm not a USB user, so I won't feign expertise here and give USB guidelines. If you have an ISA PnP card (I have two) you also have to have the ISA PnP tools installed as well as a kernel that can use ISA Plug and Play (also known as plug and pray)

As I mentioned, most major distributions will configure the sound card during the installation process. If this is not the case, you may use to any of the following tools, depending on your distribution.

  • sndconfig I mentioned this one above. It is a tool for Red Hat and distributions based on Red Hat (Mandrake, KRUD, for example). It is text based (runs it a terminal) and has always done a good job for me. It will play a sound bit of Linus Torvalds pronouncing the word "Linux"
  • YAST This is SuSE's "Swiss Army Knife" of configuration tools. Their latest version 2 is graphical. Again, there was no problem detecting my sound cards with YAST. It plays a little melody that's also the KDE default startup sound. You can adjust the default volume as well. It warns you not to set it too high, just in case you're wearing headphones and you blow your eardrums out!!
  • HardDrake Mandrake uses this graphical tool to configure hardware, including sound cards. Using the GUI, you can select the sound card and then push the button that says "launch configuration tool". I suspect that what it is doing is launching sndconfig - which, as I mentioned, is also available for Mandrake.
  • alsaconf If you're using Debian, this is the package you need to set up sound. The alsa-base package is also required.

You should now have a pretty good idea of setting up a sound card with a major Linux distribution. Strange hardware, old versions of Linux (your cousin lent you the SuSE 5.3 disks) and obscure distributions (Zingblatter's Ultra Linux 1.4) are beyond the scope of this course, so if you're one of those out there who pine for the sweets sounds of Mozart flowing from your PC, you can take a look at the HOW-TO's on the subject.You can also go to your favorite search engine (mine is Google ) and enter Linux sound card setup and you have access to the zillions of bytes of information on the topic.

Let's go on now to all of the available programs to play all of that sound and music, from the Beatles to Hans and his Swiss Alpine Yodelers.

0 Comments:

Post a Comment



<< Home