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
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
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\
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
* Update AudioOutputI2S.cpp
* Update AudioOutputSPDIF.cpp
* Fix PDM & DAC mode ESP32
The code for enabling compatibility with ESP32C3 had broken DAC builtin and PDM mode on ESP32. This should fix it again
* Update AudioOutputI2S.cpp
* ESP32-C3 has no ULP coprocessor
Only the ESP32, ESP32-S2 and ESP32-S3 chips have an ULP coprocessor, ESP32-C3 doesn't have it. So exclude this code from compiling, as it cannot compile in the C3 environment.
* uint32_t and size_t is not the same on RISC-V
This change is necessary to be able to compile it on ESP32-C3
* uint32_t and size_t is not the same on RISC-V
The change is necessary to compile it on ESP32-C3
* ESP32-C3: I2S_MODE_DAC_BUILT_IN / I2S_MODE_PDM not available
On some ESP32 chips (e.g. ESP32-C3), builtin DAC is not possible as it lacks the hardware module. In order to be able to compile the library on ESP32-C3 the defines cannot be used.
* esp8266: Allows I2S-NoDAC to use only I2S-out-data GPIO
avoiding conflicts with repurposed GPIO, especially conflicting with SDFS.
* +message
* new upstream API update
* check i2s_begin's return value
The BCK and WS pins aren't needed or used when using the I2SNoDAC
option. Restore their settings to whatever they were before, leaving
them untouched. Apps may configure the additional pins either before or
after the I2SNoDac is created.
* make dma_buf_count configurable by user, so we can have a larger dma buffer on esp32
* fix comment about interrupt priority (see esp-idf documentation system/intr_alloc)
The I2S outputs were converting samples in the buffer passed in
from u8->s16 on every call. When the I2S was full, however, the
sample would not get pushed and the output function would be
called at a later time with the same buffer...which was already
at 16 bits. It'd be converted again and turned into a high
frequency noise on the output.
Now only modify a copy of the input sample in I2S and I2SNoDAC.
Fixes the conversion problem competely.
Fixes#2
Hans-J. Ubben found a bug where the pinout wasn't being set properly on
ESP32s because the builtInDAC member was not set before calling SetPinout.
Fix per his suggestion.
With the multiple I2S modes on the ESP32, it makes sense to use a
cleaner class hierarchy for the I2S tools. Make I2SNoDAC into a
subclass of I2S (renamed from I2SDAC) and remove about 80% of the
code which was identical exept for the per-sample bitstream synthesis.