marcel-licence / esp32_basic_synth

ESP32 based simple synthesizer project
GNU General Public License v3.0
245 stars 38 forks source link

Can't compile Synthselect was not declared #74

Closed KeenVox closed 2 years ago

KeenVox commented 2 years ago

Hi, I can't get the code to compile. It always stops at "Syntselect was not declared in this scope". I'm using the Audikit V2.2. Board in the manager ist ESP32 DEV Modul. Version 1.0.6.n 1.04 makes no difference. I tried some different arduino versions, but didn't work. Any advice? Thanks!

KeenVox commented 2 years ago

Initialize Midi Module 22:50:07.310 -> Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1) 22:50:07.357 -> Core 1 register dump: 22:50:07.357 -> PC : 0x40081deb PS : 0x00050034 A0 : 0x4008751c A1 : 0x3ffbe7a0
22:50:07.357 -> A2 : 0x3ffbefcc A3 : 0x00000002 A4 : 0x00000001 A5 : 0x4008d6f4
22:50:07.357 -> A6 : 0x00000001 A7 : 0x00000000 A8 : 0x3ff6e000 A9 : 0x00000008
22:50:07.357 -> A10 : 0x00000180 A11 : 0x00000180 A12 : 0x00000000 A13 : 0x3ffb1e30
22:50:07.357 -> A14 : 0x00000000 A15 : 0x00000000 SAR : 0x00000015 EXCCAUSE: 0x00000006
22:50:07.357 -> EXCVADDR: 0x00000000 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xffffffff
22:50:07.404 -> Core 1 was running in ISR context: 22:50:07.404 -> EPC1 : 0x400d4af1 EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x40081deb 22:50:07.404 -> 22:50:07.404 -> Backtrace: 0x40081deb:0x3ffbe7a0 0x40087519:0x3ffbe7d0 0x400d4aee:0x3ffb1e90 0x400d4b55:0x3ffb1eb0 0x400d4c60:0x3ffb1ed0 0x400d3e29:0x3ffb1ef0 0x400d3e51:0x3ffb1f10 0x400d253c:0x3ffb1f50 0x400d2b53:0x3ffb1f80 0x400d4577:0x3ffb1fb0 0x4008afb1:0x3ffb1fd0 22:50:07.404 -> 22:50:07.404 -> Core 0 register dump: 22:50:07.404 -> PC : 0x400f43b6 PS : 0x00060134 A0 : 0x800d711a A1 : 0x3ffbbff0
22:50:07.451 -> A2 : 0x00000000 A3 : 0x00000001 A4 : 0x00000000 A5 : 0x00000001
22:50:07.451 -> A6 : 0x00060120 A7 : 0x00000000 A8 : 0x800d6c2a A9 : 0x3ffbbfc0
22:50:07.451 -> A10 : 0x00000000 A11 : 0x40087df4 A12 : 0x00060120 A13 : 0x3ffbb690
22:50:07.451 -> A14 : 0x00000000 A15 : 0x3ffbbce0 SAR : 0x00000000 EXCCAUSE: 0x00000006
22:50:07.451 -> EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000
22:50:07.451 -> 22:50:07.451 -> Backtrace: 0x400f43b6:0x3ffbbff0 0x400d7117:0x3ffbc010 0x4008c752:0x3ffbc030 0x4008afb1:0x3ffbc050 22:50:07.498 -> 22:50:07.498 -> Rebooting... 22:50:07.498 -> ets Jun 8 2016 00:22:57 22:50:07.498 -> 22:50:07.498 -> rst:0xc (SW_CPU_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT) 22:50:07.498 -> configsip: 0, SPIWP:0xee 22:50:07.498 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 22:50:07.498 -> mode:DIO, clock div:1 22:50:07.498 -> load:0x3fff0018,len:4 22:50:07.498 -> load:0x3fff001c,len:1216 22:50:07.498 -> ho 0 tail 12 room 4 22:50:07.498 -> load:0x40078000,len:9720 22:50:07.498 -> ho 0 tail 12 room 4 22:50:07.498 -> load:0x40080400,len:6352 22:50:07.498 -> entry 0x400806b8

KeenVox commented 2 years ago

seems to be the same or I copied it in the wrong place. If I put it after void loop () nothing seems to happen. It just stops with ff

