3 * A driver for Soundcards, misc configuration parameters.
5 * Copyright by Hannu Savolainen 1995
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * $FreeBSD: src/sys/i386/isa/sound/sound_config.h,v 1.20 1999/12/27 04:37:19 tanimura Exp $
29 * $DragonFly: src/sys/dev/sound/isa/i386/Attic/sound_config.h,v 1.2 2003/06/17 04:28:38 dillon Exp $
34 * many variables should be reduced to a range. Here define a macro
37 #define RANGE(var, low, high) (var) = \
38 ((var)<(low)?(low) : (var)>(high)?(high) : (var))
40 #undef CONFIGURE_SOUNDCARD
43 #include <i386/isa/sound/local.h>
45 #define CONFIGURE_SOUNDCARD
46 #define DYNAMIC_BUFFER
47 #undef LOADABLE_SOUNDCARD
49 #include <i386/isa/sound/os.h>
50 #include <i386/isa/sound/soundvers.h>
52 #if defined(ISC) || defined(SCO) || defined(SVR42)
56 #ifndef SND_DEFAULT_ENABLE
57 #define SND_DEFAULT_ENABLE 1
60 #ifdef CONFIGURE_SOUNDCARD
62 #ifndef MAX_REALTIME_FACTOR
63 #define MAX_REALTIME_FACTOR 4
66 /************* PCM DMA buffer sizes *******************/
68 /* If you are using high playback or recording speeds, the default buffersize
69 is too small. DSP_BUFFSIZE must be 64k or less.
71 A rule of thumb is 64k for PAS16, 32k for PAS+, 16k for SB Pro and
74 If you change the DSP_BUFFSIZE, don't modify this file.
75 Use the make config command instead. Seems to allow only 4K, 16K,
80 #define DSP_BUFFSIZE (32760)
84 #define DSP_BUFFCOUNT 1 /* 1 is recommended. */
87 #define DMA_AUTOINIT 0x10 /* XXX never used */
90 #define FM_MONO 0x28d2
92 #define FM_MONO 0x388 /* This is the I/O address used by AdLib */
96 #define AWE32_BASE 0x620 /* Default = 0x620-3, 0xA20-3, 0xE20-3 */
100 #define PAS_BASE 0x388
109 /* SEQ_MAX_QUEUE is the maximum number of sequencer events buffered by the
110 driver. (There is no need to alter this) */
111 #define SEQ_MAX_QUEUE 1024
113 #define SBFM_MAXINSTR (256) /* Size of the FM Instrument bank */
114 /* 128 instruments for general MIDI setup and 16 unassigned */
117 * Minor numbers for the sound driver.
119 * Unfortunately Creative called the codec chip of SB as a DSP. For this
120 * reason the /dev/dsp is reserved for digitized audio use. There is a
121 * device for true DSP processors but it will be called something else.
122 * In v3.0 it's /dev/sndproc but this could be a temporary solution.
125 #define SND_NDEVS 256 /* Number of supported devices */
127 #define SND_DEV_CTL 0 /* Control port /dev/mixer */
128 #define SND_DEV_SEQ 1 /* Sequencer output /dev/sequencer (FM
129 synthesizer and MIDI output) */
130 #define SND_DEV_MIDIN 2 /* Raw midi access */
131 #define SND_DEV_DSP 3 /* Digitized voice /dev/dsp */
132 #define SND_DEV_AUDIO 4 /* Sparc compatible /dev/audio */
133 #define SND_DEV_DSP16 5 /* Like /dev/dsp but 16 bits/sample */
134 #define SND_DEV_STATUS 6 /* /dev/sndstat */
135 /* #7 not in use now. Was in 2.4. Free for use after v3.0. */
136 #define SND_DEV_SEQ2 8 /* /dev/sequencer, level 2 interface */
137 #define SND_DEV_SNDPROC 9 /* /dev/sndproc for programmable devices */
138 #define SND_DEV_PSS SND_DEV_SNDPROC
140 #define DSP_DEFAULT_SPEED 8000
145 #define MAX_AUDIO_DEV 5
146 #define MAX_MIXER_DEV 5
147 #define MAX_SYNTH_DEV 3
148 #define MAX_MIDI_DEV 6
149 #define MAX_TIMER_DEV 3
152 int mode; /* Open mode */
154 int dummy; /* Reference to file-flags. OS-dependent. */
157 struct address_info {
162 int always_detect; /* 1=Trust me, it's there */
164 sound_os_info *osp; /* OS specific info */
165 int card_subtype; /* Driver specific. Usually 0 */
168 #define SYNTH_MAX_VOICES 32
170 struct voice_alloc_info {
173 int ptr; /* For device specific use */
174 unsigned short map[SYNTH_MAX_VOICES]; /* (ch << 8) | (note+1) */
176 int alloc_times[SYNTH_MAX_VOICES];
179 struct channel_info {
182 unsigned char controllers[128];
186 * Process wakeup reasons
189 #define WK_WAKEUP 0x01
190 #define WK_TIMEOUT 0x02
191 #define WK_SIGNAL 0x04
192 #define WK_SLEEP 0x08
194 #define OPEN_READ PCM_ENABLE_INPUT
195 #define OPEN_WRITE PCM_ENABLE_OUTPUT
196 #define OPEN_READWRITE (OPEN_READ|OPEN_WRITE)
198 #include <i386/isa/sound/sound_calls.h>
199 #include <i386/isa/sound/dev_table.h>
205 /* #define DDB(x) x XXX */
209 #define TIMER_ARMED 121234
210 #define TIMER_NOT_ARMED 1