From 30a1c208915a3ae9e48ceead649a6cff2750df39 Mon Sep 17 00:00:00 2001 From: Keqiao Zhang Date: Mon, 13 Mar 2023 15:29:55 +0800 Subject: [PATCH 1/3] lib.sh: rename function reset_PGA_volume to a more generic name the volume ctl name PGA is for IPC3, IPC4 uses keyword gain. so rename the function to a more generic name to cover IPC4. Signed-off-by: Keqiao Zhang --- case-lib/lib.sh | 2 +- test-case/volume-basic-test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/case-lib/lib.sh b/case-lib/lib.sh index 376743dc..9e7fdca4 100644 --- a/case-lib/lib.sh +++ b/case-lib/lib.sh @@ -827,7 +827,7 @@ 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 | 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." From f96c8a0c0cb006e33398d3226641a6005a659d88 Mon Sep 17 00:00:00 2001 From: Keqiao Zhang Date: Wed, 15 Mar 2023 13:21:56 +0800 Subject: [PATCH 2/3] lib.sh: add IPC4 gain volume ctl support in volume reset function No all IPC4 gain controls can set 0dB directly, maybe there're some problems there. As the alternative, use 100% for IPC4 gain. Will be unified after the problem is fixed. Signed-off-by: Keqiao Zhang --- case-lib/lib.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/case-lib/lib.sh b/case-lib/lib.sh index 9e7fdca4..f6a63410 100644 --- a/case-lib/lib.sh +++ b/case-lib/lib.sh @@ -830,10 +830,14 @@ set_alsa_settings() 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 } From 691a75662661cbd7957af3e01aecf00a7ecba5b0 Mon Sep 17 00:00:00 2001 From: Keqiao Zhang Date: Mon, 13 Mar 2023 15:44:48 +0800 Subject: [PATCH 3/3] lib.sh: reset all sof volume to 0dB before alsabat testing We have aligned that to use 0dB for all sof volume controls in CI test. Signed-off-by: Keqiao Zhang --- test-case/check-alsabat.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test-case/check-alsabat.sh b/test-case/check-alsabat.sh index 140daaa1..eaaef40a 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