diff --git a/src/audio/pipeline.c b/src/audio/pipeline.c index 35b585625..be726b814 100644 --- a/src/audio/pipeline.c +++ b/src/audio/pipeline.c @@ -562,15 +562,23 @@ int pipeline_reset(struct pipeline *p, struct comp_dev *host) static int pipeline_comp_copy(struct comp_dev *current, void *data, int dir) { struct pipeline_data *ppl_data = data; + int is_single_ppl = comp_is_single_pipeline(current, ppl_data->start); + int is_same_sched = + pipeline_is_same_sched_comp(current->pipeline, + ppl_data->start->pipeline); int err = 0; tracev_pipe("pipeline_comp_copy(), current->comp.id = %u, dir = %u", current->comp.id, dir); - if (!comp_is_single_pipeline(current, ppl_data->start) || - !comp_is_active(current)) { - tracev_pipe("pipeline_comp_copy(), current is from " - "another pipeline or not active"); + if (!is_single_ppl && !is_same_sched) { + tracev_pipe("pipeline_comp_copy(), current is from another " + "pipeline and can't be scheduled together"); + return err; + } + + if (!comp_is_active(current)) { + tracev_pipe("pipeline_comp_copy(), current is not active"); return err; } diff --git a/src/include/sof/audio/pipeline.h b/src/include/sof/audio/pipeline.h index f77863067..ebcddf10c 100644 --- a/src/include/sof/audio/pipeline.h +++ b/src/include/sof/audio/pipeline.h @@ -108,6 +108,13 @@ struct pipeline { /* static pipeline */ extern struct pipeline *pipeline_static; +/* checks if two pipelines have the same scheduling component */ +static inline bool pipeline_is_same_sched_comp(struct pipeline *current, + struct pipeline *previous) +{ + return current->sched_comp == previous->sched_comp; +} + /* pipeline creation and destruction */ struct pipeline *pipeline_new(struct sof_ipc_pipe_new *pipe_desc, struct comp_dev *cd);