Skip to content

Commit 4d7904d

Browse files
xiulipanslawblauciak
authored andcommitted
dai: recovery dai buffer and dma pointer for none-init start
For none-init first trigger start, need to recovery buffer state and set the dma pointer as pause/release did. This will allow ALSA STOP/START recovery pattern work now. Signed-off-by: Pan Xiuli <[email protected]>
1 parent c1d282b commit 4d7904d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/audio/dai.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,19 @@ static int dai_comp_trigger(struct comp_dev *dev, int cmd)
551551
trace_dai("dai_comp_trigger(), START");
552552
if (!dd->pointer_init)
553553
dai_pointer_init(dev);
554+
/* for nono-first init start, we need to recover the buffer
555+
* state as well pointer position as pause/relesas did
556+
*/
557+
else {
558+
/* set valid buffer pointer */
559+
dai_buffer_process(dev);
560+
561+
/* recover valid start position */
562+
ret = dma_release(dd->dma, dd->chan);
563+
if (ret < 0)
564+
return ret;
565+
}
566+
554567
/* only start the DAI if we are not XRUN handling
555568
* and the ptr is not initialized by the host as in this
556569
* case start is deferred to the first copy call as the buffer

0 commit comments

Comments
 (0)