summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@nxp.com>2018-07-24 14:10:55 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commitadc554ea011c1ae3ef32a3541d00a9209a903087 (patch)
tree2df495713752d2ab80edde1cdd0f927a46e7ee56 /sound
parent2800e4023e9070e645081b897fb8e9bbb99f99b5 (diff)
MLK-18874: ASoC: fsl_asrc: fix noise issue with 5 channel conversion
The dma_len is the size that how many data dma should transmit. As the asrc use channel as unit, so the dma_len should also in channel unit. Otherwise the output data is not align in channel, there will be noise. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com> (cherry picked from commit ed8ee98002cac3ba0ba51aea3dca99344bc7e503)
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/fsl_asrc_m2m.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c
index cfe8eee8e886..9f0314970cbb 100644
--- a/sound/soc/fsl/fsl_asrc_m2m.c
+++ b/sound/soc/fsl/fsl_asrc_m2m.c
@@ -279,8 +279,11 @@ static int fsl_asrc_prepare_io_buffer(struct fsl_asrc_pair *pair,
return -EFAULT;
*dma_len = buf_len;
- if (dir == OUT)
+ if (dir == OUT) {
*dma_len -= last_period_size * word_size * pair->channels;
+ *dma_len = *dma_len / (word_size * pair->channels) *
+ (word_size * pair->channels);
+ }
*sg_nodes = *dma_len / ASRC_MAX_BUFFER_SIZE + 1;