Commit 932a8151 authored by Ricardo Biehl Pasquali's avatar Ricardo Biehl Pasquali Committed by Takashi Iwai

ALSA: pcm: Comment why read blocks when PCM is not running

This avoids bringing back the problem introduced by
62ba568f ("ALSA: pcm: Return 0 when size <
start_threshold in capture") and fixed in 00a399ca
("ALSA: pcm: Revert capture stream behavior change in
blocking mode"), which prevented the user from starting
capture from another thread.
Signed-off-by: default avatarRicardo Biehl Pasquali <pasqualirb@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 5a23f385
...@@ -2176,6 +2176,10 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream, ...@@ -2176,6 +2176,10 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
if (runtime->status->state == SNDRV_PCM_STATE_RUNNING) if (runtime->status->state == SNDRV_PCM_STATE_RUNNING)
snd_pcm_update_hw_ptr(substream); snd_pcm_update_hw_ptr(substream);
/*
* If size < start_threshold, wait indefinitely. Another
* thread may start capture
*/
if (!is_playback && if (!is_playback &&
runtime->status->state == SNDRV_PCM_STATE_PREPARED && runtime->status->state == SNDRV_PCM_STATE_PREPARED &&
size >= runtime->start_threshold) { size >= runtime->start_threshold) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment