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 #include "os.h"
33 #include "soundvers.h"
34
35 #if !defined(PSS_MPU_BASE) && defined(EXCLUDE_SSCAPE) && \
36 defined(EXCLUDE_TRIX) && !defined(MAD16_MPU_BASE)
37 #defineEXCLUDE_MPU_EMU 38 #endif 39
40 #ifdefined(ISC) || defined(SCO) || defined(SVR42)
41 #defineGENERIC_SYSV 42 #endif 43
44 /* 45 * Disable the AD1848 driver if there are no other drivers requiring it. 46 */ 47
48 #ifdefined(EXCLUDE_GUS16) && defined(EXCLUDE_MSS) && \
49 defined(EXCLUDE_PSS) && defined(EXCLUDE_GUSMAX) && \
50 defined(EXCLUDE_SSCAPE) && defined(EXCLUDE_TRIX) && defined(EXCLUDE_MAD16)
51 #defineEXCLUDE_AD1848 52 #endif 53
54 #ifdefPSS_MSS_BASE 55 #undefEXCLUDE_AD1848 56 #endif 57
58 #undefCONFIGURE_SOUNDCARD 59 #undef DYNAMIC_BUFFER
60
61 #ifdef KERNEL_SOUNDCARD
62 #defineCONFIGURE_SOUNDCARD 63 #define DYNAMIC_BUFFER
64 #undef LOADABLE_SOUNDCARD
65 #endif 66
67 #ifdefEXCLUDE_SEQUENCER 68 #defineEXCLUDE_MIDI 69 #defineEXCLUDE_YM3812 70 #define EXCLUDE_OPL3
71 #endif 72
73 #ifndefSND_DEFAULT_ENABLE 74 #defineSND_DEFAULT_ENABLE 1
75 #endif 76
77 #ifdefCONFIGURE_SOUNDCARD 78
79 #ifndefMAX_REALTIME_FACTOR 80 #defineMAX_REALTIME_FACTOR 4
81 #endif 82
83 /************* PCM DMA buffer sizes *******************/ 84
85 /* If you are using high playback or recording speeds, the default buffersize 86 is too small. DSP_BUFFSIZE must be 64k or less. 87
88 A rule of thumb is 64k for PAS16, 32k for PAS+, 16k for SB Pro and 89 4k for SB. 90
91 If you change the DSP_BUFFSIZE, don't modify this file. 92 Use the make config command instead. */ 93
94 #ifndefDSP_BUFFSIZE 95 #defineDSP_BUFFSIZE (4096)
96 #endif 97
98 #ifndefDSP_BUFFCOUNT 99 #defineDSP_BUFFCOUNT 2 /* 2 is recommended. */ 100 #endif 101
102 #defineDMA_AUTOINIT 0x10
103
104 #defineFM_MONO 0x388 /* This is the I/O address used by AdLib */ 105
106 #ifndefPAS_BASE 107 #definePAS_BASE 0x388
108 #endif 109
110 /* SEQ_MAX_QUEUE is the maximum number of sequencer events buffered by the 111 driver. (There is no need to alter this) */ 112 #defineSEQ_MAX_QUEUE 1024
113
114 #defineSBFM_MAXINSTR (256) /* Size of the FM Instrument bank */ 115 /* 128 instruments for general MIDI setup and 16 unassigned */ 116
117 /* 118 * Minor numbers for the sound driver. 119 * 120 * Unfortunately Creative called the codec chip of SB as a DSP. For this 121 * reason the /dev/dsp is reserved for digitized audio use. There is a 122 * device for true DSP processors but it will be called something else. 123 * In v3.0 it's /dev/sndproc but this could be a temporary solution. 124 */ 125
126 #defineSND_NDEVS 256 /* Number of supported devices */ 127 #defineSND_DEV_CTL 0 /* Control port /dev/mixer */ 128 #defineSND_DEV_SEQ 1 /* Sequencer output /dev/sequencer (FM 129 synthesizer and MIDI output) */ 130 #defineSND_DEV_MIDIN 2 /* Raw midi access */ 131 #defineSND_DEV_DSP 3 /* Digitized voice /dev/dsp */ 132 #defineSND_DEV_AUDIO 4 /* Sparc compatible /dev/audio */ 133 #defineSND_DEV_DSP16 5 /* Like /dev/dsp but 16 bits/sample */ 134 #defineSND_DEV_STATUS 6 /* /dev/sndstat */ 135 /* #7 not in use now. Was in 2.4. Free for use after v3.0. */ 136 #defineSND_DEV_SEQ2 8 /* /dev/sequecer, level 2 interface */ 137 #defineSND_DEV_SNDPROC 9 /* /dev/sndproc for programmable devices */ 138 #define SND_DEV_PSS SND_DEV_SNDPROC 139
140 #defineDSP_DEFAULT_SPEED 8000
141
142 #defineON 1
143 #defineOFF 0
144
145 #defineMAX_AUDIO_DEV 5
146 #defineMAX_MIXER_DEV 5
147 #defineMAX_SYNTH_DEV 3
148 #defineMAX_MIDI_DEV 6
149 #defineMAX_TIMER_DEV 3
150
151 structfileinfo{ 152 intmode; /* Open mode */ 153 DECLARE_FILE(); /* Reference to file-flags. OS-dependent. */ 154 };
155
156 structaddress_info{ 157 intio_base;
158 intirq;
159 intdma;
160 intalways_detect; /* 1=Trust me, it's there */ 161 };
162
163 #defineSYNTH_MAX_VOICES 32
164
165 structvoice_alloc_info{ 166 intmax_voice;
167 int used_voices;
168 intptr; /* For device specific use */ 169 unsignedshortmap[SYNTH_MAX_VOICES]; /* (ch << 8) | (note+1) */ 170 inttimestamp;
171 intalloc_times[SYNTH_MAX_VOICES];
172 };
173
174 structchannel_info{ 175 intpgm_num;
176 intbender_value;
177 unsignedcharcontrollers[128];
178 };
179
180 /* 181 * Process wakeup reasons 182 */ 183 #defineWK_NONE 0x00
184 #defineWK_WAKEUP 0x01
185 #defineWK_TIMEOUT 0x02
186 #define WK_SIGNAL 0x04
187 #defineWK_SLEEP 0x08
188
189 #defineOPEN_READ 1
190 #defineOPEN_WRITE 2
191 #defineOPEN_READWRITE 3
192
193 #include "sound_calls.h"
194 #include "dev_table.h"
195
196 #ifndefDEB 197 #defineDEB(x)
198 #endif 199
200 #ifndefDDB 201 #defineDDB(x)
202 #endif 203
204 #defineTIMER_ARMED 121234
205 #defineTIMER_NOT_ARMED 1
206
207 #endif