Skip to content

Commit 53328bf

Browse files
committed
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>
1 parent 6985030 commit 53328bf

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test-case/check-alsabat.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ 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']='format' OPT_DESC['f']='target format'
37+
OPT_HAS_ARG['f']=1 OPT_VAL['f']="S16_LE"
38+
3639
OPT_NAME['F']='frequency' OPT_DESC['F']='target frequency'
3740
OPT_HAS_ARG['F']=1 OPT_VAL['F']=821
3841

@@ -52,6 +55,7 @@ pcm_p=${OPT_VAL['p']}
5255
pcm_c=${OPT_VAL['c']}
5356
rate=${OPT_VAL['r']}
5457
channel_c=${OPT_VAL['C']}
58+
format=${OPT_VAL['f']}
5559
frequency=${OPT_VAL['F']}
5660
sigmak=${OPT_VAL['k']}
5761
frames=${OPT_VAL['n']}
@@ -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)