Skip to content

Commit 1bbab37

Browse files
miRooxChao Song
authored andcommitted
lib: check locale for alsabat
alsabat always returns -2 for "C.UTF-8" locale. Suggest user set locale to "C.utf8" to avoid this issue. see alsa-project/alsa-utils#192 Signed-off-by: Yong-an Lu <yongan.lu@intel.com>
1 parent ccefded commit 1bbab37

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

case-lib/lib.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,15 @@ check_ntp_sync()
782782
timedatectl show | grep -q "NTPSynchronized=yes"
783783
}
784784

785+
# alsabat will return -2 for "C.UTF-8" locale
786+
# every case with alsabat should call this at beginning
787+
check_locale_for_alsabat()
788+
{
789+
if locale | grep -i 'C.utf-8'; then
790+
die 'Try C.utf8 instead, see https://github.com/alsa-project/alsa-utils/issues/192'
791+
fi
792+
}
793+
785794
re_enable_ntp_sync()
786795
{
787796
# disable synchronization first

test-case/check-alsabat.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ then
5858
exit 2
5959
fi
6060

61+
check_locale_for_alsabat
62+
6163
# If MODEL is defined, set proper gain for the platform
6264
if [ -z "$MODEL" ]; then
6365
# treat as warning only

test-case/check-fw-echo-reference.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ if [ "$PIPELINE_COUNT" != "2" ]; then
4949
die "Only detect $PIPELINE_COUNT pipeline(s) from topology, but two are needed"
5050
fi
5151

52+
check_locale_for_alsabat
53+
5254
for idx in $(seq 0 $((PIPELINE_COUNT - 1)))
5355
do
5456
type=$(func_pipeline_parse_value "$idx" type)

0 commit comments

Comments
 (0)