Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / sys / dev / sound / isa / i386 / sound_config.h
1 /* sound_config.h
2  *
3  * A driver for Soundcards, misc configuration parameters.
4  *
5  * Copyright by Hannu Savolainen 1995
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
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.
15  *
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
26  * SUCH DAMAGE.
27  *
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 $
30  *
31  */
32
33 /*
34  * many variables should be reduced to a range. Here define a macro
35  */
36
37 #define RANGE(var, low, high) (var) = \
38                               ((var)<(low)?(low) : (var)>(high)?(high) : (var))
39   
40 #undef CONFIGURE_SOUNDCARD
41 #undef DYNAMIC_BUFFER
42
43 #include <i386/isa/sound/local.h>
44
45 #define CONFIGURE_SOUNDCARD
46 #define DYNAMIC_BUFFER
47 #undef LOADABLE_SOUNDCARD
48
49 #include <i386/isa/sound/os.h>
50 #include <i386/isa/sound/soundvers.h>
51
52 #if defined(ISC) || defined(SCO) || defined(SVR42)
53 #define GENERIC_SYSV
54 #endif
55
56 #ifndef SND_DEFAULT_ENABLE
57 #define SND_DEFAULT_ENABLE      1
58 #endif
59
60 #ifdef CONFIGURE_SOUNDCARD
61
62 #ifndef MAX_REALTIME_FACTOR
63 #define MAX_REALTIME_FACTOR     4
64 #endif
65
66 /************* PCM DMA buffer sizes *******************/
67
68 /* If you are using high playback or recording speeds, the default buffersize
69    is too small. DSP_BUFFSIZE must be 64k or less.
70
71    A rule of thumb is 64k for PAS16, 32k for PAS+, 16k for SB Pro and
72    4k for SB.
73
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,
76    32K, 64K.
77  */
78
79 #ifndef DSP_BUFFSIZE
80 #define DSP_BUFFSIZE            (32760)
81 #endif
82
83 #ifndef DSP_BUFFCOUNT
84 #define DSP_BUFFCOUNT           1       /* 1 is recommended. */
85 #endif
86
87 #define DMA_AUTOINIT            0x10    /* XXX never used */
88
89 #ifdef PC98
90 #define FM_MONO         0x28d2
91 #else
92 #define FM_MONO         0x388   /* This is the I/O address used by AdLib */
93 #endif
94
95 #ifndef AWE32_BASE
96 #define AWE32_BASE      0x620   /* Default = 0x620-3, 0xA20-3, 0xE20-3 */
97 #endif
98
99 #ifndef PAS_BASE
100 #define PAS_BASE        0x388
101 #endif
102
103 #ifdef JAZZ16
104 #ifndef JAZZ_DMA16
105 #define JAZZ_DMA16      5
106 #endif
107 #endif
108
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
112
113 #define SBFM_MAXINSTR           (256)   /* Size of the FM Instrument bank */
114 /* 128 instruments for general MIDI setup and 16 unassigned      */
115
116 /*
117  * Minor numbers for the sound driver.
118  *
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.
123  */
124
125 #define SND_NDEVS       256     /* Number of supported devices */
126
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
139
140 #define DSP_DEFAULT_SPEED       8000
141
142 #define ON              1
143 #define OFF             0
144
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
150
151 struct fileinfo {
152         int mode;             /* Open mode */
153         int flags;
154         int dummy;     /* Reference to file-flags. OS-dependent. */
155 };
156
157 struct address_info {
158         int io_base;
159         int irq;
160         int dma;
161         int dma2;
162         int always_detect;      /* 1=Trust me, it's there */
163         char *name;
164         sound_os_info *osp;     /* OS specific info */
165         int card_subtype;       /* Driver specific. Usually 0 */
166 };
167
168 #define SYNTH_MAX_VOICES        32
169
170 struct voice_alloc_info {
171         int max_voice;
172         int used_voices;
173         int ptr;                /* For device specific use */
174         unsigned short map[SYNTH_MAX_VOICES]; /* (ch << 8) | (note+1) */
175         int timestamp;
176         int alloc_times[SYNTH_MAX_VOICES];
177 };
178
179 struct channel_info {
180         int pgm_num;
181         int bender_value;
182         unsigned char controllers[128];
183 };
184
185 /*
186  * Process wakeup reasons
187  */
188 #define WK_NONE         0x00
189 #define WK_WAKEUP       0x01
190 #define WK_TIMEOUT      0x02
191 #define WK_SIGNAL       0x04
192 #define WK_SLEEP        0x08
193
194 #define OPEN_READ       PCM_ENABLE_INPUT
195 #define OPEN_WRITE      PCM_ENABLE_OUTPUT
196 #define OPEN_READWRITE  (OPEN_READ|OPEN_WRITE)
197
198 #include <i386/isa/sound/sound_calls.h>
199 #include <i386/isa/sound/dev_table.h>
200
201 #ifndef DEB
202 #define DEB(x)
203 #endif
204 #ifndef DDB
205 /* #define DDB(x)       x        XXX */
206 #define DDB(x)
207 #endif
208
209 #define TIMER_ARMED     121234
210 #define TIMER_NOT_ARMED 1
211
212 #endif