From 8d179b371cf6c74cd2917f3ef6837ae633492a3b Mon Sep 17 00:00:00 2001 From: imonlinux <39863321+imonlinux@users.noreply.github.com> Date: Sat, 13 Sep 2025 19:55:05 -0700 Subject: [PATCH] Add files via upload --- service/10-tuning.conf | 8 +++++ .../alsa-mww-linux-voice-assistant.service | 31 ++++++++++++++++ .../alsa-oww-linux-voice-assistant.service | 31 ++++++++++++++++ service/pa-mww-linux-voice-assistant.service | 36 +++++++++++++++++++ service/pa-oww-linux-voice-assistant.service | 36 +++++++++++++++++++ 5 files changed, 142 insertions(+) create mode 100644 service/10-tuning.conf create mode 100644 service/alsa-mww-linux-voice-assistant.service create mode 100644 service/alsa-oww-linux-voice-assistant.service create mode 100644 service/pa-mww-linux-voice-assistant.service create mode 100644 service/pa-oww-linux-voice-assistant.service diff --git a/service/10-tuning.conf b/service/10-tuning.conf new file mode 100644 index 0000000..b5dc628 --- /dev/null +++ b/service/10-tuning.conf @@ -0,0 +1,8 @@ +# /etc/systemd/system/linux-voice-assistant.service.d/10-tuning.conf +[Service] +# Keep mpv logs at warning by default; override with environment if desired +Environment=LVA_MPV_MSG_LEVEL=all=warn + +# Faster, cleaner shutdowns +TimeoutStopSec=5s +KillMode=mixed diff --git a/service/alsa-mww-linux-voice-assistant.service b/service/alsa-mww-linux-voice-assistant.service new file mode 100644 index 0000000..0896995 --- /dev/null +++ b/service/alsa-mww-linux-voice-assistant.service @@ -0,0 +1,31 @@ +[Unit] +Description=Linux Voice Assistant (ALSA - ReSpeaker 2mic HAT) +After=network-online.target wyoming-openwakeword.service +Wants=network-online.target +Requires=wyoming-openwakeword.service + +[Service] +Type=simple +User=pi +Group=pi +WorkingDirectory=/home/pi/linux-voice-assistant + +Environment=PYTHONUNBUFFERED=1 + +# Use ALSA ReSpeaker 2mic HAT hardware device +Environment="MPV_DEFAULT_DEVICE=alsa/plughw:CARD=seeed2micvoicec,DEV=0" + +ExecStart=/home/pi/linux-voice-assistant/script/run \ + --name 'Linux Satellite ALSA MWW' \ + --audio-input-device default \ + --audio-output-device ${MPV_DEFAULT_DEVICE} \ +# --wake-uri 'tcp://127.0.0.1:10400' \ +# --wake-word-name 'alexa' \ +# --wake-models-dir '/home/pi/wyoming-openwakeword/wyoming_openwakeword/models' + --debug + +Restart=always +RestartSec=2 + +[Install] +WantedBy=multi-user.target diff --git a/service/alsa-oww-linux-voice-assistant.service b/service/alsa-oww-linux-voice-assistant.service new file mode 100644 index 0000000..3466db7 --- /dev/null +++ b/service/alsa-oww-linux-voice-assistant.service @@ -0,0 +1,31 @@ +[Unit] +Description=Linux Voice Assistant (ALSA - ReSpeaker 2mic HAT) +After=network-online.target wyoming-openwakeword.service +Wants=network-online.target +Requires=wyoming-openwakeword.service + +[Service] +Type=simple +User=pi +Group=pi +WorkingDirectory=/home/pi/linux-voice-assistant + +Environment=PYTHONUNBUFFERED=1 + +# Use ALSA ReSpeaker 2mic HAT hardware device +Environment="MPV_DEFAULT_DEVICE=alsa/plughw:CARD=seeed2micvoicec,DEV=0" + +ExecStart=/home/pi/linux-voice-assistant/script/run \ + --name 'Linux Satellite ALSA OWW' \ + --audio-input-device default \ + --audio-output-device ${MPV_DEFAULT_DEVICE} \ + --wake-uri 'tcp://127.0.0.1:10400' \ + --wake-word-name 'alexa' \ + --wake-models-dir '/home/pi/wyoming-openwakeword/wyoming_openwakeword/models' + --debug + +Restart=always +RestartSec=2 + +[Install] +WantedBy=multi-user.target diff --git a/service/pa-mww-linux-voice-assistant.service b/service/pa-mww-linux-voice-assistant.service new file mode 100644 index 0000000..3c23ce2 --- /dev/null +++ b/service/pa-mww-linux-voice-assistant.service @@ -0,0 +1,36 @@ +[Unit] +Description=Linux Voice Assistant (PulseAudio - Headphone Jack) +After=network-online.target pulseaudio.service wyoming-openwakeword.service +Wants=network-online.target +Requires=pulseaudio.service wyoming-openwakeword.service + +[Service] +Type=simple +User=pi +Group=pi +WorkingDirectory=/home/pi/linux-voice-assistant + +# Environment +Environment=PYTHONUNBUFFERED=1 +Environment="PULSE_SERVER=unix:/var/run/pulse/native" +Environment="PULSE_LATENCY_MSEC=60" +Environment="MPV_DEFAULT_DEVICE=pulse/alsa_output.platform-soc_sound.stereo-fallback" + +# Wait briefly for the Pulse native socket to be ready +ExecStartPre=/bin/sh -c 'for i in $(seq 1 40); do [ -S /var/run/pulse/native ] && exit 0; sleep 0.5; done; echo "PulseAudio socket not found" >&2; exit 1' + +# Launch the assistant +ExecStart=/home/pi/linux-voice-assistant/script/run \ + --name 'Linux Satellite PA MWW' \ + --audio-input-device default \ + --audio-output-device ${MPV_DEFAULT_DEVICE} \ +# --wake-uri 'tcp://127.0.0.1:10400' \ +# --wake-word-name 'alexa' \ +# --wake-models-dir '/home/pi/wyoming-openwakeword/wyoming_openwakeword/models' \ + --debug + +Restart=always +RestartSec=2 + +[Install] +WantedBy=multi-user.target diff --git a/service/pa-oww-linux-voice-assistant.service b/service/pa-oww-linux-voice-assistant.service new file mode 100644 index 0000000..20712fb --- /dev/null +++ b/service/pa-oww-linux-voice-assistant.service @@ -0,0 +1,36 @@ +[Unit] +Description=Linux Voice Assistant (PulseAudio - Headphone Jack) +After=network-online.target pulseaudio.service wyoming-openwakeword.service +Wants=network-online.target +Requires=pulseaudio.service wyoming-openwakeword.service + +[Service] +Type=simple +User=pi +Group=pi +WorkingDirectory=/home/pi/linux-voice-assistant + +# Environment +Environment=PYTHONUNBUFFERED=1 +Environment="PULSE_SERVER=unix:/var/run/pulse/native" +Environment="PULSE_LATENCY_MSEC=60" +Environment="MPV_DEFAULT_DEVICE=pulse/alsa_output.platform-soc_sound.stereo-fallback" + +# Wait briefly for the Pulse native socket to be ready +ExecStartPre=/bin/sh -c 'for i in $(seq 1 40); do [ -S /var/run/pulse/native ] && exit 0; sleep 0.5; done; echo "PulseAudio socket not found" >&2; exit 1' + +# Launch the assistant +ExecStart=/home/pi/linux-voice-assistant/script/run \ + --name 'Linux Satellite PA OWW' \ + --audio-input-device default \ + --audio-output-device ${MPV_DEFAULT_DEVICE} \ + --wake-uri 'tcp://127.0.0.1:10400' \ + --wake-word-name 'alexa' \ + --wake-models-dir '/home/pi/wyoming-openwakeword/wyoming_openwakeword/models' \ + --debug + +Restart=always +RestartSec=2 + +[Install] +WantedBy=multi-user.target