Skip to content

Commit 482b7a0

Browse files
committed
Tools: Topology: Add echo reference for SDW speaker and jack
This patch adds an echo reference capture PCM for speaker and jack playback. The additions are normally disabled but can be enabled with build options SDW_JACK_ECHO_REF=true and/or SDW_SPK_ECHO_REF=true. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 9a3ae61 commit 482b7a0

File tree

6 files changed

+470
-41
lines changed

6 files changed

+470
-41
lines changed

tools/topology/topology2/cavs-sdw.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
<ssp.conf>
5252
<bt-default.conf>
5353
<deep-buffer-default.conf>
54+
<siggen-host-copier-capture.conf>
5455

5556
Define {
5657
PLATFORM "none"

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,4 +400,35 @@ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
400400
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-rt721-4ch-allfmt.bin,DMIC0_ENHANCED_CAPTURE=true,\
401401
EFX_DMIC0_TDFB_PARAMS=line4_pass,EFX_DMIC0_DRC_PARAMS=dmic_default,\
402402
DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true,PCM_FORMAT_ALL=true"
403+
404+
# Jack codec + SmartAmp topology. No SDW_DMIC connection, experiment with echo ref
405+
"cavs-sdw\;sof-mtl-rt713-l0-rt1316-l12-echoref\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,\
406+
HDMI1_ID=4,HDMI2_ID=5,HDMI3_ID=6,SDW_SPK_ENHANCED_PLAYBACK=false,\
407+
SDW_JACK_ECHO_REF=false,SDW_SPK_ECHO_REF=true"
408+
409+
# experiment with jack and speaker echo ref
410+
"cavs-sdw\;sof-arl-cs42l43-l0-cs35l56-l23-echoref\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1,\
411+
SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\
412+
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
413+
SDW_JACK_ECHO_REF=true,SDW_SPK_ECHO_REF=true"
414+
415+
"cavs-sdw\;sof-arl-cs42l43-l0-cs35l56-l23-echoref_jack\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1,\
416+
SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\
417+
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
418+
SDW_JACK_ECHO_REF=true"
419+
420+
"cavs-sdw\;sof-arl-cs42l43-l0-cs35l56-l23-echoref_spk\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1,\
421+
SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\
422+
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
423+
SDW_SPK_ECHO_REF=true"
424+
425+
"cavs-sdw\;sof-arl-cs42l43-l0-cs35l56-l23-echoref_noenh\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1,\
426+
SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\
427+
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
428+
SDW_JACK_ECHO_REF=true,SDW_SPK_ECHO_REF=true,SDW_SPK_ENHANCED_PLAYBACK=false"
429+
430+
"cavs-sdw\;sof-arl-cs42l43-l0-cs35l56-l23-noref_noenh\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1,\
431+
SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\
432+
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
433+
SDW_SPK_ENHANCED_PLAYBACK=false"
403434
)

