Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: compress: Be more restrictive about when a drain is allowed

Draining makes little sense in the situation of hardware overrun, as the
hardware will have consumed all its available samples. Additionally,
draining whilst the stream is paused would presumably get stuck as no
data is being consumed on the DSP side.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Charles Keepax and committed by
Takashi Iwai
3b817994 a70ab8a8

+6
+6
sound/core/compress_offload.c
··· 811 811 case SNDRV_PCM_STATE_OPEN: 812 812 case SNDRV_PCM_STATE_SETUP: 813 813 case SNDRV_PCM_STATE_PREPARED: 814 + case SNDRV_PCM_STATE_PAUSED: 814 815 return -EPERM; 816 + case SNDRV_PCM_STATE_XRUN: 817 + return -EPIPE; 815 818 default: 816 819 break; 817 820 } ··· 863 860 case SNDRV_PCM_STATE_OPEN: 864 861 case SNDRV_PCM_STATE_SETUP: 865 862 case SNDRV_PCM_STATE_PREPARED: 863 + case SNDRV_PCM_STATE_PAUSED: 866 864 return -EPERM; 865 + case SNDRV_PCM_STATE_XRUN: 866 + return -EPIPE; 867 867 default: 868 868 break; 869 869 }