
		Advanced Linux Sound Architecture - Driver
		==========================================
			    Installation guide

ALSA driver replaces OSS/Lite driver which is in current Linux kernels.
Please, check if OSS/Lite is compiled in your kernel. Remove it before
you are trying to install this driver.

Before you are trying install this driver, please, read carefuly
documentation for insmod, modprobe, kerneld/kmod and even for isapnp
if you have ISA PnP soundcard. If you don't understand how these programs
work, you cannot be success with installation.

Quick install
=============

1) Run './configure' script.
   If you have ISA Plug & Play soundcard, use --with-isapnp=yes switch.
   If you want sequencer support, use --with-sequencer=yes switch.
   If you want turn on debug mode use --with-debug=full switch.
   If you want debug soundcard detection try --with-debug=detect switch.
   Example: ./configure --with-isapnp=yes --with-debug=full
2) Run 'make install'.
3) Run './snddevices' script to create new sound devices in /dev directory.
4) Edit your /etc/conf.modules (look to kerneld/kmod support section).
5) Run 'modprobe snd-card' where card is name of your card.
   Note: If you have ISA PnP soundcard you should need run isapnp program
         from isapnptools package at first to initialize soundcard if
	 you don't select native ISA PnP support via --with-isapnp=yes
	 switch.

You can also look to file utils/alsasound. This script is designed for
RedHat distribution, but it should be used with other distributions which
use System V style rc init scripts.

Note: All mixer channels are muted by default. You must use some native
      mixer program to unmute appropriate channels (for example mixer from
      alsa-utils package).

Driver cannot be activated?
===========================

1) Is OSS(/Lite) driver present? - remove it
2) Check your soundcard setup, read carefuly this install file (module
   parameters).
3) If you have ISA PnP soundcard:
   - native ISA PnP support: is your setup in /proc/isapnp.conf correct?
   - isapnptools: is isapnp.conf configuration same as for driver?
4) Driver isn't still working: remake driver with:
     ./configure --with-debug=detect; make clean; make
   Reinsert new driver modules to kernel and look to /var/log/messages if
   there aren't some messages. If these messages doesn't help you, send us
   to <alsa-devel@alsa.jcu.cz> mailing list:
	- soundcard name + chip names present on your soundcard
	- your /proc/isapnp or isapnp.conf if you have ISA PnP soundcard
	- your conf.modules or line which you activate ALSA driver
	- all messages from /var/log/messages which should be relevant to
          ALSA driver

Bug report
==========

We need know these things (at minimum):

1) driver + kernel version: 'cat /proc/asound/version'
2) soundcard info
   - soundcard name provided by manufacture
   - list of chips which soundcard have onboard
   - contents of 'cat /proc/asound/cards'
3) all messages from /var/log/messages which should be relevant to
   ALSA driver
4) problem description

ISA Plug & Play issues
======================

If you use native ISA Plug & Play module (isapnp.o) you may need know
that after isapnp.o module is inserted to kernel, all ISA Plug & Play
devices (cards) are deactivated!!! This means that they aren't useable
without driver which have build-in ISA Plug & Play support. If you
have only one ISA Plug & Play soundcard in your machine, you don't
worry about above information.

