Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib.sh: initialize with alsactl before setting proper alsa settings #966

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this can be an echo rather than a comment? Likewise with the other comment below. The only set -x I saw in this file were wrapped in sub-shells. Approving regardless.

Copy link
Collaborator

@marc-hb marc-hb Oct 13, 2022

Choose a reason for hiding this comment

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

I agree with @greg-intel , this looks like a big change and it seems very "quiet": I tried this command on my system and absolutely nothing was printed. Also, dlogi "Run alsa setting for $PNAME" runs AFTER this, could be confusing.

So either a new dlogi or maybe just this:

-  alsactl init
+  alsactl --debug init

EDIT: no, --debug is too verbose. A dlogi would be great.

Copy link
Collaborator

Choose a reason for hiding this comment

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

So either a new dlogi or maybe just this...

@fredoh9 , ping?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I lost the momentum, need to review what was my intention at first

alsactl init

Copy link
Contributor

Choose a reason for hiding this comment

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

@fredoh9 Note, this should also get the UCM defaults, but it is worth double-checking this does happen (alsactl also has " -D,--ucm-defaults execute also the UCM 'defaults' section" option but AFAIK this should not be needed)

Example default mixer settings for SOF HDA cards are here in alsa-ucm:
https://github.com/alsa-project/alsa-ucm-conf/blob/master/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf

The "True.BootSequence" sections should be executed to put the card into a sane default state.

FYI @greg-intel @marc-hb

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)
Expand All @@ -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
Expand Down