bootstrap: install alsa-utils for voice hosts
This commit is contained in:
1 parent
d25b3259e4
commit
eeed8407f9
4 files changed
+27
-8
No files matched your search
@@ -557,7 +557,7 @@ CLI, unit tests (24) + integration tests (2).
|
|||||||
`--codegen-model`) override the values read from `config.json` **for that run
|
`--codegen-model`) override the values read from `config.json` **for that run
|
||||||
only** and are never written back. `--voice` additionally installs the
|
only** and are never written back. `--voice` additionally installs the
|
||||||
optional voice-gateway stack (`requirements/voice.txt` + system
|
optional voice-gateway stack (`requirements/voice.txt` + system
|
||||||
`libportaudio2`) and downloads its models into `.runtime/voice/` via
|
`libportaudio2` + `alsa-utils`) and downloads its models into `.runtime/voice/` via
|
||||||
`scripts/voice-models.py`. The script must be run from a checkout —
|
`scripts/voice-models.py`. The script must be run from a checkout —
|
||||||
it reads pins from that checkout's `pins.json` and never re-clones the agent
|
it reads pins from that checkout's `pins.json` and never re-clones the agent
|
||||||
repo (only the SemIf engine and the simplex-chat binary). Idempotent and
|
repo (only the SemIf engine and the simplex-chat binary). Idempotent and
|
||||||
@@ -1028,7 +1028,7 @@ CLI, unit tests (24) + integration tests (2).
|
|||||||
stays stdlib-only. The voice stack is pinned separately in
|
stays stdlib-only. The voice stack is pinned separately in
|
||||||
`requirements/voice.txt` (hardware-dependent: `sounddevice`, `openwakeword`,
|
`requirements/voice.txt` (hardware-dependent: `sounddevice`, `openwakeword`,
|
||||||
`faster-whisper`, `piper-tts`, `onnxruntime`, `webrtcvad-wheels`, plus the
|
`faster-whisper`, `piper-tts`, `onnxruntime`, `webrtcvad-wheels`, plus the
|
||||||
system `libportaudio2`); it is lazy-imported too, and `bootstrap.sh --voice`
|
system `libportaudio2` + `alsa-utils`); it is lazy-imported too, and `bootstrap.sh --voice`
|
||||||
installs it and downloads the models (openWakeWord into the venv package dir,
|
installs it and downloads the models (openWakeWord into the venv package dir,
|
||||||
the Piper voice into `.runtime/voice/tts`, faster-whisper into `.runtime/hf`).
|
the Piper voice into `.runtime/voice/tts`, faster-whisper into `.runtime/hf`).
|
||||||
|
|
||||||
|
|||||||
@@ -650,8 +650,10 @@ python -m semif_agent.cli gateway --platform voice
|
|||||||
- **Requirements.** The voice stack is optional and lazy-imported; install it
|
- **Requirements.** The voice stack is optional and lazy-imported; install it
|
||||||
with `scripts/bootstrap.sh --voice` (or
|
with `scripts/bootstrap.sh --voice` (or
|
||||||
`.runtime/venv/bin/pip install -r requirements/voice.txt`) plus the system
|
`.runtime/venv/bin/pip install -r requirements/voice.txt`) plus the system
|
||||||
PortAudio lib (`apt install libportaudio2`). The gateway refuses to start with
|
PortAudio lib and ALSA mixer tools (`apt install libportaudio2 alsa-utils`).
|
||||||
an install hint if the stack is missing.
|
The gateway refuses to start with an install hint if the stack is missing.
|
||||||
|
PortAudio has no volume control — use `alsamixer`/`amixer` (then
|
||||||
|
`sudo alsactl store`) to unmute and set the mic/speaker levels.
|
||||||
- **Models.** `gateway.voice.wake.model` is an openWakeWord model (default
|
- **Models.** `gateway.voice.wake.model` is an openWakeWord model (default
|
||||||
`hey_mycroft`), `stt.model` a faster-whisper size (default `base.en`), and
|
`hey_mycroft`), `stt.model` a faster-whisper size (default `base.en`), and
|
||||||
`tts.voice` a Piper voice (default `en_US-lessac-medium`). Bootstrap downloads
|
`tts.voice` a Piper voice (default `en_US-lessac-medium`). Bootstrap downloads
|
||||||
|
|||||||
@@ -7,7 +7,10 @@
|
|||||||
# .runtime/venv/bin/pip install -r requirements/voice.txt
|
# .runtime/venv/bin/pip install -r requirements/voice.txt
|
||||||
# .runtime/venv/bin/pip install --no-deps openwakeword==0.6.0
|
# .runtime/venv/bin/pip install --no-deps openwakeword==0.6.0
|
||||||
#
|
#
|
||||||
# System prerequisite (not pip): PortAudio, e.g. `apt-get install -y libportaudio2`.
|
# System prerequisites (not pip): PortAudio + ALSA mixer tools, e.g.
|
||||||
|
# `apt-get install -y libportaudio2 alsa-utils`. PortAudio is the I/O backend;
|
||||||
|
# alsa-utils provides amixer/alsamixer/alsactl to unmute and set mic/speaker
|
||||||
|
# levels (PortAudio itself has no volume control).
|
||||||
#
|
#
|
||||||
# The audio pipeline is 16 kHz mono int16:
|
# The audio pipeline is 16 kHz mono int16:
|
||||||
# sounddevice mic capture + speaker playback (raw PortAudio streams)
|
# sounddevice mic capture + speaker playback (raw PortAudio streams)
|
||||||
|
|||||||
+17
-3
@@ -248,10 +248,18 @@ CMAKE_BUILD_PARALLEL_LEVEL=6 MAKEFLAGS=-j6 "$PIP" install -r "$REPO_ROOT/require
|
|||||||
# Hardware-dependent: only the host with a microphone/speaker needs it. The
|
# Hardware-dependent: only the host with a microphone/speaker needs it. The
|
||||||
# stack is lazy-imported, so a host without it still runs every other front end.
|
# stack is lazy-imported, so a host without it still runs every other front end.
|
||||||
if [[ "$VOICE" = 1 ]]; then
|
if [[ "$VOICE" = 1 ]]; then
|
||||||
if ! dpkg -s libportaudio2 >/dev/null 2>&1; then
|
# libportaudio2 is the I/O backend sounddevice needs; alsa-utils provides
|
||||||
echo "== installing system PortAudio (libportaudio2)"
|
# amixer/alsamixer/alsactl so the operator can unmute and set the mic/speaker
|
||||||
|
# levels (PortAudio itself has no volume control).
|
||||||
|
VOICE_SYS_PKGS=(libportaudio2 alsa-utils)
|
||||||
|
voice_missing=()
|
||||||
|
for p in "${VOICE_SYS_PKGS[@]}"; do
|
||||||
|
dpkg -s "$p" >/dev/null 2>&1 || voice_missing+=("$p")
|
||||||
|
done
|
||||||
|
if [[ ${#voice_missing[@]} -gt 0 ]]; then
|
||||||
|
echo "== installing voice system prereqs: ${voice_missing[*]}"
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y libportaudio2
|
sudo apt-get install -y "${voice_missing[@]}"
|
||||||
fi
|
fi
|
||||||
echo "== installing voice deps into $VENV"
|
echo "== installing voice deps into $VENV"
|
||||||
"$PIP" install -r "$REPO_ROOT/requirements/voice.txt"
|
"$PIP" install -r "$REPO_ROOT/requirements/voice.txt"
|
||||||
@@ -543,6 +551,12 @@ Voice command gateway (wake word + speech-to-text + text-to-speech):
|
|||||||
- Say the wake word (gateway.voice.wake.model, default 'hey_mycroft') and
|
- Say the wake word (gateway.voice.wake.model, default 'hey_mycroft') and
|
||||||
speak; the reply is spoken back. After each reply the next utterance needs
|
speak; the reply is spoken back. After each reply the next utterance needs
|
||||||
no wake word for gateway.voice.follow_up_window_s.
|
no wake word for gateway.voice.follow_up_window_s.
|
||||||
|
- If the mic or speaker is silent/quiet, set the ALSA mixer (PortAudio has no
|
||||||
|
volume control) and persist it:
|
||||||
|
alsamixer # or: amixer -c <card> sset 'Speaker' unmute
|
||||||
|
sudo alsactl store
|
||||||
|
List devices with: $PYTHON -c "import sounddevice as sd; print(sd.query_devices())"
|
||||||
|
and put the input/output device indices in gateway.voice.audio.
|
||||||
- Re-download / switch models any time with:
|
- Re-download / switch models any time with:
|
||||||
HF_HOME="$HF_CACHE" "$PYTHON" scripts/voice-models.py --config config.json
|
HF_HOME="$HF_CACHE" "$PYTHON" scripts/voice-models.py --config config.json
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in new issue
Block a user