Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mtl-007] AEC fixes from main branch submission #8603

Closed
wants to merge 10 commits into from
4 changes: 1 addition & 3 deletions src/audio/aria/aria.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,7 @@ static void aria_set_stream_params(struct comp_buffer *buffer,
const struct ipc4_audio_format *audio_fmt = &mod->priv.cfg.base_cfg.audio_fmt;

ipc4_update_buffer_format(buffer, audio_fmt);
#ifdef ARIA_GENERIC
audio_stream_init_alignment_constants(1, 1, &buffer->stream);
#else
#ifndef ARIA_GENERIC
audio_stream_init_alignment_constants(8, 1, &buffer->stream);
#endif
}
Expand Down
3 changes: 0 additions & 3 deletions src/audio/asrc/asrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,9 +755,6 @@ static int asrc_prepare(struct processing_module *mod,
sinkb = list_first_item(&dev->bsink_list,
struct comp_buffer, source_list);

audio_stream_init_alignment_constants(1, 1, &sourceb->stream);
audio_stream_init_alignment_constants(1, 1, &sinkb->stream);

/* get source data format and period bytes */
cd->source_format = audio_stream_get_frm_fmt(&sourceb->stream);
source_period_bytes = audio_stream_period_bytes(&sourceb->stream,
Expand Down
1 change: 1 addition & 0 deletions src/audio/audio_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ void audio_stream_init(struct audio_stream *audio_stream, void *buff_addr, uint3
audio_stream->addr = buff_addr;
audio_stream->end_addr = (char *)audio_stream->addr + size;

audio_stream_init_alignment_constants(1, 1, audio_stream);
source_init(audio_stream_get_source(audio_stream), &audio_stream_source_ops,
&audio_stream->runtime_stream_params);
sink_init(audio_stream_get_sink(audio_stream), &audio_stream_sink_ops,
Expand Down
5 changes: 1 addition & 4 deletions src/audio/crossover/crossover.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,14 +733,11 @@ static int crossover_prepare(struct processing_module *mod,
/* Get source data format */
cd->source_format = audio_stream_get_frm_fmt(&source->stream);
channels = audio_stream_get_channels(&source->stream);
audio_stream_init_alignment_constants(1, 1, &source->stream);

/* Validate frame format and buffer size of sinks */
list_for_item(sink_list, &dev->bsink_list) {
sink = container_of(sink_list, struct comp_buffer, source_list);
if (cd->source_format == audio_stream_get_frm_fmt(&sink->stream)) {
audio_stream_init_alignment_constants(1, 1, &sink->stream);
} else {
if (cd->source_format != audio_stream_get_frm_fmt(&sink->stream)) {
comp_err(dev, "crossover_prepare(): Source fmt %d and sink fmt %d are different.",
cd->source_format, audio_stream_get_frm_fmt(&sink->stream));
ret = -EINVAL;
Expand Down
13 changes: 0 additions & 13 deletions src/audio/dcblock/dcblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,6 @@ static int dcblock_process(struct processing_module *mod,
return 0;
}

/* init and calculate the aligned setting for available frames and free frames retrieve*/
static inline void dcblock_set_frame_alignment(struct audio_stream *source,
struct audio_stream *sink)
{
const uint32_t byte_align = 1;
const uint32_t frame_align_req = 1;

audio_stream_init_alignment_constants(byte_align, frame_align_req, source);
audio_stream_init_alignment_constants(byte_align, frame_align_req, sink);
}

#if CONFIG_IPC_MAJOR_4
static void dcblock_params(struct processing_module *mod)
{
Expand Down Expand Up @@ -266,8 +255,6 @@ static int dcblock_prepare(struct processing_module *mod,
/* get sink data format and period bytes */
cd->sink_format = audio_stream_get_frm_fmt(&sinkb->stream);

dcblock_set_frame_alignment(&sourceb->stream, &sinkb->stream);

dcblock_init_state(cd);
cd->dcblock_func = dcblock_find_func(cd->source_format);
if (!cd->dcblock_func) {
Expand Down
9 changes: 0 additions & 9 deletions src/audio/drc/drc.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,6 @@ static int drc_get_config(struct processing_module *mod,
return comp_data_blob_get_cmd(cd->model_handler, cdata, fragment_size);
}

static void drc_set_alignment(struct audio_stream *source,
struct audio_stream *sink)
{
/* Currently no optimizations those would use wider loads and stores */
audio_stream_init_alignment_constants(1, 1, source);
audio_stream_init_alignment_constants(1, 1, sink);
}

static int drc_process(struct processing_module *mod,
struct input_stream_buffer *input_buffers,
int num_input_buffers,
Expand Down Expand Up @@ -308,7 +300,6 @@ static int drc_prepare(struct processing_module *mod,
/* DRC component will only ever have 1 source and 1 sink buffer */
sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list);
sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list);
drc_set_alignment(&sourceb->stream, &sinkb->stream);

/* get source data format */
cd->source_format = audio_stream_get_frm_fmt(&sourceb->stream);
Expand Down
24 changes: 14 additions & 10 deletions src/audio/google/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ config COMP_GOOGLE_HOTWORD_DETECT
config COMP_GOOGLE_RTC_AUDIO_PROCESSING
bool "Google Real Time Communication Audio processing"
select COMP_BLOB
select GOOGLE_RTC_AUDIO_PROCESSING_MOCK if COMP_STUBS
depends on IPC_MAJOR_4
default n
help
Select for Google real-time communication audio processing. It
Expand All @@ -25,13 +23,7 @@ config COMP_GOOGLE_RTC_AUDIO_PROCESSING
This component takes raw microphones input and playback reference
and outputs an echo-free microphone signal.

config COMP_GOOGLE_RTC_USE_32_BIT_FLOAT_API
depends on COMP_GOOGLE_RTC_AUDIO_PROCESSING
bool "Use 32bit API in Google Audio processing"
default n
help
Selects an API to be used in communication with the Google real-time
communication audio processing: 32bit float or 16bit integer
if COMP_GOOGLE_RTC_AUDIO_PROCESSING

config COMP_GOOGLE_RTC_AUDIO_PROCESSING_SAMPLE_RATE_HZ
depends on COMP_GOOGLE_RTC_AUDIO_PROCESSING
Expand All @@ -41,6 +33,16 @@ config COMP_GOOGLE_RTC_AUDIO_PROCESSING_SAMPLE_RATE_HZ
Sets the sample rate for the memory buffer for the Google real-time
communication audio processing.

config COMP_GOOGLE_RTC_AUDIO_PROCESSING_CHANNEL_MAX
int "Max number of AEC channels"
default 2
help
Sets the maximum number source/sink channels Google Real
Time Communication Audio Processing will use for. This is a
computation and memory budget tunable. Channel counts are
retrieved at runtime, but channels higher than this number
are ignored (on input) or cleared (output).

config COMP_GOOGLE_RTC_AUDIO_PROCESSING_MEMORY_BUFFER_SIZE_BYTES
depends on COMP_GOOGLE_RTC_AUDIO_PROCESSING
int "Memory buffer size for Google Real Time Communication Audio processing"
Expand All @@ -67,10 +69,12 @@ config COMP_GOOGLE_RTC_AUDIO_PROCESSING_MIC_HEADROOM_LINEAR

config GOOGLE_RTC_AUDIO_PROCESSING_MOCK
bool "Google Real Time Communication Audio processing mock"
default n
default y if COMP_STUBS
depends on COMP_GOOGLE_RTC_AUDIO_PROCESSING
help
Mock Google real-time communication audio processing.
It allows for compilation check and basic audio flow checking.

endif # COMP_GOOGLE_RTC_AUDIO_PROCESSING

endmenu
Loading
Loading