Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ujfalusi Do you have idea why 0 dB is not working?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: In tplg1 100% could be +20 or +40 dB in some cases.

if is_ipc4; then
amixer -Dhw:0 -- sset "$mixer_name" 100%
else
amixer -Dhw:0 -- sset "$mixer_name" 0dB
fi
done
}

Expand Down
3 changes: 3 additions & 0 deletions test-case/check-alsabat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test-case/volume-basic-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."