Skip to content

Commit

Permalink
topology2: dts: add dts support
Browse files Browse the repository at this point in the history
This commit adds the topology2 file for DTS. The processing chain is EQ IIR - DTS.

The topology file with DTS is sof-mtl-max98357a-rt5682-ssp2-ssp0-dts.tplg.

Signed-off-by: Joe Cheng <[email protected]>
Signed-off-by: Mac Chian <[email protected]>
  • Loading branch information
joechengxperi authored and macchian committed Oct 6, 2023
1 parent e08b2c2 commit 0fc62e7
Show file tree
Hide file tree
Showing 6 changed files with 547 additions and 58 deletions.
2 changes: 1 addition & 1 deletion rimage
Submodule rimage updated 2 files
+135 −91 config/mtl.toml
+1 −1 src/manifest.c
221 changes: 164 additions & 57 deletions tools/topology/topology2/cavs-rt5682.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<io-gateway-capture.conf>
<host-copier-gain-mixin-playback.conf>
<mixout-gain-dai-copier-playback.conf>
<mixout-gain-eqiir-dts-dai-copier-playback.conf>
<deepbuffer-playback.conf>
<dai-copier-be.conf>
<dai-copier-eqiir-module-copier-capture.conf>
Expand Down Expand Up @@ -87,6 +88,7 @@ Define {
INCLUDE_ECHO_REF false
ECHO_REF_HOST_PIPELINE_ID 7
ECHO_REF_DAI_PIPELINE_ID 8
ECHO_REF_COPIER_MODULE 'module-copier.8.2'
ECHO_REF_PCM_ID 29
ECHO_REF_CORE_ID 0
# override BT default definitions
Expand All @@ -95,16 +97,14 @@ Define {
BT_PB_DAI_PIPELINE_SRC "copier.host.9.1"
BT_PB_PIPELINE_STREAM_NAME "dai-copier.SSP.10.1"
GOOGLE_RTC_AEC_SUPPORT 0
GOOGLE_RTC_AEC_REF_SOURCE 'module-copier.8.2'
GOOGLE_AEC_CORE_ID 0
HEADSET_PCM_NAME "Headset"
HEADSET_PCM_ID 0
SPEAKER_PCM_NAME "Speakers"
SPEAKER_PCM_ID 1
INCLUDE_BT_OFFLOAD true
GOOGLE_AEC_HOST_PIPELINE_PRIORITY 3
GOOGLE_AEC_PIPELINE_PRIORITY 2
DMIC_PIPELINE_PRIORITY 1
ECHO_REF_PIPELINE_PRIORITY 0
DTS_SUPPORT false
}

# override defaults with platform-specific config
Expand Down Expand Up @@ -140,6 +140,7 @@ IncludeByKey.INCLUDE_BT_OFFLOAD {
"true" "platform/intel/bt-generic.conf"
}


#
# List of all DAIs
#
Expand Down Expand Up @@ -201,6 +202,10 @@ Object.Dai.SSP [
# PCM0 ---> gain ----> Mixin ----> Mixout ----> gain ----> SSP0
# PCM1 ---> gain ----> Mixin ----> Mixout ----> gain ----> SSP1
#
# If DTS_SUPPORT is true
# PCM0 ---> gain ----> Mixin ----> Mixout ----> gain ----> EQ IIR ----> DTS ----> SSP0
# PCM1 ---> gain ----> Mixin ----> Mixout ----> gain ----> EQ IIR ----> DTS ----> SSP1
#
# SSP0 ----> PCM0
# SSP1 ----> PCM1

Expand Down Expand Up @@ -236,42 +241,109 @@ Object.Pipeline {
}
]

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 'Post Mixer $HEADSET_PCM_NAME Playback Volume'
}
}
}
{
index 4

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

Object.Widget.gain.1 {
Object.Control.mixer.1 {
name 'Post Mixer $SPEAKER_PCM_NAME Playback Volume'
}
}
}
]
IncludeByKey.DTS_SUPPORT {
"false" {
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 'Post Mixer $HEADSET_PCM_NAME Playback Volume'
}
}
}
{
index 4

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

Object.Widget.gain.1 {
Object.Control.mixer.1 {
name 'Post Mixer $SPEAKER_PCM_NAME Playback Volume'
}
}
}
]
}
"true" {
mixout-gain-eqiir-dts-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 'Post Mixer $HEADSET_PCM_NAME Playback Volume'
}
}

