LDP/LDP/howto/docbook/Sound-HOWTO.sgml

2953 lines
83 KiB
Plaintext

<!DOCTYPE Article PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
<Article>
<ArtHeader>
<Title>The Linux Sound HOWTO</Title>
<Author>
<FirstName>Jeff</FirstName>
<Surname>Tranter</Surname>
<Affiliation>
<Address>
<Email>tranter@pobox.com</Email>
</Address>
</Affiliation>
</Author>
<PubDate>v1.22, 16 July 2001</PubDate>
<revhistory>
<revision>
<revnumber>1.22</revnumber>
<date>2001-07-16</date>
<authorinitials>jjt</authorinitials>
<revremark>
Relicensed under the GFDL.
</revremark>
</revision>
<revision>
<revnumber>1.21</revnumber>
<date>2001-05-11</date>
<authorinitials>jjt</authorinitials>
<revremark>
</revremark>
</revision>
</revhistory>
<Abstract>
<Para>
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 and mailing lists.
</Para>
</Abstract>
</ArtHeader>
<Sect1><Title>Introduction</Title>
<Para>
This is the Linux Sound HOWTO. 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.
</Para>
<Para>
The scope is limited to the aspects of sound cards pertaining to
Linux. See the other documents listed in the <Emphasis>References</Emphasis>
section for more general information on sound cards and computer sound
and music generation.
</Para>
<Sect2><Title>Acknowledgments</Title>
<Para>
Much of this information came from the documentation provided with the
sound driver source code, by Hannu Savolainen
(<ULink URL="mailto:hannu@opensound.com">hannu@opensound.com</ULink>). Thanks
go to Hannu, Alan Cox, and the many other people who developed the
Linux kernel sound drivers and utilities.
</Para>
<Para>
Thanks to the <ULink URL="http://www.docbook.org">DocBook</ULink>
tools, this HOWTO is available in several formats, all generated from
a common source file.
</Para>
</Sect2>
<Sect2><Title>New versions of this document</Title>
<Para>
New versions of this document will be periodically posted to the
<ULink URL="news:comp.os.linux.answers">comp.os.linux.answers</ULink> newsgroup.
Hypertext versions of this and other Linux HOWTOs are available on
many world-wide web sites, including
<ULink URL="http://www.linuxdoc.org/">http://www.linuxdoc.org</ULink>.
Most Linux CD-ROM distributions include the HOWTOs, often under the
<Filename>/usr/doc</Filename> directory, and you can also buy printed copies
from several vendors. Sometimes the HOWTOs available from CD-ROM
vendors, ftp sites, and printed format are out of date. If the date on
this HOWTO is more than six months in the past, then a newer copy is
probably available on the Internet.
</Para>
<Para>
<Emphasis>Please note that, due to the dynamic nature of the Internet, all
web and ftp links listed in this document are subject to change.</Emphasis>
</Para>
<Para>
Translations of this document are available in several languages:
</Para>
<Para>
Chinese:
<ULink URL="http://www.linux.org.tw/CLDP/Sound-HOWTO.html">http://www.linux.org.tw/CLDP/Sound-HOWTO.html</ULink>
</Para>
<Para>
French:
<ULink URL="http://www.freenix.org/unix/linux/HOWTO/">http://www.freenix.org/unix/linux/HOWTO/</ULink>
</Para>
<Para>
Italian:
<ULink URL="http://www.pluto.linux.it/ildp/HOWTO/index.html">http://www.pluto.linux.it/ildp/HOWTO/index.html</ULink>
</Para>
<Para>
Japanese:
<ULink URL="http://yebisu.ics.es.osaka-u.ac.jp/linux/">http://yebisu.ics.es.osaka-u.ac.jp/linux/</ULink>
</Para>
<Para>
Korean:
<ULink URL="http://kldp.org/HOWTO/html/Sound/Sound-HOWTO.html">http://kldp.org/HOWTO/html/Sound/Sound-HOWTO.html</ULink>
</Para>
<Para>
Russian:
<ULink URL="http://www.phtd.tpu.edu.ru/~ott/russian/linux/howto-rus/Sound-HOWTO.html">
http://www.phtd.tpu.edu.ru/~ott/russian/linux/howto-rus/Sound-HOWTO.html</ULink>
</Para>
<Para>
Spanish:
<ULink URL="ftp://ftp.insflug.org/es">ftp://ftp.insflug.org/es</ULink>
</Para>
<Para>
Most translations of this and other Linux HOWTOs can also be found at
<ULink URL="http://www.ibiblio.org/pub/Linux/docs/HOWTO/translations/">
http://www.ibiblio.org/pub/Linux/docs/HOWTO/translations/</ULink>.
If you make a translation of this document into another language, let me
know and I'll include a reference to it here.
</Para>
</Sect2>
<Sect2><Title>Feedback</Title>
<Para>
I rely on you, the reader, to make this HOWTO useful. If you have any
suggestions, corrections, or comments, please send them to me,
<ULink URL="mailto:tranter@pobox.com">tranter@pobox.com</ULink>,
and I will try to incorporate them in the next revision.
</Para>
<Para>
I am also willing to answer general questions on sound cards under
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. Please do not ask me about using sound cards under operating
systems other than Linux.
</Para>
<Para>
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. Also consider making a donation to the Linux Documentation
Project to help support free documentation for Linux. Contact the
LDP at <ULink URL="mailto:feedback@linuxdoc.org">feedback@linuxdoc.org</ULink>
for more information.
</Para>
</Sect2>
<Sect2><Title>Distribution Policy</Title>
<Para>
Copyright (c) 1995-2001 by Jeff Tranter. Permission is granted to copy,
distribute and/or modify this document under the terms of the GNU Free
Documentation License, Version 1.1 or any later version published by
the Free Software Foundation; with no Invariant Sections, with no
Front-Cover Texts, and with no Back-Cover Texts. A copy of the
license is available at
<ULink URL="http://www.gnu.org/copyleft/fdl.html">http://www.gnu.org/copyleft/fdl.html</ULink>
</Para>
</Sect2>
</Sect1>
<Sect1><Title>Sound Card Technology</Title>
<Para>
This section gives a <Emphasis>very</Emphasis> 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.
</Para>
<Para>
Sound is an <Emphasis>analog</Emphasis> property; it can take on any value over a
continuous range. Computers are <Emphasis>digital</Emphasis>; they like to work
with discrete values. Sound cards use a device known as an <Emphasis>Analog
to Digital Converter</Emphasis> (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 <Emphasis>Digital to Analog
Converter</Emphasis> (D/A or DAC) converts numeric values back to an analog
voltage which can in turn drive a loudspeaker, producing sound.
</Para>
<Para>
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. <Emphasis>Sampling
rate</Emphasis> 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.
</Para>
<Para>
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).
</Para>
<Para>
<Emphasis>FM Synthesis</Emphasis> 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 <Emphasis>voices</Emphasis> are usually provided.
</Para>
<Para>
<Emphasis>Wavetable Synthesis</Emphasis> 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.
</Para>
<Para>
Most sound cards provide the capability of <Emphasis>mixing</Emphasis>, combining
signals from different input sources and controlling gain levels.
</Para>
<Para>
<Emphasis>MIDI</Emphasis> 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.
</Para>
<Para>
<Emphasis>MOD files</Emphasis> 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.
</Para>
<Para>
<Emphasis>MP3 files</Emphasis> are a popular format for distributing
computer music and speech. MP3 uses a sophisticated encoding scheme
(MPEG layer 3) to compress audio by roughly a factor of 10 with little
reduction in quality as compared to CD audio.
</Para>
</Sect1>
<Sect1><Title>Supported Hardware</Title>
<Para>
This section lists the sound cards and interfaces that are
currently supported under Linux. The information here is based on the
latest Linux kernel, which at time of writing was version 2.4.4. This
document only applies to the sound drivers included with the standard
Linux kernel source distribution. There are other sound drivers
available for Linux (see the later section entitled Alternate Sound
Drivers).
</Para>
<Para>
For the latest information on supported sound cards and features see
the files included with the Linux kernel source code, usually
installed in the directory
<Filename>/usr/src/linux/Documentation/sound</Filename>.
</Para>
<Sect2><Title>Platform Notes</Title>
<Para>
The information in this HOWTO is valid for Linux on the Intel
x86 platform.
</Para>
<Para>
The sound driver should also work with most sound cards on the
Alpha platform. However, some cards may conflict with I/O
ports of other devices on Alpha systems even though they work
perfectly on i386 machines, so in general it's not possible to tell if
a given card will work or not without actually trying it.
</Para>
<Para>
Users have reported that the sound driver was not yet working on the
PowerPC version of Linux, but it should be supported in
future.
</Para>
<Para>
Sound can be configured into the kernel under the MIPs port
of Linux, and some MIPs machines have EISA slots and/or built in sound
hardware. I'm told the Linux-MIPs group is interested in adding sound
support in the future.
</Para>
<Para>
The Linux kernel includes a separate driver for the Atari
and Amiga versions of Linux that implements a compatible
subset of the sound driver on the Intel platform using the built-in
sound hardware on these machines.
</Para>
<Para>
The SPARC port of Linux currently has sound support for
some models of Sun workstations. I've been told that the on-board
sound hardware works but the external DSP audio box is not supported
because Sun has not released the specifications for it.
</Para>
</Sect2>
<Sect2><Title>Sound Card Types</Title>
<Para>
A number of different types of sound cards exist, reflecting the
different bus architectures available. Here is a brief overview of the
more common types and their distinguishing features.
</Para>
<Para>
<Emphasis>ISA bus</Emphasis> cards are among the oldest sound cards
using the original (non Plug and Play) ISA bus. These typically use
jumpers to select hardware settings for I/O addresses, IRQ, and DMA
channel. You are unlikely to find any of this type manufactured today.
</Para>
<Para>
<Emphasis>ISA Plug and Play</Emphasis> cards use the extended version
of the ISA bus that supports software identification and configuration
of card settings. Few of these, if any, are still being manufactured.
</Para>
<Para>
<Emphasis>PCI bus</Emphasis> cards use the higher bandwidth PCI bus
which provides identification and configuration of cards in
software. The majority of sound cards manufactured today now use
PCI. Most motherboards that provide on-board sound hardware also make
use of the PCI bus.
</Para>
<Para>
<Emphasis>USB</Emphasis> is a newer bus architecture for external
hot-pluggable devices. In theory USB bus sound cards could be
developed, but I am only aware of USB-bus speakers being sold
currently.
</Para>
</Sect2>
<Sect2><Title>Sound Cards</Title>
<Para>
The following sound cards are supported by the Linux kernel
sound driver. Some of the items listed are audio chip sets rather than
models of sound cards. The list is incomplete because there are many
sound cards compatible with these that will work under Linux. To add
further to the confusion, some manufacturers periodically change the
design of their cards causing incompatibilities and continue to sell
them as the same model.
<informaltable frame=all>
<tgroup cols=4>
<tbody>
<row>
<entry>6850 UART MIDI Interface</entry>
<entry>AD1816/AD1816A based cards</entry>
<entry>AD1816/AD1816A sound chip</entry>
<entry>AD1848 sound chip</entry>
</row>
<row>
<entry>ADSP-2115</entry>
<entry>ALS-007 based cards (Avance Logic)</entry>
<entry>ALS-1x0 sound chip</entry>
<entry>ATARI onboard sound</entry>
</row>
<row>
<entry>ATI Stereo F/X</entry>
<entry>Acer FX-3D</entry>
<entry>AdLib</entry>
<entry>Amiga onboard sound</entry>
</row>
<row>
<entry>Audio Excel DSP 16</entry>
<entry>AudioDrive</entry>
<entry>Aztech Sound Galaxy Washington 16</entry>
<entry>Aztech Sound Galaxy WaveRider 3D</entry>
</row>
<row>
<entry>Aztech Sound Galaxy WaveRider Pro32</entry>
<entry>Beethoven ADSP-16</entry>
<entry>CMI8330 sound chip</entry>
<entry>CMI8338/8378 sound chip</entry>
</row>
<row>
<entry>Cardinal DSP16</entry>
<entry>Compaq Deskpro XL onboard sound</entry>
<entry>Corel Netwinder WaveArtist</entry>
<entry>Crystal CS423x</entry>
</row>
<row>
<entry>Crystal CS4280</entry>
<entry>Crystal CS46xx</entry>
<entry>ES1370 sound chip</entry>
<entry>ES1371 sound chip</entry>
</row>
<row>
<entry>ESC614 sound chip</entry>
<entry>ESS Maestro 1/2/2E sound ship</entry>
<entry>ESS Solo1 sound chip</entry>
<entry>ESS1688 sound chip</entry>
</row>
<row>
<entry>ESS1788 sound chip</entry>
<entry>ESS1868 sound chip</entry>
<entry>ESS1869 sound chip</entry>
<entry>ESS1887 sound chip</entry>
</row>
<row>
<entry>ESS1888 sound chip</entry>
<entry>ESS688 sound chip</entry>
<entry>Ensoniq AudioPCI (ES1370)</entry>
<entry>Ensoniq AudioPCI 97 (ES1371)</entry>
</row>
<row>
<entry>Ensoniq/Reveal/Spea SoundScape</entry>
<entry>Gallant SC-6000</entry>
<entry>Gallant SC-6600</entry>
<entry>Gravis Ultrasound</entry>
</row>
<row>
<entry>Gravis Ultrasound ACE</entry>
<entry>Gravis Ultrasound Max</entry>
<entry>Gravis Ultrasound with 16 bit option</entry>
<entry>HP Kayak</entry>
</row>
<row>
<entry>Highscreen Sound-Booster32 Wave3D</entry>
<entry>IBM MWAVE</entry>
<entry>Jazz 16</entry>
<entry>Logitech Sound Man 16</entry>
</row>
<row>
<entry>Logitech SoundMan Games</entry>
<entry>Logitech SoundMan Wave</entry>
<entry>MAD16 Pro (OpTi 82C9xx chipsets)</entry>
<entry>Media Vision Jazz16</entry>
</row>
<row>
<entry>MediaTriX AudioTriX Pro</entry>
<entry>Microsoft Windows Sound System</entry>
<entry>MiroSOUND PCM12</entry>
<entry>Mozart (OAK OTI-601)</entry>
</row>
<row>
<entry>NeoMagic 256AV/256ZX</entry>
<entry>OpTi 82C931</entry>
<entry>Orchid SW32</entry>
<entry>Personal Sound System (PSS)</entry>
</row>
<row>
<entry>Pinnacle MultiSound</entry>
<entry>Power Mac onboard sound</entry>
<entry>Pro Audio Spectrum 16</entry>
<entry>Pro Audio Studio 16</entry>
</row>
<row>
<entry>Pro Sonic 16</entry>
<entry>Q40 onboard sound</entry>
<entry>Roland MPU-401 MIDI interface</entry>
<entry>S3 SonicVibes</entry>
</row>
<row>
<entry>SGI Visual Workstation</entry>
<entry>SM Games</entry>
<entry>SY-1816</entry>
<entry>SoundBlaster 1.0 </entry>
</row>
<row>
<entry>SoundBlaster 16</entry>
<entry>SoundBlaster 16ASP</entry>
<entry>SoundBlaster 2.0</entry>
<entry>SoundBlaster 32</entry>
</row>
<row>
<entry>SoundBlaster 64</entry>
<entry>SoundBlaster AWE32</entry>
<entry>SoundBlaster AWE64</entry>
<entry>SoundBlaster Live!</entry>
</row>
<row>
<entry>SoundBlaster PCI 128</entry>
<entry>SoundBlaster PCI 512</entry>
<entry>SoundBlaster Pro</entry>
<entry>SoundBlaster Vibra16</entry>
</row>
<row>
<entry>SoundBlaster Vibra16X</entry>
<entry>TI TM4000M notebook</entry>
<entry>Terratec Base 1</entry>
<entry>Terratec Base 64</entry>
</row>
<row>
<entry>ThunderBoard</entry>
<entry>Trident 4DWave DX/NX</entry>
<entry>Trident Ali 5451</entry>
<entry>Trident SiS 7018</entry>
</row>
<row>
<entry>Turtle Beach Maui</entry>
<entry>Turtle Beach MultiSound Classic</entry>
<entry>Turtle Beach MultiSound Fiji</entry>
<entry>Turtle Beach MultiSound Hurricane</entry>
</row>
<row>
<entry>Turtle Beach MultiSound Monterey</entry>
<entry>Turtle Beach MultiSound Pinnacle</entry>
<entry>Turtle Beach MultiSound Tahiti</entry>
<entry>Turtle Beach WaveFront Maui</entry>
</row>
<row>
<entry>Turtle Beach WaveFront Tropez</entry>
<entry>Turtle Beach WaveFront Tropez+</entry>
<entry>VIA 82Cxxx chip set</entry>
<entry>VIDC 16-bit sound</entry>
</row>
<row>
<entry>Yamaha OPL2 sound chip</entry>
<entry>Yamaha OPL3 sound chip</entry>
<entry>Yamaha OPL3-SA1 sound chip</entry>
<entry>Yamaha OPL3-SA2 sound chip</entry>
</row>
<row>
<entry>Yamaha OPL3-SA3 sound chip</entry>
<entry>Yamaha OPL3-SAx sound chip</entry>
<entry>Yamaha OPL4 sound chip</entry>
<entry>Yamaha YM3812 sound chip</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</Para>
<Para>
A word about compatibility: even though most sound cards are claimed
to be <Emphasis>SoundBlaster compatible</Emphasis>, very few currently sold cards are
compatible enough to work with the Linux SoundBlaster driver. These
cards usually work better using the MSS/WSS or MAD16 driver. Only real
SoundBlaster cards made by Creative Labs, which use Creative's custom
chips (e.g. SoundBlaster16 Vibra), MV Jazz16 and ESS688/1688 based
cards generally work with the SoundBlaster driver. Trying to use a
SoundBlaster Pro compatible 16 bit sound card with the SoundBlaster
driver is usually just a waste of time.
</Para>
<Para>
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
<ULink URL="ftp://www.ibiblio.org/pub/Linux/docs/HOWTO/unmaintained/SCSI-HOWTO">SCSI HOWTO</ULink>
and
<ULink URL="http://www.ibiblio.org/LDP/HOWTO/CDROM-HOWTO.html">CDROM HOWTO</ULink>
documents for more information.
</Para>
<Para>
A kernel driver to support joystick ports, including those
provided on some sound cards, is included as part of the 2.2 and
later kernels.
</Para>
<Para>
Note that the kernel SCSI, CD-ROM, joystick, and sound drivers are
completely independent of each other.
</Para>
</Sect2>
<Sect2><Title>Alternate Sound Drivers</Title>
<Sect3><Title>OSS/4Front</Title>
<Para>
Sound support in the Linux kernel was originally written by Hannu
Savolainen. Hannu then went on to develop the Open Sound system, a
commercial set of sound drivers sold by 4Front Technologies that is
supported on a number of Unix systems. Red Hat Software sponsored Alan
Cox to enhance the kernel sound drivers to make them fully
modular. Various other people also contributed bug fixes and developed
additional drivers for new sound cards. These modified drivers were
shipped by Red Hat in their 5.0 through 5.2 releases. These changes
have now been integrated into the standard kernel as of version
2.0. Alan Cox is now the maintainer of the standard kernel sound
drivers, although Hannu still periodically contributes code taken from
the commercial driver.
</Para>
<Para>
The commercial Open Sound System driver from 4Front Technologies tends
to be easier to configure and support more sound cards, particularly
the newer models. It is also compatible with applications written for
the standard kernel sound drivers. The disadvantage is that you need
to pay for it, and you do not get source code. You can download a free
evaluation copy of the product before deciding whether to purchase it.
For more information see the 4Front Technologies web page at
<ULink URL="http://www.opensound.com">http://www.opensound.com</ULink>.
</Para>
</Sect3>
<Sect3><Title>ALSA</Title>
<Para>
Jaroslav Kysela and others started writing an alternate sound driver
for the Gravis UltraSound Card. The project was renamed <Emphasis>Advanced
Linux Sound Architecture</Emphasis> (ALSA) and has resulted in what they
believe is a more generally usable sound driver that can be used as a
replacement for the built-in kernel drivers. The ALSA drivers support
a number of popular sound cards, are full duplex, fully modularized,
and compatible with the sound architecture in the kernel. The main web
site of the ALSA project is
<ULink URL="http://www.alsa-project.org">http://www.alsa-project.org</ULink>.
A separate "Alsa-sound-mini-HOWTO" is available which deals with
compiling and installing these drivers. The ALSA drivers may move into
the standard Linux kernel as part of the 2.5 kernel development.
</Para>
</Sect3>
<Sect3><Title>Turtle Beach</Title>
<Para>
Markus Mummert
(<ULink URL="mailto:mum@mmk.e-technik.tu-muenchen.de">mum@mmk.e-technik.tu-muenchen.de</ULink>)
has written a driver package for the Turtle Beach MultiSound (classic), Tahiti, and Monterey sound
cards. The documentation states:
</Para>
<Para>
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.
</Para>
<Para>
It can be found at
<ULink URL="http://www.cs.colorado.edu/~mccreary/tbeach">http://www.cs.colorado.edu/~mccreary/tbeach</ULink>.
</Para>
</Sect3>
<Sect3><Title>Roland MPU-401</Title>
<Para>
Kim Burgaard (<ULink URL="mailto:burgaard@daimi.aau.dk">burgaard@daimi.aau.dk</ULink>)
has written a device driver and
utilities for the Roland MPU-401 MIDI interface. The Linux
software map entry gives this description:
</Para>
<Para>
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 player and
recorder.
</Para>
<Para>
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.
</Para>
<Para>
It can be found at
<ULink URL="ftp://www.ibiblio.org/pub/Linux/kernel/sound/mpu401-0.2.tar.gz">
ftp://www.ibiblio.org/pub/Linux/kernel/sound/mpu401-0.2.tar.gz</ULink>.
</Para>
</Sect3>
<Sect3><Title>SoundBlaster Live!</Title>
<Para>
Creative Labs has Linux drivers for several cards, including the SoundBlaster Live!, at
<ULink URL="http://opensource.creative.com">http://opensource.creative.com</ULink>.
</Para>
</Sect3>
<Sect3><Title>Packet Radio</Title>
<Para>
Another novel use for a sound card under Linux is as a modem for
amateur packet radio. The 2.1 and later kernels include a
driver that works with SoundBlaster and Windows Sound System
compatible sound cards to implement 1200 bps AFSK and 9600 bps FSK
packet protocols. See the Linux AX25 HOWTO for details (I'm a ham
myself, by the way -- callsign VE3ICH).
</Para>
</Sect3>
<Sect3><Title>PC Speaker</Title>
<Para>
An alternate sound driver is available that requires no additional
sound hardware; it uses the internal PC speaker. It is
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.
</Para>
<Para>
The latest version of the PC speaker driver can be found at
<ULink URL="ftp://ftp.infradead.org/pub/pcsp/">ftp://ftp.infradead.org/pub/pcsp/</ULink>.
</Para>
</Sect3>
<Sect3><Title>Parallel Port</Title>
<Para>
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.
</Para>
</Sect3>
</Sect2>
</Sect1>
<Sect1><Title>Installation</Title>
<Para>
Configuring Linux to support sound involves the following steps:
</Para>
<Para>
<OrderedList>
<ListItem>
<Para>
Installing the sound card.
</Para>
</ListItem>
<ListItem>
<Para>
Configuring Plug and Play (if applicable).
</Para>
</ListItem>
<ListItem>
<Para>
Configuring and building the kernel for sound support.
</Para>
</ListItem>
<ListItem>
<Para>
Creating the device files.
</Para>
</ListItem>
<ListItem>
<Para>
Booting the Linux kernel and testing the installation.
</Para>
</ListItem>
</OrderedList>
</Para>
<Para>
Some Linux distributions provide a sound driver configuration utility
that will detect your sound card and set up all of the necessary
configuration files to load the appropriate sound drivers for your
card. Red Hat Linux, for example, provides the <Literal
remap="tt">sndconfig</Literal> utility. If your distribution provides
such a tool I suggest you try using it. If it works for you then you
can skip the rest of the instructions in this section.
</Para>
<Para>
If this fails or you want to follow the manual method in order to
better understand what you are doing, then the next sections will
cover each of these steps in detail.
</Para>
<Sect2><Title>Installing the Sound Card</Title>
<Para>
Follow the manufacturer's instructions for installing the hardware or
have your dealer perform the installation.
</Para>
<Para>
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.
</Para>
<Para>
Usually you should use the same I/O port, IRQ, and DMA settings that
work under DOS. In some cases though (particularly with PnP cards) you
may need to use different settings to get things to work under Linux.
Some experimentation may be needed.
</Para>
</Sect2>
<Sect2><Title>Configuring ISA Plug and Play</Title>
<Para>
Some sound cards use the ISA Plug and Play protocol to configure
settings for i/o addresses, interrupts, and DMA channels. If you have
a newer PCI-bus type of sound card, or one of the very old ISA sound
cards that uses fixed settings or jumpers, then you can skip this
section.
</Para>
<Para>
The preferred way to configure Plug and Play cards is to use the
isapnp tools which ship with most Linux distributions (or you can
download them from Red Hat's web site <ULink
URL="http://www.redhat.com/">http://www.redhat.com/</ULink>).
</Para>
<Para>
First check the documentation for your Linux distribution. It may
already have Plug and Play support set up for you or it may work
slightly differently than described here. If you need to configure it
yourself,the details can be found in the man pages for the isapnp
tools. Briefly the process you would normally follow is:
</Para>
<Para>
<ItemizedList>
<ListItem>
<Para>
Use <Literal remap="tt">pnpdump</Literal> to capture the possible settings for all
your Plug and Play devices, saving the result to the file
<Filename>/etc/isapnp.conf</Filename>.
</Para>
</ListItem>
<ListItem>
<Para>
Choose settings for the sound card that do not conflict with
any other devices in your system and uncomment the appropriate lines
in <Filename>/etc/isapnp.conf</Filename>. Don't forget to uncomment the
<Literal remap="tt">(ACT Y)</Literal> command near the end.
</Para>
</ListItem>
<ListItem>
<Para>
Make sure that <Literal remap="tt">isapnp</Literal> is run when your system boots
up, normally done by one of the startup scripts. Reboot your system or
run <Literal remap="tt">isapnp</Literal> manually.
</Para>
</ListItem>
</ItemizedList>
</Para>
<Para>
If for some reason you cannot or do not wish to use the isapnp tools,
there are a couple of other options. If you use the card under
Microsoft Windows 95 or 98, you can use the device manager to set up
the card, then soft boot into Linux using the LOADLIN program. Make
sure Windows and Linux use the same card setup parameters.
</Para>
<Para>
If you use the card under DOS, you can use the <Literal
remap="tt">icu</Literal> utility that comes with SoundBlaster16 PnP
cards to configure it under DOS, then soft boot into Linux using the
LOADLIN program. Again, make sure DOS and Linux use the same card
setup parameters.
</Para>
<Para>
True ISA PnP support is implemented in the 2.4 and later kernels.
Some of the sound card drivers now support automatically detecting and
configuring the cards without the isapnp tools. Check the
documentation for the card's driver for details.
</Para>
</Sect2>
<Sect2><Title>Configuring the Kernel</Title>
<Para>
You need the appropriate device drivers for your sound card to be
present in the kernel. The kernel running on your system may already
include the drivers for your sound card. In most cases the drivers
would have been built as kernel loadable modules. You can check which
drivers are available as modules by looking in the
<Filename>/lib/modules</Filename> directories. For the 2.4.4 kernel,
the sound drivers would normally appear in
<Filename>/lib/modules/2.4.4/kernel/drivers/sound/</Filename>. If you
see the driver(s) for your sound card, you can try using the module
directory and skip recompiling the kernel.
</Para>
<Para>
If the sound drivers are not already built, you will need to configure
and build a new kernel. You can either build the sound drivers into
the kernel or build them as kernel loadable modules. In most cases
building as modules is preferred, as it allows you to easily
experiment with loading different drivers if unsure which one to use
and the drivers can be unloaded when not needed, freeing up memory.
Building the drivers into the kernel itself may be desirable if you
are unfamiliar with kernel modules and want a simpler solution.
</Para>
<Para>
The <ULink URL="http://www.ibiblio.org/LDP/HOWTO/Kernel-HOWTO.html">Linux Kernel HOWTO</ULink>
should be consulted for the details of building a kernel. I will just
mention here some issues that are specific to sound cards.
</Para>
<Para>
If you have never configured the kernel for sound support before it is
a good idea to read the relevant documentation included with the
kernel sound drivers, particularly information specific to your card
type. The files can be found in the kernel documentation directory,
usually installed in <Filename>/usr/src/linux/Documentation/sound</Filename>.
If this directory is missing you likely either have a very old kernel
version or you have not installed the kernel source code.
</Para>
<Para>
Follow the usual procedure for building the kernel. There are
currently three interfaces to the configuration process. A graphical
user interface that runs under X11 can be invoked using <Literal remap="tt">make
xconfig</Literal>. A menu-based system that only requires text displays is
available as <Literal remap="tt">make menuconfig</Literal>. The original method, using
<Literal remap="tt">make config</Literal>, offers a simple text-based interface.
</Para>
<Para>
When configuring the kernel there will be many choices for selecting
the type of sound card you have and the driver options to use.
The on-line help within the configuration tool should provide
an explanation of what each option is for. Select the appropriate
options to the best of your knowledge.
</Para>
<Para>
After configuring the options you should compile and install the new
kernel as per the Kernel HOWTO.
</Para>
</Sect2>
<Sect2><Title>Creating the Device Files</Title>
<Para>
For proper operation, device file entries must be created for the
sound devices. These are normally created for you during installation
of your Linux system. A quick check can be made using the command
listed below. If the output is as shown (the date stamp will vary)
then the device files are almost certainly okay.
<Screen>
% ls -l /dev/dsp
crw-rw-rw- 1 root root 14, 3 Apr 25 1995 /dev/dsp
</Screen>
</Para>
<Para>
Note that having the right device files there doesn't guarantee
anything on its own. The kernel driver must also be loaded or compiled
in before the devices will work (more on that later).
</Para>
<Para>
In rare cases, if you believe the device files are wrong, you can
recreate them. Most Linux distributions have a <Literal remap="tt">/dev/MAKEDEV</Literal>
script which can be used for this purpose.
</Para>
<Para>
Note that if you are using the devfs filesystem support in the 2.4
kernels, the sound device files are actually found in /dev/sound, but
there will be symbolic links to the older devices, such as /dev/dsp.
</Para>
</Sect2>
<Sect2><Title>Booting Linux and Testing the Installation</Title>
<Para>
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).
</Para>
<Para>
If you are using loadable kernel modules for sound, you will need to
load them using the <Literal remap="tt">modprobe command</Literal> for
the appropriate drivers, e.g. run the command
<Literal remap="tt">modprobe sb</Literal> for a SoundBlaster card.
</Para>
<Para>
After booting, or loading the kernel modules, check for a message such
as the following using the <Literal remap="tt">dmesg</Literal> command:
<Screen>
Soundblaster audio driver Copyright (C) by Hannu Savolainen 1993-1996
sb: Creative SB AWE64 PnP detected
sb: ISAPnP reports 'Creative SB AWE64 PnP' at i/o 0x220, irq 5, dma 1, 5
SB 4.16 detected OK (220)
sb: 1 Soundblaster PnP card(s) found.
Crystal 4280/46xx + AC97 Audio, version 1.22.32, 10:28:40 Apr 28 2001
cs46xx: Card found at 0xf4100000 and 0xf4000000, IRQ 11
cs46xx: Thinkpad 600X/A20/T20 (1014:0153) at 0xf4100000/0xf4000000, IRQ 11
ac97_codec: AC97 Audio codec, id: 0x4352:0x5914 (Cirrus Logic CS4297A rev B)
</Screen>
</Para>
<Para>
The message should indicate that a sound card was found and match your
sound card type and jumper settings (if any). The driver may also
display some error messages and warnings if you have incorrectly
configured the driver or chosen the wrong one.
</Para>
<Para>
Previous versions of this HOWTO suggested checking the output of
/dev/sndstat. This is no longer supported in the 2.4 and later
kernels.
</Para>
<Para>
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.
<Screen>
% cat endoftheworld &#62;/dev/dsp
% cat crash.au &#62;/dev/audio
</Screen>
</Para>
<Para>
(Make sure you don't omit the "&gt;" in the commands above).
</Para>
<Para>
Note that, in general, using <Literal remap="tt">cat</Literal> is not the proper way to
play audio files, it's just a quick check. You'll want to get a proper
sound player program (described later) that will do a better job.
</Para>
<Para>
If the above commands return "I/O error", you should look at the
end of the kernel messages listed using the "dmesg" command. It's
likely that an error message is printed there. Very often the message
is "Sound: DMA (output) timed out - IRQ/DRQ config error?". The above
message means that the driver didn't get the expected interrupt from
the sound card. In most cases it means that the IRQ or the DMA channel
configured to the driver doesn't work. The best way to get it working
is to try with all possible DMAs and IRQs supported by the device.
</Para>
<Para>
Another possible reason is that the device is not compatible with the
device the driver is configured for. This is almost certainly the case
when a supposedly "SoundBlaster (Pro/16) compatible" sound card
doesn't work with the SoundBlaster driver. In this case you should try
to find out the device your sound card is compatible with (by posting
to the comp.os.linux.hardware newsgroup, for example).
</Para>
<Para>
Some sample sound files can be obtained from
<ULink URL="ftp://tsx-11.mit.edu/pub/linux/packages/sound/snd-data-0.1.tar.Z">
ftp://tsx-11.mit.edu/pub/linux/packages/sound/snd-data-0.1.tar.Z></ULink>
</Para>
<Para>
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:
<Screen>
# record 4 seconds of audio from microphone
% dd bs=8k count=4 &#60;/dev/audio &#62;sample.au
4+0 records in
4+0 records out
# play back sound
% cat sample.au &#62;/dev/audio
</Screen>
</Para>
<Para>
Obviously for this to work you need a microphone connected to the
sound card and you should speak into it. You may also need to obtain a
mixer program to set the microphone as the input device and adjust the
recording gain level.
</Para>
<Para>
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.
</Para>
</Sect2>
<Sect2><Title>Troubleshooting</Title>
<Para>
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.
</Para>
<Sect3><Title>Step 1: Make sure you are really running the kernel you compiled.</Title>
<Para>
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
<Literal remap="tt">uname</Literal> command:
<Screen>
% uname -a
Linux fizzbin 2.2.4 #1 Tue Mar 23 11:23:21 EST 1999 i586 unknown
</Screen>
</Para>
<Para>
or by displaying the file <Filename>/proc/version</Filename>:
<Screen>
% cat /proc/version
Linux version 2.2.4 (root@fizzbin) (gcc version 2.7.2.3) #1 Tue Mar 23 11:23:21 EST 1999
</Screen>
</Para>
<Para>
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
<Filename>lilo</Filename>)? If booting from floppy, did you create a
new boot floppy and use it when booting?
</Para>
<Para>
If you are using kernel loadable modules, use the lsmod command to
make sure the modules are loaded:
<Screen>
% /sbin/lsmod
Module Size Used by
sb 6320 0 (unused)
sb_lib 35040 0 [sb]
uart401 6544 0 [sb_lib]
sound 59888 0 [sb_lib uart401]
soundcore 4144 5 [sb_lib sound]
isa-pnp 28304 0 [sb]
...
</Screen>
</Para>
</Sect3>
<Sect3><Title>Step 2: Make sure the kernel sound drivers are compiled in.</Title>
<Para>
The easiest way to do this is to check the output of
<Literal remap="tt">dev/sndstat</Literal> as described earlier. If the output is not as
expected then something went wrong with the kernel configuration or
build. Start the installation process again, beginning with
configuration and building of the kernel.
</Para>
</Sect3>
<Sect3><Title>Step 3: Did the kernel detect your sound card during booting?</Title>
<Para>
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 <Literal remap="tt">dmesg</Literal> command:
<Screen>
% dmesg
</Screen>
</Para>
<Para>
or
<Screen>
% tail /var/log/messages
</Screen>
</Para>
<Para>
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.
</Para>
<Para>
One possibility is that your sound card is one of the
<Emphasis>compatible</Emphasis> type that requires initialization by the DOS
driver. Try booting DOS and loading the vendor supplied sound card
driver. Then soft boot Linux using <Literal remap="tt">Control-Alt-Delete</Literal>. Make
sure that card I/O address, DMA, and IRQ settings for Linux are the
same as used under DOS. Read the <Filename>Readme.cards</Filename> file from
the sound driver source distribution for hints on configuring your
card type.
</Para>
<Para>
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.
</Para>
</Sect3>
<Sect3><Title>Step 4: Can you read data from the dsp device?</Title>
<Para>
Try reading from the <Filename>/dev/audio</Filename> device using the <Literal remap="tt">dd</Literal>
command listed earlier in this document. The command should run
without errors.
</Para>
<Para>
If it doesn't work, then chances are that the problem is an IRQ or DMA
conflict or some kind of hardware incompatibility (the device is not
supported by Linux or the driver is configured for a wrong device).
</Para>
<Para>
A remote possibility is broken hardware. Try testing the sound card
under DOS, if possible, to eliminate that as a possibility.
</Para>
</Sect3>
<Sect3><Title>When All Else Fails</Title>
<Para>
If you still have problems, here are some final suggestions for things
to try:
</Para>
<Para>
<ItemizedList>
<ListItem>
<Para>
carefully re-read this HOWTO document
</Para>
</ListItem>
<ListItem>
<Para>
read the references listed at the end of this document
and the relevant kernel source documentation files
</Para>
</ListItem>
<ListItem>
<Para>
post a question to one of the <Literal remap="tt">comp.os.linux</Literal> or other
Usenet newsgroups (comp.os.linux.hardware is a good choice; because of
the high level of traffic in these groups it helps to put the string
"sound" in the subject header for the article so the right experts
will see it)
</Para>
</ListItem>
<ListItem>
<Para>
Using a web/Usenet search engine with an intelligently selected
search criteria can give very good results quickly. One such choice is
<ULink URL="http://www.google.com">http://www.google.com</ULink>
</Para>
</ListItem>
<ListItem>
<Para>
try using the latest Linux kernel (but only as a last resort,
the latest development kernels can be unstable)
</Para>
</ListItem>
<ListItem>
<Para>
send mail to the author of the sound driver
</Para>
</ListItem>
<ListItem>
<Para>
send mail to the author of the Sound HOWTO
</Para>
</ListItem>
<ListItem>
<Para>
fire up emacs and type <Literal remap="tt">Esc-x doctor</Literal> :-)
</Para>
</ListItem>
</ItemizedList>
</Para>
</Sect3>
</Sect2>
</Sect1>
<Sect1><Title>Applications Supporting Sound</Title>
<Para>
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.
</Para>
<Para>
If you are running a graphical desktop such as
<ULink URL="http://www.kde.org">KDE</ULink> or
<ULink URL="http://www.gnome.org">GNOME</ULink> then it should already include
a number of multimedia applications that are integrated with your desktop.
</Para>
<Para>
As a minimum, you will likely want to obtain the following sound
applications:
<ItemizedList>
<ListItem>
<Para>
audio file format conversion utility (e.g. <Literal remap="tt">sox</Literal>)
</Para>
</ListItem>
<ListItem>
<Para>
mixer utility (e.g. <Literal remap="tt">aumix</Literal> or <Literal remap="tt">xmix</Literal>)
</Para>
</ListItem>
<ListItem>
<Para>
digitized file player/recorder (e.g. <Literal remap="tt">play</Literal> or <Literal remap="tt">wavplay</Literal>)
</Para>
</ListItem>
<ListItem>
<Para>
MOD file player (e.g. <Literal remap="tt">tracker</Literal>)
</Para>
</ListItem>
<ListItem>
<Para>
MIDI file player (e.g. <Literal remap="tt">playmidi</Literal>)
</Para>
</ListItem>
</ItemizedList>
</Para>
<Para>
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.
</Para>
</Sect1>
<Sect1><Title>Answers To Frequently Asked Questions</Title>
<Para>
This section answers some of the questions that have been commonly
asked on the Usenet news groups and mailing lists.
</Para>
<Para>
Answers to more questions can also be found at the OSS sound
driver web page.
</Para>
<Sect2><Title>What are the various sound device files?</Title>
<Para>
These are the most standard device file names, some Linux
distributions may use slightly different names.
</Para>
<Para>
<VariableList>
<VarListEntry>
<Term>/dev/audio</Term>
<ListItem>
<Para>
normally a link to <Filename>/dev/audio0</Filename>
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>/dev/audio0</Term>
<ListItem>
<Para>
Sun workstation compatible audio device (only
a partial implementation, does not support Sun ioctl interface, just
u-law encoding)
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>/dev/audio1</Term>
<ListItem>
<Para>
second audio device (if supported by sound card
or if more than one sound card installed)
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>/dev/dsp</Term>
<ListItem>
<Para>
normally a link to <Filename>/dev/dsp0</Filename>
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>/dev/dsp0</Term>
<ListItem>
<Para>
first digital sampling device
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>/dev/dsp1</Term>
<ListItem>
<Para>
second digital sampling device
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>/dev/mixer</Term>
<ListItem>
<Para>
normally a link to <Filename>/dev/mixer0</Filename>
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>/dev/mixer0</Term>
<ListItem>
<Para>
first sound mixer
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>/dev/mixer1</Term>
<ListItem>
<Para>
second sound mixer
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>/dev/music</Term>
<ListItem>
<Para>
high-level sequencer interface
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>/dev/sequencer</Term>
<ListItem>
<Para>
low level MIDI, FM, and GUS access
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>/dev/sequencer2</Term>
<ListItem>
<Para>
normally a link to <Filename>/dev/music</Filename>
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>/dev/midi00</Term>
<ListItem>
<Para>
1st raw MIDI port
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>/dev/midi01</Term>
<ListItem>
<Para>
2nd raw MIDI port
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>/dev/midi02</Term>
<ListItem>
<Para>
3rd raw MIDI port
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>/dev/midi03</Term>
<ListItem>
<Para>
4th raw MIDI port
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>/dev/sndstat</Term>
<ListItem>
<Para>
displays sound driver status when read (also available as /proc/sound, removed in 2.4 kernels)
</Para>
</ListItem>
</VarListEntry>
</VariableList>
</Para>
<Para>
The PC speaker driver provides the following devices:
</Para>
<Para>
<VariableList>
<VarListEntry>
<Term>/dev/pcaudio</Term>
<ListItem>
<Para>
equivalent to /dev/audio
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>/dev/pcsp</Term>
<ListItem>
<Para>
equivalent to /dev/dsp
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term>/dev/pcmixer</Term>
<ListItem>
<Para>
equivalent to /dev/mixer
</Para>
</ListItem>
</VarListEntry>
</VariableList>
</Para>
</Sect2>
<Sect2><Title>How can I play a sound sample?</Title>
<Para>
Sun workstation (.au) sound files can be played by sending them to the
<Filename>/dev/audio</Filename> device. Raw samples can be sent to
<Filename>/dev/dsp</Filename>. This will generally give poor results though, and
using a program such as <Literal remap="tt">play</Literal> is preferable, as it will
recognize most file types and set the sound card to the correct
sampling rate, etc.
</Para>
<Para>
If you are running a graphical desktop such as <ULink
URL="http://www.kde.org">KDE</ULink> or <ULink
URL="http://www.gnome.org">GNOME</ULink> then it should already
include a graphical sound file player program.
</Para>
<Para>
Programs like wavplay or vplay (in the snd-util package) will give
best results with WAV files. However they don't recognize
Microsoft ADPCM compressed WAV files. Also older versions
of play (from the Lsox package) doesn't work well with 16 bit WAV
files.
</Para>
<Para>
The splay command included in the snd-util package can be used to play
most sound files if proper parameters are entered manually in the
command line.
</Para>
</Sect2>
<Sect2><Title>How can I record a sample?</Title>
<Para>
Reading <Filename>/dev/audio</Filename> or <Filename>/dev/dsp</Filename> will return sampled
data that can be redirected to a file. A program such as <Literal remap="tt">vrec</Literal>
makes it easier to control the sampling rate, duration, etc. You may
also need a mixer program to select the appropriate input device.
</Para>
</Sect2>
<Sect2><Title>Can I have more than one sound card?</Title>
<Para>
With the current sound driver it's possible to have several
SoundBlaster, SoundBlaster/Pro, SoundBlaster16, MPU-401 or MSS cards
at the same time on the system. Installing two SoundBlasters is
possible but requires defining the macros SB2&lowbar;BASE, SB2&lowbar;IRQ, SB2&lowbar;DMA
and (in some cases) SB2&lowbar;DMA2 by editing <Filename>local.h</Filename>
manually. It's also possible to have a SoundBlaster at the same time
as a PAS16.
</Para>
<Para>
With the 2.0 and newer kernels that configure sound using make config,
instead of <Filename>local.h</Filename>, you need to edit the file
<Filename>/usr/include/linux/autoconf.h</Filename>. After the section
containing the lines:
<Screen>
#define SBC_BASE 0x220
#define SBC_IRQ (5)
#define SBC_DMA (1)
#define SB_DMA2 (5)
#define SB_MPU_BASE 0x0
#define SB_MPU_IRQ (-1)
</Screen>
</Para>
<Para>
add these lines (with values appropriate for your system):
<Screen>
#define SB2_BASE 0x330
#define SB2_IRQ (7)
#define SB2_DMA (2)
#define SB2_DMA2 (2)
</Screen>
</Para>
<Para>
The following drivers don't permit multiple instances:
</Para>
<Para>
<ItemizedList>
<ListItem>
<Para>
GUS (driver limitation)
</Para>
</ListItem>
<ListItem>
<Para>
MAD16 (hardware limitation)
</Para>
</ListItem>
<ListItem>
<Para>
AudioTrix Pro (hardware limitation)
</Para>
</ListItem>
<ListItem>
<Para>
CS4232 (hardware limitation)
</Para>
</ListItem>
</ItemizedList>
</Para>
</Sect2>
<Sect2><Title>Error: No such file or directory for sound devices</Title>
<Para>
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).
</Para>
</Sect2>
<Sect2><Title>Error: No such device for sound devices</Title>
<Para>
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.
</Para>
</Sect2>
<Sect2><Title>Error: No space left on device for sound devices</Title>
<Para>
This can happen if you tried to record data to <Filename>/dev/audio</Filename> or
<Filename>/dev/dsp</Filename> 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 <Emphasis>Creating
the Device Files</Emphasis> section of this document.
</Para>
<Para>
This may also happen with Linux 2.0 and later if there is not enough
free RAM on the system when the device is opened. The audio driver
requires at least two pages (8k) of contiguous physical RAM for each
DMA channel. This happens sometimes in machines with less than 16M of
RAM or which have been running for very long time. You can preallocate
the DMA buffers when the driver is loaded using the kernel option
"dma_buf=1".
</Para>
</Sect2>
<Sect2><Title>Error: Device busy for sound devices</Title>
<Para>
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 <Literal remap="tt">fuser</Literal> command:
<Screen>
% fuser -v /dev/dsp
/dev/dsp: USER PID ACCESS COMMAND
tranter 265 f.... tracker
</Screen>
</Para>
<Para>
In the above example, the <Literal remap="tt">fuser</Literal> 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. You
should run the <Literal remap="tt">fuser</Literal> command as root in order to report usage
by users other than yourself.
</Para>
<Para>
On some systems you may need to be root when running the
<Literal remap="tt">fuser</Literal> command in order to see the processes of other users.
</Para>
<Para>
Under the KDE desktop, the artsd sound server usually take control of the sound device. Applications
should make requests to play sound through the sound server, or the sound server should be
paused. A similar situation exists under GNOME with the esd sound
server.
</Para>
</Sect2>
<Sect2><Title>I still get device busy errors!</Title>
<Para>
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.
</Para>
</Sect2>
<Sect2><Title>Partial playback of digitized sound file</Title>
<Para>
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.
</Para>
<Para>
Another symptom is sound samples that <Emphasis>loop</Emphasis>. This is usually
caused by an IRQ conflict.
</Para>
</Sect2>
<Sect2><Title>There are pauses when playing MOD files</Title>
<Para>
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:
</Para>
<Para>
<ItemizedList>
<ListItem>
<Para>
try playing with a lower sampling rate or in mono mode
</Para>
</ListItem>
<ListItem>
<Para>
eliminate other processes
</Para>
</ListItem>
<ListItem>
<Para>
buy a faster computer
</Para>
</ListItem>
<ListItem>
<Para>
buy a more powerful sound card (e.g. Gravis UltraSound)
</Para>
</ListItem>
</ItemizedList>
</Para>
<Para>
If you have a Gravis UltraSound card, you should use one of the mod
file players written specifically for the GUS (e.g. <Literal remap="tt">gmod</Literal>).
</Para>
</Sect2>
<Sect2><Title>Compile errors when compiling sound applications</Title>
<Para>
The version 1.0c and earlier sound driver used a different and
incompatible <Literal remap="tt">ioctl()</Literal> scheme. Obtain newer source code or make
the necessary changes to adapt it to the new sound driver. See the
sound driver <Filename>Readme</Filename> file for details.
</Para>
<Para>
Also ensure that you have used the latest version of
<Filename>soundcard.h</Filename> and <Filename>ultrasound.h</Filename> when compiling
the application. See the installation instructions at beginning of
this text.
</Para>
</Sect2>
<Sect2><Title>SEGV when running sound binaries that worked previously</Title>
<Para>
This is probably the same problem described in the previous question.
</Para>
</Sect2>
<Sect2><Title>What known bugs or limitations are there in the sound driver?</Title>
<Para>
See the files included with the sound driver kernel source.
</Para>
</Sect2>
<Sect2><Title>Where are the sound driver ioctls() etc. documented?</Title>
<Para>
Currently the best documentation, other than the source code, is
available at the 4Front Technologies web site,
<ULink URL="http://www.opensound.com">http://www.opensound.com</ULink>.
Another source of information is the
<Emphasis>Linux Multimedia Guide</Emphasis>, described in the references section.
</Para>
</Sect2>
<Sect2><Title>What CPU resources are needed to play or record without pauses?</Title>
<Para>
There is no easy answer to this question, as it depends on:
</Para>
<Para>
<ItemizedList>
<ListItem>
<Para>
whether using PCM sampling or FM synthesis
</Para>
</ListItem>
<ListItem>
<Para>
sampling rate and sample size
</Para>
</ListItem>
<ListItem>
<Para>
which application is used to play or record
</Para>
</ListItem>
<ListItem>
<Para>
Sound Card hardware
</Para>
</ListItem>
<ListItem>
<Para>
disk I/O rate, CPU clock speed, cache size, etc.
</Para>
</ListItem>
</ItemizedList>
</Para>
<Para>
In general, any 386 machine or better should be able to play samples
or FM synthesized music on an 8 bit sound card with ease.
</Para>
<Para>
Playing MOD files, however, requires considerable CPU resources. Some
experimental measurements have shown that playing at 44kHz requires
more than 40&percnt; 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.
</Para>
<Para>
These statements assume the computer is not performing any other CPU
intensive tasks.
</Para>
<Para>
Converting sound files or adding effects using a utility such as
<Literal remap="tt">sox</Literal> is also much faster if you have a math
coprocessor (or CPU with on board FPU). The kernel driver itself
does not do any floating point calculations, though.
</Para>
</Sect2>
<Sect2><Title>Problems with a PAS16 and an Adaptec 1542 SCSI host adaptor</Title>
<Para>
(the following explanation was supplied by
<Literal remap="tt">seeker@indirect.com</Literal>)
</Para>
<Para>
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.
</Para>
<Para>
Additionally, both the 1542 and the PAS-16 do 16-bit DMA, so if you
sample at 16-bit 44 KHz 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.
</Para>
<Para>
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 <Emphasis>any</Emphasis> 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:
</Para>
<Para>
<ItemizedList>
<ListItem>
<Para>
get the motherboard distributor to replace the older version bus chip,
</Para>
</ListItem>
<ListItem>
<Para>
replace the motherboard, or
</Para>
</ListItem>
<ListItem>
<Para>
buy a different brand of sound card.
</Para>
</ListItem>
</ItemizedList>
</Para>
<Para>
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; <Emphasis>nobody</Emphasis>
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
<Emphasis>at least</Emphasis> 12MHz bus rates if the chips are designed
right. Exit soapbox (stage left).
</Para>
<Para>
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 <Emphasis>anything</Emphasis> they said about someone
else's hardware, since they didn't even know their own very well.
</Para>
</Sect2>
<Sect2><Title>Is it possible to read and write samples simultaneously?</Title>
<Para>
The drivers for some sound cards support full duplex mode. Check the
documentation available from 4Front Technologies for information on
how to use it.
</Para>
</Sect2>
<Sect2><Title>My SB16 is set to IRQ 2, but configure does not allow this value.</Title>
<Para>
On '286 and later machines, the IRQ 2 interrupt is cascaded to the
second interrupt controller. It is equivalent to IRQ 9.
</Para>
</Sect2>
<Sect2><Title>If I run Linux, then boot DOS, I get errors and/or sound applications do not work properly.</Title>
<Para>
This happens after a soft reboot to DOS. Sometimes the error message
misleadingly refers to a bad <Filename>CONFIG.SYS</Filename> file.
</Para>
<Para>
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).
</Para>
<Para>
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).
</Para>
<Para>
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 :-).
</Para>
</Sect2>
<Sect2><Title>Problems running DOOM under Linux</Title>
<Para>
Users of the port of ID software's game DOOM for Linux may
be interested in these notes.
</Para>
<Para>
For correct sound output you need version 2.90 or later of the sound
driver; it has support for the real-time <Literal remap="tt">DOOM mode</Literal>.
</Para>
<Para>
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
<ULink URL="ftp://www.ibiblio.org/pub/Linux/games/doom">
ftp://www.ibiblio.org/pub/Linux/games/doom</ULink>.
</Para>
<Para>
If performance of DOOM is poor on your system, disabling sound (by
renaming the file <Literal remap="tt">sndserver</Literal>) may improve it.
</Para>
<Para>
By default DOOM does not support music (as in the DOS version). The
program <Literal remap="tt">musserver</Literal> will add support for music to DOOM under
Linux. It can be found at
<ULink URL="ftp://pandora.st.hmc.edu/pub/linux/musserver.tgz">
ftp://pandora.st.hmc.edu/pub/linux/musserver.tgz</ULink>.
</Para>
</Sect2>
<Sect2><Title>How can I reduce noise picked up by my sound card?</Title>
<Para>
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.
</Para>
<Para>
Philipp Braunbeck reported that on his ESS-1868 sound card there was a
jumper to turn off the built-in amplifier which helped reduce noise
when enabled.
</Para>
<Para>
On one 386 system I found that the kernel command line option
<Literal remap="tt">no-hlt</Literal> reduced 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
<Literal remap="tt">append="no-hlt"</Literal> in your LILO configuration file.
</Para>
<Para>
Some sound cards are simply not designed with good shielding and
grounding and are prone to noise pickup.
</Para>
</Sect2>
<Sect2><Title>I can play sounds, but not record.</Title>
<Para>
If you can play sound but not record, try these steps:
</Para>
<Para>
<ItemizedList>
<ListItem>
<Para>
use a mixer program to select the appropriate device (e.g. microphone)
</Para>
</ListItem>
<ListItem>
<Para>
use the mixer to set the input gains to maximum
</Para>
</ListItem>
<ListItem>
<Para>
If you can, try to test sound card recording under MS-DOS to
determine if there is a hardware problem
</Para>
</ListItem>
</ItemizedList>
</Para>
<Para>
Sometimes a different DMA channel is used for recording than for
playback. In this case the most probable reason is that the recording
DMA is set up incorrectly.
</Para>
</Sect2>
<Sect2><Title>My "compatible" sound card only works if I first initialize under MS-DOS.</Title>
<Para>
In most cases a "SoundBlaster compatible" card will work better under
Linux if configured with a driver other than the SoundBlaster one.
Most sound cards claim to be compatible (e.g. "16 bit SB Pro
compatible" or "SB compatible 16 bit") but usually this SoundBlaster
mode is just a hack provided for DOS games compatibility. Most
cards have a 16 bit native mode which is likely to be supported by
recent Linux versions (2.0.1 and later).
</Para>
<Para>
Only with some (usually rather old) cards is it necessary to try to
get them to work in the SoundBlaster mode. The only newer cards that
are the exception to this rule are the Mwave-based cards.
</Para>
</Sect2>
<Sect2><Title>My 16-bit SoundBlaster "compatible" sound card only works in 8-bit mode under Linux.</Title>
<Para>
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.
</Para>
<Para>
You may be able to get the card to work in 16-bit mode by using the
MAD16 or MSS/WSS driver.
</Para>
</Sect2>
<Sect2><Title>Where can I find sound applications for Linux?</Title>
<Para>
Here are some good archive sites to search for Linux specific sound
applications:
</Para>
<Para>
<ItemizedList>
<ListItem>
<Para>
<ULink URL="ftp://www.ibiblio.org/pub/Linux/kernel/sound/">
ftp://www.ibiblio.org/pub/Linux/kernel/sound/</ULink>
</Para>
</ListItem>
<ListItem>
<Para>
<ULink URL="ftp://www.ibiblio.org/pub/Linux/apps/sound/">
ftp://www.ibiblio.org/pub/Linux/apps/sound/</ULink>
</Para>
</ListItem>
<ListItem>
<Para>
<ULink URL="ftp://tsx-11.mit.edu/pub/linux/packages/sound/">
ftp://tsx-11.mit.edu/pub/linux/packages/sound/></ULink>
</Para>
</ListItem>
<ListItem>
<Para>
<ULink
URL="ftp://nic.funet.fi/pub/Linux/util/sound/">
ftp://nic.funet.fi/pub/Linux/util/sound/</ULink>
</Para>
</ListItem>
<ListItem>
<Para>
<ULink URL="ftp://nic.funet.fi/pub/Linux/xtra/snd-kit/">
ftp://nic.funet.fi/pub/Linux/xtra/snd-kit/</ULink>
</Para>
</ListItem>
<ListItem>
<Para>
<ULink URL="ftp://nic.funet.fi/pub/Linux/ALPHA/sound/">
ftp://nic.funet.fi/pub/Linux/ALPHA/sound/</ULink>
</Para>
</ListItem>
</ItemizedList>
</Para>
<Para>
Also see the References section of this document.
</Para>
</Sect2>
<Sect2><Title>Can the sound drivers be compiled as a loadable module?</Title>
<Para>
With recent kernels the sound driver is supported as several kernel
loadable modules.
</Para>
<Para>
See the files in <Filename>/usr/src/linux/Documentation/sound</Filename>,
especially the files <Filename>Introduction</Filename> and
<Filename>README.modules</Filename>.
</Para>
</Sect2>
<Sect2><Title>Can I use a sound card to replace the system console beep?</Title>
<Para>
Try the <Literal remap="tt">oplbeep</Literal> program, found at
<ULink URL="ftp://www.ibiblio.org/pub/Linux/apps/sound/oplbeep-2.3.tar.gz">
ftp://www.ibiblio.org/pub/Linux/apps/sound/oplbeep-2.3.tar.gz</ULink>
</Para>
<Para>
Another variant is the <Literal remap="tt">beep</Literal> program found at
<ULink URL="ftp://www.ibiblio.org/pub/Linux/kernel/patches/misc/modreq_beep.tgz">
ftp://www.ibiblio.org/pub/Linux/kernel/patches/misc/modreq_beep.tgz</ULink>
</Para>
<Para>
The <Literal remap="tt">modutils</Literal> package has an example program and kernel patch
that supports calling an arbitrary external program to generate sounds
when requested by the kernel.
</Para>
<Para>
Version 2.0 and later of KDE allows playing a sound file for the console beep in
KDE applications such as konsole.
</Para>
<Para>
Alternatively, with some sound cards you can connect the PC speaker
output to the sound card so that all sounds come from the sound card
speakers.
</Para>
</Sect2>
<Sect2><Title>What is VoxWare?</Title>
<Para>
The commercial version of the sound drivers sold by 4Front
Technologies was previously known by other names such as
<Emphasis>VoxWare</Emphasis>, <Emphasis>USS</Emphasis> (Unix Sound System), and even
<Emphasis>TASD</Emphasis> (Temporarily Anonymous Sound Driver). It is now marketed
as <Emphasis>OSS</Emphasis> (Open Sound System). The version included
in the Linux kernel is sometimes referred to as <Emphasis>OSS/Free</Emphasis>.
</Para>
<Para>
For more information see the 4Front Technologies web page at
<ULink URL="http://www.opensound.com/">http://www.opensound.com/</ULink>.
I wrote a review of OSS/Linux in the June 1997 issue of
<ULink URL="http://www.ssc.com/lj/">Linux Journal</ULink>.
</Para>
</Sect2>
<Sect2><Title>Sox/Play/Vplay reports "invalid block size 1024"</Title>
<Para>
A change to the sound driver in version 1.3.67 broke some sound player
programs which (incorrectly) checked that the result from the
SNDCTL&lowbar;DSP&lowbar;GETBLKSIZE ioctl was greater than 4096. The latest sound
driver versions have been fixed to avoid allocating fragments shorter
than 4096 bytes which solves this problem with old utilities.
</Para>
</Sect2>
<Sect2><Title>The mixer settings are reset whenever I load the sound driver module</Title>
<Para>
You can build the sound driver as a loadable module and use
<Literal remap="tt">kerneld</Literal> to automatically load and unload it. This can present
one problem - whenever the module is reloaded the mixer
settings go back to their default values. For some sound cards this
can be too loud (e.g. SoundBlaster16) or too quiet. Markus Gutschke
(<Literal remap="tt">gutschk@uni-muenster.de</Literal>) found this solution. Use a line in
your <Filename>/etc/conf.modules</Filename> file such as the following:
<Screen>
options sound dma_buffsize=65536
post-install sound /usr/bin/setmixer igain 0 ogain 0 vol 75
</Screen>
</Para>
<Para>
This causes your mixer program (in this case <Literal remap="tt">setmixer</Literal>) to be
run immediately after the sound driver is loaded. The
<Literal remap="tt">dma&lowbar;buffsize</Literal> parameter is just a dummy value needed because
the option command requires a command line option. Change the line as
needed to match your mixer program and gain settings.
</Para>
<Para>
If you have compiled the sound driver into your kernel and you want to
set the mixer gains at boot time you can put a call to your mixer
program in a system startup file such as
<Filename>/etc/rc.d/rc.local</Filename>.
</Para>
</Sect2>
<Sect2><Title>Only user root can record sound</Title>
<Para>
By default the script in Readme.linux that creates the sound device
files only allows the devices to be read by user <Literal remap="tt">root</Literal>. This
is to plug a potential security hole. In a networked environment,
external users could conceivably log in remotely to a Linux PC with a
sound card and microphone and eavesdrop. If you are not worried about
this, you can change the permissions used in the script.
</Para>
<Para>
With the default setup, users can still play sound files. This is not
a security risk but is a potential for nuisance.
</Para>
</Sect2>
<Sect2><Title>Is the sound hardware on the IBM ThinkPad supported?</Title>
<Para>
Information on how to use the mwave sound card on an IBM ThinkPad
laptop computer can be found in the file
<Filename>/usr/src/linux/Documentation/sound/mwave</Filename>, which is part
of the kernel source distribution (note that not all IBM ThinkPads use the
MWAVE sound chip).
</Para>
</Sect2>
<Sect2><Title>Applications fail because my sound card has no mixer</Title>
<Para>
Some old 8-bit SoundBlaster cards have no mixer circuitry. Some sound
applications insist on being able to open the mixer device, and fail
with these cards. Jens Werner
(<ULink URL="mailto:werner@bert.emv.ing.tu-bs.de">werner@bert.emv.ing.tu-bs.de</ULink>)
reports a workaround for this is
to link <Literal remap="tt">/dev/mixer</Literal> to <Literal remap="tt">/dev/null</Literal> and everything
should work fine.
</Para>
</Sect2>
<Sect2><Title>Problems with a SB16 CT4170</Title>
<Para>
From Scott Manley
(<ULink URL="mailto:spm@star.arm.ac.uk">spm@star.arm.ac.uk</ULink>):
</Para>
<Para>
There seems to be a new type of Soundblaster - it was sold to us as a
SB16 - the Model no. on the Card is CT4170. These Beasties only have
one DMA channel so when you try to set them up then the kernel will
have trouble accessing the 16 bit DMA. The solution is to set the
second DMA to 1 so that the card will behave as advertised.
</Para>
</Sect2>
<Sect2><Title>How to connect a MIDI keyboard to a soundcard</Title>
<Para>
From Kim G. S. OEyhus
(<ULink URL="mailto:kim@pvv.ntnu.no">kim@pvv.ntnu.no</ULink>):
</Para>
<Para>
I looked all around the internet and in sound documentation on how to
do something as simple as connecting the MIDI output from a master
keyboard to the MIDI input on a sound card. I found nothing. The
problem is that they both use the same device, /dev/midi, at least
when using the OSS sound system. So I found a way to do it, which I
want to share. This makes for a very simple synthesizer, with full
MIDI support:
</Para>
<Para>
CONNECTING A MIDI MASTER-KEYBOARD DIRECTLY TO A SOUNDCARD WITH MIDI
</Para>
<Para>
A MIDI master-keyboard is a keyboard without any synthesizer, and with
only a MIDI-out plug. This can be connected to the 15-pin D-SUB port
on most sound-cards with a suitable cable.
</Para>
<Para>
Such a keyboard can be used to control the MIDI synthesizer device
for the card, thus making a simple keyboard controlled synthesizer.
</Para>
<Para>
Compile the following program, say with 'gcc -o prog prog.c' and run it:
<Screen>
#include &lt;fcntl.h&gt;
main()
{
int fil, a;
char b[256];
fil=open("/dev/midi", O_RDWR);
for(;;)
{
a=read(fil, b, 256);
write(fil, b, a);
}
}
</Screen>
</Para>
</Sect2>
<Sect2><Title>Problems with IRQ 15 and Ensoniq PCI 128</Title>
<Para>
From Matthew Inger (<ULink URL="mailto:mattinger@mindless.com">mattinger@mindless.com</ULink>):
</Para>
<Para>
Information on getting an Ensoniq PCI 128 card to work.
</Para>
<Para>
The problem that it was exhibiting was that it was trying to use
interrupt 15 by default (Plug and Pray was responsible for this one).
This interrupt is used by the secondary ide controller, and cannot be
shared by other devices. You need to somehow force the es1370 to use
another interrupt (should use interrupt 11 like it does under
windows).
</Para>
<Para>
I figured this one out for myself believe it or not.
</Para>
<Para>
What I had to do was:
</Para>
<Para>
a) in the BIOS, you have to tell the computer that you don't have
a Plug and Play OS. I believe this is under advanced options
in my BIOS.
</Para>
<Para>
b) in the PCI settings in the BIOS, tell the computer to reserve
interrupt 15 for legacy ISA devices. In my bios, under advanced
options, there is a section for PCI settings. Under there, there
is a Resource Exclusion area, and that's where to do this.
</Para>
<Para>
When you reboot into linux you will be able to use sound. (I don't
remember if it shows up in the boot messages or not like it used to).
To be safe, I ran sndconfig again so that it would play the test message,
which sounded not great, but it was there. When I played a CD however, it
sounded perfect.
</Para>
<Para>
Don't worry about windows, I tried both my cards: ISA Modem, and the
Sound Card out, and they work without any hitches.
</Para>
<Para>
The odds are your BIOS will be different from mine, but you just have
to figure out where the settings are for the above two items. Good
luck.
</Para>
</Sect2>
<Sect2><Title>Where can I get freely available MIDI patches to run SoftOSS?</Title>
<Para>
SoftOSS is a software-based wavetable synthesizer included with the
kernel sound driver that is compatible with the Gravis Utrasound
card. To operate the driver needs GUS compatible MIDI patch files. The
documentation mentions the "public domain MIDIA patchset available
from several ftp sites". Note that SoftOSS is no longer included
as of the 2.4 kernels.
</Para>
<Para>
As explained on the 4Front Technologies web page
<ULink URL="http://www.opensound.com/softoss.html">
http://www.opensound.com/softoss.html</ULink>
they can be downloaded from
<ULink URL="ftp://archive.cs.umbc.edu/pub/midia/instruments.tar.gz">
ftp://archive.cs.umbc.edu/pub/midia/instruments.tar.gz</ULink>.
</Para>
</Sect2>
</Sect1>
<Sect1><Title>References</Title>
<Para>
If you have a sound card that supports a CD-ROM or SCSI interface, the
Linux
<ULink URL="ftp://www.ibiblio.org/pub/Linux/docs/HOWTO/unmaintained/SCSI-HOWTO">SCSI HOWTO</ULink>
and the Linux <ULink URL="http://www.ibiblio.org/LDP/HOWTO/CDROM-HOWTO.html">CD-ROM HOWTO</ULink>
have additional information that may be useful to you.
</Para>
<Para>
The <ULink URL="http://www.ibiblio.org/LDP/HOWTO/Sound-Playing-HOWTO.html">Sound Playing HOWTO</ULink>
describes how to play various types of sound and music files under Linux.
</Para>
<Para>
The
<ULink URL="http://www.ibiblio.org/LDP/HOWTO/mini/Soundblaster-AWE.html">Linux SoundBlaster AWE32/64 Mini-HOWTO</ULink>
describes how to get a SoundBlaster 32 or 64 card working under Linux.
</Para>
<Para>
Programming information is available from the 4Front Technologies web site at
<ULink URL="http://www.opensound.com/pguide">
http://www.opensound.com/pguide</ULink>.
</Para>
<Para>
The following FAQs are regularly posted to the Usenet newsgroup
<ULink URL="news:news.announce">news.announce</ULink>
as well as being archived at
<ULink URL="ftp://rtfm.mit.edu/pub/usenet/news.answers">
ftp://rtfm.mit.edu/pub/usenet/news.answers</ULink>:
</Para>
<Para>
<ItemizedList>
<ListItem>
<Para>
PCsoundcards/generic-faq (Generic PC Soundcard FAQ)
</Para>
</ListItem>
<ListItem>
<Para>
PCsoundcards/soundcard-faq (comp.sys.ibm.pc.soundcard FAQ)
</Para>
</ListItem>
<ListItem>
<Para>
PCsoundcards/gravis-ultrasound/faq (Gravis UltraSound FAQ)
</Para>
</ListItem>
<ListItem>
<Para>
audio-fmts/part1 (Audio file format descriptions)
</Para>
</ListItem>
<ListItem>
<Para>
audio-fmts/part2 (Audio file format descriptions)
</Para>
</ListItem>
</ItemizedList>
</Para>
<Para>
The FAQs also list several product specific mailing lists
and archive sites. The following Usenet news groups discuss sound
and/or music related issues:
</Para>
<Para>
<ItemizedList>
<ListItem>
<Para>
<ULink URL="news:alt.binaries.sounds">alt.binaries.sounds.*</ULink>
(various groups for posting sound files)
</Para>
</ListItem>
<ListItem>
<Para>
<ULink URL="news:alt.binaries.multimedia">alt.binaries.multimedia</ULink>
(for posting Multimedia files)
</Para>
</ListItem>
<ListItem>
<Para>
<ULink URL="news:alt.sb.programmer">alt.sb.programmer</ULink>
(Soundblaster programming topics)
</Para>
</ListItem>
<ListItem>
<Para>
<ULink URL="news:comp.multimedia">comp.multimedia</ULink>
(Multimedia topics)
</Para>
</ListItem>
<ListItem>
<Para>
<ULink URL="news:comp.music">comp.music</ULink>
(Computer music theory and research)
</Para>
</ListItem>
<ListItem>
<Para>
<ULink URL="news:comp.sys.ibm.pc.soundcard">comp.sys.ibm.pc.soundcard.*</ULink>
(various IBM PC sound card groups)
</Para>
</ListItem>
</ItemizedList>
</Para>
<Para>
A web site dedicated to multimedia can be found at <ULink
URL="http://www.scala.com/multimedia/">http://www.scala.com/multimedia/</ULink>.
Another good site for Linux MIDI and sound applications is
<ULink URL="http://sound.condorow.net/">http://sound.condorow.net/</ULink>.
Creative Labs has a web site at <ULink URL="http://www.creaf.com/">http://www.creaf.com/</ULink>.
</Para>
<Para>
The Linux mailing list has a number of "channels" dedicated
to different topics. To find out how to join, send a mail message with
the word "help" as the message body to
<ULink URL="mailto:majordomo@vger.kernel.org">majordomo@vger.kernel.org</ULink>.
</Para>
<Para>
As mentioned several times before, the kernel sound driver includes a
number of <Filename>Readme</Filename> files containing useful information about
the sound card driver. These can typically be found in the directory
<Filename>/usr/src/linux/drivers/sound</Filename>.
</Para>
<Para>
Information on OSS, the commercial sound driver for Linux and other
Unix compatible operating systems, can be found at the 4Front
Technologies web page at
<ULink URL="http://www.opensound.com/">http://www.opensound.com/</ULink>.
</Para>
<Para>
The <Emphasis>Linux Software Map</Emphasis> (LSM) is an invaluable
reference for locating Linux software. The LSM home page is at
<ULink URL="http://www.ExecPC.com/lsm/">http://www.ExecPC.com/lsm/</ULink>.
and there is an on-line browsable version at
<ULink URL="http://www.boutell.com/lsm/">http://www.boutell.com/lsm/</ULink>.
</Para>
<Para>
Another great site for finding Linux applications is
<ULink URL="http://www.freshmeat.net/">http://www.freshmeat.net/</ULink>.
</Para>
<Para>
The Linux Documentation Project has produced several books
on Linux, including <Emphasis>Linux Installation and Getting
Started</Emphasis>. These are freely available by anonymous FTP from major
Linux archive sites or can be purchased in hardcopy format.
</Para>
<Para>
Finally, a shameless plug: If you want to learn a lot more about
multimedia under Linux (especially CD-ROM and sound card applications
and programming), check out my book <Emphasis>Linux Multimedia
Guide</Emphasis>, ISBN 1-56592-219-0, published by O'Reilly and
Associates. As well as the original English version, French and
Japanese translations are now in print. For details, call 800-998-9938
in North America or check the web page
<ULink URL="http://www.ora.com/catalog/multilinux/noframes.html">
http://www.ora.com/catalog/multilinux/noframes.html</ULink>.
</Para>
</Sect1>
</Article>