Home Home > GIT Browse > openSUSE-15.1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-01-10 20:41:49 +0100
committerTakashi Iwai <tiwai@suse.de>2019-01-11 08:35:12 +0100
commit5776501b24c366e095c64c3d1d80312ba277e26b (patch)
tree783dd45e9ceb620c670006e74b67efea3230e1af
parentb6ef5d3b41296663901e4cedd2bf3c6f92376a54 (diff)
ALSA: pcm: Return 0 when size < start_threshold in capture
(bsc#1121278).
-rw-r--r--patches.drivers/ALSA-pcm-Return-0-when-size-start_threshold-in-captu.patch47
-rw-r--r--series.conf1
2 files changed, 48 insertions, 0 deletions
diff --git a/patches.drivers/ALSA-pcm-Return-0-when-size-start_threshold-in-captu.patch b/patches.drivers/ALSA-pcm-Return-0-when-size-start_threshold-in-captu.patch
new file mode 100644
index 0000000000..98f9a24ac9
--- /dev/null
+++ b/patches.drivers/ALSA-pcm-Return-0-when-size-start_threshold-in-captu.patch
@@ -0,0 +1,47 @@
+From 62ba568f7aef4beb0eda945a2b2a91b7a2b8f215 Mon Sep 17 00:00:00 2001
+From: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
+Date: Sat, 25 Aug 2018 16:53:23 -0300
+Subject: [PATCH] ALSA: pcm: Return 0 when size < start_threshold in capture
+Git-commit: 62ba568f7aef4beb0eda945a2b2a91b7a2b8f215
+Patch-mainline: v4.20-rc1
+References: bsc#1121278
+
+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>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ sound/core/pcm_lib.c | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
+index 4e6110d778bd..7f71c2449af5 100644
+--- a/sound/core/pcm_lib.c
++++ b/sound/core/pcm_lib.c
+@@ -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) {
+- 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;
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 6c84eaf7c9..07ba4f8ab5 100644
--- a/series.conf
+++ b/series.conf
@@ -40505,6 +40505,7 @@
patches.drivers/scsi-qla2xxx-fully-convert-to-the-generic-DMA-API.patch
patches.fixes/scsi-fnic-replace-gross-legacy-tag-hack-with-blk-mq-.patch
patches.drivers/scsi-hisi_sas-Fix-NULL-pointer-dereference.patch
+ patches.drivers/ALSA-pcm-Return-0-when-size-start_threshold-in-captu.patch
patches.drivers/ALSA-memalloc-Don-t-align-the-size-to-power-of-two.patch
patches.drivers/ALSA-memalloc-Simplify-snd_malloc_dev_pages-calls.patch
patches.drivers/ALSA-memalloc-Add-non-cached-buffer-type.patch