1 /* sound_config.h 2 * 3 * A driver for Soundcards, misc configuration parameters. 4 * 5 * 6 * Copyright by Hannu Savolainen 1993 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 */ 30
31 #include "local.h"
32
33 #ifdefined(ISC) || defined(SCO) || defined(SVR42)
34 #defineGENERIC_SYSV 35 #endif 36
37 /* 38 * Disable the AD1848 driver if there are no other drivers requiring it. 39 */ 40
41 #ifdefined(EXCLUDE_GUS16) && defined(EXCLUDE_MSS) && defined(EXCLUDE_PSS) && defined(EXCLUDE_GUSMAX)
42 #defineEXCLUDE_AD1848 43 #endif 44
45 #undefCONFIGURE_SOUNDCARD 46 #undef DYNAMIC_BUFFER
47
48 #ifdef KERNEL_SOUNDCARD
49 #defineCONFIGURE_SOUNDCARD 50 #define DYNAMIC_BUFFER
51 #undef LOADABLE_SOUNDCARD
52 #endif 53
54 #ifdefEXCLUDE_SEQUENCER 55 #defineEXCLUDE_MIDI 56 #defineEXCLUDE_YM3812 57 #define EXCLUDE_OPL3
58 #endif 59
60 #ifndefSND_DEFAULT_ENABLE 61 #defineSND_DEFAULT_ENABLE 1
62 #endif 63
64 #ifdefCONFIGURE_SOUNDCARD 65
66 /* ****** IO-address, DMA and IRQ settings **** 67
68 If your card has nonstandard I/O address or IRQ number, change defines 69 for the following settings in your kernel Makefile */ 70
71 #ifndefSBC_BASE 72 #defineSBC_BASE 0x220 /* 0x220 is the factory default. */ 73 #endif 74
75 #ifndefSBC_IRQ 76 #defineSBC_IRQ 7 /* IQR7 is the factory default. */ 77 #endif 78
79 #ifndefSBC_DMA 80 #defineSBC_DMA 1
81 #endif 82
83 #ifndefSB16_DMA 84 #defineSB16_DMA 6
85 #endif 86
87 #ifndefSB16MIDI_BASE 88 #defineSB16MIDI_BASE 0x300
89 #endif 90
91 #ifndefPAS_BASE 92 #definePAS_BASE 0x388
93 #endif 94
95 #ifndefPAS_IRQ 96 #definePAS_IRQ 5
97 #endif 98
99 #ifndefPAS_DMA 100 #definePAS_DMA 3
101 #endif 102
103 #ifndefGUS_BASE 104 #defineGUS_BASE 0x220
105 #endif 106
107 #ifndefGUS_IRQ 108 #defineGUS_IRQ 15
109 #endif 110
111 #ifndefGUS_MIDI_IRQ 112 #defineGUS_MIDI_IRQGUS_IRQ 113 #endif 114
115 #ifndefGUS_DMA 116 #defineGUS_DMA 6
117 #endif 118
119 #ifndefMPU_BASE 120 #defineMPU_BASE 0x330
121 #endif 122
123 #ifndefMPU_IRQ 124 #defineMPU_IRQ 6
125 #endif 126
127 /* Echo Personal Sound System */ 128 #ifndefPSS_BASE 129 #definePSS_BASE 0x220 /* 0x240 or */ 130 #endif 131
132 #ifndefPSS_IRQ 133 #definePSS_IRQ 7
134 #endif 135
136 #ifndefPSS_DMA 137 #definePSS_DMA 1
138 #endif 139
140 #ifndefMAX_REALTIME_FACTOR 141 #defineMAX_REALTIME_FACTOR 4
142 #endif 143
144 /************* PCM DMA buffer sizes *******************/ 145
146 /* If you are using high playback or recording speeds, the default buffersize 147 is too small. DSP_BUFFSIZE must be 64k or less. 148
149 A rule of thumb is 64k for PAS16, 32k for PAS+, 16k for SB Pro and 150 4k for SB. 151
152 If you change the DSP_BUFFSIZE, don't modify this file. 153 Use the make config command instead. */ 154
155 #ifndefDSP_BUFFSIZE 156 #defineDSP_BUFFSIZE (4096)
157 #endif 158
159 #ifndefDSP_BUFFCOUNT 160 #defineDSP_BUFFCOUNT 2 /* 2 is recommended. */ 161 #endif 162
163 #defineDMA_AUTOINIT 0x10
164
165 #defineFM_MONO 0x388 /* This is the I/O address used by AdLib */ 166
167 /* SEQ_MAX_QUEUE is the maximum number of sequencer events buffered by the 168 driver. (There is no need to alter this) */ 169 #defineSEQ_MAX_QUEUE 1024
170
171 #defineSBFM_MAXINSTR (256) /* Size of the FM Instrument bank */ 172 /* 128 instruments for general MIDI setup and 16 unassigned */ 173
174 /* 175 * Minor numbers for the sound driver. 176 * 177 * Unfortunately Creative called the codec chip of SB as a DSP. For this 178 * reason the /dev/dsp is reserved for digitized audio use. There is a 179 * device for true DSP processors but it will be called something else. 180 * In v3.0 it's /dev/sndproc but this could be a temporary solution. 181 */ 182
183 #defineSND_NDEVS 256 /* Number of supported devices */ 184 #defineSND_DEV_CTL 0 /* Control port /dev/mixer */ 185 #defineSND_DEV_SEQ 1 /* Sequencer output /dev/sequencer (FM 186 synthesizer and MIDI output) */ 187 #defineSND_DEV_MIDIN 2 /* Raw midi access */ 188 #defineSND_DEV_DSP 3 /* Digitized voice /dev/dsp */ 189 #defineSND_DEV_AUDIO 4 /* Sparc compatible /dev/audio */ 190 #defineSND_DEV_DSP16 5 /* Like /dev/dsp but 16 bits/sample */ 191 #defineSND_DEV_STATUS 6 /* /dev/sndstat */ 192 /* #7 not in use now. Was in 2.4. Free for use after v3.0. */ 193 #defineSND_DEV_SEQ2 8 /* /dev/sequencer, level 2 interface */ 194 #defineSND_DEV_SNDPROC 9 /* /dev/sndproc for programmable devices */ 195 #defineSND_DEV_PSSSND_DEV_SNDPROC 196
197 #defineDSP_DEFAULT_SPEED 8000
198
199 #defineON 1
200 #defineOFF 0
201
202 #defineMAX_AUDIO_DEV 5
203 #defineMAX_MIXER_DEV 2
204 #defineMAX_SYNTH_DEV 3
205 #defineMAX_MIDI_DEV 6
206 #defineMAX_TIMER_DEV 3
207
208 structfileinfo{ 209 intmode; /* Open mode */ 210 };
211
212 structaddress_info{ 213 intio_base;
214 intirq;
215 intdma;
216 };
217
218 #defineSYNTH_MAX_VOICES 32
219
220 structvoice_alloc_info{ 221 intmax_voice;
222 int used_voices;
223 intptr; /* For device specific use */ 224 unsignedshortmap[SYNTH_MAX_VOICES]; /* (ch << 8) | (note+1) */ 225 };
226
227 structchannel_info{ 228 intpgm_num;
229 unsignedcharcontrollers[128];
230 };
231
232 /* 233 * Process wakeup reasons 234 */ 235 #defineWK_NONE 0x00
236 #defineWK_WAKEUP 0x01
237 #defineWK_TIMEOUT 0x02
238 #define WK_SIGNAL 0x04
239 #defineWK_SLEEP 0x08
240
241 #defineOPEN_READ 1
242 #defineOPEN_WRITE 2
243 #defineOPEN_READWRITE 3
244
245 #include "os.h"
246 #include "sound_calls.h"
247 #include "dev_table.h"
248
249 #ifndefDEB 250 #defineDEB(x)
251
252 #defineTIMER_ARMED 121234
253 #defineTIMER_NOT_ARMED 1
254
255 #define FUTURE_VERSION
256 #endif 257
258 #endif