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>
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) {