X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fpci%2Femu10k1%2Femupcm.c;h=de78ffe9112d0792d75bc264fdc86e30e9408fa3;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=9fbbf6ce48393736c72031954a76b9eed4d93e8d;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c index 9fbbf6ce4..de78ffe91 100644 --- a/sound/pci/emu10k1/emupcm.c +++ b/sound/pci/emu10k1/emupcm.c @@ -267,6 +267,7 @@ static void snd_emu10k1_pcm_init_voice(emu10k1_t *emu, send_routing[3] = 3; memset(send_amount, 0, sizeof(send_amount)); } else { + /* mono, left, right (master voice = left) */ tmp = stereo ? (master ? 1 : 2) : 0; memcpy(send_routing, &mix->send_routing[tmp][0], 8); memcpy(send_amount, &mix->send_volume[tmp][0], 8); @@ -292,15 +293,9 @@ static void snd_emu10k1_pcm_init_voice(emu10k1_t *emu, // setup routing if (emu->audigy) { snd_emu10k1_ptr_write(emu, A_FXRT1, voice, - ((unsigned int)send_routing[3] << 24) | - ((unsigned int)send_routing[2] << 16) | - ((unsigned int)send_routing[1] << 8) | - (unsigned int)send_routing[0]); + snd_emu10k1_compose_audigy_fxrt1(send_routing)); snd_emu10k1_ptr_write(emu, A_FXRT2, voice, - ((unsigned int)send_routing[7] << 24) | - ((unsigned int)send_routing[6] << 16) | - ((unsigned int)send_routing[5] << 8) | - (unsigned int)send_routing[4]); + snd_emu10k1_compose_audigy_fxrt2(send_routing)); snd_emu10k1_ptr_write(emu, A_SENDAMOUNTS, voice, ((unsigned int)send_amount[4] << 24) | ((unsigned int)send_amount[5] << 16) | @@ -777,8 +772,7 @@ static void snd_emu10k1_pcm_free_substream(snd_pcm_runtime_t *runtime) { emu10k1_pcm_t *epcm = runtime->private_data; - if (epcm) - kfree(epcm); + kfree(epcm); } static int snd_emu10k1_playback_open(snd_pcm_substream_t * substream) @@ -1092,6 +1086,7 @@ static int snd_emu10k1_pcm_efx_voices_mask_put(snd_kcontrol_t * kcontrol, snd_ct emu10k1_t *emu = snd_kcontrol_chip(kcontrol); unsigned int nval[2], bits; int nefx = emu->audigy ? 64 : 32; + int nefxb = emu->audigy ? 7 : 6; int change, idx; nval[0] = nval[1] = 0; @@ -1100,8 +1095,14 @@ static int snd_emu10k1_pcm_efx_voices_mask_put(snd_kcontrol_t * kcontrol, snd_ct nval[idx / 32] |= 1 << (idx % 32); bits++; } - if (bits != 1 && bits != 2 && bits != 4 && bits != 8) + + for (idx = 0; idx < nefxb; idx++) + if (1 << idx == bits) + break; + + if (idx >= nefxb) return -EINVAL; + spin_lock_irq(&emu->reg_lock); change = (nval[0] != emu->efx_voices_mask[0]) || (nval[1] != emu->efx_voices_mask[1]); @@ -1185,7 +1186,7 @@ static void fx8010_pb_trans_copy(snd_pcm_substream_t *substream, } snd_emu10k1_fx8010_playback_tram_poke1((unsigned short *)emu->fx8010.etram_pages.area + tram_pos, (unsigned short *)emu->fx8010.etram_pages.area + tram_pos + tram_size / 2, - src, frames, tram_shift++); + src, frames, tram_shift); tram_pos -= frames; pcm->tram_pos = tram_pos; pcm->tram_shift = tram_shift;