Skip to content

Commit 11a2ab5

Browse files
committed
topology2: split deep buffer speaker from deep-buffer.conf
The existing code assumes that deep buffer jack is always there if deep buffer is enabled. But amp function topology only needs deep buffer speaker. Split deep buffer speaker from the deep-buffer.conf will make us be easier to add deep buffer speaker into the amp function topology. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent 3cac13c commit 11a2ab5

File tree

2 files changed

+60
-61
lines changed

2 files changed

+60
-61
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
Define {
2+
SPEAKER_PCM_CORE_ID 0
3+
}
4+
5+
Object.Pipeline.deepbuffer-playback [
6+
{
7+
index $DEEP_BUFFER_PIPELINE_ID_2
8+
core_id $SPEAKER_PCM_CORE_ID
9+
10+
Object.Widget.host-copier.1 {
11+
stream_name $DEEP_BUFFER_PCM_NAME_2
12+
pcm_id $DEEP_BUFFER_PCM_ID_2
13+
}
14+
Object.Widget.gain.1 {
15+
Object.Control.mixer.1 {
16+
name 'Pre Mixer $DEEP_BUFFER_PCM_NAME_2 Volume'
17+
}
18+
}
19+
Object.Widget.pipeline.1 {
20+
core $SPEAKER_PCM_CORE_ID
21+
}
22+
}
23+
]
24+
25+
Object.PCM.pcm [
26+
{
27+
name $DEEP_BUFFER_PCM_NAME_2
28+
id $DEEP_BUFFER_PCM_ID_2
29+
direction playback
30+
playback_compatible_d0i3 $DEEPBUFFER_D0I3_COMPATIBLE
31+
32+
Object.Base.fe_dai.1 {
33+
name "$DEEP_BUFFER_PCM_NAME_2"
34+
}
35+
Object.PCM.pcm_caps.1 {
36+
name $DEEP_BUFFER_PCM_NAME_2
37+
formats 'S16_LE,S24_LE,S32_LE'
38+
# To avoid DMA spinning on a buffer we need bigger
39+
# buffer than the host buffer size, let's say twice as
40+
# big
41+
# (S16_LE, Stereo, 48KHz, DEEPBUFFER_FW_DMA_MS) * 2
42+
#
43+
# Note: The lower limit for the buffer size is rate
44+
# dependent
45+
buffer_size_min "$[(((2 * $channels_min) * 48) * $DEEPBUFFER_FW_DMA_MS) * 2]"
46+
}
47+
}
48+
]
49+
50+
Object.Base.route [
51+
{
52+
source $DEEP_BUFFER_PIPELINE_SRC_2
53+
sink $DEEP_BUFFER_PIPELINE_SINK_2
54+
}
55+
{
56+
source host-copier.$DEEP_BUFFER_PCM_ID_2.playback
57+
sink gain.$DEEP_BUFFER_PIPELINE_ID_2.1
58+
}
59+
]

tools/topology/topology2/platform/intel/deep-buffer.conf

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -164,65 +164,5 @@ Object.Base.route [
164164

165165
# Spawn another instance
166166
IncludeByKey.DEEP_BUF_SPK {
167-
"true" {
168-
Define {
169-
SPEAKER_PCM_CORE_ID 0
170-
}
171-
172-
Object.Pipeline.deepbuffer-playback [
173-
{
174-
index $DEEP_BUFFER_PIPELINE_ID_2
175-
core_id $SPEAKER_PCM_CORE_ID
176-
177-
Object.Widget.host-copier.1 {
178-
stream_name $DEEP_BUFFER_PCM_NAME_2
179-
pcm_id $DEEP_BUFFER_PCM_ID_2
180-
}
181-
Object.Widget.gain.1 {
182-
Object.Control.mixer.1 {
183-
name 'Pre Mixer $DEEP_BUFFER_PCM_NAME_2 Volume'
184-
}
185-
}
186-
Object.Widget.pipeline.1 {
187-
core $SPEAKER_PCM_CORE_ID
188-
}
189-
}
190-
]
191-
192-
Object.PCM.pcm [
193-
{
194-
name $DEEP_BUFFER_PCM_NAME_2
195-
id $DEEP_BUFFER_PCM_ID_2
196-
direction playback
197-
playback_compatible_d0i3 $DEEPBUFFER_D0I3_COMPATIBLE
198-
199-
Object.Base.fe_dai.1 {
200-
name "$DEEP_BUFFER_PCM_NAME_2"
201-
}
202-
Object.PCM.pcm_caps.1 {
203-
name $DEEP_BUFFER_PCM_NAME_2
204-
formats 'S16_LE,S24_LE,S32_LE'
205-
# To avoid DMA spinning on a buffer we need bigger
206-
# buffer than the host buffer size, let's say twice as
207-
# big
208-
# (S16_LE, Stereo, 48KHz, DEEPBUFFER_FW_DMA_MS) * 2
209-
#
210-
# Note: The lower limit for the buffer size is rate
211-
# dependent
212-
buffer_size_min "$[(((2 * $channels_min) * 48) * $DEEPBUFFER_FW_DMA_MS) * 2]"
213-
}
214-
}
215-
]
216-
217-
Object.Base.route [
218-
{
219-
source $DEEP_BUFFER_PIPELINE_SRC_2
220-
sink $DEEP_BUFFER_PIPELINE_SINK_2
221-
}
222-
{
223-
source host-copier.$DEEP_BUFFER_PCM_ID_2.playback
224-
sink gain.$DEEP_BUFFER_PIPELINE_ID_2.1
225-
}
226-
]
227-
}
167+
"true" "platform/intel/deep-buffer-spk.conf"
228168
}

0 commit comments

Comments
 (0)