Skip to content

Commit 5b792ec

Browse files
committed
Tools: Topology: Phase Vocoder: Bench topology to test the component
This patch adds the Phase Vocoder class to topology2 with a few configuration options for STFT parameters. The Hann window with 1024 size FFT and hop of 256 is providing good quality. Due to current high load (near 300 MCPS for stereo 48 kHz) of the module, there is a forced mono version of the configuration blob to enable testing of the feature to slow down or speed up the audio playback. The provided topology works in testbench. In a real device it can work in < 1.0 speed. The > 1.0 speed needs more patches. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent dbafddb commit 5b792ec

19 files changed

Lines changed: 421 additions & 0 deletions

tools/topology/topology2/cavs-benchmark-hda.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<mixin.conf>
4646
<mixout.conf>
4747
<multiband_drc.conf>
48+
<phase_vocoder.conf>
4849
<rtnr.conf>
4950
<sound_dose.conf>
5051
<src.conf>
@@ -864,6 +865,22 @@ IncludeByKey.BENCH_CONFIG {
864865
<include/bench/micsel_multich_s32.conf>
865866
}
866867

868+
#
869+
# Phase Vocoder component
870+
#
871+
872+
"phase_vocoder16" {
873+
<include/bench/phase_vocoder_s16.conf>
874+
}
875+
876+
"phase_vocoder24" {
877+
<include/bench/phase_vocoder_s24.conf>
878+
}
879+
880+
"phase_vocoder32" {
881+
<include/bench/phase_vocoder_s32.conf>
882+
}
883+
867884
#
868885
# RTNR component
869886
#

tools/topology/topology2/cavs-benchmark-sdw.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<mfcc.conf>
4343
<micsel.conf>
4444
<multiband_drc.conf>
45+
<phase_vocoder.conf>
4546
<rtnr.conf>
4647
<sound_dose.conf>
4748
<src.conf>
@@ -467,6 +468,22 @@ IncludeByKey.BENCH_CONFIG {
467468
<include/bench/micsel_multich_s32.conf>
468469
}
469470

471+
#
472+
# Phase Vocoder component
473+
#
474+
475+
"phase_vocoder16" {
476+
<include/bench/phase_vocoder_s16.conf>
477+
}
478+
479+
"phase_vocoder24" {
480+
<include/bench/phase_vocoder_s24.conf>
481+
}
482+
483+
"phase_vocoder32" {
484+
<include/bench/phase_vocoder_s32.conf>
485+
}
486+
470487
#
471488
# RTNR component
472489
#

