提交 f3f6c614 编写于 作者: J Jeeja KP 提交者: Takashi Iwai

ALSA: pcm: Fix avail to return error if stream is suspended

When the stream is in suspended state some applications wait
on "Stream Pipe Error" in response to snd_pcm_avail call to
resume the stream.

In the current implementation snd_pcm_avail() returns zero
when the stream is in suspended state. This causes application
to enter in infinite loop for frames to be available.

"Stream pipe Error" code is getting returned for read/write
call when the stream is in suspended state. Similarly update
snd_pcm_avail to return -ESTRPIPE.
Signed-off-by: NJeeja KP <jeeja.kp@intel.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 8c91d7d0
...@@ -2637,9 +2637,11 @@ static int snd_pcm_hwsync(struct snd_pcm_substream *substream) ...@@ -2637,9 +2637,11 @@ static int snd_pcm_hwsync(struct snd_pcm_substream *substream)
break; break;
/* Fall through */ /* Fall through */
case SNDRV_PCM_STATE_PREPARED: case SNDRV_PCM_STATE_PREPARED:
case SNDRV_PCM_STATE_SUSPENDED:
err = 0; err = 0;
break; break;
case SNDRV_PCM_STATE_SUSPENDED:
err = -ESTRPIPE;
break;
case SNDRV_PCM_STATE_XRUN: case SNDRV_PCM_STATE_XRUN:
err = -EPIPE; err = -EPIPE;
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册