Welcome to Linux Support and Sun Help
Search LinuxSupport
Alsa-sound-mini-HOWTO: Loading the driver Next Previous Contents

4. Loading the driver

There are two ways to use the ALSA-sound-modules. I personally prefer using the manual method, meaning that I insert the driver at startup. The ALSA-drivers were designed as loadable/unloadable modules - for instance they do not reset the mixer after loading - so you can easily use the kerneld approach.

Please do read the section Backwards Compatibility. You need it to have sound support ``the old way''.

4.1 Inserting with modprobe

Note: If you have a PnP audio-card, you first need to set it to the right (or at least some known) IO/IRQ/DMA. See the Plug-and-Play-HOWTO. Did you configure your Plug-and-Play-soundcard ? Ok, then read on please. The main part is: do a "modprobe snd-<soundcard>". This should do the trick. Please note that not all distributions do include /sbin in your path. If you get a "bash: modprobe: command not found", this will most likely mean that modprobe is not in your path. Try "/sbin/modprobe snd-sb16", or try to find the modprobe utility elsewhere.

The most important difficulty is with the Crystal chipsets, for these the ALSA-drivers are not auto probing. More recent information may be acquired from the INSTALL file in the driver-directory. Two examples, then a list: Gravis UltraSound (GUS) and compatibles:

