Skip to content

v2.0.0-alpha.3

Pre-release
Pre-release

Choose a tag to compare

@remcom remcom released this 24 Oct 09:16
· 45 commits to develop since this release
278f20f

Performance and real-time fixes

This release frees CPU time and RAM on both XMOS tiles, removes several causes of audio glitches, and adds diagnostics for checking how much processing headroom the audio pipeline has left.

Fixes

  • LED ring updates no longer risk dropping microphone or I2S samples. Writing a frame to the LED ring turns off interrupts for the duration of the frame. The LED task can no longer run on the cores that handle the RTOS tick, the microphone or I2S. Interrupts are also off for much less time per update: about 0.75 ms, down from about 1.65 ms.
  • Cleaner audio to the host. The 16 kHz → 48 kHz output conversion now uses a proper filter instead of repeating each sample three times. This removes images above 8 kHz and the loss of level at the top of the voice band.
  • Speaker playback no longer stalls when the echo canceller falls behind. If the AEC is late, the oldest speaker reference frame is dropped instead of holding up the DAC.
  • The watchdog now catches a stalled audio pipeline. It is only fed while audio frames keep coming out of the pipeline, so a hang on either tile resets the device.
  • Stack overflows are detected. FreeRTOS stack checking is enabled, and an overflow now halts the device with a report instead of silently corrupting memory.

Performance

  • Faster direction-of-arrival (DOA) estimation. The FFTs now run on the XMOS vector unit, and only the correlation lags that are actually needed are computed, replacing a full 512-point inverse FFT. DOA accuracy is unchanged in the host tests.
  • Less playback latency. The speaker path runs as a single task instead of a two-stage pipeline, saving up to ~30 ms of delay and a task on tile 1.
  • About a third of the tile-to-tile traffic per audio frame. Unused data is no longer sent from tile 1 to tile 0: frames are 2,004 bytes instead of 5,784.
  • Smaller per-frame overhead. Energy detection and mic gain run on the vector unit, the hot DSP files build with -O2, and a full-frame memset per frame is gone.
  • More free RAM. Tile 1 now has ~40 KB free instead of ~22 KB, and tile 0 has ~10 KB more.

New: stats servicer (resource 250)

A new read-only device-control resource for checking the real-time headroom on a running device:

Command ID Returns
STATS_SERVICER_CMD_STAGE_TIMES 0 Last and maximum processing time per audio stage, in µs (the maximum restarts on each read)
STATS_SERVICER_CMD_STACK_FREE 1 Lowest free stack per audio stage, in words
STATS_SERVICER_CMD_HEAP_FREE 2 Current and lowest free heap on tile 0 and tile 1

Seven stages are reported: mic front end + DOA, AEC, speaker reference resampling, IC/VNR, NS, AGC and output resampling. A frame is 15 ms, so any stage above 15,000 µs cannot keep up. See docs/device-control-spi-protocol.md for the payload layout.

Changes for host integrations

  • The device now waits for five servicers to register at startup instead of four, because the stats servicer was added.
  • Mic gain now clips symmetrically: negative peaks saturate at −2147483647 instead of −2147483648.
  • The SPI protocol version stays at 0x11; all protocol changes are additive.

Build

  • New CMake option SATELLITE1_VOICE_LIBS_O2 (default OFF) builds the AEC, IC, NS, AGC and VNR libraries with -O2. It costs about 3.4 KB on tile 1 and 0.9 KB on tile 0. Use the stats servicer's stage times to check whether it pays off before enabling it.
  • The host test suite now also compiles lib_xcore_math's portable reference code, so the vector-unit DOA path is tested on the build machine.