Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 3.48 KB

File metadata and controls

23 lines (14 loc) · 3.48 KB

TODO

  • Investigate and fix residual audible artifact on panic (retrigger is acceptable; panic still clicks/distorts intermittently).

  • Investigate the remaining artifact at the end of a sample. Hardware feedback: the DAC Control 3 change appears to help, but an audible artifact remains at the sample's end. Its character and cause are not yet established; do not assume it is the same pop as before. Keep the current codec configuration as the baseline (0x26 muted, 0x22 unmuted).

    Checks: Record the artifact and its timing relative to the last audible signal and EOF. Compare an original WAV with a smoothly faded version containing 200–500 ms of trailing exact-zero PCM. Compare identical PCM played from RAM and SD, and test a single voice and overlapping voices separately. Inspect sample endpoints for nonzero amplitude or DC offset; measure file-close latency and I2S underruns around EOF. Use these results to distinguish endpoint discontinuities, EOF handling, gain changes, and the codec's response to silence before choosing a fix.

    Evidence already collected: A host probe using the local WAV decoder and mixer preserved the queued tail, then emitted zeros, without calling the final output's stop(). Setting the released input's gain to zero did not erase samples already accumulated in the mixer. Firmware continues servicing the mixer while idle. Do not assume that natural EOF shuts down I2S or discards its queued tail; actual analog behavior and timing still need hardware verification.

Audio path audit

Findings from source review and targeted host-side probes of the locally installed ESP8266Audio library. Hardware noise, analog clipping, and actual SD underrun frequency still require device measurements.

  • Make loop restarts continuous and handle voice stealing without abrupt cuts. File edges now fade, but restartVoiceLoop() restarts the decoder, which emits an initial zero on each restart. SD loops no longer reopen the file (the reader buffers the next iteration), but both RAM and SD restarts pass through boundary ramps, which prevent an instantaneous step but can cause a short amplitude dip; they do not implement a seamless crossfade. At full 32-voice occupancy, replacing the oldest voice can still cut a nonzero signal. Test seamless loops and repeated triggers at saturation before changing these policies.

  • Move SD reads out of the time-critical playback path and measure underruns. Done: StreamManager reads on an sd_reader task with per-stream PSRAM ring buffers; starved voices get silence without stalling the mixer; Serial reports underruns, starved updates and SD throughput. Remaining: measure on hardware how many SD streams the 4 MHz clock sustains. Assigned streamed samples now start from a 16 KiB RAM head; previews and unsaved assignments still wait for the first read.

  • Review ES8388 startup sequencing, register definitions, and analog gain. Startup now establishes I2S and digital silence before unmuting (startup hum fix confirmed on hardware), and DAC Control 3 preserves its default control bits. Remaining review: analog outputs now use 0x1E (0 dB) with full-level digital mixing; verify available analog headroom with the actual headphone/potentiometer output and mixer load. Choose analog levels based on measured headroom. Measure startup pops, idle noise, and distortion at several output levels, including the headphone output path. Reference: ES8388 datasheet.