msm: Asoc: LPA: Fix pause and next clip play issue
- When paused and press next button to play next song, sometimes CMD_EOS fails to get Ack from LPASS and is wait timeout for 5sec causing delay for next playback start. - In the failure case, even before trigger start of driver is done,LPA driver receives pcm_close. In this case, though EOS is issued, it is not getting honored from LPASS. - If trigger start not happen in LPA driver, avoid CMD_EOS to LPASS as it will not be handled. CRs-Fixed: 368519, 366926 Change-Id: Ib5ff21925bb44849b27ed4709b72efcccf412b5d Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
This commit is contained in:
committed by
Stephen Boyd
parent
8d1efcd1c2
commit
28feaa0fea
@@ -232,10 +232,12 @@ static int msm_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
|
||||
pr_debug("SNDRV_PCM_TRIGGER_START\n");
|
||||
q6asm_run_nowait(prtd->audio_client, 0, 0, 0);
|
||||
atomic_set(&prtd->start, 1);
|
||||
atomic_set(&prtd->stop, 0);
|
||||
break;
|
||||
case SNDRV_PCM_TRIGGER_STOP:
|
||||
pr_debug("SNDRV_PCM_TRIGGER_STOP\n");
|
||||
atomic_set(&prtd->start, 0);
|
||||
atomic_set(&prtd->stop, 1);
|
||||
if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
|
||||
break;
|
||||
break;
|
||||
@@ -323,6 +325,7 @@ static int msm_pcm_open(struct snd_pcm_substream *substream)
|
||||
|
||||
prtd->dsp_cnt = 0;
|
||||
atomic_set(&prtd->pending_buffer, 1);
|
||||
atomic_set(&prtd->stop, 1);
|
||||
runtime->private_data = prtd;
|
||||
lpa_audio.prtd = prtd;
|
||||
lpa_set_volume(lpa_audio.volume);
|
||||
@@ -366,7 +369,8 @@ static int msm_pcm_playback_close(struct snd_pcm_substream *substream)
|
||||
To issue EOS to dsp, we need to be run state otherwise
|
||||
EOS is not honored.
|
||||
*/
|
||||
if (msm_routing_check_backend_enabled(soc_prtd->dai_link->be_id)) {
|
||||
if (msm_routing_check_backend_enabled(soc_prtd->dai_link->be_id) &&
|
||||
(!atomic_read(&prtd->stop))) {
|
||||
rc = q6asm_run(prtd->audio_client, 0, 0, 0);
|
||||
atomic_set(&prtd->pending_buffer, 0);
|
||||
prtd->cmd_ack = 0;
|
||||
@@ -386,6 +390,7 @@ static int msm_pcm_playback_close(struct snd_pcm_substream *substream)
|
||||
q6asm_audio_client_buf_free_contiguous(dir,
|
||||
prtd->audio_client);
|
||||
|
||||
atomic_set(&prtd->stop, 1);
|
||||
pr_debug("%s\n", __func__);
|
||||
msm_pcm_routing_dereg_phy_stream(soc_prtd->dai_link->be_id,
|
||||
SNDRV_PCM_STREAM_PLAYBACK);
|
||||
|
||||
@@ -71,6 +71,7 @@ struct msm_audio {
|
||||
int close_ack;
|
||||
int cmd_ack;
|
||||
atomic_t start;
|
||||
atomic_t stop;
|
||||
atomic_t out_count;
|
||||
atomic_t in_count;
|
||||
atomic_t out_needed;
|
||||
|
||||
Reference in New Issue
Block a user