LIFsCode / ELOC-3.0

Firmware for ELOC 3.0 Hardware
MIT License
3 stars 3 forks source link

Recording may have a performance issue #13

Closed LIFsCode closed 1 year ago

LIFsCode commented 1 year ago

reported here --> ~1:40 - 1:50

2 things are suspicious:

  1. Between finishing wav file and creating the next filename is too much time
    • (92542) WAV: Finishing wav file size: 1920044
    • (97167): main: filename /sdcard/eoc/ELOCprod24964_1970-01-01_00_01_30.wav
  2. the 2nd file is printing the wrote samples message at a much faster rate

This could indicate, that there is a buffer overrun in the I2SMEMSSampler, due to the delay of creating the 2nd filename.

LIFsCode commented 1 year ago

Reason was the missing initial timestamp, which caused the esp32 to run form 1970 on... du to a "feature" in the arduino ESP32Time library, gettings the timestamp will wait for 5000 milliseconds.

This extremely long wait will cause a buffer overrun in the I2S sampling engine, which leads to the observed behavior.

This is mainly fixed in 8cb379452d39ef79980ea1e904ed8368217c2e11:

Fix recording buffer overrun when creating the 2nd file

NOTE: this does not fix correct handling of buffer overruns