Skip to content

mux: add channels checking in *_prepare_active_look_up() functions - #3583

Merged
lgirdwood merged 3 commits into
thesofproject:masterfrom
bkokoszx:dell-distortion-fix
Nov 9, 2020
Merged

lgirdwood merged 3 commits into
thesofproject:masterfrom
bkokoszx:dell-distortion-fix

Conversation

@bkokoszx

@bkokoszx bkokoszx commented Nov 4, 2020

Copy link
Copy Markdown
Collaborator

This commit adds channel parameter checking in demux/mux_prepare_active_look_up() functions.
Look up table should not include elements referring to channels higher than those actually set in
source/sink buffers.

fixes #3499

This commit changes prepare_active_look_up() function
name to be mux specific.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
This commit adds channel parameter checking in
mux_prepare_active_look_up() function. Look up
table should not include elements referring to
channels higher than those actually set in
source/sink buffers.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
@bkokoszx
bkokoszx requested a review from akloniex as a code owner November 4, 2020 11:17
@bkokoszx

bkokoszx commented Nov 4, 2020 •

Copy link
Copy Markdown
Collaborator Author

@lgirdwood
As I mentioned in issue #3499 thread, with this PR demux on format 48 32/32 8 uses about 10 MCPS:

[  1051521.562500] (       32.005207) c0 demux        1.1       src/audio/pipeline.c:206  perf comp_copy peak plat 1031 cpu 10787

I've also ask @jdrzaszcz to perform some more tests with it in order to find any other regression. Please do not merge before we will get feedback.

@mengdonglin

Copy link
Copy Markdown
Collaborator

@bkokoszx Can you please add a few more reviewers? The policy is "At least 2 approving reviews are required to merge this pull request." @lgirdwood Can you please review this PR? It's to fix SOF v1.6 sdw audio distorting on the left speakers #3499

Comment thread src/audio/mux/mux.c
if ((cd->lookup[0].copy_elem[elem].in_ch >
(source->channels - 1)) ||
(cd->lookup[0].copy_elem[elem].out_ch >
(sink->channels - 1)))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are the in_ch and out_ch 0 based? Or '>xx->channels -1' here should be 'xx->channels'? The similar question for the demux part also.

@bkokoszx bkokoszx Nov 5, 2020 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@keyonjie
in_ch and out_ch is 0 based here, similar as in demux part.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fwiw, a future optimisation could be the removal of the lookup[0] to just lookup. I dont think we have the need for an array here ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@keyonjie
in_ch and out_ch is 0 based here, similar as in demux part.

OK, then makes sense.

@jdrzaszcz

Copy link
Copy Markdown

Hi, we performed the regression tests and stress tests with PR #3583 and there was no regression.

@lgirdwood

Copy link
Copy Markdown
Member

@jdrzaszcz @zrombel any comment on the CI failures ? Do we need to rerun?

Comment thread src/audio/mux/mux.c
if ((cd->lookup[0].copy_elem[elem].in_ch >
(source->channels - 1)) ||
(cd->lookup[0].copy_elem[elem].out_ch >
(sink->channels - 1)))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fwiw, a future optimisation could be the removal of the lookup[0] to just lookup. I dont think we have the need for an array here ?

@jdrzaszcz

Copy link
Copy Markdown

SOFCI TEST

@jdrzaszcz

Copy link
Copy Markdown

@lgirdwood I rerun CI, but it looks like there is some problem with static code inspection, @bkokoszx will take look at this

@bkokoszx

bkokoszx commented Nov 6, 2020

Copy link
Copy Markdown
Collaborator Author

@lgirdwood
We use several lookups (for each sink stream) in demux case.

@bkokoszx

bkokoszx commented Nov 6, 2020

Copy link
Copy Markdown
Collaborator Author

@lgirdwood
Are we able to merge it?

@juimonen

juimonen commented Nov 6, 2020

Copy link
Copy Markdown

@bkokoszx can you fix the checkpatch thing? otherwise I'm ok with this

This commit adds demux_prepare_active_look_up()
function. It contains channel parameter checking.
Look up table should not include elements referring
to channels higher than those actually set in
source/sink buffers.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
@bkokoszx
bkokoszx force-pushed the dell-distortion-fix branch from bf94ba9 to aea020e Compare November 6, 2020 13:03
@bkokoszx

bkokoszx commented Nov 9, 2020

Copy link
Copy Markdown
Collaborator Author

SOFCI TEST

@bkokoszx

bkokoszx commented Nov 9, 2020

Copy link
Copy Markdown
Collaborator Author

@lgirdwood @juimonen
I've fixed checkpatch error. CI passes now.

@lgirdwood
lgirdwood merged commit 85986e1 into thesofproject:master Nov 9, 2020
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.

[BUG] Intermittent audio distortion on Dell 9700 / sof-cml-rt711-rt1308-rt715.tplg / firmware 1.6

6 participants