marcel-licence commented 2 years ago

Hm should look like this:

Initialized Initialize I2S Module Initialize Midi Module Turn off Wifi/Bluetooth ESP.getFreeHeap() 140740 ESP.getMinFreeHeap() 140720 ESP.getHeapSize() 286572 ESP.getMaxAllocHeap() 69376 Firmware started successfully fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe 90 32 3c fe 80 32 15 fe fe 90 34 34 fe 80 34 0f 90 35 49 fe 90 37 24 80 35 18 fe 80 37 3e 90 39 4e fe 90 37 35 80 39 1c 90 35 52 80 37 42 90 34 64 fe 80 35 43 34 56 fe fe fe fe fe fe fe fe fe fe

marcel-licence commented 2 years ago

Generated with this code:

void loop()
{
    while (true) /* this is new */
    {
        if (Serial2.available())
        {
            Serial.printf(" %02x", Serial2.read());
        }
        delay(20);
    }

...
KeenVox commented 2 years ago

If I try that I get 'Midi_SendShortMessage' was not declared in this scope while compiling.

KeenVox commented 2 years ago

ah my bad, now I get this: 23:03:18.502 -> Initialize Synth Module 23:03:18.502 -> Initialize I2S Module 23:03:18.502 -> Connect to ES8388 codec... 0x00: 0x05 23:03:18.594 -> 0x01: 0x40 23:03:18.640 -> AdcCh1! 23:03:18.640 -> MixChAMPL! 23:03:18.640 -> ES8388 setup finished! 23:03:18.640 -> Reg 0x00 = 0x05 23:03:18.640 -> Reg 0x01 = 0x40 23:03:18.640 -> Reg 0x02 = 0x00 23:03:18.640 -> Reg 0x03 = 0x00 23:03:18.640 -> Reg 0x04 = 0x3c 23:03:18.640 -> Reg 0x05 = 0x00 23:03:18.640 -> Reg 0x06 = 0x00 23:03:18.640 -> Reg 0x07 = 0x7c 23:03:18.640 -> Reg 0x08 = 0x00 23:03:18.640 -> Reg 0x09 = 0x88 23:03:18.640 -> Reg 0x0a = 0x50 23:03:18.640 -> Reg 0x0b = 0x02 23:03:18.640 -> Reg 0x0c = 0x0c 23:03:18.640 -> Reg 0x0d = 0x02 23:03:18.640 -> Reg 0x0e = 0x30 23:03:18.640 -> Reg 0x0f = 0x20 23:03:18.640 -> Reg 0x10 = 0x00 23:03:18.640 -> Reg 0x11 = 0x00 23:03:18.640 -> Reg 0x12 = 0x16 23:03:18.640 -> Reg 0x13 = 0xb0 23:03:18.640 -> Reg 0x14 = 0x32 23:03:18.640 -> Reg 0x15 = 0x06 23:03:18.640 -> Reg 0x16 = 0x00 23:03:18.640 -> Reg 0x17 = 0x18 23:03:18.640 -> Reg 0x18 = 0x02 23:03:18.640 -> Reg 0x19 = 0x22 23:03:18.640 -> Reg 0x1a = 0x00 23:03:18.640 -> Reg 0x1b = 0x02 23:03:18.688 -> Reg 0x1c = 0x08 23:03:18.688 -> Reg 0x1d = 0x00 23:03:18.688 -> Reg 0x1e = 0x1f 23:03:18.688 -> Reg 0x1f = 0xf7 23:03:18.688 -> Reg 0x20 = 0xfd 23:03:18.688 -> Reg 0x21 = 0xff 23:03:18.688 -> Reg 0x22 = 0x1f 23:03:18.688 -> Reg 0x23 = 0xf7 23:03:18.688 -> Reg 0x24 = 0xfd 23:03:18.688 -> Reg 0x25 = 0xff 23:03:18.688 -> Reg 0x26 = 0x1b 23:03:18.688 -> Reg 0x27 = 0xb8 23:03:18.688 -> Reg 0x28 = 0x28 23:03:18.688 -> Reg 0x29 = 0x28 23:03:18.688 -> Reg 0x2a = 0xb8 23:03:18.688 -> Reg 0x2b = 0x80 23:03:18.688 -> Reg 0x2c = 0x00 23:03:18.688 -> Reg 0x2d = 0x00 23:03:18.688 -> Reg 0x2e = 0x1e 23:03:18.688 -> Reg 0x2f = 0x1e 23:03:18.688 -> Reg 0x30 = 0x1e 23:03:18.688 -> Reg 0x31 = 0x1e 23:03:18.688 -> Reg 0x32 = 0x00 23:03:18.688 -> Reg 0x33 = 0xaa 23:03:18.688 -> Reg 0x34 = 0xaa 23:03:18.688 -> Initialize Midi Module 23:03:18.688 -> Turn off Wifi/Bluetooth 23:03:18.688 -> ESP.getFreeHeap() 118904 23:03:18.688 -> ESP.getMinFreeHeap() 118884 23:03:18.688 -> ESP.getHeapSize() 267096 23:03:18.688 -> ESP.getMaxAllocHeap() 69376 23:03:18.735 -> Firmware started successfully 23:03:18.735 -> ff

marcel-licence commented 2 years ago

Okay the ff is your first received byte via midi. If you hit any keys you should get some output

KeenVox commented 2 years ago

yes looks like that: 23:15:30.355 -> Firmware started successfully 23:15:30.355 -> ff 00 20 00 00 20 00

marcel-licence commented 2 years ago

Hm okay that is really strange. There is no note on or note off event. There are some possible problems left:

You could define another PIN MIDI_RX_PIN

The baudrate is defined by MIDI_SERIAL2_BAUDRATE

KeenVox commented 2 years ago

what baud rate should I try? and the io pin? Just on of the other pins of teh audiokit?

marcel-licence commented 2 years ago

#define MIDI_SERIAL2_BAUDRATE 31250 that should be correct. Yes you can try another free IO expect IO0 and IO5 (this is for MCLK and Boot)

KeenVox commented 2 years ago

okay I changed to IO 23, the D5 LED is now blinking, but I have sound!

marcel-licence commented 2 years ago

Can you play notes?

KeenVox commented 2 years ago

Yes works as it should, I would say. 93322c>93 32 2c 00:07:07.576 -> 833240>83 32 40 00:07:08.327 -> 93324e>93 32 4e 00:07:08.468 -> 833240>83 32 40 00:07:08.655 -> 93324f>93 32 4f 00:07:08.749 -> 833240>83 32 40 00:07:09.265 -> 93323f>93 32 3f 00:07:09.358 -> 833240>83 32 40 00:07:09.639 -> 933238>93 32 38 00:07:09.733 -> 833240>83 32 40 00:07:09.980 -> 93324a>93 32 4a 00:07:10.121 -> 833240>83 32 40 00:07:10.355 -> 933425>93 34 25 00:07:10.542 -> 833440>83 34 40 00:07:10.777 -> 933438>93 34 38 00:07:10.917 -> 833440>83 34 40 00:07:11.163 -> 933432>93 34 32 00:07:11.256 -> 833440>83 34 40

marcel-licence commented 2 years ago

Hooray. That looks perfect. Do we know the issue?

KeenVox commented 2 years ago

Seems to be the IO Pin. I changed from 19 to 23 and everything works like it should :-) What's nice to, If I connect my usb midi controller to the usb/uart port of the audio kit it does work to, without changing anything in the code. my controler even gets his power from the audio kit. that's nice. :-D

marcel-licence commented 2 years ago

I am happy to hear that. Is the other LED still blinking every second? I found a BLINK_LED_PIN config which might create a conflict on the MIDI input signal.

KeenVox commented 2 years ago

In the moment it's blinking every second. Before we changed it to IO23 it blinked for every midi signal it received. Was that the purpose?

marcel-licence commented 2 years ago

The blink LED should just blink as indicator that the firmware is still running. That explains the 00 and FF in the debug output before. I am now cleaning up the pin configuration files =) So finally that explains your observed problem. The change to the ES8388 is really bad. I've noted down a lot of configurations.

KeenVox commented 2 years ago

Yeah, thank you for all your help! Hope you start selling your pcb soon, I could really need one 😉

marcel-licence commented 2 years ago

Sounds like a plan =) I've updated now the configuration files. Hope this will make the configuration in future a bit easier