Skip to content

Conversation

@SciLor
Copy link

@SciLor SciLor commented May 26, 2022

No description provided.

earlephilhower and others added 30 commits August 12, 2020 16:59
As noted by Marc Madaule (thanks!), the mono AAC decode was not
functioning properly.  Adjust the output stuff loop to fix.
Bugfixes to AAC and Opus codec addition
* test/run on host to null device

* compilation fix
* separate malloc structures

* add desync() for user when randomly seeking in the input file
fix corner cases leading to exceptions when seeking

* additional test when trying to crash-shake everything
with a rotary encoder seeking into the currently played file

* use private instead of static

* remove temporary debug code
PlatformIO requires these dependencies to be explicitly mentioned. Please check the version numbers of the libraries specified are correct. However, v1.0 for each allows for successful builds. Thanks!
When reusing the AudioGeneratorMP3 object to play multiple files with errors, the error count was never reset.
Also, if 3 errors are encountered, it would stop running but never clean up the buffers.
Code courtesy of Martin Laclaustra.

Uses the ULP coprocessor on the ESP32 to send samples to the onboard
DACs, freeing the I2S port for other uses.

Connect left output to pin 25, right to pin 26.
…ned into the fs namespace in esp32 libraries. (#335)

Co-authored-by: Pierre-Loup Martin <[email protected]>
* Modified AudioFileSourceFS.h to add resolution operator on items defined into the fs namespace in esp32 libraries.

* Added track, set, popularimeter, compilation tags.
Changed framesize loop with 32bit counter to avoid endless loops for large frames (like APIC).

Co-authored-by: Pierre-Loup Martin <[email protected]>
* Fix the order of mono samples (each pair was swapped)

* Remove comment on version and date (currently tracked within ESP8266Audio repo)

* Added some usage instructions to the header file

* Delete sample in buffer after being rendered (ULP) to avoid sound looping in the buffer at the end of playback

Co-authored-by: Martin-Laclaustra <[email protected]>
* 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
Thanks to @cjwhoishe, fixes #355 .

When a large enough read size was requested it is possible that for some
streams multiple ICY blocks could appear.  The logic doesn't support
that, so only read up to 1/2 the ICY block interval to ensure there is
no way to see two ICY blocks in one readInternal call.
* replace a disappeared shoutcast url by a working one from another example

* increase a buffer size (found by valgrind)

* make emulated example closer to the not emulated one
use `./onHost diff` to show the diff -u

* add `diff` option to onHost script

* add a delay to local copy of AudioOutputNull

* increase another buffer size

* make AudioOutputNullSlow.h compatible with arduino api (not only emulation on host)
Ensure the ICY decoder fixes make their way out.
* StreamOnHost: actually play audio

* (spaces)

* fix comment

* update message
* Add arduino-lint CI check

* Fix linting warnings
)" (#365)

This reverts commit b832ec2.

Arduino-CLI has fixed a bug in their code, attempt to run nightly builds in CI again.
earlephilhower and others added 24 commits October 8, 2025 17:30
Fixes #399

rtc_clk_cal can return 0 while calibration is underway.  If that happens
busy-wait until it returns a valid period.
* Fix ULP on ESP32

CONFIG_IDF_TARGET_ESP32 is not yet defined before #include "AudioOutputULP.h"

* AudioOutputULP: Fix DAC2 stereo in case of DAC1+DAC2

* ULP - no ESP32S2 / S3

On ESP32S2 it compiles, but no audio is coming out
On ESP32S3 DAC is not supported

* Astyle

---------

Co-authored-by: Earle F. Philhower, III <[email protected]>
Move to Opus 1.5.1
Remove OpusFile and OGG libraries because we parse the OGG file in
the object directly with way less memory and overhead.

Update example for LittleFS and RP2040

Fixes #372
Only the WAV and FLAC generators can generate 8-bit values, so it is
more efficient and sane to just have those generators upscale to 16-bit
signed (if necessary) in generation and simplify all the other
Generators and Outputs.
Move to the new I2S driver for the ESP chips, since the next revisioncl
of the IDF will remove them completely.

Make the I2S constructors saner and add consistent SetPinout() and
SetBuffers calls to allow configuration.

Remove need for separate UseMCLK or SwapClocks calls, we can figure
that out from the pins selected.

Fixes #758
Borrowed from BackgroundAudio PDM implementation
https://github.com/earlephilhower/BackgroundAudio

Requires an ESP32 model with PDM support.
Espressif changes the contents of the PDM struct depending on the
chip model.  Use a hopefully valid `#define` to avoid setting a
member that's not there in some cases.

Fixes #785
Help with testing optimization by minimizing non-decode CPU usage
* Pull untouched upstream TinySoundFont

Start from the upstream TinySoundFont by @schellingb at
https://github.com/schellingb/TinySoundFont and rearchitect the MIDI
processing.

* Convert to PROGMEM-based SoundFont structures.

This makes it much faster to access the SoundFont and also removes all the
static RAM usage.  The samples, the regions, the instruments are all now
in ROM.  Only the dynamic voices and related info takes up RAM.  No caching.

* (Re)convert to fixed point math.

TSF upstream is built for systems with real floating point units (and
produces great sound with it!), but processors like the Pico, ESP8266,
and several models of ESP32 don't have one so emulate FP in *extremely*
slow SW.  Use fixed point (integer) representations for the inner loop
and wherever possible to avoid `float` math.

For processors like the Pico 2 or original ESP32 with hardware FPUs this
still increases performance since integer is still much faster.

* Redo the example and add default SF2s

Rewrite the MIDI examples to use PROGMEM for both SF2 and MID file.
It simplifies life for the casual user and me.

* Breaking change

The MIDI object now has a `midi::SetSoundFont(tsf *)` instead of a
`midi::SetSoundfont(AudioFileSource *)`.  It no longer supports reading
SF2 from LittleFS or SD.
By rendering into a 32b int we don't have to saturate check in the inner
loop of the voice render, which is called multiple times per actual output
block.  That check is very expensive.

In tsf_render_short make the input `short *buffer` have 2x the space as
normal to allow the full 32b quantity for each sample to accumulate.
After all voices have been rendered, then resample with saturation into
int16_t values.

About 24% faster on the Pico while still saturating properly.
Use a numeric approximation to make powf much faster.  Loss of accuracy
isn't an issue in an audio output device.
The I2S write was always blocking meaning only a single loop call
might have ended up playing the entire audio output.

Replace the timeout of `10` with `0`.
Added section on ESP32 and Platform.IO integration issues and solutions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.