]> git.hungrycats.org Git - linux/commit
ALSA: dmaengine: Synchronize dma channel after drop()
authorJai Luthra <j-luthra@ti.com>
Tue, 11 Jun 2024 12:32:55 +0000 (18:02 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2024 07:53:32 +0000 (09:53 +0200)
commitc1892d64a96c6b339c8108cc15a28566dfa6f8ba
tree8fbcf2b8d1874ada124f60526722fd8fa264ea3f
parent716cc6cb4cc047fff277c21d9393232c96ad5070
ALSA: dmaengine: Synchronize dma channel after drop()

[ Upstream commit e8343410ddf08fc36a9b9cc7c51a4e53a262d4c6 ]

Sometimes the stream may be stopped due to XRUN events, in which case
the userspace can call snd_pcm_drop() and snd_pcm_prepare() to stop and
start the stream again.

In these cases, we must wait for the DMA channel to synchronize before
marking the stream as prepared for playback, as the DMA channel gets
stopped by drop() without any synchronization. Make sure the ALSA core
synchronizes the DMA channel by adding a sync_stop() hook.

Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Signed-off-by: Jai Luthra <j-luthra@ti.com>
Link: https://lore.kernel.org/r/20240611-asoc_next-v3-1-fcfd84b12164@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/sound/dmaengine_pcm.h
sound/core/pcm_dmaengine.c
sound/soc/soc-generic-dmaengine-pcm.c