tools/topology/topology2/include/common/common_definitions.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,6 @@ Define {
6969
SSP_BLOB_VERSION_3_0 0x300
7070

7171
PCM_FORMAT_ALL false # Basic s16/s24/s32, no float, 8-bit etc.
72+
SDW_JACK_ECHO_REF false # No echo reference for 3.5mm jack
73+
SDW_SPK_ECHO_REF false # No echo reference for speaker
7274
}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#
2+
# Siggen capture pipeline
3+
#
4+
# This class provides host pipeline for capture with siggen input. All
5+
# attributes defined herein are namespaced by alsatplg to
6+
# "Object.Pipeline.siggen-host-copier-capture.N.attribute_name".
7+
#
8+
# Usage: siggen-host-copier-capture pipeline object can be instantiated as:
9+
#
10+
# Object.Pipeline.siggen-host-copier-capture."N" {
11+
# period 1000
12+
# time_domain "timer"
13+
# }
14+
#
15+
# Where N is the unique pipeline ID within the same alsaconf node.
16+
#
17+
18+
<include/common/input_audio_format.conf>
19+
<include/common/output_audio_format.conf>
20+
<include/components/pipeline.conf>
21+
<include/components/host-copier.conf>
22+
<include/components/siggen.conf>
23+
24+
Class.Pipeline."siggen-host-copier-capture" {
25+
26+
<include/pipelines/pipeline-common.conf>
27+
28+
attributes {
29+
!constructor [
30+
"index"
31+
]
32+
33+
!immutable [
34+
"direction"
35+
]
36+
37+
#
38+
# siggen-host-copier-capture objects instantiated within the same alsaconf node must have
39+
# unique pipeline_id attribute
40+
#
41+
unique "instance"
42+
}
43+
44+
Object.Widget {
45+
siggen."1" {
46+
num_input_pins 0
47+
num_output_pins 1
48+
num_input_audio_formats 1
49+
num_output_audio_formats 1
50+
Object.Base.input_audio_format [
51+
{
52+
in_bit_depth 32
53+
in_valid_bit_depth 32
54+
}
55+
]
56+
Object.Base.output_audio_format [
57+
{
58+
out_bit_depth 32
59+
out_valid_bit_depth 32
60+
}
61+
]
62+
}
63+
64+
host-copier."1" {
65+
type "aif_out"
66+
node_type $HDA_HOST_INPUT_CLASS
67+
num_input_pins 1
68+
num_output_pins 1
69+
num_input_audio_formats 1
70+
num_output_audio_formats 1
71+
Object.Base.input_audio_format [
72+
{
73+
in_bit_depth 32
74+
in_valid_bit_depth 32
75+
}
76+
]
77+
Object.Base.output_audio_format [
78+
{
79+
out_bit_depth 32
80+
out_valid_bit_depth 32
81+
}
82+
]
83+
}
84+
85+
pipeline."1" {
86+
priority 0
87+
lp_mode 0
88+
}
89+
}
90+
91+
direction "capture"
92+
dynamic_pipeline 1
93+
time_domain "timer"
94+
}

tools/topology/topology2/platform/intel/sdw-amp-generic.conf

Lines changed: 168 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -636,44 +636,76 @@ Object.PCM.pcm [
636636
]
637637