Object.Widget.eqiir.1 {
Object.Control.bytes."1" {
name 'EQIIR2.0 eqiir_coef_2'
}
}

Object.Widget.dts.1 {
Object.Control.bytes."1" {
name 'CODEC_ADAPTER2.0 DTS Codec Setup 2'
}
}
}
{
index 4

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

Object.Widget.gain.1 {
Object.Control.mixer.1 {
name 'Post Mixer $SPEAKER_PCM_NAME Playback Volume'
}
}

Object.Widget.eqiir.1 {
Object.Control.bytes."1" {
name 'EQIIR1.0 eqiir_coef_1'
}
}

Object.Widget.dts.1 {
Object.Control.bytes."1" {
name 'CODEC_ADAPTER1.0 DTS Codec Setup 1'
}
}

}
]
}
}

host-gateway-capture [
{
Expand Down Expand Up @@ -349,23 +421,58 @@ Object.PCM.pcm [
}
]

IncludeByKey.DTS_SUPPORT {
"false" {
Object.Base.route [
{
source "gain.2.1"
sink "dai-copier.SSP.$HEADSET_CODEC_NAME.playback"
}
{
source "mixin.1.1"
sink "mixout.2.1"
}
{
source "gain.4.1"
sink "dai-copier.SSP.$SPEAKER_CODEC_NAME.playback"
}
{
source "mixin.3.1"
sink "mixout.4.1"
}
]
}
"true" {
Object.Base.route [
{
source "gain.2.1"
sink "eqiir.2.1"
}
{
source "dts.2.1"
sink "dai-copier.SSP.$HEADSET_CODEC_NAME.playback"
}
{
source "mixin.1.1"
sink "mixout.2.1"
}
{
source "gain.4.1"
sink "eqiir.4.1"
}
{
source "dts.4.1"
sink "dai-copier.SSP.$SPEAKER_CODEC_NAME.playback"
}
{
source "mixin.3.1"
sink "mixout.4.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 "gain.4.1"
sink "dai-copier.SSP.$SPEAKER_CODEC_NAME.playback"
}
{
source "mixin.3.1"
sink "mixout.4.1"
}
{
source "dai-copier.SSP.$HEADSET_CODEC_NAME.capture"
sink "host-copier.$HEADSET_PCM_ID.capture"
Expand All @@ -374,7 +481,7 @@ Object.Base.route [
source "host-copier.$HEADSET_PCM_ID.playback"
sink "gain.1.1"
}
{
{
source "host-copier.$SPEAKER_PCM_ID.playback"
sink "gain.3.1"
}
Expand Down
101 changes: 101 additions & 0 deletions tools/topology/topology2/include/components/dts.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#
# Common widget dts
#
# A generic dts widget. All attributes defined herein are namespaced
# by alsatplg to "Object.Widget.dts.N.attribute_name"
#
# Usage: this component can be used by instantiating it in the parent object. i.e.
#
# Object.Widget.dts."N" {
# index 1
# type "effect"
# }
#
# Where N is the unique instance number for the smart_amp object within the same alsaconf node.

Class.Widget."dts" {
#
# Pipeline ID for the DTS widget object
#
DefineAttribute."index" {
type "integer"
}

#
# Unique instance for DTS widget
#
DefineAttribute."instance" {
type "integer"
}

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

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

DefineAttribute."cpc" {
# Token set reference name and type
token_ref "comp.word"
}

DefineAttribute."is_pages" {
# Token set reference name and type
token_ref "comp.word"
}

# Attribute categories
attributes {
#
# The DTS widget name would be constructed using the index and instance attributes.
#
!constructor [
"index"
"instance"
]

#
# mandatory attributes that must be provided when the class is instantiated
#
!mandatory [
"no_pm"
"uuid"
"num_input_audio_formats"
"num_output_audio_formats"
]

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

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

#
# DTS widget objects instantiated within the same alsaconf node must have unique
# instance attribute
#
unique "instance"
}

# Default attribute values for dts widget

# UUID can be overridden in the top-level topology file
uuid "4f:c3:5f:d9:0f:37:c7:4a:bc:86:bf:dc:5b:e2:41:e6"
type "effect"
no_pm "true"
cpc 5000
is_pages 1
core_id 0
num_input_pins 1
num_output_pins 1
}
Loading

0 comments on commit 0fc62e7

Please sign in to comment.