tools/topology/topology2/development/tplg-targets-bench.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ set(components
2121
"mfcc"
2222
"mfccmel"
2323
"micsel"
24+
"phase_vocoder"
2425
"rtnr"
2526
"sound_dose"
2627
"src"
@@ -48,6 +49,7 @@ set(component_parameters
4849
"BENCH_MFCC_PARAMS=default"
4950
"BENCH_MFCC_PARAMS=mel80"
5051
"BENCH_MICSEL_PARAMS=passthrough"
52+
"BENCH_PHASE_VOCODER_PARAMS=default"
5153
"BENCH_RTNR_PARAMS=default"
5254
"BENCH_SOUND_DOSE_PARAMS=default"
5355
"BENCH_SRC_PARAMS=default"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
num_input_audio_formats 1
2+
num_output_audio_formats 1
3+
4+
# 32-bit 48KHz 2ch
5+
Object.Base.input_audio_format [
6+
{
7+
in_bit_depth 32
8+
in_valid_bit_depth 32
9+
ibs 1024
10+
}
11+
]
12+
Object.Base.output_audio_format [
13+
{
14+
out_bit_depth 32
15+
out_valid_bit_depth 32
16+
obs 1024
17+
}
18+
]
19+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
num_input_audio_formats 1
2+
num_output_audio_formats 1
3+
4+
# 32-bit 48KHz 2ch
5+
Object.Base.input_audio_format [
6+
{
7+
in_bit_depth 32
8+
in_valid_bit_depth 32
9+
ibs 1536
10+
}
11+
]
12+
Object.Base.output_audio_format [
13+
{
14+
out_bit_depth 32
15+
out_valid_bit_depth 32
16+
obs 1536
17+
}
18+
]
19+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
num_input_audio_formats 1
2+
num_output_audio_formats 1
3+
4+
# 32-bit 48KHz 2ch
5+
Object.Base.input_audio_format [
6+
{
7+
in_bit_depth 32
8+
in_valid_bit_depth 32
9+
ibs 2048
10+
}
11+
]
12+
Object.Base.output_audio_format [
13+
{
14+
out_bit_depth 32
15+
out_valid_bit_depth 32
16+
obs 2048
17+
}
18+
]
19+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
num_input_audio_formats 1
2+
num_output_audio_formats 1
3+
4+
# 32-bit 48KHz 2ch, ibs/obs is set to match
5+
# 5 ms or 240 stereo frames period.
6+
Object.Base.input_audio_format [
7+
{
8+
in_bit_depth 32
9+
in_valid_bit_depth 32
10+
in_channels 2
11+
ibs 1920
12+
}
13+
]
14+
Object.Base.output_audio_format [
15+
{
16+
out_bit_depth 32
17+
out_valid_bit_depth 32
18+
out_channels 2
19+
obs 1920
20+
}
21+
]
22+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Created initially with script "./bench_comp_generate.sh phase_vocoder"
2+
# may need edits to modify controls
3+
Object.Control {
4+
# Un-comment the supported controls in PHASE_VOCODER
5+
bytes."1" {
6+
name '$ANALOG_CAPTURE_PCM Phase Vocoder bytes'
7+
IncludeByKey.BENCH_PHASE_VOCODER_PARAMS {
8+
"default" "include/components/phase_vocoder/hann_1024_256.conf"
9+
}
10+
}
11+
mixer."1" {
12+
name '$ANALOG_CAPTURE_PCM Phase Vocoder enable'
13+
}
14+
enum."1" {
15+
name '$ANALOG_CAPTURE_PCM Phase Vocoder speed'
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Created initially with script "./bench_comp_generate.sh phase_vocoder"
2+
# may need edits to modify controls
3+
Object.Control {
4+
# Un-comment the supported controls in PHASE_VOCODER
5+
bytes."1" {
6+
name '$ANALOG_PLAYBACK_PCM Phase Vocoder bytes'
7+
IncludeByKey.BENCH_PHASE_VOCODER_PARAMS {
8+
"default" "include/components/phase_vocoder/hann_1024_256.conf"
9+
}
10+
}
11+
mixer."1" {
12+
name '$ANALOG_PLAYBACK_PCM Phase Vocoder enable'
13+
}
14+
enum."1" {
15+
name '$ANALOG_PLAYBACK_PCM Phase Vocoder speed'
16+
}
17+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Created with script "./bench_comp_generate.sh phase_vocoder"
2+
Object.Base.route [
3+
{
4+
sink '$BENCH_PLAYBACK_DAI_COPIER'
5+
source 'phase_vocoder.$BENCH_PLAYBACK_HOST_PIPELINE.1'
6+
}
7+
{
8+
sink 'phase_vocoder.$BENCH_PLAYBACK_HOST_PIPELINE.1'
9+
source 'host-copier.0.playback'
10+
}
11+
{
12+
source '$BENCH_CAPTURE_DAI_COPIER'
13+
sink 'phase_vocoder.$BENCH_CAPTURE_HOST_PIPELINE.2'
14+
}
15+
{
16+
source 'phase_vocoder.$BENCH_CAPTURE_HOST_PIPELINE.2'
17+
sink 'host-copier.0.capture'
18+
}
19+
]

0 commit comments

Comments
 (0)