Skip to content

Commit

Permalink
topology2: google-rtc-aec: adjust the IBS/OBS size based on process n…
Browse files Browse the repository at this point in the history
…eeds

Example: if a module has 2 input pins, one 16000/16/2, second 48000/16/2 and
one output pin 48000/32/4 and is designed to process 10ms data chunks:

in pin1 IBS should be 16(samples/1ms) * 2 bytes * 2 * 10(ms) = 640
in pin2 IBS should be 48(samples/1ms) * 2 bytes * 2 * 10(ms) = 1920
out pin1 OBS should be 48(samples/1ms) * 4 bytes * 4 * 10(ms) = 7680

Signed-off-by: Ranjani Sridharan <[email protected]>
Signed-off-by: Yong Zhi <[email protected]>
  • Loading branch information
ranj063 authored and kv2019i committed Nov 1, 2023
1 parent e62e333 commit d294036
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# Where N is the unique instance number for the google-rtc-aec object within the same alsaconf node.
Define {
AEC_UUID "a6:a0:80:b7:9f:26:6f:46:b4:77:23:df:a0:5a:f7:58"
# AEC requires 10ms buffers for processing
BUFFER_PERIOD_MS 10
}

Class.Widget."google-rtc-aec" {
Expand Down Expand Up @@ -96,6 +98,7 @@ Class.Widget."google-rtc-aec" {
input_pin_index 0
in_bit_depth 16
in_valid_bit_depth 16
ibs "$[(($in_channels * ($[($in_rate + 999)] / 1000)) * ($in_bit_depth / 8)) * $BUFFER_PERIOD_MS ]"
}
# 4ch 16-bit on Pin 0
{
Expand All @@ -105,19 +108,23 @@ Class.Widget."google-rtc-aec" {
in_channels 4
in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
in_ch_map $CHANNEL_MAP_3_POINT_1
ibs "$[(($in_channels * ($[($in_rate + 999)] / 1000)) * ($in_bit_depth / 8)) * $BUFFER_PERIOD_MS]"
}
# 2ch 16-bit on Pin 1
{
input_pin_index 1
in_bit_depth 16
in_valid_bit_depth 16
ibs "$[(($in_channels * ($[($in_rate + 999)] / 1000)) * ($in_bit_depth / 8)) * $BUFFER_PERIOD_MS]"
}
]

Object.Base.output_audio_format [
{
out_bit_depth 16
out_valid_bit_depth 16
obs "$[(($out_channels * ($[($out_rate + 999)] / 1000)) * ($out_bit_depth / 8)) * $BUFFER_PERIOD_MS]"

}
# 4ch 16-bit
{
Expand All @@ -126,6 +133,8 @@ Class.Widget."google-rtc-aec" {
out_channels 4
out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
out_ch_map $CHANNEL_MAP_3_POINT_1
obs "$[(($out_channels * ($[($out_rate + 999)] / 1000)) * ($out_bit_depth / 8)) * $BUFFER_PERIOD_MS]"

}
]

Expand Down

0 comments on commit d294036

Please sign in to comment.