How to: Run Wyoming Satellite and OpenWakeWord on Android

This is the interface and has automatic microphone detection and automatic component installation.

I see. We can try to get this to work at a later date, but first we should fix all the bugs and make sure we’ve figured out all dependencies and required configuration. The interface would probably just get in the way by hiding debug info and errors.

I just tried another old 32bit based Android device (Nvidia Shield Tablet) and it has the same issue as the Amazon Fire HD 7 so I think it’s safe to say that 32bit devices will not work with this for now, until we have figured out how to get PulseAudio to work on Termux on those devices.

@Rellu Can you check the output of termux-info for the CPU architecture? Is your device arm (32bit) or aarch64 (64bit)?

I put on both tablets

cd wyoming-satellite
pactl load-module module-sles-source
rec -r 16000 -c 1 -b 16 -e signed-integer -t raw --no-show-progress - | play -r 22050 -c 1 -b 16 -e signed-integer -t raw --no-show-progress - 

and nothing happened, we were waiting for the recorded sound to be played on the speakers or for microphones to be played, but it didn’t happen. It seems that the microphone is not recording.

Okay, what is the output of:

pactl list short sources

For my working devices it reports two sources. A sink monitor and a microphone.

The device on your first photo is 32bit and I don’t think we’ll be able to get this to work until we fixed [Bug]: PulseAudio not working on 32bit Android · Issue #21660 · termux/termux-packages · GitHub.
The device on the second photo is 64bit and we should be able to get this to work.

The first, the one with 32bit is the Lenovo TSV and the second, with 64bit, is the Samsung Galaxy Tab A7

On both tablets it reports only sink.monitor without microphone.

Have you tried running these commands together with a as little delay in between as possible:

pactl load-module module-sles-source
pactl list short sources

The module seems to unload automatically again after a short time, but it is necessary to have the module loaded for the microphone to show up.

Perfect. The second device is your microphone.

Does this play your mic through the speaker successfully?

pactl load-module module-sles-source && rec -r 16000 -c 1 -b 16 -e signed-integer -t raw --no-show-progress - | play -r 22050 -c 1 -b 16 -e signed-integer -t raw --no-show-progress -

if this works, you might wanna try chaining the module loading and run script together:

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

I gotta leave now. I’ll be back later today.

Yes, it plays sound on both tablets, I forgot to lower the volume but it’s a good sign. I will also try the new script. Thank you.

IT WORKS ON BOTH TABLETS and Lenovo TSV and Samsung. On Lenovo, the sound is not heard, but it executes the commands, and on Samsung it works perfectly, the sounds, awake.wav and done.wav, are heard, as well as the responses after the command is executed. Thank you for your patience.

1 Like

I got a response from the people at Termux and it appears to be a kernel limitation, rather than a CPU architecture one. Basically the kernel needs to support memfd which I think was introduced in version 3.17, but I need to do more research to say for sure.
But my current theory is that your kernel version needs to be 3.17 or above. And architecture (32bit vs 64bit shouldn’t matter).

On my Fire Tablet 10 from 2021 lib64 directory exists, but libskcodec.so does not.

Here’s the output of termux-info:

Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=17534
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.1
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages-cf.termux.dev/apt/termux-main/ stable main
Updatable packages:
All packages up to date
termux-tools version:
1.43.6
Android version:
9
Kernel build information:
Linux localhost 4.4.146+ #1 SMP PREEMPT Sat Sep 18 05:25:21 UTC 2021 aarch64 Android
Device manufacturer:
Amazon
Device model:
KFTRWI
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.api versionCode:51

After doing some experimentation, it seems most likely to me that you still need to give Termux:API permission to access the microphone.
Try this again:

termux-microphone-record -f ./tmp.wav && termux-microphone-record -q && rm -f ./tmp.wav

And see if it still prompts you to allow microphone access.

If this doesn’t make the permission permanent, you might have to go to the system setting and manually set it to always allow for the app Termux:API.

Whiptail needs to be installed to start the installer GUI

pkg install whiptail

Then the installer can be started

cd wyoming-satellite
python3 -m installer

Arrows on the keyboard are used for navigation, space for tick and enter.