Skip to content

Commit 1ae07ab

Browse files
committed
[do not merge] Audio: Up_down_mixer: Add traces to debug operation in test
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent c5f014b commit 1ae07ab

1 file changed

Lines changed: 36 additions & 7 deletions

File tree

src/audio/up_down_mixer/up_down_mixer.c

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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,
110112
static 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,
175179
static 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,
226232
static 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,20 @@ 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]);
389+
comp_info(dev, "init data: %d, %d, 0x%08x", up_down_mixer->out_channel_config,
390+
up_down_mixer->coefficients_select, up_down_mixer->channel_map);
391+
#if UP_DOWN_MIX_COEFFS_LENGTH == 8
392+
comp_info(dev, "coef[0..3]: %d, %d, %d, %d",
393+
up_down_mixer->coefficients[0], up_down_mixer->coefficients[1],
394+
up_down_mixer->coefficients[2], up_down_mixer->coefficients[3]);
395+
comp_info(dev, "coef[4..7]: %d, %d, %d, %d",
396+
up_down_mixer->coefficients[4], up_down_mixer->coefficients[5],
397+
up_down_mixer->coefficients[6], up_down_mixer->coefficients[7]);
398+
#endif
382399
} else {
400+
comp_info(dev, "no configuration in init, using default");
383401
cd->has_init_mix_configuration = false;
384402
#if FORCE_REQUEST_MONO
385403
default_config.out_channel_config = 0;
@@ -390,31 +408,40 @@ static int up_down_mixer_init(struct processing_module *mod)
390408
#else
391409
default_config.out_channel_config = up_down_mixer_init->base_cfg.audio_fmt.ch_cfg;
392410
default_config.coefficients_select = DEFAULT_COEFFICIENTS;
411+
for (i = 0; i < UP_DOWN_MIX_COEFFS_LENGTH; i++)
412+
default_config.coefficients[i] = 0;
393413
#endif
394414
up_down_mixer = &default_config;
395-
comp_info(dev, "no up_down_mixer configuration in init, using default");
396415
}
397416

398417
switch (up_down_mixer->coefficients_select) {
399418
case DEFAULT_COEFFICIENTS:
400419
cd->out_channel_map = create_channel_map(up_down_mixer->out_channel_config);
420+
comp_info(dev, "c1 out_channel map = 0x%08x", cd->out_channel_map);
401421
ret = init_mix(mod, &mod->priv.cfg.base_cfg.audio_fmt,
402422
up_down_mixer->out_channel_config, NULL);
423+
comp_info(dev, "c1 init_mix() done");
403424
break;
404425
case CUSTOM_COEFFICIENTS:
405426
cd->out_channel_map = create_channel_map(up_down_mixer->out_channel_config);
427+
comp_info(dev, "c2 out_channel map = 0x%08x", cd->out_channel_map);
406428
ret = init_mix(mod, &mod->priv.cfg.base_cfg.audio_fmt,
407429
up_down_mixer->out_channel_config, up_down_mixer->coefficients);
430+
comp_info(dev, "c2 init_mix() done");
408431
break;
409432
case DEFAULT_COEFFICIENTS_WITH_CHANNEL_MAP:
410433
cd->out_channel_map = up_down_mixer->channel_map;
434+
comp_info(dev, "c3 out_channel map = 0x%08x", cd->out_channel_map);
411435
ret = init_mix(mod, &mod->priv.cfg.base_cfg.audio_fmt,
412436
up_down_mixer->out_channel_config, NULL);
437+
comp_info(dev, "c3 init_mix() done");
413438
break;
414439
case CUSTOM_COEFFICIENTS_WITH_CHANNEL_MAP:
415440
cd->out_channel_map = up_down_mixer->channel_map;
441+
comp_info(dev, "c4 out_channel map = 0x%08x", cd->out_channel_map);
416442
ret = init_mix(mod, &mod->priv.cfg.base_cfg.audio_fmt,
417443
up_down_mixer->out_channel_config, up_down_mixer->coefficients);
444+
comp_info(dev, "c4 init_mix() done");
418445
break;
419446
default:
420447
comp_err(dev, "up_down_mixer_init(): unsupported coefficient type");
@@ -427,9 +454,11 @@ static int up_down_mixer_init(struct processing_module *mod)
427454
goto err;
428455
}
429456

457+
comp_info(dev, "up_down_mixer_init() ready");
430458
return 0;
431459

432460
err:
461+
comp_err(dev, "up_down_mixer_init() error");
433462
up_down_mixer_free(mod);
434463
return ret;
435464
}

0 commit comments

Comments
 (0)