This source file includes following definitions.
- EMU_RECSRC_MIC
- EMU_RECSRC_ADC
- EMU_RECSRC_FX
- EMU_RECSRC_NOTSET
- emuxki_recsrc_t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 #ifndef _DEV_PCI_EMU10K1VAR_H_
41 #define _DEV_PCI_EMU10K1VAR_H_
42
43 #define EMU_PCI_CBIO 0x10
44 #define EMU_SUBSYS_APS 0x40011102
45
46
47
48
49
50 struct dmamem {
51 bus_dma_tag_t dmat;
52 bus_size_t size;
53 bus_size_t align;
54 bus_size_t bound;
55 bus_dma_segment_t *segs;
56 int nsegs;
57 int rsegs;
58 caddr_t kaddr;
59 bus_dmamap_t map;
60 };
61
62 #define KERNADDR(ptr) ((void *)((ptr)->kaddr))
63 #define DMASEGADDR(ptr, segno) ((ptr)->segs[segno].ds_addr)
64 #define DMAADDR(ptr) DMASEGADDR(ptr, 0)
65 #define DMASIZE(ptr) ((ptr)->size)
66
67
68
69
70
71 #define EMU_PTESIZE 4096
72 #define EMU_MAXPTE ((EMU_CHAN_PSST_LOOPSTARTADDR_MASK + 1) / \
73 EMU_PTESIZE)
74 #define EMU_NUMCHAN 64
75 #define EMU_NUMRECSRCS 3
76
77 #define EMU_DMA_ALIGN 4096
78 #define EMU_DMAMEM_NSEG 1
79
80
81
82
83
84 struct emuxki_mem {
85 LIST_ENTRY(emuxki_mem) next;
86 struct dmamem *dmamem;
87 u_int16_t ptbidx;
88 #define EMU_RMEM 0xFFFF
89 };
90
91
92
93
94
95 struct emuxki_chanparms_fxsend {
96 struct {
97 u_int8_t level, dest;
98 } a, b, c, d, e, f, g, h;
99 };
100
101 struct emuxki_chanparms_pitch {
102 u_int16_t initial;
103
104 u_int16_t current;
105 u_int16_t target;
106 u_int8_t envelope_amount;
107
108 };
109
110 struct emuxki_chanparms_envelope {
111 u_int16_t current_state;
112 u_int8_t hold_time;
113
114 u_int8_t attack_time;
115
116 u_int8_t sustain_level;
117
118 u_int8_t decay_time;
119
120 };
121
122 struct emuxki_chanparms_volume {
123 u_int16_t current, target;
124 struct emuxki_chanparms_envelope envelope;
125 };
126
127 struct emuxki_chanparms_filter {
128 u_int16_t initial_cutoff_frequency;
129
130
131
132
133 u_int16_t current_cutoff_frequency;
134 u_int16_t target_cutoff_frequency;
135 u_int8_t lowpass_resonance_height;
136 u_int8_t interpolation_ROM;
137
138 u_int8_t envelope_amount;
139
140 u_int8_t LFO_modulation_depth;
141
142 };
143
144 struct emuxki_chanparms_loop {
145 u_int32_t start;
146 u_int32_t end;
147 };
148
149 struct emuxki_chanparms_modulation {
150 struct emuxki_chanparms_envelope envelope;
151 u_int16_t LFO_state;
152 };
153
154 struct emuxki_chanparms_vibrato_LFO {
155 u_int16_t state;
156 u_int8_t modulation_depth;
157
158 u_int8_t vibrato_depth;
159
160 u_int8_t frequency;
161 };
162
163 struct emuxki_channel {
164 u_int8_t num;
165 struct emuxki_voice *voice;
166 struct emuxki_chanparms_fxsend fxsend;
167 struct emuxki_chanparms_pitch pitch;
168 u_int16_t initial_attenuation;
169 struct emuxki_chanparms_volume volume;
170 struct emuxki_chanparms_filter filter;
171 struct emuxki_chanparms_loop loop;
172 struct emuxki_chanparms_modulation modulation;
173 struct emuxki_chanparms_vibrato_LFO vibrato_LFO;
174 u_int8_t tremolo_depth;
175 };
176
177
178
179
180
181 typedef enum {
182 EMU_RECSRC_MIC = 0,
183 EMU_RECSRC_ADC,
184 EMU_RECSRC_FX,
185 EMU_RECSRC_NOTSET
186 } emuxki_recsrc_t;
187
188 struct emuxki_voice {
189 struct emuxki_softc *sc;
190
191 u_int8_t use;
192 #define EMU_VOICE_USE_PLAY (1 << 0)
193 u_int8_t state;
194 #define EMU_VOICE_STATE_STARTED (1 << 0)
195 u_int8_t stereo;
196 #define EMU_VOICE_STEREO_NOTSET 0xFF
197 u_int8_t b16;
198 u_int32_t sample_rate;
199 union {
200 struct emuxki_channel *chan[2];
201 emuxki_recsrc_t source;
202 } dataloc;
203 struct emuxki_mem *buffer;
204 u_int16_t blksize;
205 u_int16_t trigblk;
206 u_int16_t blkmod;
207 u_int16_t timerate;
208 void (*inth) (void *);
209 void *inthparam;
210 LIST_ENTRY(emuxki_voice) next;
211 };
212
213 #if 0
214
215
216
217 struct emuxki_stream {
218 struct emu10k1 *emu;
219 u_int8_t nmono;
220 u_int8_t nstereo;
221 struct emuxki_voice *mono;
222 struct emuxki_voice *stereo;
223 LIST_ENTRY(emuxki_stream) next;
224 };
225 #endif
226
227 struct emuxki_softc {
228 struct device sc_dev;
229 struct audio_device sc_audv;
230 enum {
231 EMUXKI_SBLIVE = 0x00, EMUXKI_AUDIGY = 0x01, EMUXKI_AUDIGY2 = 0x02,
232 EMUXKI_LIVE_5_1 = 0x04, EMUXKI_APS = 0x08
233 } sc_type;
234
235
236 bus_space_tag_t sc_iot;
237 bus_space_handle_t sc_ioh;
238 bus_addr_t sc_iob;
239 bus_size_t sc_ios;
240 pci_chipset_tag_t sc_pc;
241 bus_dma_tag_t sc_dmat;
242 void *sc_ih;
243
244
245 LIST_HEAD(, emuxki_mem) mem;
246
247 struct dmamem *ptb;
248 struct dmamem *silentpage;
249
250 struct emuxki_channel *channel[EMU_NUMCHAN];
251 struct emuxki_voice *recsrc[EMU_NUMRECSRCS];
252
253 LIST_HEAD(, emuxki_voice) voices;
254
255
256 u_int8_t timerstate;
257 #define EMU_TIMER_STATE_ENABLED 1
258
259 struct ac97_host_if hostif;
260 struct ac97_codec_if *codecif;
261 struct device *sc_audev;
262
263 struct emuxki_voice *pvoice, *rvoice, *lvoice;
264 };
265
266 #endif