Skip to content

Commit b46af7b

Browse files
committed
schedule: implement timer driven scheduling
Implements timer driven scheduling by processing DW DMA data in tasks added to work queue instead of registering for DW DMA interrupt. Data processing by default will happen every 1 ms. Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
1 parent 0e92421 commit b46af7b

7 files changed

Lines changed: 185 additions & 214 deletions

File tree

src/audio/dai.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ static int dai_playback_params(struct comp_dev *dev)
261261
config->src_width = comp_sample_bytes(dev);
262262
config->dest_width = comp_sample_bytes(dev);
263263
config->cyclic = 1;
264+
config->timer_delay = dev->pipeline->ipc_pipe.timer_delay;
264265
config->dest_dev = dd->dai->plat_data.fifo[0].handshake;
265266

266267
/* set up local and host DMA elems to reset values */
@@ -329,6 +330,7 @@ static int dai_capture_params(struct comp_dev *dev)
329330
config->src_width = comp_sample_bytes(dev);
330331
config->dest_width = comp_sample_bytes(dev);
331332
config->cyclic = 1;
333+
config->timer_delay = dev->pipeline->ipc_pipe.timer_delay;
332334
config->src_dev = dd->dai->plat_data.fifo[1].handshake;
333335

334336
/* set up local and host DMA elems to reset values */

src/audio/pipeline.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,8 @@ static void pipeline_trigger_sched_comp(struct pipeline *p,
219219
*/
220220
if (comp->params.direction == SOF_IPC_STREAM_PLAYBACK ||
221221
p->status == COMP_STATE_PAUSED) {
222-
223-
/* pipelines are either scheduled by timers or DAI/DMA interrupts */
224-
if (p->ipc_pipe.timer) {
225-
/* timer - schedule initial copy */
226-
pipeline_schedule_copy(p, 0);
227-
} else {
228-
/* DAI - schedule initial pipeline fill when next idle */
229-
pipeline_schedule_copy_idle(p);
230-
}
222+
/* schedule initial pipeline fill when next idle */
223+
pipeline_schedule_copy_idle(p);
231224
}
232225
p->status = COMP_STATE_ACTIVE;
233226
break;
@@ -1290,11 +1283,6 @@ static void pipeline_task(void *arg)
12901283

12911284
sched:
12921285
tracev_pipe("PWe");
1293-
1294-
/* now reschedule the task */
1295-
/* TODO: add in scheduling cost and any timer drift */
1296-
if (p->ipc_pipe.timer)
1297-
pipeline_schedule_copy(p, p->ipc_pipe.deadline);
12981286
}
12991287

13001288
/* init pipeline */

0 commit comments

Comments
 (0)