topolog2: add deep buffer support on HDA platforms

Deep buffer uses large 100ms dma buffer size and
it also enables lp mode.

Signed-off-by: Rander Wang <rander.wang@intel.com>
This commit is contained in:
Rander Wang 2022-08-30 13:13:08 +08:00 committed by Liam Girdwood
parent baec9c1b28
commit ba03937264
4 changed files with 154 additions and 0 deletions

View File

@ -43,6 +43,20 @@ Object.Pipeline {
} }
} }
deepbuffer-playback.0 {
index 5
Object.Widget.copier.1 {
stream_name 'Analog Deepbuffer Playback'
}
Object.Widget.gain.1 {
Object.Control.mixer.1 {
name '5 3nd Playback Volume'
}
}
}
mixout-gain-host-copier-capture.0 { mixout-gain-host-copier-capture.0 {
index 3 index 3
@ -88,6 +102,18 @@ Object.PCM {
} }
direction duplex direction duplex
} }
pcm.1 {
id 1
name 'DeepBuffer'
Object.Base.fe_dai.'DeepBuffer' {}
Object.PCM.pcm_caps.playback {
name 'Analog Deepbuffer Playback'
formats 'S32_LE,S24_LE,S16_LE'
}
direction playback
}
} }
# top-level pipeline connections # top-level pipeline connections
@ -108,4 +134,8 @@ Object.Base {
source 'mixin.4.1' source 'mixin.4.1'
sink 'mixout.3.1' sink 'mixout.3.1'
} }
route.5 {
source 'mixin.5.1'
sink 'mixout.2.1'
}
} }

View File

@ -14,6 +14,7 @@
<mixout-gain-dai-copier-playback.conf> <mixout-gain-dai-copier-playback.conf>
<dai-copier-gain-mixin-capture.conf> <dai-copier-gain-mixin-capture.conf>
<mixout-gain-host-copier-capture.conf> <mixout-gain-host-copier-capture.conf>
<deepbuffer-playback.conf>
<passthrough-be.conf> <passthrough-be.conf>
<data.conf> <data.conf>
<pcm.conf> <pcm.conf>

View File

@ -56,4 +56,6 @@ Define {
GPIO_CLASS 24 # GPIO GPIO_CLASS 24 # GPIO
SPI_OUTPUT_CLASS 25 # SPI Output (DSP ->) SPI_OUTPUT_CLASS 25 # SPI Output (DSP ->)
SPI_INPUT_CLASS 26 # SPI Input (DSP <-) SPI_INPUT_CLASS 26 # SPI Input (DSP <-)
DEEPBUFFER_FW_DMA_MS 100 # 100 ms copier dma size
} }

View File

@ -0,0 +1,121 @@
#
# FE playback pipeline: deepbuffer-playback
#
# All attributes defined herein are namespaced
# by alsatplg to "Object.Pipeline.deepbuffer-playback.N.attribute_name"
#
# Usage: deepbuffer-playback pipeline object can be instantiated as:
#
# Object.Pipeline.deepbuffer-playback."N" {
# period 1000
# time_domain "timer"
# channels 2
# rate 48000
# }
#
# Where N is the unique pipeline ID within the same alsaconf node.
#
<include/common/audio_format.conf>
<include/components/copier.conf>
<include/components/mixin.conf>
<include/components/pipeline.conf>
<include/components/gain.conf>
Class.Pipeline."deepbuffer-playback" {
DefineAttribute."index" {}
<include/pipelines/pipeline-common.conf>
attributes {
!constructor [
"index"
]
!immutable [
"direction"
]
#
# deepbuffer-playback objects instantiated within the same alsaconf node must have
# unique pipeline_id attribute
#
unique "instance"
}
Object.Widget {
copier."1" {
copier_type "host"
type "aif_in"
node_type $HDA_HOST_OUTPUT_CLASS
num_audio_formats 3
# 16-bit 48KHz 2ch
Object.Base.audio_format.1 {
out_bit_depth 32
out_valid_bit_depth 24
# 100ms buffer
dma_buffer_size "$[$ibs * $DEEPBUFFER_FW_DMA_MS]"
}
# 24-bit 48KHz 2ch
Object.Base.audio_format.2 {
in_bit_depth 32
in_valid_bit_depth 24
out_bit_depth 32
out_valid_bit_depth 24
# 100ms buffer
dma_buffer_size "$[$obs * $DEEPBUFFER_FW_DMA_MS]"
}
# 32-bit 48KHz 2ch
Object.Base.audio_format.3 {
in_bit_depth 32
in_valid_bit_depth 32
out_bit_depth 32
out_valid_bit_depth 32
# 100ms buffer
dma_buffer_size "$[$ibs * $DEEPBUFFER_FW_DMA_MS]"
}
}
gain."1" {
num_audio_formats 1
# 32-bit 48KHz 2ch
Object.Base.audio_format.1 {
in_bit_depth 32
in_valid_bit_depth 24
out_bit_depth 32
out_valid_bit_depth 24
}
}
mixin."1" {}
pipeline."1" {
priority 0
# enable lp mode
lp_mode 1
}
}
Object.Base {
route.1 {
source copier.host..1
sink gain..1
}
route.2 {
source gain..1
sink mixin..1
}
}
direction "playback"
dynamic_pipeline 1
time_domain "timer"
channels 2
channels_min 2
channels_max 2
rate 48000
rate_min 48000
rate_max 48000
}