From 490aa20302e30e8cd42a0dc74d19a07bc51c3a2e Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Tue, 11 Sep 2018 18:45:39 +0800 Subject: [PATCH 1/2] host: still copy in none-active status Now will directly stop dma and no wait for last period finish, may have some unfinished job to done even after the status is set. Signed-off-by: Pan Xiuli --- src/audio/host.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/audio/host.c b/src/audio/host.c index 2598dc8f3c28..9dc21d99b5e3 100644 --- a/src/audio/host.c +++ b/src/audio/host.c @@ -839,8 +839,6 @@ static int host_copy(struct comp_dev *dev) tracev_host("cpy"); - if (dev->state != COMP_STATE_ACTIVE) - return 0; local_elem = list_first_item(&hd->config.elem_list, struct dma_sg_elem, list); From 9139db657efb5419361914167662c3e869109947 Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Tue, 11 Sep 2018 18:48:43 +0800 Subject: [PATCH 2/2] pipeline: still copy in none-active status Now will directly stop dma and no wait for last period finish, may have some unfinished job to done even after the status is set. No need to cancel the task or check the status of comp. Signed-off-by: Pan Xiuli --- src/audio/pipeline.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/audio/pipeline.c b/src/audio/pipeline.c index 296e0228d971..6aaf247b826c 100644 --- a/src/audio/pipeline.c +++ b/src/audio/pipeline.c @@ -203,7 +203,6 @@ static void pipeline_trigger_sched_comp(struct pipeline *p, switch (cmd) { case COMP_TRIGGER_PAUSE: case COMP_TRIGGER_STOP: - pipeline_schedule_cancel(p); p->status = COMP_STATE_PAUSED; break; case COMP_TRIGGER_RELEASE: @@ -771,9 +770,12 @@ static int pipeline_copy_from_upstream(struct comp_dev *start, buffer = container_of(clist, struct comp_buffer, sink_list); /* don't go upstream if this component is not connected */ - if (!buffer->connected || buffer->source->state != COMP_STATE_ACTIVE) + if (!buffer->connected) continue; + if (buffer->source->state != COMP_STATE_ACTIVE) + trace_pipe_error("pus"); + /* don't go upstream if this source is from another pipeline */ if (buffer->source->pipeline != current->pipeline) continue; @@ -834,9 +836,12 @@ static int pipeline_copy_to_downstream(struct comp_dev *start, buffer = container_of(clist, struct comp_buffer, source_list); /* don't go downstream if this component is not connected */ - if (!buffer->connected || buffer->sink->state != COMP_STATE_ACTIVE) + if (!buffer->connected) continue; + if (buffer->sink->state != COMP_STATE_ACTIVE) + trace_pipe_error("pds"); + /* don't go downstream if this sink is from another pipeline */ if (buffer->sink->pipeline != current->pipeline) continue;