Skip to content

Commit

Permalink
topology2: add topology for imx8MP
Browse files Browse the repository at this point in the history
Add playback topology for i.MX8MP with wm8960 codec

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
  • Loading branch information
iuliana-prodan authored and kv2019i committed Feb 21, 2024
1 parent b398933 commit 3ab82dc
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 0 deletions.
127 changes: 127 additions & 0 deletions tools/topology/topology2/imx8-wm8960.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
##
## Example topology for i.MX8MP board with 'CODEC' codec
##
## (source) host-copier.N.playback -> gain.N.1 -> dai-copier.SAI_DAI_INDEX(sink endpoint)
##

# Include paths
<searchdir:include>
<searchdir:include/common>
<searchdir:include/components>
<searchdir:include/controls>
<searchdir:include/dais>
<searchdir:include/pipelines>

# Include class definitions
<vendor-token.conf>
<hw_config_simple.conf>
<tokens.conf>
<dai.conf>
<data.conf>
<pcm.conf>
<pcm_caps.conf>
<fe_dai.conf>
<sai.conf>
<manifest.conf>
<route.conf>
<pipeline.conf>
<gain-playback.conf>
<dai-copier.conf>
<host-copier.conf>
<common_definitions.conf>

Define {
HEADSET_PLAYBACK_PCM_STREAM_NAME "Headset Playback"
HEADSET_PCM_NAME "Headset"
HEADSET_PCM_ID 0
}

#
# Pipeline definitions
#
# (source) host.N.playback -> gain.N.1
#
Object.Pipeline {
gain-playback [
{
index 1

Object.Widget.host-copier.1 {
stream_name $HEADSET_PLAYBACK_PCM_STREAM_NAME
pcm_id $HEADSET_PCM_ID
}

Object.Widget.gain.1 {
curve_type "windows_fade"
Object.Control.mixer.1 {
name 'Playback Volume'
}
}

time_domain "dma"
format "s32le"
num_input_audio_formats 3
num_output_audio_formats 1
}
]
}

Object.Widget {
dai-copier."1" {
dai_index $SAI_DAI_INDEX
dai_type "SAI"
copier_type "SAI"
stream_name $STREAM_CODEC_NAME
node_type $I2S_LINK_OUTPUT_CLASS
type dai_in
num_input_audio_formats 1
num_output_audio_formats 1
num_input_pins 1
direction "playback"

# copier only supports one format based on mixin/mixout requirements: 32-bit 48KHz 2ch
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
}
]
}
}

# PCM Definitions
Object.PCM.pcm [
{
name $HEADSET_PCM_NAME
direction "playback"
id $HEADSET_PCM_ID

Object.Base.fe_dai.1 {
name "$HEADSET_PCM_NAME"
}

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

# Top-level pipeline connection
# gain.1. -> dai.SAI.1.playback
Object.Base.route [
{
source "host-copier.$HEADSET_PCM_ID.playback"
sink "gain.1.1"
}
{
source "gain.1.1"
sink "dai-copier.SAI.$STREAM_CODEC_NAME.playback"
}
]
1 change: 1 addition & 0 deletions tools/topology/topology2/production/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include(tplg-targets-hda-generic.cmake)
include(tplg-targets-cavs25.cmake)
include(tplg-targets-ace1.cmake)
include(tplg-targets-ace2.cmake)
include(tplg-targets-imx8.cmake)

add_custom_target(topology2_prod)

Expand Down
7 changes: 7 additions & 0 deletions tools/topology/topology2/production/tplg-targets-imx8.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause

# Array of "input-file-name;output-file-name;comma separated pre-processor variables"
list(APPEND TPLGS
# IPC4 topology for i.MX8MP + WM8960 Codec
"imx8-wm8960\;sof-imx8mp-wm8960\;SAI_DAI_INDEX=3,STREAM_CODEC_NAME=sai3-wm8960-hifi"
)

0 comments on commit 3ab82dc

Please sign in to comment.