some optimizations for -C3.
* skip every second FFT, and use interpolation instead.
* reduce sampling rate from 22Khz to 18Khz
* new debug measurement for I2S cycle times (FFTTask)
--> in total, this brings CPU load for sound processing down to 60% (from >100% previously)
got myself an adafruit "qt py -S2" with tinyUF2 bootloader. So I wanted to get that working. And it does work :-).
FFT time = 10ms (instead of 2ms on classic ESP32) is a very good result, also virtual USB runs much better now.
- prepare for merging upstream
--> audiorective files should stay the same after merging!
- makuna just release NeoPixelBus 2.7.1 -> use for "V4" build
This introduces an optional band pass filtering step to remove low frequency noise. Very effective for PDM mics - reduces noise floor by a factor of 100 !
- I2S DAC devices utilize the complete sample range [-32767 ... 32768], while I2S microphones typically deliver samples in [-2047... 2047]. Down-scaling Line-in samples ensures that filters and AGC operate optimally.
- use aPLL clock source for I2S with MCLK
- experimental: I2S slave mode (however could not get it to work ...)
I2S microphones were not working any more in with the newest framework - only delivers silence.
Ther reason is stupid bug in espressif I2S "compatibility" driver: RIGHT and LEFT channel are swapped, so when only asking for LEFT, we get silence from RIGHT.
Workaround: simply change LEFT to RIGHT, until the problem is fixed in ESP-IDF --> Fix tested on "classic ESP32", but still need to check behavior on -S3.
Code compiles also on -S3, -S2, and -C3.
smaller changes:
- a few changes to use new APIs (MCLK, rouing and sample resolution)
- a few additional debug messages
- put correct value into _pinConfig.mck_io_num
improved ADCsample processing, including replacement of "rogue" samples from other channels (this happens at least once in 5 seconds !!).
It compiles, don't ship it yet - needs more testing.
- smoothing FFTResult (don't have a matrix to test)
- UDP sound sync improvements
- some bugfixes from SR WLED
- button.cpp: avoid starvation: strip.isUpdating() can be true for a long time.
work in progress - still needs testing!!
-new methods: getType(), isInitailized(), postProcessSample()
- allow users to compile for RIGHT audio channel (-D I2S_USE_RIGHT_CHANNEL)
- better handling in case audio input driver failed to initialize
- removed some unneeded code and unneeded parameters