• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/sound/pci/trident/

Lines Matching refs:voice

195 static void sample_start(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position);
196 static void sample_stop(struct snd_trident * trident, struct snd_trident_voice * voice, int mode);
197 static void sample_freq(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_frequency_t freq);
198 static void sample_volume(struct snd_trident * trident, struct snd_trident_voice * voice, struct snd_seq_ev_volume * volume);
199 static void sample_loop(struct snd_trident * trident, struct snd_trident_voice * voice, struct snd_seq_ev_loop * loop);
200 static void sample_pos(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position);
201 static void sample_private1(struct snd_trident * trident, struct snd_trident_voice * voice, unsigned char *data);
214 static void snd_trident_simple_init(struct snd_trident_voice * voice)
216 //voice->handler_wave = interrupt_wave;
217 //voice->handler_volume = interrupt_volume;
218 //voice->handler_effect = interrupt_effect;
219 //voice->volume_change = NULL;
220 voice->sample_ops = &sample_ops;
223 static void sample_start(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position)
232 instr = snd_seq_instr_find(trident->synth.ilist, &voice->instr, 0, 1);
235 voice->instr = instr->instr; /* copy ID to speedup aliases */
241 voice->GVSel = 1; /* route to Wave volume */
243 voice->CTRL = 0;
244 voice->Alpha = 0;
245 voice->FMS = 0;
256 voice->CTRL |= 8;
260 voice->CTRL |= 4;
264 voice->CTRL |= 2;
266 voice->LBA = simple->address.memory;
269 voice->CTRL |= 1;
270 voice->LBA += loop_start << shift;
272 voice->CSO = start_offset - loop_start;
273 voice->negCSO = 0;
275 voice->CSO = loop_start - start_offset;
276 voice->negCSO = 1;
278 voice->ESO = loop_end - loop_start - 1;
280 voice->LBA += start_offset << shift;
281 voice->CSO = sample_start;
282 voice->ESO = sample_end - 1;
283 voice->negCSO = 0;
286 if (voice->flags & SNDRV_TRIDENT_VFLG_RUNNING) {
287 snd_trident_stop_voice(trident, voice->number);
288 voice->flags &= ~SNDRV_TRIDENT_VFLG_RUNNING;
293 if( voice->negCSO ) {
294 value |= 1 << (voice->number&31);
296 value &= ~(1 << (voice->number&31));
300 voice->Attribute = 0;
301 snd_trident_write_voice_regs(trident, voice);
302 snd_trident_start_voice(trident, voice->number);
303 voice->flags |= SNDRV_TRIDENT_VFLG_RUNNING;
308 static void sample_stop(struct snd_trident * trident, struct snd_trident_voice * voice, int mode)
312 if (!(voice->flags & SNDRV_TRIDENT_VFLG_RUNNING))
318 snd_trident_stop_voice(trident, voice->number);
319 voice->flags &= ~SNDRV_TRIDENT_VFLG_RUNNING;
323 voice->CTRL &= ~1;
325 outb((unsigned char) voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
326 outw((((voice->CTRL << 12) | (voice->EC & 0x0fff)) & 0xffff), CH_GVSEL_PAN_VOL_CTRL_EC);
332 static void sample_freq(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_frequency_t freq)
339 voice->Delta = 0xeb3;
341 voice->Delta = 0x2ab;
343 voice->Delta = 0x1000;
345 voice->Delta = (((freq << 12) + freq) / 48000) & 0x0000ffff;
347 outb((unsigned char) voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
349 outb((unsigned char) voice->Delta, TRID_REG(trident, CH_NX_DELTA_CSO + 3));
350 outb((unsigned char) (voice->Delta >> 8), TRID_REG(trident, CH_NX_DELTA_ESO + 3));
352 outw((unsigned short) voice->Delta, TRID_REG(trident, CH_DX_ESO_DELTA));
358 static void sample_volume(struct snd_trident * trident, struct snd_trident_voice * voice, struct snd_seq_ev_volume * volume)
364 voice->GVSel = 0; /* use global music volume */
365 voice->FMC = 0x03;
371 voice->RVol = 0;
372 voice->CVol = 0;
374 voice->Vol = 0;
375 voice->EC = (value & 0x3fff) >> 2;
377 voice->EC |= 0xfc0;
379 voice->Vol = ((value >> 8) - 0x3f) << 5;
381 voice->Vol = 0x3ff;
382 voice->EC = 0xfff;
391 for (voice->Pan = 0; voice->Pan < 63; voice->Pan++ )
392 if (value >= pan_table[voice->Pan] )
395 for (voice->Pan = 0; voice->Pan < 63; voice->Pan++ )
396 if ((unsigned int)volume->lr >= pan_table[voice->Pan] )
398 voice->Pan |= 0x40;
401 outb((unsigned char) voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
402 outl((voice->GVSel << 31) | ((voice->Pan & 0x0000007f) << 24) |
403 ((voice->Vol & 0x000000ff) << 16) | ((voice->CTRL & 0x0000000f) << 12) |
404 (voice->EC & 0x00000fff), TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC));
405 value = ((voice->FMC & 0x03) << 14) | ((voice->RVol & 0x7f) << 7) | (voice->CVol & 0x7f);
410 static void sample_loop(struct snd_trident * trident, struct snd_trident_voice * voice, struct snd_seq_ev_loop * loop)
417 instr = snd_seq_instr_find(trident->synth.ilist, &voice->instr, 0, 1);
420 voice->instr = instr->instr; /* copy ID to speedup aliases */
428 voice->LBA = simple->address.memory + loop_start;
429 voice->CSO = 0;
430 voice->ESO = loop_end - loop_start - 1;
432 outb((unsigned char) voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
433 outb((voice->LBA >> 16), TRID_REG(trident, CH_LBA + 2));
434 outw((voice->LBA & 0xffff), TRID_REG(trident, CH_LBA));
436 outb((voice->ESO >> 16), TRID_REG(trident, CH_NX_DELTA_ESO + 2));
437 outw((voice->ESO & 0xffff), TRID_REG(trident, CH_NX_DELTA_ESO));
438 outb((voice->CSO >> 16), TRID_REG(trident, CH_NX_DELTA_CSO + 2));
439 outw((voice->CSO & 0xffff), TRID_REG(trident, CH_NX_DELTA_CSO));
441 outw((voice->ESO & 0xffff), TRID_REG(trident, CH_DX_ESO_DELTA + 2));
442 outw((voice->CSO & 0xffff), TRID_REG(trident, CH_DX_CSO_ALPHA_FMS + 2));
449 static void sample_pos(struct snd_trident * trident, struct snd_trident_voice * voice, snd_seq_position_t position)
456 instr = snd_seq_instr_find(trident->synth.ilist, &voice->instr, 0, 1);
459 voice->instr = instr->instr; /* copy ID to speedup aliases */
466 voice->CSO = (position - simple->loop_start) >> 4;
467 voice->negCSO = 0;
469 voice->CSO = (simple->loop_start - position) >> 4;
470 voice->negCSO = 1;
473 voice->CSO = position >> 4;
474 voice->negCSO = 0;
479 if( voice->negCSO ) {
480 value |= 1 << (voice->number&31);
482 value &= ~(1 << (voice->number&31));
487 outb((unsigned char) voice->number, TRID_REG(trident, T4D_LFO_GC_CIR));
489 outw((voice->CSO & 0xffff), TRID_REG(trident, CH_NX_DELTA_CSO));
490 outb((voice->CSO >> 16), TRID_REG(trident, CH_NX_DELTA_CSO + 2));
492 outw((voice->CSO & 0xffff), TRID_REG(trident, CH_DX_CSO_ALPHA_FMS) + 2);
499 static void sample_private1(struct snd_trident * trident, struct snd_trident_voice * voice, unsigned char *data)
715 int idx, voice;
723 for (voice = 0; voice < 64; voice++) {
724 v = &trident->synth.voices[voice];
743 struct snd_trident_voice *voice;
746 voice = &trident->synth.voices[idx];
747 if (voice->use && voice->client == client && voice->port == port)
748 snd_trident_free_voice(trident, voice);
756 struct snd_trident_voice *voice;
764 voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_SYNTH, info->sender.client, info->sender.port);
765 if (voice == NULL) {
770 voice->index = idx;
771 voice->Vol = 0x3ff;
772 voice->EC = 0x0fff;