Skip to content

Commit 0c76c00

Browse files
committed
alsa: remove crash on init
If alsactl init does not recognise the device, it will return error code 99 and bring down the whole test. We do not care for unrecognised devices and will ignore it instead. Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
1 parent 107aeb3 commit 0c76c00

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

case-lib/lib.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,16 @@ set_alsa_settings()
12551255
{
12561256
# This will bring the machine ALSA state to a common known point - a good baseline
12571257
dlogi "Initialising ALSA configuration for $PNAME with alsactl"
1258+
1259+
# If alsactl init does not recognise the device, it will return error code 99 and bring down the whole test.
1260+
# We do not care for unrecognised devices and will ignore it instead.
1261+
E_FLAG=0
1262+
[[ "$-" == *e* ]] || E_FLAG=$?
1263+
set +e
12581264
alsactl init
1265+
if [ "$E_FLAG" -eq 0 ] then
1266+
set -e
1267+
fi
12591268

12601269
# ZEPHYR platform shares same tplg, remove '_ZEPHYR' from platform name
12611270
local PNAME="${1%_ZEPHYR}"

0 commit comments

Comments
 (0)