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 34 #undef CONFIGURE_SOUNDCARD 35 #undef DYNAMIC_BUFFER 36 37 #ifdef KERNEL_SOUNDCARD 38 #define CONFIGURE_SOUNDCARD 39 #define DYNAMIC_BUFFER 40 #undef LOADABLE_SOUNDCARD 41 #endif 42 43 #ifdef EXCLUDE_SEQUENCER 44 #define EXCLUDE_MIDI 45 #define EXCLUDE_YM3812 46 #define EXCLUDE_OPL3 47 #endif 48 49 #ifndef SND_DEFAULT_ENABLE 50 #define SND_DEFAULT_ENABLE 1 51 #endif 52 53 /** UWM - new MIDI stuff **/ 54 55 #ifdef EXCLUDE_CHIP_MIDI 56 #define EXCLUDE_PRO_MIDI 57 #endif 58 59 /** UWM - stuff **/ 60 61 #if defined(EXCLUDE_SEQUENCER) && defined(EXCLUDE_AUDIO) 62 #undef CONFIGURE_SOUNDCARD 63 #endif 64 65 #ifdef CONFIGURE_SOUNDCARD 66 67 /* ****** IO-address, DMA and IRQ settings **** 68 69 If your card has nonstandard I/O address or IRQ number, change defines 70 for the following settings in your kernel Makefile */ 71 72 #ifndef SBC_BASE 73 #define SBC_BASE 0x220 /* 0x220 is the factory default. */ 74 #endif 75 76 #ifndef SBC_IRQ 77 #define SBC_IRQ 7 /* IQR7 is the factory default. */ 78 #endif 79 80 #ifndef SBC_DMA 81 #define SBC_DMA 1 82 #endif 83 84 #ifndef SB16_DMA 85 #define SB16_DMA 6 86 #endif 87 88 #ifndef PAS_BASE 89 #define PAS_BASE 0x388 90 #endif 91 92 #ifndef PAS_IRQ 93 #define PAS_IRQ 5 94 #endif 95 96 #ifndef PAS_DMA 97 #define PAS_DMA 3 98 #endif 99 100 #ifndef GUS_BASE 101 #define GUS_BASE 0x220 102 #endif 103 104 #ifndef GUS_IRQ 105 #define GUS_IRQ 15 106 #endif 107 108 #ifndef GUS_MIDI_IRQ 109 #define GUS_MIDI_IRQ GUS_IRQ 110 #endif 111 112 #ifndef GUS_DMA 113 #define GUS_DMA 6 114 #endif 115 116 #ifndef MPU_BASE 117 #define MPU_BASE 0x330 118 #endif 119 120 #ifndef MPU_IRQ 121 #define MPU_IRQ 6 122 #endif 123 124 #ifndef MAX_REALTIME_FACTOR 125 #define MAX_REALTIME_FACTOR 4 126 #endif 127 128 /************* PCM DMA buffer sizes *******************/ 129 130 /* If you are using high playback or recording speeds, the default buffersize 131 is too small. DSP_BUFFSIZE must be 64k or less. 132 133 A rule of thumb is 64k for PAS16, 32k for PAS+, 16k for SB Pro and 134 4k for SB. 135 136 If you change the DSP_BUFFSIZE, don't modify this file. 137 Use the make config command instead. */ 138 139 #ifndef DSP_BUFFSIZE 140 #define DSP_BUFFSIZE (4096) 141 #endif 142 143 #ifndef DSP_BUFFCOUNT 144 #define DSP_BUFFCOUNT 2 /* 2 is recommended. */ 145 #endif 146 147 #define DMA_AUTOINIT 0x10 148 149 #define FM_MONO 0x388 /* This is the I/O address used by AdLib */ 150 151 /* SEQ_MAX_QUEUE is the maximum number of sequencer events buffered by the 152 driver. (There is no need to alter this) */ 153 #define SEQ_MAX_QUEUE 1024 154 155 #define SBFM_MAXINSTR (256) /* Size of the FM Instrument 156 bank */ 157 /* 128 instruments for general MIDI setup and 16 unassigned */ 158 159 #define SND_NDEVS 50 /* Number of supported devices */ 160 #define SND_DEV_CTL 0 /* Control port /dev/mixer */ 161 #define SND_DEV_SEQ 1 /* Sequencer output /dev/sequencer (FM 162 synthesizer and MIDI output) */ 163 #define SND_DEV_MIDIN 2 /* MIDI input /dev/midin (not implemented 164 yet) */ 165 #define SND_DEV_DSP 3 /* Digitized voice /dev/dsp */ 166 #define SND_DEV_AUDIO 4 /* Sparc compatible /dev/audio */ 167 #define SND_DEV_DSP16 5 /* Like /dev/dsp but 16 bits/sample */ 168 #define SND_DEV_STATUS 6 /* /dev/sndstatus */ 169 170 /* UWM ... note add new MIDI devices here.. 171 * Also do not forget to add table midi_supported[] 172 * Minor numbers for on-chip midi devices start from 15.. and 173 * should be contiguous.. viz. 15,16,17.... 174 * ERROR!!!!!!!!! NO NO. Minor numbers above 15 are reserved!!!!!! Hannu 175 * Also note the max # of midi devices as MAX_MIDI_DEV 176 */ 177 178 #define CMIDI_DEV_PRO 15 /* Chip midi device == /dev/pro_midi */ 179 180 /* 181 * Add other midis here... 182 . 183 . 184 . 185 . 186 */ 187 188 #define DSP_DEFAULT_SPEED 8000 189 190 #define ON 1 191 #define OFF 0 192 193 #define MAX_DSP_DEV 4 194 #define MAX_MIXER_DEV 1 195 #define MAX_SYNTH_DEV 3 196 #define MAX_MIDI_DEV 4 197 198 struct fileinfo { 199 int mode; /* Open mode */ 200 }; 201 202 struct address_info { 203 int io_base; 204 int irq; 205 int dma; 206 }; 207 208 /* 209 * Process wakeup reasons 210 */ 211 #define WK_NONE 0x00 212 #define WK_WAKEUP 0x01 213 #define WK_TIMEOUT 0x02 214 #define WK_SIGNAL 0x04 215 #define WK_SLEEP 0x08 216 217 #define OPEN_READ 1 218 #define OPEN_WRITE 2 219 #define OPEN_READWRITE 3 220 221 #include "os.h" 222 #include "sound_calls.h" 223 #include "dev_table.h" 224 225 #ifndef DEB 226 #define DEB(x) 227 #endif 228 229 #endif