[meta-freescale] [meta-fsl-arm][PATCH v2] fsl-alsa-plugins: update output buffer size for asrc_pair

Zidan Wang B50113 at freescale.com
Mon Jan 5 00:12:34 PST 2015


Yes, It's just for I.MX6.
And I will add PACKAGE_ARCH_mx6 = "${MACHINE_SOCARCH}" in patch v3. Thanks.

Best Regards,
Zidan
-----Original Message-----
From: otavio.salvador at gmail.com [mailto:otavio.salvador at gmail.com] On Behalf Of Otavio Salvador
Sent: Monday, January 05, 2015 2:03 AM
To: Wang Zidan-B50113
Cc: meta-freescale at yoctoproject.org
Subject: Re: [meta-freescale] [meta-fsl-arm][PATCH v2] fsl-alsa-plugins: update output buffer size for asrc_pair

Hello Zidan,

On Sun, Jan 4, 2015 at 7:31 AM, Zidan Wang <b50113 at freescale.com> wrote:
> When input size larger than DMA_MAX_BYTES the output size should be updated.
> Otherwise the asrc have will not have enough data, then it will be timeout.
>
> Signed-off-by: Zidan Wang <b50113 at freescale.com>

Great commit log. Thanks ... more comments below ...

> diff --git 
> a/recipes-multimedia/alsa/fsl-alsa-plugins/0001-asrc_pair-update-outpu
> t-buffer-size.patch 
> b/recipes-multimedia/alsa/fsl-alsa-plugins/0001-asrc_pair-update-outpu
> t-buffer-size.patch
> new file mode 100644
> index 0000000..d76c74d
> --- /dev/null
> +++ b/recipes-multimedia/alsa/fsl-alsa-plugins/0001-asrc_pair-update-o
> +++ utput-buffer-size.patch
> @@ -0,0 +1,47 @@
> +From 9acab46fe307ec71d4a4dbe447e356f90b6a4a09 Mon Sep 17 00:00:00 
> +2001
> +From: Shengjiu Wang <shengjiu.wang at freescale.com>
> +Date: Fri, 12 Dec 2014 14:58:06 +0800
> +Subject: [PATCH] [asrc_pair] update output buffer size
> +
> +When input size larger than DMA_MAX_BYTES the output size should be updated.
> +Otherwise the asrc have will not have enough data, then it will be timeout.
> +
> +Upstream Status: Inappropriate [platform specific]
> +
> +Signed-off-by: Shengjiu Wang <shengjiu.wang at freescale.com>
> +---
> + asrc/asrc_pair.c | 11 ++++++++---
> + 1 file changed, 8 insertions(+), 3 deletions(-)
> +
> +diff --git a/asrc/asrc_pair.c b/asrc/asrc_pair.c index 
> +e3df027..e74e8b1 100644
> +--- a/asrc/asrc_pair.c
> ++++ b/asrc/asrc_pair.c
> +@@ -139,7 +139,7 @@ asrc_pair *asrc_pair_create(unsigned int channels, ssize_t in_period_frames,
> +     config.dma_buffer_size = dma_buffer_size;
> +     config.input_sample_rate = in_rate;
> +     config.output_sample_rate = out_rate;
> +-    config.buffer_num = 1;
> ++    config.buffer_num = buf_num;
> +     config.input_word_width = ASRC_WIDTH_16_BIT;
> +     config.output_word_width = ASRC_WIDTH_16_BIT;
> +     config.inclk = INCLK_NONE;
> +@@ -303,8 +303,13 @@ void asrc_pair_convert_s16(asrc_pair *pair, 
> +const int16_t *src, unsigned int src
> +
> +     while (src_left > 0)
> +     {
> +-        in_len = src_left > pair->buf_size ? pair->buf_size : src_left;
> +-        out_len = dst_left;
> ++      if (src_left > pair->buf_size) {
> ++              in_len = pair->buf_size;
> ++              out_len = dst_left * in_len/src_left;
> ++      } else {
> ++              in_len = src_left;
> ++              out_len = dst_left;
> ++      }
> +
> +         buf_info.input_buffer_vaddr = s;
> +         buf_info.input_buffer_length = in_len;
> +--
> +1.9.1
> +
> diff --git a/recipes-multimedia/alsa/fsl-alsa-plugins_1.0.25.bb 
> b/recipes-multimedia/alsa/fsl-alsa-plugins_1.0.25.bb
> index 331ccdb..2350a82 100644
> --- a/recipes-multimedia/alsa/fsl-alsa-plugins_1.0.25.bb
> +++ b/recipes-multimedia/alsa/fsl-alsa-plugins_1.0.25.bb
> @@ -14,6 +14,9 @@ SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.tar.gz"
>  SRC_URI[md5sum] = "b1ca7a250a8cd5da07062081b30b4118"
>  SRC_URI[sha256sum] = "902df92255d755e8eb08b3c3db0c7b9d70d26d9659b219373bee425ffdc34245"
>
> +SRC_URI_append_mx6 = " 
> +file://0001-asrc_pair-update-output-buffer-size.patch \ "
> +

This should be applied ONLY for i.MX6?

If this is the case, than you also need to add:

PACKAGE_ARCH_mx6 = "${MACHINE_SOCARCH}"

So it has a different package architecture feed and does not cause a rebuild due sstate hash change for other SoCs.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


More information about the meta-freescale mailing list