ALSA: emu10k1: fix synthesizer sample playback position and caching
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>
Thu, 18 May 2023 14:03:38 +0000 (16:03 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 18 May 2023 14:39:46 +0000 (16:39 +0200)
commitdf335e9a8bcb58be3b7388cff556f06eeb3d024f
tree4d37a0fa557352165f3cad4f956f88986db85efb
parent816967d55f425a647137ef884d8e92f2baf541dc
ALSA: emu10k1: fix synthesizer sample playback position and caching

Compensate for the cache delay, and actually populate the cache.
Without these, the playback would start with garbage (which would be
(mostly?) masqueraded by the attack phase).

Unlike for the PCM voices, this doesn't try to compensate for the
interpolator read-ahead, because it's pointless to be super-exact here.

Note that this code is probably still broken for particularly short
samples, because we ignore the loop-related parts of CCR. But I'm not
going to reverse-engineer that now ...

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Link: https://lore.kernel.org/r/20230518140339.3722308-1-oswald.buddenhagen@gmx.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/emu10k1/emu10k1_callback.c