Skip to content

Commit

Permalink
topology2: mtl: Add HDMI-in capture support for SSP-based no-headset …
Browse files Browse the repository at this point in the history
…codec products.

Adding support for the product which doesn't have no ssp-based audio codec
but need to support HDMI audio playback and HDMI-in capture via I2S.

Signed-off-by: Balamurugan C <[email protected]>
  • Loading branch information
CBala21 committed Jan 24, 2024
1 parent ac76b3e commit 0db4292
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 130 deletions.
259 changes: 130 additions & 129 deletions tools/topology/topology2/cavs-es83x6.conf
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ Define {
MCLK 24576000
# override BE link ids
NUM_HDMIS 3
HDMI1_ID 3
HDMI2_ID 4
HDMI3_ID 5
PLATFORM "none"
HEADSET_CODEC_NAME 'SSP1-Codec'
HEADSET_PLAYBACK_PCM_STREAM_NAME 'Headset Playback'
Expand All @@ -76,32 +73,34 @@ IncludeByKey.NUM_HDMIS {
"[3-4]" "platform/intel/hdmi-generic.conf"
}

IncludeByKey.HEADSET_CODEC {
"true" {
#
# List of all DAIs
#
#SSP Index: 0, Direction: duplex
Object.Dai.SSP [
{
id 0
dai_index $HEADSET_SSP_DAI_INDEX
direction "duplex"
name $HEADSET_CODEC_NAME
default_hw_conf_id 0
sample_bits 32
io_clk $MCLK

Object.Base.hw_config.1 {
name $HEADSET_HW_CONFIG_NAME
id 0
bclk_freq 3072000
tdm_slot_width 32
# TODO: remove this. Needs alsaptlg change.
Object.Base.link_config.1 {
clock_source 1
Object.Dai.SSP [
{
id 0
dai_index $HEADSET_SSP_DAI_INDEX
direction "duplex"
name $HEADSET_CODEC_NAME
default_hw_conf_id 0
sample_bits 32
io_clk $MCLK

Object.Base.hw_config.1 {
name $HEADSET_HW_CONFIG_NAME
id 0
bclk_freq 3072000
tdm_slot_width 32
# TODO: remove this. Needs alsaptlg change.
Object.Base.link_config.1 {
clock_source 1
}
}
}
}
}
]
]

#
# Pipeline definitions
Expand All @@ -111,121 +110,123 @@ Object.Dai.SSP [
# SSP1 ----> PCM0

# Pipeline ID:1 PCM ID: 0
Object.Pipeline {
# playback pipelines
host-copier-gain-mixin-playback [
{
index 1

Object.Widget.host-copier.1 {
stream_name '$HEADSET_PLAYBACK_PCM_STREAM_NAME'
pcm_id $HEADSET_PCM_ID
}
Object.Widget.gain.1 {
Object.Control.mixer.1 {
name 'Playback Volume 1'
Object.Pipeline {
# playback pipelines
host-copier-gain-mixin-playback [
{
index 1

Object.Widget.host-copier.1 {
stream_name '$HEADSET_PLAYBACK_PCM_STREAM_NAME'
pcm_id $HEADSET_PCM_ID
}
Object.Widget.gain.1 {
Object.Control.mixer.1 {
name 'Playback Volume 1'
}
}
}
}
}
]

mixout-gain-dai-copier-playback [
{
index 2

Object.Widget.dai-copier.1 {
dai_index $HEADSET_SSP_DAI_INDEX
dai_type "SSP"
copier_type "SSP"
stream_name "$HEADSET_CODEC_NAME"
node_type $I2S_LINK_OUTPUT_CLASS
}
]

mixout-gain-dai-copier-playback [
{
index 2

Object.Widget.dai-copier.1 {
dai_index $HEADSET_SSP_DAI_INDEX
dai_type "SSP"
copier_type "SSP"
stream_name "$HEADSET_CODEC_NAME"
node_type $I2S_LINK_OUTPUT_CLASS
}

Object.Widget.gain.1 {
Object.Control.mixer.1 {
name 'Main Playback Volume 2'
Object.Widget.gain.1 {
Object.Control.mixer.1 {
name 'Main Playback Volume 2'
}
}
}
}
}
]
]

host-gateway-capture [
{
index 5
host-gateway-capture [
{
index 5

Object.Widget.host-copier.1 {
stream_name '$HEADSET_CAPTURE_PCM_STREAM_NAME'
pcm_id $HEADSET_PCM_ID
}
}
]

io-gateway-capture [
{
index 6

Object.Widget.dai-copier."1" {
dai_index $HEADSET_SSP_DAI_INDEX
dai_type "SSP"
type dai_out
copier_type "SSP"
stream_name "$HEADSET_CODEC_NAME"
node_type $I2S_LINK_INPUT_CLASS
Object.Base.input_audio_format [
{
in_bit_depth 32
in_valid_bit_depth 32
Object.Widget.host-copier.1 {
stream_name '$HEADSET_CAPTURE_PCM_STREAM_NAME'
pcm_id $HEADSET_PCM_ID
}
]
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 32
}
]

io-gateway-capture [
{
index 6

Object.Widget.dai-copier."1" {
dai_index $HEADSET_SSP_DAI_INDEX
dai_type "SSP"
type dai_out
copier_type "SSP"
stream_name "$HEADSET_CODEC_NAME"
node_type $I2S_LINK_INPUT_CLASS
Object.Base.input_audio_format [
{
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
]
}
}
]
}
]
}

Object.PCM.pcm [
{
name "$HEADSET_PCM_NAME"
id $HEADSET_PCM_ID
direction "duplex"
Object.Base.fe_dai.1 {
name "$HEADSET_PCM_NAME"
}
Object.PCM.pcm [
{
name "$HEADSET_PCM_NAME"
id $HEADSET_PCM_ID
direction "duplex"
Object.Base.fe_dai.1 {
name "$HEADSET_PCM_NAME"
}

Object.PCM.pcm_caps.1 {
direction "playback"
name "$HEADSET_PLAYBACK_PCM_STREAM_NAME"
formats 'S16_LE,S24_LE,S32_LE'
}
Object.PCM.pcm_caps.1 {
direction "playback"
name "$HEADSET_PLAYBACK_PCM_STREAM_NAME"
formats 'S16_LE,S24_LE,S32_LE'
}

Object.PCM.pcm_caps.2 {
direction "capture"
name "$HEADSET_CAPTURE_PCM_STREAM_NAME"
formats 'S16_LE,S24_LE,S32_LE'
}
}
]
Object.PCM.pcm_caps.2 {
direction "capture"
name "$HEADSET_CAPTURE_PCM_STREAM_NAME"
formats 'S16_LE,S24_LE,S32_LE'
}
}
]

Object.Base.route [
{
source "gain.2.1"
sink "dai-copier.SSP.$HEADSET_CODEC_NAME.playback"
}
{
source "mixin.1.1"
sink "mixout.2.1"
}
{
source "dai-copier.SSP.$HEADSET_CODEC_NAME.capture"
sink "host-copier.$HEADSET_PCM_ID.capture"
}
{
source "host-copier.$HEADSET_PCM_ID.playback"
sink "gain.1.1"
Object.Base.route [
{
source "gain.2.1"
sink "dai-copier.SSP.$HEADSET_CODEC_NAME.playback"
}
{
source "mixin.1.1"
sink "mixout.2.1"
}
{
source "dai-copier.SSP.$HEADSET_CODEC_NAME.capture"
sink "host-copier.$HEADSET_PCM_ID.capture"
}
{
source "host-copier.$HEADSET_PCM_ID.playback"
sink "gain.1.1"
}
]
}
]
}
8 changes: 7 additions & 1 deletion tools/topology/topology2/production/tplg-targets-ace1.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ GOOGLE_RTC_AEC_SUPPORT=1,DEEP_BUF_SPK=true,PLAYBACK_PIPELINE_SRC=dts"
#ES83x6+HDMI-IN
"cavs-es83x6\;sof-mtl-es83x6-ssp1-hdmi-ssp02\;PLATFORM=mtl,PREPROCESS_PLUGINS=nhlt,\
NHLT_BIN=nhlt-sof-mtl-es83x6-ssp1-hdmi-ssp02.bin,HEADSET_SSP_DAI_INDEX=1,\
HEADSET_CODEC_NAME=SSP1-Codec,HDMI_IN_CAPTURE=true"
HEADSET_CODEC=true,HEADSET_CODEC_NAME=SSP1-Codec,HDMI1_ID=3,HDMI2_ID=4,HDMI3_ID=5,\
HDMI_IN_CAPTURE=true"

#No HeadsetCodec+HDMI-IN
"cavs-es83x6\;sof-mtl-hdmi-ssp02\;PLATFORM=mtl,PREPROCESS_PLUGINS=nhlt,\
NHLT_BIN=nhlt-sof-mtl-hdmi-ssp02.bin,HEADSET_CODEC=false,HDMI_IN_CAPTURE=true,\
HDMI_IN_1_ID=0,HDMI_IN_2_ID=1"

# SDW + DMIC + HDMI
"cavs-sdw\;sof-mtl-sdw-cs42l42-l0-max98363-l2\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\
Expand Down

0 comments on commit 0db4292

Please sign in to comment.