Skip to content

Commit 49306b9

Browse files
committed
[DEBUG] Add debug logs for pipeline prepare failures
Add info-level logs to diagnose test failures: - aria: Log format/rate/channels before validation - ipc4: Log pipeline state during RESET transitions - pipeline: Log component state during prepare Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
1 parent 77790ce commit 49306b9

3 files changed

Lines changed: 40 additions & 9 deletions

File tree

src/audio/aria/aria.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,21 @@ static int aria_prepare(struct processing_module *mod,
198198
aria_set_stream_params(source, mod);
199199
aria_set_stream_params(sink, mod);
200200

201+
/* Log detailed format information before validation */
202+
comp_info(dev, "aria_prepare: source fmt=%d rate=%d channels=%d",
203+
audio_stream_get_valid_fmt(&source->stream),
204+
audio_stream_get_rate(&source->stream),
205+
audio_stream_get_channels(&source->stream));
206+
comp_info(dev, "aria_prepare: sink fmt=%d rate=%d channels=%d",
207+
audio_stream_get_valid_fmt(&sink->stream),
208+
audio_stream_get_rate(&sink->stream),
209+
audio_stream_get_channels(&sink->stream));
210+
201211
if (audio_stream_get_valid_fmt(&source->stream) != SOF_IPC_FRAME_S24_4LE ||
202212
audio_stream_get_valid_fmt(&sink->stream) != SOF_IPC_FRAME_S24_4LE) {
203-
comp_err(dev, "format is not supported");
213+
comp_err(dev, "format is not supported: source_fmt=%d (expected=%d), sink_fmt=%d (expected=%d)",
214+
audio_stream_get_valid_fmt(&source->stream), SOF_IPC_FRAME_S24_4LE,
215+
audio_stream_get_valid_fmt(&sink->stream), SOF_IPC_FRAME_S24_4LE);
204216
return -EINVAL;
205217
}
206218

src/audio/pipeline/pipeline-params.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ static int pipeline_comp_prepare(struct comp_dev *current,
262262
struct pipeline_data *ppl_data = ctx->comp_data;
263263
int err;
264264

265-
pipe_dbg(current->pipeline, "pipeline_comp_prepare(), current->comp.id = 0x%x, dir = %u",
266-
dev_comp_id(current), dir);
265+
pipe_info(current->pipeline, "pipeline_comp_prepare(), current->comp.id = 0x%x, dir = %u",
266+
dev_comp_id(current), dir);
267267

268268
if (!comp_is_single_pipeline(current, ppl_data->start)) {
269269
/* ipc4 module is only prepared in its parent pipeline */
@@ -282,9 +282,14 @@ static int pipeline_comp_prepare(struct comp_dev *current,
282282
return err;
283283
}
284284

285+
pipe_info(current->pipeline, "calling comp_prepare() for comp 0x%x (state=%d)",
286+
dev_comp_id(current), current->state);
285287
err = comp_prepare(current);
286-
if (err < 0 || err == PPL_STATUS_PATH_STOP)
288+
if (err < 0 || err == PPL_STATUS_PATH_STOP) {
289+
pipe_err(current->pipeline, "comp_prepare() failed for comp 0x%x: err=%d",
290+
dev_comp_id(current), err);
287291
return err;
292+
}
288293

289294
return pipeline_for_each_comp(current, ctx, dir);
290295
}

src/ipc/ipc4/handler.c

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,16 @@ static int ipc4_pcm_params(struct ipc_comp_dev *pcm_dev)
160160
}
161161

162162
/* prepare pipeline audio params */
163+
tr_info(&ipc_tr, "ipc: attempting to prepare pipe %d comp %d (state=%d)",
164+
pcm_dev->cd->pipeline->pipeline_id,
165+
pcm_dev->cd->pipeline->comp_id,
166+
pcm_dev->cd->pipeline->status);
163167
err = pipeline_prepare(pcm_dev->cd->pipeline, pcm_dev->cd);
164168
if (err < 0) {
165-
ipc_cmd_err(&ipc_tr, "ipc: pipe %d comp %d prepare failed %d",
169+
ipc_cmd_err(&ipc_tr, "ipc: pipe %d comp %d prepare failed %d (state=%d)",
166170
pcm_dev->cd->pipeline->pipeline_id,
167-
pcm_dev->cd->pipeline->comp_id, err);
171+
pcm_dev->cd->pipeline->comp_id, err,
172+
pcm_dev->cd->pipeline->status);
168173
goto error;
169174
}
170175

@@ -309,20 +314,29 @@ int ipc4_pipeline_prepare(struct ipc_comp_dev *ppl_icd, uint32_t cmd)
309314
}
310315
break;
311316
case SOF_IPC4_PIPELINE_STATE_RESET:
317+
tr_info(&ipc_tr, "pipeline %d: attempting RESET from state %d", ppl_icd->id, status);
312318
switch (status) {
313319
case COMP_STATE_INIT:
314-
tr_dbg(&ipc_tr, "pipeline %d: reset from init", ppl_icd->id);
320+
tr_info(&ipc_tr, "pipeline %d: reset from init", ppl_icd->id);
315321
ret = ipc4_pipeline_complete(ipc, ppl_icd->id, cmd);
316322
break;
317323
case COMP_STATE_READY:
324+
tr_info(&ipc_tr, "pipeline %d: reset from ready (no action)", ppl_icd->id);
325+
/* No action needed */
326+
break;
318327
case COMP_STATE_ACTIVE:
328+
tr_info(&ipc_tr, "pipeline %d: reset from active (no action)", ppl_icd->id);
329+
/* No action needed */
330+
break;
319331
case COMP_STATE_PAUSED:
332+
tr_info(&ipc_tr, "pipeline %d: reset from paused (no action)", ppl_icd->id);
320333
/* No action needed */
321334
break;
322335
default:
323336
ipc_cmd_err(&ipc_tr,
324-
"pipeline %d: Invalid state for RESET: %d",
325-
ppl_icd->id, status);
337+
"pipeline %d: Invalid state for RESET: %d (valid: %d,%d,%d,%d)",
338+
ppl_icd->id, status, COMP_STATE_INIT, COMP_STATE_READY,
339+
COMP_STATE_ACTIVE, COMP_STATE_PAUSED);
326340
return IPC4_INVALID_REQUEST;
327341
}
328342

0 commit comments

Comments
 (0)