<!doctype linuxdoc system> 

<article>

<title>The Linux Sound HOWTO
<author>Jeff Tranter, <htmlurl url="mailto:jeff&lowbar;tranter@mitel.com"
name="jeff&lowbar;tranter@mitel.com">
<date>v1.12, 21 October 1995

<abstract>
This document describes sound support for Linux. It lists the
supported sound hardware, describes how to configure the kernel
drivers, and answers frequently asked questions. The intent is to
bring new users up to speed more quickly and reduce the amount of
traffic in the usenet news groups.
</abstract>

<toc>

<sect>Introduction<p>

This is the Linux Sound HOWTO document. It is intended as a quick
reference covering everything you need to know to install and
configure sound support under Linux. Frequently asked questions about
sound under Linux are answered, and references are given to some other
sources of information on a variety of topics related to computer
generated sound and music.

The scope is limited to the aspects of sound cards pertaining to
Linux. See the other documents listed in the <em>References</em>
section for more general information on sound cards and computer sound
and music generation.

<sect1>Acknowledgments<p>

Much of this information came from the <tt>Readme</tt> files provided
with the sound driver source code, by Hannu Savolainen (<htmlurl
url="mailto:hannu@voxware.pp.fi" name="hannu@voxware.pp.fi">). Thanks
go to Hannu and the many other people who developed the Linux kernel
sound drivers and utilities.

Thanks to the <htmlurl
url="ftp://sunsite.unc.edu/pub/Linux/utils/text/linuxdoc-sgml-1.3.tar.gz"
name="Linuxdoc-SGML"> package, this HOWTO is available in several
formats, all generated from a common source file.

<sect1>Revision History<p>

<descrip>

<tag>Version 1.1</tag>first version; posted to SOUND channel of Linux
activists mailing list only

<tag>Version 1.2</tag>minor updates; first version available on archive sites

<tag>Version 1.3</tag>converted to SGML; now available in several formats
using Matt Welsh's Linuxdoc-SGML tools; appearance changed due to new
format, only minor changes to content

<tag>Version 1.4</tag>minor tweaking of SGML; added answer on PAS16
and Adaptec1542A SCSI adaptor incompatibilities

<tag>Version 1.5</tag>2.5a sound driver is now in 1.1 kernel
distribution; note on GUS-MAX support; other minor updates

<tag>Version 1.6</tag>added info on "no space on device" error; added
note that Hacker's Guide is in a "hidden" directory; added question on
bidirectional mode; info on "device busy" errors; other minor changes

<tag>Version 1.7</tag>added info on ASP and AWE32; VoxWare 2.9 is
available; answer to question on using IRQ2; references to Sound and
SCSI HOWTOs

<tag>Version 1.8</tag>added question on errors under DOS; many minor
things updated to match the version 2.90 sound driver; info on DOOM;
answer on reducing noise

<tag>Version 1.9</tag>questions on recording and clone cards

<tag>Version 1.10</tag>mentioned that HOWTO is available on WWW, as
printed copies, and translations; info on DMA conflict with QIC tape
driver; info on Sound Galaxy NX Pro and Logitech BusMouse

