@donburch @rejoe2 thanks for sharing your service files! I tried to repeat your steps on my RP where I have rhasspy installed as a deb package, but if I start it as a service it doesn’t see audio input and output:
Feb 09 15:02:32 raspberrypi rhasspy[27323]: [ERROR:2022-02-09 15:02:32,027] rhasspymicrophone_pyaudio_hermes: record
Feb 09 15:02:32 raspberrypi rhasspy[27323]: Traceback (most recent call last):
Feb 09 15:02:32 raspberrypi rhasspy[27323]: File "/usr/lib/rhasspy/rhasspy-microphone-pyaudio-hermes/rhasspymicrophone_pyaudio_hermes/__init__.py", line 119, in record
Feb 09 15:02:32 raspberrypi rhasspy[27323]: stream_callback=callback,
Feb 09 15:02:32 raspberrypi rhasspy[27323]: File "/usr/lib/rhasspy/usr/local/lib/python3.7/site-packages/pyaudio.py", line 750, in open
Feb 09 15:02:32 raspberrypi rhasspy[27323]: stream = Stream(self, *args, **kwargs)
Feb 09 15:02:32 raspberrypi rhasspy[27323]: File "/usr/lib/rhasspy/usr/local/lib/python3.7/site-packages/pyaudio.py", line 441, in __init__
Feb 09 15:02:32 raspberrypi rhasspy[27323]: self._stream = pa.open(**arguments)
Feb 09 15:02:32 raspberrypi rhasspy[27323]: OSError: [Errno -9996] Invalid input device (no default output device)
Feb 09 15:03:06 raspberrypi rhasspy[27323]: [ERROR:2022-02-09 15:03:06,229] rhasspyserver_hermes: Command '['aplay', '-q', '-t', 'wav']' returned non-zero exit status 1.
Feb 09 15:03:06 raspberrypi rhasspy[27323]: Traceback (most recent call last):
Feb 09 15:03:06 raspberrypi rhasspy[27323]: File "/usr/lib/rhasspy/usr/local/lib/python3.7/site-packages/quart/app.py", line 1821, in full_dispatch_request
Feb 09 15:03:06 raspberrypi rhasspy[27323]: result = await self.dispatch_request(request_context)
Feb 09 15:03:06 raspberrypi rhasspy[27323]: File "/usr/lib/rhasspy/usr/local/lib/python3.7/site-packages/quart/app.py", line 1869, in dispatch_request
Feb 09 15:03:06 raspberrypi rhasspy[27323]: return await handler(**request_.view_args)
Feb 09 15:03:06 raspberrypi rhasspy[27323]: File "/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/__main__.py", line 1699, in api_text_to_speech
Feb 09 15:03:06 raspberrypi rhasspy[27323]: results = await asyncio.gather(*aws)
Feb 09 15:03:06 raspberrypi rhasspy[27323]: File "/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/__main__.py", line 1685, in speak
Feb 09 15:03:06 raspberrypi rhasspy[27323]: say_chars_per_second=say_chars_per_second,
Feb 09 15:03:06 raspberrypi rhasspy[27323]: File "/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/__init__.py", line 632, in speak_sentence
Feb 09 15:03:06 raspberrypi rhasspy[27323]: raise AudioServerException(play_response.error)
Feb 09 15:03:06 raspberrypi rhasspy[27323]: rhasspyserver_hermes.AudioServerException: Command '['aplay', '-q', '-t', 'wav']' returned non-zero exit status 1.
Here is my /etc/systemd/system/rhasspy.service:
[Unit]
Description=Rhasspy Service
After=syslog.target network.target pulseaudio.service
[Service]
Type=simple
ExecStart=/bin/bash -c 'rhasspy --profile en 2>&1 | cat'
WorkingDirectory=/home/pi
User=pi
Group=audio
RestartSec=10
Restart=on-failure
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=rhasspy
[Install]
WantedBy=multi-user.target
What did I miss?
PS: I works fine if I just start it from the shell like rhasspy --profile en