Skip to content

Commit 92fe8a1

Browse files
singalsumarc-hb
authored andcommitted
test-case: check-alsabat.sh: Lower the threshold for detecting tones
The default parameter sigma k is 3.0 when omitted from command line. This patch drops the threshold to half with 1.5 to better detect distortion in playback. Alsabat judges spectral components above the threshold as sine frequencies. This change should increase the probability fail a test to avoid green failures to happen. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 1bbab37 commit 92fe8a1

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

test-case/check-alsabat.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ OPT_HAS_ARG['c']=1 OPT_VAL['c']=''
3636
OPT_NAME['f']='frequency' OPT_DESC['f']='target frequency'
3737
OPT_HAS_ARG['f']=1 OPT_VAL['f']=821
3838

39+
OPT_NAME['k']='sigmak' OPT_DESC['k']='sigma k value'
40+
OPT_HAS_ARG['k']=1 OPT_VAL['k']=1.5
41+
3942
OPT_NAME['n']='frames' OPT_DESC['n']='test frames'
4043
OPT_HAS_ARG['n']=1 OPT_VAL['n']=240000
4144

@@ -50,6 +53,7 @@ pcm_c=${OPT_VAL['c']}
5053
rate=${OPT_VAL['r']}
5154
channel_c=${OPT_VAL['C']}
5255
frequency=${OPT_VAL['f']}
56+
sigmak=${OPT_VAL['k']}
5357
frames=${OPT_VAL['n']}
5458

5559
if [ "$pcm_p" = "" ]||[ "$pcm_c" = "" ];
@@ -91,16 +95,16 @@ arecord -Dplug$pcm_c -d 1 /dev/null -q || die "Failed to capture on PCM: $pcm_c"
9195

9296
# alsabat test
9397
# hardcode the channel number of playback to 2, as sof doesnot support mono wav.
94-
dlogc "alsabat -P$pcm_p --standalone -n $frames -r $rate -c 2 -F $frequency"
95-
alsabat -P$pcm_p --standalone -n $frames -c 2 -r $rate -F $frequency & playPID=$!
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=$!
96100

97101
# playback may have low latency, add one second delay to aviod recording zero at beginning.
98102
sleep 1
99103

100104
# We use different USB sound cards in CI, part of them only support 1 channel for capture,
101105
# so make the channel as an option and config it in alsabat-playback.csv
102-
dlogc "alsabat -C$pcm_c -c $channel_c -r $rate -F $frequency"
103-
alsabat -C$pcm_c -c $channel_c -r $rate -F $frequency || {
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 || {
104108
# upload failed wav file
105109
__upload_wav_file
106110
# dump amixer contents for more debugging

0 commit comments

Comments
 (0)