Giving My AI Agent Ears and Voice: Resurrecting a Google AIY Kit for Signal Voice Chats & Spoken Alerts

By | November 29, 2026

Back in 2017, Google shipped the cardboard AIY Voice Kit with a Raspberry Pi Voice HAT—complete with stereo MEMS microphones, a 3-watt speaker amplifier, and an illuminated arcade push-button. Years after Google retired the original cloud Assistant SDK, the hardware was still sitting on my desk (rpi-5), already wired into my homelab Tailscale mesh and Weave Scope topology.

Instead of letting good audio hardware collect dust, I resurrected it as ears and a voice for agy, my local AI agent.


Why Replace the Cloud SDK with a Local Split Architecture

Running modern speech-to-text and neural text-to-speech directly on a Raspberry Pi 3 (armv7l, Raspbian Buster) is painfully slow. Instead, I split the pipeline across two nodes over Tailscale:

  1. rpi-5 (Edge Audio & Button Client): Handles arecord, paplay, and the aiy.board GPIO arcade button/LED (GPIO 23 & GPIO 25).
  2. Workstation (agy-voice.service on port 8765): Runs faster-whisper (base, int8 on CPU), invokes agy CLI (--effort low --mode auto), and synthesizes natural speech with piper-tts (en_US-lessac-medium).

This keeps rpi-5 ultra-lightweight while giving agy sub-second local transcription and crisp neural voice output.


Solving the First Gotcha: pulseaudio Owning card 0

On rpi-5, dtoverlay=googlevoicehat-soundcard exposes snd_rpi_googlevoicehat_soundcar as card 0 for both capture and playback. Running arecord -D plughw:0,0 directly failed immediately with:

arecord: main:828: audio open error: Device or resource busy

A quick fuser -v /dev/snd/* showed pulseaudio (running under user pi) already held /dev/snd/pcmC0D0c and /dev/snd/pcmC0D0p. Switching the client to run as User=pi with XDG_RUNTIME_DIR=/run/user/1000 and recording/playing via arecord -D pulse and paplay solved the contention cleanly—no fighting ALSA locks.


The Voice Gateway Server (agy_voice_server.py)

On the workstation side, a persistent systemd --user service (agy-voice.service) keeps both faster-whisper and the Piper ONNX voice model warm in RAM inside a Python 3.13 virtual environment:

  • POST /ask: Accepts raw 16 kHz mono WAV audio, transcribes it with VAD filtering, strips markdown/URLs from agy‘s concise 1–3 sentence response, and streams back synthesized audio/wav.
  • POST /tts: Accepts JSON {"text": "..."} and returns audio/wav for standalone spoken notifications.
  • GET /health: Silent health check ({"status": "ok"}).

Before handing the reply to Piper, a small regex cleaner removes code fences, backticks, markdown links, and #/* characters so the speaker never reads out raw formatting symbols.


Walkie-Talkie UX + Proactive Spoken Alerts (rpi-5)

On rpi-5, agy-voice-client.service wires the arcade button and LED into an intuitive walkie-talkie loop:

  • Idle: Button LED glows softly (Led.BEACON_DARK).
  • Press & Hold: LED turns solid (Led.ON) while arecord -D pulse -f S16_LE -r 16000 -c 1 captures your voice.
  • Release: LED pulses (Led.PULSE_QUICK) while POST http://<workstation-tailscale-ip>:8765/ask transcribes, queries agy, and returns WAV audio.
  • Reply: paplay speaks agy‘s answer through the AIY 3-watt speaker, then returns the LED to idle.

As a bonus, agy-voice-client.service also listens on port 8766 (POST /speak), giving Home Assistant, antigravity-sentinel, and agy itself a direct way to announce critical homelab alerts aloud—like a UPS switching to battery or a downed service. To avoid waking anyone up at night or startling the room, antigravity-sentinel enforces a 09:00–21:00 daytime window and plays alerts at a gentle 30% volume (paplay --volume=19660).


Reusing the Same Voice Pipeline on Signal

Because agy-voice.service already exposes standalone /stt and /tts HTTP endpoints, I wired the exact same local faster-whisper and Piper pipeline into my self-only Signal bot (signal-bot.service):

  1. Incoming Voice Notes: When I send an audio/voice note in Signal’s Note to Self chat, signal_bot.py detects the audio/* attachment, posts it to /stt, and feeds the transcript into agy (or instant sub-second handlers like weather, ups, and sopor).
  2. Spoken Voice Replies: When replying to a voice note, signal_bot.py synthesizes the answer via /tts, transcodes the WAV into a compact 32 kbps OGG/Opus voice note with ffmpeg, and attaches it alongside the text reply.

One faster-whisper + Piper daemon now powers both the physical AIY desk box and mobile Signal voice chats.


Two More Real-World Fixes: Duration Flags and Default Playback Volume

Testing the live push-to-talk loop on rpi-5 surfaced two subtle bugs that are easy to miss in initial setup:

  • Go duration units on --print-timeout: agy parses --print-timeout as a Go time.Duration. Passing 180 instead of 180s in agy_voice_server.py caused the CLI to exit immediately with code 2 (time: missing unit in duration "180"), triggering “Sorry, agy returned an error.” Switching to 180s and logging stderr on non-zero exits resolved it immediately.
  • Consistent 30% playback volume: While the /speak endpoint defaulted to volume=0.30, play_wav_bytes() in agy_voice_client.py still defaulted to volume=1.0 (65536, 100%) for push-to-talk responses—making desk replies overwhelmingly loud. Setting play_wav_bytes(wav_bytes, volume=0.30) aligned interactive voice replies with the same comfortable room level as spoken alerts.

What’s Next

Now that rpi-5 is part of the Tailscale mesh (<rpi-5-tailscale-ip>) and bridged to agy, I can ask my desk box for a quick Sopor climate briefing, check UPS status, or trigger Home Assistant actions hands-free—breathing a second life into a 2017 cardboard kit with 100% local STT and TTS.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.