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

volume: fix processing size in HiFi3 implementation #81

Merged
merged 1 commit into from
Jul 13, 2018

Conversation

tlauda
Copy link
Contributor

@tlauda tlauda commented Jul 11, 2018

HiFi3 implementation for volume used wrong buffer size,
which caused buffer overflow.

Signed-off-by: Tomasz Lauda [email protected]

@wenqingfu
Copy link

[FAILED][build][SOF Firmware: sof/pr/81] 4e43d9be12451fb1e3f5e7f8fffb8a3d1704dde5

@tlauda
Copy link
Contributor Author

tlauda commented Jul 11, 2018

Can we repeat the build?
It's a simple change and I don't really get why it failed.
CI uses gcc to build FW and this code will only compile for xcc, so it's even more strange.

@@ -60,7 +60,7 @@ static void vol_s16_to_s16(struct comp_dev *dev, struct comp_buffer *sink,
ae_f16x4 in_sample;
size_t channel;
int i;
int limit = source->size / (dev->params.channels << 1);
int limit = cd->source_period_bytes / (dev->params.channels << 1);
Copy link
Member

Choose a reason for hiding this comment

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

is this really equivalent to the generic code?
The generic code iterations are controlled by dev->frames, here you are making a reference to the source period, is this matching?

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, it's exactly the same as the generic code.
Previously it was incorrect, because it was using the size of the whole buffer instead of the size of currently processed period.

Copy link
Member

Choose a reason for hiding this comment

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

What I was trying to say is that the code would be "more similar" if you used the same dev->frames in the loop. the source_period_bytes is derived from dev->frames, so might as well use the latter for symmetry.

@plbossart
Copy link
Member

plbossart commented Jul 11, 2018

The code compiles alright for APL with xt-xcc, the CI fail is likely a problem due to GCC being broken...

@wenqingfu
Copy link

do you mean the way CI use GCC is wrong or #78 ?

@plbossart
Copy link
Member

plbossart commented Jul 11, 2018 via email

@mengdonglin
Copy link
Collaborator

Building failure observed by SOF CI.

SUMMARY

stage: build
result: FAILED
Successful Platform: None
Failed Platform: baytrail apollolake cannonlake trigger commit: SOF Firmware

SOF Firmware COMMIT

branch : sof/pr/81
commit : 4e43d9be12451fb1e3f5e7f8fffb8a3d1704dde5
subject: volume: fix processing size in HiFi3 implementation
date : 2018-07-11 17:40:57 +0800
author : Tomasz Lauda [email protected]

SOF Topology COMMIT

branch : soft/master
commit : 47339d2
subject: Merge pull request #22 from keqiaozhang/tplgfix
date : 2018-07-11 05:25:39 +0800
author : Liam Girdwood [email protected]

DETAILS

Platform: baytrail FAIL
Logs for Debug:
stdout: http://bee.sh.intel.com/~lkp//result/build-sof/baytrail/4e43d9be12451fb1e3f5e7f8fffb8a3d1704dde5/47339d2302f445c3b35d50f9720ee649dd2f739b/0/stdout
stderr: http://bee.sh.intel.com/~lkp//result/build-sof/baytrail/4e43d9be12451fb1e3f5e7f8fffb8a3d1704dde5/47339d2302f445c3b35d50f9720ee649dd2f739b/0/stderr

Platform: apollolake FAIL
Logs for Debug:
stdout: http://bee.sh.intel.com/~lkp//result/build-sof/apollolake-up2/4e43d9be12451fb1e3f5e7f8fffb8a3d1704dde5/47339d2302f445c3b35d50f9720ee649dd2f739b/0/stdout
stderr: http://bee.sh.intel.com/~lkp//result/build-sof/apollolake-up2/4e43d9be12451fb1e3f5e7f8fffb8a3d1704dde5/47339d2302f445c3b35d50f9720ee649dd2f739b/0/stderr

Platform: cannonlake FAIL
Logs for Debug:
stdout: http://bee.sh.intel.com/~lkp//result/build-sof/cannonlake/4e43d9be12451fb1e3f5e7f8fffb8a3d1704dde5/47339d2302f445c3b35d50f9720ee649dd2f739b/0/stdout
stderr: http://bee.sh.intel.com/~lkp//result/build-sof/cannonlake/4e43d9be12451fb1e3f5e7f8fffb8a3d1704dde5/47339d2302f445c3b35d50f9720ee649dd2f739b/0/stderr

Jenkins Info for CI Developers

Check console output at http://bee.sh.intel.com:8080/job/lkp-sof/559/

HiFi3 implementation for volume used wrong buffer size,
which caused buffer overflow.

Signed-off-by: Tomasz Lauda <[email protected]>
@tlauda tlauda force-pushed the topic/volume_processing branch from 4e43d9b to b56e6ac Compare July 13, 2018 08:33
@tlauda
Copy link
Contributor Author

tlauda commented Jul 13, 2018

Changed to dev->frames to be more similar to generic code.

Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

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

thanks for the update, looks good to me!

@plbossart
Copy link
Member

compiled and tested on Up^2, no issues with volume (except for zipper noise but this is a different bug) -> merge.

@plbossart plbossart merged commit 295d0c1 into thesofproject:master Jul 13, 2018
@tlauda tlauda deleted the topic/volume_processing branch November 22, 2019 11:26
lyakh pushed a commit to lyakh/sof that referenced this pull request Nov 23, 2020
Added working demo using GStreamer Java bindings
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