Skip to content

Setup playback and ADSSS decoding

Receiver-side path

The setup engine is inside voice-agent, not a separate modem daemon. Relevant types are SetupEngine, AudioDecoder, ADSSS::StreamDecoder, and ADSSS::IStreamCallbacks.

enableAudioModem receives an audio device, enables the stream decoder, and delivers decoded bytes through OnDataDecoded/dataDecoded. The binary enforces input.sampleRate == ADSSS::Config::ReferenceSampleRate.

The default reference is /usr/share/voice-agent/reference.pcm, configurable with adsss_reference; adsss_config is also exposed as a flag. Failure to initialize the decoder produces Audio setup failed.

From sound to network provisioning

  1. The phone generates a fresh xToken and ADSSS WAV as described in audio modem.
  2. The Mini captures 16 kHz mono audio and decodes the JSON payload.
  3. The setup engine applies Wi-Fi country, SSID, and PSK and receives the xToken/environment/account fields.
  4. voice-agent calls /account/attach_xtoken with xtoken_id to attach the provisioning token to the device.
  5. On success it writes the persistent Marusya session and enters normal voice-engine operation.

The phone independently polls account/info_xtoken; CONNECTED confirms the server-side result, not just successful audio playback.

Reference audio

The on-device reference.pcm and the Android reference4_10sec.pcm are both 646,400 bytes: 161,600 float samples at 16 kHz, or 10.1 seconds. The generated setup WAV uses the same reference and carries the payload by modulation.

The file is not an ordinary spoken prompt and must not be replaced with arbitrary silence or music. The exact decoder configuration beyond the reference/sample-rate checks is still being mapped.

Failure behavior

Setup modes include audio provisioning, manual setup, auto-exit, and cancellation. NEED_XTOKEN is an explicit state string. Failure code 4 reaches OnSetupFailed → hwResetDevice, which creates the next-boot reset marker; not every decoder failure should be assumed to use that code without a runtime log.

Security

Setup audio is a bearer provisioning message. It contains Wi-Fi credentials and a live xToken. Anyone who records a still-valid transmission can recover those values with the same public algorithm/reference. Use fresh tokens, do not retain setup recordings, and redact generated JSON/WAV artifacts from documentation.