• Home
  • Raw
  • Download

Lines Matching +full:8 +full:- +full:ch

18  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
55 * macro evaluates its args more than once, so changed to upper-case.
80 emux->ops = emu10k1_ops; in snd_emu10k1_ops_setup()
99 emu = hw->synth; in snd_emu10k1_synth_get_voice()
104 int ch; in snd_emu10k1_synth_get_voice() local
105 vp = &emu->voices[best[i].voice]; in snd_emu10k1_synth_get_voice()
106 if ((ch = vp->ch) < 0) { in snd_emu10k1_synth_get_voice()
108 dev_warn(emu->card->dev, in snd_emu10k1_synth_get_voice()
109 "synth_get_voice: ch < 0 (%d) ??", i); in snd_emu10k1_synth_get_voice()
113 vp->emu->num_voices--; in snd_emu10k1_synth_get_voice()
114 vp->ch = -1; in snd_emu10k1_synth_get_voice()
115 vp->state = SNDRV_EMUX_ST_OFF; in snd_emu10k1_synth_get_voice()
116 return ch; in snd_emu10k1_synth_get_voice()
121 return -ENOMEM; in snd_emu10k1_synth_get_voice()
134 hw = vp->hw; in release_voice()
135 dcysusv = 0x8000 | (unsigned char)vp->reg.parm.modrelease; in release_voice()
136 snd_emu10k1_ptr_write(hw, DCYSUSM, vp->ch, dcysusv); in release_voice()
137 dcysusv = 0x8000 | (unsigned char)vp->reg.parm.volrelease | DCYSUSV_CHANNELENABLE_MASK; in release_voice()
138 snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, dcysusv); in release_voice()
152 hw = vp->hw; in terminate_voice()
153 snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0x807f | DCYSUSV_CHANNELENABLE_MASK); in terminate_voice()
154 if (vp->block) { in terminate_voice()
156 emem = (struct snd_emu10k1_memblk *)vp->block; in terminate_voice()
157 if (emem->map_locked > 0) in terminate_voice()
158 emem->map_locked--; in terminate_voice()
170 hw = vp->hw; in free_voice()
175 if (hw && (vp->ch >= 0)) { in free_voice()
176 snd_emu10k1_ptr_write(hw, IFATN, vp->ch, 0xff00); in free_voice()
177 snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0x807f | DCYSUSV_CHANNELENABLE_MASK); in free_voice()
178 // snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0); in free_voice()
179 snd_emu10k1_ptr_write(hw, VTFT, vp->ch, 0xffff); in free_voice()
180 snd_emu10k1_ptr_write(hw, CVCF, vp->ch, 0xffff); in free_voice()
181 snd_emu10k1_voice_free(hw, &hw->voices[vp->ch]); in free_voice()
182 vp->emu->num_voices--; in free_voice()
183 vp->ch = -1; in free_voice()
196 hw = vp->hw; in update_voice()
198 snd_emu10k1_ptr_write(hw, IFATN_ATTENUATION, vp->ch, vp->avol); in update_voice()
200 snd_emu10k1_ptr_write(hw, IP, vp->ch, vp->apitch); in update_voice()
202 snd_emu10k1_ptr_write(hw, PTRX_FXSENDAMOUNT_A, vp->ch, vp->apan); in update_voice()
203 snd_emu10k1_ptr_write(hw, PTRX_FXSENDAMOUNT_B, vp->ch, vp->aaux); in update_voice()
208 snd_emu10k1_ptr_write(hw, TREMFRQ, vp->ch, vp->reg.parm.tremfrq); in update_voice()
217 * look up voice table - get the best voice in order of preference
229 best[i].time = (unsigned int)-1; /* XXX MAX_?INT really */ in lookup_voices()
230 best[i].voice = -1; in lookup_voices()
237 for (i = 0; i < emu->max_voices; i++) { in lookup_voices()
240 vp = &emu->voices[i]; in lookup_voices()
241 state = vp->state; in lookup_voices()
243 if (vp->ch < 0) { in lookup_voices()
254 val = snd_emu10k1_ptr_read(hw, CVCF_CURRENTVOL, vp->ch); in lookup_voices()
266 /* check if sample is finished playing (non-looping only) */ in lookup_voices()
268 (vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_SINGLESHOT)) { in lookup_voices()
269 val = snd_emu10k1_ptr_read(hw, CCCA_CURRADDR, vp->ch); in lookup_voices()
270 if (val >= vp->reg.loopstart) in lookup_voices()
274 if (vp->time < bp->time) { in lookup_voices()
275 bp->time = vp->time; in lookup_voices()
276 bp->voice = i; in lookup_voices()
284 * emu->voice_lock is already held.
294 hw = emu->hw; in get_voice()
299 vp = &emu->voices[best[i].voice]; in get_voice()
300 if (vp->ch < 0) { in get_voice()
305 vp->ch = hwvoice->number; in get_voice()
306 emu->num_voices++; in get_voice()
323 int ch; in start_voice() local
329 hw = vp->hw; in start_voice()
330 ch = vp->ch; in start_voice()
331 if (snd_BUG_ON(ch < 0)) in start_voice()
332 return -EINVAL; in start_voice()
333 chan = vp->chan; in start_voice()
335 emem = (struct snd_emu10k1_memblk *)vp->block; in start_voice()
337 return -EINVAL; in start_voice()
338 emem->map_locked++; in start_voice()
340 /* dev_err(hw->card->devK, "emu: cannot map!\n"); */ in start_voice()
341 return -ENOMEM; in start_voice()
344 vp->reg.start += mapped_offset; in start_voice()
345 vp->reg.end += mapped_offset; in start_voice()
346 vp->reg.loopstart += mapped_offset; in start_voice()
347 vp->reg.loopend += mapped_offset; in start_voice()
351 if (hw->audigy) { in start_voice()
352 temp = FXBUS_MIDI_LEFT | (FXBUS_MIDI_RIGHT << 8) | in start_voice()
354 snd_emu10k1_ptr_write(hw, A_FXRT1, ch, temp); in start_voice()
358 snd_emu10k1_ptr_write(hw, FXRT, ch, temp); in start_voice()
362 snd_emu10k1_ptr_write(hw, DCYSUSV, ch, 0x0000); in start_voice()
363 snd_emu10k1_ptr_write(hw, VTFT, ch, 0x0000FFFF); in start_voice()
364 snd_emu10k1_ptr_write(hw, CVCF, ch, 0x0000FFFF); in start_voice()
365 snd_emu10k1_ptr_write(hw, PTRX, ch, 0); in start_voice()
366 snd_emu10k1_ptr_write(hw, CPF, ch, 0); in start_voice()
369 snd_emu10k1_ptr_write(hw, IP, vp->ch, vp->apitch); in start_voice()
372 snd_emu10k1_ptr_write(hw, ENVVAL, ch, vp->reg.parm.moddelay); in start_voice()
373 snd_emu10k1_ptr_write(hw, ATKHLDM, ch, vp->reg.parm.modatkhld); in start_voice()
374 snd_emu10k1_ptr_write(hw, DCYSUSM, ch, vp->reg.parm.moddcysus); in start_voice()
375 snd_emu10k1_ptr_write(hw, ENVVOL, ch, vp->reg.parm.voldelay); in start_voice()
376 snd_emu10k1_ptr_write(hw, ATKHLDV, ch, vp->reg.parm.volatkhld); in start_voice()
381 temp = (unsigned int)vp->acutoff << 8 | (unsigned char)vp->avol; in start_voice()
382 snd_emu10k1_ptr_write(hw, IFATN, vp->ch, temp); in start_voice()
385 snd_emu10k1_ptr_write(hw, PEFE, ch, vp->reg.parm.pefe); in start_voice()
388 snd_emu10k1_ptr_write(hw, LFOVAL1, ch, vp->reg.parm.lfo1delay); in start_voice()
389 snd_emu10k1_ptr_write(hw, LFOVAL2, ch, vp->reg.parm.lfo2delay); in start_voice()
394 snd_emu10k1_ptr_write(hw, TREMFRQ, vp->ch, vp->reg.parm.tremfrq); in start_voice()
398 /* reverb and loop start (reverb 8bit, MSB) */ in start_voice()
399 temp = vp->reg.parm.reverb; in start_voice()
400 temp += (int)vp->chan->control[MIDI_CTL_E1_REVERB_DEPTH] * 9 / 10; in start_voice()
402 addr = vp->reg.loopstart; in start_voice()
403 snd_emu10k1_ptr_write(hw, PSST, vp->ch, (temp << 24) | addr); in start_voice()
405 /* chorus & loop end (chorus 8bit, MSB) */ in start_voice()
406 addr = vp->reg.loopend; in start_voice()
407 temp = vp->reg.parm.chorus; in start_voice()
408 temp += (int)chan->control[MIDI_CTL_E3_CHORUS_DEPTH] * 9 / 10; in start_voice()
411 snd_emu10k1_ptr_write(hw, DSL, ch, temp); in start_voice()
414 snd_emu10k1_ptr_write(hw, Z1, ch, 0); in start_voice()
415 snd_emu10k1_ptr_write(hw, Z2, ch, 0); in start_voice()
418 …temp = (hw->silent_page.addr << hw->address_mode) | (hw->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MA… in start_voice()
419 snd_emu10k1_ptr_write(hw, MAPA, ch, temp); in start_voice()
420 snd_emu10k1_ptr_write(hw, MAPB, ch, temp); in start_voice()
426 if (vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_8BITS) in start_voice()
434 snd_emu10k1_ptr_write(hw, CCR, ch, 0x1c << 16); in start_voice()
435 snd_emu10k1_ptr_write(hw, CDE, ch, sample); in start_voice()
436 snd_emu10k1_ptr_write(hw, CDF, ch, sample); in start_voice()
439 …temp = ((unsigned int)hw->silent_page.addr << hw_address_mode) | (hw->address_mode ? MAP_PTI_MASK1… in start_voice()
440 snd_emu10k1_ptr_write(hw, MAPA, ch, temp); in start_voice()
441 snd_emu10k1_ptr_write(hw, MAPB, ch, temp); in start_voice()
444 val -= 4; in start_voice()
447 snd_emu10k1_ptr_write(hw, CCR, ch, val); in start_voice()
452 addr = vp->reg.start; in start_voice()
453 temp = vp->reg.parm.filterQ; in start_voice()
455 if (vp->apitch < 0xe400) in start_voice()
458 unsigned int shift = (vp->apitch - 0xe000) >> 10; in start_voice()
461 if (vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_8BITS) in start_voice()
463 snd_emu10k1_ptr_write(hw, CCCA, ch, temp); in start_voice()
466 temp = (unsigned int)vp->vtarget << 16; in start_voice()
467 snd_emu10k1_ptr_write(hw, VTFT, ch, temp | vp->ftarget); in start_voice()
468 snd_emu10k1_ptr_write(hw, CVCF, ch, temp | 0xff00); in start_voice()
482 hw = vp->hw; in trigger_voice()
484 emem = (struct snd_emu10k1_memblk *)vp->block; in trigger_voice()
485 if (! emem || emem->mapped_page < 0) in trigger_voice()
489 ptarget = (unsigned int)vp->ptarget << 16; in trigger_voice()
491 ptarget = IP_TO_CP(vp->apitch); in trigger_voice()
494 temp = ptarget | (vp->apan << 8) | vp->aaux; in trigger_voice()
495 snd_emu10k1_ptr_write(hw, PTRX, vp->ch, temp); in trigger_voice()
498 snd_emu10k1_ptr_write(hw, CPF, vp->ch, ptarget); in trigger_voice()
501 snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, vp->reg.parm.voldcysus|DCYSUSV_CHANNELENABLE_MASK); in trigger_voice()
515 pitch = (char)(vp->reg.parm.fmmod>>8); in set_fmmod()
516 cutoff = (vp->reg.parm.fmmod & 0xff); in set_fmmod()
517 modulation = vp->chan->gm_modulation + vp->chan->midi_pressure; in set_fmmod()
519 LIMITVALUE(pitch, -128, 127); in set_fmmod()
520 fmmod = ((unsigned char)pitch<<8) | cutoff; in set_fmmod()
521 snd_emu10k1_ptr_write(hw, FMMOD, vp->ch, fmmod); in set_fmmod()
533 pitch = (char)(vp->reg.parm.fm2frq2>>8); in set_fm2frq2()
534 freq = vp->reg.parm.fm2frq2 & 0xff; in set_fm2frq2()
535 modulation = vp->chan->gm_modulation + vp->chan->midi_pressure; in set_fm2frq2()
537 LIMITVALUE(pitch, -128, 127); in set_fm2frq2()
538 fm2frq2 = ((unsigned char)pitch<<8) | freq; in set_fm2frq2()
539 snd_emu10k1_ptr_write(hw, FM2FRQ2, vp->ch, fm2frq2); in set_fm2frq2()
547 val = snd_emu10k1_ptr_read(hw, CCCA, vp->ch) & ~CCCA_RESONANCE; in set_filterQ()
548 val |= (vp->reg.parm.filterQ << 28); in set_filterQ()
549 snd_emu10k1_ptr_write(hw, CCCA, vp->ch, val); in set_filterQ()