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
4 changes: 4 additions & 0 deletions tools/topology/topology2/cavs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt.bin"

# CAVS SDW topology with passthrough pipelines
"cavs-sdw\;cavs-sdw"

# CAVS SDW with SRC gain and mixer support
"cavs-sdw-src-gain-mixin\;cavs-sdw-src-gain-mixin"

# CAVS SSP topology for TGL
"cavs-nocodec\;cavs-tgl-nocodec\;NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-cavs-tgl-nocodec.bin"
Expand Down
181 changes: 181 additions & 0 deletions tools/topology/topology2/cavs/cavs-sdw-src-gain-mixin.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
<searchdir:cavs>
<searchdir:include>
<searchdir:include/common>
<searchdir:include/components>
<searchdir:include/components/cavs>
<searchdir:include/dais>
<searchdir:include/controls>
<searchdir:include/pipelines/cavs>

<vendor-token.conf>
<tokens.conf>
<virtual.conf>
<src-gain-mixin-playback.conf>
<mixout-gain-dai-copier-playback.conf>
<passthrough-capture.conf>
<passthrough-be.conf>
<data.conf>
<pcm.conf>
<pcm_caps.conf>
<fe_dai.conf>
<alh.conf>
<hw_config.conf>
<manifest.conf>
<route.conf>
<cavs/common_definitions.conf>
<copier.conf>
<pipeline.conf>
<dai.conf>
<host.conf>

Define {
SDW_PLAYBACK_PCM 'SDW0-Playback'
SDW_CAPTURE_PCM 'SDW0-Capture'
PLAYBACK_LINK_ID 0
CAPTURE_LINK_ID 1
}

#
# List of all DAIs
#
#ALH Index: 0, Direction: duplex
Object.Dai {
ALH."2" {
id $PLAYBACK_LINK_ID
direction "playback"
name $SDW_PLAYBACK_PCM
default_hw_conf_id 0
rate 48000
channels 2

Object.Base.hw_config."ALH2" {
id 0
}
}
ALH."3" {
id $CAPTURE_LINK_ID
direction "capture"
name $SDW_CAPTURE_PCM
default_hw_conf_id 1
rate 48000
channels 2

Object.Base.hw_config."ALH3" {
id 1
}
}
}

#
# Pipeline definitions
#

# Pipeline ID:1 PCM ID: 0
Object.Pipeline {
src-gain-mixin-playback."1" {
format "s16le"
index 1

Object.Widget.copier.1.stream_name "Gain Playback 0"
Object.Widget.gain.1{
Object.Control.mixer.1 {
name 'Src Playback Volume'
}
}

}
mixout-gain-dai-copier-playback."3" {
index 2

Object.Widget.pipeline.1 {
stream_name 'copier.ALH.2.1'
}
Object.Widget.copier.1 {
stream_name $SDW_PLAYBACK_PCM
dai_type "ALH"
copier_type "ALH"
type "dai_in"
node_type $ALH_LINK_OUTPUT_CLASS
}

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

format s16le
}

passthrough-capture."4" {
format "s16le"
index 4

Object.Widget.copier.1.stream_name "Passthrough Capture 0"
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.2 {
direction "capture"
index 3
copier_type "ALH"
Object.Widget.pipeline.1 {
stream_name 'copier.ALH.3.1'
}
Object.Widget.copier.1 {
stream_name $SDW_CAPTURE_PCM
dai_type "ALH"
copier_type "ALH"
type "dai_out"
node_type $ALH_LINK_INPUT_CLASS
}
format s16le
}
}

Object.PCM {
pcm."0" {
name "Jack out"
id 0
direction "playback"
Object.Base.fe_dai."Jack out" {}

Object.PCM.pcm_caps."playback" {
name "Gain Playback 0"
formats 'S16_LE,S32_LE'
rate_min 16000
rate_max 48000
}
}
pcm."1" {
name "Jack in"
id 1
direction "capture"
Object.Base.fe_dai."Jack in" {}

Object.PCM.pcm_caps."capture" {
name "Passthrough Capture 0"
formats 'S16_LE,S32_LE'
}
}
}

Object.Base {
route."1" {
source "mixin.1.1"
sink "mixout.2.1"
}

route."2" {
source 'gain.2.1'
sink 'copier.ALH.2.1'
}

route."3" {
source "copier.ALH.3.1"
sink "copier.host.4.1"
}
}
5 changes: 3 additions & 2 deletions tools/topology/topology2/include/common/audio_format.conf
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ Class.Base."audio_format" {
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256)) | ($out_sample_type * 65536)]"

# math expression for computing input/put buffer sizes
ibs "$[($in_channels * ($in_rate / 1000)) * ($in_bit_depth / 8)]"
obs "$[($out_channels * ($out_rate / 1000)) * ($out_bit_depth / 8)]"
# for 11.025 22.05, 44.1, 88.2 and 176.4khz, we need to round it to ceiling value
ibs "$[($in_channels * ($[($in_rate + 999)] / 1000)) * ($in_bit_depth / 8)]"
obs "$[($out_channels * ($[($out_rate + 999)] / 1000)) * ($out_bit_depth / 8)]"
}
96 changes: 96 additions & 0 deletions tools/topology/topology2/include/components/cavs/src.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#
#
# A generic src component. All attributes defined herein are namespaced
# by alsatplg to "Object.Widget.src.N.attribute_name"
#
# Usage: this component can be used by instantiating it in the parent object. i.e.
#
# Object.Widget.src."N" {
# period_sink_count 2
# period_source_count 2
# format "s24le"
# rate_out 48000
# }
#
# Where N is the unique instance number for the src widget within the same alsaconf node.

Class.Widget."src" {
#
# Pipeline ID for the src widget object
#
DefineAttribute."index" {}

#
# object instance
#
DefineAttribute."instance" {}

#include common component definition
<include/components/widget-common.conf>

#
# widget UUID
#
DefineAttribute."uuid" {
type "string"
# Token set reference name and type
token_ref "sof_tkn_comp.uuid"
}

#
# Bespoke attributes
#

# Target sample rate
DefineAttribute."rate_out" {
# Token set reference name and type
token_ref "sof_tkn_src.word"
}

DefineAttribute."num_audio_formats" {
# Token set reference name and type
token_ref "sof_tkn_comp.word"
}

attributes {
#
# The widget name would be constructed using the index and instance attributes.
# For ex: "src.1.1" or "src.10.2" etc.
#
!constructor [
"index"
"instance"
]

!mandatory [
"rate_out"
]

#
# immutable attributes cannot be modified in the object instance
#
!immutable [
"uuid"
"type"
]

#
# deprecated attributes should not be added in the object instance
#
!deprecated [
"preload_count"
]

unique "instance"
}

#
# Default attributes
#
type "src"
# E61BB28D-149A-4C1F-B709-46823EF5F5AE
uuid "8d:b2:1b:e6:9a:14:1f:4c:b7:09:46:82:3e:f5:f5:ae"
no_pm "true"

rate_out 48000
}
Loading