anarchius.org

anarchius.org > Resource > TLGO > Chapter 00

Welcome to T.he L.inux G.uide O.nline

The following is a reference to Linux. Please feel free to contact me for any details.

Chapter 00 - Configuration FAQs

Configuring Sound Card using modprobe

Configuring Sound on Linux, unlike that of Video Cards, is entirely in the kernel land. This means we, at the least, insert some kernel modules or, at the most, recompile the linux kernel source.

We will assume that we are dealing with a "stock" kernel here that has has most of the modules already built in and available under the /lib/modules/< your kernel version> / modules. So we shall not talk about recompiling kernels here.

The process of getting your card to work can be broadly divided into three steps:

  1. Identifying your sound card
  2. Finding the appropriate driver for your card
  3. Inserting the module(s) (and probably writing scripts to automate it for every-day-use)

1. Identifying your Sound card

If you have /proc filesystem enabled (it is enabled in most of the distros) you can check out the sound card you have by the following command:

$ grep audio /proc/pci
Multimedia audio controller: C-Media Electronics include CM8738 (rev 16).

[The above output is for a particular card, your card will most probably be a different one.]

Now that we know we have a C-Media Electronics Sound card we now go out in search of the appropriate modules.

2. Finding the appropriate module

$ cd /lib/modules/< your kernel version >

Now let's search for the modules:

$ for i in `find .`
> do
>    if [ -n "`echo $i | grep -E "\.o"`" ]
>    then
>      echo -n "$i: "
>      modinfo -d $i
>    fi
> done

./kernel/drivers/net/dummy.o:
./kernel/drivers/sound/cmpci.o: CM8x38 Audio Driver
./kernel/drivers/sound/soundcore.o: Core sound module

The above is the output for the above system modules. Now we see CM8x38 Audio Driver. So we can come to the conclusion that /lib/modules/2.4.9/kernel/drivers/sound/cmpci.o is _the_ module that we need.

If you haven't got any results it could probably be that your soundcard is yet to get support under linux. but wait! search on google.com/linux or your favourite search engine. get to irc.debian.org#linuxhelp and ask for help. For even better results switch to the "bleeding edge" kernels. Some drivers are _so_ badly written that they donot yield to ``modprobe -d'' commands. For example the above output shows a dummy net driver showing a "" to ``modprobe -d''. play around.

3. Inserting the appropriate module

Most modules aren't self-sustained, ie., they depend on other modules for their working. Thanks to modprobe and modules.dep

Modprobe can automagically insert modules and their dependencies, provided you have a proper modules.dep file under the modules tree. So, here we go as root and insert them:

$ modprobe cmpci

Now the modules have been inserted. we being the suspecting human beings we are will see if they _really_ have been inserted.

# lsmod

Module

Size

Used by

dummy1

1312

1 (autoclean)

dummy0

1312

1 (autoclean)

cmpci

23264

1

soundcore

4016

2 [cmpci]

Now let's test it:

# cat >/dev/audio
even better, if you have sox installed, try this:
# play somefile.wav

Do you hear something? Congrats! you have brought your sound card to work! Now you can go ahead and install a boot up script to do the ``modprobe cmpci'' everytime you boot.