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

Reset all PGA volume to 0dB #953

Merged
merged 3 commits into from
Sep 8, 2022
Merged

Conversation

keqiaozhang
Copy link
Contributor

No description provided.

@marc-hb
Copy link
Collaborator

marc-hb commented Aug 29, 2022

Can you clarify the relationship with

@keqiaozhang
Copy link
Contributor Author

Can you clarify the relationship with

I think #951 is only reset the volume for nocodec devices. But we found the plain arecord issue(thesofproject/linux#3804) on many other models recently:
http://sof-ci.sh.intel.com/#/result/planresultdetail/14968?model=ADLP_SKU0B00_SDCA_ZEPHYR&testcase=multiple-pause-resume-50
http://sof-ci.sh.intel.com/#/result/planresultdetail/14926?model=ADLP_BRYA_I2S&testcase=check-pause-resume-capture-100
...
This is because the PGA capture volume being turned to the maximum after the volume_basic_test.sh. So I added a function to reset the PGA volume to 0dB for all our models at the end of the volume test.

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.

What do you think of this warning? I know it's off-topic but it looks like a serious bug; serious enough to require fixing before changing other, more minor problems.

In test-case/volume-basic-test.sh line 65:
for i in $(seq 1 $maxloop)
^-^ SC2167: This parent loop has its index variable overridden.


In test-case/volume-basic-test.sh line 70:
    for i in "${pgalist[@]}"
    ^-^ SC2165: This nested loop overrides the index variable of its parent.

case-lib/lib.sh Outdated Show resolved Hide resolved
test-case/volume-basic-test.sh Outdated Show resolved Hide resolved
test-case/volume-basic-test.sh Outdated Show resolved Hide resolved
After the volume test, all PGA* volume will be set to MAX. This
affects other cases, such as pause/resume related tests(SOF#3804)
To avoid such issue, we need to reset all PGA volume to default
0dB after the volume test.

Signed-off-by: Keqiao Zhang <[email protected]>
@keqiaozhang
Copy link
Contributor Author

keqiaozhang commented Sep 5, 2022

serious enough to require fixing before changing other, more minor problems.

I will fix these warnings in another PR next.
[Edit]: fixed the shellcheck warnings in this PR.

fredoh9
fredoh9 previously approved these changes Sep 7, 2022
Copy link
Collaborator

@fredoh9 fredoh9 left a comment

Choose a reason for hiding this comment

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

Thank you for finding the root cause why all PGAs are 100%, I totally forgot about volume test. Resetting to 0 db works.
And shellcheck fixes are also good catch.

Let volume test run first before alsabat test after this.

@marc-hb
Copy link
Collaborator

marc-hb commented Sep 7, 2022

replace the index name to kctl for the nested loop
it may overrides the index variable of its parent.

Thanks for the fix. I haven't read the code but it looks like a very serious fix? Maybe the title of the commit message should not be "fix shellcheck warning" like it's just pleasing shellcheck and nothing else. The reason why we use shellcheck is because sometimes it can find serious bugs like this one and it's worth all the other times when it reports non-serious issues.

First, the pid is never assigned, replace it with aplay.
second, replace the index name to kctl for the nested loop
it may overrides the index variable of its parent.

Signed-off-by: Keqiao Zhang <[email protected]>
@keqiaozhang
Copy link
Contributor Author

Let volume test run first before alsabat test after this.

I will change the test case order.

@keqiaozhang
Copy link
Contributor Author

Maybe the title of the commit message should not be "fix shellcheck warning" like it's just pleasing shellcheck and nothing else.

I have revised the commit message.

reset_PGA_volume()
{
# set all PGA* volume to 0dB
amixer -Dhw:0 scontrols | sed -e "s/^.*'\(.*\)'.*/\1/" |grep PGA |

Choose a reason for hiding this comment

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

for IPC4 the volume control are named as gain, I think you should also grep gain here.

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, you are right. But the volume-base-test.sh only support PGA control ATM. The volume test is skipped on all our IPC4 platforms. I can submit another PR for IPC4.

@aiChaoSONG
Copy link

merge for v2.3 test.

@aiChaoSONG aiChaoSONG merged commit f5b00be into thesofproject:main Sep 8, 2022
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.

4 participants