-
Notifications
You must be signed in to change notification settings - Fork 14
Esp32 Audiokit ES8388 dead end . Sound distortion #102
Description
Hi Marcel,
I bought two Audiokit V2.2 cards, an A404 and an A520, because someone said that the antenna painted black is an ES8388 and the one that isn't painted is an AC101. This doesn't seem to be true.
To begin with, I haven't been able to compile for the card with the AC101 because it gives errors like "class AC101' has no member named 'SetLineSource'" "'class AC101' has no member named 'SetMicSource'" etc...
The configuration in Arduino IDE 2.3.7:
I downgraded Arduino ESP32 Boards to version 2.0.10
I downgraded ESP32 (by Spressiff) to version 2.0.16
JTAG Adapter: Disabled
PSRAM: Enabled
Partition Scheme: No OTA (2 MB APP/2 MB SPIFFS)
CPU Frequency: 240 MHz (WiFi/BT)
Flash Mode: QIO
Flash Frequency: 80 MHz
Flash Size: 4 MB (32 MB)
Upload Speed: 921600
Arduino runs on: Core 1
Events run on: Core 1
Core Debug Level: None
Clear all Flash before uploading sketch: Disabled
I load the esp32_midi_sampler sketch and manage to compile/load it without errors (apparently) onto the Audiokit A520 board using #define BOARD_ESP32_AUDIO_KIT_ES8388.
The output after booting via the serial monitor is this:
rst:0x1 (POWERON_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0
Connect to ES8388 codec...
SDA: 33
SCL: 32
freq: 400000
0x00: 0x05
0x01: 0x40
AdcCh1!
MixChAMPL!
ES8388 setup finished!
Reg 0x00 = 0x05
Reg 0x01 = 0x40
.
.
.
.
.
Reg 0x0a = 0x50
Reg 0x0b = 0x02
I2S_NUM_0 configured using following pins:
BCLK,BCK: 27
WCLK,LCK: 26
DOUT: 25
DIN: 35
MCLK: 0
I2S configured using following pins:
BCLK,BCK: 27
WCLK,LCK: 26
DOUT: 25
DIN: 35
MCLK: 0
Setup Serial2 with 31250 baud with rx: IO21 only
Setup MidiPort2 using Serial2
Total PSRAM: 4192123
Free PSRAM: 4192123
Try to allocate 4192122 bytes
Not able to allocate the complete PSRAM buffer!
Now trying to reduce the allocation buffer sizeTotal PSRAM: 4192107
Free PSRAM: 63351
Allocated 4128756 bytes
storageLen: 2064378
storageLen: 46.81s
rev: 15329, 15329
Reverb is ready!
delay samples: 22050
Max delay time: 0.50s
ESP.getFreeHeap() 170892
ESP.getMinFreeHeap() 165392
ESP.getHeapSize() 245664
ESP.getMaxAllocHeap() 65524
Total heap: 245664
Free heap: 170892
Total PSRAM: 4192091
Free PSRAM: 19235
Firmware started successfully
�[?25l�[0;0HLoaded sample: 22049
inL �[0;32m �[0m outL �[0;32m �[0m
inR �[0;32m �[0m outR �[0;32m �[0m
56926 of 2064378 bytes used
O_______________________________
LittleFS: pet_bottle.wav
Key1 Key3 Key5 #####
Key2 Key4 Key6
I soldered the jumpers and 1.8kΩ resistors to the indicated points for using AUDIO_KIT_BUTTON_ANALOG. I also enabled VT100 and OLED_OSC_DISP_ENABLED.
I copied the ESP32 folder from MlLsynth_Tools_libraries/SRC to ML_Synth_Tools/SRC because I received a warning during compilation.
After trying the different configurations in /board_audio_kit_es8388.h, I only get a horrible sound when pressing keys 2, 3, 4, 5, and 6 or after sending a MIDI note to pin 21 with a USB/MIDI converter when using the I2S = 1 configuration. The other configurations produce no sound at all.
I2S=6 configuration is not working. The boot process displays strange symbols on the serial monitor after attempting to activate the es8388 codec.
With the I2S = 5 configuration, the VT100 display correctly shows activity on the microphone and line inputs. Pressing keys 2, 3, 4, 5, and 6, or after sending a MIDI message, also activates the OUTPT LEDs correctly, but there is no sound from the sound card. The MIDI activity LED has a 5-second pulse rate. This 5-second pulse rate is not what is shown in your video, where everything appears to be running smoothly. It seems that some kind of access or process using the serial port is being overloaded or slowed down?
With I2S=1, the line-in and output LEDs light up simultaneously when sending a MIDI message via pin 21. The sound coming through the headphones is completely distorted and sounds the same across the entire keyboard range; the pitch doesn't change. It sounds like digital distortion or a corrupted data reading. Disabling the VT100 returns the MIDI activity LED pulse rate to 1 second. Sending a MIDI message under these conditions results in the same noise and distortion.
Loading the samples with Littlefs seems to be working correctly.
This is what it says after loading Littlefs:
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 38:18:2b:89:91:07
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Flash will be erased from 0x00290000 to 0x003effff...
Compressed 1441792 bytes to 110741...
Writing at 0x00290000... (14 %)
Writing at 0x0035dd3d... (28 %)
Writing at 0x00361f84... (42 %)
Writing at 0x00366354... (57 %)
Writing at 0x0036bdfc... (71 %)
Writing at 0x00371cb3... (85 %)
Writing at 0x00375e18... (100 %)
Wrote 1441792 bytes (110741 compressed) at 0x00290000 in 4.4 seconds (effective 2608.7 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
Completed upload.
848
I've been struggling for several weeks, trying different things I've read about this, but I'm not making any progress. The library versions listed in your documentation links don't match what you indicate as necessary. Perhaps it all boils down to that; it's 2026, and any update or change to any of them would leave me out of this project.
I've tried both sound cards with identical results. I've also loaded and tested Phil Schatzmann's streams-audiokit-sd-audiokit.ino sketch, and it works correctly. Both sound cards work using the AudioBoardStream kit (AudioKitEs8388V1) configuration, so it's clear the problem lies elsewhere. I'm very interested in your project; it's spectacular, especially the real-time capture and playback of the sample. Thank you very much for your effort.