Skip to content

Commit 781bc2b

Browse files
committed
Tools: Topology: Add FLOAT_LE and U8 formats to PCH DMIC
This patch adds option to add float and unsigned 8-bit capture formats to PCH DMIC if PCM_FORMAT_ALL is set to true. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 364a315 commit 781bc2b

File tree

1 file changed

+190
-49
lines changed

1 file changed

+190
-49
lines changed

tools/topology/topology2/platform/intel/dmic-generic.conf

Lines changed: 190 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ IncludeByKey.PASSTHROUGH {
107107
stream_name $DMIC0_PCM_CAPS
108108
pcm_id $DMIC0_PCM_ID
109109
num_input_audio_formats 1
110-
num_output_audio_formats 1
111110
IncludeByKey.DMIC0_PCM_CHANNELS {
112111
"1" {
113112
Object.Base.input_audio_format [
@@ -120,56 +119,192 @@ IncludeByKey.PASSTHROUGH {
120119
in_ch_map $CHANNEL_MAP_MONO
121120
}
122121
]
123-
Object.Base.output_audio_format [
122+
IncludeByKey.PCM_FORMAT_ALL {
123+
"true" {
124+
num_output_audio_formats 5
125+
Object.Base.output_audio_format [
126+
{
127+
out_rate $DMIC0_RATE
128+
out_bit_depth 16
129+
out_valid_bit_depth 16
130+
out_ch_cfg $CHANNEL_CONFIG_MONO
131+
out_ch_map $CHANNEL_MAP_MONO
132+
}
133+
{
134+
out_rate $DMIC0_RATE
135+
out_bit_depth 32
136+
out_valid_bit_depth 32
137+
out_ch_cfg $CHANNEL_CONFIG_MONO
138+
out_ch_map $CHANNEL_MAP_MONO
139+
}
140+
{
141+
out_rate $DMIC0_RATE
142+
out_bit_depth 32
143+
out_valid_bit_depth 24
144+
out_ch_cfg $CHANNEL_CONFIG_MONO
145+
out_ch_map $CHANNEL_MAP_MONO
146+
}
147+
{
148+
out_rate $DMIC0_RATE
149+
out_bit_depth 32
150+
out_valid_bit_depth 32
151+
out_sample_type $SAMPLE_TYPE_FLOAT
152+
out_ch_cfg $CHANNEL_CONFIG_MONO
153+
out_ch_map $CHANNEL_MAP_MONO
154+
}
155+
{
156+
out_rate $DMIC0_RATE
157+
out_bit_depth 8
158+
out_valid_bit_depth 8
159+
out_sample_type $SAMPLE_TYPE_UNSIGNED_INTEGER
160+
out_ch_cfg $CHANNEL_CONFIG_MONO
161+
out_ch_map $CHANNEL_MAP_MONO
162+
}
163+
]
164+
}
165+
"false" {
166+
num_output_audio_formats 1
167+
Object.Base.output_audio_format [
168+
{
169+
out_rate $DMIC0_RATE
170+
out_channels 1
171+
out_bit_depth 32
172+
out_valid_bit_depth 32
173+
out_ch_cfg $CHANNEL_CONFIG_MONO
174+
out_ch_map $CHANNEL_MAP_MONO
175+
}
176+
]
177+
}
178+
}
179+
}
180+
"2" {
181+
Object.Base.input_audio_format [
124182
{
125-
out_rate $DMIC0_RATE
126-
out_channels 1
127-
out_bit_depth 32
128-
out_valid_bit_depth 32
129-
out_ch_cfg $CHANNEL_CONFIG_MONO
130-
out_ch_map $CHANNEL_MAP_MONO
183+
in_rate $DMIC0_RATE
184+
in_bit_depth 32
185+
in_valid_bit_depth 32
131186
}
132187
]
188+
IncludeByKey.PCM_FORMAT_ALL {
189+
"true" {
190+
num_output_audio_formats 5
191+
Object.Base.output_audio_format [
192+
{
193+
out_rate $DMIC0_RATE
194+
out_bit_depth 16
195+
out_valid_bit_depth 16
196+
}
197+
{
198+
out_rate $DMIC0_RATE
199+
out_bit_depth 32
200+
out_valid_bit_depth 24
201+
}
202+
{
203+
out_rate $DMIC0_RATE
204+
out_bit_depth 32
205+
out_valid_bit_depth 32
206+
}
207+
{
208+
out_rate $DMIC0_RATE
209+
out_bit_depth 32
210+
out_valid_bit_depth 32
211+
out_sample_type $SAMPLE_TYPE_FLOAT
212+
}
213+
{
214+
out_rate $DMIC0_RATE
215+
out_bit_depth 8
216+
out_valid_bit_depth 8
217+
out_sample_type $SAMPLE_TYPE_UNSIGNED_INTEGER
218+
}
219+
]
220+
}
221+
"false" {
222+
num_output_audio_formats 1
223+
Object.Base.output_audio_format [
224+
{
225+
out_rate $DMIC0_RATE
226+
out_bit_depth 32
227+
out_valid_bit_depth 32
228+
}
229+
]
230+
}
231+
}
133232
}
134-
"2" {
135-
Object.Base.input_audio_format [
136-
{
137-
in_rate $DMIC0_RATE
138-
in_bit_depth 32
139-
in_valid_bit_depth 32
140-
}
141-
]
142-
Object.Base.output_audio_format [
143-
{
144-
out_rate $DMIC0_RATE
145-
out_bit_depth 32
146-
out_valid_bit_depth 32
147-
}
148-
]
149-
}
150-
"4" {
151-
Object.Base.input_audio_format [
152-
{
153-
in_rate $DMIC0_RATE
154-
in_channels 4
155-
in_bit_depth 32
156-
in_valid_bit_depth 32
157-
in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
158-
in_ch_map $CHANNEL_MAP_3_POINT_1
159-
}
160-
]
161-
Object.Base.output_audio_format [
162-
{
163-
out_rate $DMIC0_RATE
164-
out_channels 4
165-
out_bit_depth 32
166-
out_valid_bit_depth 32
167-
out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
168-
out_ch_map $CHANNEL_MAP_3_POINT_1
169-
}
170-
]
171-
}
172-
}
233+
"4" {
234+
Object.Base.input_audio_format [
235+
{
236+
in_rate $DMIC0_RATE
237+
in_channels 4
238+
in_bit_depth 32
239+
in_valid_bit_depth 32
240+
in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
241+
in_ch_map $CHANNEL_MAP_3_POINT_1
242+
}
243+
]
244+
IncludeByKey.PCM_FORMAT_ALL {
245+
"true" {
246+
num_output_audio_formats 5
247+
Object.Base.output_audio_format [
248+
{
249+
out_rate $DMIC0_RATE
250+
out_channels 4
251+
out_bit_depth 16
252+
out_valid_bit_depth 16
253+
out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
254+
out_ch_map $CHANNEL_MAP_3_POINT_1
255+
}
256+
{
257+
out_rate $DMIC0_RATE
258+
out_channels 4
259+
out_bit_depth 32
260+
out_valid_bit_depth 24
261+
out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
262+
out_ch_map $CHANNEL_MAP_3_POINT_1
263+
}
264+
{
265+
out_rate $DMIC0_RATE
266+
out_channels 4
267+
out_bit_depth 32
268+
out_valid_bit_depth 32
269+
out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
270+
out_ch_map $CHANNEL_MAP_3_POINT_1
271+
}
272+
{
273+
out_rate $DMIC0_RATE
274+
out_channels 4
275+
out_bit_depth 32
276+
out_valid_bit_depth 32
277+
out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
278+
out_ch_map $CHANNEL_MAP_3_POINT_1
279+
out_sample_type $SAMPLE_TYPE_FLOAT
280+
}
281+
{
282+
out_rate $DMIC0_RATE
283+
out_channels 4
284+
out_bit_depth 8
285+
out_valid_bit_depth 8
286+
out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
287+
out_ch_map $CHANNEL_MAP_3_POINT_1
288+
out_sample_type $SAMPLE_TYPE_UNSIGNED_INTEGER
289+
}
290+
]
291+
}
292+
"false" {
293+
num_output_audio_formats 1
294+
Object.Base.output_audio_format [
295+
{
296+
out_rate $DMIC0_RATE
297+
out_channels 4
298+
out_bit_depth 32
299+
out_valid_bit_depth 32
300+
out_ch_cfg $CHANNEL_CONFIG_3_POINT_1
301+
out_ch_map $CHANNEL_MAP_3_POINT_1
302+
}
303+
]
304+
}
305+
}
306+
}
307+
}
173308
}
174309

175310
Object.Widget.pipeline."1" {
@@ -881,8 +1016,14 @@ Object.PCM.pcm [
8811016

8821017
Object.PCM.pcm_caps.1 {
8831018
name $DMIC0_PCM_CAPS
884-
# only 32-bit capture supported now
885-
formats 'S32_LE'
1019+
IncludeByKey.PCM_FORMAT_ALL {
1020+
"true" {
1021+
formats 'S16_LE,S24_LE,S32_LE,U8,FLOAT_LE'
1022+
}
1023+
"false" {
1024+
formats 'S32_LE'
1025+
}
1026+
}
8861027
channels_min $DMIC0_PCM_CHANNELS
8871028
channels_max $DMIC0_PCM_CHANNELS
8881029
IncludeByKey.DMIC0_RATE {

0 commit comments

Comments
 (0)