From 6aed5a771f03ae716a924a47f396c91240e71e5c Mon Sep 17 00:00:00 2001 From: Fred Oh Date: Wed, 12 Oct 2022 00:28:58 -0700 Subject: [PATCH] lib.sh: initialize with alsactl before setting proper alsa settings alsaclt init will try to initialize all sound devices to a default state. It doesn't guarantee to set default for all, but good to start with when proper alsa settings are desired. Signed-off-by: Fred Oh --- case-lib/lib.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/case-lib/lib.sh b/case-lib/lib.sh index a9c6fd0f..84c5da76 100644 --- a/case-lib/lib.sh +++ b/case-lib/lib.sh @@ -802,6 +802,10 @@ set_alsa_settings() { # ZEPHYR platform shares same tplg, remove '_ZEPHYR' from platform name local PNAME="${1%_ZEPHYR}" + + # Initialize alsa settings first + alsactl init + dlogi "Run alsa setting for $PNAME" case $PNAME in APL_UP2_NOCODEC | CML_RVP_NOCODEC | JSL_RVP_NOCODEC | TGLU_RVP_NOCODEC | ADLP_RVP_NOCODEC | TGLH_RVP_NOCODEC) @@ -825,6 +829,9 @@ set_alsa_settings() reset_PGA_volume() { + # Initialize alsa settings first + alsactl init + # set all PGA* volume to 0dB amixer -Dhw:0 scontrols | sed -e "s/^.*'\(.*\)'.*/\1/" |grep PGA | while read -r mixer_name