summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-09-12 05:16:04 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-09-12 05:16:03 -0700
commitbc7a35be18e39658004dcab0f780afeb45d1133d (patch)
treef897c461851949d5a561d84d051dafb661dfa10a
parent5872e6e3e86a31ebd1e270ca8227aa00750bac93 (diff)
parent3d90a144e757c6c1ec8c8624000aab1ab9c46c69 (diff)
Merge "ASoc: msm: qdsp6v2: Fix timestamp glitch during gapless transition"
-rw-r--r--sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c b/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c
index 7e0f790b30e9..70ed8dd3e038 100644
--- a/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c
+++ b/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c
@@ -2005,20 +2005,25 @@ static int msm_compr_pointer(struct snd_compr_stream *cstream,
gapless_transition = prtd->gapless_state.gapless_transition;
spin_unlock_irqrestore(&prtd->lock, flags);
+ if (gapless_transition)
+ pr_debug("%s session time in gapless transition",
+ __func__);
+
/*
- Query timestamp from DSP if some data is with it.
- This prevents timeouts.
+ - Do not query if no buffer has been given.
+ - Do not query on a gapless transition.
+ Playback for the 2nd stream can start (thus returning time
+ starting from 0) before the driver knows about EOS of first stream.
*/
- if (!first_buffer || gapless_transition) {
- if (gapless_transition)
- pr_debug("%s session time in gapless transition",
- __func__);
+
+ if (!first_buffer && !gapless_transition) {
if (pdata->use_legacy_api)
rc = q6asm_get_session_time_legacy(prtd->audio_client,
- &timestamp);
+ &prtd->marker_timestamp);
else
rc = q6asm_get_session_time(prtd->audio_client,
- &timestamp);
+ &prtd->marker_timestamp);
+
if (rc < 0) {
pr_err("%s: Get Session Time return value =%lld\n",
__func__, timestamp);
@@ -2027,9 +2032,8 @@ static int msm_compr_pointer(struct snd_compr_stream *cstream,
else
return -EAGAIN;
}
- } else {
- timestamp = prtd->marker_timestamp;
}
+ timestamp = prtd->marker_timestamp;
/* DSP returns timestamp in usec */
pr_debug("%s: timestamp = %lld usec\n", __func__, timestamp);