Patchwork [2/3] alsa-lib: fix hw_ptr exceed the boundary

login
register
mail settings
Submitter Wang Zidan
Date Aug. 4, 2014, 3:21 a.m.
Message ID <1407122473-16439-1-git-send-email-b50113@freescale.com>
Download mbox | patch
Permalink /patch/77167/
State Accepted
Commit a06c9340e99df56ce79f03b56a25a694997daefc
Headers show

Comments

Wang Zidan - Aug. 4, 2014, 3:21 a.m.
For long time test case, the hw_ptr will exceed the boundary, then cause
the avail size wrong.

Signed-off-by: Wang Zidan <b50113@freescale.com>
---
 ...1-pcm-rate-fix-hw_ptr-exceed-the-boundary.patch |   34 ++++++++++++++++++++
 meta/recipes-multimedia/alsa/alsa-lib_1.0.27.2.bb  |    1 +
 2 files changed, 35 insertions(+)
 create mode 100755 meta/recipes-multimedia/alsa/alsa-lib/0001-pcm-rate-fix-hw_ptr-exceed-the-boundary.patch
Otavio Salvador - Aug. 4, 2014, 8:13 p.m.
On Mon, Aug 4, 2014 at 12:21 AM, Wang Zidan <b50113@freescale.com> wrote:
> For long time test case, the hw_ptr will exceed the boundary, then cause
> the avail size wrong.
>
> Signed-off-by: Wang Zidan <b50113@freescale.com>



Acked-by: Otavio Salvador <otavio@ossystems.com.br>

Patch

diff --git a/meta/recipes-multimedia/alsa/alsa-lib/0001-pcm-rate-fix-hw_ptr-exceed-the-boundary.patch b/meta/recipes-multimedia/alsa/alsa-lib/0001-pcm-rate-fix-hw_ptr-exceed-the-boundary.patch
new file mode 100755
index 0000000..8be3d75
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-lib/0001-pcm-rate-fix-hw_ptr-exceed-the-boundary.patch
@@ -0,0 +1,34 @@ 
+From 035f196bcdc1e9903ed52ad1859dc23d3aa74e72 Mon Sep 17 00:00:00 2001
+From: Shengjiu Wang <shengjiu.wang@freescale.com>
+Date: Mon, 14 Jul 2014 16:55:48 +0800
+Subject: [PATCH] pcm: rate: fix hw_ptr exceed the boundary
+
+For long time test case, the hw_ptr will exceed the boundary, then cause
+the avail size wrong.
+
+Commit is 035f196bcdc1e9903ed52ad1859dc23d3aa74e72 in master branch
+
+Upstream Status: Backported
+
+Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+---
+ src/pcm/pcm_rate.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
+index 7f667d4..2563d82 100644
+--- a/src/pcm/pcm_rate.c
++++ b/src/pcm/pcm_rate.c
+@@ -574,6 +574,8 @@ static inline void snd_pcm_rate_sync_hwptr(snd_pcm_t *pcm)
+ 	rate->hw_ptr =
+ 		(slave_hw_ptr / rate->gen.slave->period_size) * pcm->period_size +
+ 		rate->ops.input_frames(rate->obj, slave_hw_ptr % rate->gen.slave->period_size);
++
++	rate->hw_ptr %= pcm->boundary;
+ }
+ 
+ static int snd_pcm_rate_hwsync(snd_pcm_t *pcm)
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/alsa/alsa-lib_1.0.27.2.bb b/meta/recipes-multimedia/alsa/alsa-lib_1.0.27.2.bb
index d46f7a0..b345377 100644
--- a/meta/recipes-multimedia/alsa/alsa-lib_1.0.27.2.bb
+++ b/meta/recipes-multimedia/alsa/alsa-lib_1.0.27.2.bb
@@ -19,6 +19,7 @@  SRC_URI = "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-${PV}.tar.bz2 \
            file://fix-tstamp-declaration.patch \
            file://Update-iatomic.h-functions-definitions-for-mips.patch \
            file://0001-pcm-route-Use-get32-for-multi-source-route-calculati.patch \
+           file://0001-pcm-rate-fix-hw_ptr-exceed-the-boundary.patch \
 "
 SRC_URI[md5sum] = "69129a7c37697f81ac092335e9fa452b"
 SRC_URI[sha256sum] = "690ed393e7efd4fc7e3a2d2cda5449298ca0c895197e5914e350882012430d19"