Skip to content

Commit

Permalink
[DEBUG] check audio format
Browse files Browse the repository at this point in the history
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
  • Loading branch information
yongzhi1 committed Nov 2, 2023
1 parent a9d4e60 commit b726945
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/audio/google/google_rtc_audio_processing.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

#define GOOGLE_RTC_AUDIO_PROCESSING_FREQENCY_TO_PERIOD_FRAMES 100

LOG_MODULE_REGISTER(google_rtc_audio_processing, CONFIG_SOF_LOG_LEVEL);
LOG_MODULE_REGISTER(google_rtc_audio_processing, 4);

/* b780a0a6-269f-466f-b477-23dfa05af758 */
DECLARE_SOF_RT_UUID("google-rtc-audio-processing", google_rtc_audio_processing_uuid,
Expand Down Expand Up @@ -121,7 +121,7 @@ static int google_rtc_audio_processing_reconfigure(struct processing_module *mod
size_t size;
int ret;

comp_dbg(dev, "google_rtc_audio_processing_reconfigure()");
//comp_dbg(dev, "google_rtc_audio_processing_reconfigure()");

if (!comp_is_current_data_blob_valid(cd->tuning_handler) &&
!comp_is_new_data_blob_available(cd->tuning_handler)) {
Expand Down Expand Up @@ -330,16 +330,29 @@ static int google_rtc_audio_processing_init(struct processing_module *mod)

md->private = cd;

struct module_config *cfg = &md->cfg;

cd->config = *(const struct sof_ipc4_aec_config *)cfg->init_data;

cd->tuning_handler = comp_data_blob_handler_new(dev);
if (!cd->tuning_handler) {
ret = -ENOMEM;
goto fail;
}

const struct ipc4_base_module_extended_cfg *base_cfg = md->cfg.init_data;
const size_t size = sizeof(struct ipc4_input_pin_format);

memcpy_s(&cd->config.base_cfg, sizeof(struct ipc4_base_module_cfg),
&base_cfg->base_cfg, sizeof(struct ipc4_base_module_cfg));
/* Copy the pin formats */
memcpy_s(&cd->config.capture_fmt, size,
base_cfg->base_cfg_ext.pin_formats, size);
#if 0
memcpy_s(&cd->config.reference_fmt, size,
base_cfg->base_cfg_ext.pin_formats[size], size);

memcpy_s(&cd->config.output_fmt, size,
&base_cfg->base_cfg_ext.pin_formats[size * 2], size);
#endif
comp_dbg(dev, "ZZZZ cd->config.reference_fmt.channels_count is %d", cd->config.reference_fmt.channels_count);

cd->num_aec_reference_channels = CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_NUM_AEC_REFERENCE_CHANNELS;
cd->num_capture_channels = CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_NUM_CHANNELS;
cd->num_frames = CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_SAMPLE_RATE_HZ /
Expand Down
1 change: 1 addition & 0 deletions src/include/ipc4/aec.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

struct sof_ipc4_aec_config {
struct ipc4_base_module_cfg base_cfg;
struct ipc4_audio_format capture_fmt;
struct ipc4_audio_format reference_fmt;
struct ipc4_audio_format output_fmt;
uint32_t cpc_low_power_mode;
Expand Down

0 comments on commit b726945

Please sign in to comment.