Skip to content

Commit 196f86c

Browse files
RanderWangkv2019i
authored andcommitted
topology2: change the sample type for Linux audio system
At first the sample type is set to MSB_INTEGER to follow windows settings, but actually we use LSB_INTERGER type such as S24_4LE. Now change the default sample type to LSB_INTERGER to align with FW usage. For DAI copier we need to use MSB_INTERGER for hardware requirement. Currently sample type only affect s24/c32 case, so only change sample type in dai for this format config. FW will use sample type to choose correct format conversion function and can deal with Windows audio stream correctly with MSB s24/c32 format. out_fmt_cfg is redefined for a alsa-lib bug. Alsa-lib will first process out_fmt_cfg = '$[($out_channels | ($out_valid_bit_depth * 256)) | ($out_sample_type * 65536)]' in base class and then deal with out_sample_type, so error is reported. Now first define out_sample_type and then out_fmt_cfg, everything works. Signed-off-by: Rander Wang <rander.wang@intel.com>
1 parent 87856a7 commit 196f86c

6 files changed

Lines changed: 10 additions & 4 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,13 @@ Class.Base."audio_format" {
211211
in_valid_bit_depth 16
212212
in_channels 2
213213
in_interleaving_style "interleaved"
214-
in_sample_type $SAMPLE_TYPE_MSB_INTEGER
214+
in_sample_type $SAMPLE_TYPE_LSB_INTEGER
215215
out_rate 48000
216216
out_bit_depth 16
217217
out_valid_bit_depth 16
218218
out_channels 2
219219
out_interleaving_style "interleaved"
220-
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
220+
out_sample_type $SAMPLE_TYPE_LSB_INTEGER
221221
in_ch_cfg $CHANNEL_CONFIG_STEREO
222222
in_ch_map $CHANNEL_MAP_STEREO
223223
out_ch_cfg $CHANNEL_CONFIG_STEREO

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Class.Base."input_audio_format" {
124124
in_valid_bit_depth 16
125125
in_channels 2
126126
in_interleaving_style "interleaved"
127-
in_sample_type $SAMPLE_TYPE_MSB_INTEGER
127+
in_sample_type $SAMPLE_TYPE_LSB_INTEGER
128128
in_ch_cfg $CHANNEL_CONFIG_STEREO
129129
in_ch_map $CHANNEL_MAP_STEREO
130130

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Class.Base."output_audio_format" {
124124
out_valid_bit_depth 16
125125
out_channels 2
126126
out_interleaving_style "interleaved"
127-
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
127+
out_sample_type $SAMPLE_TYPE_LSB_INTEGER
128128
out_ch_cfg $CHANNEL_CONFIG_STEREO
129129
out_ch_map $CHANNEL_MAP_STEREO
130130

tools/topology/topology2/include/pipelines/cavs/dai-copier-be.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ Class.Pipeline."dai-copier-be" {
6767
in_valid_bit_depth 24
6868
out_bit_depth 32
6969
out_valid_bit_depth 24
70+
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
71+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
7072
}
7173
}
7274

tools/topology/topology2/include/pipelines/cavs/dai-kpb-be.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ Class.Pipeline."dai-kpb-be" {
5454
in_valid_bit_depth 24
5555
out_bit_depth 32
5656
out_valid_bit_depth 24
57+
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
58+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
5759
}
5860

5961
Object.Base.audio_format.1 {

tools/topology/topology2/include/pipelines/cavs/io-gateway.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ Class.Pipeline."io-gateway" {
6767
{
6868
out_bit_depth 32
6969
out_valid_bit_depth 24
70+
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
71+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
7072
}
7173
{
7274
out_bit_depth 32

0 commit comments

Comments
 (0)