Skip to content

Conversation

@arikgreen
Copy link
Contributor

@arikgreen arikgreen commented May 30, 2025

Add the default volume settings for PTLH SDW RT712. The level sets to 100% for these controls is a reason of failing the check-alsabat-headset-* tests.
The previous test case volume-basic-test-50.sh increrases the volume levels to 100% and do not revert to previous setting.

Internal Jira: SOFC2-1031

This is the log from passed run of one of the tests:

TPLG=/lib/firmware/intel/sof-ipc4-tplg/sof-ptl-rt712-l2-rt1320-l1.tplg MODEL=PTLH_SDW_RT712 SOF_TEST_INTERVAL=5 ~/sof-test/test-case/check-alsabat.sh -p hw:sofsoundwire,0 -c hw:sofsoundwire,1 -C 2 -F 599
2025-05-30 09:16:16 UTC [INFO] ktime=2617 sof-test PID=2976: starting
2025-05-30 09:16:16 UTC [INFO] Run alsa setting for PTLH_SDW_RT712
numid=14,iface=MIXER,name='Headphone Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=2,iface=MIXER,name='rt712 FU05 Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=87,step=0
  : values=80,80
  | dBscale-min=-65.25dB,step=0.75dB,mute=0
numid=1,iface=MIXER,name='rt712 FU06 Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=87,step=0
  : values=80,80
  | dBscale-min=-65.25dB,step=0.75dB,mute=0
numid=15,iface=MIXER,name='Headset Mic Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=3,iface=MIXER,name='rt712 FU0F Capture Switch'
  ; type=BOOLEAN,access=rw------,values=2
  : values=on,on
numid=4,iface=MIXER,name='rt712 FU0F Capture Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=63,step=0
  : values=46,46
  | dBscale-min=-17.25dB,step=0.75dB,mute=0
numid=43,iface=MIXER,name='Pre Mixer Jack Out Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=45,step=0
  : values=43,43
  | dBscale-min=-90.00dB,step=2.00dB,mute=1
numid=44,iface=MIXER,name='Post Mixer Jack Out Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=45,step=0
  : values=43,43
  | dBscale-min=-90.00dB,step=2.00dB,mute=1
numid=46,iface=MIXER,name='Pre Mixer Deepbuffer Jack Out Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=45,step=0
  : values=43,43
  | dBscale-min=-90.00dB,step=2.00dB,mute=1
numid=47,iface=MIXER,name='Pre Mixer Speaker Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=45,step=0
  : values=43,43
  | dBscale-min=-90.00dB,step=2.00dB,mute=1
numid=48,iface=MIXER,name='Post Mixer Speaker Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=45,step=0
  : values=43,43
  | dBscale-min=-90.00dB,step=2.00dB,mute=1
2025-05-30 09:16:16 UTC [INFO] Starting /usr/local/bin/mtrace-reader.py >& ~/sof-test/logs/check-alsabat/2025-05-30-09:16:16-15322/mtrace.txt &
2025-05-30 09:16:16 UTC [INFO] check the PCMs before alsabat test
Warning: Some sources (like microphones) may produce inaudible results
         with 8-bit sampling. Use '-f' argument to increase resolution
         e.g. '-f S16_LE'.
2025-05-30 09:16:19 UTC [COMMAND] alsabat -Phw:sofsoundwire,0 --standalone -n 240000 -r 48000 -c 2 -f S16_LE -F 599 -k 2.1
alsa-utils version 1.2.9

Entering playback thread (ALSA).
Get period size: 3000  buffer size: 24000
Playing generated audio sine wave
2025-05-30 09:16:20 UTC [COMMAND] alsabat -Chw:sofsoundwire,1 -c 2 -r 48000 -f S16_LE -F 599 -k 2.1
alsa-utils version 1.2.9

Entering capture thread (ALSA).
Get period size: 3000  buffer size: 24000
Recording ...
Capture completed.

BAT analysis: signal has 65536 frames at 48000 Hz, 2 channels, 2 bytes per sample.

Channel 1 - Checking for target frequency 599.00 Hz
Amplitude: 21253.2; Percentage: [64]
Detected peak at 599.12 Hz of 38.82 dB
 Total 42.0 dB from 589.60 to 608.64 Hz
 PASS: Peak detected at target frequency
