This guide will help you configure a Genie client on a Raspberry Pi or equivalent hardware. You can follow this guide to build a custom DIY speaker running the Genie virtual assistant.
Note: this guide is for setting up only the Genie client. The client must connect to a preexisting Genie server. See the standalone server guide to learn how to configure a Genie server+client combo, or the overall installation guide for all the available installation options.
This page is a work-in-progress. Please check back later for updates.
The following configuration have been tested:
Base Board: Raspberry Pi 4 model B
Microphone: Any USB microphone compatible with Linux should work.
The following have been tested:
Base Board: Raspberry Pi 4 model B
Microphone: attach a mic to the usb sound card microphone input.
Speaker: attach a speaker to the usb sound card audio/headphone output.
Base Board: Raspberry Pi 4 model B
Microphone: ReSpeaker 2-Mic Pi HAT https://www.seeedstudio.com/ReSpeaker-2-Mics-Pi-HAT.html
Microphone: ReSpeaker 4-Mic Pi HAT https://wiki.seeedstudio.com/ReSpeaker_4_Mic_Array_for_Raspberry_Pi
Speaker: attach a speaker with 3.5mm jack (or direct cable to the JST 2.0 Speaker Out) to the ReSpeaker output (by default will work the Pi's onboard output, see below for details).
Additional configuration:
alsamixer -D hw:1
to set the volume of the "Headphone" to a non-zero value. pacmd list-sinks
to view the list of outputs and their names (the ReSpeaker should be "alsa_output.platform-soc_sound.stereo-fallback");
pacmd set-default-sink "alsa_output.platform-soc_sound.stereo-fallback"
to set the ReSpeaker output as default;
reboot
to restart the board and use the new configuration;
Base Board: Raspberry Pi 3 model B v1.2
Microphone: Any USB microphone compatible with Linux should work.
The following have been tested:
Base Board: Raspberry Pi 3 model B v1.2
Microphone: attach a mic to the usb sound card microphone input.
Speaker: attach a speaker to the usb sound card audio/headphone output.
Base Board: Raspberry Pi 3 Model B v1.2
Microphone: ReSpeaker 2-Mic Pi HAT https://www.seeedstudio.com/ReSpeaker-2-Mics-Pi-HAT.html
Speaker: attach a speaker with 3.5mm jack (or direct cable to the JST 2.0 Speaker Out) to the ReSpeaker output (by default will work the Pi's onboard output, see installation details for managing it).
Additional configuration:
alsamixer -D hw:1
to set the volume of the "Headphone" to a non-zero value. pacmd list-sinks
to view the list of outputs and their names (the ReSpeaker should be "alsa_output.platform-soc_sound.stereo-fallback");
pacmd set-default-sink "alsa_output.platform-soc_sound.stereo-fallback"
to set the ReSpeaker output as default;
reboot
to restart the board and use the new configuration;
Base Board: Raspberry Pi Zero v1.3/W v1.1/2
Microphone: attach a mic to the usb sound card microphone input.
Speaker: attach a speaker to the usb sound card audio/headphone output.
Base Board: Raspberry Pi Zero v1.3/W v1.1/2
Microphone: ReSpeaker 2-Mic Pi HAT https://www.seeedstudio.com/ReSpeaker-2-Mics-Pi-HAT.html
Speaker: attach a speaker with 3.5mm jack to the ReSpeaker jack port.
Additional configuration:
alsamixer -D hw:1
to set the volume of the "Headphone" to a non-zero value.The Genie client supports the latest stable version of Raspberry Pi OS and Debian ("Bullseye").
If you wish to install the Genie client on a different operating system, you must rebuild the client from source. Installing the client Genie on an OS other than Raspberry Pi OS is not supported, and some functionality of the client might not be available.
Debian packages for Raspberry Pi OS are available for download.
wget https://almond-static.stanford.edu/releases/raspios/bullseye/genie-client_0.1.0_armhf.deb
sudo apt install -y gstreamer1.0-alsa
sudo apt install ./genie-client_0.1.0_armhf.deb
wget https://almond-static.stanford.edu/releases/debian/bullseye/genie-client_0.1.0_armhf.deb
sudo apt install ./genie-client_0.1.0_armhf.deb
wget https://almond-static.stanford.edu/releases/debian/bullseye/genie-client_0.1.0_arm64.deb
sudo apt install ./genie-client_0.1.0_arm64.deb
wget https://almond-static.stanford.edu/releases/debian/bullseye/genie-client_0.1.0_amd64.deb
sudo apt install ./genie-client_0.1.0_amd64.deb
Genie uses the PulseAudio sound system. PulseAudio will be installed automatically as a dependency of genie-client.
Make sure that PulseAudio is running:
systemctl --user enable pulseaudio.socket
systemctl --user start pulseaudio.socket
Edit the file /etc/pulse/default.pa
and add the following lines:
load-module module-echo-cancel source_name=echosrc sink_name=echosink aec_method=speex
load-module module-role-ducking trigger_roles=voice-assistant ducking_roles=music volume=20% global=true
Then restart PulseAudio or reboot to apply the configuration.
Edit the file /etc/pulse/default.pa
and add the following lines:
load-module module-echo-cancel source_name=echosrc sink_name=echosink channels=2 rate=48000 aec_method=webrtc
load-module module-role-ducking trigger_roles=voice-assistant ducking_roles=music volume=20% global=true
Then restart PulseAudio or reboot to apply the configuration.
After running the client with the command genie-client
, navigate to the IP address of the device, port 8000, to configure the client.
To connect to a local Genie server, follow the configuration instructions in the Configuration page of Genie server.
To connect to a cloud Genie account, set:
wss://genie.stanford.edu/me/api/conversation
In the current implementation, genie-client must be started as a user (session) systemd service.
If your user is automatically logged in, you can use a systemctl --user
service to autostart the genie-client when the user is logged in. (working on Raspberry Pi OS)
~/.config/systemd/user/genie-client.service
with the following lines:[Unit]
Description=GenieClient
After=network.target
[Service]
ExecStart=/usr/bin/genie-client
Restart=always
[Install]
WantedBy=default.target
~/.config/systemd/user/genie-client.timer
filesystemctl --user enable genie-client.service
systemctl --user start genie-client.service