Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions topology2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,23 @@ ACPI when selecting and loading the corresponding topology.
Function topologies are intended to be reusable across devices that provide the same function.
Please do not add any customized feature in the function topology.

`sof-hda-generic.conf` builds the HDA function topologies the same way `cavs-sdw.conf` builds the
`sof-sdca-*` ones: one conf, and macros that enable a single function and disable the others.

| Function | Enable | Disable |
|---|---|---|
| HDA codec | `HDA_CONFIG=mix` (or `efx`, `src`, `dax`, `passthrough`) | `HDA_CONFIG=none` (default) |
| HDMI/DP (iDisp) | `NUM_HDMIS=3` (default) | `NUM_HDMIS=0` |
| PCH DMIC | `NUM_DMICS=1..4` | `NUM_DMICS=0` (default) |
| HDMI-IN (SSP) | `HDMI_IN_CAPTURE=true` | `HDMI_IN_CAPTURE=false` (default) |
| Bluetooth (SSP) | `ADD_BT=true` | `ADD_BT=false` (default) |

The virtual widgets follow their function, so a disabled function leaves none behind. The
function topologies are the `sof-<platform>-<function>-id<BE id>` targets (see `sof_hda_get_tplg_files()`;
the HDA codec and HDMI ones have no NHLT blob and no `<platform>`) in
`production/tplg-targets-hda-generic.cmake`. They are loaded next to each other, so choose
non-overlapping PCM and pipeline IDs for each of them.

### Registering CMake Targets

