earlephilhower / ESP8266Audio

Arduino library to play MOD, WAV, FLAC, MIDI, RTTTL, MP3, and AAC files on I2S DACs or with a software emulated delta-sigma DAC on the ESP8266 and ESP32
GNU General Public License v3.0
2.06k stars 438 forks source link

Compile error when using AudioOutputULP.h #649

Open CobaltEcho opened 1 year ago

CobaltEcho commented 1 year ago

When I use the AudioOutputULP.h library, I get an error on Build/Compile:

undefined reference to `vtable for AudioOutputULP'

Full message:

c:/users/echo/.platformio/packages/toolchain-xtensa-esp32@8.4.0+2021r2-patch5/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\src\main.cpp.o:(.literal._Z5setupv+0x1c): undefined reference to `vtable for AudioOutputULP'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp32dev\firmware.elf] Error 1

It compiles fine using the AudioOutputI2S library (using internal DAC) output = new AudioOutputI2S(0, 1);, but since I'm using the internal DAC, I would like to free up my I2S and also attempt to prevent popping as noted here in issue #406 .

I also tried using this branch without sucess: https://github.com/FedericoBusero/ESP8266Audio/tree/FedericoBusero-patch-ULP

ben25belot commented 8 months ago

Hi,

Yes, I'm also trying to eliminate the popping sounds. I managed to do it with this OutputULP by removing line 21 of the file AudioOutputULP.cpp (we could also modify it for better protection). #if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3

Everything works for me, without any popping sounds!

CobaltEcho commented 1 month ago

I got it to work using platformIO by adding a build flag:

platform = espressif32 @ ^6.4.0
board = esp32dev
framework = arduino, espidf
lib_deps = 
    earlephilhower/ESP8266Audio@^1.9.7
build_flags = -DCONFIG_IDF_TARGET_ESP32