sof icon indicating copy to clipboard operation
sof copied to clipboard

Audio: volume: fix problem with Hifi 4

Open gbernatxintel opened this issue 1 year ago • 5 comments

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.

gbernatxintel avatar May 22 '24 17:05 gbernatxintel

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

gbernatxintel avatar May 22 '24 17:05 gbernatxintel

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

gbernatxintel avatar Jun 10 '24 08:06 gbernatxintel

@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.

lgirdwood avatar Jun 11 '24 15:06 lgirdwood

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.

marc-hb avatar Jun 14 '24 20:06 marc-hb

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

gbernatxintel avatar Jun 18 '24 08:06 gbernatxintel

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

singalsu avatar Jul 19 '24 12:07 singalsu

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

kv2019i avatar Sep 06 '24 10:09 kv2019i

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

Yep, OK to close.

singalsu avatar Sep 11 '24 14:09 singalsu