Detected at least 1 signal(s) in total

Channel 2 - Checking for target frequency 599.00 Hz
Amplitude: 21329.7; Percentage: [65]
Detected peak at 599.12 Hz of 38.82 dB
 Total 42.0 dB from 589.60 to 608.64 Hz
 PASS: Peak detected at target frequency
Detected at least 1 signal(s) in total

Return value is 0
Playback completed.

Return value is 0
2025-05-30 09:16:24 UTC [INFO] Starting func_exit_handler(0)
2025-05-30 09:16:24 UTC [INFO] pkill -TERM -f mtrace-reader.py
2025-05-30 09:16:24 UTC [INFO] nlines=251~/sof-test/logs/check-alsabat/2025-05-30-09:16:16-15322/mtrace.txt
+ grep -B 2 -A 1 -i --word-regexp -e ERR -e ERROR -e '<err>' -e OSError ~/sof-test/logs/check-alsabat/2025-05-30-09:16:16-15322/mtrace.txt
2025-05-30 09:16:24 UTC [INFO] ktime=2625 sof-test PID=2976: ending
2025-05-30 09:16:24 UTC [INFO] Test Result: PASS!

and failed run before these changes

TPLG=/lib/firmware/intel/sof-ipc4-tplg/sof-ptl-rt712-l2-rt1320-l1.tplg MODEL=PTLH_SDW_RT712 SOF_TEST_INTERVAL=5 ~/sof-test/test-case/check-alsabat.sh -p hw:sofsoundwire,0 -c hw:sofsoundwire,1 -C 2 -F 599
2025-05-29 14:08:23 UTC [REMOTE_INFO] ktime=3356 sof-test PID=40710: starting
2025-05-29 14:08:23 UTC [REMOTE_INFO] Run alsa setting for PTLH_SDW_RT712
numid=14,iface=MIXER,name='Headphone Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=2,iface=MIXER,name='rt712 FU05 Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=87,step=0
  : values=80,80
  | dBscale-min=-65.25dB,step=0.75dB,mute=0
numid=1,iface=MIXER,name='rt712 FU06 Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=87,step=0
  : values=80,80
  | dBscale-min=-65.25dB,step=0.75dB,mute=0
numid=15,iface=MIXER,name='Headset Mic Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=3,iface=MIXER,name='rt712 FU0F Capture Switch'
  ; type=BOOLEAN,access=rw------,values=2
  : values=on,on
numid=4,iface=MIXER,name='rt712 FU0F Capture Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=63,step=0
  : values=46,46
  | dBscale-min=-17.25dB,step=0.75dB,mute=0
2025-05-29 14:08:23 UTC [REMOTE_INFO] Starting /usr/local/bin/mtrace-reader.py >& ~/sof-test/logs/check-alsabat/2025-05-29-14:08:23-14144/mtrace.txt &
2025-05-29 14:08:23 UTC [REMOTE_INFO] check the PCMs before alsabat test
2025-05-29 14:08:26 UTC [REMOTE_COMMAND] alsabat -Phw:sofsoundwire,0 --standalone -n 240000 -r 48000 -c 2 -f S16_LE -F 599 -k 2.1
2025-05-29 14:08:27 UTC [REMOTE_COMMAND] alsabat -Chw:sofsoundwire,1 -c 2 -r 48000 -f S16_LE -F 599 -k 2.1
WARNING: Signal overflow!
 FAIL: Peak freq too high 1797.36 Hz
 FAIL: Peak freq too high 4193.12 Hz
alsa-utils version 1.2.9

Entering capture thread (ALSA).
Get period size: 3000  buffer size: 24000
Recording ...
Capture completed.

BAT analysis: signal has 65536 frames at 48000 Hz, 2 channels, 2 bytes per sample.

Channel 1 - Checking for target frequency 599.00 Hz
Amplitude: 40391.8; Percentage: [123]
Detected peak at 599.12 Hz of 37.62 dB
 Total 40.7 dB from 589.60 to 607.91 Hz
 PASS: Peak detected at target frequency
Detected peak at 1797.36 Hz of 28.28 dB
 Total 41.5 dB from 1793.70 to 1800.29 Hz
