Skip to content

Commit ef60020

Browse files
committed
Tools: Topology2: Add 8-bit formats to host copier and PCM
Adding for test to HDA generic topologies for PCM0 support for 8-bit formats unsigned, A-law, and mu-law. TBD: Maybe better to do this to a non-production topology, e.g. sof-nocodec to only enable testing. There's currently no requirement to support this in HDA. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent fa4dded commit ef60020

File tree

4 files changed

+46
-4
lines changed

4 files changed

+46
-4
lines changed

tools/topology/topology2/cavs-mixin-mixout-hda.conf

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,27 @@ Object.Pipeline {
113113
Object.Widget.host-copier.1 {
114114
stream_name $ANALOG_PLAYBACK_PCM
115115
pcm_id 0
116-
num_input_audio_formats 3
116+
num_input_audio_formats 6
117117
num_output_audio_formats 1
118118
Object.Base.input_audio_format [
119+
{
120+
in_rate $HDA_ANALOG_PLAYBACK_RATE
121+
in_bit_depth 8
122+
in_valid_bit_depth 8
123+
in_sample_type $SAMPLE_TYPE_UNSIGNED_INTEGER
124+
}
125+
{
126+
in_rate $HDA_ANALOG_PLAYBACK_RATE
127+
in_bit_depth 8
128+
in_valid_bit_depth 8
129+
in_sample_type $SAMPLE_TYPE_A_LAW
130+
}
131+
{
132+
in_rate $HDA_ANALOG_PLAYBACK_RATE
133+
in_bit_depth 8
134+
in_valid_bit_depth 8
135+
in_sample_type $SAMPLE_TYPE_MU_LAW
136+
}
119137
{
120138
in_rate $HDA_ANALOG_PLAYBACK_RATE
121139
in_bit_depth 16
@@ -172,7 +190,7 @@ Object.Pipeline {
172190
stream_name $ANALOG_CAPTURE_PCM
173191
pcm_id 0
174192
num_input_audio_formats 1
175-
num_output_audio_formats 3
193+
num_output_audio_formats 6
176194
Object.Base.input_audio_format [
177195
{
178196
in_rate $HDA_ANALOG_CAPTURE_RATE
@@ -181,6 +199,24 @@ Object.Pipeline {
181199
}
182200
]
183201
Object.Base.output_audio_format [
202+
{
203+
out_rate $HDA_ANALOG_PLAYBACK_RATE
204+
out_bit_depth 8
205+
out_valid_bit_depth 8
206+
out_sample_type $SAMPLE_TYPE_UNSIGNED_INTEGER
207+
}
208+
{
209+
out_rate $HDA_ANALOG_PLAYBACK_RATE
210+
out_bit_depth 8
211+
out_valid_bit_depth 8
212+
out_sample_type $SAMPLE_TYPE_A_LAW
213+
}
214+
{
215+
out_rate $HDA_ANALOG_PLAYBACK_RATE
216+
out_bit_depth 8
217+
out_valid_bit_depth 8
218+
out_sample_type $SAMPLE_TYPE_MU_LAW
219+
}
184220
{
185221
out_rate $HDA_ANALOG_CAPTURE_RATE
186222
out_bit_depth 16
@@ -368,14 +404,14 @@ Object.PCM.pcm [
368404
Object.PCM.pcm_caps.1 {
369405
direction "playback"
370406
name $ANALOG_PLAYBACK_PCM
371-
formats 'S32_LE,S24_LE,S16_LE'
407+
formats 'S32_LE,S24_LE,S16_LE,U8,A_LAW,MU_LAW'
372408
rate_min $HDA_ANALOG_PLAYBACK_RATE
373409
rate_max $HDA_ANALOG_PLAYBACK_RATE
374410
}
375411
Object.PCM.pcm_caps.2 {
376412
direction "capture"
377413
name $ANALOG_CAPTURE_PCM
378-
formats 'S32_LE,S24_LE,S16_LE'
414+
formats 'S32_LE,S24_LE,S16_LE,U8,A_LAW,MU_LAW'
379415
rate_min $HDA_ANALOG_CAPTURE_RATE
380416
rate_max $HDA_ANALOG_CAPTURE_RATE
381417
}

tools/topology/topology2/include/common/common_definitions.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Define {
3434
SAMPLE_TYPE_SIGNED_INTEGER 2 # Signed Integer
3535
SAMPLE_TYPE_UNSIGNED_INTEGER 3 # Unsigned Integer
3636
SAMPLE_TYPE_FLOAT 4 # Float
37+
SAMPLE_TYPE_A_LAW 5 # A-law
38+
SAMPLE_TYPE_MU_LAW 6 # mu-law
3739

3840
# Copier type
3941
HDA_HOST_OUTPUT_CLASS 0 # HD/A host output (-> DSP)

tools/topology/topology2/include/common/input_audio_format.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ Class.Base."input_audio_format" {
9898
$SAMPLE_TYPE_SIGNED_INTEGER
9999
$SAMPLE_TYPE_UNSIGNED_INTEGER
100100
$SAMPLE_TYPE_FLOAT
101+
$SAMPLE_TYPE_A_LAW
102+
$SAMPLE_TYPE_MU_LAW
101103
]
102104
}
103105
}

tools/topology/topology2/include/common/output_audio_format.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ Class.Base."output_audio_format" {
103103
$SAMPLE_TYPE_SIGNED_INTEGER
104104
$SAMPLE_TYPE_UNSIGNED_INTEGER
105105
$SAMPLE_TYPE_FLOAT
106+
$SAMPLE_TYPE_A_LAW
107+
$SAMPLE_TYPE_MU_LAW
106108
]
107109
}
108110
}

0 commit comments

Comments
 (0)