aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/sst-haswell-pcm.c
diff options
context:
space:
mode:
authorLiam Girdwood <liam.r.girdwood@linux.intel.com>2014-05-02 16:56:33 +0100
committerMark Brown <broonie@linaro.org>2014-05-02 09:54:05 -0700
commit51b4e24f383c84ed927fef348072b6dc65b9816d (patch)
treed0818cfe74582d6152c4b094d915bd53c8f36333 /sound/soc/intel/sst-haswell-pcm.c
parentASoC: Intel: Fix allow hw_params to be called more than once. (diff)
downloadlinux-dev-51b4e24f383c84ed927fef348072b6dc65b9816d.tar.xz
linux-dev-51b4e24f383c84ed927fef348072b6dc65b9816d.zip
ASoC: Intel: Fix stream position pointer.
Read the stream offset and presentation position from DSP memory rather than using the old estimated position. This fixes timing issues with pulseaudio. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to '')
-rw-r--r--sound/soc/intel/sst-haswell-pcm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/soc/intel/sst-haswell-pcm.c b/sound/soc/intel/sst-haswell-pcm.c
index 50fea077898b..8c6bd33dd375 100644
--- a/sound/soc/intel/sst-haswell-pcm.c
+++ b/sound/soc/intel/sst-haswell-pcm.c
@@ -569,12 +569,14 @@ static snd_pcm_uframes_t hsw_pcm_pointer(struct snd_pcm_substream *substream)
struct hsw_pcm_data *pcm_data = snd_soc_pcm_get_drvdata(rtd);
struct sst_hsw *hsw = pdata->hsw;
snd_pcm_uframes_t offset;
+ uint64_t ppos;
+ u32 position = sst_hsw_get_dsp_position(hsw, pcm_data->stream);
- offset = bytes_to_frames(runtime,
- sst_hsw_get_dsp_position(hsw, pcm_data->stream));
+ offset = bytes_to_frames(runtime, position);
+ ppos = sst_hsw_get_dsp_presentation_position(hsw, pcm_data->stream);
- dev_dbg(rtd->dev, "PCM: DMA pointer %zu bytes\n",
- frames_to_bytes(runtime, (u32)offset));
+ dev_dbg(rtd->dev, "PCM: DMA pointer %du bytes, pos %llu\n",
+ position, ppos);
return offset;
}