/sbin/modprobe snd-gusclassic
For all 16-bit Soundblaster-cards (SoundBlaster 16 (PnP), SoundBlaster AWE 32 (PnP), SoundBlaster AWE 64 (PnP):
/sbin/modprobe snd-sb16

4.2 Which module for which card?

Gravis UltraSound Extreme

modprobe snd-gusextreme

Gravis UltraSound MAX

modprobe snd-gusmax

ESS AudioDrive

ESS AudioDrive ES-1688 and ES-688 soundcards

modprobe snd-audiodrive1688

Gravis UltraSound PnP

Gravis UltraSound PnP, Dynasonic 3-D/Pro, STB Sound Rage 32 and other soundcards based on AMD InterWave (tm) chip.

modprobe snd-interwave

UltraSound 32-Pro

UltraSound 32-Pro (soundcard from STB used by Compaq) and other soundcards based on AMD InterWave (tm) chip with TEA6330T circuit for extended control of bass, treble and master volume

modprobe snd-interwave-stb

Soundblaster

8-bit Soundblaster cards (SoundBlaster 1.0, SoundBlaster 2.0, SoundBlaster Pro)

modprobe snd-sb8

Soundblaster 16

16-bit SoundBlaster cards (SoundBlaster 16 (PnP), SoundBlaster AWE 32 (PnP), SoundBlaster AWE 64 (PnP). Please note: this module does not support the SoundBlaster VibraX16 soundcard.

modprobe snd-sb16

Yamaha OPL3-SA2/SA3 soundcards

Just "modprobe snd-opl3sa" will not work, this driver does not do autoprobing. See below.

S3 SonicVibes

S3 SonicVibes PCI soundcards. (PINE Schubert 32 PCI)

modprobe snd-sonicvibes

Ensoniq/Soundblaster PCI64

Ensoniq AudioPCI ES1370/1371 PCI soundcards. (SoundBlaster PCI 64)

modprobe snd-audiopci

CS4232/4232A

All soundcards based on CS4232/CS4232A chips. Just "modprobe snd-card-cs4232" will not work, no auto-probing. See below.

4235 and higher

All soundcards based on CS4235/CS4236/CS4236B/CS4237B/CS4238B/CS4239 chips. Just "modprobe snd-card-cs4236" will not work, no auto-probing. See below.

4.3 modprobe for drivers without auto-probing

If you have a non-autoprobing driver, you need to supply additional info at startup to have the driver work. More information can be found in the file INSTALL in the driver directory.

OPL3-SA2 and OPL3-SA3

According to the INSTALL file you need to supply all the information for this driver. If you initialized the card with the isapnp-tools, you can probably get info from the /etc/isapnp.conf file for the following values:

snd_port - control port # for OPL3-SA chip
snd_wss_port - WSS port # for OPL3-SA chip (0x530,0xe80,0xf40,0x604)
snd_midi_port - port # for MPU-401 UART (0x300,0x330), -1 = disable
snd_fm_port - FM port # for OPL3-SA chip (0x388), -1 = disable
snd_irq - IRQ # for OPL3-SA chip (5,7,9,10)
snd_dma1 - first DMA # for Yamaha OPL3-SA chip (0,1,3)
snd_dma1_size - max first DMA size in kB (4-64kB)
snd_dma2 - second DMA # for Yamaha OPL3-SA chip (0,1,3), -1 = disable
snd_dma2_size - max second DMA size in kB (4-64kB)
You would do a "modprobe snd-opl3sa snd_port=0xNNN snd_wss_port=0x530 snd_midi_port=-1 snd_fm_port=0x388 snd_irq=5 snd_dma1=0 snd_dma1_size=NN snd_dma2=1 snd_dma2_size=NN" to load this driver (without midi-support. I am still convinced that midi-support is the thing you need when you have synthesizers and stuff and want to connect them to your Linux box. Never needed Midi-support even to play midi-files.)

Note that the "NN" values need to be supplied, only I do not know what would be reasonable values. I do not know if the dma size option is really required.

CS4232/CS4232A chips

According to the INSTALL file you need to supply the main port for this card. Note that with the driver for 3235/6/7/8/9 cards, the one below, I ended up supplying all information (except DMA-size), otherwise the driver did not work. So you may as well use the whole command line to insert the driver. If you initialized the card with the isapnp-tools, you can probably get info from the /etc/isapnp.conf file for the following values:

snd_port - port # for CS4232 chip (PnP setup - 0x534)
snd_cport - control port # for CS4232 chip (PnP setup - 0x120)
snd_mpu_port - port # for MPU-401 UART (PnP setup - 0x300), -1 = disable
snd_fm_port - FM port # for CS4232 chip (PnP setup - 0x388), -1 = disable
snd_jport - joystick port for CS4232 chip (PnP setup - 0x200), -1 =
disable
snd_irq - IRQ # for CS4232 chip (5,7,9,11,12,15)
snd_mpu_irq - IRQ # for MPU-401 UART (9,11,12,15)
snd_dma1 - first DMA # for CS4232 chip (0,1,3)
snd_dma1_size - max first DMA size in kB (4-64kB)
snd_dma2 - second DMA # for Yamaha CS4232 chip (0,1,3), -1 = disable
snd_dma2_size - max second DMA size in kB (4-64kB)
You would do a "modprobe snd-card-cs4232 snd_port=0x534 snd_cport=0x120 snd_mpu_port=-1 snd_fm_port=0x388 snd_jport=-1 snd_irq=5 snd_dma1=0 snd_dma1_size=NN snd_dma2=1 snd_dma2_size=NN" to load the driver for a "standard configured" soundcard. (Without midi-support, see the note at Yamaha OPL-3, and no joystick support). If you used different values in /etc/isapnp.conf, then you would use the values here also (Note: it can be wise to use your brains anyway ;)

Note that the "NN" values need to be supplied, only I do not know what would be reasonable values. I do not know if the dma size option is really required.

CS4235/CS4236/CS4236B/CS4237B/CS4238B/CS4239 chips

According to the INSTALL file you need to supply the main port and control ports for this card. Note that with a CS4237B card, I ended up supplying all information (except DMA-size), otherwise the driver did not work. So you may as well use the whole command line to insert the driver, and not only supply snd_port and snd_cport. If you initialized the card with the isapnp-tools, you can probably get info from the /etc/isapnp.conf file for the following values:

snd_port - port # for CS4232 chip (PnP setup - 0x534)
snd_cport - control port # for CS4232 chip (PnP setup - 0x120)
snd_mpu_port - port # for MPU-401 UART (PnP setup - 0x300), -1 = disable
snd_fm_port - FM port # for CS4232 chip (PnP setup - 0x388), -1 = disable
snd_jport - joystick port for CS4232 chip (PnP setup - 0x200), -1 = disable
snd_irq - IRQ # for CS4232 chip (5,7,9,11,12,15)
snd_mpu_irq - IRQ # for MPU-401 UART (9,11,12,15)
snd_dma1 - first DMA # for CS4232 chip (0,1,3)
snd_dma1_size - max first DMA size in kB (4-64kB)
snd_dma2 - second DMA # for Yamaha CS4232 chip (0,1,3), -1 = disable
snd_dma2_size - max second DMA size in kB (4-64kB)
You would do a "modprobe snd-card-cs4232 snd_port=0x534 snd_cport=0x120 snd_mpu_port=-1 snd_fm_port=0x388 snd_jport=-1 snd_irq=5 snd_dma1=0 snd_dma1_size=NN snd_dma2=1 snd_dma2_size=NN" to load the driver. (Without midi-support, see the note at Yamaha OPL-3, and no joystick support). Notes:

4.4 The kerneld approach

kerneld is a daemon that inserts modules on request, and unloads them once they are not in use anymore. Since I have no experience with kerneld, I do not know if the information below is accurate. The info comes from the INSTALL file in the ALSA-drivers package. Excellent information about kerneld can be found in the kerneld-mini-HOWTO.

Follow these steps:

Example for /etc/conf.modules for Gravis UltraSound PnP soundcard:
alias char-major-14 snd
alias snd-minor-oss-0 snd-interwave
alias snd-minor-oss-3 snd-pcm1-oss
alias snd-minor-oss-4 snd-pcm1-oss
alias snd-minor-oss-5 snd-pcm1-oss
alias snd-minor-oss-12 snd-pcm1-oss
alias snd-card-0 snd-interwave
options snd snd_major=14 snd_cards_limit=1
options snd-interwave snd_index=1 snd_id="guspnp" snd_port=0x220 snd_irq=5
snd_dma1=5 snd_dma2=6
Example if you want use more soundcards in one machine (configuration below is for Sound Blaster 16 and Gravis UltraSound Classic):
alias char-major-14 snd
alias snd-minor-oss-0 snd-mixer
alias snd-minor-oss-3 snd-pcm1-oss
alias snd-minor-oss-4 snd-pcm1-oss
alias snd-minor-oss-5 snd-pcm1-oss
alias snd-minor-oss-12 snd-pcm1-oss
alias snd-card-0 snd-sb16
alias snd-card-1 snd-gusclassic
options snd snd_major=14 snd_cards_limit=2
options snd-sb16 snd_index=1 snd_port=0x220 snd_irq=5 snd_dma8=1 snd_dma16=5
options snd-gusclassic snd_index=2 snd_irq=11 snd_dma1=6 snd_dma2=7
Example if two Gravis UltraSound Classic soundcards are present in system:
alias char-major-14 snd
alias snd-minor-oss-0 snd-mixer
alias snd-minor-oss-3 snd-pcm1-oss
alias snd-minor-oss-4 snd-pcm1-oss
alias snd-minor-oss-5 snd-pcm1-oss
alias snd-minor-oss-12 snd-pcm1-oss
alias snd-card-0 snd-gusclassic
alias snd-card-1 snd-gusclassic
options snd snd_major=14 snd_cards_limit=2
options snd-gusclassic snd_index=1,2 snd_port=0x220,0x260 snd_irq=5,11
snd_dma1=5,6 snd_dma2=7,3

4.5 Backwards compatibility

If you want to preserve OSS/Free or OSS/Linux compatibility, you need to insert one more driver: the snd-pcm1-oss driver for OSS-compatibility. Issue a

modprobe snd-pcm1-oss
This will give you /dev/audio and /dev/dsp-support, just as the OSS/Free (kernel) drivers and OSS/Linux (the $25 ones) do. Note that this is only an emulation.


Next Previous Contents
Valid HTML 4.01! Valid CSS!