Skip to content

Commit 4202c38

Browse files
Chao SongChao Song
authored andcommitted
keyword-detection: don't use fixed card number
The SOF card number is not always 0, because we set up a USB sound card for loopback. Signed-off-by: Chao Song <chao.song@linux.intel.com>
1 parent 814b904 commit 4202c38

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

test-case/check-keyword-detection.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,19 @@ test_dir="/tmp"
7171
def_blob="$test_dir"/detertor_default_config.blob
7272

7373
# get wov kcontrol ID
74-
wov_kctl_id=$(amixer controls |grep "Detector" |awk -F= '{print $2}' |cut -d"," -f1)
74+
wov_kctl_id=$(amixer -c "$SOFCARD" controls |grep "Detector" |awk -F= '{print $2}' |cut -d"," -f1)
7575

7676
# get wov PGA volume kcontrol name
77-
wov_kctl_pga=$(amixer controls |grep "KWD Capture Volume" |awk -F= '{print $4}')
77+
wov_kctl_pga=$(amixer -c "$SOFCARD" controls |grep "KWD Capture Volume" |awk -F= '{print $4}')
7878

7979
# adjust wov PGA volume
80-
amixer cset name="$wov_kctl_pga" 40
80+
amixer -c "$SOFCARD" cset name="$wov_kctl_pga" 40
8181

8282
# store the default config blob
8383
_store_default_wov_config_bolb()
8484
{
8585
if [ ! -f "$def_blob" ]; then
86-
sof-ctl -Dhw:0 -n "$wov_kctl_id" -r -o "$def_blob"
86+
sof-ctl -Dhw:"$SOFCARD" -n "$wov_kctl_id" -r -o "$def_blob"
8787
dlogi "default blob:"
8888
cat "$def_blob"
8989
fi
@@ -99,7 +99,7 @@ _get_default_pt_hd()
9999
_restore_default_wov_config_bolb()
100100
{
101101
if [ -f "$def_blob" ]; then
102-
sof-ctl -Dhw:0 -n "$wov_kctl_id" -r -s "$def_blob"
102+
sof-ctl -Dhw:"$SOFCARD" -n "$wov_kctl_id" -r -s "$def_blob"
103103
fi
104104
}
105105

@@ -114,7 +114,7 @@ _update_blob(){
114114
dlogi "kwd config blob is updated to:"
115115
cat "$new_blob"
116116
dlogi "write back the new kwd config blob"
117-
sof-ctl -Dhw:0 -n "$wov_kctl_id" -r -s "$new_blob" >> /dev/null || die "Failed to write back the new kwd config bolb"
117+
sof-ctl -Dhw:"$SOFCARD" -n "$wov_kctl_id" -r -s "$new_blob" >> /dev/null || die "Failed to write back the new kwd config bolb"
118118
}
119119

120120
for i in $(seq 1 "$loop_cnt")

0 commit comments

Comments
 (0)