suggested sound module loading info for 2.2+

Gregory A. Zornetzer (gazornetzer@students.wisc.edu)
Fri, 08 Oct 1999 22:58:25 -0500


Hi everyone,
So, after seeing the little discussion about the sound module loading
names, I decided that I really should finish that little document I had
been working on about the new sound module loading scheme. It's
attached below, and should probably replace the readme.modules in the
kernel Documentation directory, once it's been looked over. So I
encourage people to read it, and see what they think of it. I'd
appreciate input from people using ALSA on how this stuff works for
them, and any info to make the document more correct & useable. While I
do read the linux-kernel list via the archives, I could miss a post, so
please CC me on recommendations and replies.
Cheers,

-Greg Zornetzer
gazornetzer@students.wisc.edu

Sound Module autoloading in 2.2 and higher kernels
by Greg Zornetzer gazornetzer@students.wisc.edu

**NOTE - this document does not cover how to configure the options for
your
sound driver module: the IRQ, DMA, and IO ports. For this information,
refer
to the documentation for that module. However, the alias information in
most
of those documents is out of date.

During the 2.1 development cycle, some modifications were made to the
autoloading procedure for sound modules. While the old method of
autoloading
sound modules still works, it does not take full advantage of the new
loading
system.

Briefly, the old method of sound module loading was that when a request
was
made of any of the sound devices, the kernel would request
char-major-14, the
umbrella driver for all sound drivers. The old-style /etc/conf.modules
or
/etc/modules.conf would contain a line similar to the following:

alias char-major-14 sb
post-install sb modprobe adlib_card
(If you have a card other than a Soundblaster, the lines would have your
sound
card's driver instead of sb aliased above)

This would, in effect, load all of the sound facilities at once. While
this
will work, it will often load modules that you really don't need. In
addition,
it does not work optimally with ALSA drivers.

Instead, the following aliases in /etc/modules.conf will provide more
robust
functioning of the sound driver, including support for multiple sound
cards,
and proper support for multiple sound drivers for digital audio,
synthesized
music, and MIDI.

alias char-major-14 soundcore

Upon a request for any sound module, this alias will cause linux to
autoload
the basic core of sound support. It is small and free of the large
code-base
of the OSS sound drivers.

alias sound-slot-0 your_card_module

Soundcore automatically requests sound-slot modules; these correspond to
the
modules for the specific sound card on your system. For example, I have
a
Sound Blaster, so I'd have sound-slot-0 aliased to sb. This slot system
provides the basis for allowing multiple sound cards on your system.
(I'm
sure that someone has a use for this feature.) The second sound card
would
be loaded by sound-slot-1, for example, which corresponds to devices
such as
/dev/dsp1.

Once the core, and the specific driver for your card have been loaded,
it may
be necessary to load modules for specific services. When using OSS
modules
(which are the kernel default), many of these services are handled by
sound.o,
the main OSS module. In other sound systems, the features may be broken
into
seperate modules, or not implemented at all. These sound services
requests
come in the format of sound-service-X-Y, where X is the number of the
slot
(sound card) the request is for, and Y is the number corresponding to
the
service. The following services are available (taken mostly from
Documentation/devices.txt, where they're listed:

0: The mixer service, which is generally taken care of by the main sound
driver from OSS or ALSA.
1: The fm synthesizer service, which often requires an additional module
to be
loaded, often the opl3 driver, which requires synth0
2: The MIDI interface port, which also can require module loading, if
the
card driver doesn't automatically load MIDI support.
3: Digital audio support for /dev/dsp and /dev/audio: These are taken
care of
by the main sound driver in OSS, but probably require a driver load
on ALSA.
6: The /dev/sndstat service, which doesn't really depend much on a
hardware

driver, but on a high-level module like the OSS sound.o to support
it.

synth0 is a seperate module request that comes from the opl3 driver
(which is
pretty common in OSS), and usually calls for adlib_card to be loaded for
fm synthesized audio.

As you can tell, this document is rather heavily based on the OSS
modules
distributed with the kernel and the sb driver, since this is what I use.
Here's my configuration in /etc/conf.modules:

alias char-major-14 soundcore # basic sound capabilities
alias sound-slot-0 sb # main sound card hardware driver
alias sound-service-0-0 sound # mixer taken care of by sound.o
alias sound-service-0-1 opl3 # fm synthesizer
alias sound-service-0-2 sb # uart support part of sb
alias sound-service-0-3 sound # /dev/dsp & /dev/audio support in sound.o
alias sound-service-0-6 sound # /dev/sndstat support in sound.o
alias synth0 adlib_card # adlib is our fm synthesizer, called by opl3

This should be enough to get OSS users to work fully on the new loading
system.
If you have information on the right way that ALSA drivers fit into this
picture, please feel free to add to this.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/