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 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 #define EXCLUDE_MPU_EMU
  38 #endif
  39 
  40 #if defined(ISC) || defined(SCO) || defined(SVR42)
  41 #define GENERIC_SYSV
  42 #endif
  43 
  44 /*
  45  * Disable the AD1848 driver if there are no other drivers requiring it.
  46  */
  47 
  48 #if defined(EXCLUDE_GUS16) && defined(EXCLUDE_MSS) && \
  49     defined(EXCLUDE_PSS) && defined(EXCLUDE_GUSMAX) && \
  50     defined(EXCLUDE_SSCAPE) && defined(EXCLUDE_TRIX) && defined(EXCLUDE_MAD16)
  51 #define EXCLUDE_AD1848
  52 #endif
  53 
  54 #ifdef PSS_MSS_BASE
  55 #undef EXCLUDE_AD1848
  56 #endif
  57 
  58 #undef CONFIGURE_SOUNDCARD
  59 #undef DYNAMIC_BUFFER
  60 
  61 #ifdef KERNEL_SOUNDCARD
  62 #define CONFIGURE_SOUNDCARD
  63 #define DYNAMIC_BUFFER
  64 #undef LOADABLE_SOUNDCARD
  65 #endif
  66 
  67 #ifdef EXCLUDE_SEQUENCER
  68 #define EXCLUDE_MIDI
  69 #define EXCLUDE_YM3812
  70 #define EXCLUDE_OPL3
  71 #endif
  72 
  73 #ifndef SND_DEFAULT_ENABLE
  74 #define SND_DEFAULT_ENABLE      1
  75 #endif
  76 
  77 #ifdef CONFIGURE_SOUNDCARD
  78 
  79 #ifndef MAX_REALTIME_FACTOR
  80 #define MAX_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 #ifndef DSP_BUFFSIZE
  95 #define DSP_BUFFSIZE            (4096)
  96 #endif
  97 
  98 #ifndef DSP_BUFFCOUNT
  99 #define DSP_BUFFCOUNT           2       /* 2 is recommended. */
 100 #endif
 101 
 102 #define DMA_AUTOINIT            0x10
 103 
 104 #define FM_MONO         0x388   /* This is the I/O address used by AdLib */
 105 
 106 /* SEQ_MAX_QUEUE is the maximum number of sequencer events buffered by the
 107    driver. (There is no need to alter this) */
 108 #define SEQ_MAX_QUEUE   1024
 109 
 110 #define SBFM_MAXINSTR           (256)   /* Size of the FM Instrument bank */
 111 /* 128 instruments for general MIDI setup and 16 unassigned      */
 112 
 113 /*
 114  * Minor numbers for the sound driver.
 115  *
 116  * Unfortunately Creative called the codec chip of SB as a DSP. For this
 117  * reason the /dev/dsp is reserved for digitized audio use. There is a
 118  * device for true DSP processors but it will be called something else.
 119  * In v3.0 it's /dev/sndproc but this could be a temporary solution.
 120  */
 121 
 122 #define SND_NDEVS       256     /* Number of supported devices */
 123 #define SND_DEV_CTL     0       /* Control port /dev/mixer */
 124 #define SND_DEV_SEQ     1       /* Sequencer output /dev/sequencer (FM
 125                                    synthesizer and MIDI output) */
 126 #define SND_DEV_MIDIN   2       /* Raw midi access */
 127 #define SND_DEV_DSP     3       /* Digitized voice /dev/dsp */
 128 #define SND_DEV_AUDIO   4       /* Sparc compatible /dev/audio */
 129 #define SND_DEV_DSP16   5       /* Like /dev/dsp but 16 bits/sample */
 130 #define SND_DEV_STATUS  6       /* /dev/sndstat */
 131 /* #7 not in use now. Was in 2.4. Free for use after v3.0. */
 132 #define SND_DEV_SEQ2    8       /* /dev/sequecer, level 2 interface */
 133 #define SND_DEV_SNDPROC 9       /* /dev/sndproc for programmable devices */
 134 #define SND_DEV_PSS     SND_DEV_SNDPROC
 135 
 136 #define DSP_DEFAULT_SPEED       8000
 137 
 138 #define ON              1
 139 #define OFF             0
 140 
 141 #define MAX_AUDIO_DEV   5
 142 #define MAX_MIXER_DEV   5
 143 #define MAX_SYNTH_DEV   3
 144 #define MAX_MIDI_DEV    6
 145 #define MAX_TIMER_DEV   3
 146 
 147 struct fileinfo {
 148           int mode;           /* Open mode */
 149           DECLARE_FILE();     /* Reference to file-flags. OS-dependent. */
 150        };
 151 
 152 struct address_info {
 153         int io_base;
 154         int irq;
 155         int dma;
 156         int always_detect;      /* 1=Trust me, it's there */
 157 };
 158 
 159 #define SYNTH_MAX_VOICES        32
 160 
 161 struct voice_alloc_info {
 162                 int max_voice;
 163                 int used_voices;
 164                 int ptr;                /* For device specific use */
 165                 unsigned short map[SYNTH_MAX_VOICES]; /* (ch << 8) | (note+1) */
 166                 int timestamp;
 167                 int alloc_times[SYNTH_MAX_VOICES];
 168         };
 169 
 170 struct channel_info {
 171                 int pgm_num;
 172                 int bender_value;
 173                 unsigned char controllers[128];
 174         };
 175 
 176 /*
 177  * Process wakeup reasons
 178  */
 179 #define WK_NONE         0x00
 180 #define WK_WAKEUP       0x01
 181 #define WK_TIMEOUT      0x02
 182 #define WK_SIGNAL       0x04
 183 #define WK_SLEEP        0x08
 184 
 185 #define OPEN_READ       1
 186 #define OPEN_WRITE      2
 187 #define OPEN_READWRITE  3
 188 
 189 #include "sound_calls.h"
 190 #include "dev_table.h"
 191 
 192 #ifndef DEB
 193 #define DEB(x)
 194 #endif
 195 
 196 #ifndef DDB
 197 #define DDB(x)
 198 #endif
 199 
 200 #define TIMER_ARMED     121234
 201 #define TIMER_NOT_ARMED 1
 202 
 203 #endif

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