root/drivers/sound/sound_config.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /* sound_config.h
   2  *
   3  * A driver for Soundcards, misc configuration parameters.
   4  *
   5  * 
   6  * Copyright by Hannu Savolainen 1995
   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 #undef CONFIGURE_SOUNDCARD
  32 #undef DYNAMIC_BUFFER
  33 
  34 #include "local.h"
  35 
  36 #ifdef KERNEL_SOUNDCARD
  37 #define CONFIGURE_SOUNDCARD
  38 #define DYNAMIC_BUFFER
  39 #undef LOADABLE_SOUNDCARD
  40 #endif
  41 
  42 #include "os.h"
  43 #include "soundvers.h"
  44 
  45 #if !defined(PSS_MPU_BASE) && defined(EXCLUDE_SSCAPE) && \
  46       defined(EXCLUDE_TRIX) && !defined(MAD16_MPU_BASE) && \
  47       defined(EXCLUDE_CS4232) && defined(EXCLUDE_MAUI)
  48 #define EXCLUDE_MPU_EMU
  49 #endif
  50 
  51 #if defined(ISC) || defined(SCO) || defined(SVR42)
  52 #define GENERIC_SYSV
  53 #endif
  54 
  55 /*
  56  * Disable the AD1848 driver if there are no other drivers requiring it.
  57  */
  58 
  59 #if defined(EXCLUDE_GUS16) && defined(EXCLUDE_MSS) && \
  60     defined(EXCLUDE_PSS) && defined(EXCLUDE_GUSMAX) && \
  61     defined(EXCLUDE_SSCAPE) && defined(EXCLUDE_TRIX) && defined(EXCLUDE_MAD16) && \
  62     defined(EXCLUDE_CS4232) && defined(EXCLUDE_PNP)
  63 #define EXCLUDE_AD1848
  64 #endif
  65 
  66 #ifdef PSS_MSS_BASE
  67 #undef EXCLUDE_AD1848
  68 #endif
  69 
  70 #ifdef EXCLUDE_SEQUENCER
  71 #define EXCLUDE_MIDI
  72 #define EXCLUDE_YM3812
  73 #define EXCLUDE_OPL3
  74 #endif
  75 
  76 #ifndef SND_DEFAULT_ENABLE
  77 #define SND_DEFAULT_ENABLE      1
  78 #endif
  79 
  80 #ifdef CONFIGURE_SOUNDCARD
  81 
  82 #ifndef MAX_REALTIME_FACTOR
  83 #define MAX_REALTIME_FACTOR     4
  84 #endif
  85 
  86 /************* PCM DMA buffer sizes *******************/
  87 
  88 /* If you are using high playback or recording speeds, the default buffersize
  89    is too small. DSP_BUFFSIZE must be 64k or less.
  90 
  91    A rule of thumb is 64k for PAS16, 32k for PAS+, 16k for SB Pro and
  92    4k for SB.
  93 
  94    If you change the DSP_BUFFSIZE, don't modify this file.
  95    Use the make config command instead. */
  96 
  97 #ifndef DSP_BUFFSIZE
  98 #define DSP_BUFFSIZE            (4096)
  99 #endif
 100 
 101 #ifndef DSP_BUFFCOUNT
 102 #define DSP_BUFFCOUNT           1       /* 1 is recommended. */
 103 #endif
 104 
 105 #define DMA_AUTOINIT            0x10
 106 
 107 #define FM_MONO         0x388   /* This is the I/O address used by AdLib */
 108 
 109 #ifndef PAS_BASE
 110 #define PAS_BASE        0x388
 111 #endif
 112 
 113 #ifdef JAZZ16
 114 #ifndef JAZZ_DMA16
 115 #define JAZZ_DMA16      5
 116 #endif
 117 #endif
 118 
 119 /* SEQ_MAX_QUEUE is the maximum number of sequencer events buffered by the
 120    driver. (There is no need to alter this) */
 121 #define SEQ_MAX_QUEUE   1024
 122 
 123 #define SBFM_MAXINSTR           (256)   /* Size of the FM Instrument bank */
 124 /* 128 instruments for general MIDI setup and 16 unassigned      */
 125 
 126 /*
 127  * Minor numbers for the sound driver.
 128  *
 129  * Unfortunately Creative called the codec chip of SB as a DSP. For this
 130  * reason the /dev/dsp is reserved for digitized audio use. There is a
 131  * device for true DSP processors but it will be called something else.
 132  * In v3.0 it's /dev/sndproc but this could be a temporary solution.
 133  */
 134 
 135 #define SND_NDEVS       256     /* Number of supported devices */
 136 #define SND_DEV_CTL     0       /* Control port /dev/mixer */
 137 #define SND_DEV_SEQ     1       /* Sequencer output /dev/sequencer (FM
 138                                    synthesizer and MIDI output) */
 139 #define SND_DEV_MIDIN   2       /* Raw midi access */
 140 #define SND_DEV_DSP     3       /* Digitized voice /dev/dsp */
 141 #define SND_DEV_AUDIO   4       /* Sparc compatible /dev/audio */
 142 #define SND_DEV_DSP16   5       /* Like /dev/dsp but 16 bits/sample */
 143 #define SND_DEV_STATUS  6       /* /dev/sndstat */
 144 /* #7 not in use now. Was in 2.4. Free for use after v3.0. */
 145 #define SND_DEV_SEQ2    8       /* /dev/sequecer, level 2 interface */
 146 #define SND_DEV_SNDPROC 9       /* /dev/sndproc for programmable devices */
 147 #define SND_DEV_PSS     SND_DEV_SNDPROC
 148 
 149 #define DSP_DEFAULT_SPEED       8000
 150 
 151 #define ON              1
 152 #define OFF             0
 153 
 154 #define MAX_AUDIO_DEV   5
 155 #define MAX_MIXER_DEV   5
 156 #define MAX_SYNTH_DEV   3
 157 #define MAX_MIDI_DEV    6
 158 #define MAX_TIMER_DEV   3
 159 
 160 struct fileinfo {
 161           int mode;           /* Open mode */
 162           struct file *filp;     /* Reference to file-flags. OS-dependent. */
 163        };
 164 
 165 struct address_info {
 166         int io_base;
 167         int irq;
 168         int dma;
 169         int dma2;
 170         int always_detect;      /* 1=Trust me, it's there */
 171         char *name;
 172         int driver_use_1;       /* Driver defined field 1 */
 173         int driver_use_2;       /* Driver defined field 2 */
 174         sound_os_info *osp;     /* OS spesific info */
 175 };
 176 
 177 #define SYNTH_MAX_VOICES        32
 178 
 179 struct voice_alloc_info {
 180                 int max_voice;
 181                 int used_voices;
 182                 int ptr;                /* For device specific use */
 183                 unsigned short map[SYNTH_MAX_VOICES]; /* (ch << 8) | (note+1) */
 184                 int timestamp;
 185                 int alloc_times[SYNTH_MAX_VOICES];
 186         };
 187 
 188 struct channel_info {
 189                 int pgm_num;
 190                 int bender_value;
 191                 unsigned char controllers[128];
 192         };
 193 
 194 /*
 195  * Process wakeup reasons
 196  */
 197 #define WK_NONE         0x00
 198 #define WK_WAKEUP       0x01
 199 #define WK_TIMEOUT      0x02
 200 #define WK_SIGNAL       0x04
 201 #define WK_SLEEP        0x08
 202 
 203 #define OPEN_READ       PCM_ENABLE_INPUT
 204 #define OPEN_WRITE      PCM_ENABLE_OUTPUT
 205 #define OPEN_READWRITE  (OPEN_READ|OPEN_WRITE)
 206 
 207 #include "sound_calls.h"
 208 #include "dev_table.h"
 209 
 210 #ifndef DEB
 211 #define DEB(x)
 212 #endif
 213 
 214 #ifndef DDB
 215 #define DDB(x)
 216 #endif
 217 
 218 #define TIMER_ARMED     121234
 219 #define TIMER_NOT_ARMED 1
 220 
 221 #endif

/* [previous][next][first][last][top][bottom][index][help] */