@@ -33,6 +33,9 @@ OPT_HAS_ARG['r']=1 OPT_VAL['r']=48000
3333OPT_NAME[' c' ]=' pcm_c' OPT_DESC[' c' ]=' pcm for capture. Example: hw:1,0'
3434OPT_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+
3639OPT_NAME[' F' ]=' frequency' OPT_DESC[' F' ]=' target frequency'
3740OPT_HAS_ARG[' F' ]=1 OPT_VAL[' F' ]=821
3841
@@ -52,6 +55,7 @@ pcm_p=${OPT_VAL['p']}
5255pcm_c=${OPT_VAL['c']}
5356rate=${OPT_VAL['r']}
5457channel_c=${OPT_VAL['C']}
58+ format=${OPT_VAL['f']}
5559frequency=${OPT_VAL['F']}
5660sigmak=${OPT_VAL['k']}
5761frames=${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.
102106sleep 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