Skip to content

Commit f81a09f

Browse files
authored
check_alsabat.sh: add format support (#1009)
* check_alsabat.sh: rename -f[requency] option to -F for alsabat consistency Signed-off-by: Keqiao Zhang <keqiao.zhang@intel.com> * check_alsabat.sh: add new -f[format] option add a new option -f to support different formats in alsabat test. Signed-off-by: Keqiao Zhang <keqiao.zhang@intel.com> --------- Signed-off-by: Keqiao Zhang <keqiao.zhang@intel.com>
1 parent 32d9fe9 commit f81a09f

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

test-case/check-alsabat.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ OPT_HAS_ARG['r']=1 OPT_VAL['r']=48000
3333
OPT_NAME['c']='pcm_c' OPT_DESC['c']='pcm for capture. Example: hw:1,0'
3434
OPT_HAS_ARG['c']=1 OPT_VAL['c']=''
3535

36-
OPT_NAME['f']='frequency' OPT_DESC['f']='target frequency'
37-
OPT_HAS_ARG['f']=1 OPT_VAL['f']=821
36+
OPT_NAME['f']='format' OPT_DESC['f']='target format'
37+
OPT_HAS_ARG['f']=1 OPT_VAL['f']="S16_LE"
38+
39+
OPT_NAME['F']='frequency' OPT_DESC['F']='target frequency'
40+
OPT_HAS_ARG['F']=1 OPT_VAL['F']=821
3841

3942
OPT_NAME['k']='sigmak' OPT_DESC['k']='sigma k value'
4043
OPT_HAS_ARG['k']=1 OPT_VAL['k']=1.5
@@ -52,7 +55,8 @@ pcm_p=${OPT_VAL['p']}
5255
pcm_c=${OPT_VAL['c']}
5356
rate=${OPT_VAL['r']}
5457
channel_c=${OPT_VAL['C']}
55-
frequency=${OPT_VAL['f']}
58+
format=${OPT_VAL['f']}
59+
frequency=${OPT_VAL['F']}
5660
sigmak=${OPT_VAL['k']}
5761
frames=${OPT_VAL['n']}
5862

@@ -95,16 +99,16 @@ arecord -Dplug$pcm_c -d 1 /dev/null -q || die "Failed to capture on PCM: $pcm_c"
9599

96100
# alsabat test
97101
# hardcode the channel number of playback to 2, as sof doesnot support mono wav.
98-
dlogc "alsabat -P$pcm_p --standalone -n $frames -r $rate -c 2 -F $frequency -k $sigmak"
99-
alsabat -P$pcm_p --standalone -n $frames -c 2 -r $rate -F $frequency -k $sigmak & playPID=$!
102+
dlogc "alsabat -P$pcm_p --standalone -n $frames -r $rate -c 2 -f $format -F $frequency -k $sigmak"
103+
alsabat -P$pcm_p --standalone -n $frames -c 2 -r $rate -f $format -F $frequency -k $sigmak & playPID=$!
100104

101105
# playback may have low latency, add one second delay to aviod recording zero at beginning.
102106
sleep 1
103107

104108
# We use different USB sound cards in CI, part of them only support 1 channel for capture,
105109
# so make the channel as an option and config it in alsabat-playback.csv
106-
dlogc "alsabat -C$pcm_c -c $channel_c -r $rate -F $frequency -k $sigmak"
107-
alsabat -C$pcm_c -c $channel_c -r $rate -F $frequency -k $sigmak || {
110+
dlogc "alsabat -C$pcm_c -c $channel_c -r $rate -f $format -F $frequency -k $sigmak"
111+
alsabat -C$pcm_c -c $channel_c -r $rate -f $format -F $frequency -k $sigmak || {
108112
# upload failed wav file
109113
__upload_wav_file
110114
# dump amixer contents for more debugging

0 commit comments

Comments
 (0)