Skip to content

v2.0.2

Latest

Choose a tag to compare

@remcom remcom released this 27 Nov 15:14
f3c347f

Satellite1 XMOS firmware v2.0.2

A follow-up to v2.0.1 that moves to lib_voice 2.0.0, locates wake words past a TV or fan, and levels the wake word channel with an AGC of its own. The SPI device-control protocol stays 0x11, and every change to it adds something. A host written for v2.0.1 keeps working.

The headline changes:

  • Wake words are located past a TV or fan. Before, the wake word steering pointed the beam at the interferer. In simulated rooms it was 110–170° off the talker for every wake word after the first, even with the talker 4–8 dB louder. Now 8 of 9 wake words over a TV and 9 of 9 over a fan land within 45° of the talker (before: 0 and 1 of 9).
  • New AUDIO_SERVICER_CMD_CH1_AGC (12), on by default, levels the wake word channel (ch1) with an AGC of its own. Talker levels from −10 to +25 dB around the usual level now reach the wake word engine at −23..−13 dBFS rms, with nothing clipped.
  • New AUDIO_SERVICER_CMD_WAKE_TIMING (11) reports how long the last wake word took to reach the device.
  • fwk_voice 0.8.0 is replaced by lib_voice 2.0.0, its successor. This frees 27 KB of RAM on tile 0 and 40–86 KB on tile 1, and the XMOS dependencies are updated.

Behavior changes

  • Channel 1 (wake word) is now levelled by default. The new AGC assumes the host multiplies the channel by 4, as ESPHome's micro_wake_word does with gain_factor: 4, so Satellite1-ESPHome needs no change. Its output is divided by 4 to allow for that gain. A host that uses a different gain, or wants the old fixed mic gain, writes 0 to CH1_AGC.
  • The wake word is located from a different window. The device now uses the DOA results of the ~0.75 s before the last ~300 ms, not the last ~1.5 s. The ~300 ms it leaves out is the time a detection takes to be reported.
  • The DOA reacts faster. Smoothing went from 0.95 to 0.7, so a TV that never stops isn't carried into the start of a wake word.

Wake word steering past a TV or fan

  • The DOA removes steady noise. It averages the noise cross spectrum of each mic pair over frames without speech or echo, and subtracts it before the PHAT normalisation. It then weights each bin by its power over that averaged noise. PHAT alone let the bins between speech harmonics outvote the talker. With a fan, 91% of talker-dominated frames are now located (before: 10%).
  • New wake rule. A direction that holds all the idle speech before the wake word now ranks nowhere (novelty 1.0), so a TV that talks all the time isn't picked. If no direction ranks above zero, the largest group wins.
  • Simulated ch1 SNR in BEAM mode, wake word / command:
    • TV: 3.4 / 3.5 dB → 4.2 / 4.5 dB
    • noise and fan: 6.8 / 7.0 dB → 12.0 / 11.9 dB
  • Tile 1 RAM: +2 KB.

Wake word channel AGC and wake timing (audio servicer, resource 230)

Command ID Access What it does
AUDIO_SERVICER_CMD_WAKE_TIMING 11 R 8 bytes (versioned, version 1): timing of the last WAKE_EVENT
AUDIO_SERVICER_CMD_CH1_AGC 12 R/W 1 level ch1 with its own AGC (default), 0 fixed mic gain. Other values return SERVICER_WRONG_PAYLOAD

Like the other audio settings, CH1_AGC isn't saved and goes back to the default on reset.

CH1_AGC

  • It's a second lib_voice AGC, running on tile 0. Its targets and soft clipping work at the level the engine sees after the host's ×4. Speech peaks sit around −9..−3 dBFS there, and are soft clipped above −6 dBFS so they never reach full scale.
  • It starts at ×4 (the old fixed gain) and adapts on speech only. It can raise the gain by up to +18 dB, at +0.2 dB a frame, and lower it by up to −20 dB, at −0.5 dB a frame. Writing 1 restarts it from ×4.
  • With the fixed gain, only about 15 dB of talker level worked. Speech 5 dB above the usual level clipped in the ×4, and speech 10–15 dB softer reached the engine at −35..−40 dBFS. Simulated, over a talker range of −10..+25 dB, the engine saw −34..+5 dBFS with up to 46% clipped. With the AGC it sees −23..−13 dBFS, with nothing clipped.
  • Tile 0 RAM: +1 KB.

