summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/imx-pcm-rpmsg.c
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@freescale.com>2017-03-30 20:14:18 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:52:54 +0800
commit14e0dcede5381bcde8308f9b28cf0896107b3c6f (patch)
treeea8ff3033b161bd4066d65b476bdb9126aa7d9bd /sound/soc/fsl/imx-pcm-rpmsg.c
parentce2f05d271f4cbaf77fed45dac0069b44dc58d96 (diff)
MLK-14582: ASoC: imx-pcm-rpmsg: fix audio noise issue with pulseaudio
The pulse audio will set a wrong buffer size which is not the integral multiple of period size, it will cause the DMA can't work correctly in M4 side. The reason is that we always need to add a constraint for SNDRV_PCM_HW_PARAM_PERIODS, which make it integer. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> (cherry picked from commit 54a10a6c2130a69aca4c1923dac3a15137911146)
Diffstat (limited to 'sound/soc/fsl/imx-pcm-rpmsg.c')
-rw-r--r--sound/soc/fsl/imx-pcm-rpmsg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/fsl/imx-pcm-rpmsg.c b/sound/soc/fsl/imx-pcm-rpmsg.c
index 71ef7692c290..e7d7244d7405 100644
--- a/sound/soc/fsl/imx-pcm-rpmsg.c
+++ b/sound/soc/fsl/imx-pcm-rpmsg.c
@@ -140,6 +140,11 @@ static int imx_rpmsg_pcm_open(struct snd_pcm_substream *substream)
substream->runtime->private_data = prtd;
+ ret = snd_pcm_hw_constraint_integer(substream->runtime,
+ SNDRV_PCM_HW_PARAM_PERIODS);
+ if (ret < 0)
+ return ret;
+
return ret;
}