Skip to content

Commit ba2f6c5

Browse files
authored
Volume reset for alsabat testing (#1010)
* 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 <keqiao.zhang@intel.com> * 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 <keqiao.zhang@intel.com> * 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 <keqiao.zhang@intel.com> --------- Signed-off-by: Keqiao Zhang <keqiao.zhang@intel.com>
1 parent fbd2257 commit ba2f6c5

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

case-lib/lib.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -827,13 +827,17 @@ set_alsa_settings()
827827
esac
828828
}
829829

830-
reset_PGA_volume()
830+
reset_sof_volume()
831831
{
832832
# set all PGA* volume to 0dB
833-
amixer -Dhw:0 scontrols | sed -e "s/^.*'\(.*\)'.*/\1/" |grep PGA |
833+
amixer -Dhw:0 scontrols | sed -e "s/^.*'\(.*\)'.*/\1/" |grep -E 'PGA|gain' |
834834
while read -r mixer_name
835835
do
836-
amixer -Dhw:0 -- sset "$mixer_name" 0dB
836+
if is_ipc4; then
837+
amixer -Dhw:0 -- sset "$mixer_name" 100%
838+
else
839+
amixer -Dhw:0 -- sset "$mixer_name" 0dB
840+
fi
837841
done
838842
}
839843

test-case/check-alsabat.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ fi
6868

6969
check_locale_for_alsabat
7070

71+
# reset sof volume to 0dB
72+
reset_sof_volume
73+
7174
# If MODEL is defined, set proper gain for the platform
7275
if [ -z "$MODEL" ]; then
7376
# treat as warning only

test-case/volume-basic-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,4 @@ done
9090
pkill -9 aplay
9191

9292
dlogi "Reset all PGA volume to 0dB"
93-
reset_PGA_volume || die "Failed to reset some PGA volume to 0dB."
93+
reset_sof_volume || die "Failed to reset some PGA volume to 0dB."

0 commit comments

Comments
 (0)