Skip to content
Closed
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
8 changes: 8 additions & 0 deletions alsa_settings/ADLP_RVP_SDW_IPC4ZPH.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set -e

# enable playback
amixer -c sofsoundwire cset name='Headphone Switch' on
amixer -c sofsoundwire cset name='gain.0.1 1 Playback Volume 0' 45
amixer -c sofsoundwire cset name='gain.15.1 Deepbuffer Volume' 45
amixer -c sofsoundwire cset name='gain.1.1 2 Main Playback Volume' 45
amixer -c sofsoundwire cset name='rt711 DAC Surr Playback Volume' 80
15 changes: 15 additions & 0 deletions alsa_settings/CAVS_NOCODEC_IPC4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
set -e

# SSP playback
amixer -c sofnocodec cset name='gain.1.1 Playback Volume 1' 45
amixer -c sofnocodec cset name='gain.15.1 Deepbuffer Volume' 45
amixer -c sofnocodec cset name='gain.2.1 Main Playback Volume 2' 45
amixer -c sofnocodec cset name='gain.3.1 Playback Volume 3' 45
amixer -c sofnocodec cset name='gain.4.1 Main Playback Volume 4' 45
amixer -c sofnocodec cset name='gain.5.1 Playback Volume 5' 45
amixer -c sofnocodec cset name='gain.6.1 Main Playback Volume 6' 45
Copy link
Member

Choose a reason for hiding this comment

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

Can you remind me why we should care about the volume settings in the firmware? This should be 0dB by default, always. the way this is implemented will break for every topology change or rename of controls.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the default volume should be 0dB, but we cannot ensure that these volumes will not be modified before testing alsabat.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@keqiaozhang you mean because other tests may change them? Why?

I've seen a large number of discussions about ALSA settings and UCM for a few years now and I still don't know how the "ideal state" should look like. Exceptions and quirks are sometimes necessary but I still can't tell what is a quirk versus what is a Good Thing. Is this already documented somewhere or would a new https://github.com/thesofproject/sof-test/discussions help?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, the default volume should be 0dB, but we cannot ensure that these volumes will not be modified before testing alsabat.

then use a script to find all gain/PGA for the firmware using regexps and reset the value separately from codec stuff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

then use a script to find all gain/PGA for the firmware using regexps and reset the value separately from codec stuff

Can we merge this PR first? I will try your suggestion next. It's not only related to volume, but also related to switch.

Copy link
Collaborator

Choose a reason for hiding this comment

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

then use a script to find all gain/PGA for the firmware using regexps and reset the value separately from codec stuff.

@keqiaozhang is this what you're trying to do in #1010?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@keqiaozhang is this what you're trying to do in #1010?

Yes, I'm working on it.


# SSP capture
amixer -c sofnocodec cset name='gain.17.1 Main Capture Volume 2' 45
amixer -c sofnocodec cset name='gain.7.1 Main Capture Volume 1' 45
amixer -c sofnocodec cset name='gain.8.1 Host Capture Volume' 45
8 changes: 8 additions & 0 deletions alsa_settings/TGLU_RVP_SDW_IPC4ZPH.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set -e

# enable playback
amixer -c sofsoundwire cset name='Headphone Switch' on
amixer -c sofsoundwire cset name='gain.1.1 1 Playback Volume 0' 45
amixer -c sofsoundwire cset name='gain.15.1 Deepbuffer Volume' 45
amixer -c sofsoundwire cset name='gain.2.1 2 Main Playback Volume' 45
amixer -c sofsoundwire cset name='rt711 DAC Surr Playback Volume' 55
8 changes: 8 additions & 0 deletions alsa_settings/TGLU_UP_HDA_IPC4ZPH.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set -e

# enable headset playback
amixer -c sofhdadsp cset name='Master Playback Switch' on
amixer -c sofhdadsp cset name='Master Playback Volume' 45
amixer -c sofhdadsp cset name='gain.1.1 1 2nd Playback Volume' 45
amixer -c sofhdadsp cset name='gain.15.1 Deepbuffer Volume' 45
amixer -c sofhdadsp cset name='gain.2.1 2 Main Playback Volume' 45
4 changes: 4 additions & 0 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,10 @@ set_alsa_settings()
# common nocodec_ci alsa settings
"$SCRIPT_HOME"/alsa_settings/CAVS_NOCODEC_CI.sh
;;
TGLU_RVP_NOCODEC_IPC4ZPH | ADLP_RVP_NOCODEC_IPC4ZPH)
# common nocodec_ipc4 alsa settings
"$SCRIPT_HOME"/alsa_settings/CAVS_NOCODEC_IPC4.sh
;;
*)
# if script name is same as platform name, default case will handle all
if [ -f "$SCRIPT_HOME"/alsa_settings/"$PNAME".sh ]; then
Expand Down