arduino-libraries/ArduinoSound

zero value buffer occasionally appears in I2S reading

Opened this issue · 0 comments

Hi,

When I modify the arduinosound library for my own operation, I found a wired issue.

I read the AmplitudeAnalyzer::update(const void* buffer, size_t size) function play the key role for further operation with I2S reading data. And the easiest way is to modify the rms functions: arm_rms_q31((q31_t*)buffer, size / 4, (q31_t*)&analysis)

But when I simply change the above sentence to

q31_t* tmp = (q31_t*)buffer;
_analysis = *tmp;

There appears zero value buffer occasionally (sometimes correct, but sometimes only shows zeros through serial print. And it will turn to zero and then turn to correct values).

I am not sure what is the problem cause I didn't change other logic in ArudioSound. Is there other magic in the rms functions?