muvox-io / euphonium

Tiny audio platform
GNU Affero General Public License v3.0
96 stars 15 forks source link

ESP32 Crashing/Panicing with Dummy DAC #57

Open errolt opened 2 years ago

errolt commented 2 years ago

Is this related to the internal dac?

ESP32 crashes the moment bluetooth audio playback starts, or when Spotify tries to connect to ESP32.

Happens with both precompiled release and current master branch.

Reproduce: Flash binary release to ESP32 wrover-ib module. Connect to module over bluetooth. Start playback.

Output: I (18565) BT_AV: event: 13 I (18565) RCCT: AVRC event notification: 5 I (18565) BT_AV: Play position changed: 390627-ms I (18565) RCCT: AVRC event notification: 1 I (18575) BT_AV: Playback status changed: 0x1 I (18575) BT_AV: A2DP audio state: Started I [bluetooth] BluetoothPlugin.cpp:74: Locking access... I [core] Core.cpp:50: Shutting down except bluetooth Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.

ore 0 register dump: PC : 0x401913ae PS : 0x00060b30 A0 : 0x800d93db A1 : 0x3ffe7da0
0x401913ae: i2s_set_sample_rates at /home/errol/esp/esp-idf/components/driver/i2s.c:1384 (discriminator 2)

A2 : 0x00000000 A3 : 0x0000ac44 A4 : 0x00000001 A5 : 0x3ffdda18
A6 : 0x00000000 A7 : 0x3ffe7d30 A8 : 0x00000000 A9 : 0x00000000
A10 : 0x00000000 A11 : 0x0000ac44 A12 : 0x00000009 A13 : 0x3ffdda40
A14 : 0x00000014 A15 : 0x3f40f623 SAR : 0x00000010 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000048 LBEG : 0x40092d61 LEND : 0x40092d83 LCOUNT : 0x00000000
0x40092d61: memcpy at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/newlib/newlib/libc/machine/xtensa/memcpy.S:272

0x40092d83: memcpy at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/newlib/newlib/libc/machine/xtensa/memcpy.S:290

Backtrace:0x401913ab:0x3ffe7da00x400d93d8:0x3ffe7dd0 0x400e1596:0x3ffe7df0 0x400daea8:0x3ffe7e80 0x400d27e8:0x3ffe7ea0 0x401913ab: i2s_set_sample_rates at /home/errol/esp/esp-idf/components/driver/i2s.c:1384 (discriminator 2)

0x400d93d8: DACAudioOutput::configureOutput(AudioOutput::SampleFormat, int) at /home/errol/git/euphonium/targets/esp32/app/build/../main/DACAudioOutput.cpp:53

0x400e1596: MainAudioBuffer::configureOutput(AudioOutput::SampleFormat, unsigned int) at /home/errol/git/euphonium/euphonium/include/MainAudioBuffer.h:45 (inlined by) MainAudioBuffer::configureOutput(AudioOutput::SampleFormat, unsigned int) at /home/errol/git/euphonium/euphonium/include/MainAudioBuffer.h:42 (inlined by) BluetoothPlugin::runTask() at /home/errol/git/euphonium/targets/esp32/app/build/../main/bluetooth/BluetoothPlugin.cpp:76

0x400daea8: bell::Task::taskEntryFunc(void*) at /home/errol/git/euphonium/euphonium/bell/include/Task.h:98

0x400d27e8: pthread_task_func at /home/errol/esp/esp-idf/components/pthread/pthread.c:195 (discriminator 15)

feelfreelinux commented 1 year ago

Can confirm, when having dummy dac selected, the i2s sample rate change crashes the program.