Production topologies are registered in `production/tplg-targets-*.cmake` files. Each
Expand Down
12 changes: 12 additions & 0 deletions topology2/cavs-sdw.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<deepbuffer-playback.conf>
<deepbuffer-capture.conf>
<compr-playback.conf>
<compr-speed-playback.conf>
<host-gateway-playback.conf>
<host-gateway-capture.conf>
<host-gateway-tdfb-drc-capture.conf>
Expand Down Expand Up @@ -105,6 +106,11 @@ Define {
COMPR_2_PIPELINE_SINK 'mixout.21.1'
COMPR_2_PCM_NAME 'Compress Speaker'

COMPR_SPEED_PIPELINE_SINK 'mixout.1.1'
COMPR_SPEED_PCM_NAME 'Compress Speed Jack Out'
COMPR_SPEED_2_PIPELINE_SINK 'mixout.21.1'
COMPR_SPEED_2_PCM_NAME 'Compress Speed Speaker'

SDW_JACK_OUT_STREAM 'SDW0-Playback'
SDW_JACK_IN_STREAM 'SDW0-Capture'
SDW_JACK_OUT_BE_ID 0
Expand Down Expand Up @@ -137,6 +143,7 @@ Define {
SDW_AMP_XOVER_EQFIR_PARAMS default
DOLBY_DAX_CORE_ID 0
DTS_CORE_ID 0
COMPR_SPEED_CORE_ID 1
SDW_AMP_PIPELINE_SRC "generic"
SDW_JACK_PIPELINE_SRC "generic"
SDW_ECHO_REF_DAI "false"
Expand Down Expand Up @@ -247,6 +254,7 @@ IncludeByKey.SDW_JACK {
Define {
# disable compressed audio for Jack
COMPRESSED_1 false
COMPRESSED_SPEED_1 false
}
}
}
Expand All @@ -256,6 +264,7 @@ IncludeByKey.NUM_SDW_AMP_LINKS {
Define {
# Enable compressed audio for Speaker
COMPRESSED_2 true
COMPRESSED_SPEED_2 true
}
}
}
Expand Down Expand Up @@ -300,3 +309,6 @@ IncludeByKey.SDW_DMIC_AUDIO_FEATURE_CAPTURE {
IncludeByKey.SDW_DMIC_COMPR_AUDIO_FEATURE_CAPTURE {
"true" "platform/intel/sdw-dmic-audio-feature-compress.conf"
}
IncludeByKey.COMPRESSED_SPEED {
"true" "platform/intel/compr-speed.conf"
}
307 changes: 307 additions & 0 deletions topology2/development/cavs-dmic-ssp-lbm-webrtc-aec.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,307 @@
#
# cAVS hybrid DMIC + SSP2 digital loopback topology for webrtc-aec
#
# Uses onboard DMIC0 (or ESP32-P4 PDM DMIC injector) for microphone capture
# and SSP2 in internal digital loopback (lbm_mode / SSCR1_LBM) for speaker
# playback echo reference:
#
# PCM2 playback ──(5)──> [SSP2 TX -> lbm_mode -> SSP2 RX] ──(12)──┐
# ▼
# DMIC0 RX ───────(8)──────────────────────────────> WEBRTC-AEC ──(7)──> PCM0 capture
#

<searchdir:include>
<searchdir:include/common>
<searchdir:include/components>
<searchdir:include/dais>
<searchdir:include/pipelines/cavs>
<searchdir:platform>
<searchdir:platform/intel>

<vendor-token.conf>
<manifest.conf>
<tokens.conf>
<virtual.conf>
<host-gateway-capture.conf>
<host-gateway-playback.conf>
<io-gateway-capture.conf>
<io-gateway.conf>
<data.conf>
<pcm.conf>
<pcm_caps.conf>
<fe_dai.conf>
<ssp.conf>
<dmic.conf>
<pdm_config.conf>
<intel/hw_config_cardinal_clk.conf>
<route.conf>
<common_definitions.conf>
<dai-copier.conf>
<module-copier.conf>
<pipeline.conf>
<dai.conf>
<host.conf>
<input_pin_binding.conf>
<output_pin_binding.conf>
<input_audio_format.conf>
<output_audio_format.conf>

<webrtc-aec.conf>

Define {
MCLK 24576000
PLATFORM "none"
DMIC_DRIVER_VERSION 1
DMIC_IO_CLK 38400000
DMIC0_ID 6
DMIC0_PCM_ID 0
DMIC0_PCM_NAME "DMIC0"
DMIC0_NAME "dmic01"
SSP2_PCM_NAME "Port2"
AEC_RATE 16000
AEC_BCLK 1024000
AEC_BITS 16
AEC_FMT "S16_LE"
MIC_CH 2
REF_CH 2
}

IncludeByKey.PLATFORM {
"tgl" "platform/intel/tgl.conf"
"adl" "platform/intel/tgl.conf"
"mtl" "platform/intel/mtl.conf"
"lnl" "platform/intel/lnl.conf"
"ptl" "platform/intel/ptl.conf"
"nvl" "platform/intel/ptl.conf" # Note: Assume same configuration as PTL
}

Object.Dai.DMIC [
{
dai_index 0
name $DMIC0_NAME
id $DMIC0_ID
driver_version $DMIC_DRIVER_VERSION
io_clk $DMIC_IO_CLK
sample_rate $AEC_RATE
clk_min 500000
clk_max 4800000
unmute_ramp_time_ms 200
num_pdm_active 2

Object.Base.hw_config.1 {
id 0
name "DMIC0"
}

Object.Base.pdm_config.1 {
mic_a_enable 1
mic_b_enable 1
ctrl_id 0
}
}
]

Object.Dai.SSP [
{
id 2
dai_index 2
direction "duplex"
name "NoCodec-2"
default_hw_conf_id 0
sample_bits 32
quirks "lbm_mode"
io_clk $MCLK
Object.Base.hw_config.1 {
name "SSP2"
id 0
bclk_freq 1024000
fsync_freq 16000
tdm_slot_width 32
Object.Base.link_config.1 { clock_source 1 }
}
}
]

Object.Pipeline.io-gateway [
{
index 6
direction playback
Object.Widget.dai-copier.1 {
dai_index 2 dai_type "SSP" copier_type "SSP"
stream_name "NoCodec-2" node_type $I2S_LINK_OUTPUT_CLASS
num_input_pins 1
num_input_audio_formats 1
Object.Base.input_audio_format [{
in_rate $AEC_RATE in_bit_depth $AEC_BITS in_valid_bit_depth $AEC_BITS
in_channels $REF_CH
}]
num_output_audio_formats 1
Object.Base.output_audio_format [{
out_rate $AEC_RATE out_bit_depth 32 out_valid_bit_depth 32
out_channels $REF_CH
}]
}
}
]

Object.Pipeline.host-gateway-playback [
{
index 5
Object.Widget.host-copier.1 {
stream_name 'SSP2 Playback' pcm_id 2
num_input_audio_formats 1
Object.Base.input_audio_format [{
in_rate $AEC_RATE in_bit_depth $AEC_BITS in_valid_bit_depth $AEC_BITS
in_channels $REF_CH
}]
num_output_audio_formats 1
Object.Base.output_audio_format [{
out_rate $AEC_RATE out_bit_depth $AEC_BITS out_valid_bit_depth $AEC_BITS
out_channels $REF_CH
}]
}
}
]

Object.Pipeline.host-gateway-capture [
{
index 7
Object.Widget.host-copier.1 {
stream_name 'DMIC0 Capture' pcm_id $DMIC0_PCM_ID
num_input_audio_formats 1
Object.Base.input_audio_format [{
in_rate $AEC_RATE in_bit_depth $AEC_BITS in_valid_bit_depth $AEC_BITS
in_channels $MIC_CH
}]
num_output_audio_formats 1
Object.Base.output_audio_format [{
out_rate $AEC_RATE out_bit_depth $AEC_BITS out_valid_bit_depth $AEC_BITS
out_channels $MIC_CH
}]
}
}
]

Object.Pipeline.io-gateway-capture [
{
index 8
direction capture
Object.Widget.dai-copier.1 {
dai_index 0 dai_type "DMIC" type dai_out copier_type "DMIC"
stream_name $DMIC0_NAME node_type $DMIC_LINK_INPUT_CLASS
num_input_audio_formats 1
Object.Base.input_audio_format [{
in_rate $AEC_RATE in_bit_depth 32 in_valid_bit_depth 32
in_channels $MIC_CH
}]
num_output_audio_formats 1
Object.Base.output_audio_format [{
out_rate $AEC_RATE out_bit_depth $AEC_BITS out_valid_bit_depth $AEC_BITS
out_channels $MIC_CH
}]
}
}
{
index 12
direction capture
Object.Widget.dai-copier.1 {
dai_index 2 dai_type "SSP" type dai_out copier_type "SSP"
stream_name "NoCodec-2" node_type $I2S_LINK_INPUT_CLASS
num_input_audio_formats 1
Object.Base.input_audio_format [{
in_rate $AEC_RATE in_bit_depth 32 in_valid_bit_depth 32
in_channels $REF_CH
}]
num_output_audio_formats 1
Object.Base.output_audio_format [{
out_rate $AEC_RATE out_bit_depth $AEC_BITS out_valid_bit_depth $AEC_BITS
out_channels $REF_CH
}]
}
}
]

Object.Widget.webrtc-aec [
{
index 7
name "webrtc-aec.7.1"
num_input_pins 2
num_input_audio_formats 2
num_output_audio_formats 1

Object.Base.input_audio_format [
{
input_pin_index 0
in_rate $AEC_RATE
in_bit_depth $AEC_BITS
in_valid_bit_depth $AEC_BITS
in_channels $MIC_CH
ibs "$[(($in_channels * ($[($in_rate + 999)] / 1000)) * ($in_bit_depth / 8)) * $WEBRTC_AEC_PERIOD_MS]"
}
{
input_pin_index 1
in_rate $AEC_RATE
in_bit_depth $AEC_BITS
in_valid_bit_depth $AEC_BITS
in_channels $REF_CH
ibs "$[(($in_channels * ($[($in_rate + 999)] / 1000)) * ($in_bit_depth / 8)) * $WEBRTC_AEC_PERIOD_MS]"
}
]

Object.Base.output_audio_format [
{
out_rate $AEC_RATE
out_bit_depth $AEC_BITS
out_valid_bit_depth $AEC_BITS
out_channels $MIC_CH
obs "$[(($out_channels * ($[($out_rate + 999)] / 1000)) * ($out_bit_depth / 8)) * $WEBRTC_AEC_PERIOD_MS]"
}
]

Object.Control {
mixer."1" {
name 'DMIC0 Capture AEC Switch'
}
mixer."2" {
name 'DMIC0 Capture AEC Suppression Switch'
}
}

Object.Base.input_pin_binding.1 {
input_pin_binding_name "dai-copier.DMIC.$DMIC0_NAME.capture"
}
Object.Base.input_pin_binding.2 {
input_pin_binding_name "dai-copier.SSP.NoCodec-2.capture"
}
}
]

Object.PCM.pcm [
{
name "$DMIC0_PCM_NAME"
id $DMIC0_PCM_ID
direction "capture"
Object.Base.fe_dai.1 { name "$DMIC0_PCM_NAME" }
Object.PCM.pcm_caps.1 {
direction "capture" name "DMIC0 Capture" formats $AEC_FMT
rate_min $AEC_RATE rate_max $AEC_RATE channels_min $MIC_CH channels_max $MIC_CH
}
}
{
name "$SSP2_PCM_NAME"
id 2
direction "playback"
Object.Base.fe_dai.1 { name "$SSP2_PCM_NAME" }
Object.PCM.pcm_caps.1 {
direction "playback" name "SSP2 Playback" formats $AEC_FMT
rate_min $AEC_RATE rate_max $AEC_RATE channels_min $REF_CH channels_max $REF_CH
}
}
]

Object.Base.route [
{ source "host-copier.2.playback" sink "dai-copier.SSP.NoCodec-2.playback" }
{ source "dai-copier.DMIC.$DMIC0_NAME.capture" sink "webrtc-aec.7.1" }
{ source "dai-copier.SSP.NoCodec-2.capture" sink "webrtc-aec.7.1" }
{ source "webrtc-aec.7.1" sink "host-copier.0.capture" }
]
Loading
Loading