old-www/HOWTO/Sound-HOWTO/x504.html

1579 lines
35 KiB
HTML

<HTML
><HEAD
><TITLE
>Answers To Frequently Asked Questions</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.63
"><LINK
REL="HOME"
TITLE="The Linux Sound HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Applications Supporting Sound"
HREF="x478.html"><LINK
REL="NEXT"
TITLE="References"
HREF="x916.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Linux Sound HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x478.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x916.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN504"
>6. Answers To Frequently Asked Questions</A
></H1
><P
>This section answers some of the questions that have been commonly
asked on the Usenet news groups and mailing lists.</P
><P
>Answers to more questions can also be found at the OSS sound
driver web page.</P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN508"
>6.1. What are the various sound device files?</A
></H2
><P
>These are the most standard device file names, some Linux
distributions may use slightly different names.</P
><P
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>/dev/audio</DT
><DD
><P
>normally a link to <TT
CLASS="FILENAME"
>/dev/audio0</TT
></P
></DD
><DT
>/dev/audio0</DT
><DD
><P
>Sun workstation compatible audio device (only
a partial implementation, does not support Sun ioctl interface, just
u-law encoding)</P
></DD
><DT
>/dev/audio1</DT
><DD
><P
>second audio device (if supported by sound card
or if more than one sound card installed)</P
></DD
><DT
>/dev/dsp</DT
><DD
><P
>normally a link to <TT
CLASS="FILENAME"
>/dev/dsp0</TT
></P
></DD
><DT
>/dev/dsp0</DT
><DD
><P
>first digital sampling device</P
></DD
><DT
>/dev/dsp1</DT
><DD
><P
>second digital sampling device</P
></DD
><DT
>/dev/mixer</DT
><DD
><P
>normally a link to <TT
CLASS="FILENAME"
>/dev/mixer0</TT
></P
></DD
><DT
>/dev/mixer0</DT
><DD
><P
>first sound mixer</P
></DD
><DT
>/dev/mixer1</DT
><DD
><P
>second sound mixer</P
></DD
><DT
>/dev/music</DT
><DD
><P
>high-level sequencer interface</P
></DD
><DT
>/dev/sequencer</DT
><DD
><P
>low level MIDI, FM, and GUS access</P
></DD
><DT
>/dev/sequencer2</DT
><DD
><P
>normally a link to <TT
CLASS="FILENAME"
>/dev/music</TT
></P
></DD
><DT
>/dev/midi00</DT
><DD
><P
>1st raw MIDI port</P
></DD
><DT
>/dev/midi01</DT
><DD
><P
>2nd raw MIDI port</P
></DD
><DT
>/dev/midi02</DT
><DD
><P
>3rd raw MIDI port</P
></DD
><DT
>/dev/midi03</DT
><DD
><P
>4th raw MIDI port</P
></DD
><DT
>/dev/sndstat</DT
><DD
><P
>displays sound driver status when read (also available as /proc/sound, removed in 2.4 kernels)</P
></DD
></DL
></DIV
></P
><P
>The PC speaker driver provides the following devices:</P
><P
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>/dev/pcaudio</DT
><DD
><P
>equivalent to /dev/audio</P
></DD
><DT
>/dev/pcsp</DT
><DD
><P
>equivalent to /dev/dsp</P
></DD
><DT
>/dev/pcmixer</DT
><DD
><P
>equivalent to /dev/mixer</P
></DD
></DL
></DIV
></P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN600"
>6.2. How can I play a sound sample?</A
></H2
><P
>Sun workstation (.au) sound files can be played by sending them to the
<TT
CLASS="FILENAME"
>/dev/audio</TT
> device. Raw samples can be sent to
<TT
CLASS="FILENAME"
>/dev/dsp</TT
>. This will generally give poor results though, and
using a program such as <TT
CLASS="LITERAL"
>play</TT
> is preferable, as it will
recognize most file types and set the sound card to the correct
sampling rate, etc.</P
><P
>If you are running a graphical desktop such as <A
HREF="http://www.kde.org"
TARGET="_top"
>KDE</A
> or <A
HREF="http://www.gnome.org"
TARGET="_top"
>GNOME</A
> then it should already
include a graphical sound file player program.</P
><P
>Programs like wavplay or vplay (in the snd-util package) will give
best results with WAV files. However they don't recognize
Microsoft ADPCM compressed WAV files. Also older versions
of play (from the Lsox package) doesn't work well with 16 bit WAV
files.</P
><P
>The splay command included in the snd-util package can be used to play
most sound files if proper parameters are entered manually in the
command line.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN611"
>6.3. How can I record a sample?</A
></H2
><P
>Reading <TT
CLASS="FILENAME"
>/dev/audio</TT
> or <TT
CLASS="FILENAME"
>/dev/dsp</TT
> will return sampled
data that can be redirected to a file. A program such as <TT
CLASS="LITERAL"
>vrec</TT
>
makes it easier to control the sampling rate, duration, etc. You may
also need a mixer program to select the appropriate input device.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN617"
>6.4. Can I have more than one sound card?</A
></H2
><P
>With the current sound driver it's possible to have several
SoundBlaster, SoundBlaster/Pro, SoundBlaster16, MPU-401 or MSS cards
at the same time on the system. Installing two SoundBlasters is
possible but requires defining the macros SB2_BASE, SB2_IRQ, SB2_DMA
and (in some cases) SB2_DMA2 by editing <TT
CLASS="FILENAME"
>local.h</TT
>
manually. It's also possible to have a SoundBlaster at the same time
as a PAS16.</P
><P
>With the 2.0 and newer kernels that configure sound using make config,
instead of <TT
CLASS="FILENAME"
>local.h</TT
>, you need to edit the file
<TT
CLASS="FILENAME"
>/usr/include/linux/autoconf.h</TT
>. After the section
containing the lines:
<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>#define SBC_BASE 0x220
#define SBC_IRQ (5)
#define SBC_DMA (1)
#define SB_DMA2 (5)
#define SB_MPU_BASE 0x0
#define SB_MPU_IRQ (-1)</PRE
></FONT
></TD
></TR
></TABLE
></P
><P
>add these lines (with values appropriate for your system):
<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>#define SB2_BASE 0x330
#define SB2_IRQ (7)
#define SB2_DMA (2)
#define SB2_DMA2 (2)</PRE
></FONT
></TD
></TR
></TABLE
></P
><P
>The following drivers don't permit multiple instances:</P
><P
>&#13;<P
></P
><UL
><LI
><P
>GUS (driver limitation)</P
></LI
><LI
><P
>MAD16 (hardware limitation)</P
></LI
><LI
><P
>AudioTrix Pro (hardware limitation)</P
></LI
><LI
><P
>CS4232 (hardware limitation)</P
></LI
></UL
>&#13;</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN638"
>6.5. Error: No such file or directory for sound devices</A
></H2
><P
>You need to create the sound driver device files. See the section on
creating device files. If you do have the device files, ensure that
they have the correct major and minor device numbers (some older
CD-ROM distributions of Linux may not create the correct device files
during installation).</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN641"
>6.6. Error: No such device for sound devices</A
></H2
><P
>You have not booted with a kernel containing the sound driver or the
I/O address configuration doesn't match your hardware. Check that you
are running the newly compiled kernel and verify that the settings
entered when configuring the sound driver match your hardware setup.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN644"
>6.7. Error: No space left on device for sound devices</A
></H2
><P
>This can happen if you tried to record data to <TT
CLASS="FILENAME"
>/dev/audio</TT
> or
<TT
CLASS="FILENAME"
>/dev/dsp</TT
> without creating the necessary device file. The
sound device is now a regular file, and has filled up your disk
partition. You need to run the script described in the <EM
>Creating
the Device Files</EM
> section of this document.</P
><P
>This may also happen with Linux 2.0 and later if there is not enough
free RAM on the system when the device is opened. The audio driver
requires at least two pages (8k) of contiguous physical RAM for each
DMA channel. This happens sometimes in machines with less than 16M of
RAM or which have been running for very long time. You can preallocate
the DMA buffers when the driver is loaded using the kernel option
"dma_buf=1".</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN651"
>6.8. Error: Device busy for sound devices</A
></H2
><P
>Only one process can open a given sound device at one time. Most
likely some other process is using the device in question. One way to
determine this is to use the <TT
CLASS="LITERAL"
>fuser</TT
> command:
<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>% fuser -v /dev/dsp
/dev/dsp: USER PID ACCESS COMMAND
tranter 265 f.... tracker</PRE
></FONT
></TD
></TR
></TABLE
></P
><P
>In the above example, the <TT
CLASS="LITERAL"
>fuser</TT
> command showed that process
265 had the device open. Waiting for the process to complete or
killing it will allow the sound device to be accessed once again. You
should run the <TT
CLASS="LITERAL"
>fuser</TT
> command as root in order to report usage
by users other than yourself.</P
><P
>On some systems you may need to be root when running the
<TT
CLASS="LITERAL"
>fuser</TT
> command in order to see the processes of other users.</P
><P
>Under the KDE desktop, the artsd sound server usually take control of the sound device. Applications
should make requests to play sound through the sound server, or the sound server should be
paused. A similar situation exists under GNOME with the esd sound
server.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN662"
>6.9. I still get device busy errors!</A
></H2
><P
>According to Brian Gough, for the SoundBlaster cards which use DMA
channel 1 there is a potential conflict with the QIC-02 tape driver,
which also uses DMA 1, causing "device busy" errors. If you are using
FTAPE, you may have this driver enabled. According to the FTAPE-HOWTO
the QIC-02 driver is not essential for the use of FTAPE; only the
QIC-117 driver is required. Reconfiguring the kernel to use QIC-117
but not QIC-02 allows FTAPE and the sound-driver to coexist.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN665"
>6.10. Partial playback of digitized sound file</A
></H2
><P
>The symptom is usually that a sound sample plays for about a second
and then stops completely or reports an error message about "missing
IRQ" or "DMA timeout". Most likely you have incorrect IRQ or DMA
channel settings. Verify that the kernel configuration matches the
sound card jumper settings and that they do not conflict with some
other card.</P
><P
>Another symptom is sound samples that <EM
>loop</EM
>. This is usually
caused by an IRQ conflict.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN670"
>6.11. There are pauses when playing MOD files</A
></H2
><P
>Playing MOD files requires considerable CPU power. You may
have too many processes running or your computer may be too slow to
play in real time. Your options are to:</P
><P
>&#13;<P
></P
><UL
><LI
><P
>try playing with a lower sampling rate or in mono mode</P
></LI
><LI
><P
>eliminate other processes</P
></LI
><LI
><P
>buy a faster computer</P
></LI
><LI
><P
>buy a more powerful sound card (e.g. Gravis UltraSound)</P
></LI
></UL
>&#13;</P
><P
>If you have a Gravis UltraSound card, you should use one of the mod
file players written specifically for the GUS (e.g. <TT
CLASS="LITERAL"
>gmod</TT
>).</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN685"
>6.12. Compile errors when compiling sound applications</A
></H2
><P
>The version 1.0c and earlier sound driver used a different and
incompatible <TT
CLASS="LITERAL"
>ioctl()</TT
> scheme. Obtain newer source code or make
the necessary changes to adapt it to the new sound driver. See the
sound driver <TT
CLASS="FILENAME"
>Readme</TT
> file for details.</P
><P
>Also ensure that you have used the latest version of
<TT
CLASS="FILENAME"
>soundcard.h</TT
> and <TT
CLASS="FILENAME"
>ultrasound.h</TT
> when compiling
the application. See the installation instructions at beginning of
this text.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN693"
>6.13. SEGV when running sound binaries that worked previously</A
></H2
><P
>This is probably the same problem described in the previous question.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN696"
>6.14. What known bugs or limitations are there in the sound driver?</A
></H2
><P
>See the files included with the sound driver kernel source.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN699"
>6.15. Where are the sound driver ioctls() etc. documented?</A
></H2
><P
>Currently the best documentation, other than the source code, is
available at the 4Front Technologies web site,
<A
HREF="http://www.opensound.com"
TARGET="_top"
>http://www.opensound.com</A
>.
Another source of information is the
<EM
>Linux Multimedia Guide</EM
>, described in the references section.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN704"
>6.16. What CPU resources are needed to play or record without pauses?</A
></H2
><P
>There is no easy answer to this question, as it depends on:</P
><P
>&#13;<P
></P
><UL
><LI
><P
>whether using PCM sampling or FM synthesis</P
></LI
><LI
><P
>sampling rate and sample size</P
></LI
><LI
><P
>which application is used to play or record</P
></LI
><LI
><P
>Sound Card hardware</P
></LI
><LI
><P
>disk I/O rate, CPU clock speed, cache size, etc.</P
></LI
></UL
>&#13;</P
><P
>In general, any 386 machine or better should be able to play samples
or FM synthesized music on an 8 bit sound card with ease.</P
><P
>Playing MOD files, however, requires considerable CPU resources. Some
experimental measurements have shown that playing at 44kHz requires
more than 40% of the speed of a 486/50 and a 386/25 can hardly play
faster than 22 kHz (these are with an 8 bit card sound such as a
SoundBlaster). A card such as the Gravis UltraSound card performs more
functions in hardware, and will require less CPU resources.</P
><P
>These statements assume the computer is not performing any other CPU
intensive tasks.</P
><P
>Converting sound files or adding effects using a utility such as
<TT
CLASS="LITERAL"
>sox</TT
> is also much faster if you have a math
coprocessor (or CPU with on board FPU). The kernel driver itself
does not do any floating point calculations, though.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN724"
>6.17. Problems with a PAS16 and an Adaptec 1542 SCSI host adaptor</A
></H2
><P
>(the following explanation was supplied by
<TT
CLASS="LITERAL"
>seeker@indirect.com</TT
>)</P
><P
>Linux only recognizes the 1542 at address 330 (default) or 334, and
the PAS only allows the MPU-401 emulation at 330. Even when you
disable the MPU-401 under software, something still wants to conflict
with the 1542 if it's at its preferred default address. Moving the
1542 to 334 makes everyone happy.</P
><P
>Additionally, both the 1542 and the PAS-16 do 16-bit DMA, so if you
sample at 16-bit 44 KHz stereo and save the file to a SCSI drive hung
on the 1542, you're about to have trouble. The DMAs overlap and there
isn't enough time for RAM refresh, so you get the dread ``PARITY ERROR
- SYSTEM HALTED'' message, with no clue to what caused it. It's made
worse because a few second-party vendors with QIC-117 tape drives
recommend setting the bus on/off times such that the 1542 is on even
longer than normal. Get the SCSISEL.EXE program from Adaptec's BBS or
several places on the internet, and reduce the BUS ON time or increase
the BUS OFF time until the problem goes away, then move it one notch
or more further. SCSISEL changes the EEPROM settings, so it's more
permanent than a patch to the DOS driver line in CONFIG.SYS, and will
work if you boot right into Linux (unlike the DOS patch). Next
problem solved.</P
><P
>Last problem - the older Symphony chipsets drastically reduced the
timing of the I/O cycles to speed up bus accesses. None of various
boards I've played with had <EM
>any</EM
> problem with the reduced
timing except for the PAS-16. Media Vision's BBS has SYMPFIX.EXE
that's supposed to cure the problem by twiddling a diagnostic bit in
Symphony's bus controller, but it's not a hard guarantee. You may
need to:</P
><P
>&#13;<P
></P
><UL
><LI
><P
>get the motherboard distributor to replace the older version bus chip,</P
></LI
><LI
><P
>replace the motherboard, or</P
></LI
><LI
><P
>buy a different brand of sound card.</P
></LI
></UL
>&#13;</P
><P
>Young Microsystems will upgrade the boards they import for around
$30 (US); other vendors may be similar if you can figure out
who made or imported the motherboard (good luck). The problem is in
ProAudio's bus interface chip as far as I'm concerned; <EM
>nobody</EM
>
buys a $120 sound card and sticks it in a 6MHz AT. Most of
them wind up in 25-40MHz 386/486 boxes, and should be able to handle
<EM
>at least</EM
> 12MHz bus rates if the chips are designed
right. Exit soapbox (stage left).</P
><P
>The first problem depends on the chipset used on your motherboard,
what bus speed and other BIOS settings, and the phase of the moon.
The second problem depends on your refresh option setting (hidden or
synchronous), the 1542 DMA rate and (possibly) the bus I/O rate. The
third can be determined by calling Media Vision and asking which
flavor of Symphony chip is incompatible with their slow design. Be
warned, though - 3 of 4 techs I talked to were brain damaged. I would
be very leery of trusting <EM
>anything</EM
> they said about someone
else's hardware, since they didn't even know their own very well.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN745"
>6.18. Is it possible to read and write samples simultaneously?</A
></H2
><P
>The drivers for some sound cards support full duplex mode. Check the
documentation available from 4Front Technologies for information on
how to use it.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN748"
>6.19. My SB16 is set to IRQ 2, but configure does not allow this value.</A
></H2
><P
>On '286 and later machines, the IRQ 2 interrupt is cascaded to the
second interrupt controller. It is equivalent to IRQ 9.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN751"
>6.20. If I run Linux, then boot DOS, I get errors and/or sound applications do not work properly.</A
></H2
><P
>This happens after a soft reboot to DOS. Sometimes the error message
misleadingly refers to a bad <TT
CLASS="FILENAME"
>CONFIG.SYS</TT
> file.</P
><P
>Most of the current sound cards have software programmable IRQ and DMA
settings. If you use different settings between Linux and
MS-DOS/Windows, this may cause problems. Some sound cards don't accept
new parameters without a complete reset (i.e. cycle the power or use
the hardware reset button).</P
><P
>The quick solution to this problem it to perform a full reboot using
the reset button or power cycle rather than a soft reboot
(e.g. Ctrl-Alt-Del).</P
><P
>The correct solution is to ensure that you use the same IRQ and DMA
settings with MS-DOS and Linux (or not to use DOS :-).</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN758"
>6.21. Problems running DOOM under Linux</A
></H2
><P
>Users of the port of ID software's game DOOM for Linux may
be interested in these notes.</P
><P
>For correct sound output you need version 2.90 or later of the sound
driver; it has support for the real-time <TT
CLASS="LITERAL"
>DOOM mode</TT
>.</P
><P
>The sound samples are 16-bit. If you have an 8-bit sound card you can
still get sound to work using one of several programs available in
<A
HREF="ftp://www.ibiblio.org/pub/Linux/games/doom"
TARGET="_top"
>ftp://www.ibiblio.org/pub/Linux/games/doom</A
>.</P
><P
>If performance of DOOM is poor on your system, disabling sound (by
renaming the file <TT
CLASS="LITERAL"
>sndserver</TT
>) may improve it.</P
><P
>By default DOOM does not support music (as in the DOS version). The
program <TT
CLASS="LITERAL"
>musserver</TT
> will add support for music to DOOM under
Linux. It can be found at
<A
HREF="ftp://pandora.st.hmc.edu/pub/linux/musserver.tgz"
TARGET="_top"
>ftp://pandora.st.hmc.edu/pub/linux/musserver.tgz</A
>.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN770"
>6.22. How can I reduce noise picked up by my sound card?</A
></H2
><P
>Using good quality shielded cables and trying the sound card in
different slots may help reduce noise. If the sound card
has a volume control, you can try different settings (maximum is
probably best). Using a mixer program you can make sure
that undesired inputs (e.g. microphone) are set to zero gain.</P
><P
>Philipp Braunbeck reported that on his ESS-1868 sound card there was a
jumper to turn off the built-in amplifier which helped reduce noise
when enabled.</P
><P
>On one 386 system I found that the kernel command line option
<TT
CLASS="LITERAL"
>no-hlt</TT
> reduced the noise level. This tells the kernel not to
use the halt instruction when running the idle process loop. You can
try this manually when booting, or set it up using the command
<TT
CLASS="LITERAL"
>append="no-hlt"</TT
> in your LILO configuration file.</P
><P
>Some sound cards are simply not designed with good shielding and
grounding and are prone to noise pickup.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN778"
>6.23. I can play sounds, but not record.</A
></H2
><P
>If you can play sound but not record, try these steps:</P
><P
>&#13;<P
></P
><UL
><LI
><P
>use a mixer program to select the appropriate device (e.g. microphone)</P
></LI
><LI
><P
>use the mixer to set the input gains to maximum</P
></LI
><LI
><P
>If you can, try to test sound card recording under MS-DOS to
determine if there is a hardware problem</P
></LI
></UL
>&#13;</P
><P
>Sometimes a different DMA channel is used for recording than for
playback. In this case the most probable reason is that the recording
DMA is set up incorrectly.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN790"
>6.24. My "compatible" sound card only works if I first initialize under MS-DOS.</A
></H2
><P
>In most cases a "SoundBlaster compatible" card will work better under
Linux if configured with a driver other than the SoundBlaster one.
Most sound cards claim to be compatible (e.g. "16 bit SB Pro
compatible" or "SB compatible 16 bit") but usually this SoundBlaster
mode is just a hack provided for DOS games compatibility. Most
cards have a 16 bit native mode which is likely to be supported by
recent Linux versions (2.0.1 and later).</P
><P
>Only with some (usually rather old) cards is it necessary to try to
get them to work in the SoundBlaster mode. The only newer cards that
are the exception to this rule are the Mwave-based cards.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN794"
>6.25. My 16-bit SoundBlaster "compatible" sound card only works in 8-bit mode under Linux.</A
></H2
><P
>16-bit sound cards described as SoundBlaster compatible are really
only compatible with the 8-bit SoundBlaster Pro. They typically have a
16-bit mode which is not compatible with the SoundBlaster 16 and not
compatible with the Linux sound driver.</P
><P
>You may be able to get the card to work in 16-bit mode by using the
MAD16 or MSS/WSS driver.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN798"
>6.26. Where can I find sound applications for Linux?</A
></H2
><P
>Here are some good archive sites to search for Linux specific sound
applications:</P
><P
>&#13;<P
></P
><UL
><LI
><P
><A
HREF="ftp://www.ibiblio.org/pub/Linux/kernel/sound/"
TARGET="_top"
>ftp://www.ibiblio.org/pub/Linux/kernel/sound/</A
></P
></LI
><LI
><P
><A
HREF="ftp://www.ibiblio.org/pub/Linux/apps/sound/"
TARGET="_top"
>ftp://www.ibiblio.org/pub/Linux/apps/sound/</A
></P
></LI
><LI
><P
><A
HREF="ftp://tsx-11.mit.edu/pub/linux/packages/sound/"
TARGET="_top"
>ftp://tsx-11.mit.edu/pub/linux/packages/sound/&#62;</A
></P
></LI
><LI
><P
><A
HREF="ftp://nic.funet.fi/pub/Linux/util/sound/"
TARGET="_top"
>ftp://nic.funet.fi/pub/Linux/util/sound/</A
></P
></LI
><LI
><P
><A
HREF="ftp://nic.funet.fi/pub/Linux/xtra/snd-kit/"
TARGET="_top"
>ftp://nic.funet.fi/pub/Linux/xtra/snd-kit/</A
></P
></LI
><LI
><P
><A
HREF="ftp://nic.funet.fi/pub/Linux/ALPHA/sound/"
TARGET="_top"
>ftp://nic.funet.fi/pub/Linux/ALPHA/sound/</A
></P
></LI
></UL
>&#13;</P
><P
>Also see the References section of this document.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN822"
>6.27. Can the sound drivers be compiled as a loadable module?</A
></H2
><P
>With recent kernels the sound driver is supported as several kernel
loadable modules.</P
><P
>See the files in <TT
CLASS="FILENAME"
>/usr/src/linux/Documentation/sound</TT
>,
especially the files <TT
CLASS="FILENAME"
>Introduction</TT
> and
<TT
CLASS="FILENAME"
>README.modules</TT
>.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN829"
>6.28. Can I use a sound card to replace the system console beep?</A
></H2
><P
>Try the <TT
CLASS="LITERAL"
>oplbeep</TT
> program, found at
<A
HREF="ftp://www.ibiblio.org/pub/Linux/apps/sound/oplbeep-2.3.tar.gz"
TARGET="_top"
>ftp://www.ibiblio.org/pub/Linux/apps/sound/oplbeep-2.3.tar.gz</A
></P
><P
>Another variant is the <TT
CLASS="LITERAL"
>beep</TT
> program found at
<A
HREF="ftp://www.ibiblio.org/pub/Linux/kernel/patches/misc/modreq_beep.tgz"
TARGET="_top"
>ftp://www.ibiblio.org/pub/Linux/kernel/patches/misc/modreq_beep.tgz</A
></P
><P
>The <TT
CLASS="LITERAL"
>modutils</TT
> package has an example program and kernel patch
that supports calling an arbitrary external program to generate sounds
when requested by the kernel.</P
><P
>Version 2.0 and later of KDE allows playing a sound file for the console beep in
KDE applications such as konsole.</P
><P
>Alternatively, with some sound cards you can connect the PC speaker
output to the sound card so that all sounds come from the sound card
speakers.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN841"
>6.29. What is VoxWare?</A
></H2
><P
>The commercial version of the sound drivers sold by 4Front
Technologies was previously known by other names such as
<EM
>VoxWare</EM
>, <EM
>USS</EM
> (Unix Sound System), and even
<EM
>TASD</EM
> (Temporarily Anonymous Sound Driver). It is now marketed
as <EM
>OSS</EM
> (Open Sound System). The version included
in the Linux kernel is sometimes referred to as <EM
>OSS/Free</EM
>.</P
><P
>For more information see the 4Front Technologies web page at
<A
HREF="http://www.opensound.com/"
TARGET="_top"
>http://www.opensound.com/</A
>.
I wrote a review of OSS/Linux in the June 1997 issue of
<A
HREF="http://www.ssc.com/lj/"
TARGET="_top"
>Linux Journal</A
>.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN852"
>6.30. Sox/Play/Vplay reports "invalid block size 1024"</A
></H2
><P
>A change to the sound driver in version 1.3.67 broke some sound player
programs which (incorrectly) checked that the result from the
SNDCTL_DSP_GETBLKSIZE ioctl was greater than 4096. The latest sound
driver versions have been fixed to avoid allocating fragments shorter
than 4096 bytes which solves this problem with old utilities.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN855"
>6.31. The mixer settings are reset whenever I load the sound driver module</A
></H2
><P
>You can build the sound driver as a loadable module and use
<TT
CLASS="LITERAL"
>kerneld</TT
> to automatically load and unload it. This can present
one problem - whenever the module is reloaded the mixer
settings go back to their default values. For some sound cards this
can be too loud (e.g. SoundBlaster16) or too quiet. Markus Gutschke
(<TT
CLASS="LITERAL"
>gutschk@uni-muenster.de</TT
>) found this solution. Use a line in
your <TT
CLASS="FILENAME"
>/etc/conf.modules</TT
> file such as the following:
<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>options sound dma_buffsize=65536
post-install sound /usr/bin/setmixer igain 0 ogain 0 vol 75</PRE
></FONT
></TD
></TR
></TABLE
></P
><P
>This causes your mixer program (in this case <TT
CLASS="LITERAL"
>setmixer</TT
>) to be
run immediately after the sound driver is loaded. The
<TT
CLASS="LITERAL"
>dma_buffsize</TT
> parameter is just a dummy value needed because
the option command requires a command line option. Change the line as
needed to match your mixer program and gain settings.</P
><P
>If you have compiled the sound driver into your kernel and you want to
set the mixer gains at boot time you can put a call to your mixer
program in a system startup file such as
<TT
CLASS="FILENAME"
>/etc/rc.d/rc.local</TT
>.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN867"
>6.32. Only user root can record sound</A
></H2
><P
>By default the script in Readme.linux that creates the sound device
files only allows the devices to be read by user <TT
CLASS="LITERAL"
>root</TT
>. This
is to plug a potential security hole. In a networked environment,
external users could conceivably log in remotely to a Linux PC with a
sound card and microphone and eavesdrop. If you are not worried about
this, you can change the permissions used in the script.</P
><P
>With the default setup, users can still play sound files. This is not
a security risk but is a potential for nuisance.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN872"
>6.33. Is the sound hardware on the IBM ThinkPad supported?</A
></H2
><P
>Information on how to use the mwave sound card on an IBM ThinkPad
laptop computer can be found in the file
<TT
CLASS="FILENAME"
>/usr/src/linux/Documentation/sound/mwave</TT
>, which is part
of the kernel source distribution (note that not all IBM ThinkPads use the
MWAVE sound chip).</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN876"
>6.34. Applications fail because my sound card has no mixer</A
></H2
><P
>Some old 8-bit SoundBlaster cards have no mixer circuitry. Some sound
applications insist on being able to open the mixer device, and fail
with these cards. Jens Werner
(<A
HREF="mailto:werner@bert.emv.ing.tu-bs.de"
TARGET="_top"
>werner@bert.emv.ing.tu-bs.de</A
>)
reports a workaround for this is
to link <TT
CLASS="LITERAL"
>/dev/mixer</TT
> to <TT
CLASS="LITERAL"
>/dev/null</TT
> and everything
should work fine.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN882"
>6.35. Problems with a SB16 CT4170</A
></H2
><P
>From Scott Manley
(<A
HREF="mailto:spm@star.arm.ac.uk"
TARGET="_top"
>spm@star.arm.ac.uk</A
>):</P
><P
>There seems to be a new type of Soundblaster - it was sold to us as a
SB16 - the Model no. on the Card is CT4170. These Beasties only have
one DMA channel so when you try to set them up then the kernel will
have trouble accessing the 16 bit DMA. The solution is to set the
second DMA to 1 so that the card will behave as advertised.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN887"
>6.36. How to connect a MIDI keyboard to a soundcard</A
></H2
><P
>From Kim G. S. OEyhus
(<A
HREF="mailto:kim@pvv.ntnu.no"
TARGET="_top"
>kim@pvv.ntnu.no</A
>):</P
><P
>I looked all around the internet and in sound documentation on how to
do something as simple as connecting the MIDI output from a master
keyboard to the MIDI input on a sound card. I found nothing. The
problem is that they both use the same device, /dev/midi, at least
when using the OSS sound system. So I found a way to do it, which I
want to share. This makes for a very simple synthesizer, with full
MIDI support:</P
><P
>CONNECTING A MIDI MASTER-KEYBOARD DIRECTLY TO A SOUNDCARD WITH MIDI</P
><P
>A MIDI master-keyboard is a keyboard without any synthesizer, and with
only a MIDI-out plug. This can be connected to the 15-pin D-SUB port
on most sound-cards with a suitable cable.</P
><P
>Such a keyboard can be used to control the MIDI synthesizer device
for the card, thus making a simple keyboard controlled synthesizer.</P
><P
>Compile the following program, say with 'gcc -o prog prog.c' and run it:
<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>#include &#60;fcntl.h&#62;
main()
{
int fil, a;
char b[256];
fil=open("/dev/midi", O_RDWR);
for(;;)
{
a=read(fil, b, 256);
write(fil, b, a);
}
}</PRE
></FONT
></TD
></TR
></TABLE
>&#13;</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN897"
>6.37. Problems with IRQ 15 and Ensoniq PCI 128</A
></H2
><P
>From Matthew Inger (<A
HREF="mailto:mattinger@mindless.com"
TARGET="_top"
>mattinger@mindless.com</A
>):</P
><P
>Information on getting an Ensoniq PCI 128 card to work.</P
><P
>The problem that it was exhibiting was that it was trying to use
interrupt 15 by default (Plug and Pray was responsible for this one).
This interrupt is used by the secondary ide controller, and cannot be
shared by other devices. You need to somehow force the es1370 to use
another interrupt (should use interrupt 11 like it does under
windows).</P
><P
>I figured this one out for myself believe it or not.</P
><P
>What I had to do was:</P
><P
>a) in the BIOS, you have to tell the computer that you don't have
a Plug and Play OS. I believe this is under advanced options
in my BIOS.</P
><P
>b) in the PCI settings in the BIOS, tell the computer to reserve
interrupt 15 for legacy ISA devices. In my bios, under advanced
options, there is a section for PCI settings. Under there, there
is a Resource Exclusion area, and that's where to do this.</P
><P
>When you reboot into linux you will be able to use sound. (I don't
remember if it shows up in the boot messages or not like it used to).
To be safe, I ran sndconfig again so that it would play the test message,
which sounded not great, but it was there. When I played a CD however, it
sounded perfect.</P
><P
>Don't worry about windows, I tried both my cards: ISA Modem, and the
Sound Card out, and they work without any hitches.</P
><P
>The odds are your BIOS will be different from mine, but you just have
to figure out where the settings are for the above two items. Good
luck.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN910"
>6.38. Where can I get freely available MIDI patches to run SoftOSS?</A
></H2
><P
>SoftOSS is a software-based wavetable synthesizer included with the
kernel sound driver that is compatible with the Gravis Utrasound
card. To operate the driver needs GUS compatible MIDI patch files. The
documentation mentions the "public domain MIDIA patchset available
from several ftp sites". Note that SoftOSS is no longer included
as of the 2.4 kernels.</P
><P
>As explained on the 4Front Technologies web page
<A
HREF="http://www.opensound.com/softoss.html"
TARGET="_top"
>http://www.opensound.com/softoss.html</A
>
they can be downloaded from
<A
HREF="ftp://archive.cs.umbc.edu/pub/midia/instruments.tar.gz"
TARGET="_top"
>ftp://archive.cs.umbc.edu/pub/midia/instruments.tar.gz</A
>.</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x478.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x916.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Applications Supporting Sound</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>References</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>