Skip to content

Instantly share code, notes, and snippets.

@forslund
Last active June 20, 2023 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save forslund/b3679508d849efb8e48eda8d04c91f23 to your computer and use it in GitHub Desktop.
Save forslund/b3679508d849efb8e48eda8d04c91f23 to your computer and use it in GitHub Desktop.
Mycroft-Precise on aarch64

Set up environment

  • Setup 2 GB swap
  • Make sure there's room in /tmp ( > 2 GB)

Install python 3.5

To be able to use the prebuild wheel of tensorflow python 3.5 is needed.

Install prerequisites

sudo apt-get update && sudo apt-get install -y build-essential git libexpat1-dev libssl-dev zlib1g-dev   libncurses5-dev libbz2-dev liblzma-dev   libsqlite3-dev libffi-dev tcl-dev linux-headers-generic libgdbm-dev   libreadline-dev tk tk-dev

wget https://www.python.org/ftp/python/3.5.4/
tar -xzf Python-3.5.4.tgz
cd Python-3.5.4
./configure --prefix=/usr/local --enable-loadable-sqlite-extensions --with-lto --with-system-expat --with-system-ffi --enable-ipv6 --disable-rpath --enable-shared --enable-optimizations

make && sudo make install

Setup precise

Get precise

git clone https://github.com/MycroftAI/mycroft-precise.git
cd mycroft-precise

Create and activate python 3.5 virtual environment

python3.5 -m venv .venv

Install tensorflow

wget https://github.com/lhelontra/tensorflow-on-arm/releases/download/v1.13.1/tensorflow-1.13.1-cp35-none-linux_aarch64.whl

pip install tensorflow-1.13.1-cp35-none-linux_aarch64.whl

Build precise

pip install cython
pip install --update setuptools

./build.sh
@rbrisita
Copy link

For anyone trying this as of 2023-06-20, it might be best to try the steps below.

Create a default ALSA resource file

cat <<EOF > ~/.asoundrc
pcm.!default {
	type hw
	card 0
}

ctl.!default {
	type hw           
	card 0
}
EOF

Binary Install

  1. wget https://github.com/MycroftAI/mycroft-precise/releases/download/v0.3.0/precise-all_0.3.0_aarch64.tar.gz
  2. tar xvf precise-all_0.3.0_aarch64.tar.gz
  3. cd precise
  4. Create data/activate.wav # it will try to play this file on detection

Get Keyword Model

  1. wget https://github.com/MycroftAI/precise-data/raw/models/hey-mycroft.tar.gz
  2. tar xvf hey-mycroft.tar.gz

Run Listener

  1. ./precise-listen hey-mycroft.pb

On an Manjaro Linux aarch64 system I got some ALSA errors, no doubt remedied through config files, but it still worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment