|
22 | 22 | ## all pipelines are alive and without kernel error |
23 | 23 | ## |
24 | 24 |
|
| 25 | +set -e |
| 26 | + |
25 | 27 | source $(dirname ${BASH_SOURCE[0]})/../case-lib/lib.sh |
26 | 28 |
|
27 | 29 | OPT_OPT_lst['t']='tplg' OPT_DESC_lst['t']='tplg file, default value is env TPLG: $TPLG' |
@@ -87,8 +89,8 @@ func_run_pipeline_with_type() |
87 | 89 | dlogc "${APP_LST[$1]} -D $dev -c $channel -r $rate -f $fmt ${DEV_LST[$1]} -q" |
88 | 90 | "${APP_LST[$1]}" -D $dev -c $channel -r $rate -f $fmt "${DEV_LST[$1]}" -q & |
89 | 91 |
|
90 | | - tmp_count=$(expr $tmp_count - 1 ) |
91 | | - [[ $tmp_count -le 0 ]] && return |
| 92 | + : $((tmp_count--)) |
| 93 | + if [ "$tmp_count" -le 0 ]; then return 0; fi |
92 | 94 | done |
93 | 95 | } |
94 | 96 |
|
|
116 | 118 | # check all refer capture pipeline status |
117 | 119 | # 1. check process count: |
118 | 120 | pcount=$(pidof arecord|wc -w) |
119 | | - tmp_count=$(expr $tmp_count + $pcount) |
| 121 | + tmp_count=$((tmp_count + pcount)) |
120 | 122 | pcount=$(pidof aplay|wc -w) |
121 | | - tmp_count=$(expr $tmp_count + $pcount) |
| 123 | + tmp_count=$((tmp_count + pcount)) |
122 | 124 | [[ $tmp_count -ne $max_count ]] && func_error_exit "Target pipeline count: $max_count, current process count: $tmp_count" |
123 | 125 |
|
124 | 126 | # 2. check arecord process status |
|
134 | 136 | # 3. check process count again: |
135 | 137 | tmp_count=0 |
136 | 138 | pcount=$(pidof arecord|wc -w) |
137 | | - tmp_count=$(expr $tmp_count + $pcount) |
| 139 | + tmp_count=$((tmp_count + pcount)) |
138 | 140 | pcount=$(pidof aplay|wc -w) |
139 | | - tmp_count=$(expr $tmp_count + $pcount) |
| 141 | + tmp_count=$((tmp_count + pcount)) |
140 | 142 | [[ $tmp_count -ne $max_count ]] && func_error_exit "Target pipeline count: $max_count, current process count: $tmp_count" |
141 | 143 |
|
142 | 144 | # 4. check arecord process status |
|
147 | 149 | [[ $? -eq 1 ]] && func_error_exit "Catch the abnormal process status of aplay" |
148 | 150 |
|
149 | 151 |
|
150 | | - # kill all arecord |
| 152 | + dlogc 'pkill -9 aplay arecord' |
151 | 153 | pkill -9 arecord |
152 | 154 | pkill -9 aplay |
153 | 155 |
|
|
0 commit comments