Message ID | 49b8b57c-4e69-6e9e-9bb5-a2ef2df2f258@flowbird.group |
---|---|
State | New |
Headers | show |
Series | alsa / dma: Sound stops playing after xrun | expand |
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 2236b5e..b03dac3 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -18,6 +18,9 @@ #include <sound/pcm_params.h> #include <sound/timer.h> +#include <linux/dmaengine.h> +#include <sound/dmaengine_pcm.h> + #include "pcm_local.h" #ifdef CONFIG_SND_PCM_XRUN_DEBUG @@ -2239,6 +2242,10 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream, } } _end_unlock: + /* MF: Workaround for broken sound after XRUN. */ + if (err == -EPIPE) + dmaengine_synchronize(snd_dmaengine_pcm_get_chan(substream)); + runtime->twake = 0; if (xfer > 0 && err >= 0)