topology2: cavs-sdw: add Speaker and Microphone pcm

Add Speaker PCM to cavs-sdw topology. We need to set NUM_SDW_AMPS=1 in
CMakeLists.txt if there is only one amplifier in the device and set
NUM_SDW_AMPS=2 if there are two amplifiers.
Set SDW_DMIC=1 if there is a SDW DMIC, like rt714 in the device.
The 2nd ALH copier stream name should be the same as the 1st ALH
copier, and no need to connect to the route.
The 2nd ALH copier data will be set to the 1st ALH copier's gateway config
in the aggregated mode.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
This commit is contained in:
Bard Liao 2022-10-13 18:32:07 +08:00 committed by Liam Girdwood
parent 1faf055755
commit 113064cbf7
5 changed files with 188 additions and 0 deletions

View File

@ -17,6 +17,18 @@ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-4ch.bin,USE_CHAIN_DMA=true
# CAVS SDW topology with passthrough pipelines
"cavs-sdw\;cavs-sdw\;DEEPBUFFER_FW_DMA_MS=100"
# IPC4 topology for TGL rt711 Headset + rt1316 Amplifier + rt714 DMIC
"cavs-sdw\;sof-tgl-rt711-rt1316-rt714\;NUM_SDW_AMPS=2,SDW_DMIC=1"
# IPC4 topology for TGL rt711 Headset + rt1308 Amplifier + rt715 DMIC
"cavs-sdw\;sof-tgl-rt715-rt711-rt1308-mono\;NUM_SDW_AMPS=1,SDW_DMIC=1,\
SDW_JACK_OUT_STREAM=SDW1-Playback,SDW_JACK_IN_STREAM=SDW1-Capture,\
SDW_SPK_STREAM=SDW2-Playback,SDW_DMIC_STREAM=SDW0-Capture"
# IPC4 topology for TGL rt711 Headset + rt1308 Amplifier + PCH DMIC
"cavs-sdw\;sof-tgl-rt711-rt1308-4ch\;NUM_SDW_AMPS=1,NUM_DMICS=4,DMIC0_ID=3,\
DMIC1_ID=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1"
# CAVS SDW with SRC gain and mixer support
"cavs-sdw-src-gain-mixin\;cavs-sdw-src-gain-mixin"

View File

@ -59,6 +59,8 @@ Define {
SDW_JACK_IN_STREAM 'SDW0-Capture'
SDW_JACK_OUT_BE_ID 0
SDW_JACK_IN_BE_ID 1
NUM_SDW_AMPS 0
SDW_DMIC 0
}
# include DMIC config if needed.
@ -80,6 +82,14 @@ IncludeByKey.DEEPBUFFER_FW_DMA_MS{
"[1-1000]" "platform/intel/deep-buffer.conf"
}
IncludeByKey.NUM_SDW_AMPS {
"[1-2]" "platform/intel/sdw-amp-generic.conf"
}
IncludeByKey.SDW_DMIC {
"1" "platform/intel/sdw-dmic-generic.conf"
}
#
# List of all DAIs
#

View File

@ -0,0 +1,15 @@
Object.Pipeline {
passthrough-be.$ALH_2ND_SPK_ID {
direction "playback"
index $ALH_2ND_SPK_ID
copier_type "ALH"
Object.Widget.copier.1 {
stream_name $SDW_SPK_STREAM
dai_type "ALH"
copier_type "ALH"
type "dai_in"
node_type $ALH_LINK_OUTPUT_CLASS
}
}
}

View File

@ -0,0 +1,84 @@
# route and pipeline index start from pcm id * 10
Define {
SDW_SPK_STREAM 'SDW1-Playback'
ALH_2ND_SPK_ID 22
SDW_AMP_BE_ID 2
}
Object.Dai {
ALH."514" {
id $SDW_AMP_BE_ID
direction "playback"
name $SDW_SPK_STREAM
default_hw_conf_id 0
rate 48000
channels 2
Object.Base.hw_config."ALH514" {
id 0
}
}
}
Object.Pipeline {
host-copier-gain-mixin-playback.20 {
index 20
Object.Widget.copier.1 {
stream_name "sdw amplifiers"
}
Object.Widget.gain.1 {
Object.Control.mixer.1 {
name 'Amplifier Volume'
}
}
}
mixout-gain-dai-copier-playback.21 {
index 21
Object.Widget.copier.1 {
stream_name $SDW_SPK_STREAM
dai_type "ALH"
copier_type "ALH"
node_type $ALH_LINK_OUTPUT_CLASS
}
Object.Widget.gain.1 {
Object.Control.mixer.1 {
name 'Main Amplifier Volume'
}
}
}
}
IncludeByKey.NUM_SDW_AMPS {
"2" "platform/intel/alh-2nd-spk.conf"
}
Object.PCM {
pcm.2 {
name "Speaker"
id 2
direction "playback"
Object.Base.fe_dai."Speaker" {}
Object.PCM.pcm_caps."playback" {
name "sdw amplifiers"
formats 'S16_LE,S24_LE,S32_LE'
}
}
}
Object.Base {
route.20 {
source "gain.21.1"
sink "copier.ALH.21.1"
}
route.21 {
source 'mixin.20.1'
sink 'mixout.21.1'
}
}

View File

@ -0,0 +1,67 @@
# route and pipeline index start from pcm id * 10
Define {
SDW_DMIC_STREAM 'SDW3-Capture'
SDW_DMIC_BE_ID 4
}
Object.Dai {
ALH."771" {
id $SDW_DMIC_BE_ID
direction "capture"
name $SDW_DMIC_STREAM
default_hw_conf_id 0
rate 48000
channels 2
Object.Base.hw_config."ALH771" {
id 0
}
}
}
Object.Pipeline {
passthrough-capture.40 {
index 40
Object.Widget.copier.1.stream_name "sdw dmic"
Object.Widget.copier.1.Object.Base.audio_format.1 {
# 32 -> 16 bits conversion is done here,
# so in_bit_depth is 32 (and out_bit_depth is 16).
in_bit_depth 32
}
}
passthrough-be.41 {
direction "capture"
index 41
copier_type "ALH"
Object.Widget.copier.1 {
stream_name $SDW_DMIC_STREAM
dai_type "ALH"
copier_type "ALH"
type "dai_out"
node_type $ALH_LINK_INPUT_CLASS
}
}
}
Object.PCM {
pcm.4 {
name "Microphone"
id 4
direction "capture"
Object.Base.fe_dai."SDW DMIC" {}
Object.PCM.pcm_caps."capture" {
name "sdw dmic"
formats 'S16_LE,S24_LE,S32_LE'
}
}
}
Object.Base {
route.40 {
source "copier.ALH.41.1"
sink "copier.host.40.1"
}
}