-
Notifications
You must be signed in to change notification settings - Fork 349
Audio: Mixer: Optimize sources and sink buffers access #4944
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
Audio: Mixer: Optimize sources and sink buffers access #4944
Conversation
4627493 to
2c6b4d1
Compare
lyakh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a couple of minor improvement proposals
2c6b4d1 to
a10ca7d
Compare
a10ca7d to
c4b08e6
Compare
|
I'm keeping this draft until I'm confident it works fully. Cmocka tests only 16 frames of 32 bit data. Nocodec topologies allow test only with 16 bit so 24 bit untested. I need to tweak a topology to allow 16/24/32 for both PCMs. I testing it myself my playing back to L1, R1, L2, R2 different frequencies and then observe the spectrogram for all frequencies to be present in output mix without glitches. |
c4b08e6 to
daecc08
Compare
|
OK, this optimized version with 32 bit processing for 24 bit passed system/merge/build this. Next I will restore the version with proper 24 bit processing for 24 bit. |
65ec6ab to
6c1e916
Compare
kv2019i
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good as well. Very good that you added a comment about the 16x4 SIMD experiment. This is very useful to have in git history.
src/audio/mixer.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could have been a separate commit (and even PR) as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dbaluta shared your thoughts. If preferred I can do one more iteration The system/merge/build step still fails so this can't be merged yet. Please respond if separate PR or commit desired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we split this for bisect. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which way better?
- First fix the bug then optimize
- Optimize but preserve the bug, then fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll go for 1.
I learned afterwards the the stuff at main copy() function level is 6 MCPS while the mixer functions I worked with are 4 MCPS for 2x stereo streams. If the copy() function could improve (buffer locking, unlocking) the SIMD might show more gain. But that should be another PR. |
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to be split patches for bisect (since we have a fix and new feature).
src/audio/mixer.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we split this for bisect. Thanks.
src/audio/mixer.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be a lot better if the sat_int24 implementation had the HIFI implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking that but it would be a quite invasive change. There would be need for saturate from 64b to 24b and 32b to 24b version. 32bi could be with this name, and edit possible uses with 64 bit argument to other components. If you think it's worth the risk (also sat_int16, sat_int32) I could do it. Should I proceed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do this into a separate PR since it impacts nearly every processing component. The saturate optimization was less significant for mixer so it's OK to proceed without.
6c1e916 to
7d58016
Compare
|
Do not merge. Testing just the first commit with 24 bit mixer function add (duplicate of 32 bit with saturate fix). |
7d58016 to
28c58aa
Compare
This patch adds a 24 bit mixer function. Previously 24 bit was handled with 32 bit function. It did not properly saturate the output to 24 bits. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
28c58aa to
50e6eca
Compare
|
@lgirdwood I've addressed your comments now. |
|
SOFCI TEST |
|
SOFCI TEST |
This patch replaces the usage of audio_stream_read/write_frag_sXX() usage with block processing based on audio_stream_bytes_without_wrap(). There are no processing related changes. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
50e6eca to
3ef7e88
Compare
|
Same code, just a minor commit text change to trigger re-run of CI tests. |
Uh oh!
There was an error while loading. Please reload this page.