Skip to content

Troubleshooting and Reporting Issues

buntatoes edited this page Nov 29, 2026 · 1 revision

Troubleshooting and Reporting Issues

This page covers standalone diagnostics, common TTS/ASR/SAPI 5 troubleshooting steps, the per-game compatibility fix policy, hardware testing status, and how to submit actionable bug reports.


Quick Diagnostics

Verify that Tonic's core synthesis, grammar parsing, and unit tests work on your machine before debugging a specific game:

# 1. Inspect runtime capabilities and host speech-dispatcher bridge status
./zig-out/bin/tonic info

# 2. Run the full unit test suite across all modules
zig build test --summary all

# 3. Synthesize a test WAV file with the built-in formant synthesizer
./zig-out/bin/tonic speak "Systems ready. Test 1 2 3." --wav /tmp/tonic_test.wav

# 4. Round-trip test finite-grammar recognition against the synthesized WAV
./zig-out/bin/tonic speak "open cargo bay" --wav /tmp/tonic_cmd.wav
./zig-out/bin/tonic recognize /tmp/tonic_cmd.wav \
  --phrase "fire missile" \
  --phrase "open cargo bay" \
  --phrase "raise shields"

Common Issues & Fixes

No Audio Output from tonic speak Without --wav

  • Without --wav, tonic speak delegates plain-text playback to host speech-dispatcher (libspeechd.so.2) when available.
  • If speech-dispatcher is not installed or its daemon is not running, tonic speak synthesizes PCM in memory and prints the sample count rather than opening an audio device directly.
  • Pass --wav <file.wav> and play the output with your system audio player (e.g. pw-play, aplay), or install/start speech-dispatcher if you want direct desktop playback from the CLI.

Unexpected Host Voice or speech-dispatcher Delay on Linux

  • Set TONIC_NO_HOST_SPEECH=1 to bypass the runtime dlopen("libspeechd.so.2") probe and force Tonic's built-in pure-Zig Klatt formant synthesizer.
  • Confirm with TONIC_NO_HOST_SPEECH=1 ./zig-out/bin/tonic info (should show Host Probe Disabled: yes (TONIC_NO_HOST_SPEECH)).

Headless Testing or Crashing Audio Driver Inside Windows PE sapi.dll

  • Set TONIC_NO_AUDIO_PLAYBACK=1 to bypass winmm.dll waveOut playback while preserving ISpVoice synthesis, event delivery, and WaitUntilDone.
  • Set TONIC_NO_MIC_CAPTURE=1 to bypass winmm.dll waveIn microphone capture when activating ISpRecognizer.

tonic recognize Rejects a WAV File

  • tonic recognize expects an uncompressed 16-bit signed PCM RIFF WAV file (audio_fmt = 1, bits_per_sample = 16, up to 32 MiB).
  • Compressed WAV encodings (ADPCM, μ-law, floating-point IEEE 32-bit) or non-WAV formats (MP3, OGG, FLAC) are rejected. Convert them to 16-bit PCM WAV (e.g. 16000 Hz or 22050 Hz mono) before testing.

Voice Commands Are Not Recognized in a Game

  1. Check whether the game uses compiled binary SAPI CFG grammars (SPBINARYGRAMMAR): Tonic currently detects binary CFG blobs safely and returns S_OK with zero parsed rules instead of crashing. Titles using SRGS XML, SAPI 5 XML, plain phrase lists, or ISpGrammarBuilder::AddWordTransition are supported.
  2. Check microphone noise floor and volume: Live WaveInCapture uses an adaptive background noise floor and flushes utterances after ~500 ms of trailing silence, requiring a DTW recognition confidence of at least 0.35. Excessively quiet microphones or continuous loud background noise can prevent VAD triggering or push confidence below 0.35.
  3. Remember closed-vocabulary scope: Tonic is designed for finite voice-command grammars (ISpRecoGrammar), not unconstrained free-form dictation (LoadDictation is currently a S_OK no-op).
  4. Verify PipeWire/ALSA input routing in Vodka: Ensure the host microphone is active in PipeWire/ALSA and visible to Vodka's libvodka_audio.so.

Checking DLL Loading Under Pisco / Vodka

Enable Pisco logging in Steam Launch Options to confirm sapi.dll loads from files/lib/vodka/tonic/:

PISCO_LOG=1 %command%

Inspect $HOME/steam-<APPID>.log for sapi.dll load entries (+loaddll is enabled automatically by PISCO_LOG=1 / PROTON_LOG=1).


Per-Game Compatibility Fixes (src/game_fixes.zig)

Universal SAPI 5, TTS, ASR, and WinMM improvements always go into Tonic's core subsystems so every application benefits. If a specific title exhibits a non-standard SAPI 5 quirk (such as polling without draining async notifications or expecting a looser confidence threshold), per-game workaround flags are isolated strictly by executable basename in src/game_fixes.zig so they never regress other titles.


Tested Hardware & Platform Matrix

Note

Hardware Testing Disclaimer: Tonic is developed and verified on an AMD Ryzen CPU (x86_64) running Linux. Multi-architecture Windows PE targets (x86_64-windows, i386-windows, and aarch64-windows) cross-compile cleanly, while native Intel and ARM64 Linux hosts have not yet been validated on hardware.

Component Status Notes
AMD Ryzen CPU (x86_64 Linux) Tested & Verified Primary development, build, CLI, libtonic.so, and full unit test host
Windows PE x86_64-windows (sapi.dll) Cross-Compiled & Pisco-Integrated Freestanding PE64 DLL (link_libc = false) routed via Pisco VODKADLLPATH and sapi=n
Windows PE i386-windows (sapi.dll) Cross-Compiled & Pisco-Integrated Freestanding 32-bit PE32 DLL (winapi/stdcall) for WoW64 prefixes
Windows PE aarch64-windows (sapi.dll) Cross-Compiled Only Freestanding ARM64 PE DLL builds cleanly; native ARM64 hardware execution untested
Intel CPUs / ARM64 Linux Hosts Untested / Unknown Expected to work with Zig 0.17.1+; hardware test reports welcome

Reporting Issues

If you encounter a bug in Tonic's TTS, SSML, finite-grammar ASR, CLI, libtonic.so, or SAPI 5 sapi.dll compatibility, please open a GitHub issue on buntatoes/tonic (or buntatoes/pisco for Steam Play / Pisco launcher issues) and include:

  • Game or application title — full title name, Steam AppID (if applicable), and any launch options or TONIC_* / VODKADLLOVERRIDES variables used.
  • Steps to replicate — clear, numbered steps to reproduce the issue, along with expected vs. actual behavior (and whether TTS, SSML, XML grammars, binary CFG grammars, or microphone capture are involved).
  • Hardware & OS details — CPU, Linux distro, kernel version, audio server (PipeWire vs. ALSA), microphone device (for ASR issues), and whether speech-dispatcher (libspeechd.so.2) is installed.
  • Tonic & Pisco version — the exact Tonic branch/commit (plus Pisco and Vodka versions/commits if running through Pisco).
  • Logs (optional, helpful) — tonic info output, zig build test --summary all output, or relevant PISCO_LOG=1 / PROTON_LOG=1 excerpts (scrubbed of any personal paths or credentials).