[Sound-open-firmware] [PATCH] pipeline: fix timestamp for capture streams.
Make sure we timestamp upstream in capture streams
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- src/audio/pipeline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/audio/pipeline.c b/src/audio/pipeline.c index 62c21b7..4e830c6 100644 --- a/src/audio/pipeline.c +++ b/src/audio/pipeline.c @@ -851,7 +851,7 @@ upstream: continue;
/* continue downstream */ - res = timestamp_upstream(start, buffer->sink, posn); + res = timestamp_upstream(start, buffer->source, posn); if (res == 1) break; }
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- src/lib/alloc.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/src/lib/alloc.c b/src/lib/alloc.c index e28817b..1b43d12 100644 --- a/src/lib/alloc.c +++ b/src/lib/alloc.c @@ -481,7 +481,6 @@ void *rballoc(int zone, int bflags, size_t bytes) /* will request fit in single block */ for (i = 0; i < array_size; i++) {
- trace_value(block_map[i].block_size); /* is block big enough */ if (block_map[i].block_size < bytes) continue;
pipeline completion should check for valid pipeline status and return any errors for invalid status (like already completed pipelines).
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- src/audio/pipeline.c | 13 +++++++++++-- src/include/reef/audio/pipeline.h | 3 ++- src/include/reef/ipc.h | 2 +- src/ipc/intel-ipc.c | 4 +--- src/ipc/ipc.c | 6 +++--- 5 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/src/audio/pipeline.c b/src/audio/pipeline.c index 4e830c6..69dcce7 100644 --- a/src/audio/pipeline.c +++ b/src/audio/pipeline.c @@ -228,6 +228,7 @@ struct pipeline *pipeline_new(struct sof_ipc_pipe_new *pipe_desc,
/* init pipeline */ p->sched_comp = cd; + p->status = COMP_STATE_INIT; schedule_task_init(&p->pipe_task, pipeline_task, p); schedule_task_config(&p->pipe_task, pipe_desc->priority, pipe_desc->core); @@ -263,16 +264,24 @@ int pipeline_free(struct pipeline *p) return 0; }
-void pipeline_complete(struct pipeline *p) +int pipeline_complete(struct pipeline *p) { /* now walk downstream and upstream form "start" component and complete component task and pipeline init */
trace_pipe("com"); - tracev_value(p->ipc_pipe.pipeline_id); + trace_value(p->ipc_pipe.pipeline_id); + + /* cheeck whether pipeline is already complete */ + if (p->status != COMP_STATE_INIT) { + trace_pipe_error("epc"); + return -EINVAL; + }
connect_downstream(p, p->sched_comp, p->sched_comp); connect_upstream(p, p->sched_comp, p->sched_comp); + p->status = COMP_STATE_READY; + return 0; }
/* connect component -> buffer */ diff --git a/src/include/reef/audio/pipeline.h b/src/include/reef/audio/pipeline.h index 909f905..41cfffc 100644 --- a/src/include/reef/audio/pipeline.h +++ b/src/include/reef/audio/pipeline.h @@ -59,6 +59,7 @@ struct pipeline {
/* runtime status */ int32_t xrun_bytes; /* last xrun length */ + uint32_t status; /* pipeline status */
/* lists */ struct list_item comp_list; /* list of components */ @@ -86,7 +87,7 @@ int pipeline_comp_connect(struct pipeline *p, struct comp_dev *source_comp, struct comp_buffer *sink_buffer); int pipeline_buffer_connect(struct pipeline *p, struct comp_buffer *source_buffer, struct comp_dev *sink_comp); -void pipeline_complete(struct pipeline *p); +int pipeline_complete(struct pipeline *p);
/* pipeline parameters */ int pipeline_params(struct pipeline *p, struct comp_dev *cd, diff --git a/src/include/reef/ipc.h b/src/include/reef/ipc.h index 84a1dc1..a552626 100644 --- a/src/include/reef/ipc.h +++ b/src/include/reef/ipc.h @@ -148,7 +148,7 @@ int ipc_buffer_free(struct ipc *ipc, uint32_t buffer_id); */ int ipc_pipeline_new(struct ipc *ipc, struct sof_ipc_pipe_new *pipeline); int ipc_pipeline_free(struct ipc *ipc, uint32_t comp_id); -void ipc_pipeline_complete(struct ipc *ipc, uint32_t comp_id); +int ipc_pipeline_complete(struct ipc *ipc, uint32_t comp_id);
/* * Pipeline component and buffer connections. diff --git a/src/ipc/intel-ipc.c b/src/ipc/intel-ipc.c index 92dfd73..8a4fafd 100644 --- a/src/ipc/intel-ipc.c +++ b/src/ipc/intel-ipc.c @@ -787,9 +787,7 @@ static int ipc_glb_tplg_pipe_complete(uint32_t header)
trace_ipc("Ipc");
- ipc_pipeline_complete(_ipc, ipc_pipeline->comp_id); - - return 0; + return ipc_pipeline_complete(_ipc, ipc_pipeline->comp_id); }
static int ipc_glb_tplg_comp_connect(uint32_t header) diff --git a/src/ipc/ipc.c b/src/ipc/ipc.c index e589d56..966fafd 100644 --- a/src/ipc/ipc.c +++ b/src/ipc/ipc.c @@ -293,17 +293,17 @@ int ipc_pipeline_free(struct ipc *ipc, uint32_t comp_id) return 0; }
-void ipc_pipeline_complete(struct ipc *ipc, uint32_t comp_id) +int ipc_pipeline_complete(struct ipc *ipc, uint32_t comp_id) { struct ipc_comp_dev *ipc_pipe;
/* check whether pipeline exists */ ipc_pipe = ipc_get_comp(ipc, comp_id); if (ipc_pipe == NULL) - return; + return -EINVAL;
/* free buffer and remove from list */ - pipeline_complete(ipc_pipe->pipeline); + return pipeline_complete(ipc_pipe->pipeline); }
int ipc_comp_dai_config(struct ipc *ipc, struct sof_ipc_dai_config *config)
Emit trace data to show format matching failures for source and sink data types.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- src/audio/volume.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/audio/volume.c b/src/audio/volume.c index 960a144..be6197e 100644 --- a/src/audio/volume.c +++ b/src/audio/volume.c @@ -616,7 +616,10 @@ static int volume_prepare(struct comp_dev *dev) cd->scale_vol = func_map[i].func; goto found; } - + trace_volume_error("vp3"); + trace_value(cd->source_format); + trace_value(cd->sink_format); + trace_value(dev->params.channels); return -EINVAL;
found:
participants (1)
-
Liam Girdwood