-
Notifications
You must be signed in to change notification settings - Fork 349
[DNM] Google aec sink src dp #8469
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
[DNM] Google aec sink src dp #8469
Conversation
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>
676bfad to
a551a05
Compare
| 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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
lkoenig
left a comment
There was a problem hiding this 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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
|
@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 */ |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
|
closing by now, a new PR will be opened soon |
This PR modifies google AEC shimm to use sink/src interface and to be run as DP module in 10ms period
it contains all required not merged changes as a squash commit
it still contains a bit to do - do not merge