home *** CD-ROM | disk | FTP | other *** search
/ Hackers Toolkit v2.0 / Hackers_Toolkit_v2.0.iso / HTML / archive / Unix / HOWTOs / SOUND-HO < prev    next >
Text File  |  1999-11-04  |  80KB  |  2,311 lines

  1.   The Linux Sound HOWTO
  2.   Jeff Tranter, tranter@pobox.com
  3.   v1.19, 23 January 1998
  4.  
  5.   This document describes sound support for Linux. It lists the sup-
  6.   ported sound hardware, describes how to configure the kernel drivers,
  7.   and answers frequently asked questions. The intent is to bring new
  8.   users up to speed more quickly and reduce the amount of traffic in the
  9.   Usenet news groups and mailing lists.
  10.   ______________________________________________________________________
  11.  
  12.   Table of Contents
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.   1. Introduction
  68.  
  69.      1.1 Acknowledgments
  70.      1.2 Revision History
  71.      1.3 New versions of this document
  72.      1.4 Feedback
  73.      1.5 Distribution Policy
  74.  
  75.   2. Sound Card Technology
  76.  
  77.   3. Supported Hardware
  78.  
  79.      3.1 Sound Cards
  80.      3.2 Alternate Sound Drivers
  81.      3.3 PC Speaker
  82.      3.4 Parallel Port
  83.  
  84.   4. Installation
  85.  
  86.      4.1 Installing the Sound Card
  87.      4.2 Configuring the Kernel
  88.      4.3 Creating the Device Files
  89.      4.4 Booting Linux and Testing the Installation
  90.      4.5 Troubleshooting
  91.         4.5.1 Step 1: Make sure you are really running the kernel you compiled.
  92.         4.5.2 Step 2: Make sure the kernel sound drivers are compiled in.
  93.         4.5.3 Step 3: Did the kernel detect your sound card during booting?
  94.         4.5.4 Step 4: Can you read data from the dsp device?
  95.         4.5.5 When All Else Fails
  96.  
  97.   5. Applications Supporting Sound
  98.  
  99.   6. Answers To Frequently Asked Questions
  100.  
  101.      6.1 What are the various sound device files?
  102.      6.2 How can I play a sound sample?
  103.      6.3 How can I record a sample?
  104.      6.4 Can I have more than one sound card?
  105.      6.5 Error: No such file or directory for sound devices
  106.      6.6 Error: No such device for sound devices
  107.      6.7 Error: No space left on device for sound devices
  108.      6.8 Error: Device busy for sound devices
  109.      6.9 I still get device busy errors!
  110.      6.10 Partial playback of digitized sound file
  111.      6.11 There are pauses when playing MOD files
  112.      6.12 Compile errors when compiling sound applications
  113.      6.13 SEGV when running sound binaries that worked previously
  114.      6.14 What known bugs or limitations are there in the sound driver?
  115.      6.15 Where are the sound driver ioctls() etc. documented?
  116.      6.16 What CPU resources are needed to play or record without pauses?
  117.      6.17 Problems with a PAS16 and an Adaptec 1542 SCSI host adaptor
  118.      6.18 Is it possible to read and write samples simultaneously?
  119.      6.19 My SB16 is set to IRQ 2, but configure does not allow this value.
  120.      6.20 Are the SoundBlaster AWE32 or SoundBlaster16 ASP supported?
  121.      6.21 If I run Linux, then boot DOS, I get errors and/or sound applications do not work properly.
  122.      6.22 Problems running DOOM under Linux
  123.      6.23 How can I reduce noise picked up by my sound card?
  124.      6.24 I can play sounds, but not record.
  125.      6.25 My "compatible" sound card only works if I first initialize under MS-DOS.
  126.      6.26 My 16-bit SoundBlaster "compatible" sound card only works in 8-bit mode under Linux.
  127.      6.27 Where can I find sound applications for Linux?
  128.      6.28 Can the sound driver be compiled as a loadable module?
  129.      6.29 Can I use a sound card to replace the system console beep?
  130.      6.30 What is VoxWare?
  131.      6.31 Are Plug and Play sound card supported?
  132.      6.32 Sox/Play/Vplay reports "invalid block size 1024"
  133.      6.33 Why does the sound driver have its own configuration program?
  134.      6.34 The mixer settings are reset whenever I load the sound driver module
  135.      6.35 Only user root can record sound
  136.      6.36 Is the sound hardware on the IBM ThinkPad supported?
  137.  
  138.   7. References
  139.  
  140.  
  141.  
  142.   ______________________________________________________________________
  143.  
  144.   1.  Introduction
  145.  
  146.  
  147.   This is the Linux Sound HOWTO. It is intended as a quick reference
  148.   covering everything you need to know to install and configure sound
  149.   support under Linux. Frequently asked questions about sound under
  150.   Linux are answered, and references are given to some other sources of
  151.   information on a variety of topics related to computer generated sound
  152.   and music.
  153.  
  154.   The scope is limited to the aspects of sound cards pertaining to
  155.   Linux. See the other documents listed in the References section for
  156.   more general information on sound cards and computer sound and music
  157.   generation.
  158.  
  159.  
  160.   1.1.  Acknowledgments
  161.  
  162.  
  163.   Much of this information came from the documentation provided with the
  164.   sound driver source code, by Hannu Savolainen (hannu@voxware.pp.fi).
  165.   Thanks go to Hannu and the many other people who developed the Linux
  166.   kernel sound drivers and utilities.
  167.  
  168.   Thanks to the SGML Tools package, this HOWTO is available in several
  169.   formats, all generated from a common source file.
  170.  
  171.  
  172.   1.2.  Revision History
  173.  
  174.  
  175.  
  176.  
  177.      Version 1.1
  178.         first version; posted to SOUND channel of Linux activists
  179.         mailing list only
  180.  
  181.  
  182.      Version 1.2
  183.         minor updates; first version available on archive sites
  184.  
  185.  
  186.      Version 1.3
  187.         converted to SGML; now available in several formats using Matt
  188.         Welsh's Linuxdoc-SGML tools; appearance changed due to new
  189.         format, only minor changes to content
  190.  
  191.  
  192.      Version 1.4
  193.         minor tweaking of SGML; added answer on PAS16 and Adaptec1542A
  194.         SCSI adaptor incompatibilities
  195.  
  196.  
  197.      Version 1.5
  198.         2.5a sound driver is now in 1.1 kernel distribution; note on
  199.         GUS-MAX support; other minor updates
  200.  
  201.  
  202.      Version 1.6
  203.         added info on "no space on device" error; added note that
  204.         Hacker's Guide is in a "hidden" directory; added question on
  205.         bidirectional mode; info on "device busy" errors; other minor
  206.         changes
  207.  
  208.  
  209.      Version 1.7
  210.         added info on ASP and AWE32; VoxWare 2.9 is available; answer to
  211.         question on using IRQ2; references to Sound and SCSI HOWTOs
  212.  
  213.  
  214.      Version 1.8
  215.         added question on errors under DOS; many minor things updated to
  216.         match the version 2.90 sound driver; info on DOOM; answer on
  217.         reducing noise
  218.  
  219.  
  220.      Version 1.9
  221.         questions on recording and clone cards
  222.  
  223.  
  224.      Version 1.10
  225.         mentioned that HOWTO is available on WWW, as printed copies, and
  226.         translations; info on DMA conflict with QIC tape driver; info on
  227.         Sound Galaxy NX Pro and Logitech BusMouse
  228.  
  229.  
  230.      Version 1.11
  231.         A long overdue update (I've been busy); document placed under
  232.         GPL; brought up to date with version 3.0 sound driver; info on
  233.         many new supported sound card drivers; more info on
  234.         configuration and troubleshooting; lots of HTML links added;
  235.         brought in line with format of CD-ROM HOWTO
  236.  
  237.  
  238.      Version 1.12
  239.         new sound drivers in 1.3.34 kernel; new sound device names; 1542
  240.         address is 334 not 333; clarify status of Creative Labs Emu and
  241.         ASP; pointer to Creative Labs and MediaTrix Web sites
  242.  
  243.  
  244.      Version 1.13
  245.         note on the name VoxWare; updated to reflect latest supported
  246.         sound cards and configuration options; question on Plug and Play
  247.         support; question on block size problem; new xconfig and
  248.         menuconfig options; modutils has sound device support; vger
  249.         mailing list going away; emphasize author's Web site; other
  250.         miscellaneous minor changes
  251.  
  252.  
  253.      Version 1.14
  254.         Audio Excell DSP16 is not currently supported (should be working
  255.         again in a few months); changes to configure program; Italian
  256.         version of HOWTO available; trick for setting mixer gains when
  257.         loading sound module; latest stable kernel is now 2.0; new name
  258.         for sound driver; question on root permissions on sound device
  259.         files
  260.  
  261.  
  262.      Version 1.15
  263.         removed some questions that were very old and now obsolete; new
  264.         e-mail address for author; fixed some links to point to latest
  265.         software packages; more information on multimedia book; minor
  266.         spelling and grammatical changes
  267.  
  268.  
  269.      Version 1.16
  270.         many updates and corrections from Hannu Savolainen; added six
  271.         month "best before" date; new URL to web page for book; added
  272.         link to Spanish translation; minor spelling and grammatical
  273.         changes
  274.  
  275.  
  276.      Version 1.17
  277.         Chinese version available; alternate GUS driver; packet radio
  278.         modem; Linux Multimedia guide is now available in French and
  279.         Japanese; references to a couple of relevant mini-HOWTOs;
  280.         pointer for IBM ThinkPad
  281.  
  282.  
  283.      Version 1.18
  284.         Korean translation available; more information on status of
  285.         sound on MIPS; updated info on multiple sound card support;
  286.         should be root when running fuser
  287.  
  288.  
  289.      Version 1.19
  290.         added index entries; placed under LDP license rather than GPL
  291.  
  292.  
  293.  
  294.   1.3.  New versions of this document
  295.  
  296.  
  297.   New versions of this document will be periodically posted to the
  298.   comp.os.linux.answers newsgroup. They will also be uploaded to various
  299.   anonymous ftp sites that archive such information including
  300.   <ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/>.
  301.  
  302.   Hypertext versions of this and other Linux HOWTOs are available on
  303.   many World-Wide-Web sites, including  <http://sunsite.unc.edu/LDP/>.
  304.   Most Linux CD-ROM distributions include the HOWTOs, often under the
  305.   /usr/doc directory, and you can also buy printed copies from several
  306.   vendors. Sometimes the HOWTOs available from CD-ROM vendors, ftp
  307.   sites, and printed format are out of date. If the date on this HOWTO
  308.   is more than six months in the past, then a newer copy is probably
  309.   available on the Internet.
  310.  
  311.   A French translation of this document is available at
  312.   <ftp://ftp.ibp.fr/pub2/linux/french/docs/HOWTO/>.
  313.  
  314.   A Japanese translation is available from  <http://yebisu.ics.es.osaka-
  315.   u.ac.jp/linux/>.
  316.  
  317.   An Italian translation is available from
  318.   <http://www.psy.unipd.it/ildp/docs/HOWTO/Sound-HOWTO.html>.
  319.  
  320.   A Spanish translation is available from
  321.   <http://www.insflug.nova.es/howtos/online/sonido/sonido-COMO.html>.
  322.  
  323.   A Chinese translation is available from
  324.   <http://linux.ntcic.edu.tw/~yorkwu/linux/howto/sound/>.
  325.  
  326.   A Hangul (Korean) translation is available from
  327.   <http://members.iWorld.net/mangchi/HOWTO/Sound-HOWTO.html>.
  328.  
  329.   Most translations of this and other Linux HOWTOs can also be found at
  330.   <http://sunsite.unc.edu/pub/Linux/docs/HOWTO/translations/> and
  331.   <ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/translations/>.
  332.  
  333.   If you make a translation of this document into another language, let
  334.   me know and I'll include a reference to it here.
  335.  
  336.  
  337.   1.4.  Feedback
  338.  
  339.  
  340.   I rely on you, the reader, to make this HOWTO useful. If you have any
  341.   suggestions, corrections, or comments, please send them to me,
  342.   tranter@pobox.com, and I will try to incorporate them in the next
  343.   revision.
  344.  
  345.   I am also willing to answer general questions on sound cards under
  346.   Linux, as best I can. Before doing so, please read all of the
  347.   information in this HOWTO, and send me detailed information about the
  348.   problem. Please do not ask me about using sound cards under operating
  349.   systems other than Linux.
  350.  
  351.   If you publish this document on a CD-ROM or in hardcopy form, a
  352.   complimentary copy would be appreciated. Mail me for my postal
  353.   address. Also consider making a donation to the Linux Documentation
  354.   Project to help support free documentation for Linux. Contact the
  355.   Linux HOWTO coordinator, Tim Bynum  <mailto:linux-
  356.   howto@sunsite.unc.edu>, for more information.
  357.  
  358.  
  359.   1.5.  Distribution Policy
  360.  
  361.  
  362.   Copyright (c) 1995-1998 by Jeff Tranter.  This document may be
  363.   distributed under the terms set forth in the LDP license at
  364.   <http://sunsite.unc.edu/LDP/COPYRIGHT.html>.
  365.  
  366.  
  367.   2.  Sound Card Technology
  368.  
  369.  
  370.   This section gives a very cursory overview of computer audio
  371.   technology, in order to help you understand the concepts used later in
  372.   the document. You should consult a book on digital audio or digital
  373.   signal processing in order to learn more.
  374.  
  375.   Sound is an analog property; it can take on any value over a
  376.   continuous range. Computers are digital; they like to work with
  377.   discrete values. Sound cards use a device known as an Analog to
  378.   Digital Converter (A/D or ADC) to convert voltages corresponding to
  379.   analog sound waves into digital or numeric values which can be stored
  380.   in memory. Similarly, a Digital to Analog Converter (D/A or DAC)
  381.   converts numeric values back to an analog voltage which can in turn
  382.   drive a loudspeaker, producing sound.
  383.  
  384.   The process of analog to digital conversion, known as sampling,
  385.   introduces some error. Two factors are key in determining how well the
  386.   sampled signal represents the original. Sampling rate is the number of
  387.   samples made per unit of time (usually expresses as samples per second
  388.   or Hertz). A low sampling rate will provide a less accurate
  389.   representation of the analog signal. Sample size is the range of
  390.   values used to represent each sample, usually expressed in bits. The
  391.   larger the sample size, the more accurate the digitized signal will
  392.   be.
  393.  
  394.   Sound cards commonly use 8 or 16 bit samples at sampling rates from
  395.   about 4000 to 44,000 samples per second. The samples may also be
  396.   contain one channel (mono) or two (stereo).
  397.   FM Synthesis is an older technique for producing sound. It is based on
  398.   combining different waveforms (e.g. sine, triangle, square). FM
  399.   synthesis is simpler to implement in hardware that D/A conversion, but
  400.   is more difficult to program and less flexible. Many sound cards
  401.   provide FM synthesis for backward compatibility with older cards and
  402.   software. Several independent sound generators or voices are usually
  403.   provided.
  404.  
  405.   Wavetable Synthesis combines the flexibility of D/A conversion with
  406.   the multiple channel capability of FM synthesis. With this scheme
  407.   digitized voices can be downloaded into dedicated memory, and then
  408.   played, combined, and modified with little CPU overhead. State of the
  409.   art sound cards all support wavetable synthesis.
  410.  
  411.   Most sound cards provide the capability of mixing, combining signals
  412.   from different input sources and controlling gain levels.
  413.  
  414.   MIDI stands for Musical Instrument Digital Interface, and is a
  415.   standard hardware and software protocol for allowing musical
  416.   instruments to communicate with each other. The events sent over a
  417.   MIDI bus can also be stored as MIDI files for later editing and
  418.   playback. Many sound cards provide a MIDI interface. Those that do not
  419.   can still play MIDI files using the on-board capabilities of the sound
  420.   card.
  421.  
  422.   MOD files are a common format for computer generated songs.  As well
  423.   as information about the musical notes to be played, the files contain
  424.   digitized samples for the instruments (or voices). MOD files
  425.   originated on the Amiga computer, but can be played on other systems,
  426.   including Linux, with suitable software.
  427.  
  428.  
  429.   3.  Supported Hardware
  430.  
  431.  
  432.   This section lists the sound cards and interfaces that are currently
  433.   supported under Linux. The information here is based on the latest
  434.   Linux kernels, at time of writing.
  435.  
  436.   The sound driver has its own version numbering. The latest stable
  437.   Linux kernel release was version 2.0.33, using sound driver version
  438.   3.5.4-960630.
  439.  
  440.   The author of the sound driver, Hannu Savolainen, typically also makes
  441.   available newer beta releases of the sound driver before they are
  442.   included as part of the standard Linux kernel distribution. The most
  443.   up to date list of supported cards is available at <http://www.4front-
  444.   tech.com/ossfree/new_cards.html> (USA) or
  445.   <http://personal.eunet.fi/pp/voxware/new_cards.html> (Europe). These
  446.   pages indicate which sound driver version is required for a given type
  447.   of sound card or if support for it is still under development. The
  448.   file /usr/src/linux/drivers/sound/Readme.cards distributed with the
  449.   kernel sound driver contains information on supported cards but it is
  450.   not always up to date.
  451.  
  452.   The information in this HOWTO is valid for Linux on the Intel
  453.   platform.
  454.  
  455.   The sound driver should also work with most sound cards on the Alpha
  456.   platform. However, some cards may conflict with I/O ports of other
  457.   devices on Alpha systems even though they work perfectly on i386
  458.   machines, so in general it's not possible to tell if a given card will
  459.   work or not without actually trying it.
  460.  
  461.   At the time of writing the sound driver was not yet working on the
  462.   PowerPC version of Linux, but it should be supported in future.
  463.   Sound can be configured into the kernel under the MIPs port of Linux,
  464.   and some MIPs machines have EISA slots and/or built in sound hardware.
  465.   I'm told the Linux-MIPs group is interested in adding sound support in
  466.   the future.
  467.  
  468.   The Linux kernel includes a separate driver for the Atari and Amiga
  469.   versions of Linux that implements a compatible subset of the sound
  470.   driver on the Intel platform using the built-in sound hardware on
  471.   these machines.
  472.  
  473.   The SPARC port of Linux does not currently have sound support. Like
  474.   the Amiga and Atari, SPARC machines have built in sound hardware, so
  475.   it could be done with a new driver (this is somewhat ironic, as under
  476.   Linux /dev/dsp emulates the SunOS sound device).
  477.  
  478.  
  479.   3.1.  Sound Cards
  480.  
  481.  
  482.   The following sound cards are supported by the Linux kernel sound
  483.   driver:
  484.  
  485.  
  486.   o  ATI Stereo F/X (no longer manufactured)
  487.  
  488.   o  AdLib (no longer manufactured)
  489.  
  490.   o  Ensoniq SoundScape (and compatibles made by Reveal and Spea)
  491.  
  492.   o  Gravis Ultrasound
  493.  
  494.   o  Gravis Ultrasound ACE
  495.  
  496.   o  Gravis Ultrasound Max
  497.  
  498.   o  Gravis Ultrasound with 16 bit sampling option
  499.  
  500.   o  Logitech Sound Man 16
  501.  
  502.   o  Logitech SoundMan Games
  503.  
  504.   o  Logitech SoundMan Wave
  505.  
  506.   o  MAD16 Pro (OPTi 82C928, 82C929, 82C930, 82C924 chipsets)
  507.  
  508.   o  Media Vision Jazz16
  509.  
  510.   o  MediaTriX AudioTriX Pro
  511.  
  512.   o  Microsoft Windows Sound System (MSS/WSS)
  513.  
  514.   o  Mozart (OAK OTI-601)
  515.  
  516.   o  Orchid SW32
  517.  
  518.   o  Personal Sound System (PSS)
  519.  
  520.   o  Pro Audio Spectrum 16
  521.  
  522.   o  Pro Audio Studio 16
  523.  
  524.   o  Pro Sonic 16
  525.  
  526.   o  Roland MPU-401 MIDI interface
  527.  
  528.  
  529.   o  Sound Blaster 1.0
  530.  
  531.   o  Sound Blaster 16
  532.  
  533.   o  Sound Blaster 16ASP
  534.  
  535.   o  Sound Blaster 2.0
  536.  
  537.   o  Sound Blaster AWE32
  538.  
  539.   o  Sound Blaster Pro
  540.  
  541.   o  TI TM4000M notebook
  542.  
  543.   o  ThunderBoard
  544.  
  545.   o  Turtle Beach Tropez ("classic" but not Plus)
  546.  
  547.   o  Turtle Beach Maui
  548.  
  549.   o  Yamaha FM synthesizers (OPL2, OPL3 and OPL4)
  550.  
  551.   o  6850 UART MIDI Interface
  552.  
  553.   It should be noted that Plug and Play (PnP) sound cards are not fully
  554.   compatible with the older non-PnP models of the same device. For
  555.   example, the SoundBlaster16 PnP is not fully compatible with the
  556.   original SoundBlaster16. The same is true for the Soundscape PnP and
  557.   GUS PnP cards. More information related to Plug and Play is found
  558.   later in this document.
  559.  
  560.   The following cards are not supported, either because they are
  561.   obsolete or because the vendor will not release the programming
  562.   information needed to write a driver:
  563.  
  564.  
  565.   o  Pro Audio Spectrum (original)
  566.  
  567.   o  Pro Audio Spectrum+
  568.  
  569.   o  older (Sierra Aria based) sound cards made by Diamond
  570.  
  571.   Other sound cards that are claimed to be compatible with one of the
  572.   supported sound cards may work if they are hardware (i.e. register
  573.   level) compatible.
  574.  
  575.   Even though most sound cards are claimed to be "SoundBlaster
  576.   compatible", very few currently sold cards are compatible enough to
  577.   work with the Linux SoundBlaster driver. These cards usually work
  578.   better using the MSS/WSS or MAD16 driver. Only real SoundBlaster cards
  579.   made by Creative Labs, which use Creative's custom chips (e.g.
  580.   SoundBlaster16 Vibra), MV Jazz16 and ESS688/1688 based cards generally
  581.   work with the SoundBlaster driver. Trying to use a "SoundBlaster Pro
  582.   compatible 16 bit sound card" with the SoundBlaster driver is usually
  583.   just a waste of time.
  584.  
  585.   The Linux kernel supports the SCSI port provided on some sound cards
  586.   (e.g. ProAudioSpectrum 16) and the proprietary interface for some CD-
  587.   ROM drives (e.g. Soundblaster Pro). See the Linux SCSI HOWTO and CDROM
  588.   HOWTO documents for more information.
  589.  
  590.   A loadable kernel module to support joystick ports, including those
  591.   provided on some sound cards, is also available.
  592.  
  593.   Note that the kernel SCSI, CD-ROM, joystick, and sound drivers are
  594.   completely independent of each other.
  595.   For the latest information on the sound card driver check Hannu
  596.   Savolainen's World-Wide Web site listed in the References section.
  597.  
  598.  
  599.   3.2.  Alternate Sound Drivers
  600.  
  601.  
  602.   There are some "unofficial" sound drivers available, not included in
  603.   the standard Linux kernel distribution, and used in place of the
  604.   standard sound driver.
  605.  
  606.   A commercial version of the Linux sound driver is sold by 4Front
  607.   Technologies. It offers a number of additional features over the free
  608.   version included in the Linux kernel. For more information see the
  609.   4Front Technologies Web page at  <http://www.4front-tech.com/>.
  610.  
  611.   Markus Mummert (mum@mmk.e-technik.tu-muenchen.de) has written a driver
  612.   package for the Turtle Beach MultiSound (classic), Tahiti, and
  613.   Monterey sound cards. The documentation states:
  614.  
  615.  
  616.        "It is designed for high quality hard disk recording/play-
  617.        back without losing sync even on a busy system. Other fea-
  618.        tures such as wave synthesis, MIDI and digital signal pro-
  619.        cessor (DSP) cannot be used. Also, recording and playback at
  620.        the same time is not possible. It currently replaces VoxWare
  621.        and was tested on several kernel versions ranging from 1.0.9
  622.        to 1.2.1. Also, it is installable on UN*X SysV386R3.2 sys-
  623.        tems."
  624.  
  625.  
  626.   It can be found at  <http://www.cs.colorado.edu/~mccreary/tbeach>.
  627.  
  628.   Kim Burgaard (burgaard@daimi.aau.dk) has written a device driver and
  629.   utilities for the Roland MPU-401 MIDI interface. The Linux software
  630.   map entry gives this description:
  631.  
  632.  
  633.        "A device driver for true Roland MPU-401 compatible MIDI
  634.        interfaces (including Roland SCC-1 and RAP-10/ATW-10). Comes
  635.        with a useful collection of utilities including a Standard
  636.        MIDI File player and recorder.
  637.  
  638.  
  639.  
  640.        Numerous improvements have been made since version 0.11a.
  641.        Among other things, the driver now features IRQ sharing pol-
  642.        icy and complies with the new kernel module interface.
  643.        Metronome functionality, possibility for synchronizing e.g.
  644.        graphics on a per beat basis without losing precision,
  645.        advanced replay/record/overdub interface and much, much
  646.        more."
  647.  
  648.  
  649.   It can be found at
  650.   <ftp://sunsite.unc.edu/pub/Linux/kernel/sound/mpu401-0.2.tar.gz>.
  651.  
  652.   Jaroslav Kysela and others have written an alternate sound driver for
  653.   the Gravis UltraSound Card. Information can be found at
  654.   <http://romeo.pf.jcu.cz/~perex/ultra>, the home page of the Linux
  655.   UltraSound Project.
  656.  
  657.   Another novel use for a sound card under Linux is as a modem for
  658.   amateur packet radio. The recent 2.1.x kernels include a driver that
  659.   works with SoundBlaster and Windows Sound System compatible sound
  660.   cards to implement 1200 bps AFSK and 9600 bps FSK packet protocols.
  661.   See the Linux AX25 HOWTO for details (I'm a ham myself, by the way --
  662.   callsign VE3ICH).
  663.  
  664.  
  665.   3.3.  PC Speaker
  666.  
  667.  
  668.   An alternate sound driver is available that requires no additional
  669.   sound hardware; it uses the internal PC speaker. It is mostly software
  670.   compatible with the sound card driver, but, as might be expected,
  671.   provides much lower quality output and has much more CPU overhead. The
  672.   results seem to vary, being dependent on the characteristics of the
  673.   individual loudspeaker. For more information, see the documentation
  674.   provided with the release.
  675.  
  676.   The current version is 1.1, and can be found at
  677.   <ftp://ftp.informatik.hu-berlin.de/pub/os/linux/hu-sound/>
  678.  
  679.  
  680.   3.4.  Parallel Port
  681.  
  682.  
  683.   Another option is to build a digital to analog converter using a
  684.   parallel printer port and some additional components. This provides
  685.   better sound quality than the PC speaker but still has a lot of CPU
  686.   overhead. The PC sound driver package mentioned above supports this,
  687.   and includes instructions for building the necessary hardware.
  688.  
  689.  
  690.   4.  Installation
  691.  
  692.  
  693.   Configuring Linux to support sound involves the following steps:
  694.  
  695.  
  696.   1. Installing the sound card.
  697.  
  698.   2. Configuring and building the kernel for sound support.
  699.  
  700.   3. Creating the device files.
  701.  
  702.   4. Booting the Linux kernel and testing the installation.
  703.  
  704.   The next sections will cover each of these steps in detail.
  705.  
  706.  
  707.   4.1.  Installing the Sound Card
  708.  
  709.  
  710.   Follow the manufacturer's instructions for installing the hardware or
  711.   have your dealer perform the installation.
  712.  
  713.   Older sound cards usually have switch or jumper settings for IRQ, DMA
  714.   channel, etc; note down the values used. If you are unsure, use the
  715.   factory defaults. Try to avoid conflicts with other devices (e.g.
  716.   ethernet cards, SCSI host adaptors, serial and parallel ports) if
  717.   possible.
  718.  
  719.   Usually you should use the same I/O port, IRQ, and DMA settings that
  720.   work under DOS. In some cases though (particularly with PnP cards) you
  721.   may need to use different settings to get things to work under Linux.
  722.   Some experimentation may be needed.
  723.  
  724.  
  725.  
  726.  
  727.   4.2.  Configuring the Kernel
  728.  
  729.  
  730.   When initially installing Linux you likely used a precompiled kernel.
  731.   These kernels usually do not provide sound support. It is best to
  732.   recompile the kernel yourself with the drivers you need. You may also
  733.   want to recompile the kernel in order to upgrade to a newer version or
  734.   to free up memory resources by minimizing the size of the kernel.
  735.  
  736.   The Linux Kernel HOWTO <http://sunsite.unc.edu/LDP/HOWTO/Kernel-
  737.   HOWTO.html> should be consulted for the details of building a kernel.
  738.   I will just mention here some issues that are specific to sound cards.
  739.  
  740.   If you have never configured the kernel for sound support before it is
  741.   a good idea to read all of the Readme files included with the kernel
  742.   sound drivers, particularly information specific to your card type.
  743.   The following documentation files can be found in the kernel sound
  744.   driver directory, usually installed in /usr/src/linux/drivers/sound:
  745.  
  746.  
  747.   CHANGELOG         - description of changes in each release
  748.   COPYING           - copying and copyright restrictions
  749.   Readme            - latest and most important news
  750.   Readme.aedsp16    - information about Audio Excel DSP 16 sound card
  751.   Readme.cards      - notes on configuring specific cards
  752.   Readme.linux      - notes on installing separately release sound drivers
  753.   Readme.modules    - how to build driver as a loadable kernel module
  754.   Readme.v30        - new features in version 3.0 sound driver
  755.   experimental.txt  - notes on experimental features
  756.  
  757.  
  758.  
  759.   Follow the usual procedure for building the kernel. There are
  760.   currently three interfaces to the configuration process. A graphical
  761.   user interface that runs under X11 can be invoked using "make
  762.   xconfig". A menu-based system that only requires text displays is
  763.   available as "make menuconfig". The original method, using "make
  764.   config", offers a simple text-based interface.
  765.  
  766.   Special care must be taken when using "make xconfig" or "make
  767.   menuconfig". All Yes/No questions must be examined carefully. The
  768.   default answer provided by these commands is always No which is not
  769.   the proper one in all cases. In particular the "/dev/dsp and
  770.   /dev/audio support" (CONFIG_AUDIO) option should usually be enabled.
  771.  
  772.   In this document I will assume that you use the traditional command
  773.   line configuration process invoked using "make config", although the
  774.   process is similar in each case.
  775.  
  776.   There are also two different ways to configure sound. The first is the
  777.   "old" way (the only one offered prior to the 2.0.0 kernels). It uses a
  778.   standalone configuration program that is part of the sound driver.
  779.   This method works with most sound cards except the rare few that
  780.   require additional "low level" drivers (miroSOUND, AWE32, and AEDSP16
  781.   cards).
  782.  
  783.   The second is the "new" method which is better integrated with the
  784.   menu-based configuration used for the rest of the kernel. This one
  785.   doesn't work with sound cards that require a firmware download file.
  786.   This includes the PSS, SM Wave, AudioTrix Pro and TurtleBeach
  787.   Tropez/Maui cards. With these cards the old method has to be used.
  788.  
  789.   The "new" method is always used by "make xconfig". When using "make
  790.   menuconfig" you can select between the "old" and "new" methods in the
  791.   sound subscreen. When using "make config" you get the "old" method by
  792.   default. However if you have used the "new" method once, it will be
  793.   used by "make config" too. You can switch back to the "old" method by
  794.   running "make menuconfig" and by selecting the "old" one.
  795.  
  796.   The recommended method is to use "make menuconfig" together with the
  797.   "old" sound config method. Many sound configuration problems are
  798.   caused (at least partly) by incorrect use of the "new" method.
  799.  
  800.   It is also possible to build the sound driver as a kernel loadable
  801.   module. I recommend initially building the driver into the kernel.
  802.   Once it is tested and working you can explore using the kernel module
  803.   option.
  804.  
  805.   When you run make config, enable sound support by answering "y" to the
  806.   question
  807.  
  808.  
  809.  
  810.        Sound card support (CONFIG_SOUND) [M/n/y/?]
  811.  
  812.  
  813.  
  814.  
  815.   At the end of the configuration questions a sound configuration
  816.   program will be compiled, run, and will then ask you what sound card
  817.   options you want. Be careful when answering these questions since
  818.   answering a question incorrectly may prevent some later ones from
  819.   being asked. For example, don't answer "yes" to the first question
  820.   (PAS16) if you don't really have a PAS16. Don't enable more cards than
  821.   you really need, since they just consume memory. Also some drivers
  822.   (like MPU-401) may conflict with your SCSI controller and prevent the
  823.   kernel from booting.
  824.  
  825.   I list here a brief description of each of the configuration dialog
  826.   options. Answer "y" (yes) or "n" (no) to each question. The default
  827.   answer is shown so that "[Y/n/?]" means "y" by default and "[N/y/?]"
  828.   means the default is "n". To use the default value, just hit Enter,
  829.   but remember that the default value isn't necessarily correct.
  830.  
  831.   Entering a question mark ("?") will produce a short descriptive
  832.   message describing that configuration option.
  833.  
  834.   Note also that all questions may not be asked. The configuration
  835.   program may disable some questions depending on the earlier choices.
  836.   It may also select some options automatically as well.
  837.  
  838.  
  839.  
  840.      Old configuration exists in /etc/soundconf. Use it [Y/n/?]
  841.         If you have previously compiled the kernel for sound support,
  842.         then the previous configuration can be saved. If you want to use
  843.         the previous setup, answer "y". If you are trying a different
  844.         configuration or have upgraded to a newer kernel, you should
  845.         answer "n" and go through the configuration process.
  846.  
  847.  
  848.      ProAudioSpectrum 16 support [Y/n/?]
  849.         Answer "y" only if you have a Pro Audio Spectrum 16, ProAudio
  850.         Studio 16 or Logitech SoundMan 16. Don't answer 'y' if you have
  851.         some other card made by Media Vision or Logitech since they are
  852.         not PAS16 compatible.
  853.  
  854.  
  855.      SoundBlaster support [Y/n/?]
  856.         Answer "y" if you have an original SoundBlaster card made by
  857.         Creative Labs or a 100% hardware compatible clone (like the
  858.         Thunderboard or SM Games). If your card was in the list of
  859.         supported cards look at the card specific instructions in the
  860.         Readme.cards file before answering this question. For an unknown
  861.         card you may answer "y'"if the card claims to be SoundBlaster
  862.         compatible.
  863.  
  864.  
  865.      Gravis Ultrasound support [Y/n/?]
  866.         Answer "y" if you have a GUS or GUS MAX. Answer "n" if you don't
  867.         have a GUS since the driver consumes a lot of memory.
  868.  
  869.  
  870.      MPU-401 support (NOT for SB16) [Y/n/?]
  871.         Be careful with this question. The MPU-401 interface is
  872.         supported by almost all sound cards. However, some natively
  873.         supported cards have their own driver for MPU-401. Enabling the
  874.         MPU-401 option with these cards will cause a conflict. Also
  875.         enabling MPU-401 on a system that doesn't really have a MPU-401
  876.         could cause some trouble. If your card was in the list of
  877.         supported cards, look at the card specific instructions in the
  878.         Readme.cards file. It's safe to answer "y" if you have a true
  879.         MPU-401 MIDI interface card.
  880.  
  881.  
  882.      6850 UART Midi support [Y/n/?]
  883.         It's safe to answer "n" to this question in all cases. The 6850
  884.         UART interface is very rarely used.
  885.  
  886.  
  887.      PSS (ECHO-ADI2111) support [Y/n/?]
  888.         Answer "y" only if you have Orchid SW32, Cardinal DSP16 or some
  889.         other card based on the PSS chipset (AD1848 codec + ADSP-2115
  890.         DSP chip + Echo ESC614 ASIC CHIP).
  891.  
  892.  
  893.      16 bit sampling option of GUS (not GUS MAX) [Y/n/?]
  894.         Answer "y" if you have installed the 16 bit sampling
  895.         daughtercard on your GUS. Answer "n" if you have a GUS MAX.
  896.         Enabling this option disables GUS MAX support.
  897.  
  898.  
  899.      GUS MAX support [Y/n/?]
  900.         Answer "y" only if you have a GUS MAX.
  901.  
  902.  
  903.      Microsoft Sound System support [Y/n/?]
  904.         Again think carefully before answering "y" to this question.
  905.         It's safe to answer "y" if you have the original Windows Sound
  906.         System card made by Microsoft or Aztech SG 16 Pro (or NX16 Pro).
  907.         Also you may answer "y" in case your card was not listed earlier
  908.         in this file. For cards having native support in VoxWare,
  909.         consult the card specific instructions in Readme.cards. Some
  910.         drivers have their own MSS support and enabling this option will
  911.         cause a conflict.
  912.  
  913.  
  914.      Ensoniq Soundscape support [Y/n/?]
  915.         Answer "y" if you have a sound card based on the Ensoniq
  916.         SoundScape chipset. Such cards are being manufactured at least
  917.         by Ensoniq, Spea and Reveal (Reveal makes other cards also).
  918.  
  919.  
  920.      MediaTriX AudioTriX Pro support [Y/n/?]
  921.         Answer "y" if you have the AudioTriX Pro.
  922.  
  923.  
  924.  
  925.      Support for MAD16 and/or Mozart based cards?
  926.         Answer "y" if your card has a Mozart (OAK OTI-601) or MAD16
  927.         (OPTi 82C928 or 82C929) audio interface chip. These chips are
  928.         currently quite common so it's possible that many no-name cards
  929.         have one of them. In addition the MAD16 chip is used in some
  930.         cards made by known manufacturers such as Turtle Beach (Tropez),
  931.         Reveal (some models) and Diamond (latest ones).
  932.  
  933.  
  934.      Support for Crystal CS4232 based (PnP) cards [Y/n/?]
  935.         Answer "y" if you have a card based on the Crystal CS4232 chip
  936.         set.
  937.  
  938.  
  939.      Support for Turtle Beach Wave Front (Maui, Tropez) synthesizers
  940.         [Y/n/?]"  Answer "y" if you have any of these cards.
  941.  
  942.  
  943.      SoundBlaster Pro support [Y/n/?]
  944.         Enable this option if your card is a SoundBlaster Pro or
  945.         SoundBlaster 16. Enable it also with any SoundBlaster Pro
  946.         clones. Answering "n" saves some memory but "y" is the safe
  947.         alternative.
  948.  
  949.  
  950.      SoundBlaster 16 support [Y/n/?]
  951.         Enable if you have a SoundBlaster 16 (including the AWE32).
  952.  
  953.  
  954.      Audio Excel DSP 16 initialization support [Y/n/?]
  955.         Enable this if you have an Audio Excel DSP16 card. See the file
  956.         Readme.aedsp16 for more information.
  957.  
  958.  
  959.   The configuration program then asks some questions about the higher
  960.   level services. It's recommended to answer "y" to each of these
  961.   questions. Answer "n" only if you know you will not need the option.
  962.  
  963.  
  964.  
  965.      /dev/dsp and /dev/audio support (usually required) [Y/n/?]
  966.         Answering "n" disables /dev/dsp and /dev/audio, the A/D and D/A
  967.         converter devices. Answer "y".
  968.  
  969.  
  970.      MIDI interface support [Y/n/?]
  971.         Answering "n" disables /dev/midixx devices and access to any
  972.         MIDI ports using /dev/sequencer and /dev/music. This option also
  973.         affects any MPU-401 and/or General MIDI compatible devices.
  974.  
  975.  
  976.      FM synthesizer (YM3812/OPL-3) support [Y/n/?]
  977.         Answer "y" here.
  978.  
  979.  
  980.      /dev/sequencer support [Y/n/?]
  981.         Answering "n" disables /dev/sequencer and /dev/music
  982.  
  983.  
  984.      Do you want support for the mixer of SG NX Pro ?
  985.         Answer "y" if you have a Sound Galaxy NX Pro sound card and want
  986.         support for its extended mixer functions.
  987.  
  988.  
  989.      Do you want support for the MV Jazz16 (ProSonic etc.) ?
  990.         Answer "y" if you have an MV Jazz16 sound card.
  991.      Do you have a Logitech SoundMan Games [Y/n/?]
  992.         Answer "y" if you have a Logitech SoundMan Games sound card.
  993.  
  994.  
  995.   After the above questions the configuration program prompts for the
  996.   card specific configuration information. Usually just a set of I/O
  997.   address, IRQ and DMA numbers are asked. With some cards the program
  998.   asks for some files to be used during initialization of the card.
  999.   These are used by cards which have a DSP chip or microprocessor which
  1000.   must be initialized by downloading a program (microcode) file to the
  1001.   card. In some cases this file is written to a .h file by the config
  1002.   program and then included to the driver during compile. Again, read
  1003.   the information in the file Readme.cards pertaining to your card type.
  1004.  
  1005.   At the end you will be prompted:
  1006.  
  1007.  
  1008.  
  1009.        The sound driver is now configured.
  1010.        Save copy of this configuration to /etc/soundconf [Y/n/?]
  1011.  
  1012.  
  1013.  
  1014.  
  1015.   Normally you would enter "y" so that if you later need to recompile
  1016.   the kernel you have the option of using the same sound driver
  1017.   configuration.
  1018.  
  1019.   If you are upgrading from an older sound driver, make sure that the
  1020.   files /usr/include/sys/soundcard.h and /usr/include/sys/ultrasound.h
  1021.   are symbolic links to the corresponding files in /usr/include/linux,
  1022.   or that they simply contain the lines #include <linux/soundcard.h> and
  1023.   #include <linux/ultrasound.h>, respectively.
  1024.  
  1025.   You are now ready to compile and install the new kernel.
  1026.  
  1027.  
  1028.   4.3.  Creating the Device Files
  1029.  
  1030.  
  1031.   For proper operation, device file entries must be created for the
  1032.   sound devices. These are normally created for you during installation
  1033.   of your Linux system. A quick check can be made using the command
  1034.   listed below. If the output is as shown (the date stamp will vary)
  1035.   then the device files are almost certainly okay.
  1036.  
  1037.  
  1038.  
  1039.        % ls -l /dev/sndstat
  1040.        crw-rw-rw-   1 root     root      14,   6 Apr 25  1995 /dev/sndstat
  1041.  
  1042.  
  1043.  
  1044.  
  1045.   Note that having the right device files there doesn't guarantee
  1046.   anything on its own. The kernel driver must also be loaded or compiled
  1047.   in before the devices will work (more on that later).
  1048.  
  1049.   In rare cases, if you believe the device files are wrong, you can
  1050.   recreate them using the short shell script from the end of the file
  1051.   Readme.linux in the directory /usr/src/linux/drivers/sound, running it
  1052.   as user root. Alternatively, most Linux distributions have a
  1053.   /dev/MAKEDEV script which can be used for this purpose.
  1054.  
  1055.   If you are using the PC speaker sound driver, read the documentation
  1056.   that came with the package to determine if any device files need to be
  1057.   created.
  1058.  
  1059.  
  1060.   4.4.  Booting Linux and Testing the Installation
  1061.  
  1062.  
  1063.   You should now be ready to boot the new kernel and test the sound
  1064.   drivers. Follow your usual procedure for installing and rebooting the
  1065.   new kernel (keep the old kernel around in case of problems, of
  1066.   course).
  1067.  
  1068.   During booting, check for a message such as the following on powerup
  1069.   (if they scroll by too quickly to read, you may be able to retrieve
  1070.   them with the dmesg command):
  1071.  
  1072.  
  1073.  
  1074.        Sound initialization started
  1075.        <Sound Blaster 16 (4.13)> at 0x220 irq 5 dma 1,5
  1076.        <Sound Blaster 16> at 0x330 irq 5 dma 0
  1077.        <Yamaha OPL3 FM> at 0x388
  1078.        Sound initialization complete
  1079.  
  1080.  
  1081.  
  1082.  
  1083.   This should match your sound card type and jumper settings (if any).
  1084.  
  1085.   Note that the above messages are not displayed when using loadable
  1086.   sound driver module (unless you enable it, e.g. using "insmod sound
  1087.   trace_init=1).
  1088.  
  1089.   When the sound driver is linked into the kernel, the "Sound
  1090.   initialization started" and "Sound initialization complete" messages
  1091.   should be displayed. If they are not printed, it means that there is
  1092.   no sound driver present in the kernel. In this case you should check
  1093.   that you actually installed the kernel you compiled when enabling the
  1094.   sound driver.
  1095.  
  1096.   If nothing is printed between the "Sound initialization started" and
  1097.   the "Sound initialization complete" lines, it means that no sound
  1098.   devices were detected. Most probably it means that you don't have the
  1099.   correct driver enabled, the card is not supported, the I/O port is bad
  1100.   or that you have a PnP card that has not been configured.
  1101.  
  1102.   The driver may also display some error messages and warnings during
  1103.   boot. Watch for these when booting the first time after configuring
  1104.   the sound driver.
  1105.  
  1106.   Next you should check the device file /dev/sndstat. Reading the sound
  1107.   driver status device file should provide additional information on
  1108.   whether the sound card driver initialized properly. Sample output
  1109.   should look something like this:
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.   % cat /dev/sndstat
  1124.   Sound Driver:3.5.4-960630 (Sat Jan 4 23:56:57 EST 1997 root,
  1125.   Linux fizzbin 2.0.27 #48 Thu Dec 5 18:24:45 EST 1996 i586)
  1126.   Kernel: Linux fizzbin 2.0.27 #48 Thu Dec 5 18:24:45 EST 1996 i586
  1127.   Config options: 0
  1128.  
  1129.   Installed drivers:
  1130.   Type 1: OPL-2/OPL-3 FM
  1131.   Type 2: Sound Blaster
  1132.   Type 7: SB MPU-401
  1133.  
  1134.   Card config:
  1135.   Sound Blaster at 0x220 irq 5 drq 1,5
  1136.   SB MPU-401 at 0x330 irq 5 drq 0
  1137.   OPL-2/OPL-3 FM at 0x388 drq 0
  1138.  
  1139.   Audio devices:
  1140.   0: Sound Blaster 16 (4.13)
  1141.  
  1142.   Synth devices:
  1143.   0: Yamaha OPL-3
  1144.  
  1145.   Midi devices:
  1146.   0: Sound Blaster 16
  1147.  
  1148.   Timers:
  1149.   0: System clock
  1150.  
  1151.   Mixers:
  1152.   0: Sound Blaster
  1153.  
  1154.  
  1155.  
  1156.  
  1157.   The command above can report some error messages. "No such file or
  1158.   directory" indicates that you need to create the device files (see
  1159.   section 4.3). "No such device" means that sound driver is not loaded
  1160.   or linked into kernel. Go back to section 4.2 to correct this.
  1161.  
  1162.   If lines in the "Card config:" section of /dev/sndstat are listed
  1163.   inside parentheses (such as "(SoundBlaster at 0x220 irq 5 drq 1,5)"),
  1164.   it means that this device was configured but not detected.
  1165.  
  1166.   Now you should be ready to play a simple sound file. Get hold of a
  1167.   sound sample file, and send it to the sound device as a basic check of
  1168.   sound output, e.g.
  1169.  
  1170.  
  1171.  
  1172.        % cat endoftheworld >/dev/dsp
  1173.        % cat crash.au >/dev/audio
  1174.  
  1175.  
  1176.  
  1177.  
  1178.   (Make sure you don't omit the ">" in the commands above).
  1179.  
  1180.   Note that, in general, using cat is not the proper way to play audio
  1181.   files, it's just a quick check. You'll want to get a proper sound
  1182.   player program (described later) that will do a better job.
  1183.  
  1184.   This command will work only if there is at least one device listed in
  1185.   the audio devices section of /dev/sndstat. If the audio devices
  1186.   section is empty you should check why the device was not detected.
  1187.  
  1188.  
  1189.   If the above commands return "I/O error", you should look at the end
  1190.   of the kernel messages listed using the "dmesg" command. It's likely
  1191.   that an error message is printed there. Very often the message is
  1192.   "Sound: DMA (output) timed out - IRQ/DRQ config error?". The above
  1193.   message means that the driver didn't get the expected interrupt from
  1194.   the sound card. In most cases it means that the IRQ or the DMA channel
  1195.   configured to the driver doesn't work. The best way to get it working
  1196.   is to try with all possible DMAs and IRQs supported by the device.
  1197.  
  1198.   Another possible reason is that the device is not compatible with the
  1199.   device the driver is configured for. This is almost certainly the case
  1200.   when a supposedly "SoundBlaster (Pro/16) compatible" sound card
  1201.   doesn't work with the SoundBlaster driver. In this case you should try
  1202.   to find out the device your sound card is compatible with (by posting
  1203.   to the comp.os.linux.hardware newsgroup, for example).
  1204.  
  1205.   Some sample sound files can be obtained from
  1206.   <ftp://tsx-11.mit.edu/pub/linux/packages/sound/snd-data-0.1.tar.Z>
  1207.  
  1208.   Now you can verify sound recording. If you have sound input
  1209.   capability, you can do a quick test of this using commands such as the
  1210.   following:
  1211.  
  1212.  
  1213.  
  1214.        # record 4 seconds of audio from microphone
  1215.        EDT% dd bs=8k count=4 </dev/audio >sample.au
  1216.        4+0 records in
  1217.        4+0 records out
  1218.        # play back sound
  1219.        % cat sample.au >/dev/audio
  1220.  
  1221.  
  1222.  
  1223.  
  1224.   Obviously for this to work you need a microphone connected to the
  1225.   sound card and you should speak into it. You may also need to obtain a
  1226.   mixer program to set the microphone as the input device and adjust the
  1227.   recording gain level.
  1228.  
  1229.   If these tests pass, you can be reasonably confident that the sound
  1230.   D/A and A/D hardware and software are working. If you experience
  1231.   problems, refer to the next section of this document.
  1232.  
  1233.  
  1234.   4.5.  Troubleshooting
  1235.  
  1236.  
  1237.   If you still encounter problems after following the instructions in
  1238.   the HOWTO, here are some things to check. The checks are listed in
  1239.   increasing order of complexity. If a check fails, solve the problem
  1240.   before moving to the next stage.
  1241.  
  1242.  
  1243.   4.5.1.  Step 1: Make sure you are really running the kernel you com-
  1244.   piled.
  1245.  
  1246.  
  1247.   You can check the date stamp on the kernel to see if you are running
  1248.   the one that you compiled with sound support. You can do this with the
  1249.   uname command:
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.   % uname -a
  1256.   Linux fizzbin 2.0.0 #1 Tue Jun 4 16:57:55 EDT 1996 i386
  1257.  
  1258.  
  1259.  
  1260.  
  1261.   or by displaying the file /proc/version:
  1262.  
  1263.  
  1264.  
  1265.        % cat /proc/version
  1266.        Linux version 2.0.0 (root@fizzbin) (gcc version 2.7.0) #1 Tue Jun 4 16:57:55 EDT 1996
  1267.  
  1268.  
  1269.  
  1270.  
  1271.   If the date stamp doesn't seem to match when you compiled the kernel,
  1272.   then you are running an old kernel. Did you really reboot? If you use
  1273.   LILO, did you re-install it (typically by running /etc/lilo/install)?
  1274.   If booting from floppy, did you create a new boot floppy and use it
  1275.   when booting?
  1276.  
  1277.  
  1278.   4.5.2.  Step 2: Make sure the kernel sound drivers are compiled in.
  1279.  
  1280.  
  1281.   The easiest way to do this is to check the output of "dev/sndstat" as
  1282.   described earlier. If the output is not as expected then something
  1283.   went wrong with the kernel configuration or build. Start the
  1284.   installation process again, beginning with configuration and building
  1285.   of the kernel.
  1286.  
  1287.  
  1288.   4.5.3.  Step 3: Did the kernel detect your sound card during booting?
  1289.  
  1290.  
  1291.   Make sure that the sound card was detected when the kernel booted. You
  1292.   should have seen a message on bootup. If the messages scrolled off the
  1293.   screen, you can usually recall them using the dmesg command:
  1294.  
  1295.  
  1296.  
  1297.        % dmesg
  1298.  
  1299.  
  1300.  
  1301.  
  1302.   or
  1303.  
  1304.  
  1305.  
  1306.        % tail /var/adm/messages
  1307.  
  1308.  
  1309.  
  1310.  
  1311.   If your sound card was not found then something is wrong. Make sure it
  1312.   really is installed. If the sound card works under DOS then you can be
  1313.   reasonably confident that the hardware is working, so it is likely a
  1314.   problem with the kernel configuration. Either you configured your
  1315.   sound card as the wrong type or wrong parameters, or your sound card
  1316.   is not compatible with any of the Linux kernel sound card drivers.
  1317.  
  1318.   One possibility is that your sound card is one of the "compatible"
  1319.   type that requires initialization by the DOS driver. Try booting DOS
  1320.   and loading the vendor supplied sound card driver. Then soft boot
  1321.   Linux using Control-Alt-Delete. Make sure that card I/O address, DMA,
  1322.   and IRQ settings for Linux are the same as used under DOS. Read the
  1323.   Readme.cards file from the sound driver source distribution for hints
  1324.   on configuring your card type.
  1325.  
  1326.   If your sound card is not listed in this document, it is possible that
  1327.   the Linux drivers do not support it. You can check with some of the
  1328.   references listed at the end of this document for assistance.
  1329.  
  1330.  
  1331.   4.5.4.  Step 4: Can you read data from the dsp device?
  1332.  
  1333.  
  1334.   Try reading from the /dev/audio device using the dd command listed
  1335.   earlier in this document. The command should run without errors.
  1336.  
  1337.   If it doesn't work, then chances are that the problem is an IRQ or DMA
  1338.   conflict or some kind of hardware incompatibility (the device is not
  1339.   supported by Linux or the driver is configured for a wrong device).
  1340.  
  1341.   A remote possibility is broken hardware. Try testing the sound card
  1342.   under DOS, if possible, to eliminate that as a possibility.
  1343.  
  1344.  
  1345.   4.5.5.  When All Else Fails
  1346.  
  1347.  
  1348.   If you still have problems, here are some final suggestions for things
  1349.   to try:
  1350.  
  1351.  
  1352.   o  carefully re-read this HOWTO document
  1353.  
  1354.   o  read the references listed at the end of this document, especially
  1355.      Hannu Savolainen's web pages and the relevant kernel source Readme
  1356.      files
  1357.  
  1358.   o  post a question to one of the comp.os.linux or other Usenet
  1359.      newsgroups (comp.os.linux.hardware is a good choice; because of the
  1360.      high level of traffic in these groups it helps to put the string
  1361.      "sound" in the subject header for the article so the right experts
  1362.      will see it)
  1363.  
  1364.   o  Using a Web/Usenet search engine with an intelligently selected
  1365.      search criteria can give very good results quickly. One such choice
  1366.      is <http://www.altavista.digital.com>
  1367.  
  1368.   o  try using the latest Linux kernel (but only as a last resort, the
  1369.      latest development kernels can be unstable)
  1370.  
  1371.   o  send mail to the author of the sound driver
  1372.  
  1373.   o  send mail to the author of the Sound HOWTO
  1374.  
  1375.   o  fire up emacs and type Esc-x doctor :-)
  1376.  
  1377.  
  1378.   5.  Applications Supporting Sound
  1379.  
  1380.  
  1381.   I give here a sample of the types of applications that you likely want
  1382.   if you have a sound card under Linux. You can check the Linux Software
  1383.   Map, Internet archive sites, and/or files on your Linux CD-ROM for
  1384.   more up to date information.
  1385.  
  1386.  
  1387.   As a minimum, you will likely want to obtain the following sound
  1388.   applications:
  1389.  
  1390.  
  1391.   o  audio file format conversion utility (e.g. Sox)
  1392.  
  1393.   o  mixer utility (e.g. aumix or xmix)
  1394.  
  1395.   o  digitized file player/recorder (e.g. play or wavplay)
  1396.  
  1397.   o  MOD file player (e.g. tracker)
  1398.  
  1399.   o  MIDI file player (e.g. playmidi)
  1400.  
  1401.   There are text-based as well as GUI-based versions of most of these
  1402.   tools. There are also some more esoteric applications (e.g. speech
  1403.   synthesis and recognition) that you may wish to try.
  1404.  
  1405.  
  1406.   6.  Answers To Frequently Asked Questions
  1407.  
  1408.  
  1409.   This section answers some of the questions that have been commonly
  1410.   asked on the Usenet news groups and mailing lists.
  1411.  
  1412.   Answers to more questions can also be found at the OSS sound driver
  1413.   web page.
  1414.  
  1415.  
  1416.   6.1.  What are the various sound device files?
  1417.  
  1418.  
  1419.   These are the most "standard" device file names, some Linux
  1420.   distributions may use slightly different names.
  1421.  
  1422.  
  1423.      /dev/audio
  1424.         normally a link to /dev/audio0
  1425.  
  1426.      /dev/audio0
  1427.         Sun workstation compatible audio device (only a partial
  1428.         implementation, does not support Sun ioctl interface, just u-law
  1429.         encoding)
  1430.  
  1431.      /dev/audio1
  1432.         second audio device (if supported by sound card or if more than
  1433.         one sound card installed)
  1434.  
  1435.      /dev/dsp
  1436.         normally a link to /dev/dsp0
  1437.  
  1438.      /dev/dsp0
  1439.         first digital sampling device
  1440.  
  1441.      /dev/dsp1
  1442.         second digital sampling device
  1443.  
  1444.      /dev/mixer
  1445.         normally a link to /dev/mixer0
  1446.  
  1447.      /dev/mixer0
  1448.         first sound mixer
  1449.  
  1450.      /dev/mixer1
  1451.         second sound mixer
  1452.  
  1453.      /dev/music
  1454.         high-level sequencer interface
  1455.  
  1456.      /dev/sequencer
  1457.         low level MIDI, FM, and GUS access
  1458.  
  1459.      /dev/sequencer2
  1460.         normally a link to /dev/music
  1461.  
  1462.      /dev/midi00
  1463.         1st raw MIDI port
  1464.  
  1465.      /dev/midi01
  1466.         2nd raw MIDI port
  1467.  
  1468.      /dev/midi02
  1469.         3rd raw MIDI port
  1470.  
  1471.      /dev/midi03
  1472.         4th raw MIDI port
  1473.  
  1474.      /dev/sndstat
  1475.         displays sound driver status when read
  1476.  
  1477.   The PC speaker driver provides the following devices:
  1478.  
  1479.  
  1480.      /dev/pcaudio
  1481.         equivalent to /dev/audio
  1482.  
  1483.      /dev/pcsp
  1484.         equivalent to /dev/dsp
  1485.  
  1486.      /dev/pcmixer
  1487.         equivalent to /dev/mixer
  1488.  
  1489.  
  1490.   6.2.  How can I play a sound sample?
  1491.  
  1492.  
  1493.   Sun workstation (.au) sound files can be played by sending them to the
  1494.   /dev/audio device. Raw samples can be sent to /dev/dsp. This will
  1495.   generally give poor results though, and using a program such as play
  1496.   is preferable, as it will recognize most file types and set the sound
  1497.   card to the correct sampling rate, etc.
  1498.  
  1499.   Programs like wavplay or vplay (in the snd-util package) will give
  1500.   best results with WAV files. However they don't recognize Microsoft
  1501.   ADPCM compressed WAV files. Also older versions of play (from the Lsox
  1502.   package) doesn't work well with 16 bit WAV files.
  1503.  
  1504.   The splay command included in the snd-util package can be used to play
  1505.   most sound files if proper parameters are entered manually in the
  1506.   command line.
  1507.  
  1508.  
  1509.   6.3.  How can I record a sample?
  1510.  
  1511.  
  1512.   Reading /dev/audio or /dev/dsp will return sampled data that can be
  1513.   redirected to a file. A program such as vrec makes it easier to
  1514.   control the sampling rate, duration, etc. You may also need a mixer
  1515.   program to select the appropriate input device.
  1516.  
  1517.  
  1518.  
  1519.   6.4.  Can I have more than one sound card?
  1520.  
  1521.  
  1522.   With the current sound driver it's possible to have several
  1523.   SoundBlaster, SoundBlaster/Pro, SoundBlaster16, MPU-401 or MSS cards
  1524.   at the same time on the system. Installing two SoundBlasters is
  1525.   possible but requires defining the macros SB2_BASE, SB2_IRQ, SB2_DMA
  1526.   and (in some cases) SB2_DMA2 by editing local.h manually. It's also
  1527.   possible to have a SoundBlaster at the same time as a PAS16.
  1528.  
  1529.   With the newer 2.0.x kernels that configure sound using make config,
  1530.   instead of local.h, you need to edit the file
  1531.   /usr/include/linux/autoconf.h.  After the section containing the
  1532.   lines:
  1533.  
  1534.  
  1535.  
  1536.        #define SBC_BASE 0x220
  1537.        #define SBC_IRQ (5)
  1538.        #define SBC_DMA (1)
  1539.        #define SB_DMA2 (5)
  1540.        #define SB_MPU_BASE 0x0
  1541.        #define SB_MPU_IRQ (-1)
  1542.  
  1543.  
  1544.  
  1545.  
  1546.   add these lines (with values appropriate for your system):
  1547.  
  1548.  
  1549.  
  1550.        #define SB2_BASE 0x330
  1551.        #define SB2_IRQ (7)
  1552.        #define SB2_DMA (2)
  1553.        #define SB2_DMA2 (2)
  1554.  
  1555.  
  1556.  
  1557.  
  1558.   The following drivers don't permit multiple instances:
  1559.  
  1560.  
  1561.   o  GUS (driver limitation)
  1562.  
  1563.   o  MAD16 (hardware limitation)
  1564.  
  1565.   o  AudioTrix Pro (hardware limitation)
  1566.  
  1567.   o  CS4232 (hardware limitation)
  1568.  
  1569.  
  1570.   6.5.  Error: No such file or directory for sound devices
  1571.  
  1572.  
  1573.   You need to create the sound driver device files. See the section on
  1574.   creating device files. If you do have the device files, ensure that
  1575.   they have the correct major and minor device numbers (some older CD-
  1576.   ROM distributions of Linux may not create the correct device files
  1577.   during installation).
  1578.  
  1579.  
  1580.   6.6.  Error: No such device for sound devices
  1581.  
  1582.  
  1583.   You have not booted with a kernel containing the sound driver or the
  1584.   I/O address configuration doesn't match your hardware. Check that you
  1585.   are running the newly compiled kernel and verify that the settings
  1586.   entered when configuring the sound driver match your hardware setup.
  1587.  
  1588.  
  1589.   6.7.  Error: No space left on device for sound devices
  1590.  
  1591.  
  1592.   This can happen if you tried to record data to /dev/audio or /dev/dsp
  1593.   without creating the necessary device file. The sound device is now a
  1594.   regular file, and has filled up your disk partition. You need to run
  1595.   the script described in the Creating the Device Files section of this
  1596.   document.
  1597.  
  1598.   This may also happen with Linux 2.0 and later if there is not enough
  1599.   free RAM on the system when the device is opened. The audio driver
  1600.   requires at least two pages (8k) of contiguous physical RAM for each
  1601.   DMA channel. This happens sometimes in machines with less than 16M of
  1602.   RAM or which have been running for very long time. It may be possible
  1603.   to free some RAM by compiling and running the following C program
  1604.   before trying to open the device again:
  1605.  
  1606.  
  1607.  
  1608.        main() {
  1609.          int i;
  1610.          char mem[500000];
  1611.          for (i = 0; i < 500000; i++)
  1612.            mem[i] = 0;
  1613.          exit(0);
  1614.        }
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.   6.8.  Error: Device busy for sound devices
  1621.  
  1622.  
  1623.   Only one process can open a given sound device at one time. Most
  1624.   likely some other process is using the device in question. One way to
  1625.   determine this is to use the fuser command:
  1626.  
  1627.  
  1628.  
  1629.        % fuser -v /dev/dsp
  1630.        /dev/dsp:             USER       PID ACCESS COMMAND
  1631.                              tranter    265 f....  tracker
  1632.  
  1633.  
  1634.  
  1635.  
  1636.   In the above example, the fuser command showed that process 265 had
  1637.   the device open. Waiting for the process to complete or killing it
  1638.   will allow the sound device to be accessed once again. You should run
  1639.   the fuser command as root in order to report usage by users other than
  1640.   yourself.
  1641.  
  1642.  
  1643.   6.9.  I still get device busy errors!
  1644.  
  1645.  
  1646.   According to Brian Gough, for the SoundBlaster cards which use DMA
  1647.   channel 1 there is a potential conflict with the QIC-02 tape driver,
  1648.   which also uses DMA 1, causing "device busy" errors. If you are using
  1649.   FTAPE, you may have this driver enabled. According to the FTAPE-HOWTO
  1650.   the QIC-02 driver is not essential for the use of FTAPE; only the
  1651.   QIC-117 driver is required. Reconfiguring the kernel to use QIC-117
  1652.   but not QIC-02 allows FTAPE and the sound-driver to coexist.
  1653.  
  1654.  
  1655.   6.10.  Partial playback of digitized sound file
  1656.  
  1657.  
  1658.   The symptom is usually that a sound sample plays for about a second
  1659.   and then stops completely or reports an error message about "missing
  1660.   IRQ" or "DMA timeout". Most likely you have incorrect IRQ or DMA
  1661.   channel settings. Verify that the kernel configuration matches the
  1662.   sound card jumper settings and that they do not conflict with some
  1663.   other card.
  1664.  
  1665.   Another symptom is sound samples that "loop". This is usually caused
  1666.   by an IRQ conflict.
  1667.  
  1668.  
  1669.   6.11.  There are pauses when playing MOD files
  1670.  
  1671.  
  1672.   Playing MOD files requires considerable CPU power. You may have too
  1673.   many processes running or your computer may be too slow to play in
  1674.   real time. Your options are to:
  1675.  
  1676.  
  1677.   o  try playing with a lower sampling rate or in mono mode
  1678.  
  1679.   o  eliminate other processes
  1680.  
  1681.   o  buy a faster computer
  1682.  
  1683.   o  buy a more powerful sound card (e.g. Gravis UltraSound)
  1684.  
  1685.   If you have a Gravis UltraSound card, you should use one of the mod
  1686.   file players written specifically for the GUS (e.g. gmod).
  1687.  
  1688.  
  1689.   6.12.  Compile errors when compiling sound applications
  1690.  
  1691.  
  1692.   The version 1.0c and earlier sound driver used a different and
  1693.   incompatible ioctl() scheme. Obtain newer source code or make the
  1694.   necessary changes to adapt it to the new sound driver. See the sound
  1695.   driver Readme file for details.
  1696.  
  1697.   Also ensure that you have used the latest version of soundcard.h and
  1698.   ultrasound.h when compiling the application. See the installation
  1699.   instructions at beginning of this text.
  1700.  
  1701.  
  1702.   6.13.  SEGV when running sound binaries that worked previously
  1703.  
  1704.  
  1705.   This is probably the same problem described in the previous question.
  1706.  
  1707.  
  1708.   6.14.  What known bugs or limitations are there in the sound driver?
  1709.  
  1710.  
  1711.   See the Readme and CHANGELOG files included with the sound driver
  1712.   kernel source.
  1713.  
  1714.  
  1715.  
  1716.  
  1717.   6.15.  Where are the sound driver ioctls() etc. documented?
  1718.  
  1719.  
  1720.   These are partially documented in the Hacker's Guide to VoxWare,
  1721.   currently available in draft form. The latest version is draft 2, and
  1722.   can be found on  <ftp://nic.funet.fi/pub/Linux/ALPHA/sound/>. Note
  1723.   that this directory is "hidden" and will not appear in directory
  1724.   listings. If you "cd" to the directory and use the FTP "dir" command,
  1725.   the files are there.
  1726.  
  1727.   At time of writing new documentation was becoming available on the
  1728.   4Front Technologies Web site.
  1729.  
  1730.   Another source of information is the Linux Multimedia Guide, described
  1731.   in the references section.
  1732.  
  1733.  
  1734.   6.16.  What CPU resources are needed to play or record without pauses?
  1735.  
  1736.  
  1737.   There is no easy answer to this question, as it depends on:
  1738.  
  1739.  
  1740.   o  whether using PCM sampling or FM synthesis
  1741.  
  1742.   o  sampling rate and sample size
  1743.  
  1744.   o  which application is used to play or record
  1745.  
  1746.   o  Sound Card hardware
  1747.  
  1748.   o  disk I/O rate, CPU clock speed, cache size, etc.
  1749.  
  1750.   In general, any 386 machine should be able to play samples or FM
  1751.   synthesized music on an 8 bit sound card with ease.
  1752.  
  1753.   Playing MOD files, however, requires considerable CPU resources. Some
  1754.   experimental measurements have shown that playing at 44kHz requires
  1755.   more than 40% of the speed of a 486/50 and a 386/25 can hardly play
  1756.   faster than 22 kHz (these are with an 8 bit card sound such as a
  1757.   SoundBlaster). A card such as the Gravis UltraSound card performs more
  1758.   functions in hardware, and will require less CPU resources.
  1759.  
  1760.   These statements assume the computer is not performing any other CPU
  1761.   intensive tasks.
  1762.  
  1763.   Converting sound files or adding effects using a utility such as sox
  1764.   is also much faster if you have a math coprocessor (or CPU with on
  1765.   board FPU). The kernel driver itself does not do any floating point
  1766.   calculations, though.
  1767.  
  1768.  
  1769.   6.17.  Problems with a PAS16 and an Adaptec 1542 SCSI host adaptor
  1770.  
  1771.  
  1772.   (the following explanation was supplied by seeker@indirect.com)
  1773.  
  1774.   Linux only recognizes the 1542 at address 330 (default) or 334, and
  1775.   the PAS only allows the MPU-401 emulation at 330. Even when you
  1776.   disable the MPU-401 under software, something still wants to conflict
  1777.   with the 1542 if it's at its preferred default address. Moving the
  1778.   1542 to 334 makes everyone happy.
  1779.  
  1780.  
  1781.   Additionally, both the 1542 and the PAS-16 do 16-bit DMA, so if you
  1782.   sample at 16-bit 44 KHz stereo and save the file to a SCSI drive hung
  1783.   on the 1542, you're about to have trouble. The DMAs overlap and there
  1784.   isn't enough time for RAM refresh, so you get the dread ``PARITY ERROR
  1785.   - SYSTEM HALTED'' message, with no clue to what caused it. It's made
  1786.   worse because a few second-party vendors with QIC-117 tape drives
  1787.   recommend setting the bus on/off times such that the 1542 is on even
  1788.   longer than normal. Get the SCSISEL.EXE program from Adaptec's BBS or
  1789.   several places on the internet, and reduce the BUS ON time or increase
  1790.   the BUS OFF time until the problem goes away, then move it one notch
  1791.   or more further. SCSISEL changes the EEPROM settings, so it's more
  1792.   permanent than a patch to the DOS driver line in CONFIG.SYS, and will
  1793.   work if you boot right into Linux (unlike the DOS patch). Next problem
  1794.   solved.
  1795.  
  1796.  
  1797.   Last problem - the older Symphony chipsets drastically reduced the
  1798.   timing of the I/O cycles to speed up bus accesses. None of various
  1799.   boards I've played with had any problem with the reduced timing except
  1800.   for the PAS-16. Media Vision's BBS has SYMPFIX.EXE that's supposed to
  1801.   cure the problem by twiddling a diagnostic bit in Symphony's bus
  1802.   controller, but it's not a hard guarantee. You may need to:
  1803.  
  1804.  
  1805.   o  get the motherboard distributor to replace the older version bus
  1806.      chip,
  1807.  
  1808.   o  replace the motherboard, or
  1809.  
  1810.   o  buy a different brand of sound card.
  1811.  
  1812.   Young Microsystems will upgrade the boards they import for around $30
  1813.   (US); other vendors may be similar if you can figure out who made or
  1814.   imported the motherboard (good luck). The problem is in ProAudio's bus
  1815.   interface chip as far as I'm concerned; nobody buys a $120 sound card
  1816.   and sticks it in a 6MHz AT. Most of them wind up in 25-40MHz 386/486
  1817.   boxes, and should be able to handle at least 12MHz bus rates if the
  1818.   chips are designed right. Exit soapbox (stage left).
  1819.  
  1820.  
  1821.   The first problem depends on the chipset used on your motherboard,
  1822.   what bus speed and other BIOS settings, and the phase of the moon.
  1823.   The second problem depends on your refresh option setting (hidden or
  1824.   synchronous), the 1542 DMA rate and (possibly) the bus I/O rate. The
  1825.   third can be determined by calling Media Vision and asking which
  1826.   flavor of Symphony chip is incompatible with their slow design. Be
  1827.   warned, though - 3 of 4 techs I talked to were brain damaged. I would
  1828.   be very leery of trusting anything they said about someone else's
  1829.   hardware, since they didn't even know their own very well.
  1830.  
  1831.  
  1832.  
  1833.   6.18.  Is it possible to read and write samples simultaneously?
  1834.  
  1835.  
  1836.   Due to hardware limitations, this is not possible with most sound
  1837.   cards. Some newer cards do support it. See the section on
  1838.   "bidirectional mode" in the Hacker's Guide to Voxware for more
  1839.   information.
  1840.  
  1841.  
  1842.   6.19.  My SB16 is set to IRQ 2, but configure does not allow this
  1843.   value.
  1844.  
  1845.  
  1846.   On '286 and later machines, the IRQ 2 interrupt is cascaded to the
  1847.   second interrupt controller. It is equivalent to IRQ 9.
  1848.  
  1849.   6.20.  Are the SoundBlaster AWE32 or SoundBlaster16 ASP supported?
  1850.  
  1851.  
  1852.   In the past, Creative Labs was not willing to release programming
  1853.   information for these cards. They have since changed their policy and
  1854.   an AWE driver is now included in the Linux 2.1.x kernels.
  1855.  
  1856.  
  1857.   6.21.  If I run Linux, then boot DOS, I get errors and/or sound appli-
  1858.   cations do not work properly.
  1859.  
  1860.  
  1861.   This happens after a soft reboot to DOS. Sometimes the error message
  1862.   misleadingly refers to a bad CONFIG.SYS file.
  1863.  
  1864.   Most of the current sound cards have software programmable IRQ and DMA
  1865.   settings. If you use different settings between Linux and MS-
  1866.   DOS/Windows, this may cause problems. Some sound cards don't accept
  1867.   new parameters without a complete reset (i.e. cycle the power or use
  1868.   the hardware reset button).
  1869.  
  1870.   The quick solution to this problem it to perform a full reboot using
  1871.   the reset button or power cycle rather than a soft reboot (e.g. Ctrl-
  1872.   Alt-Del).
  1873.  
  1874.   The correct solution is to ensure that you use the same IRQ and DMA
  1875.   settings with MS-DOS and Linux (or not to use DOS :-).
  1876.  
  1877.  
  1878.   6.22.  Problems running DOOM under Linux
  1879.  
  1880.  
  1881.   Users of the port of ID software's game DOOM for Linux may be
  1882.   interested in these notes.
  1883.  
  1884.   For correct sound output you need version 2.90 or later of the sound
  1885.   driver; it has support for the real-time "DOOM mode".
  1886.  
  1887.   The sound samples are 16-bit. If you have an 8-bit sound card you can
  1888.   still get sound to work using one of several programs available in
  1889.   <ftp://sunsite.unc.edu/pub/Linux/games/doom>.
  1890.  
  1891.   If performance of DOOM is poor on your system, disabling sound (by
  1892.   renaming the file sndserver) may improve it.
  1893.  
  1894.   By default DOOM does not support music (as in the DOS version). The
  1895.   program musserver will add support for music to DOOM under Linux. It
  1896.   can be found at  <ftp://pandora.st.hmc.edu/pub/linux/musserver.tgz>.
  1897.  
  1898.  
  1899.   6.23.  How can I reduce noise picked up by my sound card?
  1900.  
  1901.  
  1902.   Using good quality shielded cables and trying the sound card in
  1903.   different slots may help reduce noise. If the sound card has a volume
  1904.   control, you can try different settings (maximum is probably best).
  1905.  
  1906.   Using a mixer program you can make sure that undesired inputs (e.g.
  1907.   microphone) are set to zero gain.
  1908.  
  1909.   Some sound cards are simply not designed with good shielding and
  1910.   grounding and are prone to noise pickup.
  1911.  
  1912.   Finally, on my system I found that the kernel command line option no-
  1913.   hlt reduces the noise level. This tells the kernel not to use the halt
  1914.   instruction when running the idle process loop. You can try this
  1915.   manually when booting, or set it up using the command append="no-hlt"
  1916.   in your LILO configuration file.
  1917.  
  1918.  
  1919.   6.24.  I can play sounds, but not record.
  1920.  
  1921.  
  1922.   If you can play sound but not record, try these steps:
  1923.  
  1924.  
  1925.   o  use a mixer program to select the appropriate device (e.g.
  1926.      microphone)
  1927.  
  1928.   o  use the mixer to set the input gains to maximum
  1929.  
  1930.   o  If you can, try to test sound card recording under MS-DOS to
  1931.      determine if there is a hardware problem
  1932.  
  1933.   Sometimes a different DMA channel is used for recording than for
  1934.   playback. In this case the most probable reason is that the recording
  1935.   DMA is set up incorrectly.
  1936.  
  1937.  
  1938.   6.25.  My "compatible" sound card only works if I first initialize
  1939.   under MS-DOS.
  1940.  
  1941.  
  1942.   In most cases a "SoundBlaster compatible" card will work better under
  1943.   Linux if configured with a driver other than the SoundBlaster one.
  1944.   Most sound cards claim to be compatible (e.g. "16 bit SB Pro
  1945.   compatible" or "SB compatible 16 bit") but usually this SoundBlaster
  1946.   mode is just a "hack" provided for DOS games compatibility. Most cards
  1947.   have a 16 bit native mode which is likely to be supported by recent
  1948.   Linux versions (2.0.1 and later).
  1949.  
  1950.   Only with some (usually rather old) cards is it necessary to try to
  1951.   get them to work in the SoundBlaster mode. The only newer cards that
  1952.   are the exception to this rule are the Mwave-based cards.
  1953.  
  1954.  
  1955.   6.26.  My 16-bit SoundBlaster "compatible" sound card only works in
  1956.   8-bit mode under Linux.
  1957.  
  1958.  
  1959.   16-bit sound cards described as SoundBlaster compatible are really
  1960.   only compatible with the 8-bit SoundBlaster Pro. They typically have a
  1961.   16-bit mode which is not compatible with the SoundBlaster 16 and not
  1962.   compatible with the Linux sound driver.
  1963.  
  1964.   You may be able to get the card to work in 16-bit mode by using the
  1965.   MAD16 or MSS/WSS driver.
  1966.  
  1967.  
  1968.   6.27.  Where can I find sound applications for Linux?
  1969.  
  1970.  
  1971.   Here are some good archive sites to search for Linux specific sound
  1972.   applications:
  1973.  
  1974.  
  1975.   o  <ftp://sunsite.unc.edu:/pub/Linux/kernel/sound/>
  1976.  
  1977.   o  <ftp://sunsite.unc.edu:/pub/Linux/apps/sound/>
  1978.  
  1979.   o  <ftp://tsx-11.mit.edu:/pub/linux/packages/sound/>
  1980.  
  1981.   o  <ftp://nic.funet.fi:/pub/Linux/util/sound/>
  1982.  
  1983.   o  <ftp://nic.funet.fi:/pub/Linux/xtra/snd-kit/>
  1984.  
  1985.   o  <ftp://nic.funet.fi:/pub/Linux/ALPHA/sound/>
  1986.  
  1987.  
  1988.   6.28.  Can the sound driver be compiled as a loadable module?
  1989.  
  1990.  
  1991.   With recent kernels the sound driver is supported as a kernel loadable
  1992.   module.
  1993.  
  1994.   See the files /usr/src/linux/drivers/sound/Readme.modules and
  1995.   /usr/src/linux/Documentation/modules.txt (or /usr/src/linux/README)
  1996.   for details.
  1997.  
  1998.  
  1999.   6.29.  Can I use a sound card to replace the system console beep?
  2000.  
  2001.  
  2002.   Try the oplbeep program, found at
  2003.   <ftp://sunsite.unc.edu/pub/Linux/apps/sound/oplbeep-alpha.tar.gz>
  2004.  
  2005.   Another variant is the beep program found at
  2006.   <ftp://sunsite.unc.edu/pub/Linux/kernel/patches/misc/modreq_beep.tgz>
  2007.  
  2008.   The modutils package has an example program and kernel patch that
  2009.   supports calling an arbitrary external program to generate sounds when
  2010.   requested by the kernel.
  2011.  
  2012.   Alternatively, with some sound cards you can connect the PC speaker
  2013.   output to the sound card so that all sounds come from the sound card
  2014.   speakers.
  2015.  
  2016.  
  2017.   6.30.  What is VoxWare?
  2018.  
  2019.  
  2020.   The kernel sound drivers support several different Intel-based Unix
  2021.   compatible operating systems, and can be obtained as a package
  2022.   separate from the Linux kernel. Up until February 1996 the author had
  2023.   called the software "VoxWare". Unfortunately this name has been
  2024.   registered by VoxWare Incorporated, and can not be used. The new name
  2025.   of the driver is OSS/Free.
  2026.  
  2027.   The Open Sound System (OSS) is a commercially available kernel sound
  2028.   driver for various Unix systems, sold by 4Front Technologies. The free
  2029.   version, known as OSS/Free will continue to be made freely available
  2030.   for Linux systems.
  2031.  
  2032.   Other names you may come across that have been used in the past to
  2033.   refer to the same sound driver are TASD (Temporarily Anonymous Sound
  2034.   Driver) and USS (Unix Sound System).
  2035.  
  2036.   For more information see the 4Front Technologies Web page at
  2037.   <http://www.4front-tech.com/>. I wrote a review of OSS/Linux in the
  2038.   June 1997 issue of Linux Journal.
  2039.  
  2040.  
  2041.   6.31.  Are Plug and Play sound card supported?
  2042.  
  2043.  
  2044.   Full Plug and Play support should be coming in Linux version 2.1. In
  2045.   the mean time there are a number of workarounds for getting Plug and
  2046.   Play sound cards to work.
  2047.   If you have a newer Pentium system with a Plug and Play BIOS, it
  2048.   should take care of configuring the cards for you. Make sure that you
  2049.   configure the Linux sound driver to use the same I/O address, IRQ, and
  2050.   DMA channel parameters as the BIOS.
  2051.  
  2052.   There is a package of Plug and Play tools for Linux that can be used
  2053.   to set up the card. It can be found at Red Hat's Web site
  2054.   <http://www.redhat.com/> (it may also be included in your Linux
  2055.   distribution).
  2056.  
  2057.   If you use the card under Windows95, you can use the device manager to
  2058.   set up the card, then soft boot into Linux using the LOADLIN program.
  2059.   Make sure Windows95 and Linux use the same card setup parameters.
  2060.  
  2061.   If you use the card under DOS, you can use the icu utility that comes
  2062.   with SoundBlaster16 PnP cards to configure it under DOS, then soft
  2063.   boot into Linux using the LOADLIN program. Again, make sure DOS and
  2064.   Linux use the same card setup parameters.
  2065.  
  2066.   The commercial OSS sound driver has support for the SoundBlaster16 PnP
  2067.   sound card. You can purchase this driver from 4Front Technologies.
  2068.  
  2069.  
  2070.   6.32.  Sox/Play/Vplay reports "invalid block size 1024"
  2071.  
  2072.  
  2073.   A change to the sound driver in version 1.3.67 broke some sound player
  2074.   programs which (incorrectly) checked that the result from the
  2075.   SNDCTL_DSP_GETBLKSIZE ioctl was greater than 4096. The utilities
  2076.   included in the latest snd-util-3.x.tar.gz package (at
  2077.   <ftp://ftp.4front-tech.com/ossfree>.) now handle this properly. The
  2078.   latest sound driver versions have also been fixed to avoid allocating
  2079.   fragments shorter than 4096 bytes which solves this problem with old
  2080.   utilities.
  2081.  
  2082.  
  2083.   6.33.  Why does the sound driver have its own configuration program?
  2084.  
  2085.  
  2086.   The sound driver supports many different configuration parameters.
  2087.   The configure program included with the sound driver checks for many
  2088.   dependencies between parameters. The tools used to configure the
  2089.   kernel don't support this level of functionality.
  2090.  
  2091.   That said, the latest kernels do optionally allow using the standard
  2092.   kernel configuration tools with the sound driver (see the earlier
  2093.   section on "Configuring the Kernel".
  2094.  
  2095.  
  2096.   6.34.  The mixer settings are reset whenever I load the sound driver
  2097.   module
  2098.  
  2099.  
  2100.   You can build the sound driver as a loadable module and use kerneld to
  2101.   automatically load and unload it. This can present one problem -
  2102.   whenever the module is reloaded the mixer settings go back to their
  2103.   default values. For some sound cards this can be too loud (e.g.
  2104.   SoundBlaster16) or too quiet. Markus Gutschke (gutschk@uni-
  2105.   muenster.de) found this solution. Use a line in your /etc/conf.modules
  2106.   file such as the following:
  2107.  
  2108.  
  2109.  
  2110.        options sound dma_buffsize=65536 && /usr/bin/setmixer igain 0 ogain 0 vol 75
  2111.  
  2112.  
  2113.   This causes your mixer program (in this case setmixer) to be run
  2114.   immediately after the sound driver is loaded. The dma_buffsize
  2115.   parameter is just a dummy value needed because the option command
  2116.   requires a command line option. Change the line as needed to match
  2117.   your mixer program and gain settings.
  2118.  
  2119.   If you have compiled the sound driver into your kernel and you want to
  2120.   set the mixer gains at boot time you can put a call to your mixer
  2121.   program in a system startup file such as /etc/rc.d/rc.local.
  2122.  
  2123.  
  2124.   6.35.  Only user root can record sound
  2125.  
  2126.  
  2127.   By default the script in Readme.linux that creates the sound device
  2128.   files only allows the devices to be read by user root. This is to plug
  2129.   a potential security hole. In a networked environment, external users
  2130.   could conceivably log in remotely to a Linux PC with a sound card and
  2131.   microphone and eavesdrop. If you are not worried about this, you can
  2132.   change the permissions used in the script.
  2133.  
  2134.   With the default setup, users can still play sound files. This is not
  2135.   a security risk but is a potential for nuisance.
  2136.  
  2137.  
  2138.   6.36.  Is the sound hardware on the IBM ThinkPad supported?
  2139.  
  2140.  
  2141.   Information on how to use the mwave sound card on an IBM ThinkPad
  2142.   laptop computer under Linux can be found at
  2143.   <http://www.screamin.demon.co.uk/>.
  2144.  
  2145.  
  2146.   7.  References
  2147.  
  2148.  
  2149.   If you have a sound card that supports a CD-ROM or SCSI interface, the
  2150.   Linux SCSI HOWTO and the Linux CD-ROM HOWTO have additional
  2151.   information that may be useful to you.
  2152.  
  2153.   The Sound Playing HOWTO describes how to play various types of sound
  2154.   and music files under Linux.
  2155.  
  2156.   The Ultrasound Plug'n'play Mini-HOWTO describes how to get a plug and
  2157.   play Gravis Ultrasound card working under Linux.
  2158.  
  2159.   The Linux SoundBlaster 16 PnP Mini-HOWTO describes how to get a plug
  2160.   and play SoundBlaster 16 card working under Linux.
  2161.  
  2162.   The Linux SoundBlaster AWE64 PnP Mini-HOWTO describes how to get a
  2163.   plug and play SoundBlaster AWE64 card working under Linux.
  2164.  
  2165.   There is an old document called the Hacker's Guide to VoxWare,
  2166.   available from  <ftp://nic.funet.fi/pub/Linux/ALPHA/sound/>. Most of
  2167.   the information in there has been superseded by the documents at
  2168.   <http://www.4front-tech.com/pguide>, but the section on /dev/sequencer
  2169.   may still be useful.
  2170.  
  2171.   The following FAQs are regularly posted to the Usenet newsgroup
  2172.   news.announce as well as being archived at
  2173.   <ftp://rtfm.mit.edu/pub/usenet/news.answers>:
  2174.  
  2175.  
  2176.   o  PCsoundcards/generic-faq (Generic PC Soundcard FAQ)
  2177.  
  2178.  
  2179.   o  PCsoundcards/soundcard-faq (comp.sys.ibm.pc.soundcard FAQ)
  2180.  
  2181.   o  PCsoundcards/gravis-ultrasound/faq (Gravis UltraSound FAQ)
  2182.  
  2183.   o  audio-fmts/part1 (Audio file format descriptions)
  2184.  
  2185.   o  audio-fmts/part2 (Audio file format descriptions)
  2186.  
  2187.   The FAQs also list several product specific mailing lists and archive
  2188.   sites. The following Usenet news groups discuss sound and/or music
  2189.   related issues:
  2190.  
  2191.  
  2192.   o  alt.binaries.sounds.* (various groups for posting sound files)
  2193.  
  2194.   o  alt.binaries.multimedia (for posting Multimedia files)
  2195.  
  2196.   o  alt.sb.programmer (Soundblaster programming topics)
  2197.  
  2198.   o  comp.multimedia (Multimedia topics)
  2199.  
  2200.   o  comp.music (Computer music theory and research)
  2201.  
  2202.   o  comp.sys.ibm.pc.soundcard.* (various IBM PC sound card groups)
  2203.  
  2204.   A Web site dedicated to multimedia can be found at
  2205.   <http://viswiz.gmd.de/MultimediaInfo/>. Creative Labs has a Web site
  2206.   at  <http://www.creaf.com/>. MediaTrix has a Web site at
  2207.   <http://www.mediatrix.com/>.
  2208.  
  2209.   The Linux mailing list has a number of "channels" dedicated to
  2210.   different topics, including sound. To find out how to join, send a
  2211.   mail message with the word "help" as the message body to
  2212.   majordomo@vger.rutgers.edu. These mailing lists are not recommended
  2213.   for questions on sound card setup etc., they are intended for
  2214.   development related discussion.
  2215.  
  2216.   As mentioned several times before, the kernel sound driver includes a
  2217.   number of Readme files containing useful information about the sound
  2218.   card driver. These can typically be found in the directory
  2219.   /usr/src/linux/drivers/sound.
  2220.  
  2221.   The author of the kernel sound driver, Hannu Savolainen, can be
  2222.   contacted by email at hannu@voxware.pp.fi. He also has a World-Wide
  2223.   Web site at  <http://personal.eunet.fi/pp/voxware>. The Web site is
  2224.   the best source for finding out the latest status of supported sound
  2225.   cards, known problems, and bug fixes.
  2226.  
  2227.   Information on OSS, the commercial sound driver for Linux and other
  2228.   Unix compatible operating systems, can be found on the 4Front
  2229.   Technologies Web page at  <http://www.4front-tech.com/>.
  2230.  
  2231.   The Linux Software Map (LSM) is an invaluable reference for locating
  2232.   Linux software. Searching the LSM for keywords such as sound is a good
  2233.   way to identify applications related to sound hardware. The LSM can be
  2234.   found on various anonymous FTP sites, including
  2235.   <ftp://sunsite.unc.edu/pub/Linux/docs/LSM/>.
  2236.  
  2237.   The Linux Documentation Project has produced several books on Linux,
  2238.   including Linux Installation and Getting Started. These are freely
  2239.   available by anonymous FTP from major Linux archive sites or can be
  2240.   purchased in hardcopy format.
  2241.  
  2242.   Finally, a shameless plug: If you want to learn a lot more about
  2243.   multimedia under Linux (especially CD-ROM and sound card applications
  2244.   and programming), check out my book Linux Multimedia Guide, ISBN
  2245.   1-56592-219-0, published by O'Reilly and Associates. As well as the
  2246.   original English version, French and Japanese translations are now in
  2247.   print. For details, call 800-998-9938 in North America or check the
  2248.   Web page  <http://www.ora.com/catalog/multilinux/noframes.html> or my
  2249.   home page  <http://www.pobox.com/~tranter>.
  2250.  
  2251.  
  2252.  
  2253.  
  2254.  
  2255.  
  2256.  
  2257.  
  2258.  
  2259.  
  2260.  
  2261.  
  2262.  
  2263.  
  2264.  
  2265.  
  2266.  
  2267.  
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.