Detected peak at 4193.12 Hz of 22.02 dB
 Total 41.6 dB from 4193.12 to 4193.12 Hz
Detected at least 3 signal(s) in total

Return value is -1003
2025-05-29 14:08:29 UTC [REMOTE_INFO] Starting func_exit_handler(1)
2025-05-29 14:08:29 UTC [REMOTE_ERROR] Starting func_exit_handler(), exit status=1, FUNCNAME stack:
2025-05-29 14:08:29 UTC [REMOTE_ERROR]  main()  @  ~/sof-test/test-case/check-alsabat.sh
2025-05-29 14:08:29 UTC [REMOTE_INFO] pkill -TERM -f mtrace-reader.py
2025-05-29 14:08:29 UTC [REMOTE_INFO] nlines=262 ~/sof-test/logs/check-alsabat/2025-05-29-14:08:23-14144/mtrace.txt
+ grep -B 2 -A 1 -i --word-regexp -e ERR -e ERROR -e '' -e OSError ~/sof-test/logs/check-alsabat/2025-05-29-14:08:23-14144/mtrace.txt
2025-05-29 14:08:29 UTC [REMOTE_INFO] ktime=3362 sof-test PID=40710: ending
2025-05-29 14:08:29 UTC [REMOTE_WARNING] Process(es) started by ~/sof-test/test-case/check-alsabat.sh are still active, killing these process(es):
2025-05-29 14:08:29 UTC [REMOTE_WARNING] Catch pid: 40820 alsabat -Phw:sofsoundwire,0 --standalone -n 240000 -c 2 -r 48000 -f S16_LE -F 599 -k 2.1
2025-05-29 14:08:29 UTC [REMOTE_WARNING] Kill cmd:'alsabat -Phw:sofsoundwire,0 --standalone -n 240000 -c 2 -r 48000 -f S16_LE -F 599 -k 2.1' by kill -9
2025-05-29 14:08:29 UTC [REMOTE_INFO] Test Result: FAIL!

@arikgreen arikgreen requested a review from gbarkadiusz May 30, 2025 09:38
@arikgreen arikgreen requested review from a team, golowanow, lgirdwood and marc-hb as code owners May 30, 2025 09:38
@arikgreen arikgreen added the type:bug Something doesn't work as expected label May 30, 2025
@arikgreen arikgreen requested a review from Copilot May 30, 2025 09:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the ALSA settings for PTLH SDW RT712 to address issues with failing headset tests by setting the default volume levels to 95% instead of 100%.

  • Adds new amixer commands to set default volume levels for various controls
  • Aims to prevent volume levels from being mistakenly left at 100% which previously caused test failures

Copy link
Contributor

@gbarkadiusz gbarkadiusz left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@LukaszMrugala LukaszMrugala left a comment

Choose a reason for hiding this comment

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

GitHub tests don't run on RT712, so those fails can be disregarded.
Change to the script is valid and gives us proper results - tests passing. However, a more thorough look at the cause is needed - I've created the Issue #1275 about it.

amixer -c sofsoundwire cset name='rt712 FU0F Capture Switch' on
amixer -c sofsoundwire cset name='rt712 FU0F Capture Volume' 46

# set default volume levels
Copy link
Member

Choose a reason for hiding this comment

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

I wonder does it help to avoid 'Signal overflow' reducing the playback volume instead, e.g. from 80 to 50 ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That "overflow" comment just hit a MAX nerve... take a look at:

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, reducing the playback volume also fixed the issue

@arikgreen arikgreen force-pushed the awilczax/fix-alsabat-ptlh-set-playback-volume branch from 0f47a34 to 6004f44 Compare June 2, 2025 07:32
Change the default playback volume settings for PTLH SDW RT712.
Reduce volume from 80 to 60.
The level sets to 80 for these controls is a reason of failing
the check-alsabat-headset-* tests.

Internal Jira: SOFC2-1031

Signed-off-by: Artur Wilczak <arturx.wilczak@intel.com>
@arikgreen arikgreen force-pushed the awilczax/fix-alsabat-ptlh-set-playback-volume branch from 6004f44 to 26a2b15 Compare June 2, 2025 08:39
@golowanow golowanow merged commit 863ab70 into thesofproject:main Jun 2, 2025
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something doesn't work as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants