Audio: volume: fix problem with Hifi 4
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.
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
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
@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.
If you ever resume work on this, don't forget to temporarily revert 87571f337c10 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?
@singalsu This is fixed now, right, and we can close this?
Yep, OK to close.