Hub75 is very memory hungry. So we try to make a bit more RAM available
* use 16bit samples when compiling with HUB75 support --> 3KB saved
* avoid using aPLL (HUB75 needs it)
* move audio buffers from BSS (always allocated) to heap (only allocated when FFTtask runs) --> 10Kb saved
* suspend live preview for 6 seconds when out-of-memory
Please note that these statements are included for clarification purposes only.
WLED-MM specific source code is always provided under GPLv3, see LICENSE.
* added ESP_INTR_FLAG_IRAM to reduce lost samples (only on ESP32 without PSRAM) --> may cause crash if used wrongly
* FFT_MajorPeak stabilized, by ignoring extreme results
* remove double Wire.begin() - Wire cannot be re-initialized; its already started by pinManager.joinWire()
* Only use global I2C pins; make sure that audireactive I2C settings are aligned with global I2C pins
* minor cleanup
* remove I2C pins from AudioSource::initialize()
Note to self: sdaPin, sclPin are just dummy values now, good for UI consistency, but unused otherwise. Could be removed.
* debug messages added to different initializers
* SPH0654::initialize() was having a wrong signature: uint8 instead of int8.
C++ can be a real bastard ;-)
In contrast to upstream, MM follows a "no pin stealing" approach, so the Wire interfaces are only initialized when needed.
pinManager.joinWire() will take care of the details, and will return false if something went wrong.
using a dynamic array for newSamples[num_samples] was never needed. It was a risks as the buffer was allcated/deallocated with every call of getSamples().
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