From dc841995d90c2cfa7756c17080fa8a43a4713ddb Mon Sep 17 00:00:00 2001 From: Viswanath L Date: Tue, 27 Nov 2018 21:56:17 +0530 Subject: [PATCH] tegra-alt: adsp: Do not adjust Compress PCM pos PCM pointer in compress path need not be adjusted for sample rate conversion as rate conversion always happens in AHUB (ASRC) and not in ADSP; cases where rate conversion happens in ADSP will no longer return correct position Bug 200430129 Change-Id: I93e3f0680260ce057a17c70f037c9093be3e17cf Signed-off-by: Viswanath L Reviewed-on: https://git-master.nvidia.com/r/1959444 (cherry picked from commit fd33d1360f3a2e684363eecf9f0570b66fa2f51d) Reviewed-on: https://git-master.nvidia.com/r/1984711 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Sumit Bhattacharya Reviewed-by: mobile promotions Tested-by: mobile promotions --- sound/soc/tegra-alt/tegra210_adsp_alt.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sound/soc/tegra-alt/tegra210_adsp_alt.c b/sound/soc/tegra-alt/tegra210_adsp_alt.c index b437659b..d46d5a2d 100644 --- a/sound/soc/tegra-alt/tegra210_adsp_alt.c +++ b/sound/soc/tegra-alt/tegra210_adsp_alt.c @@ -1572,14 +1572,10 @@ static int tegra210_adsp_compr_pointer(struct snd_compr_stream *cstream, struct snd_compr_tstamp *tstamp) { struct tegra210_adsp_compr_rtd *prtd = cstream->runtime->private_data; - struct snd_soc_pcm_runtime *rtd = cstream->device->private_data; - struct tegra210_adsp *adsp = - snd_soc_platform_get_drvdata(rtd->platform); struct tegra210_adsp_app *app = prtd->fe_apm; nvfx_shared_state_t *shared = &app->apm->nvfx_shared_state; - uint32_t frames_played = ((shared->output[0].bytes >> 2) * - snd_pcm_rate_bit_to_rate(prtd->codec.sample_rate)) / - adsp->i2s_rate; + uint32_t frames_played = + (uint32_t)((shared->output[0].bytes >> 1) / prtd->codec.ch_in); tstamp->byte_offset = shared->input[0].bytes % cstream->runtime->buffer_size;