This page lists what a voice call needed on our reference board, the ESP32-S3-BOX-3, and why. Use it as a checklist when you
bring up your own board. These values are one board's, not a certification: board quality stays yours. The SDK's repository is private:
to ask for access, write to sdk@onesay.com.
Flash and memory
| Setting | On the BOX-3 | What happens without it |
|---|---|---|
| App partition | 3 MB for the app (LiveKit minimal's table) when the board uses esp_capture's AEC source | That image is about 2.1 MB; without the AEC source, Opus alone makes about 1.7 MB, which does not fit the 1.5 MB table |
| PSRAM | On, octal at 80 MHz, with 16 MB flash | The audio encoder's 40 KiB stack lives in external RAM |
| Code in PSRAM | CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y, as LiveKit minimal | With esp_capture's AEC source, capture, echo cancellation and decoding fall behind real time while the Agent speaks |
| CPU | 240 MHz |
Keep internal RAM free. During a call, our board read about 34 KB of free internal RAM at its lowest. With TLS buffers in internal RAM it read under 2 KB before media started, and the peer connection failed to open. These settings, from LiveKit's own ESP32 example, made that difference:
CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=256
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=8192
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=4096Tasks and buffers
| Setting | On the BOX-3 | Why |
|---|---|---|
| Main task stack | 20 KiB, not pinned to a core (CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY) | Control calls run TLS on this task. Pinned to the core that also ran capture and Wi-Fi, a handshake took far too long |
| RTC signaling task stack | 8 KiB, ONESAY_RTC_SIGNALING_TASK_STACK_SIZE | 4 KiB overflowed on the board |
| WebSocket buffer | 2,048 bytes, CONFIG_WS_BUFFER_SIZE | At 1,024 the signaling request did not fit, and the connection stayed in reconnecting |
Audio
- Capture gives the SDK 16 kHz mono PCM. For a conversation it must be echo-cancelled, against your own speaker's signal, and
you declare that with
echo_cancelled. - Render receives decoded audio. On the BOX-3 the Agent's voice arrived at 48 kHz, 2 channels, so your
openmust accept that or return an error. The SDK's media port page lists the formats. - Render counters are not hearing. A written frame means your sink accepted it. Only a person can say that it was clear.
Volume and the echo reference
The speaker's level and the echo canceller's reference are tied together, as the reference comes back through the codec after the speaker's gain. Raise the volume one step at a time, and after each step read the peaks of the reference and the microphone: a value at full scale, 32,767, is clipped. If the reference clips, lower its input gain. If the microphone clips, lower that too, and check that the board still hears speech.
Our board's clear level was found by ear. It is not a value to copy.
Boards with an ES8311 and an ES7210
The SDK's esp32s3_es8311_es7210_agent_call example is a starting point for ESP32-S3 boards that pair an ES8311 speaker codec with
an ES7210 microphone codec. It is in release v0.1.9 and later. Its board layer feeds the speaker's output back into one ES7210 input as the echo reference.
- The ES7210's slot order. In TDM the ES7210 sends its four inputs in slots 0 to 3 in the order MIC1, MIC3, MIC2, MIC4, not
MIC1 to MIC4. LiveKit's ESP32
minimalexample reads them in this order. - The reference's slot depends on your wiring. It is the slot of the MIC input your board feeds the codec's output back into. The example's defaults are the microphone on MIC1 (slot 0) and the reference on MIC3 (slot 1); if your board uses other inputs, set both slots in menuconfig. An echo canceller fed the wrong slot removes nothing, and the Agent hears its own voice.
- Check it on the board. The example's microphone check (see its README) prints the level of each slot, first quiet, then with a 1 kHz tone on the speaker. The reference is the slot that is loud during the tone and near the noise floor when quiet. Set the microphone and reference slots in menuconfig from what it shows.
Logs
Keep the log level at WARN, the level our runs used. It keeps the SDK's and ESP-IDF's logs quiet. Your own firmware and the reference example may still print resource IDs and idempotency keys, so treat the console as sensitive.
What is still open on our board
These did not stop our calls. We have not settled their cause, so you may see them too:
- Task watchdog lines appear during a call.
- The board's outgoing audio frame rate fell to about half while the Agent was replying.
- The first words of the Agent are lost, as How an AI Agent talks through an ESP32 board explains.
Compare against the reference board
When your board has a problem, run the same step on a BOX-3 if you have one. A difference then points to your board, and no difference points to the SDK or the service. Send the full serial output at WARN level with any report, and never a credential, token or provisioning code.