OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [drivers/] [sound/] [sound_config.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1626 jcastillo
/* sound_config.h
2
 *
3
 * A driver for Soundcards, misc configuration parameters.
4
 */
5
/*
6
 * Copyright (C) by Hannu Savolainen 1993-1996
7
 *
8
 * USS/Lite for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
9
 * Version 2 (June 1991). See the "COPYING" file distributed with this software
10
 * for more info.
11
 */
12
 
13
 
14
#include "local.h"
15
#include "os.h"
16
#include "soundvers.h"
17
 
18
#if defined(ISC) || defined(SCO) || defined(SVR42)
19
#define GENERIC_SYSV
20
#endif
21
 
22
 
23
 
24
 
25
 
26
 
27
#ifndef SND_DEFAULT_ENABLE
28
#define SND_DEFAULT_ENABLE      1
29
#endif
30
 
31
#ifndef MAX_REALTIME_FACTOR
32
#define MAX_REALTIME_FACTOR     4
33
#endif
34
 
35
/************* PCM DMA buffer sizes *******************/
36
 
37
/* If you are using high playback or recording speeds, the default buffer size
38
   is too small. DSP_BUFFSIZE must be 64k or less.
39
 
40
   A rule of thumb is 64k for PAS16, 32k for PAS+, 16k for SB Pro and
41
   4k for SB.
42
 
43
   If you change the DSP_BUFFSIZE, don't modify this file.
44
   Use the make config command instead. */
45
 
46
#ifndef DSP_BUFFSIZE
47
#define DSP_BUFFSIZE            (4096)
48
#endif
49
 
50
#ifndef DSP_BUFFCOUNT
51
#define DSP_BUFFCOUNT           1       /* 1 is recommended. */
52
#endif
53
 
54
#define DMA_AUTOINIT            0x10
55
 
56
#define FM_MONO         0x388   /* This is the I/O address used by AdLib */
57
 
58
#ifndef PAS_BASE
59
#define PAS_BASE        0x388
60
#endif
61
 
62
#if defined(SB16_DMA) && !defined(SB_DMA2)
63
#  define SB_DMA2 SB16_DMA
64
#endif
65
 
66
#if defined(SB16MIDI_BASE) && !defined(SB_MPU_BASE)
67
#   define SB_MPU_BASE SB16MIDI_BASE
68
#endif
69
 
70
#ifndef SB_MPU_IRQ
71
#  define SB_MPU_IRQ SBC_IRQ
72
#endif
73
 
74
/* SEQ_MAX_QUEUE is the maximum number of sequencer events buffered by the
75
   driver. (There is no need to alter this) */
76
#define SEQ_MAX_QUEUE   1024
77
 
78
#define SBFM_MAXINSTR           (256)   /* Size of the FM Instrument bank */
79
/* 128 instruments for general MIDI setup and 16 unassigned      */
80
 
81
/*
82
 * Minor numbers for the sound driver.
83
 *
84
 * Unfortunately Creative called the codec chip of SB as a DSP. For this
85
 * reason the /dev/dsp is reserved for digitized audio use. There is a
86
 * device for true DSP processors but it will be called something else.
87
 * In v3.0 it's /dev/sndproc but this could be a temporary solution.
88
 */
89
 
90
#define SND_NDEVS       256     /* Number of supported devices */
91
#define SND_DEV_CTL     0        /* Control port /dev/mixer */
92
#define SND_DEV_SEQ     1       /* Sequencer output /dev/sequencer (FM
93
                                   synthesizer and MIDI output) */
94
#define SND_DEV_MIDIN   2       /* Raw midi access */
95
#define SND_DEV_DSP     3       /* Digitized voice /dev/dsp */
96
#define SND_DEV_AUDIO   4       /* Sparc compatible /dev/audio */
97
#define SND_DEV_DSP16   5       /* Like /dev/dsp but 16 bits/sample */
98
#define SND_DEV_STATUS  6       /* /dev/sndstat */
99
#define SND_DEV_AWFM    7       /* Reserved */
100
#define SND_DEV_SEQ2    8       /* /dev/sequencer, level 2 interface */
101
#define SND_DEV_SNDPROC 9       /* /dev/sndproc for programmable devices */
102
#define SND_DEV_PSS     SND_DEV_SNDPROC
103
 
104
#define DSP_DEFAULT_SPEED       8000
105
 
106
#define ON              1
107
#define OFF             0
108
 
109
#define MAX_AUDIO_DEV   5
110
#define MAX_MIXER_DEV   5
111
#define MAX_SYNTH_DEV   3
112
#define MAX_MIDI_DEV    6
113
#define MAX_TIMER_DEV   3
114
 
115
struct fileinfo {
116
          int mode;           /* Open mode */
117
          int flags;
118
          int dummy;     /* Reference to file-flags. OS-dependent. */
119
       };
120
 
121
struct address_info {
122
        int io_base;
123
        int irq;
124
        int dma;
125
        int dma2;
126
        int always_detect;      /* 1=Trust me, it's there */
127
        char *name;
128
        int driver_use_1;       /* Driver defined field 1 */
129
        int driver_use_2;       /* Driver defined field 2 */
130
        int *osp;       /* OS specific info */
131
        int card_subtype;       /* Driver specific. Usually 0 */
132
};
133
 
134
#define SYNTH_MAX_VOICES        32
135
 
136
struct voice_alloc_info {
137
                int max_voice;
138
                int used_voices;
139
                int ptr;                /* For device specific use */
140
                unsigned short map[SYNTH_MAX_VOICES]; /* (ch << 8) | (note+1) */
141
                int timestamp;
142
                int alloc_times[SYNTH_MAX_VOICES];
143
        };
144
 
145
struct channel_info {
146
                int pgm_num;
147
                int bender_value;
148
                unsigned char controllers[128];
149
        };
150
 
151
/*
152
 * Process wakeup reasons
153
 */
154
#define WK_NONE         0x00
155
#define WK_WAKEUP       0x01
156
#define WK_TIMEOUT      0x02
157
#define WK_SIGNAL       0x04
158
#define WK_SLEEP        0x08
159
#define WK_SELECT       0x10
160
 
161
#define OPEN_READ       PCM_ENABLE_INPUT
162
#define OPEN_WRITE      PCM_ENABLE_OUTPUT
163
#define OPEN_READWRITE  (OPEN_READ|OPEN_WRITE)
164
 
165
#include "sound_calls.h"
166
#include "dev_table.h"
167
 
168
#ifndef DEB
169
#define DEB(x)
170
#endif
171
 
172
#ifndef DDB
173
#define DDB(x)
174
#endif
175
 
176
#define TIMER_ARMED     121234
177
#define TIMER_NOT_ARMED 1

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.