Skip to content

Commit

Permalink
Modify periods setting for RTNR capturing pipeline
Browse files Browse the repository at this point in the history
With the  release of RTNR version 20220728, period for capturing pipeline requires at least 5ms.

Periods setting for 16KHz capturing pipeline is also removed since RTNR is currently running in 48KHz capturing pipeline only.

Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
  • Loading branch information
MingJenTai authored and lgirdwood committed Aug 31, 2022
1 parent 9915d1e commit 8496d58
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
6 changes: 2 additions & 4 deletions tools/topology/topology1/platform/intel/intel-generic-dmic.m4
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ ifdef(`DMIC16K_PCM_CHANNELS', `', `define(DMIC16K_PCM_CHANNELS, CHANNELS)')
dnl Unless explicitly specified, dmic period at 48k is 1ms
ifdef(`DMIC_48k_PERIOD_US', `', `define(DMIC_48k_PERIOD_US, 1000)')

## Prolong period to 4ms for RTNR
ifdef(`RTNR', `define(`INTEL_GENERIC_DMIC_PERIOD', 4000)', `define(`INTEL_GENERIC_DMIC_PERIOD', 1000)')
ifdef(`RTNR', `define(`INTEL_GENERIC_DMIC_PERIOD_INV', 250)', `define(`INTEL_GENERIC_DMIC_PERIOD_INV', 1000)')
define(`INTEL_GENERIC_DMIC_PERIOD', 1000)

ifelse(CHANNELS, 1, `define(`VOLUME_CHANNEL_MAP', LIST(` ', KCONTROL_CHANNEL(FL, 1, 0)))')
ifelse(CHANNELS, 2, `define(`VOLUME_CHANNEL_MAP', LIST(` ', KCONTROL_CHANNEL(FL, 1, 0),
Expand Down Expand Up @@ -105,7 +103,7 @@ define(`PGA_NAME', Dmic1)
ifdef(NO16KDMIC, `',
`PIPELINE_PCM_ADD(sof/pipe-DMIC16KPROC-capture-16khz.m4,
DMIC_PIPELINE_16k_ID, DMIC_PCM_16k_ID, DMIC16K_PCM_CHANNELS, s32le,
INTEL_GENERIC_DMIC_PERIOD_INV, 0, DMIC_16k_CORE_ID, 16000, 16000, 16000)')
INTEL_GENERIC_DMIC_PERIOD, 0, DMIC_16k_CORE_ID, 16000, 16000, 16000)')

undefine(`PGA_NAME')
undefine(`PIPELINE_FILTER1')
Expand Down
11 changes: 8 additions & 3 deletions tools/topology/topology1/sof-tgl-max98357a-rt5682.m4
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,17 @@ define(DMIC_PIPELINE_KWD_ID, `12')
define(DMIC_DAI_LINK_16k_ID, eval(BOARD_DMIC_BE_ID_BASE + 1))
define(DMIC_PIPELINE_48k_CORE_ID, `1')

ifdef(`RTNR', `define(`DMICPROC', rtnr)', `')
ifdef(`GOOGLE_RTC_AUDIO_PROCESSING',
`define(`DMICPROC', google-rtc-audio-processing)'
`ifdef(`RTNR',
`define(`DMICPROC', google-rtc-audio-processing-rtnr)',
`define(`DMICPROC', google-rtc-audio-processing)')'
`define(`DMIC_48k_PERIOD_US', 10000)'
,
`')
`ifdef(`RTNR',
`define(`DMICPROC', rtnr)'
# 5ms period is required for RTNR build 20220728 and later versions
`define(`DMIC_48k_PERIOD_US', 5000)')'
)

ifdef(`GOOGLE_RTC_AUDIO_PROCESSING', `define(`SPK_PLAYBACK_CORE', DMIC_PIPELINE_48k_CORE_ID)', `define(`SPK_PLAYBACK_CORE', `0')')

Expand Down

0 comments on commit 8496d58

Please sign in to comment.