<tag>Version 1.11</tag>A long overdue update (I've been busy);
document placed under GPL; brought up to date with version 3.0 sound
driver; info on many new supported sound card drivers; more info on
configuration and troubleshooting; lots of HTML links added; brought
in line with format of CD-ROM HOWTO

<tag>Version 1.12</tag>new sound drivers in 1.3.34 kernel; new sound
device names; 1542 address is 334 not 333; clarify status of Creative
Labs Emu and ASP; pointer to Creative Labs and MediaTrix Web sites

</descrip>

<sect1>New versions of this document<p>

New versions of this document will be periodically posted to the
<htmlurl url="news:comp.os.linux.answers"
name="comp.os.linux.answers"> newsgroup. They will also be uploaded
to various anonymous ftp sites that archive such information including
<url url="ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/">.

Hypertext versions of this and other Linux HOWTOs are available on
many World-Wide-Web sites, including <url
url="http://sunsite.unc.edu/mdw/mdw.html">. Most Linux CD-ROM
distributions include the HOWTOs, and you can also buy printed copies
from several vendors.
 
A French translation of this document is available at <url
url="ftp://ftp.ibp.fr/pub2/linux/french/docs/HOWTO/">.

A Japanese translation is available is available from <url
url="http://yebisu.ics.es.osaka-u.ac.jp/linux/">.

<sect1>Feedback<p>

I rely on you, the users, to make this HOWTO useful. If you have any
suggestions, corrections, or comments, please send them to me,
<htmlurl url="mailto:jeff&lowbar;tranter@mitel.com"
name="jeff&lowbar;tranter@mitel.com">, and I will try to incorporate
them in the next revision.

I am also willing to answer general questions on sound cards and
Linux, as best I can. Before doing so, please read all of the
information in this HOWTO, and send me detailed information about the
problem.

If you publish this document on a CD-ROM or in hardcopy form, a
complimentary copy would be appreciated. Mail me for my postal
address.

<sect1>Distribution Policy<p>

Copyright (C) 1995 Jeff Tranter.

This HOWTO is free documentation; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.

This document is distributed in the hope that it will be useful, but
<bf>without any warranty</bf>; without even the implied warranty of
<bf>merchantability</bf> or <bf>fitness for a particular purpose</bf>.
See the GNU General Public License for more details.

You can obtain a copy of the GNU General Public License by writing to
the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
USA.

<sect>Sound Card Technology<p>

This section gives a <em>very</em> cursory overview of computer audio
technology, in order to help you understand the concepts used later in
the document. You should consult a book on digital audio or digital
signal processing in order to learn more.

Sound is an <em>analog</em> property; it can take on any value over a
continuous range. Computers are <em>digital</em>; they like to work
with discrete values. Sound cards use a device known as an <em>Analog
to Digital Converter</em> (A/D or ADC) to convert voltages
corresponding to analog sound waves into digital or numeric values
which can be stored in memory. Similarly, a <em>Digital to Analog
Converter
</em>
(D/A or DAC) converts numeric values back to an analog voltage which
can in turn drive a loudspeaker, producing sound.

The process of analog to digital conversion, known as sampling,
introduces some error. Two factors are key in determining how well the
sampled signal represents the original. <em>Sampling rate</em> is the
number of samples made per unit of time (usually expresses as samples
per second or Hertz). A low sampling rate will provide a less accurate
representation of the analog signal. Sample size is the range of
values used to represent each sample, usually expressed in bits. The
larger the sample size, the more accurate the digitized signal will
be.

Sound cards commonly use 8 or 16 bit samples at sampling rates from
about 4000 to 44,000 samples per second. The samples may also be
contain one channel (mono) or two (stereo).

<em>FM Synthesis</em> is an older technique for producing sound. It is
based on combining different waveforms (e.g. sine, triangle, square).
FM synthesis is simpler to implement in hardware that D/A conversion,
but is more difficult to program and less flexible. Many sound cards
provide FM synthesis for backward compatibility with older cards and
software. Several independent sound generators or <em>voices</em> are
usually provided.

<em>Wavetable Synthesis</em> combines the flexibility of D/A
conversion with the multiple channel capability of FM synthesis. With
this scheme digitized voices can be downloaded into dedicated memory,
and then played, combined, and modified with little CPU
overhead. State of the art sound cards all support wavetable
synthesis.

Most sound cards provide the capability of <em>mixing</em>, combining
signals from different input sources and controlling gain levels.

<em>MIDI</em> stands for Musical Instrument Digital Interface, and is
a standard hardware and software protocol for allowing musical
instruments to communicate with each other. The events sent over a
MIDI bus can also be stored as MIDI files for later editing and
playback. Many sound cards provide a MIDI interface. Those that do not
can still play MIDI files using the on-board capabilities of the sound
card.

<em>MOD files</em> are a common format for computer generated songs.
As well as information about the musical notes to be played, the files
contain digitized samples for the instruments (or voices).  MOD files
originated on the Amiga computer, but can be played on other systems,
including Linux, with suitable software.

<sect>Supported Hardware<p>

This section lists the sound cards and interfaces that are currently
supported under Linux. The information here is based on the latest
Linux kernels, at time of writing.

The sound driver has its own version numbering.  The latest stable
Linux kernel release was version 1.2.13, using sound driver version
2.90-2. The latest development kernel was version 1.3.35 and provided
the version 3.5-alpha1-951002 sound driver.

The author of the sound driver, Hannu Savolainen, typically also makes
available newer beta releases of the sound driver as kernel patches
before they are included as part of the standard Linux kernel
distribution.

This information is only valid for Linux on the Intel platform.  Some
information may be applicable to other processor architectures, but I
have no first hand experience or information.

<sect1>Sound Cards<p>

The following sound cards are supported by the Linux kernel sound
driver:

<itemize>
<item>ATI Stereo F/X
<item>AdLib
<item>Audio Excell DSP16 
<item>Cardinal DSP16
<item>Ensoniq SoundScape (and compatibles made by Reveal and Spea)
<item>Gravis Ultrasound
<item>Gravis Ultrasound ACE
<item>Gravis Ultrasound Max
<item>Gravis Ultrasound with 16 bit option
<item>Logitech Sound Man 16
<item>Logitech SoundMan Games
<item>Logitech SoundMan Wave
<item>MAD16 Pro (OPTi 82C929)
<item>Media Vision Jazz16
<item>MediaTriX AudioTriX Pro
<item>Microsoft Windows Sound System (MSS/WSS)
<item>Mozart (OAK OTI-601)
<item>Orchid SW32
<item>Personal Sound System (PSS)
<item>Pro Audio Spectrum 16
<item>Pro Audio Studio 16	
<item>Pro Sonic 16
<item>Roland MPU-401 MIDI interface
<item>Sound Blaster 1.0 
<item>Sound Blaster 16
<item>Sound Blaster 16ASP
<item>Sound Blaster 2.0
<item>Sound Blaster AWE32
<item>Sound Blaster Pro
<item>TI TM4000M notebook
<item>ThunderBoard
<item>Turtle Beach Tropez
<item>Yamaha FM synthesizers (OPL2, OPL3 and OPL4)
<item>6850 UART MIDI Interface
</itemize>

Starting with the 1.3.35 kernel some additional sound cards are
supported, but this is an Alpha test release and may or may not work
reliably. When configuring it you are warned:

<tscreen><verb>
*********************************************************
* NOTE!!!! THIS IS AN _EXPERIMENTAL_ ALPHA TEST VERSION *
* WHICH CERTAINLY HAS BUGS AND MAY SERIOUSLY DAMAGE YOUR*
* SYSTEM. YOU HAVE A CHANCE TO HIT CTRL-C NOW!!!!!!!!   *
*********************************************************
</verb></tscreen>

The following cards are <em>not</em> supported, either because they
are obsolete or because the vendor will not release the programming
information needed to write a driver:

<itemize>
<item>Pro Audio Spectrum (original)
<item>Pro Audio Spectrum+ 
<item>older (Sierra Aria based) soundcards made by Diamond
</itemize>

Other sound cards that are claimed to be compatible with one of the
supported sound cards <em>may</em> work if they are hardware
(i.e. register level) compatible. Some cards described as "100%
SoundBlaster compatible" are <em>not</em> register compatible. Some
hints for getting compatible cards to work are given later in this
document. If you have a card that works and is not listed here, let me
know and I will add it to the list.

The Linux kernel supports the SCSI port provided on some sound cards
(e.g. ProAudioSpectrum 16) and the proprietary interface for some
CD-ROM drives (e.g. Soundblaster Pro). See the Linux <htmlurl
url="http://sunsite.unc.edu/mdw/HOWTO/SCSI-HOWTO.html" name="SCSI
HOWTO"> and <htmlurl
url="http://sunsite.unc.edu/mdw/HOWTO/CDROM-HOWTO.html" name="CDROM
HOWTO"> documents for more information.

A loadable kernel module to support joystick ports, including those
provided on some sound cards, is also available.

Note that the kernel SCSI, CD-ROM, joystick, and sound drivers are
completely independent of each other.

<sect1>Alternate Sound Drivers<p>

There are some "unofficial" sound drivers available, not included in
the standard Linux kernel distribution, and used in place of the
VoxWare driver.

Markus Mummert (<htmlurl url="mailto:mum@mmk.e-technik.tu-muenchen.de"
name="mum@mmk.e-technik.tu-muenchen.de">) has written a driver package
for the Turtle Beach MultiSound (classic), Tahiti, and Monterey
soundcards. The documentation states:

<quote>
"It is designed for high quality hard disk recording/playback without
losing sync even on a busy system. Other features such as wave
synthesis, MIDI and digital signal processor (DSP) cannot be
used. Also, recording and playback at the same time is not
possible. It currently replaces VoxWare and was tested on several
kernel versions ranging from 1.0.9 to 1.2.1. Also, it is installable
on UN*X SysV386R3.2 systems."
</quote>

It can be found at <url
url="http://www.cs.colorado.edu/~mccreary/tbeach">.

Kim Burgaard (<htmlurl url="mailto:burgaard@daimi.aau.dk"
name="burgaard@daimi.aau.dk">) has written a device driver and
utilities for the Roland MPU-401 MIDI interface. The Linux software
map entry gives this description:

<quote>
"A device driver for true Roland MPU-401 compatible MIDI interfaces
(including Roland SCC-1 and RAP-10/ATW-10). Comes with a useful
collection of utilities including a Standard MIDI File replayer and
recorder.
</quote>

<quote>
Numerous improvements have been made since version 0.11a. Among other
things, the driver now features IRQ sharing policy and complies with
the new kernel module interface.  Metronome functionality, possibility
for synchronizing e.g. graphics on a per beat basis without losing
precision, advanced replay/record/overdub interface and much, much
more."
</quote>

It can be found at <url
url="ftp://sunsite.unc.edu/pub/Linux/kernel/sound/mpu401-0.2.tar.gz">.

<sect1>PC Speaker<p>

An alternate sound driver is available that requires no additional
sound hardware; it uses the internal PC speaker. It is mostly software
compatible with the sound card driver, but, as might be expected,
provides much lower quality output and has much more CPU overhead. The
results seem to vary, being dependent on the characteristics of the
individual loudspeaker. For more information, see the documentation
provided with the release.

The current version is 0.9b, and can be found at
<url url="ftp://ftp.informatik.hu-berlin.de/pub/os/linux/hu-sound/">

<sect1>Parallel Port<p>

Another option is to build a digital to analog converter using a
parallel printer port and some additional components. This provides
better sound quality than the PC speaker but still has a lot of CPU
overhead. The PC sound driver package mentioned above supports this,
and includes instructions for building the necessary hardware.

<sect>Installation<p>

Configuring Linux to support sound involves the following steps:

<enum>
<item>Installing the sound card.
<item>Configuring and building the kernel for sound support.
<item>Creating the device files.
<item>Booting the Linux kernel and testing the installation.
</enum>

The next sections will cover each of these steps in detail.

<sect1>Installing the Sound Card<p>

Follow the manufacturer's instructions for installing the hardware or
have your dealer perform the installation.

Older sound cards usually have switch or jumper settings for IRQ, DMA
channel, etc; note down the values used. If you are unsure, use the
factory defaults. Try to avoid conflicts with other devices
(e.g. ethernet cards, SCSI host adaptors, serial and parallel ports)
if possible.

<sect1>Configuring the Kernel<p>

When initially installing Linux you likely used a precompiled
kernel. These kernels usually do not provide sound support. It is best
to recompile the kernel yourself with the drivers you need. You may
also want to recompile the kernel in order to upgrade to a newer
version or to free up memory resources by minimizing the size of the
kernel.

The <url url="http://sunsite.unc.edu/mdw/HOWTO/Kernel-HOWTO.html"
name="Linux Kernel HOWTO"> should be consulted for the details of
building a kernel. I will just mention here some issues that are
specific to sound cards.

If you have never configured the kernel for sound support before it is
a good idea to read <em>all</em> of the Readme files included with the
kernel sound drivers, particularly information specific to your card
type. The following documentation files can be found in the kernel
sound driver directory, usually installed in <url
url="/usr/src/linux/drivers/sound">:

<verb>
CHANGELOG         - description of changes in each release
COPYING           - copying and copyright restrictions
Readme            - latest and most important news
Readme.aedsp16    - information about Audio Excel DSP 16 sound card
Readme.cards      - notes on configuring specific cards
Readme.linux      - notes on installing separately release sound drivers
Readme.modules    - how to build driver as a loadable kernel module
Readme.v30        - new features in version 3.0 sound driver
experimental.txt  - notes on experimental features
</verb>

Follow the usual procedure for building the kernel. When you run
<tt>make config</tt>, enable sound support by answering "yes" to the
question

<tscreen><verb>
Sound card support?
</verb></tscreen>

At the end of the configuration questions a sound configuration
program will be compiled, run, and will then ask you what sound card
options you want. Be careful when answering these questions since
answering a question incorrectly may prevent some later ones from
being asked. For example, don't answer "yes" to the first question
(PAS16) if you don't really have a PAS16. Don't enable more cards than
you really need, since they just consume memory. Also some drivers
(like MPU401) may conflict with your SCSI controller and prevent the
kernel from booting.

I list here a brief description of each of the configuration dialog
options. Answer "y" (yes) or "n" (no) to each question. The default
answer is shown so that "(y/n)" means "y" by default and "(n/y)" means
the default is "n". To use the default value, just hit Enter, but
remember that the default value isn't necessarily correct.

Note also that all questions may not be asked. The configuration
program may disable some questions depending on the earlier
choices. It may also select some options automatically as well.

<descrip>

<tag>ProAudioSpectrum 16 support?</tag>

Answer "y" <em>only</em> if you have a Pro Audio Spectrum <em>16</em>,
ProAudio Studio 16 or Logitech SoundMan 16.  Don't answer 'y' if you
have some other card made by Media Vision or Logitech since they are
not PAS16 compatible.

<tag>SoundBlaster support?</tag>

Answer "y" if you have an original SoundBlaster card made by Creative
Labs or a 100% hardware compatible clone (like the Thunderboard or SM
Games). If your card was in the list of supported cards look at the
card specific instructions in the <tt>Readme.cards</tt> file before
answering this question. For an unknown card you may answer "y'"if the
card claims to be SoundBlaster compatible.

<tag>Generic OPL2/OPL3 FM synthesizer support?</tag>

Answer "y" if your card has a FM chip made by Yamaha (OPL2/OPL3/OPL4).
Answering "y" is usually a safe and recommended choice, however some
cards may have software (TSR) FM emulation. Enabling FM support with
these cards may cause trouble (I don't currently know of any such
cards, however).

<tag>Gravis Ultrasound support?</tag>

Answer "y" if you have a GUS or GUS MAX. Answer "n" if you don't have
a GUS since the driver consumes a lot of memory.

<tag>MPU-401 support (NOT for SB16)?</tag>

Be careful with this question. The MPU401 interface is supported by
almost all soundcards. However, some natively supported cards have
their own driver for MPU401. Enabling the MPU401 option with these
cards will cause a conflict. Also enabling MPU401 on a system that
doesn't really have a MPU401 could cause some trouble. If your card
was in the list of supported cards, look at the card specific
instructions in the <tt>Readme.cards</tt> file. It's safe to answer
"y" if you have a true MPU401 MIDI interface card.

<tag>6850 UART Midi support?</tag>

It's safe to answer "n" to this question in all cases. The 6850 UART
interface is very rarely used.

<tag>PSS (ECHO-ADI2111) support?</tag>

Answer "y" only if you have Orchid SW32, Cardinal DSP16 or some other
card based on the PSS chipset (AD1848 codec + ADSP-2115 DSP chip +
Echo ESC614 ASIC CHIP).

<tag>16 bit sampling option of GUS (<em>not</em> GUS MAX)?</tag>

Answer "y" if you have installed the 16 bit sampling daughtercard on
your GUS. Answer "n" if you have a GUS MAX. Enabling this option
disables GUS MAX support.

<tag>GUS MAX support?</tag>

Answer "y" only if you have a GUS MAX.

<tag>Microsoft Sound System support?</tag>

Again think carefully before answering "y" to this question. It's safe
to answer "y" if you have the original Windows Sound System card made
by Microsoft or Aztech SG 16 Pro (or NX16 Pro).  Also you may answer
"y" in case your card was not listed earlier in this file. For cards
having native support in VoxWare, consult the card specific
instructions in <tt>Readme.cards</tt>. Some drivers have their own MSS
support and enabling this option will cause a conflict.

<tag>Ensoniq Soundscape support?</tag>

Answer "y" if you have a soundcard based on the Ensoniq SoundScape
chipset. Such cards are being manufactured at least by Ensoniq, Spea
and Reveal (Reveal makes other cards also).

<tag>MediaTriX AudioTriX Pro support?</tag>

Answer "y" if you have the AudioTriX Pro.

<TAG>Support for MAD16 and/or Mozart based cards?</TAG>

Answer "y" if your card has a Mozart (OAK OTI-601) or MAD16 (OPTi
82C928 or 82C929) audio interface chip. These chips are currently
quite common so it's possible that many no-name cards have one of
them. In addition the MAD16 chip is used in some cards made by known
manufacturers such as Turtle Beach (Tropez), Reveal (some models) and
Diamond (latest ones).

<TAG>SoundBlaster Pro support?</TAG>

Enable this option if your card is a SoundBlaster Pro or SoundBlaster
16. Enable it also with any SoundBlaster Pro clones. Answering "n"
saves some memory but "y" is the safe alternative.

<tag>SoundBlaster 16 support?</tag>

Enable if you have a SoundBlaster 16 (including the AWE32).

<tag>Audio Excel DSP 16 initialization support?</tag>

Enable this if you have an Audio Excel DSP16 card. See the file
<tt>Readme.aedsp16</tt> for more information.

</descrip>

The configuration program then asks some questions about the
higher level services. It's recommended to answer "y" to each of these
questions. Answer "n" only if you know you will not need the option.

<descrip>

<tag>/dev/dsp and /dev/audio support (usually required)?</tag>

Answering "n" disables <tt>/dev/dsp</tt> and <tt>/dev/audio</tt>, the
A/D and D/A converter devices. Answer "y".

<tag>MIDI interface support?</tag>

Answering "n" disables <tt>/dev/midixx</tt> devices and access to any
MIDI ports using <tt>/dev/sequencer</tt> and <tt>/dev/music</tt>. This
option also affects any MPU401 and/or General MIDI compatible devices.

<tag>FM synthesizer (YM3812/OPL-3) support?</tag>

Answer "y" here.

<tag>/dev/sequencer support?</tag>

Answering "n" disables <tt>/dev/sequencer</tt> and <tt>/dev/music</tt>

</descrip>

After the above questions the configuration program prompts for the
card specific configuration information. Usually just a set of I/O
address, IRQ and DMA numbers are asked. With some cards the program
asks for some files to be used during initialization of the
card. These are used by cards which have a DSP chip or microprocessor
which must be initialized by downloading a program (microcode) file to
the card. In some cases this file is written to a .h file by the
config program and then included to the driver during compile. Again,
read the information in the file <tt>Readme.cards</tt> pertaining to
your card type.

If you are upgrading from an older sound driver, make sure that the
files <tt>/usr/include/sys/soundcard.h</tt> and
<tt>/usr/include/sys/ultrasound.h</tt> are symbolic links to the
corresponding files in <tt>/usr/include/linux</tt>, or that they
simply contain the lines <tt>#include &lt;linux/soundcard.h&gt;</tt>
and <tt>#include &lt;linux/ultrasound.h&gt;</tt>, respectively.

You are now ready to compile and install the new kernel.

<sect1>Creating the Device Files<p>

The first time the kernel sound driver is configured you need to
create the sound device files. The easiest way to do this is to cut
the short shell script from the end of the file <tt>Readme.linux</tt>
in the directory <tt>/usr/src/linux/drivers/sound</tt>, and run it as
user <tt>root</tt>.

If your device entries already exist, you might want to ensure they
are correct. If they are not, or if you are in doubt, run the above
script and it will replace any existing entries with correct ones.

Some older Linux distributions provided install scripts which created
incorrect sound device files. You may also have a
<tt>/dev/MAKEDEV</tt> script for creating device files. Using the
script included with the kernel sound driver is preferred since it
should always be up to date with the latest supported sound devices.

After running the script your sound device files should look something
like this:

<verb>
lrwxrwxrwx   1 root        11 Aug 22 00:01 audio -> /dev/audio0
crw-rw-rw-   1 root   14,   4 Aug 22 00:01 audio0
crw-rw-rw-   1 root   14,  20 Aug 22 00:01 audio1
lrwxrwxrwx   1 root         9 Aug 22 00:01 dsp -> /dev/dsp0
crw-rw-rw-   1 root   14,   3 Aug 22 00:01 dsp0
crw-rw-rw-   1 root   14,  19 Aug 22 00:01 dsp1
crw-rw-rw-   1 root   14,   2 Aug 22 00:01 midi00
crw-rw-rw-   1 root   14,  18 Aug 22 00:01 midi01
crw-rw-rw-   1 root   14,  34 Aug 22 00:01 midi02
crw-rw-rw-   1 root   14,  50 Aug 22 00:01 midi03
crw-rw-rw-   1 root   14,   0 Aug 22 00:01 mixer
crw-rw-rw-   1 root   14,  16 Aug 22 00:01 mixer1
crw-rw-rw-   1 root   14,   8 Aug 22 00:01 music
crw-rw-rw-   1 root   14,  17 Aug 22 00:01 patmgr0
crw-rw-rw-   1 root   14,  33 Aug 22 00:01 patmgr1
crw-rw-rw-   1 root   14,   1 Aug 22 00:01 sequencer
lrwxrwxrwx   1 root        10 Aug 22 00:01 sequencer2 -> /dev/music
crw-rw-rw-   1 root   14,   6 Aug 22 00:01 sndstat
</verb>

If you are using the PC speaker sound driver, read the documentation
that came with the package to determine what device files to create.

Normally the configuration you used when building the kernel will be
acceptable to the sound card driver. It is also possible to pass
parameters on the kernel command line (e.g. from LILO) to configure
the sound driver. These are defined in the file <tt>Readme.linux</tt>.
It should rarely be necessary to use these. They are mainly intended
for developers of Linux boot disks to create a kernel that supports
multiple types of sound cards.

<sect1>Booting Linux and Testing the Installation<p>

You should now be ready to boot the new kernel and test the sound
drivers. Follow your usual procedure for installing and rebooting the
new kernel (keep the old kernel around in case of problems, of
course).

During booting, check for a message such as the following on powerup
(if they scroll by too quickly to read, you may be able to retrieve
them with the "dmesg" command):

<tscreen><verb>
snd2 <SoundBlaster Pro 3.2> at 0x220 irq 5 drq 1
snd1 <Yamaha OPL-3 FM> at 0x388 irq 0 drq 0
</verb></tscreen>

This should match your sound card type and jumper settings (if any).

The driver may also display some error messages and warnings during
boot. Watch for these when booting the first time after configuring
the sound driver.

Next you should check the device file <tt>/dev/sndstat</tt>.  Reading
the sound driver status device file should provide additional
information on whether the sound card driver initialized
properly. Sample output should look something like this:

<tscreen><verb>
% cat /dev/sndstat
VoxWare Sound Driver:3.0.1-950812 (Thu Aug 17 23:33:07 EDT 1995 root@fizzbin.ca)
Config options: 312002

Installed drivers: 
Type 1: OPL-2/OPL-3 FM
Type 2: SoundBlaster

Card config: 
SoundBlaster at 0x220 irq 5 drq 1
OPL-2/OPL-3 FM at 0x388 irq 0 drq 0

Audio devices:
0: SoundBlaster Pro 3.2

Synth devices:
0: Yamaha OPL-3

Midi devices: NOT ENABLED IN CONFIG

Timers:
0: System Timer

Mixers:
0: SoundBlaster
</verb></tscreen>

Now you should be ready to play a simple sound file. Get hold of a
sound sample file, and send it to the sound device as a basic check of
sound output, e.g.

<tscreen><verb>
% cat endoftheworld >/dev/dsp
% cat crash.au >/dev/audio
</verb></tscreen>

(Make sure you don't omit the "&gt;" in the commands above).

Some sample sound files can be obtained from <url
url="ftp://tsx-11.mit.edu/pub/linux/packages/sound/snd-data-0.1.tar.Z">

Now you can verify sound recording. If you have sound input
capability, you can do a quick test of this using commands such as the
following:

<tscreen><verb>
# record 4 seconds of audio from microphone
% dd bs=8k count=4 &etago;dev/audio >sample.au
4+0 records in
4+0 records out
# play back sound
% cat sample.au >/dev/audio
</verb></tscreen>

If these tests pass, you can be reasonably confident that the sound
D/A and A/D hardware and software are working. If you experience
problems, refer to the next section of this document.

<sect1>Troubleshooting<p>

If you still encounter problems after following the instructions in
the HOWTO, here are some things to check. The checks are listed in
increasing order of complexity. If a check fails, solve the problem
before moving to the next stage.

<sect2>Step 1: Make sure you are really running the kernel you compiled.<p>

You can check the date stamp on the kernel to see if you are running
the one that you compiled with sound support. You can do this with the
<tt>uname</tt> command:

<tscreen><verb>
% uname -a
Linux fizzbin 1.3.20 #1 Fri Aug 18 22:12:36 EDT 1995 i386
</verb></tscreen>

or by displaying the file <tt>/proc/version</tt>:

<tscreen><verb>
% cat /proc/version
Linux version 1.2.13 (root@fizzbin) (gcc version 2.6.3) #9 Sun Aug 6 11:56:47 EDT 1995
</verb></tscreen>

If the date stamp doesn't seem to match when you compiled the kernel,
then you are running an old kernel. Did you really reboot? If you use
LILO, did you re-install it (typically by running
<tt>/etc/lilo/install</tt>)? If booting from floppy, did you create a
new boot floppy and use it when booting?

<sect2>Step 2: Make sure the kernel sound drivers are compiled in.<p>

You can see what drivers are compiled in by looking at
<tt>/proc/devices</tt>:

<tscreen><verb>
% cat /proc/devices
Character devices:
 1 mem
 4 tty
 5 cua
 6 lp
14 sound
15 Joystick

Block devices:
 2 fd
 3 hd
25 sbpcd
</verb></tscreen>

What we are looking for here is character device 14, labeled "sound".
If the sound device is not listed then something went wrong with the
kernel configuration or build. Start the installation process again,
beginning with configuration and building of the kernel.

<sect2>Step 3: Did the kernel detect your sound card during booting?<p>

Make sure that the sound card was detected when the kernel booted. You
should have seen a message on bootup. If the messages scrolled off the
screen, you can usually recall them using the <tt>dmesg</tt> command:

<tscreen><verb>
% dmesg
</verb></tscreen>

or

<tscreen><verb>
% tail /var/adm/messages
</verb></tscreen>

If your sound card was not found then something is wrong. Make sure it
really is installed. If the sound card works under DOS then you can be
reasonably confident that the hardware is working, so it is likely a
problem with the kernel configuration. Either you configured your
sound card as the wrong type or wrong parameters, or your sound card
is not compatible with any of the Linux kernel sound card drivers.

One possibility is that your sound card is one of the "compatible"
type that requires initialization by the DOS driver. Try booting DOS
and loading the vendor supplied sound card driver. Then soft boot
Linux using <tt>Control-Alt-Delete</tt>. Make sure that card I/O
address, DMA, and IRQ settings for Linux are the same as used under
DOS.  Read the <tt>Readme.cards</tt> file from the sound driver source
distribution for hints on configuring your card type.

If your sound card is not listed in this document, it is possible that
the Linux drivers do not support it. You can check with some of the
references listed at the end of this document for assistance.

<sect2>Step 4: Can you read data from the dsp device?<p>

Try reading from the <tt>/dev/audio</tt> device using the <tt>dd</tt>
command listed earlier in this document. The command should run
without errors.

If this does not work, then a possible cause is the device file. Make
sure than the device files in the <tt>/dev</tt> directory has the
correct major and minor numbers as listed previously. Check that the
permissions on the device file allow reading and writing.

A remote possibility is a hardware problem. Try testing the drive
under DOS, if possible, to determine if this could be the case.

<sect2>When All Else Fails<p>

If you still have problems, here are some final suggestions for things
to try:

<itemize>
<item>carefully re-read this HOWTO document
<item>read the references listed at the end of this document,
especially the relevant kernel source Readme files
<item>post a question to one of the <tt>comp.os.linux</tt> or
other usenet newsgroups
<item>send a question to the Sound channel of the Linux mailing list
<item>try using the latest Linux kernel
<item>contact your computer dealer
<item>contact the sound card manufacturer
<item>send mail to the author of the sound driver
<item>send mail to the author of the Sound HOWTO
<item>fire up emacs and type <tt>Esc-x doctor</tt>
</itemize>

<sect>Applications Supporting Sound<p>

I give here a sample of the types of applications that you likely want
if you have a sound card under Linux. You can check the Linux Software
Map, Internet archive sites, and/or files on your Linux CD-ROM for
more up to date information.

As a minimum, you will likely want to obtain the following sound
applications:

<itemize>
<item>audio file format conversion utility (e.g. <tt>Sox</tt>)
<item>mixer utility (e.g. <tt>aumix</tt> or <tt>xmix</tt>)
<item>digitized file player/recorder (e.g. <tt>play</tt> or <tt>wavplay</tt>)
<item>MOD file player (e.g. <tt>tracker</tt>)
<item>MIDI file player (e.g. <tt>mp</tt>)
</itemize>

There are text-based as well as GUI-based versions of most of these
tools. There are also some more esoteric applications (e.g. speech
synthesis and recognition) that you may wish to try.

<sect>Answers To Frequently Asked Questions<p>

This section answers some of the questions that have been commonly
asked on the Usenet news groups and mailing lists.

<sect1>What are the various sound device files?<p>

These are the most "standard" device file names, some Linux
distributions may use slightly different names.

<descrip>
<tag>/dev/audio</tag>normally a link to <tt>/dev/audio0</tt>
<tag>/dev/audio0</tag>Sun workstation compatible audio device (only
a partial implementation, does not support Sun ioctl interface, just
u-law encoding)
<tag>/dev/audio1</tag>second audio device (if supported by sound card)
<tag>/dev/dsp</tag>normally a link to <tt>/dev/dsp0</tt>
<tag>/dev/dsp0</tag>first digital sampling device
<tag>/dev/dsp1</tag>second digital sampling device
<tag>/dev/mixer</tag>sound mixer
<tag>/dev/mixer1</tag>second sound mixer
<tag>/dev/music</tag>high-level sequencer interface
<tag>/dev/patmgr0</tag>Patch Manager
<tag>/dev/patmgr1</tag>Patch Manager
<tag>/dev/sequencer</tag>low level MIDI, FM, and GUS access
<tag>/dev/sequencer2</tag>normally a link to <tt>/dev/music</tt>
<tag>/dev/midi00</tag>1st raw MIDI port
<tag>/dev/midi01</tag>2nd raw MIDI port
<tag>/dev/midi02</tag>3rd raw MIDI port
<tag>/dev/midi03</tag>4th raw MIDI port
<tag>/dev/sndstat</tag>displays sound driver status when read
</descrip>

The PC speaker driver provides the following devices:

<descrip>
<tag>/dev/pcaudio</tag>equivalent to /dev/audio
<tag>/dev/pcsp</tag>equivalent to /dev/dsp
<tag>/dev/pcmixer</tag>equivalent to /dev/mixer
</descrip>

<sect1>How can I play a sound sample?<p>

Sun workstation (.au) sound files can be played by sending them to the
<tt>/dev/audio</tt> device. Raw samples can be sent to
<tt>/dev/dsp</tt>. Using a program such as <tt>play</tt> is
preferable, as it will recognize most file types and set the sound
card to the correct sampling rate, etc.

<sect1>How can I record a sample?<p>

Reading <tt>/dev/audio</tt> or <tt>/dev/dsp</tt> will return sampled
data that can be redirected to a file. A program such as <tt>vrec</tt>
makes it easier to control the sampling rate, duration, etc. You may
also need a mixer program to select the appropriate input device.

<sect1>Can I have more than one sound card?<p>

Up to two sound cards is supported. It's possible to install a Gravis
UltraSound or MPU-401 with a SoundBlaster, SoundBlaster Pro,
SoundBlaster16 or ProAudioSpectrum16. It's <em>not</em> possible to
have a ProAudioSpectrum16 and SoundBlaster at the same time (the PAS16
has an SB emulator in it). It's also not possible to have more than
one card of the same type at the same time -- for example, a GUS + GUS
combination is not possible.

You can change the sound card configuration parameters at boot time
using command line options from a boot loader such as LILO. See the
kernel sound driver file <tt>Readme.linux</tt> for details.

<sect1>Error: <tt>No such file or directory</tt> for sound devices<p>

You need to create the sound driver device files. See the section on
creating device files. If you do have the device files, ensure that
they have the correct major and minor device numbers (some older
CD-ROM distributions of Linux may not create the correct device files
during installation).

<sect1>Error: <tt>No such device</tt> for sound devices<p>

You have not booted with a kernel containing the sound driver or the
I/O address configuration doesn't match your hardware. Check that you
are running the newly compiled kernel and verify that the settings
entered when configuring the sound driver match your hardware setup.

<sect1>Error: <tt>No space left on device</tt> for sound devices<p>

This can happen if you tried to record data to /dev/audio or /dev/dsp
without creating the necessary device file. The sound device is now a
regular file, and has filled up your disk partition. You need to run
the script described in the <em>Creating the Device Files</em> section
of this document.

<sect1>Error: <tt>device busy</tt> for sound devices<p>

Only one process can open a given sound device at one time. Most
likely some other process is using the device in question. One way to
determine this is to use the fuser command:

<tscreen><verb>
% fuser -v /dev/dsp
/dev/dsp:             USER       PID ACCESS COMMAND
                      tranter    265 f....  tracker
</verb></tscreen>

In the above example, the fuser command showed that process 265 had
the device open. Waiting for the process to complete or killing it
will allow the sound device to be accessed once again.

<sect1>I still get <tt>device busy</tt> errors!<p>

According to Brian Gough, for the SoundBlaster cards which use DMA
channel 1 there is a potential conflict with the QIC-02 tape driver,
which also uses DMA 1, causing "device busy" errors. If you are using
FTAPE, you may have this driver enabled. According to the FTAPE-HOWTO
the QIC-02 driver is not essential for the use of FTAPE; only the
QIC-117 driver is required. Reconfiguring the kernel to use QIC-117
but not QIC-02 allows FTAPE and the sound-driver to coexist.

(the following explanation was supplied by Harald Albrecht
<tt>albrecht@igpm.rwth-aachen.de</tt>)

Some soundcards support using DMA channel 0. The sound driver
configuration program allows this, and the kernel compiles properly,
but accessing the sound device results in a "device busy" error
message.

The reason is that the Linux kernel reserves DMA channel 0 for DRAM
refresh. This is no longer true for modern 386/486 boards which use
their own refresh logic. You can correct it by changing this line in
the file /usr/src/linux/kernel/dma.c:

<tscreen><verb>
static volatile unsigned int dma_chan_busy[MAX_DMA_CHANNELS] = {
		1, 0, 0, 0, 1, 0, 0, 0
};
</verb></tscreen>

Replace the first 1 with a 0; this enables DMA channel 0. Don't do the
same with DMA channel 4 as this is cascade and won't work! The code
should now look like this:

<tscreen><verb>
static volatile unsigned int dma_chan_busy[MAX_DMA_CHANNELS] = {
		0, 0, 0, 0, 1, 0, 0, 0
};
</verb></tscreen>

Recompile and reboot with the new kernel.

<sect1>Partial playback of digitized sound file<p>

The symptom is usually that a sound sample plays for about a second
and then stops completely or reports an error message about "missing
IRQ" or "DMA timeout". Most likely you have incorrect IRQ or DMA
channel settings. Verify that the kernel configuration matches the
sound card jumper settings and that they do not conflict with some
other card.

Another symptom is sound samples that "loop". This is usually caused
by an IRQ conflict.

<sect1>There are pauses when playing MOD files<p>

Playing MOD files requires considerable CPU power. You may have too
many processes running or your computer may be too slow to play in
real time. Your options are to:

<itemize>
<item>try playing with a lower sampling rate or in mono mode
<item>eliminate other processes
<item>buy a faster computer
<item>buy a more powerful sound card (e.g. Gravis UltraSound)
</itemize>

If you have a Gravis UltraSound card, you should use one of the mod
file players written specifically for the GUS (e.g. <tt>gmod</tt>).

<sect1>Compile errors when compiling sound applications<p>

The version 1.0c and earlier sound driver used a different and
incompatible <tt>ioctl()</tt> scheme. Obtain newer source code or make
the necessary changes to adapt it to the new sound driver. See the
sound driver <tt>Readme</tt> file for details.

Also ensure that you have used the latest version of
<tt>soundcard.h</tt> and <tt>ultrasound.h</tt> when compiling the
application. See the installation instructions at beginning of this
text.

<sect1>SEGV when running sound binaries that worked previously<p>

This is probably the same problem described in the previous question.

<sect1>What known bugs or limitations are there in the sound driver?<p>

See the <tt>Readme</tt> and <tt>CHANGELOG</tt> files included with the
sound driver kernel source.

<sect1>What do all the sound driver configuration options mean?<p>

During configuration of the sound driver, a <tt>configure</tt> program
is compiled and executed. This program asks you some questions and
then generates the header file <tt>local.h</tt> that defines the sound
card configuration.

The configuration file defines (or undefines) the following
symbols:

<verb>
Symbol			Meaning
======			=======
KERNEL_SOUNDCARD	enable/disable sound driver
EXCLUDE_PAS		ProAudioSpectrum support
EXCLUDE_SB		SoundBlaster support
EXCLUDE_ADLIB		AdLib support
EXCLUDE_GUS		Gravis UltraSound support
EXCLUDE_MPU401		MPU-401 MIDI interface support
EXCLUDE_UART6850	6850 MIDI UART support
EXCLUDE_PSS		Professional Sound System support
EXCLUDE_GUS16		Gravis UltraSound support
EXCLUDE_GUSMAX		Gravis UltraSound Max support
EXCLUDE_MSS		Microsoft Sound System support
EXCLUDE_SBPRO		SoundBlaster Pro support
EXCLUDE_SB16		SoundBlaster 16 support
EXCLUDE_AUDIO		Digitized voice support
EXCLUDE_MIDI		MIDI interface support
EXCLUDE_YM3812		FM synthesizer (YM3812/OPL-3) support
EXCLUDE_SEQUENCER	MIDI sequencer support
EXCLUDE_PRO_MIDI	SoundBlaster Pro MIDI support
EXCLUDE_CHIP_MIDI	MIDI on CHIP support
SBC_BASE 0x220		SoundBlaster I/O base address
SBC_IRQ			SoundBlaster IRQ number
SBC_DMA			SoundBlaster DMA channel
SB16_DMA		SoundBlaster 16 DMA channel
SB16_MIDI_BASE		base address of SoundBlaster 16 MIDI port
PAS_IRQ			ProAudioSpectrum IRQ number
PAS_DMA			ProAudioSpectrum DMA channel
GUS_IRQ			Gravis UltraSound IRQ number
GUS_DMA			Gravis UltraSound DMA channel
GUS_BASE		base address of Gravis UltraSound
MPU_IRQ			MPU-401 IRQ number
MPU_BASE		base address of MPU-401 port
DSP_BUFFSIZE		DMA buffer size
</verb>

Several other defines are also created, setting such things as the
sound driver revision level and the time and date when configure was
run.

There are other parameters that are not set by the configure
program. If you need to change these, edit the file
<tt>sound_config.h</tt>.

To disable the sound driver, run <tt>make config</tt> and answer "no"
to the "Sound card support?" question.

<sect1>Where are the sound driver ioctls() etc. documented?<p>

These are partially documented in the <em>Hacker's Guide to
VoxWare</em>, currently available in draft form. The latest version is
draft 2, and can be found on <url
url="ftp://nic.funet.fi/pub/OS/Linux/ALPHA/sound">. Note that this
directory is "hidden" and will not appear in directory listings. If
you "cd" to the directory and use the FTP "dir" command, the files
<em>are</em> there.

<sect1>What CPU resources are needed to play or record without pauses?<p>

There is no easy answer to this question, as it depends on:

<itemize>
<item>whether using PCM sampling or FM synthesis
<item>sampling rate and sample size
<item>which application is used to play or record
<item>Sound Card hardware
<item>disk I/O rate, CPU clock speed, cache size, etc.
</itemize>

In general, any 386 machine should be able to play samples or FM
synthesized music on an 8 bit soundcard with ease.

Playing MOD files, however, requires considerable CPU resources. Some
experimental measurements have shown that playing at 44kHz requires
more than 40% of the speed of a 486/50 and a 386/25 can hardly play
faster than 22 kHz (these are with an 8 bit card sound such as a
SoundBlaster). A card such as the Gravis UltraSound card performs more
functions in hardware, and will require less CPU resources.

These statements assume the computer is not performing any other CPU
intensive tasks.

Converting sound files or adding effects using a utility such as Sox
is also much faster if you have a math coprocessor. The kernel driver
itself does not do any floating point calculations, though.

<sect1>Problems with a PAS16 and an Adaptec 1542 SCSI host adaptor<p>

(the following explanation was supplied by
<tt>seeker@indirect.com</tt>)

Linux only recognizes the 1542 at address 330 (default) or 334, and
the PAS only allows the MPU-401 emulation at 330.  Even when you
disable the MPU-401 under software, something still wants to conflict
with the 1542 if it's at its preferred default address.  Moving the
1542 to 334 makes everyone happy.<P>

Additionally, both the 1542 and the PAS-16 do 16-bit DMA, so if you
sample at 16-bit 44KHz stereo and save the file to a SCSI drive hung
on the 1542, you're about to have trouble.  The DMAs overlap and there
isn't enough time for RAM refresh, so you get the dread ``PARITY ERROR
- SYSTEM HALTED'' message, with no clue to what caused it.  It's made
worse because a few second-party vendors with QIC-117 tape drives
recommend setting the bus on/off times such that the 1542 is on even
longer than normal.  Get the SCSISEL.EXE program from Adaptec's BBS or
several places on the internet, and reduce the BUS ON time or increase
the BUS OFF time until the problem goes away, then move it one notch
or more further.  SCSISEL changes the EEPROM settings, so it's more
permanent than a patch to the DOS driver line in CONFIG.SYS, and will
work if you boot right into Linux (unlike the DOS patch).  Next
problem solved.<P>

Last problem - the older Symphony chipsets drastically reduced the
timing of the I/O cycles to speed up bus accesses.  None of various
boards I've played with had <em>any</em> problem with the reduced
timing except for the PAS-16.  Media Vision's BBS has SYMPFIX.EXE
that's supposed to cure the problem by twiddling a diagnostic bit in
Symphony's bus controller, but it's not a hard guarantee.  You may
need to:

<itemize>
<item>get the motherboard distributor to replace the older version bus chip,
<item>replace the motherboard, or
<item>buy a different brand of sound card.
</itemize>

Young Microsystems will upgrade the boards they import for around
&dollar;30 (US); other vendors may be similar if you can figure out
who made or imported the motherboard (good luck).  The problem is in
ProAudio's bus interface chip as far as I'm concerned; <em>nobody</em>
buys a &dollar;120 sound card and sticks it in a 6MHz AT.  Most of
them wind up in 25-40MHz 386/486 boxes, and should be able to handle
<em>at least</em> 12MHz bus rates if the chips are designed
right. Exit soapbox (stage left).
<P>

The first problem depends on the chipset used on your motherboard,
what bus speed and other BIOS settings, and the phase of the moon.
The second problem depends on your refresh option setting (hidden or
synchronous), the 1542 DMA rate and (possibly) the bus I/O rate.  The
third can be determined by calling Media Vision and asking which
flavor of Symphony chip is incompatible with their slow design.  Be
warned, though - 3 of 4 techs I talked to were brain damaged.  I would
be very leery of trusting <em>anything</em> they said about someone
else's hardware, since they didn't even know their own very well.<P>

<sect1>Problems with the FM synthesizer on a SoundBlaster Pro 1<p>

The newer SB Pro has an OPL-3 FM chip, but the older version 1 used
the OPL-2. The sound driver assumed the presence of an OPL-3. Version
2.5 and later of the sound driver corrects this problem.

<sect1>Is it possible to read and write samples simultaneously?<p>

Due to hardware limitations, this is not possible with most sound
cards. The only supported card that can do this is the
ProAudioSpectrum16. See the section on "bidirectional mode" in the
<em>Hacker's Guide to Voxware</em> for more information.

(Late breaking news: The 3.0.1 sound driver now supports the
<tt>select()</tt> system call for <tt>/dev/dsp</tt> and
<tt>/dev/audio</tt>. This could be useful for a bidirectional
application. See the file <tt>CHANGELOG</tt>.)

<sect1>My SB16 is set to IRQ 2, but configure does not allow this value.<p>

On '286 and later machines, the IRQ 2 interrupt is cascaded to the
second interrupt controller. It is equivalent to IRQ 9.

<sect1>Are the SoundBlaster AWE32 or SoundBlaster16 ASP supported?<p>

These cards offer special chips (ASP and Emu) that support additional
features such as wavetable synthesis, however Creative Labs is not
willing to release programming information. Unless they change their
policy there can be no support for the special hardware under Linux.
The cards <em>are</em> supported as regular SoundBlaster 16 cards
under Linux.

The Gravis UltraSound card has capabilities similar to the AWE32, and
is supported under Linux.  Cards based on other DSPs such as the
Analog Devices ADSP-21xx may be supported in the future.

<sect1>If I run Linux, then boot DOS, I get errors and/or sound applications do not work properly.<p>

This happens after a soft reboot to DOS.  Sometimes the error message
misleadingly refers to a bad CONFIG.SYS file.

Most of the current sound cards have software programmable IRQ and DMA
settings. If you use different settings between Linux and
MS-DOS/Windows, this may cause problems. Some sound cards don't accept
new parameters without a complete reset (i.e. cycle the power or use
the hardware reset button).

The quick solution to this problem it to perform a full reboot using
the reset button or power cycle rather than a soft reboot
(e.g. Ctrl-Alt-Del).

The correct solution is to ensure that you use the same IRQ and DMA
settings with MS-DOS and Linux (or not to use DOS :-).

<sect1>Problems running DOOM under Linux<p>

Users of the port of ID software's game DOOM for Linux may be
interested in these notes.

For correct sound output you need version 2.90 or later of the sound
driver; it has support for the real-time "DOOM mode".

The sound samples are 16-bit. If you have an 8-bit sound card you can
still get sound to work using one of several programs available in
<url url="ftp://sunsite.unc/edu/pub/Linux/games/doom">.

If performance of DOOM is poor on your system, disabling sound (by
renaming the file <tt>sndserver</tt>) may improve it.

By default DOOM does not support music (as in the DOS version).  The
program <tt>musserver</tt> will add support for music to DOOM under
Linux. It can be found at <url
url="ftp://pandora.st.hmc.edu/pub/linux/musserver.tgz">.

<sect1>How can I reduce noise picked up by my soundcard?<p>

Using good quality shielded cables and trying the sound card in
different slots may help reduce noise. If the sound card has a volume
control, you can try different settings (maximum is probably best).

Using a mixer program you can make sure that undesired inputs
(e.g. microphone) are set to zero gain.

Some sound cards are simply not designed with good shielding and
grounding and are prone to noise pickup.

Finally, on my system I found that the kernel command line option
<tt>no-hlt</tt> reduces the noise level. This tells the kernel not to
use the halt instruction when running the idle process loop. You can
try this manually when booting, or set it up using the command
<tt>append = "no-hlt"</tt> in your LILO configuration file.

<sect1>I can play sounds, but not record.<p>

If you can play sound but not record, try these steps:

<itemize>
<item> use a mixer program to select the appropriate device (e.g. microphone)
<item> use the mixer to set the input gains to maximum
<item>If you can, try to test sound card recording under MS-DOS to
determine if there is a hardware problem
</itemize>

<sect1>My "compatible" sound card only works if I first initialize under MS-DOS.<p>

Some sound card clones are not 100% register compatible with the real
thing; they sometimes contain extra circuitry such as mixers. You
<em>may</em> be able to use these under Linux if you first initialize
under MS-DOS, then soft boot Linux (i.e. Ctrl-Alt-Delete).

One user also reported that he had better results if he used LOADLIN
rather than LILO to boot Linux after initializing his sound card under
MS-DOS (this was with a Diamond sound card).,

They may or may not function reliably. The real solution is to find
out from the manufacturer what the differences are and have the
support added to the sound driver. This has been done, for example,
for the Sound Galaxy NX Pro.

<sect1>My 16-bit SoundBlaster "compatible" sound card only works in 8-bit mode under Linux.<p>

16-bit sound cards described as SoundBlaster compatible are really
only compatible with the 8-bit SoundBlaster Pro. They typically have a
16-bit mode which is not compatible with the SoundBlaster 16 and not
compatible with the Linux sound driver.

If your card is also listed as compatible with the Microsoft Windows
Sound System, you may be able to get it to work in 16-bit mode if you
enable support for the WSS in the Linux sound driver. You will also
probably have to do the DOS initialization trick to get the card to
work.

<sect1>Where can I find sound applications for Linux?<p>

Here are some good archive sites to search for Linux specific sound
applications:

<itemize>
<item> <url url="ftp://sunsite.unc.edu:/pub/Linux/kernel/sound/">
<item> <url url="ftp://sunsite.unc.edu:/pub/Linux/apps/sound/">
<item> <url url="ftp://tsx-11.mit.edu:/pub/linux/packages/sound/">
<item> <url url="ftp://nic.funet.fi:/pub/OS/Linux/util/sound/">
<item> <url url="ftp://nic.funet.fi:/pub/OS/Linux/xtra/snd-kit/">
<item> <url url="ftp://nic.funet.fi:/pub/OS/Linux/ALPHA/sound/">
</itemize>

<sect1>Can the sound driver be compiled as a loadable module?<p>

With recent kernels the sound driver is supported as a kernel
loadable module.

See the files <url url="/usr/src/linux/drivers/sound/Readme.modules"> and <url
url="/usr/src/linux/Documentation/modules.txt"> (or <url
url="/usr/src/linux/README">) for details.

<sect1>Can I use a soundcard to replace the system console "beep"?<p>

Try the <tt>oplbeep</tt> program, found at
<url url="ftp://sunsite.unc.edu/.pub/linux/apps/sound/oplbeep-alpha.tar.gz">

Alternatively, with some sound cards you can connect the PC speaker
output to the soundcard so that all sounds come from the sound card
speakers.

<sect>References<p>

If you have a sound card that supports a CD-ROM or SCSI interface, the
Linux <htmlurl url="http://sunsite.unc.edu/mdw/HOWTO/SCSI-HOWTO.html"
name="SCSI HOWTO"> and the Linux <htmlurl
url="http://sunsite.unc.edu/mdw/HOWTO/CDROM-HOWTO.html" name="CD-ROM
HOWTO"> have additional information that may be useful to you.

Hannu Savolainen has written a draft version of the <em>Hacker's Guide
to VoxWare</em>. The latest version is draft 2, and can be found on
<url url="ftp://nic.funet.fi/pub/OS/Linux/ALPHA/sound/">.

The following FAQs are regularly posted to the usenet newsgroup
<htmlurl url="news:news.announce" name="news.announce"> as well as
being archived at <url
url="ftp://rtfm.mit.edu/pub/usenet/news.answers">:

<itemize>
<item> PCsoundcards/generic-faq (Generic PC Soundcard FAQ)
<item> PCsoundcards/soundcard-faq (comp.sys.ibm.pc.soundcard FAQ)
<item> PCsoundcards/gravis-ultrasound/faq (Gravis UltraSound FAQ)
<item> audio-fmts/part1 (Audio file format descriptions)
<item> audio-fmts/part2 (Audio file format descriptions)
</itemize>

The FAQs also list several product specific mailing lists and archive
sites. The following Usenet news groups discuss sound and/or music
related issues:

<itemize>
<item> <htmlurl url="news:alt.binaries.sounds"
name="alt.binaries.sounds.*"> (various groups for posting sound files)
<item> <htmlurl url="news:alt.binaries.multimedia"
name="alt.binaries.multimedia"> (for posting Multimedia files)
<item> <htmlurl url="news:alt.sb.programmer" name="alt.sb.programmer">
(Soundblaster programming topics)
<item> <htmlurl url="news:comp.multimedia" name="comp.multimedia">
(Multimedia topics)
<item> <htmlurl url="news:comp.music" name="comp.music"> (Computer music
theory and research)
<item> <htmlurl url="news:comp.sys.ibm.pc.soundcard"
name="comp.sys.ibm.pc.soundcard.*"> (various IBM PC soundcard groups)
</itemize>

A Web site dedicated to multimedia can be found at <url
url="http://viswiz.gmd.de/MultimediaInfo/">. Creative Labs has a Web
site at <url url="http://www.creaf.com/">. MediaTrix has a Web site
at <url url="http://www.mediatrix.com/">.

The Linux mailing list has a number of "channels" dedicated to
different topics, including sound. To find out how to join, send a
mail message with the word "help" as the message body to <htmlurl
url="mailto:majordomo@vger.rutgers.edu"
name="majordomo@vger.rutgers.edu">.

As mentioned several times before, the kernel sound driver includes a
number of <tt>Readme</tt> files containing useful information about
the sound card driver. These can typically be found in the directory
<url url="/usr/src/linux/drivers/sound">.

The author of the kernel sound driver, Hannu Savolainen, can be
contacted by email at <htmlurl url="mailto:hannu@voxware.pp.fi"
name="hannu@voxware.pp.fi">. He also has a World-Wide Web site at <url
url="http://personal.eunet.fi/pp/voxware">.

The <em>Linux Software Map</em> (LSM) is an invaluable reference for
locating Linux software. Searching the LSM for keywords such as
<em>sound</em> is a good way to identify applications related to sound
hardware. The LSM can be found on various anonymous FTP sites,
including <url url="ftp://sunsite.unc.edu/pub/Linux/docs/LSM.gz">.

The Linux Documentation Project has produced several books on Linux,
including <em>Linux Installation and Getting Started</em>. These are
freely available by anonymous FTP from major Linux archive sites or
can be purchased in hardcopy format.

</article>
