diff options
author | Shengjiu Wang <shengjiu.wang@freescale.com> | 2017-03-30 20:14:18 +0800 |
---|---|---|
committer | Dong Aisheng <aisheng.dong@nxp.com> | 2019-11-25 15:52:54 +0800 |
commit | 14e0dcede5381bcde8308f9b28cf0896107b3c6f (patch) | |
tree | ea8ff3033b161bd4066d65b476bdb9126aa7d9bd /sound/soc/fsl/imx-pcm-rpmsg.c | |
parent | ce2f05d271f4cbaf77fed45dac0069b44dc58d96 (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.c | 5 |
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; } |