[Sound-open-firmware] [PATCH] pipeline: Allow pipeline copy to be scheduled when idle for preload.

Liam Girdwood liam.r.girdwood at linux.intel.com
Thu Nov 16 23:01:25 CET 2017


Use the new idle schedule API to schedule a pipeline copy for preload
after prepare() and before trigger(). This pipeline preload copy will
run within the same context as the regular pipeline copy.

Signed-off-by: Liam Girdwood <liam.r.girdwood at linux.intel.com>
---
 src/audio/pipeline.c              | 11 +++++++++++
 src/include/reef/audio/pipeline.h |  1 +
 2 files changed, 12 insertions(+)

diff --git a/src/audio/pipeline.c b/src/audio/pipeline.c
index 61d80b4..40ccdc5 100644
--- a/src/audio/pipeline.c
+++ b/src/audio/pipeline.c
@@ -200,6 +200,9 @@ static void pipeline_cmd_update(struct pipeline *p, struct comp_dev *comp,
 	case COMP_CMD_RELEASE:
 		p->xrun_bytes = 0;
 
+		/* schedule initial pipeline fill when next idle */
+		pipeline_schedule_copy_idle(p);
+
 		/* schedule pipeline */
 		if (p->ipc_pipe.timer)
 			pipeline_schedule_copy(p, 0);
@@ -983,6 +986,14 @@ void pipeline_schedule_copy(struct pipeline *p, uint64_t start)
 		schedule_task(&p->pipe_task, start, p->ipc_pipe.deadline);
 }
 
+/* notify pipeline that this component requires buffers emptied/filled
+ * when DSP is next idle. This is intended to be used to preload pipeline
+ * buffers prior to trigger start. */
+void pipeline_schedule_copy_idle(struct pipeline *p)
+{
+	schedule_task_idle(&p->pipe_task, p->ipc_pipe.deadline);
+}
+
 void pipeline_schedule_cancel(struct pipeline *p)
 {
 	schedule_task_complete(&p->pipe_task);
diff --git a/src/include/reef/audio/pipeline.h b/src/include/reef/audio/pipeline.h
index 41cfffc..c5ba49f 100644
--- a/src/include/reef/audio/pipeline.h
+++ b/src/include/reef/audio/pipeline.h
@@ -114,6 +114,7 @@ int init_pipeline(void);
 
 /* schedule a copy operation for this pipeline */
 void pipeline_schedule_copy(struct pipeline *p, uint64_t start);
+void pipeline_schedule_copy_idle(struct pipeline *p);
 void pipeline_schedule_cancel(struct pipeline *p);
 
 /* get time pipeline timestamps from host to dai */
-- 
2.11.0



More information about the Sound-open-firmware mailing list