topology2: ipc4: add mixin & mixout support

Also add a simple pipeline used by windows. A normal
playback pipeline is : copier -> mixin -> mixout -> gain -> copier

Signed-off-by: Rander Wang <rander.wang@intel.com>
This commit is contained in:
Rander Wang 2021-08-25 10:49:39 +08:00 committed by Liam Girdwood
parent 4d4fd8c426
commit 0fefcc8bdf
6 changed files with 577 additions and 0 deletions

View File

@ -0,0 +1,238 @@
<include/common/vendor-token.conf>
<include/common/tokens.conf>
<include/components/host.conf>
<include/components/gain.conf>
<include/components/mixin.conf>
<include/components/mixout.conf>
<include/components/pipeline.conf>
<include/pipelines/cavs/mixin-playback.conf>
<include/pipelines/cavs/mixout-gain-playback.conf>
<include/pipelines/cavs/gain-capture.conf>
<include/controls/mixer.conf>
<include/controls/bytes.conf>
<include/components/copier.conf>
<include/components/virtual.conf>
<include/common/data.conf>
<include/common/pcm.conf>
<include/common/pcm_caps.conf>
<include/common/fe_dai.conf>
<include/dais/hda.conf>
<include/dais/hw_config.conf>
<include/common/manifest.conf>
<include/common/pcm.conf>
<include/common/fe_dai.conf>
<include/common/pcm_caps.conf>
<include/common/route.conf>
# a typical windows playback pipeline
# pipeline 1 --------------- pipeline 2
# copier -> mixin --------------> mixout -> gain -> copier
Object.Dai {
HDA.0 {
name 'Analog Playback and Capture'
id 4
index 0
default_hw_conf_id 4
Object.Base.hw_config.HDA0 [
]
Object.Widget.copier.0 {
direction playback
index 1
dai_index 1
type dai_in
dai_type "HDA"
copier_type "HDA"
stream_name 'Analog Playback and Capture'
period_sink_count 0
period_source_count 2
format s32le
}
Object.Widget.copier.1 {
direction capture
index 2
dai_index 2
type dai_out
dai_type "HDA"
copier_type "HDA"
stream_name 'Analog Playback and Capture'
dai_index 1
period_sink_count 2
period_source_count 0
format s32le
}
direction duplex
}
}
Object.Pipeline {
mixin-playback.1 {
Object.Widget.pipeline.1 {
stream_name 'mixin.playback'
}
Object.Widget.copier.1{
stream_name 'Gain Playback 0'
}
Object.Widget.mixin.1{
}
format s16le
}
gain-capture.2 {
Object.Widget.pipeline.1 {
stream_name 'copier.HDA.1.capture'
}
Object.Widget.copier.1{
stream_name 'Gain Capture 0'
}
Object.Widget.gain.1{
Object.Control.mixer.1 {
name 'Main gain capture 0'
}
}
format s16le
}
}
Object.Pipeline {
mixout-gain-playback.3 {
Object.Widget.pipeline.1 {
stream_name 'copier.HDA.0.playback'
}
Object.Widget.mixout.1{
}
Object.Widget.gain.1{
Object.Control.mixer.1 {
name 'Main gain playback 0'
}
}
format s16le
}
}
Object.PCM {
pcm.0 {
name 'HDA Analog'
Object.Base.fe_dai.'HDA Analog' [
]
Object.PCM.pcm_caps.playback {
name 'Gain Playback 0'
formats 'S32_LE,S16_LE'
}
Object.PCM.pcm_caps.capture {
name 'Gain Capture 0'
formats 'S32_LE,S16_LE'
}
direction duplex
}
}
Object.Base.route.1 {
source 'copier.host.1.1'
sink 'mixin.1.1'
}
Object.Base.route.2 {
source 'mixin.1.1'
sink 'mixout.3.1'
}
Object.Base.route.3 {
source 'mixout.3.1'
sink 'gain.3.1'
}
Object.Base.route.4 {
source 'gain.3.1'
sink 'copier.HDA.1.0'
}
Object.Base.route.5 {
source 'copier.HDA.2.1'
sink 'gain.2.1'
}
Object.Base.route.6 {
source 'gain.2.1'
sink 'copier.host.2.1'
}
Object.Widget.virtual {
codec0_in {
type input
index 1
}
codec1_in {
type input
index 2
}
codec0_out {
type output
index 3
}
codec1_out {
type output
index 4
}
codec2_in {
type input
index 5
}
codec2_out {
type output
index 6
}
iDisp1_out {
type output
index 7
}
iDisp2_out {
type output
index 8
}
iDisp3_out {
type output
index 9
}
'iDisp3 Tx' {
type out_drv
index 0
}
'iDisp2 Tx' {
type out_drv
index 1
}
'iDisp1 Tx' {
type out_drv
index 2
}
'Analog CPU Playback' {
type out_drv
index 3
}
'Digital CPU Playback' {
type out_drv
index 4
}
'Alt Analog CPU Playback' {
type out_drv
index 5
}
'Analog CPU Capture' {
type input
index 6
}
'Digital CPU Capture' {
type input
index 7
}
'Alt Analog CPU Capture' {
type input
index 8
}
}

