MLK-11429-16: ASoC: fsl_asrc: Add delay after enabling ASRC p2p
authorNicolin Chen <Guangyu.Chen@freescale.com>
Wed, 9 Apr 2014 03:24:51 +0000 (11:24 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:48:11 +0000 (14:48 -0500)
cherry-pick below patch from imx_3.14.y
ENGR00307592 ASoC: fsl_asrc: Add delay after enabling ASRC p2p

When using ASRC p2p as a for-end with other back-end modules like ESAI,
it'd be safer to add 1ms delay, less might be futile for extreme cases,
after enabling ASRC so as to keep ASRC output FIFO with enough data to
content the DMA burstsize of back-ends and accordingly prevent underrun
that might happen to them.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
(cherry picked from commit c68c1874c07c30a3483eed70fb2abe82e19d1d20)

sound/soc/fsl/fsl_asrc.c

index 257dbd8..98bc5d4 100644 (file)
@@ -529,6 +529,8 @@ static int fsl_asrc_dai_trigger(struct snd_pcm_substream *substream, int cmd,
        case SNDRV_PCM_TRIGGER_RESUME:
        case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
                fsl_asrc_start_pair(pair);
+               /* Output enough data to content the DMA burstsize of BE */
+               mdelay(1);
                break;
        case SNDRV_PCM_TRIGGER_STOP:
        case SNDRV_PCM_TRIGGER_SUSPEND: