@@ -47,6 +47,8 @@ static int set_downmix_coefficients(struct processing_module *mod,
4747 struct comp_dev * dev = mod -> dev ;
4848 int ret ;
4949
50+ comp_info (dev , "set_downmix_coefficients()" );
51+
5052 if (cd -> downmix_coefficients ) {
5153 ret = memcpy_s (& custom_coeffs , sizeof (custom_coeffs ), downmix_coefficients ,
5254 sizeof (int32_t ) * UP_DOWN_MIX_COEFFS_LENGTH );
@@ -110,6 +112,8 @@ static int set_downmix_coefficients(struct processing_module *mod,
110112static up_down_mixer_routine select_mix_out_stereo (struct comp_dev * dev ,
111113 const struct ipc4_audio_format * format )
112114{
115+ comp_info (dev , "select_mix_out_stereo()" );
116+
113117 if (format -> depth == IPC4_DEPTH_16BIT ) {
114118 switch (format -> ch_cfg ) {
115119 case IPC4_CHANNEL_CONFIG_MONO :
@@ -175,6 +179,8 @@ static up_down_mixer_routine select_mix_out_stereo(struct comp_dev *dev,
175179static up_down_mixer_routine select_mix_out_mono (struct comp_dev * dev ,
176180 const struct ipc4_audio_format * format )
177181{
182+ comp_info (dev , "select_mix_out_mono(" );
183+
178184 if (format -> depth == IPC4_DEPTH_16BIT ) {
179185 switch (format -> ch_cfg ) {
180186 case IPC4_CHANNEL_CONFIG_STEREO :
@@ -226,6 +232,8 @@ static up_down_mixer_routine select_mix_out_mono(struct comp_dev *dev,
226232static up_down_mixer_routine select_mix_out_5_1 (struct comp_dev * dev ,
227233 const struct ipc4_audio_format * format )
228234{
235+ comp_info (dev , "select_mix_out_5_1()" );
236+
229237 if (format -> depth == IPC4_DEPTH_16BIT ) {
230238 switch (format -> ch_cfg ) {
231239 case IPC4_CHANNEL_CONFIG_MONO :
@@ -265,6 +273,8 @@ static int init_mix(struct processing_module *mod,
265273 struct up_down_mixer_data * cd = module_get_private_data (mod );
266274 struct comp_dev * dev = mod -> dev ;
267275
276+ comp_info (dev , "init_mix()" );
277+
268278 if (!format )
269279 return - EINVAL ;
270280
@@ -326,6 +336,8 @@ static int up_down_mixer_free(struct processing_module *mod)
326336{
327337 struct up_down_mixer_data * cd = module_get_private_data (mod );
328338
339+ comp_info (mod -> dev , "up_down_mixer_free()" );
340+
329341 rfree (cd -> buf_in );
330342 rfree (cd -> buf_out );
331343 rfree (cd );
@@ -372,14 +384,10 @@ static int up_down_mixer_init(struct processing_module *mod)
372384 dev -> ipc_config .ipc_config_size , min_size );
373385
374386 if (dev -> ipc_config .ipc_config_size > min_size ) {
387+ comp_info (dev , "init configuration found" );
375388 cd -> has_init_mix_configuration = true;
376- comp_info (dev , "init data contains up_down_mixer configuration" );
377- comp_info (dev , "out_channel_config = %d" , up_down_mixer -> out_channel_config );
378- comp_info (dev , "coefficients_select = %d" , up_down_mixer -> coefficients_select );
379- comp_info (dev , "channel_map = %d" , up_down_mixer -> channel_map );
380- for (i = 0 ; i < UP_DOWN_MIX_COEFFS_LENGTH ; i ++ )
381- comp_info (dev , "coef[%d] = %d" , i , up_down_mixer -> coefficients [i ]);
382389 } else {
390+ comp_info (dev , "no configuration in init, using default" );
383391 cd -> has_init_mix_configuration = false;
384392#if FORCE_REQUEST_MONO
385393 default_config .out_channel_config = 0 ;
@@ -390,31 +398,51 @@ static int up_down_mixer_init(struct processing_module *mod)
390398#else
391399 default_config .out_channel_config = up_down_mixer_init -> base_cfg .audio_fmt .ch_cfg ;
392400 default_config .coefficients_select = DEFAULT_COEFFICIENTS ;
401+ for (i = 0 ; i < UP_DOWN_MIX_COEFFS_LENGTH ; i ++ )
402+ default_config .coefficients [i ] = 0 ;
393403#endif
394404 up_down_mixer = & default_config ;
395- comp_info (dev , "no up_down_mixer configuration in init, using default" );
396405 }
397406
407+ comp_info (dev , "init data: %d, %d, 0x%08x" , up_down_mixer -> out_channel_config ,
408+ up_down_mixer -> coefficients_select , up_down_mixer -> channel_map );
409+ #if UP_DOWN_MIX_COEFFS_LENGTH == 8
410+ comp_info (dev , "coef[0..3]: %d, %d, %d, %d" ,
411+ up_down_mixer -> coefficients [0 ], up_down_mixer -> coefficients [1 ],
412+ up_down_mixer -> coefficients [2 ], up_down_mixer -> coefficients [3 ]);
413+ comp_info (dev , "coef[4..7]: %d, %d, %d, %d" ,
414+ up_down_mixer -> coefficients [4 ], up_down_mixer -> coefficients [5 ],
415+ up_down_mixer -> coefficients [6 ], up_down_mixer -> coefficients [7 ]);
416+ #endif
417+
398418 switch (up_down_mixer -> coefficients_select ) {
399419 case DEFAULT_COEFFICIENTS :
400420 cd -> out_channel_map = create_channel_map (up_down_mixer -> out_channel_config );
421+ comp_info (dev , "c1 out_channel map = %d" , cd -> out_channel_map );
401422 ret = init_mix (mod , & mod -> priv .cfg .base_cfg .audio_fmt ,
402423 up_down_mixer -> out_channel_config , NULL );
424+ comp_info (dev , "c1 init_mix() done" );
403425 break ;
404426 case CUSTOM_COEFFICIENTS :
405427 cd -> out_channel_map = create_channel_map (up_down_mixer -> out_channel_config );
428+ comp_info (dev , "c2 out_channel map = %d" , cd -> out_channel_map );
406429 ret = init_mix (mod , & mod -> priv .cfg .base_cfg .audio_fmt ,
407430 up_down_mixer -> out_channel_config , up_down_mixer -> coefficients );
431+ comp_info (dev , "c2 init_mix() done" );
408432 break ;
409433 case DEFAULT_COEFFICIENTS_WITH_CHANNEL_MAP :
410434 cd -> out_channel_map = up_down_mixer -> channel_map ;
435+ comp_info (dev , "c3 out_channel map = %d" , cd -> out_channel_map );
411436 ret = init_mix (mod , & mod -> priv .cfg .base_cfg .audio_fmt ,
412437 up_down_mixer -> out_channel_config , NULL );
438+ comp_info (dev , "c3 init_mix() done" );
413439 break ;
414440 case CUSTOM_COEFFICIENTS_WITH_CHANNEL_MAP :
415441 cd -> out_channel_map = up_down_mixer -> channel_map ;
442+ comp_info (dev , "c4 out_channel map = %d" , cd -> out_channel_map );
416443 ret = init_mix (mod , & mod -> priv .cfg .base_cfg .audio_fmt ,
417444 up_down_mixer -> out_channel_config , up_down_mixer -> coefficients );
445+ comp_info (dev , "c4 init_mix() done" );
418446 break ;
419447 default :
420448 comp_err (dev , "up_down_mixer_init(): unsupported coefficient type" );
@@ -427,9 +455,11 @@ static int up_down_mixer_init(struct processing_module *mod)
427455 goto err ;
428456 }
429457
458+ comp_info (dev , "up_down_mixer_init() ready" );
430459 return 0 ;
431460
432461err :
462+ comp_err (dev , "up_down_mixer_init() error" );
433463 up_down_mixer_free (mod );
434464 return ret ;
435465}
0 commit comments