From: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
To: tiwai@suse.de
Cc: alsa-devel@alsa-project.org
Subject: [PATCH v2] ALSA: pcm: Return 0 when size < start_threshold in capture
Date: Wed, 22 Aug 2018 12:03:59 -0300 [thread overview]
Message-ID: <20180822150359.GA12976@localhost.localdomain> (raw)
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 2:
The code was not changed. Just resubmitting to follow the
rules from Documentation/process/submitting-patches.rst.
--- pcm_lib.c.orig 2018-08-21 15:31:54.457405053 -0300
+++ pcm_lib.c 2018-08-21 15:56:01.264549084 -0300
@@ -2125,7 +2125,7 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(str
pcm_transfer_f transfer;
bool nonblock;
bool is_playback;
- int err;
+ int err = 0;
err = pcm_sanity_check(substream);
if (err < 0)
@@ -2173,11 +2173,15 @@ 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 */
goto _end_unlock;
+ }
}
runtime->twake = runtime->control->avail_min ? : 1;
next reply other threads:[~2018-08-22 15:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-22 15:03 Ricardo Biehl Pasquali [this message]
2018-08-22 15:08 ` [PATCH v2] ALSA: pcm: Return 0 when size < start_threshold in capture Takashi Iwai
2018-08-22 15:25 ` Ricardo Biehl Pasquali
2018-08-22 15:46 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180822150359.GA12976@localhost.localdomain \
--to=pasqualirb@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.