Skip to content

Conversation

@PLangowski
Copy link
Contributor

Restore the equalizer config to its previous state after test

@PLangowski PLangowski requested review from a team, golowanow, lgirdwood and marc-hb as code owners July 28, 2025 13:29
@sofci
Copy link
Collaborator

sofci commented Jul 28, 2025

Can one of the admins verify this patch?

reply test this please to run this test once

Copy link
Contributor

@redzynix redzynix left a comment

Choose a reason for hiding this comment

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

Looks good, the code is much more readable now.

One comment though, please change the commit title from test-case/check-audio-equalizer.sh: Restore config after test to test-case: check-audio-equalizer.sh: Restore config after test

@PLangowski
Copy link
Contributor Author

@golowanow I applied your suggestions. Could you take a look again?

Copy link
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

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

Minor codestyle suggestions


if [ $ret -ne 0 ]; then
dloge "Equalizer test failure with $conf"
return 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

[ "$ret" -eq 0 ] || die ...

@PLangowski
Copy link
Contributor Author

@marc-hb Fixed, could you look again?


sof-ctl -Dhw:"$sofcard" -c name="$double_quoted_id" -s "$eq_last_conf" || die "Failed to restore equalizer config from $eq_last_conf"

[ "$ret" -eq 0 ] || die "Equalizer test failure with $conf"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
[ "$ret" -eq 0 ] || die "Equalizer test failure with $conf"
[ "$ret" -eq 0 ] || die "$cmd with $conf returned $ret"

Comment on lines 68 to 75
$cmd -D "$dev" -f "$fmt" -c "$channel" -r "$rate" -d "$duration" "$dummy_file" || ret=$?

[ -r "$eq_last_conf" ] ||
die "Failed to read equalizer config from $eq_last_conf"

sof-ctl -Dhw:"$sofcard" -c name="$double_quoted_id" -s "$eq_last_conf" || die "Failed to restore equalizer config from $eq_last_conf"

[ "$ret" -eq 0 ] || die "Equalizer test failure with $conf"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
$cmd -D "$dev" -f "$fmt" -c "$channel" -r "$rate" -d "$duration" "$dummy_file" || ret=$?
[ -r "$eq_last_conf" ] ||
die "Failed to read equalizer config from $eq_last_conf"
sof-ctl -Dhw:"$sofcard" -c name="$double_quoted_id" -s "$eq_last_conf" || die "Failed to restore equalizer config from $eq_last_conf"
[ "$ret" -eq 0 ] || die "Equalizer test failure with $conf"
$cmd -D "$dev" -f "$fmt" -c "$channel" -r "$rate" -d "$duration" "$dummy_file" || ret=$?
[ -r "$eq_last_conf" ] ||
die "Failed to read equalizer config from $eq_last_conf"
sof-ctl -Dhw:"$sofcard" -c name="$double_quoted_id" -s "$eq_last_conf" || die "Failed to restore equalizer config from $eq_last_conf"
[ "$ret" -eq 0 ] || return 1

to keep the current expectation at the caller function.

@golowanow
Copy link
Member

@PLangowski - I don't see results from this changed test probe on our CI, please run it there and let me know where to check.

Save the initial equalizer config to a temporary file and restore
it after each test

Signed-off-by: Pawel Langowski <pawelx.langowski@intel.com>
@PLangowski
Copy link
Contributor Author

@golowanow I'm not sure if it's possible to run a test on CI before merging it. Do you know how to do that?

@golowanow golowanow merged commit 83ff0e1 into thesofproject:main Aug 7, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants