Skip to content

Commit 961425c

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 54413c5 commit 961425c

5 files changed

Lines changed: 449 additions & 41 deletions

File tree

tools/topology/topology2/cavs-sdw.conf

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

5657
Define {
5758
PLATFORM "none"

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: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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+
#
34+
# siggen-host-copier-capture objects instantiated within the same alsaconf
35+
# node must have unique pipeline_id attribute
36+
#
37+
unique "instance"
38+
}
39+
40+
Object.Widget {
41+
siggen."1" {
42+
num_input_pins 1
43+
num_output_pins 1
44+
num_input_audio_formats 1
45+
num_output_audio_formats 1
46+
Object.Base.input_audio_format [
47+
{
48+
in_bit_depth 32
49+
in_valid_bit_depth 32
50+
}
51+
]
52+
Object.Base.output_audio_format [
53+
{
54+
out_bit_depth 32
55+
out_valid_bit_depth 32
56+
}
57+
]
58+
}
59+
60+
host-copier."1" {
61+
type "aif_out"
62+
node_type $HDA_HOST_INPUT_CLASS
63+
num_input_pins 1
64+
num_output_pins 1
65+
num_input_audio_formats 1
66+
num_output_audio_formats 3
67+
Object.Base.input_audio_format [
68+
{
69+
in_bit_depth 32
70+
in_valid_bit_depth 32
71+
}
72+
]
73+
Object.Base.output_audio_format [
74+
{
75+
out_bit_depth 16
76+
out_valid_bit_depth 16
77+
}
78+
{
79+
out_bit_depth 32
80+
out_valid_bit_depth 24
81+
}
82+
{
83+
out_bit_depth 32
84+
out_valid_bit_depth 32
85+
}
86+
]
87+
}
88+
89+
pipeline."1" {
90+
priority 0
91+
lp_mode 0
92+
}
93+
}
94+
95+
direction "capture"
96+
dynamic_pipeline 1
97+
time_domain "timer"
98+
}

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

Lines changed: 165 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Define {
1313
AMP_FEEDBACK_CH_PER_LINK 2
1414
SDW_AMP_FEEDBACK true
1515
AMP_PLAYBACK_NAME 'Speaker Playback'
16+
SDW_SPK_ECHO_REF_PCM_ID 12
1617
}
1718

1819
Object.Dai.ALH [
@@ -636,44 +637,76 @@ Object.PCM.pcm [
636637
]
637638

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

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

0 commit comments

Comments
 (0)