Skip to content

Commit

Permalink
[RTNR] Fix buffer size calculation
Browse files Browse the repository at this point in the history
The correct frame length should be calculated by
FRAME_LEN = SAMPLING_RATE * PERIODS / 1000000

The macro COMP_PERIOD_FRAMES does the thing.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
  • Loading branch information
MingJenTai authored and lgirdwood committed Mar 30, 2022
1 parent 3e6fd30 commit a5fd52e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tools/topology/topology1/sof/pipe-rtnr-capture-16khz.m4
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ W_RTNR(0, PIPELINE_FORMAT, 2, DAI_PERIODS, DMIC_PIPELINE_16k_CORE_ID, LIST(` ',
# Capture Buffers
W_BUFFER(0, COMP_BUFFER_SIZE(4,
COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS,
eval(PCM_MAX_RATE / SCHEDULE_PERIOD)), PLATFORM_PASS_MEM_CAP)
COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), PLATFORM_PASS_MEM_CAP)

W_BUFFER(1, COMP_BUFFER_SIZE(4,
COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS,
eval(PCM_MAX_RATE / SCHEDULE_PERIOD)), PLATFORM_PASS_MEM_CAP)
COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), PLATFORM_PASS_MEM_CAP)

P_GRAPH(pipe-rtnr-capture-PIPELINE_ID, PIPELINE_ID,
LIST(` ',
Expand Down
4 changes: 2 additions & 2 deletions tools/topology/topology1/sof/pipe-rtnr-capture.m4
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ W_RTNR(0, PIPELINE_FORMAT, 2, DAI_PERIODS, SCHEDULE_CORE, LIST(` ', "DEF_RTNR_B
# Capture Buffers
W_BUFFER(0, COMP_BUFFER_SIZE(4,
COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS,
eval(PCM_MAX_RATE / SCHEDULE_PERIOD)), PLATFORM_PASS_MEM_CAP)
COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), PLATFORM_PASS_MEM_CAP)

W_BUFFER(1, COMP_BUFFER_SIZE(4,
COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS,
eval(PCM_MAX_RATE / SCHEDULE_PERIOD)), PLATFORM_PASS_MEM_CAP)
COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), PLATFORM_PASS_MEM_CAP)

P_GRAPH(pipe-rtnr-capture-PIPELINE_ID, PIPELINE_ID,
LIST(` ',
Expand Down

0 comments on commit a5fd52e

Please sign in to comment.