Skip to content

Commit be014ea

Browse files
committed
[DEBUG] add logs
More logs. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
1 parent 8ed9be4 commit be014ea

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

src/audio/copier/copier.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,9 @@ static int copier_prepare(struct processing_module *mod,
355355
cd->config.base.audio_fmt.depth, cd->config.out_fmt.depth);
356356
return -EINVAL;
357357
}
358+
359+
/* Debug: Log initial converter assignment */
360+
comp_info(dev, "copier_prepare: set initial converter[0]=%p", cd->converter[0]);
358361
}
359362

360363
return 0;
@@ -543,11 +546,16 @@ static int do_conversion_copy(struct comp_dev *dev,
543546
i = IPC4_SINK_QUEUE_ID(buf_get_id(sink));
544547
if (i >= IPC4_COPIER_MODULE_OUTPUT_PINS_COUNT)
545548
return -EINVAL;
549+
550+
/* Log buffer ID, sink_queue_id, and converter availability */
551+
comp_info(dev, "do_conversion_copy: buf_id=0x%x, sink_queue_id=%d, converter[%d]=%p",
552+
buf_get_id(sink), i, i, cd->converter[i]);
553+
546554
buffer_stream_invalidate(src, processed_data->source_bytes);
547555

548556
/* Validate converter function pointer to prevent NULL dereference crash */
549557
if (!cd->converter[i]) {
550-
comp_err(mod->dev, "NULL converter function for sink_queue_id=%d", i);
558+
comp_err(dev, "NULL converter function for sink_queue_id=%d", i);
551559
return -EFAULT;
552560
}
553561

@@ -627,10 +635,16 @@ static int copier_module_copy(struct processing_module *mod,
627635
if (sink_queue_id >= IPC4_COPIER_MODULE_OUTPUT_PINS_COUNT)
628636
return -EINVAL;
629637

638+
/* Log buffer ID, sink_queue_id, and converter availability */
639+
comp_info(mod->dev, "copier_module_copy: output[%d] buf_id=0x%x, sink_queue_id=%d, converter[%d]=%p",
640+
i, buf_get_id(sink_c), sink_queue_id, sink_queue_id,
641+
cd->converter[sink_queue_id]);
642+
630643
comp_get_copy_limits(src_c, sink_c, &processed_data);
631644

632645
source_samples = processed_data.frames *
633646
audio_stream_get_channels(input_buffers[0].data);
647+
634648
/* Validate converter function pointer to prevent NULL dereference crash */
635649
if (!cd->converter[sink_queue_id]) {
636650
comp_err(mod->dev, "NULL converter function for sink_queue_id=%d",
@@ -791,6 +805,10 @@ __cold static int copier_set_sink_fmt(struct comp_dev *dev, const void *data,
791805
return -EINVAL;
792806
}
793807

808+
/* Debug: Log SET_SINK_FORMAT details */
809+
comp_info(dev, "copier_set_sink_fmt: sink_id=%d, setting converter[%d]",
810+
sink_fmt->sink_id, sink_fmt->sink_id);
811+
794812
if (memcmp(&cd->config.base.audio_fmt, &sink_fmt->source_fmt,
795813
sizeof(sink_fmt->source_fmt))) {
796814
comp_err(dev, "error: source fmt should be equal to input fmt");
@@ -814,6 +832,10 @@ __cold static int copier_set_sink_fmt(struct comp_dev *dev, const void *data,
814832
&sink_fmt->sink_fmt, ipc4_gtw_none,
815833
ipc4_bidirection, chmap);
816834

835+
/* Debug: Log converter assignment result */
836+
comp_info(dev, "copier_set_sink_fmt: assigned converter[%d]=%p",
837+
sink_fmt->sink_id, cd->converter[sink_fmt->sink_id]);
838+
817839
return 0;
818840
}
819841

src/ipc/ipc4/helper.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,11 @@ __cold static struct comp_buffer *ipc4_create_buffer(struct comp_dev *src, bool
402402
ipc_buf.comp.id = IPC4_COMP_ID(src_queue, dst_queue);
403403
ipc_buf.comp.pipeline_id = src->ipc_config.pipeline_id;
404404
ipc_buf.comp.core = cpu_get_id();
405+
406+
/* Debug: Log buffer creation details */
407+
comp_info(src, "ipc4_create_buffer: src_queue=%d, dst_queue=%d, buffer_id=0x%x",
408+
src_queue, dst_queue, ipc_buf.comp.id);
409+
405410
return buffer_new(&ipc_buf, is_shared);
406411
}
407412

@@ -578,6 +583,10 @@ __cold int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect)
578583
else
579584
buf_size = ibs * 2;
580585

586+
/* Debug: Log binding details before buffer creation */
587+
tr_info(&ipc_tr, "ipc4_bind: binding src_id=0x%x to sink_id=0x%x, src_queue=%d, dst_queue=%d",
588+
src_id, sink_id, bu->extension.r.src_queue, bu->extension.r.dst_queue);
589+
581590
buffer = ipc4_create_buffer(source, cross_core_bind, buf_size, bu->extension.r.src_queue,
582591
bu->extension.r.dst_queue);
583592
if (!buffer) {

0 commit comments

Comments
 (0)