|
| 1 | +# |
| 2 | +# cAVS nocodec topology: webrtc-aec echo cancellation test |
| 3 | +# |
| 4 | +# Standalone test topology for webrtc_aec (AECm) on real hardware. |
| 5 | +# Uses two SSP loopback ports — one for the mic, one for the speaker |
| 6 | +# echo reference — matching the google-rtc-aec nocodec topology. |
| 7 | +# |
| 8 | +# Pipeline diagram: |
| 9 | +# |
| 10 | +# PCM0 playback ──(1)────────────────────(2)──> SSP0 TX |
| 11 | +# |
| 12 | +# PCM2 playback ──(5)────────────────────(6)──> SSP2 TX |
| 13 | +# |
| 14 | +# SSP0 RX ──────(8)──> WEBRTC-AEC ──────(7)──> PCM0 capture |
| 15 | +# ↑ |
| 16 | +# SSP2 RX ──────(12)────────+ |
| 17 | +# |
| 18 | +# SSP0 = microphone (same pipeline as capture PCM0). |
| 19 | +# SSP2 = speaker echo reference (cross-pipeline feed into AEC pin 1). |
| 20 | +# |
| 21 | +# Board: any cAVS/ACE platform with two SSP loopback fixtures. |
| 22 | +# Compile: alsatplg -c cavs-nocodec-webrtc-aec.conf -o webrtc-aec.tplg |
| 23 | + |
| 24 | +<searchdir:include> |
| 25 | +<searchdir:include/common> |
| 26 | +<searchdir:include/components> |
| 27 | +<searchdir:include/dais> |
| 28 | +<searchdir:include/pipelines/cavs> |
| 29 | +<searchdir:platform> |
| 30 | +<searchdir:platform/intel> |
| 31 | + |
| 32 | +<vendor-token.conf> |
| 33 | +<manifest.conf> |
| 34 | +<tokens.conf> |
| 35 | +<virtual.conf> |
| 36 | +<host-gateway-capture.conf> |
| 37 | +<host-gateway-playback.conf> |
| 38 | +<io-gateway-capture.conf> |
| 39 | +<io-gateway.conf> |
| 40 | +<data.conf> |
| 41 | +<pcm.conf> |
| 42 | +<pcm_caps.conf> |
| 43 | +<fe_dai.conf> |
| 44 | +<ssp.conf> |
| 45 | +<intel/hw_config_cardinal_clk.conf> |
| 46 | +<manifest.conf> |
| 47 | +<route.conf> |
| 48 | +<common_definitions.conf> |
| 49 | +<dai-copier.conf> |
| 50 | +<module-copier.conf> |
| 51 | +<pipeline.conf> |
| 52 | +<dai.conf> |
| 53 | +<host.conf> |
| 54 | +<input_pin_binding.conf> |
| 55 | +<output_pin_binding.conf> |
| 56 | +<input_audio_format.conf> |
| 57 | +<output_audio_format.conf> |
| 58 | + |
| 59 | +<webrtc-aec.conf> |
| 60 | + |
| 61 | +Define { |
| 62 | + MCLK 24576000 |
| 63 | + PLATFORM "none" |
| 64 | + SSP0_PCM_ID 0 |
| 65 | + SSP0_PCM_NAME "Port0" |
| 66 | + SSP2_PCM_NAME "Port2" |
| 67 | +} |
| 68 | + |
| 69 | +IncludeByKey.PLATFORM { |
| 70 | + "tgl" "platform/intel/tgl.conf" |
| 71 | + "adl" "platform/intel/tgl.conf" |
| 72 | + "mtl" "platform/intel/mtl.conf" |
| 73 | + "lnl" "platform/intel/lnl.conf" |
| 74 | + "ptl" "platform/intel/lnl.conf" |
| 75 | +} |
| 76 | + |
| 77 | +Object.Dai.SSP [ |
| 78 | + { |
| 79 | + id 0 |
| 80 | + dai_index 0 |
| 81 | + direction "duplex" |
| 82 | + name NoCodec-0 |
| 83 | + default_hw_conf_id 0 |
| 84 | + sample_bits 32 |
| 85 | + quirks "lbm_mode" |
| 86 | + io_clk $MCLK |
| 87 | + Object.Base.hw_config.1 { |
| 88 | + name "SSP0" |
| 89 | + id 0 |
| 90 | + bclk_freq 3072000 |
| 91 | + tdm_slot_width 32 |
| 92 | + Object.Base.link_config.1 { clock_source 1 } |
| 93 | + } |
| 94 | + } |
| 95 | + { |
| 96 | + id 2 |
| 97 | + dai_index 2 |
| 98 | + direction "duplex" |
| 99 | + name NoCodec-2 |
| 100 | + default_hw_conf_id 0 |
| 101 | + sample_bits 32 |
| 102 | + quirks "lbm_mode" |
| 103 | + io_clk $MCLK |
| 104 | + Object.Base.hw_config.1 { |
| 105 | + name "SSP2" |
| 106 | + id 0 |
| 107 | + bclk_freq 3072000 |
| 108 | + tdm_slot_width 32 |
| 109 | + Object.Base.link_config.1 { clock_source 1 } |
| 110 | + } |
| 111 | + } |
| 112 | +] |
| 113 | + |
| 114 | +# Playback pipelines |
| 115 | +Object.Pipeline.io-gateway [ |
| 116 | + { |
| 117 | + index 2 |
| 118 | + direction playback |
| 119 | + Object.Widget.dai-copier.1 { |
| 120 | + dai_index 0 dai_type "SSP" copier_type "SSP" |
| 121 | + stream_name "NoCodec-0" node_type $I2S_LINK_OUTPUT_CLASS |
| 122 | + num_input_pins 1 |
| 123 | + num_input_audio_formats 1 |
| 124 | + Object.Base.input_audio_format [{ in_bit_depth 16 in_valid_bit_depth 16 }] |
| 125 | + num_output_audio_formats 1 |
| 126 | + Object.Base.output_audio_format [{ out_bit_depth 32 out_valid_bit_depth 32 }] |
| 127 | + } |
| 128 | + } |
| 129 | + { |
| 130 | + index 6 |
| 131 | + direction playback |
| 132 | + Object.Widget.dai-copier.1 { |
| 133 | + dai_index 2 dai_type "SSP" copier_type "SSP" |
| 134 | + stream_name "NoCodec-2" node_type $I2S_LINK_OUTPUT_CLASS |
| 135 | + num_input_pins 1 |
| 136 | + num_input_audio_formats 1 |
| 137 | + Object.Base.input_audio_format [{ in_bit_depth 16 in_valid_bit_depth 16 }] |
| 138 | + num_output_audio_formats 1 |
| 139 | + Object.Base.output_audio_format [{ out_bit_depth 32 out_valid_bit_depth 32 }] |
| 140 | + } |
| 141 | + } |
| 142 | +] |
| 143 | + |
| 144 | +Object.Pipeline.host-gateway-playback [ |
| 145 | + { |
| 146 | + index 1 |
| 147 | + Object.Widget.host-copier.1 { |
| 148 | + stream_name 'SSP0 Playback' pcm_id 0 |
| 149 | + num_input_audio_formats 1 |
| 150 | + Object.Base.input_audio_format [{ in_bit_depth 16 in_valid_bit_depth 16 }] |
| 151 | + num_output_audio_formats 1 |
| 152 | + Object.Base.output_audio_format [{ out_bit_depth 16 out_valid_bit_depth 16 }] |
| 153 | + } |
| 154 | + } |
| 155 | + { |
| 156 | + index 5 |
| 157 | + Object.Widget.host-copier.1 { |
| 158 | + stream_name 'SSP2 Playback' pcm_id 2 |
| 159 | + num_input_audio_formats 1 |
| 160 | + Object.Base.input_audio_format [{ in_bit_depth 16 in_valid_bit_depth 16 }] |
| 161 | + num_output_audio_formats 1 |
| 162 | + Object.Base.output_audio_format [{ out_bit_depth 16 out_valid_bit_depth 16 }] |
| 163 | + } |
| 164 | + } |
| 165 | +] |
| 166 | + |
| 167 | +# Capture: SSP0 (mic) + SSP2 (ref) both feed into the AEC widget |
| 168 | +Object.Pipeline.host-gateway-capture [ |
| 169 | + { |
| 170 | + index 7 |
| 171 | + Object.Widget.host-copier.1 { |
| 172 | + stream_name 'SSP0 Capture' pcm_id 0 |
| 173 | + num_input_audio_formats 1 |
| 174 | + Object.Base.input_audio_format [{ in_bit_depth 16 in_valid_bit_depth 16 }] |
| 175 | + num_output_audio_formats 1 |
| 176 | + Object.Base.output_audio_format [{ out_bit_depth 16 out_valid_bit_depth 16 }] |
| 177 | + } |
| 178 | + } |
| 179 | +] |
| 180 | + |
| 181 | +Object.Pipeline.io-gateway-capture [ |
| 182 | + { |
| 183 | + index 8 |
| 184 | + direction capture |
| 185 | + Object.Widget.dai-copier.1 { |
| 186 | + dai_index 0 dai_type "SSP" type dai_out copier_type "SSP" |
| 187 | + stream_name "NoCodec-0" node_type $I2S_LINK_INPUT_CLASS |
| 188 | + num_input_audio_formats 1 |
| 189 | + Object.Base.input_audio_format [{ in_bit_depth 32 in_valid_bit_depth 32 }] |
| 190 | + num_output_audio_formats 1 |
| 191 | + Object.Base.output_audio_format [{ out_bit_depth 16 out_valid_bit_depth 16 }] |
| 192 | + } |
| 193 | + } |
| 194 | + { |
| 195 | + index 12 |
| 196 | + direction capture |
| 197 | + Object.Widget.dai-copier.1 { |
| 198 | + dai_index 2 dai_type "SSP" type dai_out copier_type "SSP" |
| 199 | + stream_name "NoCodec-2" node_type $I2S_LINK_INPUT_CLASS |
| 200 | + num_input_audio_formats 1 |
| 201 | + Object.Base.input_audio_format [{ in_bit_depth 32 in_valid_bit_depth 32 }] |
| 202 | + num_output_audio_formats 1 |
| 203 | + Object.Base.output_audio_format [{ out_bit_depth 16 out_valid_bit_depth 16 }] |
| 204 | + } |
| 205 | + } |
| 206 | +] |
| 207 | + |
| 208 | +# |
| 209 | +# webrtc-aec widget: 2 input pins bound to both capture copiers |
| 210 | +# |
| 211 | +Object.Widget.webrtc-aec [ |
| 212 | + { |
| 213 | + index 7 |
| 214 | + name "webrtc-aec.7.1" |
| 215 | + |
| 216 | + # Pin 0: microphone (same pipeline 7 as the host-copier sink) |
| 217 | + Object.Base.input_pin_binding.1 { |
| 218 | + input_pin_binding_name "dai-copier.SSP.NoCodec-0.capture" |
| 219 | + } |
| 220 | + # Pin 1: echo reference from speaker pipeline |
| 221 | + Object.Base.input_pin_binding.2 { |
| 222 | + input_pin_binding_name "dai-copier.SSP.NoCodec-2.capture" |
| 223 | + } |
| 224 | + } |
| 225 | +] |
| 226 | + |
| 227 | +Object.PCM.pcm [ |
| 228 | + { |
| 229 | + name "$SSP0_PCM_NAME" |
| 230 | + id $SSP0_PCM_ID |
| 231 | + direction "duplex" |
| 232 | + Object.Base.fe_dai.1 { name "$SSP0_PCM_NAME" } |
| 233 | + Object.PCM.pcm_caps.1 { |
| 234 | + direction "playback" name "SSP0 Playback" formats 'S16_LE' |
| 235 | + } |
| 236 | + Object.PCM.pcm_caps.2 { |
| 237 | + direction "capture" name "SSP0 Capture" formats 'S16_LE' |
| 238 | + } |
| 239 | + } |
| 240 | + { |
| 241 | + name "$SSP2_PCM_NAME" |
| 242 | + id 2 |
| 243 | + direction "playback" |
| 244 | + Object.Base.fe_dai.1 { name "$SSP2_PCM_NAME" } |
| 245 | + Object.PCM.pcm_caps.1 { |
| 246 | + direction "playback" name "SSP2 Playback" formats 'S16_LE' |
| 247 | + } |
| 248 | + } |
| 249 | +] |
| 250 | + |
| 251 | +Object.Base.route [ |
| 252 | + { source "host-copier.0.playback" sink "dai-copier.SSP.NoCodec-0.playback" } |
| 253 | + { source "host-copier.2.playback" sink "dai-copier.SSP.NoCodec-2.playback" } |
| 254 | + # Mic → AEC pin 0 (handled by input_pin_binding above) |
| 255 | + { source "dai-copier.SSP.NoCodec-0.capture" sink "webrtc-aec.7.1" } |
| 256 | + # Ref → AEC pin 1 |
| 257 | + { source "dai-copier.SSP.NoCodec-2.capture" sink "webrtc-aec.7.1" } |
| 258 | + # AEC output → host |
| 259 | + { source "webrtc-aec.7.1" sink "host-copier.0.capture" } |
| 260 | +] |
0 commit comments