638638
IncludeByKey.PASSTHROUGH {
639-
"false" {
640-
IncludeByKey.SDW_SPK_ENHANCED_PLAYBACK {
641-
"true" {
642-
Object.Base.route [
643-
{
644-
source "drc.21.1"
645-
sink "alh-copier.$SDW_SPK_STREAM.0"
646-
}
647-
]
648-
}
649-
"false" {
650-
Object.Base.route [
651-
{
652-
source "gain.21.1"
653-
sink "alh-copier.$SDW_SPK_STREAM.0"
654-
}
655-
]
656-
}
657-
}
658-
Object.Base.route [
659-
{
660-
source 'mixin.20.1'
661-
sink 'mixout.21.1'
662-
}
663-
{
664-
source 'host-copier.2.playback'
665-
sink 'gain.20.1'
666-
}
667-
]
668-
}
669-
"true" {
670-
Object.Base.route [
671-
{
672-
source "host-copier.2.playback"
673-
sink "alh-copier.$SDW_SPK_STREAM.0"
639+
"false" {
640+
IncludeByKey.SDW_SPK_ECHO_REF {
641+
"true" {
642+
IncludeByKey.SDW_SPK_ENHANCED_PLAYBACK {
643+
"true" {
644+
Object.Base.route [
645+
{
646+
source "drc.21.1"
647+
sink "module-copier.21.22"
648+
}
649+
{
650+
source "module-copier.21.22"
651+
sink "alh-copier.$SDW_SPK_STREAM.0"
652+
}
653+
]
654+
}
655+
"false" {
656+
Object.Base.route [
657+
{
658+
source "gain.21.1"
659+
sink "module-copier.21.22"
660+
}
661+
{
662+
source "module-copier.21.22"
663+
sink "alh-copier.$SDW_SPK_STREAM.0"
664+
}
665+
]
666+
}
667+
}
668+
}
669+
"false" {
670+
IncludeByKey.SDW_SPK_ENHANCED_PLAYBACK {
671+
"true" {
672+
Object.Base.route [
673+
{
674+
source "drc.21.1"
675+
sink "alh-copier.$SDW_SPK_STREAM.0"
676+
}
677+
]
678+
}
679+
"false" {
680+
Object.Base.route [
681+
{
682+
source "gain.21.1"
683+
sink "alh-copier.$SDW_SPK_STREAM.0"
684+
}
685+
]
686+
}
687+
}
688+
}
674689
}
675-
]
676-
}
690+
Object.Base.route [
691+
{
692+
source 'mixin.20.1'
693+
sink 'mixout.21.1'
694+
}
695+
{
696+
source 'host-copier.2.playback'
697+
sink 'gain.20.1'
698+
}
699+
]
700+
}
701+
"true" {
702+
Object.Base.route [
703+
{
704+
source "host-copier.2.playback"
705+
sink "alh-copier.$SDW_SPK_STREAM.0"
706+
}
707+
]
708+
}
677709
}
678710

679711
IncludeByKey.SDW_AMP_FEEDBACK {
@@ -885,3 +917,102 @@ IncludeByKey.SDW_AMP_FEEDBACK {
885917
]
886918
}
887919
}
920+
921+
IncludeByKey.SDW_SPK_ECHO_REF {
922+
"true" {
923+
Object.Widget.alh-copier [
924+
{
925+
stream_name "EchoRef_virtual_DAI"
926+
direction "capture"
927+
type "dai_out"
928+
index 22
929+
dai_index 25
930+
node_type $ALH_LINK_INPUT_CLASS
931+
num_input_audio_formats 1
932+
num_output_audio_formats 1
933+
num_output_pins 1
934+
935+
Object.Base.input_audio_format [
936+
{
937+
in_bit_depth 32
938+
in_valid_bit_depth $SDW_LINK_VALID_BITS
939+
in_sample_type $SAMPLE_TYPE_MSB_INTEGER
940+
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]"
941+
}
942+
]
943+
Object.Base.output_audio_format [
944+
{
945+
out_bit_depth 32
946+
out_valid_bit_depth 32
947+
}
948+
]
949+
}
950+
]
951+
952+
Object.Widget.module-copier."22" {
953+
index 21
954+
num_input_pins 1
955+
num_output_pins 2
956+
num_input_audio_formats 1
957+
num_output_audio_formats 1
958+
Object.Base.input_audio_format [
959+
{
960+
in_bit_depth 32
961+
in_valid_bit_depth 32
962+
}
963+
]
964+
Object.Base.output_audio_format [
965+
{
966+
out_bit_depth 32
967+
out_valid_bit_depth 32
968+
}
969+
]
970+
}
971+
972+
Object.Pipeline {
973+
siggen-host-copier-capture [
974+
{
975+
index 22
976+
Object.Widget.host-copier."1" {
977+
stream_name "Speaker Echo Reference"
978+
pcm_id 12
979+
}
980+
Object.Widget.siggen."1" {
981+
num_input_pins 2
982+
num_output_pins 1
983+
}
984+
}
985+
]
986+
}
987+
988+
Object.PCM.pcm [
989+
{
990+
name "Speaker Echo Reference"
991+
id 12
992+
direction "capture"
993+
Object.Base.fe_dai.1 {
994+
name "Speaker Echo Reference"
995+
}
996+
Object.PCM.pcm_caps.1 {
997+
name "Speaker Echo Reference"
998+
formats 'S32_LE'
999+
}
1000+
}
1001+
]
1002+
1003+
Object.Base.route [
1004+
{
1005+
source "alh-copier.EchoRef_virtual_DAI.25"
1006+
sink "siggen.22.1"
1007+
}
1008+
{
1009+
source "module-copier.21.22"
1010+
sink "siggen.22.1"
1011+
}
1012+
{
1013+
source "siggen.22.1"
1014+
sink "host-copier.12.capture"
1015+
}
1016+
]
1017+
}
1018+
}

0 commit comments

Comments
 (0)