From a26eb619f57f7e0a18cbfff6a38ee1bb8e4be0cc Mon Sep 17 00:00:00 2001 From: Viraj Karandikar Date: Mon, 23 Feb 2015 18:37:06 +0530 Subject: [PATCH] asoc: tegra-alt: fix for repeat of offload stream Do not send message to inactive state transition and flush. APM moves to inactive state on its own. Convert sample rate from index to value when sending to user. Bug 200082504 Change-Id: I9ee1c4a995940882e7cf163ab90fc59ffd0804df Signed-off-by: Viraj Karandikar Reviewed-on: http://git-master/r/710381 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Stephen Holmes Reviewed-by: Sumit Bhattacharya --- sound/soc/tegra-alt/tegra210_adsp_alt.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sound/soc/tegra-alt/tegra210_adsp_alt.c b/sound/soc/tegra-alt/tegra210_adsp_alt.c index ee119a72..25346a20 100644 --- a/sound/soc/tegra-alt/tegra210_adsp_alt.c +++ b/sound/soc/tegra-alt/tegra210_adsp_alt.c @@ -857,11 +857,6 @@ static int tegra210_adsp_compr_msg_handler(struct tegra210_adsp_app *app, dev_warn(prtd->dev, "EOS reached before drain"); break; } - tegra210_adsp_send_state_msg(prtd->fe_apm, - nvfx_state_inactive, - TEGRA210_ADSP_MSG_FLAG_SEND); - tegra210_adsp_send_flush_msg(prtd->fe_apm, - TEGRA210_ADSP_MSG_FLAG_SEND); snd_compr_drain_notify(prtd->cstream); prtd->is_draining = 0; } @@ -1055,7 +1050,6 @@ static int tegra210_adsp_compr_trigger(struct snd_compr_stream *cstream, return ret; } break; - default: dev_err(prtd->dev, "Unsupported state."); return -EINVAL; @@ -1119,7 +1113,8 @@ static int tegra210_adsp_compr_pointer(struct snd_compr_stream *cstream, tstamp->pcm_frames = frames_played; /* TODO : calculate IO frames correctly */ tstamp->pcm_io_frames = frames_played; - tstamp->sampling_rate = prtd->codec.sample_rate; + tstamp->sampling_rate = + snd_pcm_rate_bit_to_rate(prtd->codec.sample_rate); dev_vdbg(prtd->dev, "%s off %d copied %d pcm %d pcm io %d", __func__, (int)tstamp->byte_offset, (int)tstamp->copied_total,