-
Notifications
You must be signed in to change notification settings - Fork 349
Audio: volume: fix problem with Hifi 4 #9158
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
Conversation
The issue of incorrect signal amplitude when the frame equals 45 has been fixed. When we sample the signal at a frequency of 44.1kHz, the frame equals 44, and every 10th period it equals 45. However, the value of 45 was not handled correctly. As a solution, processing for samples that are not processed as a result of division by 4 has been added. Signed-off-by: Grzegorz Bernat <grzegorzx.bernat@intel.com>
|
Set to draft because during the test The problem occurs for frequencies: 22,05kHz and 44,1kHz |
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 nice fix!
| m = n >> 2; | ||
| int left = n & 0x03; | ||
| /* Process samples in blocks of 4*/ | ||
| for(i =0; i<m; i++) { |
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.
indentation and spaces
| in = audio_stream_wrap(source, in); | ||
| out = audio_stream_wrap(sink, out); | ||
| in = (ae_f16x4 *)audio_stream_wrap(source, in); | ||
| out = (ae_f16x4 *)audio_stream_wrap(sink, out); |
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.
in C type-casts between void * and other pointer types aren't needed (as long as const and various attributes are preserved)
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.
Unneeded casts are harmful because they mask type errors.
|
@gbernatxintel with 44.1k and 1ms timer we will have variable frame count, however pipeline is optimized for fixed frame count that also aligns with the SIMD data width (and HiFi4 SIMD width > Hifi3 width). With this is mind we need to add some headroom (for extra frames) in the buffer and deal with the extra frames when they reach the SIMD data size. e.g. |
|
If you ever resume work on this, don't forget to temporarily revert 87571f3 when submitting to Github so CI can provide some test coverage. Then drop the revert at the last minute. |
|
Checked on the LNL platform, the fix works exactly the same as on MTL. Still appears glitch at the beginning of the signal |
|
@lgirdwood @gbernatxintel OK, I will try to continue from this next week. |
|
@singalsu This is fixed now, right, and we can close this? |
Yep, OK to close. |

The issue of incorrect signal amplitude when the frame equals 45 has been fixed. When we sample the signal at a frequency of 44.1kHz, the frame equals 44, and every 10th period it equals 45. However, the value of 45 was not handled correctly. As a solution, processing for samples that are not processed as a result of division by 4 has been added.