* [PATCH v3] ALSA: pcm: Return 0 when size < start_threshold in capture
@ 2018-08-25 19:53 Ricardo Biehl Pasquali
2018-08-26 7:31 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Ricardo Biehl Pasquali @ 2018-08-25 19:53 UTC (permalink / raw)
To: tiwai; +Cc: alsa-devel
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: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
---
version 3:
Set 'err' variable inside 'else' block.
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -2173,11 +2173,16 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(str
goto _end_unlock;
if (!is_playback &&
- runtime->status->state == SNDRV_PCM_STATE_PREPARED &&
- size >= runtime->start_threshold) {
- err = snd_pcm_start(substream);
- if (err < 0)
+ 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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v3] ALSA: pcm: Return 0 when size < start_threshold in capture
2018-08-25 19:53 [PATCH v3] ALSA: pcm: Return 0 when size < start_threshold in capture Ricardo Biehl Pasquali
@ 2018-08-26 7:31 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2018-08-26 7:31 UTC (permalink / raw)
To: Ricardo Biehl Pasquali; +Cc: alsa-devel
On Sat, 25 Aug 2018 21:53:23 +0200,
Ricardo Biehl Pasquali wrote:
>
> 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: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
> ---
>
> version 3:
> Set 'err' variable inside 'else' block.
OK, re-queued this one in my local branch. Will be published once
after 4.19-rc1 is released.
thanks,
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-26 7:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-25 19:53 [PATCH v3] ALSA: pcm: Return 0 when size < start_threshold in capture Ricardo Biehl Pasquali
2018-08-26 7:31 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.