Skip to content

Conversation

@marcinszkudlinski
Copy link
Contributor

@marcinszkudlinski marcinszkudlinski commented Nov 9, 2023

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
as agreed with Google, IPC3 is no longer needed in
AEC shimm implementation

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
This commit changes AEC to use sink/src interface
and makes it to be a DP module

it also use 32bit api of google's AEC

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
ref = audio_stream_wrap(ref_stream, ref);
ref += cd->num_aec_reference_channels;
if ((void *)ref >= (void *)ref_buf_end)
ref = (void *)ref_buf_start;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this won't be a lot, but we could optimise this a bit: remove this if in the loop and calculate first till the potential end of the buffer, and then wrap, or use an encompassing loop as in other modules. Same for source and sink below

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from my test before, wrap would be faster than we check in the for loop.

Copy link
Contributor

@lkoenig lkoenig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just the more pressing question I have.

source_release_data(src_stream, num_of_bytes_to_process);

/* call the library, use same in/out buffers */
GoogleRtcAudioProcessingProcessCapture_float32(cd->state,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure the playback and the capture are in sync: ie they get 10ms of data at the same time ? I see nothing in the code ensuring it is the case: I might have missed it.
Otherwise we take care of that by calling the AnalyseRender only when 10ms of playback data, and only call the ProcessCapture when we have 10ms of raw microphone data.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DP module won;t be scheduled until there are ready - have 10ms on each input
see bool google_rtc_audio_is_ready_to_process

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if 10ms playback is ready 9ms after 10ms capture are ready ? That will leave a deadline of 1ms wouldn't it ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not to mentioned the case when the rates are not exactly the same on render and capture (I think we can omit this case for now).

}

int GoogleRtcAudioProcessingAnalyzeRender_int16(GoogleRtcAudioProcessingState *const state,
const int16_t *const data)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both exisyts in the library and can be mixed.

@lgirdwood
Copy link
Member

@marcinszkudlinski any update ?

@marcinszkudlinski
Copy link
Contributor Author

@marcinszkudlinski any update ?

I'm waiting for feedback from 007 branch.

k_thread_stack_t __sparse_cache *p_stack; /* pointer to thread stack */
struct k_sem sem; /* semaphore for task scheduling */
struct processing_module *mod; /* the module to be scheduled */
uint32_t LL_cycles_to_deadline; /* current number of LL cycles till deadline */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lower case

* ipc4_update_source_format(ref, &cd->config.reference_fmt);
*/
source_set_channels(ref,
CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_NUM_AEC_REFERENCE_CHANNELS);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either align, or one line

CONFIG_PROBE_DMA_MAX=2

CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING=y
CONFIG_COMP_STUBS=y
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline, please configure your editor.

bool "Google Real Time Communication Audio processing"
select COMP_BLOB
select GOOGLE_RTC_AUDIO_PROCESSING_MOCK if COMP_STUBS
depends on IPC_MAJOR_4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cujomalainey, @andyross I think this is how this PR excluded google_rtc_audio_processing.c from the compilation check:

https://github.com/thesofproject/sof/actions/runs/6815375008/job/18534330110?pr=8469

warning: COMP_GOOGLE_RTC_AUDIO_PROCESSING (defined at
/home/runner/work/sof/sof/workspace/sof/zephyr/../src/audio/google/Kconfig:15) was assigned the
value 'y' but got the value 'n'. Check these unsatisfied dependencies: IPC_MAJOR_4 (=n)

CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING=y is in app/stub_build_all_ipc3.conf but not in app/stub_build_all_ipc4.conf. I've noticed other differences between these two .conf files; you may want to bring them somewhat back in sync again.

@marcinszkudlinski
Copy link
Contributor Author

closing by now, a new PR will be opened soon

@marcinszkudlinski marcinszkudlinski deleted the google_aec_sink_src_dp branch June 21, 2024 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants