Closed raprakashvi closed 2 weeks ago
Can you please enable the verbose debug mode and post the output here ?
Hi @lucasssvaz , I enabled the verbose mode during compiling and upload and below is the output.
23:26:26.580 -> I2S bus initialized.
23:26:26.580 -> Initializing SD card...
23:26:26.645 -> SD card initialized.
23:26:26.678 -> Recording 5 seconds of audio data...
23:26:26.678 -> Writing audio data to file...
23:26:26.678 -> Application complete.
we need debug enabled in the core (for your board) not for compiling and uploading in the IDE
@raprakashvi can you please provide us more information as stated above? thanks.
@VojtechBartoska I am having trouble figuring out the steps to enter debug mode and hence the delay, would appreciate pointers
@raprakashvi select this option in the menu and upload the code to the board again
any updates on this @raprakashvi?
Hi @VojtechBartoska thanks a lot for your patience. Here is the code and verbose output. Seems buffer size issue.
Initializing I2S bus...
I2S bus initialized.
Initializing SD card...
SD card initialized.
Recording 5 seconds of audio data...
Writing audio data to file...
Application complete.
an.c:160] perimanSetPinBus(): Pin 15 successfully set to type SDMMC_CMD (42) with bus 0x3ffc1150
[ 1065][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 14 successfully set to type SDMMC_CLK (41) with bus 0x3ffc1150
[ 1076][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 2 successfully set to type SDMMC_D0 (43) with bus 0x3ffc1150
SD card initialized.
Recording 5 seconds of audio data...
[ 1087][D][ESP_I2S.cpp:965] recordWAV(): Record WAV: rate:16000, bits:32, channels:1, size:320000
[ 1101][E][ESP_I2S.cpp:969] recordWAV(): Failed to allocate WAV buffer with size 320044
Writing audio data to file...
Application complete.
[ 1116][E][esp32-hal-periman.c:122] perimanSetPinBus(): Invalid pin: 255
[ 1124][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 21 successfully set to type INIT (0) with bus 0x0
[ 1134][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 22 successfully set to type INIT (0) with bus 0x0
[ 1144][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 25 successfully set to type INIT (0) with bus 0x0
=========== After Setup Start ============
INTERNAL Memory Info:
------------------------------------------
Total Size : 379728 B ( 370.8 KB)
Free Bytes : 318308 B ( 310.8 KB)
Allocated Bytes : 53684 B ( 52.4 KB)
Minimum Free Bytes: 301768 B ( 294.7 KB)
Largest Free Block: 110580 B ( 108.0 KB)
------------------------------------------
GPIO Info:
------------------------------------------
GPIO : BUS_TYPE[bus/unit][chan]
--------------------------------------
1 : UART_TX[0]
2 : SDMMC_D0
3 : UART_RX[0]
4 : GPIO
12 : GPIO
13 : GPIO
14 : SDMMC_CLK
15 : SDMMC_CMD
============ After Setup End =============
You need PSRAM to record that much data with this function. It's trying to allocate 320KB buffer and that is more than you can do on internal RAM
I see. Then it won't work with my current ESP Wroom 32 boards as they only have up to 4 MB flash and the PSRAM shows 0. Seems like S3 boards might be better for testing this function. Meanwhile, I did get the recording and writing part working where I wrote a custom function to record and save the Wav file in real time to SD card. Might be a good idea to add that as a function option in the future in the official implementation as the MMC is already being used,
Hello @raprakashvi, can I consider this ticket as solved?
Yes. This part is solved. I am happy to help if anyone has any questions on this or related issue.
On Mon, Sep 16, 2024 at 7:46 AM Vojtěch Bartoška @.***> wrote:
Hello @raprakashvi https://github.com/raprakashvi, can I consider this ticket as solved?
— Reply to this email directly, view it on GitHub https://github.com/espressif/arduino-esp32/issues/9740#issuecomment-2352691049, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMREUJOPBUSE3IKIXPHUPFTZW3AJZAVCNFSM6AAAAABITNQGDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJSGY4TCMBUHE . You are receiving this because you were mentioned.Message ID: @.***>
Board
ESP32
Device Description
ESP-WROOM-32
Hardware Configuration
SD Card Standard INPUT
Version
latest master (checkout manually)
IDE Name
Arduino
Operating System
Windows 10
Flash frequency
80 Mhz
PSRAM enabled
no
Upload speed
115200
Description
Testing the microphone and SD card from the example and everytime the file is created but with 0 bytes. Seems like the record to wav function is not waiting for the process to finish.
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide