Skip to content

Commit e6a3538

Browse files
AEC: remove number of channels workaround from the code
After topology changes, those WAs are no longer required Number of channels are taken from the configuration now no need for options in Kconfig Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
1 parent f24e966 commit e6a3538

2 files changed

Lines changed: 8 additions & 47 deletions

File tree

src/audio/google/Kconfig

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,6 @@ config COMP_GOOGLE_RTC_AUDIO_PROCESSING_SAMPLE_RATE_HZ
3333
Sets the sample rate for the memory buffer for the Google real-time
3434
communication audio processing.
3535

36-
config COMP_GOOGLE_RTC_AUDIO_PROCESSING_NUM_CHANNELS
37-
depends on COMP_GOOGLE_RTC_AUDIO_PROCESSING
38-
int "Number of channels to process for Google Real Time Communication Audio processing"
39-
default 4
40-
help
41-
Sets the number of channels to process in the Google real-time
42-
communication audio processing.
43-
44-
config COMP_GOOGLE_RTC_AUDIO_PROCESSING_NUM_AEC_REFERENCE_CHANNELS
45-
depends on COMP_GOOGLE_RTC_AUDIO_PROCESSING
46-
int "Number of AEC reference channels for Google Real Time Communication Audio processing"
47-
default 2
48-
help
49-
Sets the number AEC reference channels in the Google real-time
50-
communication audio processing.
51-
5236
config COMP_GOOGLE_RTC_AUDIO_PROCESSING_MEMORY_BUFFER_SIZE_BYTES
5337
depends on COMP_GOOGLE_RTC_AUDIO_PROCESSING
5438
int "Memory buffer size for Google Real Time Communication Audio processing"

src/audio/google/google_rtc_audio_processing.c

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -80,30 +80,6 @@ void GoogleRtcFree(void *ptr)
8080
return rfree(ptr);
8181
}
8282

83-
static void google_rtc_audio_processing_params(struct processing_module *mod,
84-
struct sof_source *ref,
85-
struct sof_source *mic,
86-
struct sof_sink *out)
87-
{
88-
struct google_rtc_audio_processing_comp_data *cd = module_get_private_data(mod);
89-
struct sof_ipc_stream_params *params = mod->stream_params;
90-
struct comp_buffer *sinkb, *sourceb;
91-
struct list_item *source_list;
92-
struct comp_dev *dev = mod->dev;
93-
94-
ipc4_base_module_cfg_to_stream_params(&mod->priv.cfg.base_cfg, params);
95-
component_set_nearest_period_frames(dev, params->rate);
96-
/* TODO - it does not work, to be checked before merging!!
97-
* ipc4_update_source_format(ref, &cd->config.reference_fmt);
98-
*/
99-
source_set_channels(ref,
100-
CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_NUM_AEC_REFERENCE_CHANNELS);
101-
/* ipc4_update_source_format(mic, &mod->priv.cfg.base_cfg.audio_fmt); */
102-
source_set_channels(mic, CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_NUM_CHANNELS);
103-
/* ipc4_update_sink_format(out, &mod->priv.cfg.base_cfg.audio_fmt); */
104-
sink_set_channels(out, CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_NUM_CHANNELS);
105-
}
106-
10783
static int google_rtc_audio_processing_reconfigure(struct processing_module *mod)
10884
{
10985
struct google_rtc_audio_processing_comp_data *cd = module_get_private_data(mod);
@@ -361,8 +337,8 @@ static int google_rtc_audio_processing_init(struct processing_module *mod)
361337
goto fail;
362338
}
363339

364-
cd->num_aec_reference_channels = CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_NUM_AEC_REFERENCE_CHANNELS;
365-
cd->num_capture_channels = CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_NUM_CHANNELS;
340+
cd->num_aec_reference_channels = cd->config.reference_fmt.channels_count;
341+
cd->num_capture_channels = mod->priv.cfg.base_cfg.audio_fmt.channels_count;
366342
cd->num_frames = CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_SAMPLE_RATE_HZ /
367343
GOOGLE_RTC_AUDIO_PROCESSING_FREQENCY_TO_PERIOD_FRAMES;
368344

@@ -523,11 +499,12 @@ static int google_rtc_audio_processing_prepare(struct processing_module *mod,
523499
source_set_alignment_constants(sources[i], 1, 1);
524500
}
525501

526-
google_rtc_audio_processing_params(mod,
527-
sources[cd->aec_reference_source],
528-
sources[cd->raw_microphone_source],
529-
sinks[0]);
530-
502+
/* enforce format on pins */
503+
ipc4_update_source_format(sources[cd->aec_reference_source],
504+
&cd->config.reference_fmt);
505+
ipc4_update_source_format(sources[cd->raw_microphone_source],
506+
&mod->priv.cfg.base_cfg.audio_fmt);
507+
ipc4_update_sink_format(sinks[0], &mod->priv.cfg.base_cfg.audio_fmt);
531508

532509
/* On some platform the playback output is left right left right due to a crossover
533510
* later on the signal processing chain. That makes the aec_reference be 4 channels

0 commit comments

Comments
 (0)