Skip to content

Conversation

@gbernatxintel
Copy link
Contributor

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.

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>
@gbernatxintel gbernatxintel marked this pull request as draft May 22, 2024 17:06
@gbernatxintel
Copy link
Contributor Author

Set to draft because during the test
"tests/avs/fw_01_base_fw_modules/test_09_peak_vol.py::TestPeakVolFull::test_01_09_peakvol_quality[44100Hz_16in16bit_1ch-0]"
there is an issue with the first period after signal is processing correctly; there is still a lack of signal processing.

The problem occurs for frequencies: 22,05kHz and 44,1kHz
However, for frequencies 88,2kHz and higher it is already correct processing

Copy link
Collaborator

@lyakh lyakh left a 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++) {
Copy link
Collaborator

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);
Copy link
Collaborator

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)

Copy link
Collaborator

@marc-hb marc-hb Jun 13, 2024

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
Copy link
Contributor Author

Currently, after the fix, the program processes 88.2kHz and higher frequencies correctly. For lower frequencies glitch appears which is not trivial. Below are the test results

image

@lgirdwood
Copy link
Member

lgirdwood commented Jun 11, 2024

@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.
44, (9 times) 45 for HiFi3 may become
44 (19 times) 46 for HiFi4
@singalsu pls chime in.

@marc-hb
Copy link
Collaborator

marc-hb commented Jun 14, 2024

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.

@gbernatxintel
Copy link
Contributor Author

Checked on the LNL platform, the fix works exactly the same as on MTL. Still appears glitch at the beginning of the signal

@lgirdwood lgirdwood added this to the v2.11 milestone Jul 4, 2024
@singalsu
Copy link
Collaborator

@lgirdwood @gbernatxintel OK, I will try to continue from this next week.

@singalsu singalsu removed their assignment Sep 5, 2024
@kv2019i
Copy link
Collaborator

kv2019i commented Sep 6, 2024

@singalsu This is fixed now, right, and we can close this?

@kv2019i kv2019i removed this from the v2.11 milestone Sep 10, 2024
@singalsu
Copy link
Collaborator

@singalsu This is fixed now, right, and we can close this?

Yep, OK to close.

@singalsu singalsu closed this Sep 11, 2024
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.

6 participants