Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62ba568f authored by Ricardo Biehl Pasquali's avatar Ricardo Biehl Pasquali Committed by Takashi Iwai
Browse files

ALSA: pcm: Return 0 when size < start_threshold in capture



In __snd_pcm_lib_xfer(), when capture, if state is PREPARED
and size is less than start_threshold nothing can be done.
As there is no error, 0 is returned.

Signed-off-by: default avatarRicardo Biehl Pasquali <pasqualirb@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 5b394b2d
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -2173,11 +2173,16 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
		goto _end_unlock;

	if (!is_playback &&
	    runtime->status->state == SNDRV_PCM_STATE_PREPARED &&
	    size >= runtime->start_threshold) {
	    runtime->status->state == SNDRV_PCM_STATE_PREPARED) {
		if (size >= runtime->start_threshold) {
			err = snd_pcm_start(substream);
			if (err < 0)
				goto _end_unlock;
		} else {
			/* nothing to do */
			err = 0;
			goto _end_unlock;
		}
	}

	runtime->twake = runtime->control->avail_min ? : 1;