ALSA: emu10k1: rewire {en,dis}abling interrupts for PCM playback
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>
Tue, 16 May 2023 09:36:10 +0000 (11:36 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 17 May 2023 15:04:34 +0000 (17:04 +0200)
commit35a60d1edff4dec9a31862a3515676cd0fafe4e4
tree93ccdcddca6eac7f9cc602f075dc0a0756145e74
parenta61c695aee87ba9c9f6b2996f98e933e3c33a049
ALSA: emu10k1: rewire {en,dis}abling interrupts for PCM playback

We now enable ints even before triggering, and disable them only after
stopping - otherwise there is a race condition we may plausibly run into
when we pause/resume near the end of the buffer.

Updating the epcm->running flag is moved the same way, as it affects the
*_pointer() functions, which are called by the interrupt handler.

Also, factor these out to own functions, for clarity.

For multi-channel, the extra voice is now triggered after all regular
voices - we wouldn't want to receive an int before all channels have
passed the period boundary.

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