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:13 +0100
commite92afec55f6053984b215f87e2892994c1f406cb (patch)
treeccf9e45f7a8a133b33176c4280eb7d9329463ac0
parent1218fe2357aa28513f93889ddb00c2b70fffe0f3 (diff)
ALSA: pcm: Update hardware pointer before start capture
(bsc#1121278).
-rw-r--r--patches.drivers/ALSA-pcm-Update-hardware-pointer-before-start-captur.patch49
-rw-r--r--series.conf1
2 files changed, 50 insertions, 0 deletions
diff --git a/patches.drivers/ALSA-pcm-Update-hardware-pointer-before-start-captur.patch b/patches.drivers/ALSA-pcm-Update-hardware-pointer-before-start-captur.patch
new file mode 100644
index 0000000000..96aa24c8dc
--- /dev/null
+++ b/patches.drivers/ALSA-pcm-Update-hardware-pointer-before-start-captur.patch
@@ -0,0 +1,49 @@
+From 64b6acf60b665fffd419c23886a1cbeeb253cfb4 Mon Sep 17 00:00:00 2001
+From: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
+Date: Fri, 7 Sep 2018 16:58:54 -0300
+Subject: [PATCH] ALSA: pcm: Update hardware pointer before start capture
+Git-commit: 64b6acf60b665fffd419c23886a1cbeeb253cfb4
+Patch-mainline: v4.20-rc1
+References: bsc#1121278
+
+This ensures the transfer loop won't waste a run to read
+the few frames (if any) between start and hw_ptr update.
+It will wait for the next interrupt with wait_for_avail().
+
+Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ sound/core/pcm_lib.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
+index 7f71c2449af5..40013b26f671 100644
+--- a/sound/core/pcm_lib.c
++++ b/sound/core/pcm_lib.c
+@@ -2172,6 +2172,10 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
+ if (err < 0)
+ goto _end_unlock;
+
++ runtime->twake = runtime->control->avail_min ? : 1;
++ if (runtime->status->state == SNDRV_PCM_STATE_RUNNING)
++ snd_pcm_update_hw_ptr(substream);
++
+ if (!is_playback &&
+ runtime->status->state == SNDRV_PCM_STATE_PREPARED) {
+ if (size >= runtime->start_threshold) {
+@@ -2185,10 +2189,8 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
+ }
+ }
+
+- runtime->twake = runtime->control->avail_min ? : 1;
+- if (runtime->status->state == SNDRV_PCM_STATE_RUNNING)
+- snd_pcm_update_hw_ptr(substream);
+ avail = snd_pcm_avail(substream);
++
+ while (size > 0) {
+ snd_pcm_uframes_t frames, appl_ptr, appl_ofs;
+ snd_pcm_uframes_t cont;
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 288be21bb4..0de7f1a94b 100644
--- a/series.conf
+++ b/series.conf
@@ -40517,6 +40517,7 @@
patches.drivers/ALSA-hda-Remove-substream-allocation-free-ops.patch
patches.drivers/ALSA-hda-Clean-up-jackpoll_ms-option-handling.patch
patches.drivers/ALSA-hda-move-hda_codec.h-to-include-sound.patch
+ patches.drivers/ALSA-pcm-Update-hardware-pointer-before-start-captur.patch
patches.drivers/ALSA-hda-fix-unused-variable-warning.patch
patches.drivers/ALSA-hda-ca0132-Define-new-verbs-and-control-params.patch
patches.drivers/ALSA-hda-ca0132-Add-quirk-for-Sound-BlasterX-AE-5.patch