Module parameters
=================

  User can modify/set parameters at load time of module. If modules supports
  more cards and you have more than one card of same type, simply specify more
  values for parameter delimited with commas.
  
  Module snd.o
  ------------

    snd_major	- major # for sound driver
		- default is 14 - this value is compatible with OSS/Lite
    snd_cards_limit
		- specifies card limit # (1-8)
		- good for kerneld/kmod support if you don't want search
		  for soundcards which aren't installed in your system
    snd_device_mode
		- specifies permission mask for dynamic sound device filesystem
		- default value = 0666
		- for example 'snd_device_mode=0660'
    snd_device_gid
		- specifies GID number for dynamic sound device filesystem
		- default value = 0 (root)
    snd_device_uid
		- specifies UID number for dynamic sound device filesystem
		- default value = 0 (root)

  Global parameters for top soundcard modules
  -------------------------------------------

    snd_index	- 1-8 - index for soundcard
                - if not set, first free index is assigned
    snd_id	- user identification for card (up to 15 chars)
		- default expression is 'card<snd_index>' (for example card1)
		- value is used for /proc/asound filesystem
		- this value can be used with application for identification
		  of card if user doesn't want identify card with index number

  Module snd-audiodrive1688.o
  ---------------------------

    Module for ESS AudioDrive ES-1688 and ES-688 soundcards.

    snd_port	- port # for ES-1688 chip (0x220,0x240,0x260)
    snd_mpu_port - port # for MPU-401 port (0x300,0x310,0x320,0x330), -1 = disable (default)
    snd_irq	- IRQ # for ES-1688 chip (5,7,9,10)
    snd_mpu_irq	- IRQ # for MPU-401 port (5,7,9,10)
    snd_dma8	- DMA # for ES-1688 chip (0,1,3)
    snd_dma8_size - max DMA size in kB (4-64kB)

    Module supports up to 8 cards and autoprobe (without MPU-401 port).

  Module snd-gusclassic.o
  -----------------------

    Module for Gravis UltraSound Classic soundcard.

    snd_port	- port # for GF1 chip (0x220,0x230,0x240,0x250,0x260)
    snd_irq	- IRQ # for GF1 chip (3,5,9,11,12,15)
    snd_dma1	- DMA # for GF1 chip (1,3,5,6,7)
    snd_dma1_size - max DMA1 size in kB (4-128kB)
    snd_dma2	- DMA # for GF1 chip (1,3,5,6,7,-1=disable)
    snd_dma2_size - max DMA2 size in kB (4-128kB)
    snd_joystick_dac - 0 to 31, (0.59V-4.52V or 0.389V-2.98V)

    Module supports up to 8 cards and autoprobe.

  Module snd-gusextreme.o
  -----------------------

    Module for Gravis UltraSound Extreme soundcard.

    snd_port	- port # for ES-1688 chip (0x220,0x230,0x240,0x250,0x260)
    snd_gf1_port - port # for GF1 chip (0x210,0x220,0x230,0x240,0x250,0x260,0x270)
    snd_mpu_port - port # for MPU-401 port (0x300,0x310,0x320,0x330), -1 = disable
    snd_irq	- IRQ # for ES-1688 chip (5,7,9,10)
    snd_mpu_irq	- IRQ # for MPU-401 port (5,7,9,10)
    snd_irq1	- IRQ # for GF1 chip (3,5,9,11,12,15)
    snd_dma8	- DMA # for ES-1688 chip (0,1,3)
    snd_dma8_size - max DMA8 size in kB (4-64kB)
    snd_dma1	- DMA # for GF1 chip (1,3,5,6,7)
    snd_dma1_size - max DMA1 size in kB (4-128kB)
    snd_joystick_dac - 0 to 31, (0.59V-4.52V or 0.389V-2.98V)

    Module supports up to 8 cards and autoprobe (without MPU-401 port).

  Module snd-gusmax.o
  -------------------

    Module for Gravis UltraSound MAX soundcard.

    snd_port	- port # for GF1 chip (0x220,0x230,0x240,0x250,0x260)
    snd_irq	- IRQ # for GF1 chip (3,5,9,11,12,15)
    snd_dma1	- DMA # for GF1 chip (1,3,5,6,7)
    snd_dma1_size - max DMA1 size in kB (4-128kB)
    snd_dma2	- DMA # for GF1 chip (1,3,5,6,7,-1=disable)
    snd_dma2_size - max DMA2 size in kB (4-128kB)
    snd_joystick_dac - 0 to 31, (0.59V-4.52V or 0.389V-2.98V)

    Module supports up to 8 cards and autoprobe.
    
  Module snd-interwave.o
  ----------------------

    Module for Gravis UltraSound PnP, Dynasonic 3-D/Pro, STB Sound Rage 32
    and other soundcards based on AMD InterWave (tm) chip.
  
    snd_port	- port # for InterWave chip (0x210,0x220,0x230,0x240,0x250,0x260)
    snd_irq	- IRQ # for InterWave chip (3,5,9,11,12,15)
    snd_dma1	- DMA # for InterWave chip (0,1,3,5,6,7)
    snd_dma1_size - max DMA1 size in kB (4-128kB)
    snd_dma2	- DMA # for InterWave chip (0,1,3,5,6,7,-1=disable)
    snd_dma2_size - max DMA2 size in kB (4-128kB)
    snd_joystick_dac - 0 to 31, (0.59V-4.52V or 0.389V-2.98V)
    snd_midi    - 1 = MIDI UART enable, 0 = MIDI UART disable (default)

    Module supports up to 8 cards, autoprobe and ISA PnP.

  Module snd-interwave-stb.o
  --------------------------

    Module for 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.
  
    snd_port	- port # for InterWave chip (0x210,0x220,0x230,0x240,0x250,0x260)
    snd_port_tc - tone control (i2c bus) port # for TEA6330T chip (0x350,0x360,0x370,0x380)
    snd_irq	- IRQ # for InterWave chip (3,5,9,11,12,15)
    snd_dma1	- DMA # for InterWave chip (0,1,3,5,6,7)
    snd_dma1_size - max DMA1 size in kB (4-128kB)
    snd_dma2	- DMA # for InterWave chip (0,1,3,5,6,7,-1=disable)
    snd_dma2_size - max DMA2 size in kB (4-128kB)
    snd_joystick_dac - 0 to 31, (0.59V-4.52V or 0.389V-2.98V)
    snd_midi    - 1 = MIDI UART enable, 0 = MIDI UART disable (default)

    Module supports up to 8 cards, autoprobe and ISA PnP.

  Module snd-sb8.o
  ----------------

    Module for 8-bit SoundBlaster cards: SoundBlaster 1.0,
					 SoundBlaster 2.0,
					 SoundBlaster Pro

    snd_port	- port # for SB DSP chip (0x220,0x240,0x260)
    snd_irq	- IRQ # for SB DSP chip (5,7,9,10)
    snd_dma8	- DMA # for SB DSP chip (1,3)
    snd_dma8_size - max DMA size in kB (4-64kB)

    Module supports up to 8 cards and autoprobe.
    
  Module snd-sb16.o
  -----------------

    Module for 16-bit SoundBlaster cards: SoundBlaster 16 (PnP),
					  SoundBlaster AWE 32 (PnP),
					  SoundBlaster AWE 64 PnP

    snd_port	- port # for SB DSP 4.x chip (0x220,0x240,0x260)
    snd_mpu_port - port # for MPU-401 UART (0x300,0x330), -1 = disable
    snd_irq	- IRQ # for SB DSP 4.x chip (5,7,9,10)
    snd_dma8	- 8-bit DMA # for SB DSP 4.x chip (0,1,3)
    snd_dma8_size - max 8-bit DMA size in kB (4-64kB)
    snd_dma16	- 16-bit DMA # for SB DSP 4.x chip (5,6,7)
    snd_dma16_size - max 16-bit DMA size in kB (4-128kB)
    snd_mic_agc - Mic Auto-Gain-Control - 1 = enable (default), 0 = disable
    
    Module supports up to 8 cards, autoprobe and ISA PnP.

    Note: This module doesn't support SoundBlaster VibraX16 soundcard.
          This soundcard uses two 8-bit DMA channels and seems that
          documentation isn't available at Creative Labs WWW site.
          If you know where can be get documentation, mail us...
          Otherwise - this soundcard isn't supported yet, so don't
          send us any e-mails with "my soundcard isn't working"...
    
  Module snd-opl3sa.o
  -------------------

    Module for Yamaha OPL3-SA2/SA3 soundcards.

    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)
    
    Module supports up to 8 cards and ISA PnP. This module doesn't supports
    autoprobe (if ISA PnP isn't used) thus all ports must be specified!!!
    
  Module snd-mozart.o
  -------------------

    Module for OAK Mozart cards.

    snd_port	- port # for WSS chip (0x530,0xe80,0xf40,0x604)
    snd_irq	- IRQ # for WSS chip (7,9,10,11)
    snd_dma1	- DMA # for WSS chip (0,1,3)
    snd_dma1_size - max DMA size in kB (4-64kB)
    
    Module supports only one card and autoprobe.
    
  Module snd-sonicvibes.o
  -----------------------

    Module for S3 SonicVibes PCI soundcards.
			* PINE Schubert 32 PCI

    snd_dmaa_size - max DDMA-A (playback) size in kB (4-128kB)
    snd_dmac_size - max DDMA-C (record) size in kB (4-128kB)
    snd_reverb    - Reverb Enable - 1 = enable, 0 = disable (default)
                  - SoundCard must have onboard SRAM for this.
    snd_mge       - Mic Gain Enable - 1 = enable, 0 = disable (default)
    
    Module supports up to 8 cards and autoprobe.

  Module snd-audiopci.o
  ---------------------

    Module for Ensoniq AudioPCI ES1370/1371 PCI soundcards.
			* SoundBlaster PCI 64
			* SoundBlaster PCI 128

    snd_dac1_frame_size - max dac1 (playback1) frame size in kB (4-128kB)
    snd_dac2_frame_size - max dac2 (playback2) frame size in kB (4-128kB)
    snd_adc_frame_size  - max adc (record) frame size in kB (4-128kB)

    Module supports up to 8 cards and autoprobe.
    
  Module snd-card-cs4232.o
  ------------------------

    Module for soundcards based on CS4232/CS4232A chips.

    snd_port	- port # for CS4232 chip (PnP setup - 0x534)
    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)
    
    Module supports up to 8 cards. This module doesn't supports autoprobe
    thus main port must be specified!!! Other ports are optional.
    

  Module snd-card-cs4236.o
  ------------------------

    Module for soundcards based on CS4235/CS4236/CS4236B/CS4237B/
                                   CS4238B/CS4239 chips.

    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)
    
    Module supports up to 8 cards. This module doesn't supports autoprobe
    (if ISA PnP isn't used) thus main port and control port must be
    specified!!! Other ports are optional.
    

modprobe/kerneld/kmod support
=============================

Bellow example is for Gravis UltraSound PnP soundcard:

----- /etc/conf.modules

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 (bellow configuration
is for Sound Blaster 16 and Gravis UltraSound Classic):

----- /etc/conf.modules

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:

----- /etc/conf.modules

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

-----

ALSA PCM devices to OSS devices mapping
=======================================

/dev/snd/pcm00  -> /dev/audio0 (/dev/audio) -> minor 4
/dev/snd/pcm00  -> /dev/dsp0 (/dev/dsp)     -> minor 3
/dev/snd/pcm01  -> /dev/adsp0 (/dev/adsp)   -> minor 12
/dev/snd/pcm10  -> /dev/audio1              -> minor 4+16 = 20
/dev/snd/pcm10  -> /dev/dsp1                -> minor 3+16 = 19
/dev/snd/pcm11  -> /dev/adsp1               -> minor 12+16 = 28
/dev/snd/pcm20  -> /dev/audio2              -> minor 4+32 = 36
/dev/snd/pcm20  -> /dev/dsp2                -> minor 3+32 = 39
/dev/snd/pcm21  -> /dev/adsp2               -> minor 12+32 = 44

First number from /dev/snd/pcmXY means soundcard number and second means
device number.

Proc interfaces (/proc/asound)
==============================

/proc/asound/#card#/pcm#o
-------------------------
  String "Playback erase" - erase all additional informations about OSS applications
  String "Playback <app_name> <fragments> <fragment_size> [<options>]"
  String "Record erase" - erase all additional informations about OSS applications
  String "Record <app_name> <fragments> <fragment_size> [<options>]"

   <app_name> - name of application with (highter priority) or without path
   <fragments> - number of fragments or zero if auto
   <fragment_size> - size of fragment in bytes or zero if auto
   <options> - optional parameters
	  - WR_ONLY - if application tries open pcm device with O_RDWR
                      driver rewrites this to O_WRONLY (playback) - good
                      for Quake etc...

  Example: echo "Playback x11amp 128 16384" > /proc/asound/0/pcm0o
           echo "Playback squake 0 0 WR_ONLY" > /proc/asound/0/pcm0o

/proc/asound/#card#/sb16
------------------------
  String "Playback 8" -> driver will use always 8-bit DMA channel for playback.
  String "Playback 16" -> driver will use always 16-bit DMA channel for playback.
  String "Playback auto" (default) -> driver will use auto mode (first opened
  direction will use 16-bit DMA channel).
  String "Record 8" -> driver will use always 8-bit DMA channel for record.
  String "Record 16" -> driver will use always 16-bit DMA channel for record.
  String "Record auto" (default) -> driver will use auto mode (first opened
  direction will use 16-bit DMA channel).

  Example: echo "Record 16" > /proc/asound/0/sb16
