@@ -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
0 commit comments