Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73e3423a authored by Haynes Mathew George's avatar Haynes Mathew George Committed by Gerrit - the friendly Code Review server
Browse files

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.

This issue will only happen if pause/resume is called with at least
one dsp_fragment in the driver space

Bug: 30101878
CRs-Fixed: 2058309
Change-Id: I764bcf2fd6028a051a890a768e52e87f6676241e
Signed-off-by: default avatarcarter_hsu <carter_hsu@htc.com>
Git-commit: b528a6e9af1597f668ded6fe48b9ad2c35355d9c
Git-repo: https://android.googlesource.com/kernel/msm


Signed-off-by: default avatarHaynes Mathew George <hgeorge@codeaurora.org>
Signed-off-by: default avatarSatya Krishna Pindiproli <satyak@codeaurora.org>
parent f4903509
Loading
Loading
Loading
Loading
+16 −11
Original line number Diff line number Diff line
@@ -487,6 +487,7 @@ 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");
			if (prtd->dsp_fragments_sent == 0)
				atomic_set(&prtd->xrun, 1);
			spin_unlock_irqrestore(&prtd->lock, flags);
			break;
@@ -637,8 +638,8 @@ static void compr_event_handler(uint32_t opcode,
			 * WRITE_DONE(X)
			 * RESUME
			 */
			if ((prtd->copied_total == prtd->bytes_sent) &&
			    atomic_read(&prtd->drain)) {
			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)
@@ -647,6 +648,10 @@ static void compr_event_handler(uint32_t opcode,
					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);