soc: msm: Fix offload may be no sound when user resumes music
Send compress data by q6asm_run callback when user resumes music, if the write_done event has been callback at offload pause state. Bug: 30101878 Signed-off-by: Eric Laurent <elaurent@google.com>
This commit is contained in:
parent
75b8cbf0c3
commit
dce0df919e
|
@ -462,7 +462,8 @@ static void compr_event_handler(uint32_t opcode,
|
|||
if (!atomic_read(&prtd->start)) {
|
||||
/* Writes must be restarted from _copy() */
|
||||
pr_debug("write_done received while not started, treat as xrun");
|
||||
atomic_set(&prtd->xrun, 1);
|
||||
if (prtd->dsp_fragments_sent == 0)
|
||||
atomic_set(&prtd->xrun, 1);
|
||||
spin_unlock_irqrestore(&prtd->lock, flags);
|
||||
break;
|
||||
}
|
||||
|
@ -561,16 +562,20 @@ static void compr_event_handler(uint32_t opcode,
|
|||
* WRITE_DONE(X)
|
||||
* RESUME
|
||||
*/
|
||||
if ((prtd->copied_total == prtd->bytes_sent) &&
|
||||
atomic_read(&prtd->drain)) {
|
||||
pr_debug("RUN ack, wake up & continue pending drain\n");
|
||||
if ((prtd->copied_total == prtd->bytes_sent)) {
|
||||
if (atomic_read(&prtd->drain)) {
|
||||
pr_debug("RUN ack, wake up & continue pending drain\n");
|
||||
|
||||
if (prtd->last_buffer)
|
||||
prtd->last_buffer = 0;
|
||||
if (prtd->last_buffer)
|
||||
prtd->last_buffer = 0;
|
||||
|
||||
prtd->drain_ready = 1;
|
||||
wake_up(&prtd->drain_wait);
|
||||
atomic_set(&prtd->drain, 0);
|
||||
prtd->drain_ready = 1;
|
||||
wake_up(&prtd->drain_wait);
|
||||
atomic_set(&prtd->drain, 0);
|
||||
} else if (prtd->dsp_fragments_sent) {
|
||||
pr_info("RUN ack, resume for pending frames\n");
|
||||
msm_compr_send_buffer(prtd);
|
||||
}
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&prtd->lock, flags);
|
||||
|
|
Loading…
Reference in New Issue