-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathverify-pcm-list.sh
More file actions
executable file
·55 lines (45 loc) · 1.49 KB
/
verify-pcm-list.sh
File metadata and controls
executable file
·55 lines (45 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
##
## Case Name: verify PCM list with tplg file
## Preconditions:
## driver already inserted with modprobe
## Description:
## using /proc/asound/pcm to compare with tplg content
## Case step:
## 1. load tplg file to get pipeline list string
## 2. load /proc/asound/pcm to get pcm list string
## 3. compare string list
## Expect result:
## pipeline list is same as pcm list
##
set -e
# source from the relative path of current folder
# shellcheck source=case-lib/lib.sh
source "$(dirname "${BASH_SOURCE[0]}")/../case-lib/lib.sh"
OPT_NAME['t']='tplg' OPT_DESC['t']='tplg file, default value is env TPLG: $''TPLG'
OPT_HAS_ARG['t']=1 OPT_VAL['t']="${TPLG:-}"
func_opt_parse_option "$@"
tplg=${OPT_VAL['t']}
start_test
tplg_path=$(func_lib_get_tplg_path "$tplg") ||
die "No available topology for this test case"
tplg_str=$(sof-tplgreader.py "$tplg_path" -d id pcm type -o)
pcm_str=$(sof-dump-status.py -i "${SOFCARD:-0}")
dlogc "sof-tplgreader.py $tplg_path -d id pcm type -o"
dlogi "Pipeline(s) from topology file:"
echo "$tplg_str"
dlogc "sof-dump-status.py -i ${SOFCARD:-0}"
dlogi "Pipeline(s) from system:"
echo "$pcm_str"
if [[ "$tplg_str" != "$pcm_str" ]]; then
dloge "Pipeline(s) from topology don't match pipeline(s) from system"
dlogi "Dump aplay -l"
aplay -l
dlogi "Dump arecord -l"
arecord -l
sof-kernel-dump.sh > "$LOG_ROOT"/kernel.txt
exit 1
else
dlogi "Pipeline(s) from topology match pipeline(s) from system"
fi
exit 0