On the ESP32 it seems the i2s clock set will cause a hiccup, even
if it's setting the exact same clock as before.
Avoid it by only setting the I2S clock if it differs from the last set.
Initialize it to 0hz to ensure the first setRate call always works.
Supercedes #656
Very minor fix for damaged SoundFont files.
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
MP3 comes in chunks of encoded data started by a header sequence.
Scan for it in the decoder and only pass in data that starts with
this header to avoid the burst errors
Avoids a avalanche of `lost synchronization` error reports when there
is a file error.
Also enable additional sketches on the RP2040/RP2350
U64 big/little endian mismatch for ARM cores. Remove the whole PowerPC support option as there aren't any commerically significant PPC embedded systems still being developed.
* Performance improvement
- new tsf_note_on_fast returning playIndex and removing lowpass filter setup since it is not being processed in tsf_voice_render_fast anyway but is consuming a lot of cpu
- new tsf_note_off_fast using playIndex to stop voices faster
- Removing lowpass filter setup from tsf_voice_render_fast since it is not being processed
- Math tweaks trying to avoid complex math operations (specially conversions) at voice render stage
- Precalculating *F32P32 values to avoid doing them at voice render stage
* Fixing data type
* Initializing play indexes
---------
Co-authored-by: Edgar <edgar.coria@xema.tech>
Implement the renamed network client and other API changes when built
under the 3.x branch of the Arduino ESP32 core.
Disable building TSF on the ESP32, the Xtensa G++ backend bug is still there.
Minimal changes to get I2S to build under new IDF. Deprecated but
not removed, so warnings are expected but should not be fatal in
use.
Fixes#683
ESP32: When calling destructor after stop, and then create a new object, then an error is shown "I2S: register I2S object to platform failed" because i2s_driver_uninstall had not been called.
ESP8266 : i2s_end is not called when stopping, but i2sOn is false, resulting in new call i2s_rxtx_begin
Fix examples to build on RP2040
Clean up generator warnings
No SPDIF on RP2040 (yet)
Add back C sources for AAC on ARM
No WiFi streaming on RP2040
No webradio on RP2040
No talking clock (NTP) on RP2040 either
The I2S subsystem was rewritten in the RP2040 core V2.0, so update to
use the new object and calls.
Also clean up some code warnings and remove SPIFFS from the RP2040\
Updated code to correctly call the parent classes constructor for the RP2040.
Changed the code for the RP2040 to correctly call the parent classes constructor.
* Fix a tricky bug that causes delays in playback
... this bug was already present in stellaplayer. Obviously "effectNumber" must be checked, because "effectParameterX" just holds the "upper nibble" of effectParameter
* fix for issue #474
- do channel mixing in 32bit, to avoid noise from over/underflow
- write audio output as "signed int" (not unsigned)
- add int16 saturation check ("clipping")
* avoid crash when MOD file has to many CHANNELS
- avoid guru meditation, by logging an error and refusing playback in case MOD.numberOfChannels > CHANNELS
- correct small typo
* internal DAC: avoid possible overflow in conversion int16 -> uint16
* update constants
.. we can do 16bit and 8 channels, so let's do it ;-)
This adds some debugging code to better understand what is going on inside the mixer code (AudioGeneratorMOD::GetSample). And it also prints out some usefull information from the MOD file.
Only active when do_MIXER_DEBUG is defined.
* MOD generator: 12 bits of "real" resolution (instead of 10)
With this change, we gain 2 additional bits of "real resolution" from the sample interpolation step.
Still need some testing to be sure that nothing get "lost" at the same time.
* limit to 4 channels on ESP8266
As discussed in https://github.com/earlephilhower/ESP8266Audio/pull/479#issuecomment-1007708703
Fixes#474
This bug was already present in stellaplayer. Obviously "effectNumber" must be checked, because "effectParameterX" just holds the "upper nibble" of effectParameter
- do channel mixing in 32bit, to avoid noise from over/underflow
- write audio output as "signed int" (not unsigned)
- add int16 saturation check ("clipping")
* avoid crash when MOD file has to many CHANNELS
- avoid guru meditation, by logging an error and refusing playback in case MOD.numberOfChannels > CHANNELS