diff options
author | Ricardo Biehl Pasquali <pasqualirb@gmail.com> | 2019-02-12 21:57:51 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-02-13 02:01:05 -0500 |
commit | 932a81519572156a88dbc2349d183c603446f9c4 (patch) | |
tree | 0e88452ce44a24650e853d917eb17f7c6ae77585 | |
parent | 5a23f385686fe0e9cd8e19cb09dff9a3b68082de (diff) |
ALSA: pcm: Comment why read blocks when PCM is not running
This avoids bringing back the problem introduced by
62ba568f7aef ("ALSA: pcm: Return 0 when size <
start_threshold in capture") and fixed in 00a399cad1a0
("ALSA: pcm: Revert capture stream behavior change in
blocking mode"), which prevented the user from starting
capture from another thread.
Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/core/pcm_lib.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index bcb06bd3d81d..345ab1ab2cac 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -2176,6 +2176,10 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream, | |||
2176 | if (runtime->status->state == SNDRV_PCM_STATE_RUNNING) | 2176 | if (runtime->status->state == SNDRV_PCM_STATE_RUNNING) |
2177 | snd_pcm_update_hw_ptr(substream); | 2177 | snd_pcm_update_hw_ptr(substream); |
2178 | 2178 | ||
2179 | /* | ||
2180 | * If size < start_threshold, wait indefinitely. Another | ||
2181 | * thread may start capture | ||
2182 | */ | ||
2179 | if (!is_playback && | 2183 | if (!is_playback && |
2180 | runtime->status->state == SNDRV_PCM_STATE_PREPARED && | 2184 | runtime->status->state == SNDRV_PCM_STATE_PREPARED && |
2181 | size >= runtime->start_threshold) { | 2185 | size >= runtime->start_threshold) { |