* [PATCH] Revert "ALSA: emu10k1: fix synthesizer sample playback position and caching"
@ 2024-04-01 14:58 Oswald Buddenhagen
2024-04-01 17:02 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Oswald Buddenhagen @ 2024-04-01 14:58 UTC (permalink / raw)
To: alsa-devel; +Cc: Takashi Iwai, Jaroslav Kysela, Arthur Marsh
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: df335e9a8b (ALSA: emu10k1: fix synthesizer sample playback position and caching, 2023-05-18)
Link: https://bugzilla.kernel.org/show_bug.cgi?id=218625
Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
---
sound/pci/emu10k1/emu10k1_callback.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/sound/pci/emu10k1/emu10k1_callback.c b/sound/pci/emu10k1/emu10k1_callback.c
index d36234b88fb4..941bfbf812ed 100644
--- a/sound/pci/emu10k1/emu10k1_callback.c
+++ b/sound/pci/emu10k1/emu10k1_callback.c
@@ -255,7 +255,7 @@ lookup_voices(struct snd_emux *emu, struct snd_emu10k1 *hw,
/* check if sample is finished playing (non-looping only) */
if (bp != best + V_OFF && bp != best + V_FREE &&
(vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_SINGLESHOT)) {
- val = snd_emu10k1_ptr_read(hw, CCCA_CURRADDR, vp->ch) - 64;
+ val = snd_emu10k1_ptr_read(hw, CCCA_CURRADDR, vp->ch);
if (val >= vp->reg.loopstart)
bp = best + V_OFF;
}
@@ -362,7 +362,7 @@ start_voice(struct snd_emux_voice *vp)
map = (hw->silent_page.addr << hw->address_mode) | (hw->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MASK0);
- addr = vp->reg.start + 64;
+ addr = vp->reg.start;
temp = vp->reg.parm.filterQ;
ccca = (temp << 28) | addr;
if (vp->apitch < 0xe400)
@@ -430,9 +430,6 @@ start_voice(struct snd_emux_voice *vp)
/* Q & current address (Q 4bit value, MSB) */
CCCA, ccca,
- /* cache */
- CCR, REG_VAL_PUT(CCR_CACHEINVALIDSIZE, 64),
-
/* reset volume */
VTFT, vtarget | vp->ftarget,
CVCF, vtarget | CVCF_CURRENTFILTER_MASK,
--
2.42.0.419.g70bf8a5751
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] Revert "ALSA: emu10k1: fix synthesizer sample playback position and caching"
2024-04-01 14:58 [PATCH] Revert "ALSA: emu10k1: fix synthesizer sample playback position and caching" Oswald Buddenhagen
@ 2024-04-01 17:02 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2024-04-01 17:02 UTC (permalink / raw)
To: Oswald Buddenhagen; +Cc: alsa-devel, Jaroslav Kysela, Arthur Marsh
On Mon, 01 Apr 2024 16:58:05 +0200,
Oswald Buddenhagen wrote:
>
> 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: df335e9a8b (ALSA: emu10k1: fix synthesizer sample playback position and caching, 2023-05-18)
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=218625
> Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Thanks, applied now.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-01 17:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-01 14:58 [PATCH] Revert "ALSA: emu10k1: fix synthesizer sample playback position and caching" Oswald Buddenhagen
2024-04-01 17:02 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox