diff options
author | Shengjiu Wang <shengjiu.wang@freescale.com> | 2017-06-12 16:27:14 +0800 |
---|---|---|
committer | Dong Aisheng <aisheng.dong@nxp.com> | 2019-11-25 15:51:24 +0800 |
commit | d928e16f9d396f9323b4fa331162bc8754154fb4 (patch) | |
tree | 64d2b4226c179047ca16a053f10c90eeab511373 | |
parent | 98ee74727894da0250d31c0f43038016aa1f24e8 (diff) |
MLK-15066-1: ASoC: imx-pcm-dma-v2: fix noise issue with pulseaudio
Same as commit c55075170214 ("MLK-14582: ASoC: imx-pcm-rpmsg: fix
audio noise issue with pulseaudio"), need to add a constraint for
SNDRV_PCM_HW_PARAM_PERIODS, which make the period number integer.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
-rw-r--r-- | sound/soc/fsl/imx-pcm-dma-v2.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sound/soc/fsl/imx-pcm-dma-v2.c b/sound/soc/fsl/imx-pcm-dma-v2.c index 38ff1375ff3d..7d345dd92e3d 100644 --- a/sound/soc/fsl/imx-pcm-dma-v2.c +++ b/sound/soc/fsl/imx-pcm-dma-v2.c @@ -113,12 +113,23 @@ static int imx_pcm_open(struct snd_pcm_substream *substream) chan = dma_request_slave_channel(rtd->cpu_dai->dev, dma_data->filter_data); ret = snd_dmaengine_pcm_open(substream, chan); + if (ret) + return ret; } else { ret = snd_dmaengine_pcm_open_request_chan(substream, imx_dma_filter_fn, dma_data->filter_data); + if (ret) + return ret; } - return ret; + + ret = snd_pcm_hw_constraint_integer(substream->runtime, + SNDRV_PCM_HW_PARAM_PERIODS); + if (ret < 0) + return ret; + + + return 0; } static int imx_pcm_mmap(struct snd_pcm_substream *substream, |