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

Otavio Salvador otavio at ossystems.com.br
Wed Dec 31 11:10:10 PST 2014


On Tue, Dec 30, 2014 at 12:58 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.
>
> Commit 9acab46fe307ec71d4a4dbe447e356f90b6a4a09 in master branch

This commit id does not seem to exist in the public layer, I think you
might mistakenly referenced an internal commit.

Could you point us the commit in master branch of meta-fsl-arm?

> Signed-off-by: Zidan Wang <b50113 at freescale.com>
> ---
>  .../0001-asrc_pair-update-output-buffer-size.patch | 49 ++++++++++++++++++++++
>  recipes-multimedia/alsa/fsl-alsa-plugins_1.0.25.bb |  3 ++
>  2 files changed, 52 insertions(+)
>  create mode 100644 recipes-multimedia/alsa/fsl-alsa-plugins/0001-asrc_pair-update-output-buffer-size.patch
>
> diff --git a/recipes-multimedia/alsa/fsl-alsa-plugins/0001-asrc_pair-update-output-buffer-size.patch b/recipes-multimedia/alsa/fsl-alsa-plugins/0001-asrc_pair-update-output-buffer-size.patch
> new file mode 100644
> index 0000000..a53ac13
> --- /dev/null
> +++ b/recipes-multimedia/alsa/fsl-alsa-plugins/0001-asrc_pair-update-output-buffer-size.patch
> @@ -0,0 +1,49 @@
> +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.
> +
> +Commit 9acab46fe307ec71d4a4dbe447e356f90b6a4a09 in master branch
> +
> +Upstream Status: Backported
> +
> +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 \
> +"
> +

Shouldn't this to be applied for all SoCs using this recipe?

>  INCLUDE_DIR = "-I${STAGING_KERNEL_DIR}/include/uapi -I${STAGING_KERNEL_DIR}/include"
>
>  EXTRA_OECONF = "CFLAGS="${INCLUDE_DIR}""
> --
> 1.9.1
>
> --
> _______________________________________________
> meta-freescale mailing list
> meta-freescale at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-freescale



-- 
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