diff --git a/case-lib/lib.sh b/case-lib/lib.sh index 376743dc..f6a63410 100644 --- a/case-lib/lib.sh +++ b/case-lib/lib.sh @@ -827,13 +827,17 @@ set_alsa_settings() esac } -reset_PGA_volume() +reset_sof_volume() { # set all PGA* volume to 0dB - amixer -Dhw:0 scontrols | sed -e "s/^.*'\(.*\)'.*/\1/" |grep PGA | + amixer -Dhw:0 scontrols | sed -e "s/^.*'\(.*\)'.*/\1/" |grep -E 'PGA|gain' | while read -r mixer_name do - amixer -Dhw:0 -- sset "$mixer_name" 0dB + if is_ipc4; then + amixer -Dhw:0 -- sset "$mixer_name" 100% + else + amixer -Dhw:0 -- sset "$mixer_name" 0dB + fi done } diff --git a/test-case/check-alsabat.sh b/test-case/check-alsabat.sh index 96c0e753..c6e9c0b7 100755 --- a/test-case/check-alsabat.sh +++ b/test-case/check-alsabat.sh @@ -68,6 +68,9 @@ fi check_locale_for_alsabat +# reset sof volume to 0dB +reset_sof_volume + # If MODEL is defined, set proper gain for the platform if [ -z "$MODEL" ]; then # treat as warning only diff --git a/test-case/volume-basic-test.sh b/test-case/volume-basic-test.sh index 2199ce42..6a378c27 100755 --- a/test-case/volume-basic-test.sh +++ b/test-case/volume-basic-test.sh @@ -90,4 +90,4 @@ done pkill -9 aplay dlogi "Reset all PGA volume to 0dB" -reset_PGA_volume || die "Failed to reset some PGA volume to 0dB." +reset_sof_volume || die "Failed to reset some PGA volume to 0dB."