I just managed to get wyoming-satellite to work on Android. My goal was to add voice assistant capabilities (always running in he background) to my wall mounted tablet which is primarily used as a Home Assistant panel. And I needed to achieve this with open source software only.
Here are the steps I took in order to get this to work:
If you want to install it manually instead, click here
Open Termux and run the following commands one by one by typing them and pressing enter:
# Update packages
pkg up
# Install required packages
pkg install -y git python sox pulseaudio termux-api
# Check architecture and install pulseaudio without memfd if necessary
export ARCH="$(termux-info | grep -A 1 "CPU architecture:" | tail -1)"
echo "Architecture: $ARCH"
if [ "$ARCH" = "arm" ]; then pkg remove -y pulseaudio ; wget "https://github.com/T-vK/pulseaudio-termux-no-memfd/releases/download/1.1.0/pulseaudio_17.0-2_arm.deb" && pkg i -y ./pulseaudio_17.0-2_arm.deb ; fi
# Start test recording to trigger mic permission prompt
termux-microphone-record -f ./tmp.wav
# It should ask you for mic access now. Select `Always Allow`.
# Now quit the test recording
termux-microphone-record -q
# And delete the test recording
rm -f ./tmp.wav
# Temporarily load PulseAudio moule for mic access
pactl load-module module-sles-source
# Verify that there is at least one microphone detected
pactl list short sources | grep "module-sles-source.c" && echo success || echo failure
# Clone Wyoming Satellite repo
git clone https://github.com/rhasspy/wyoming-satellite.git
# Enter Wyoming Satellite direcotry
cd wyoming-satellite
# Run Wyoming Satellite setup script
./script/setup
# Write down the IP address (most likely starting with `192.`) of your device, you will find it in the output of this command:
ifconfig
# Load PulseAudio moule for mic access again (just in case it got unloaded already)
# and start Wyoming Satellite by running this entire multi-line command at once:
pactl load-module module-sles-source && script/run \
--name 'Android Satellite' \
--uri 'tcp://0.0.0.0:10700' \
--mic-command 'rec -r 16000 -c 1 -b 16 -e signed-integer -t raw --no-show-progress - ' \
--snd-command ' play -r 22050 -c 1 -b 16 -e signed-integer -t raw --no-show-progress -' \
--awake-wav ./sounds/awake.wav \
--done-wav ./sounds/done.wav \
--timer-finished-wav ./sounds/timer_finished.wav \
--timer-finished-wav-repeat 5 0.5 \
--debug
If you also want to install Wyoming OpenWakeWord, please refer to install.sh or just run the simple one liner command.
Open Home Assistant go to Settings ā Integrations ā Add Integration ā Wyoming Protocol
It should ask you for a host and a port now. Enter the IP address you noted in step 3 from the output of ifconfig into the host-field and enter 10700 in the port-field.
You should now be able to find it under Settings ā Devices:
Of corse.
0.0.0.0 simply means āall network interfacesā. It makes the service available to your entire network over all your network interfaces (i.e. Wifi and Ethernet). You could replace it with the IP address of your Android deviceās Wifi interface and thus ensure that it only exposes the service through that interface. But if that IP changes, it will break, thus 0.0.0.0 is the recommended approach.
In regards the the rest of the command:
script/run is the script that starts the wyoming service
āname āAndroid Satelliteā sets the name as seen by Home Assistant to Android Satellite. You can replace it with whatever you want.
āuri ātcp://0.0.0.0:10700ā specifies where the service should be exposed. 10700 is the Port that you have to enter in the Wyoming Protocol Integration in HA. You can use any other Port if you want, but I recommend using the defaults to avoid potential interference with other services.
āmic-command This parameter expects a bash command that streams the audio input of a mic to its stdout. The audio stream must be a raw PCM stream in this format:
Sample rate: 16000hz
Sample size: 16 bytes
Endianess: little-endian
Data Type: signed integer
Channel count: 1
Iām using the sox command rec for this purpose, but other commands like arecord, parecord, pw-record or maybe even termux-microphone-record could theoretically be used as well.
āsnd-command This parameter expects a bash command that can take an audio stream over stdin and play it back on a speaker or headphoneā¦ The audio stream is a raw PCM stream is this format:
Sample rate: 22050hz
Sample size: 16 bytes
Endianess: little-endian
Data Type: signed integer
Channel count: 1
Iām using the sox command play for that purpose, but other commands would probably work too.
Yes and no. It needs to be running, but it can just stay in the background. I alway have the Home Assistant app running in the foreground and Termux running in the background always listening.
This is fantastic. I have a project called View Assist that uses (mostly) Android tablets in conjunction with Stream Assist integration to connect to HA Assist. The Stream Assist method does work but have always wanted to try to get Wyoming running on these tablets and also to integrate the Wyoming satellites into View Assist as well.
Weāve got a few hundred folks that have joined our Discord server and it would be great to chat with you there if youāre interested.
Good work. Iām glad you were able to do this. I managed to install on my Lenovo ThinkSmart View.
This line should be corrected --mic-command 'rec -r 16000 -c 1 -b 16 -e signed-integer -t raw --no-how-progress - ' \ to --no-show-progress - to detect the microphone.
I managed to connect it to Home Assistant, but I couldnāt get the wake word to work with this satellite, even though it says INFO: root Streaming audio in the log.
Sorry for the typo. I will update the command in my post.
There are also additional useful options for audio feedback like --wake-wav and --done-wav which I will add.
I have an old Amazon Fire tablet somewhere. Iāll dig it out and try to get this to work on it as well.
I installed it on a Lenovo TSV tablet and a Samsung A7 tablet with Android 12 and I still canāt get it to recognize the wake word. It connects to Home Assistant but in the log from Termux it says āPing enabledā then after a while it says āDid not receive ping response within timeoutā. And in the Home Assistant logs, there are many disconnections of the Wyoming satellite.
Source: components/wyoming/satellite.py:139
integration: Wyoming Protocol (documentation, issues)
First occurred: 08:23:00 (492 occurrences)
Last logged: 11:58:15
Satellite has been disconnected. Reconnecting in 10 second(s)```
I get that error too sometimes, but you can ignore it. Wyoming Satellite recovers from it automatically.
What does your Home Assistant configuration regarding the Wyoming Protocol Integration look like? Do you have OpenWakeWord running somewhere?
You must at least have one instance of OpenWakeWord, one instance for SpeechToText like Wyoming Whisper and your Satellite of course:
But since your tablet is probably newer, you might have a better chance of getting it to work.
It would be helpful if you could provide the output of termux-info to get better insight.
But here is soemthing you can try:
Check if /system/lib64 exists, by running ls -la /system/lib64. If it does exist, run:
export LD_PRELOAD=/system/lib64/libskcodec.so
Then try pactl load-module module-sles-source again, if it still fails, try running pulseaudio --start and then pactl load-module module-sles-source.
It works very well for me wake word on other satellites, esp32, stream assist, assist microphone and wyoming sattelite on raspberry pi. I tried to open the wav file from the recording test and only a very short noise is heard.
Does OpenWakeWord show up in the Wyoming Protocol Integration on Home Assistant for you? If not, then you should add it. Otherwise the OpenWakeWord instance(s) will only run locally on your satellites and since I havenāt managed to get it to work on Termux, youād be missing it there.
Regarding the graphical interface, Iām not sure. Iāve never used it before.