View File

@ -108,4 +108,7 @@ Object.Base.VendorToken {
channels 1401
}
"sof_tkn_mixinout" {
mix_type 1700
}
}

View File

@ -0,0 +1,100 @@
#
# Common widget mixin
#
# A generic mixin widget. All attributes defined herein are namespaced
# by alsatplg to "Object.Widget.mixin.N.attribute_name"
#
# Usage: this component can be used by instantiating it in the parent object. i.e.
#
# Object.Widget.mixin."N" {
# type "mixer"
# mix_type "mix_in"
# }
#
# Where N is the unique instance number for the mixin object within the same alsaconf node.
Class.Widget."mixin" {
#
# Pipeline ID for the mixin object
#
DefineAttribute."index" {}
#
# Mixin object instance
#
DefineAttribute."instance" {}
DefineAttribute."mix_type" {
type "string"
token_ref "sof_tkn_mixinout.word"
constraints {
!valid_values [
"mix_in"
"mix_out"
]
!tuple_values [
0
1
]
}
}
#include common component definition
<include/components/widget-common.conf>
#
# Copier component UUID
#
DefineAttribute."uuid" {
type "string"
# Token set reference name and type
token_ref "sof_tkn_comp.uuid"
}
attributes {
#
# The mixin widget name would be constructed using the index and
# instance attributes. For ex: "mixin.0.1".
#
!constructor [
"index"
"instance"
]
#
# mandatory attributes that must be provided when the class is instantiated
#
!mandatory [
"no_pm"
"uuid"
"mix_type"
]
#
# immutable attributes cannot be modified in the object instance
#
!immutable [
"uuid"
]
#
# deprecated attributes should not be added in the object instance
#
!deprecated [
"preload_count"
]
unique "instance"
}
#
# Default attributes for mixin
#
type "mixer"
mix_type "mix_in"
#UUID: 39656EB2-3B71-4049-8D3F-F92CD5C43C09
uuid "b2:6e:65:39:71:3b:49:40:8d:3f:f9:2c:d5:c4:3c:09"
no_pm "true"
core_id 0
}

View File

