]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00305624-2 ASoC: imx-hdmi-dma: Correct the appl pointer
authorNicolin Chen <Guangyu.Chen@freescale.com>
Tue, 25 Mar 2014 03:46:35 +0000 (11:46 +0800)
committerNicolin Chen <Guangyu.Chen@freescale.com>
Thu, 27 Mar 2014 11:20:00 +0000 (19:20 +0800)
We might not be able to get appl_ptr, so we estimated it by using hw_ptr,
while the distance between then should not be 2 * priv->period_bytes
initially but 8 * priv->period_bytes as we pri-filled one entire buffer
size at the beginning. The driver's memory access might be overlapped
with ALSA's buffer updating. So this patch fixes this inaccurate distance.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
sound/soc/fsl/imx-hdmi-dma.c

index 8f3e79845fa643b88df2a8f9f7370ef202beed7c..d0e907a07790efe07471e22443fbc9572338e162 100644 (file)
@@ -447,7 +447,7 @@ static void hdmi_dma_data_copy(struct snd_pcm_substream *substream,
 
        appl_bytes = frames_to_bytes(runtime, runtime->status->hw_ptr);
        if (type == 'p')
-               appl_bytes += 2 * priv->period_bytes;
+               appl_bytes += 8 * priv->period_bytes;
        offset = appl_bytes % priv->buffer_bytes;
 
        switch (type) {