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 $
33 * many variables should be reduced to a range. Here define a macro
36 #define RANGE(var, low, high) (var) = \
37 ((var)<(low)?(low) : (var)>(high)?(high) : (var))
39 #undef CONFIGURE_SOUNDCARD
42 #include <i386/isa/sound/local.h>
44 #define CONFIGURE_SOUNDCARD
45 #define DYNAMIC_BUFFER
46 #undef LOADABLE_SOUNDCARD
48 #include <i386/isa/sound/os.h>
49 #include <i386/isa/sound/soundvers.h>
51 #if defined(ISC) || defined(SCO) || defined(SVR42)
55 #ifndef SND_DEFAULT_ENABLE
56 #define SND_DEFAULT_ENABLE 1
59 #ifdef CONFIGURE_SOUNDCARD
61 #ifndef MAX_REALTIME_FACTOR
62 #define MAX_REALTIME_FACTOR 4
65 /************* PCM DMA buffer sizes *******************/
67 /* If you are using high playback or recording speeds, the default buffersize
68 is too small. DSP_BUFFSIZE must be 64k or less.
70 A rule of thumb is 64k for PAS16, 32k for PAS+, 16k for SB Pro and
73 If you change the DSP_BUFFSIZE, don't modify this file.
74 Use the make config command instead. Seems to allow only 4K, 16K,
79 #define DSP_BUFFSIZE (32760)
83 #define DSP_BUFFCOUNT 1 /* 1 is recommended. */
86 #define DMA_AUTOINIT 0x10 /* XXX never used */
89 #define FM_MONO 0x28d2
91 #define FM_MONO 0x388 /* This is the I/O address used by AdLib */
95 #define AWE32_BASE 0x620 /* Default = 0x620-3, 0xA20-3, 0xE20-3 */
99 #define PAS_BASE 0x388
108 /* SEQ_MAX_QUEUE is the maximum number of sequencer events buffered by the
109 driver. (There is no need to alter this) */
110 #define SEQ_MAX_QUEUE 1024
112 #define SBFM_MAXINSTR (256) /* Size of the FM Instrument bank */
113 /* 128 instruments for general MIDI setup and 16 unassigned */
116 * Minor numbers for the sound driver.
118 * Unfortunately Creative called the codec chip of SB as a DSP. For this
119 * reason the /dev/dsp is reserved for digitized audio use. There is a
120 * device for true DSP processors but it will be called something else.
121 * In v3.0 it's /dev/sndproc but this could be a temporary solution.
124 #define SND_NDEVS 256 /* Number of supported devices */
126 #define SND_DEV_CTL 0 /* Control port /dev/mixer */
127 #define SND_DEV_SEQ 1 /* Sequencer output /dev/sequencer (FM
128 synthesizer and MIDI output) */
129 #define SND_DEV_MIDIN 2 /* Raw midi access */
130 #define SND_DEV_DSP 3 /* Digitized voice /dev/dsp */
131 #define SND_DEV_AUDIO 4 /* Sparc compatible /dev/audio */
132 #define SND_DEV_DSP16 5 /* Like /dev/dsp but 16 bits/sample */
133 #define SND_DEV_STATUS 6 /* /dev/sndstat */
134 /* #7 not in use now. Was in 2.4. Free for use after v3.0. */
135 #define SND_DEV_SEQ2 8 /* /dev/sequencer, level 2 interface */
136 #define SND_DEV_SNDPROC 9 /* /dev/sndproc for programmable devices */
137 #define SND_DEV_PSS SND_DEV_SNDPROC
139 #define DSP_DEFAULT_SPEED 8000
144 #define MAX_AUDIO_DEV 5
145 #define MAX_MIXER_DEV 5
146 #define MAX_SYNTH_DEV 3
147 #define MAX_MIDI_DEV 6
148 #define MAX_TIMER_DEV 3
151 int mode; /* Open mode */
153 int dummy; /* Reference to file-flags. OS-dependent. */
156 struct address_info {
161 int always_detect; /* 1=Trust me, it's there */
163 sound_os_info *osp; /* OS specific info */
164 int card_subtype; /* Driver specific. Usually 0 */
167 #define SYNTH_MAX_VOICES 32
169 struct voice_alloc_info {
172 int ptr; /* For device specific use */
173 unsigned short map[SYNTH_MAX_VOICES]; /* (ch << 8) | (note+1) */
175 int alloc_times[SYNTH_MAX_VOICES];
178 struct channel_info {
181 unsigned char controllers[128];
185 * Process wakeup reasons
188 #define WK_WAKEUP 0x01
189 #define WK_TIMEOUT 0x02
190 #define WK_SIGNAL 0x04
191 #define WK_SLEEP 0x08
193 #define OPEN_READ PCM_ENABLE_INPUT
194 #define OPEN_WRITE PCM_ENABLE_OUTPUT
195 #define OPEN_READWRITE (OPEN_READ|OPEN_WRITE)
197 #include <i386/isa/sound/sound_calls.h>
198 #include <i386/isa/sound/dev_table.h>
204 /* #define DDB(x) x XXX */
208 #define TIMER_ARMED 121234
209 #define TIMER_NOT_ARMED 1