Skip to content

Commit 03f56ed

Browse files
ossilatortiwai
authored andcommitted
Revert "ALSA: emu10k1: fix synthesizer sample playback position and caching"
As already anticipated in the original commit, playback was broken for very short samples. I just didn't expect it to be an actual problem, because we're talking about less than 1.5 milliseconds here. But clearly such wavetable samples do actually exist. The problem was that for such short samples we'd set the current position beyond the end of the loop, so we'd run off the end of the sample and play garbage. This is a bigger (more audible) problem than the original one, which was that we'd start playback with garbage (whatever was still in the cache), which would be mostly masked by the note's attack phase. So revert to the old behavior for now. We'll subsequently fix it properly with a bigger patch series. Note that this isn't a full revert - the dead code is not re-introduced, because that would be silly. Fixes: df335e9 ("ALSA: emu10k1: fix synthesizer sample playback position and caching") Link: https://bugzilla.kernel.org/show_bug.cgi?id=218625 Signed-off-by: Oswald Buddenhagen <[email protected]> Message-ID: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 755795c commit 03f56ed

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

sound/pci/emu10k1/emu10k1_callback.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ lookup_voices(struct snd_emux *emu, struct snd_emu10k1 *hw,
255255
/* check if sample is finished playing (non-looping only) */
256256
if (bp != best + V_OFF && bp != best + V_FREE &&
257257
(vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_SINGLESHOT)) {
258-
val = snd_emu10k1_ptr_read(hw, CCCA_CURRADDR, vp->ch) - 64;
258+
val = snd_emu10k1_ptr_read(hw, CCCA_CURRADDR, vp->ch);
259259
if (val >= vp->reg.loopstart)
260260
bp = best + V_OFF;
261261
}
@@ -362,7 +362,7 @@ start_voice(struct snd_emux_voice *vp)
362362

363363
map = (hw->silent_page.addr << hw->address_mode) | (hw->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MASK0);
364364

365-
addr = vp->reg.start + 64;
365+
addr = vp->reg.start;
366366
temp = vp->reg.parm.filterQ;
367367
ccca = (temp << 28) | addr;
368368
if (vp->apitch < 0xe400)
@@ -430,9 +430,6 @@ start_voice(struct snd_emux_voice *vp)
430430
/* Q & current address (Q 4bit value, MSB) */
431431
CCCA, ccca,
432432

433-
/* cache */
434-
CCR, REG_VAL_PUT(CCR_CACHEINVALIDSIZE, 64),
435-
436433
/* reset volume */
437434
VTFT, vtarget | vp->ftarget,
438435
CVCF, vtarget | CVCF_CURRENTFILTER_MASK,

0 commit comments

Comments
 (0)