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

Commit 60fafe34 authored by Sitong Chen's avatar Sitong Chen
Browse files

ASoC: msm: qdsp6v2: write all periods to DSP on playback trigger



In mmap mode, when playback is triggered, send as much as periods
to DSP.

In previous implementation, only 1 period be sent to DSP at trigger
time, it's consumed in DSP and then send back a write-done event,
which will be captured and trigger another write action in the
event_handler.
The problem is, any jitter in the event transmission will result
in a delay on the next write, and a gap in the output is noticeable.
A multiple-periods queue in DSP can filter out such a jitter to
avoid impact to the output.

Change-Id: I6f04971c076409b5ada8e40cea2b4e01de88b5a9
Signed-off-by: default avatarHan Lu <hanlu@codeaurora.org>
Signed-off-by: default avatarSitong Chen <sitochen@codeaurora.org>
parent 3f57ae97
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -265,12 +265,19 @@ static void event_handler(uint32_t opcode,
				break;
			}
			if (prtd->mmap_flag) {
				pr_debug("%s:writing %d bytes of buffer to dsp\n",
					__func__,
				int cnt = prtd->pcm_size / prtd->pcm_count;

				pr_debug("%s %d:buffer %d, period %d, %d writes\n",
					__func__, __LINE__,
					prtd->pcm_size, prtd->pcm_count, cnt);
				while (cnt--) {
					pr_debug("%s %d:writing %d bytes of buffer to dsp\n",
						__func__, __LINE__,
						prtd->pcm_count);
					q6asm_write_nolock(prtd->audio_client,
						prtd->pcm_count,
						0, 0, NO_TIMESTAMP);
				}
			} else {
				while (atomic_read(&prtd->out_needed)) {
					pr_debug("%s:writing %d bytes of buffer to dsp\n",