we can use `-D CONFIG_ASYNC_TCP_TASK_STACK_SIZE=xxxx` to increase the stack size of AsyncWebserver - default is 8196.
This should give us a bit of headroom for new UI items.
We still need PR #94 for more savings.
Especially on 8266, the usermod can cause unexpected shut-downs in default configuration, when A0 is not connected to a battery voltage measurement circuit.
new "Receive or Local" mode:
if UDP sound is missing or interrupted for too long, switch back to local audio input.
UDP sound resumes when a fresh packet is received again.
--> still needs testing, and even more regression testing.
The standard build is sending packets each 20ms, which means there are double packets (no new FFT results yet) and the max. delay between sampling and sending is up to 50ms.
* (FASTPATH only): FFT Task directly notifies UDP send when it has new data, reducing delays to the absolute minimum. this also optimizes UDP packets throughput, by avoiding duplicates.
* (FASTPATH only): receiver polling frequency is increased, to process new packets earlier (may increase CPU load)
UDP transfers have some delays (measured between 2ms and 400ms). As consequence, FFT results sometimes "freeze" for a short time as no new data is arriving.
To hide these freezes, we apply the same "dynamics limiter" method as for volumeSmth.
Some optimizations in FASTPATH mode, to ensure that audio processing takes places as soon as new samples are arriving:
* raise fftTask prio to 4 (above async_tcp) - to ensure that other gimmicks (MQTT, IR, alexa, live preview (ws), json API, or web UI) cannot cause delays by preempting audio.
* changed the "be nice" condition in AR::loop
audioSyncPacket contains four "invisible" padding bytes added by the compiler. These need to be initialized to zero, as future versions of the protocol will make use of these fields.
* 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 ;-)