@ -0,0 +1,100 @@
#
# Common widget mixout
#
# A generic mixout widget. All attributes defined herein are namespaced
# by alsatplg to "Object.Widget.mixout.N.attribute_name"
#
# Usage: this component can be used by instantiating it in the parent object. i.e.
#
# Object.Widget.mixout."N" {
# type "mixer"
# mix_type "mix_out"
# }
#
# Where N is the unique instance number for the mixout object within the same alsaconf node.
Class.Widget."mixout" {
#
# Pipeline ID for the mixout object
#
DefineAttribute."index" {}
#
# Mixout object instance
#
DefineAttribute."instance" {}
DefineAttribute."mix_type" {
type "string"
token_ref "sof_tkn_mixinout.word"
constraints {
!valid_values [
"mix_in"
"mix_out"
]
!tuple_values [
0
1
]
}
}
#include common component definition
<include/components/widget-common.conf>
#
# Copier component UUID
#
DefineAttribute."uuid" {
type "string"
# Token set reference name and type
token_ref "sof_tkn_comp.uuid"
}
attributes {
#
# The mixout widget name would be constructed using the index and
# instance attributes. For ex: "mixout.0.1".
#
!constructor [
"index"
"instance"
]
#
# mandatory attributes that must be provided when the class is instantiated
#
!mandatory [
"no_pm"
"uuid"
"mix_type"
]
#
# immutable attributes cannot be modified in the object instance
#
!immutable [
"uuid"
]
#
# deprecated attributes should not be added in the object instance
#
!deprecated [
"preload_count"
]
unique "instance"
}
#
# Default attributes for mixout
#
type "mixer"
mix_type "mix_out"
#UUID: 3C56505A-24D7-418F-BDDC-C1F5A3AC2AE0
uuid "5a:50:56:3c:d7:24:8f:41:bd:dc:c1:f5:a3:ac:2a:e0"
no_pm "true"
core_id 0
}

View File

@ -0,0 +1,69 @@
#
# windows normal playback pipeline
#
# A windows pipeline. All attributes defined herein are namespaced
# by alsatplg to "Object.Pipeline.mixin-playback.N.attribute_name"
#
# Usage: mixin-playback pipeline object can be instantiated as:
#
# Object.Pipeline.mixin-playback."N" {
# format "s16le"
# period 1000
# time_domain "timer"
# channels 2
# rate 48000
# }
#
# Where N is the unique pipeline ID within the same alsaconf node.
#
Class.Pipeline."mixin-playback" {
DefineAttribute."index" {}
<include/pipelines/pipeline-common.conf>
attributes {
!constructor [
"index"
]
!mandatory [
"format"
]
!immutable [
"direction"
]
#
# mixin-playback objects instantiated within the same alsaconf node must have
# unique pipeline_id attribute
#
unique "index"
}
Object.Widget {
copier."1" {
copier_type "host"
type "aif_in"
}
mixin."1" {
}
pipeline."1" {
priority 0
lp_mode 0
}
}
direction "playback"
time_domain "timer"
channels 2
channels_min 2
channels_max 2
rate 48000
rate_min 48000
rate_max 48000
}

View File

@ -0,0 +1,67 @@
#
# windows mixout-gain playback pipeline
#
# A windows pipeline. All attributes defined herein are namespaced
# by alsatplg to "Object.Pipeline.mixout-gain-playback.N.attribute_name"
#
# Usage: mixout-gain-playback pipeline object can be instantiated as:
#
# Object.Pipeline.mixout-gain-playback."N" {
# format "s16le"
# period 1000
# time_domain "timer"
# channels 2
# rate 48000
# }
#
# Where N is the unique pipeline ID within the same alsaconf node.
#
Class.Pipeline."mixout-gain-playback" {
DefineAttribute."index" {}
<include/pipelines/pipeline-common.conf>
attributes {
!constructor [
"index"
]
!mandatory [
"format"
]
!immutable [
"direction"
]
#
# mixout-gain-playback objects instantiated within the same alsaconf node must have
# unique pipeline_id attribute
#
unique "index"
}
Object.Widget {
mixout."1" {
}
gain."1" {
}
pipeline."1" {
priority 0
lp_mode 0
}
}
direction "playback"
time_domain "timer"
channels 2
channels_min 2
channels_max 2
rate 48000
rate_min 48000
rate_max 48000
}