WAKE_TIMING

  • The device fills it within a frame of each WAKE_EVENT 1, so read it ~30 ms after the write.
  • It gives the frames between the newest DOA result and the wake event, the number of DOA results in the wake word window, and MIC_FRONTEND_WAKE_LATENCY_FRAMES. It also carries a wake word counter, so a host can tell a new wake word from the previous one.
  • In a quiet room the newest DOA result is the end of the wake word. A host can then measure the report latency (I2S path, wake word engine and SPI write) that the wake word window has to leave out.

The byte layouts are in docs/device-control-spi-protocol.md. Writes to WAKE_TIMING are rejected with CONTROL_BAD_COMMAND.

lib_voice 2.0.0 and dependency updates

  • lib_voice's AEC stores the adaptive filters in the time domain. That frees RAM on both tiles:

    Variant Tile 0 / tile 1 bytes, v2.0.1 (fwk_voice 0.8.0) lib_voice 2.0.0
    fixed_delay 424,668 / 407,588 397,676 / 368,052
    aec4 424,668 / 508,340 397,676 / 421,996

    These figures are for lib_voice alone, before the DOA (+2 KB tile 1) and ch1 AGC (+1 KB tile 0) changes above.

  • The NS no longer over-suppresses bins by up to 6 dB when the loudest one is cut.

  • The AEC state is sized per build variant by the aec_conf.h that lib_voice's generate_schedule() writes. The aec4 build no longer needs a patched copy of lib_aec and lib_ic.

  • lib_voice's IC no longer computes the VNR of its output, so tile 0 does that now. The AGC gets the same VNR input as before.

  • In simulation the lib_voice AEC is a few tenths of a dB weaker on average, and up to 1.4 dB weaker in its worst frames. The IC, NS, mic modes and taps are within 0.1 dB.

  • Updated dependencies:

    • lib_xcore_math 3.0.1, added as modules/lib_xcore_math
    • fwk_core 1.1.0, fwk_io 3.6.0, fwk_rtos 3.2.0
    • lib_src 2.7.1, lib_sw_pll 2.5.0, xscope_fileio 1.3.1, lib_qspi_fast_read 1.0.2
    • xmos-ai-tools 1.4.5 (requirements.txt). The VNR now links its TFLite Micro runtime.
  • Removed:

    • the lib_tflite_micro, lib_nn and lib_xua submodules
    • the unbuilt adec, adec_alt_arch and referenceless pipelines, which were written against the fwk_voice API

Building from source: run git submodule sync && git submodule update --init --recursive and pip install -r requirements.txt to pick up the new submodules and xmos-ai-tools 1.4.5. The generated VNR model source now lives in the build directory.

Voice pipeline simulation

  • tests/sim_voice now builds against lib_voice and wake_agc.c, with new level_sweep and level_jump scenarios for the ch1 AGC.
  • New sim_sdbeam: a superdirective (MVDR, diffuse noise) beam and onset-based selection among 6 fixed beams, with beam_pattern, beam_tv and beam_noise scenarios. Neither beat delay-and-sum with the DOA fix, so neither ships.
  • New sim_doa_exp: float variants of doa.c, with the wake_trace and doa_reverb diagnostics that found why the wake steering picked the interferer.
  • The phase-inverted run of the SNR measurement now replays the first run's steering, so both runs steer the same way.
  • Results: docs/voice-simulation.md.

Known limitations

  • The wake word location, AGC level and lib_voice comparison numbers come from simulation.
  • The ch1 AGC assumes the host applies ×4. With a different gain, levels at the engine are off by the difference.
  • The WAKE_TIMING latency reads a few frames short in a reverberant room.

Release assets

Asset Contents
satellite1_xmos.factory.bin / .md5 and satellite1_xmos-v2.0.2.factory.bin / .md5 Default firmware (fixed_delay)
satellite1_xmos_aec4.factory.bin / .md5 and satellite1_xmos_aec4-v2.0.2.factory.bin / .md5 Experimental aec4 firmware
satellite_firmware_apps-v2.0.2.zip All build outputs (.xe, factory and upgrade images)
satellite1-xmos-firmware_2.0.2-1_all.deb Debian package with the default firmware

Full changelog: v2.0.1...v2.0.2