rhasspy / wyoming-satellite

Remote voice satellite using Wyoming protocol
MIT License
617 stars 91 forks source link

RasPi Zero openwakeword Fails after a while with `RuntimeError: can't start new thread` #118

Open eldridgea opened 7 months ago

eldridgea commented 7 months ago

I'm running the Wyoming satellite on my Raspberry Pi Zero with reSpeaker following the official instructions. While it works for a while, it reliably fails and stops picking up wake words after a while, usually less than 20 minutes.

Relevant journalctl output from the last run

-- Journal begins at Mon 2023-12-04 21:57:17 EST. --
Feb 19 12:32:52 raspizero run[474]: Traceback (most recent call last):
Feb 19 12:32:52 raspizero run[474]:   File "/home/eldridgea/wyoming-openwakeword/.venv/lib/python3.9/site-packages/wyoming/server.py", line 35, in run
Feb 19 12:32:52 raspizero run[474]:     if not (await self.handle_event(event)):
Feb 19 12:32:52 raspizero run[474]:   File "/home/eldridgea/wyoming-openwakeword/wyoming_openwakeword/handler.py", line 73, in handle_event
Feb 19 12:32:52 raspizero run[474]:     ensure_loaded(
Feb 19 12:32:52 raspizero run[474]:   File "/home/eldridgea/wyoming-openwakeword/wyoming_openwakeword/handler.py", line 255, in ensure_loaded
Feb 19 12:32:52 raspizero run[474]:     state.ww_threads[model_key].start()
Feb 19 12:32:52 raspizero run[474]:   File "/usr/lib/python3.9/threading.py", line 874, in start
Feb 19 12:32:52 raspizero run[474]:     _start_new_thread(self._bootstrap, ())
Feb 19 12:32:52 raspizero run[474]: RuntimeError: can't start new thread

(Probably unrelated but for context, the reason I'm running it on the Pi, is I was running the Wyoming satellite on the Pi and openwakeword on my Home Assistant instance, and a recent update meant that HA's openwakeword would only detect once and then not again until it was rebooted. So I moved to running it directly on the Pi, but hit this issue)

Joldiges commented 1 month ago

I'm running the Wyoming satellite on my Raspberry Pi Zero with reSpeaker following the official instructions. While it works for a while, it reliably fails and stops picking up wake words after a while, usually less than 20 minutes.

Relevant journalctl output from the last run

-- Journal begins at Mon 2023-12-04 21:57:17 EST. --
Feb 19 12:32:52 raspizero run[474]: Traceback (most recent call last):
Feb 19 12:32:52 raspizero run[474]:   File "/home/eldridgea/wyoming-openwakeword/.venv/lib/python3.9/site-packages/wyoming/server.py", line 35, in run
Feb 19 12:32:52 raspizero run[474]:     if not (await self.handle_event(event)):
Feb 19 12:32:52 raspizero run[474]:   File "/home/eldridgea/wyoming-openwakeword/wyoming_openwakeword/handler.py", line 73, in handle_event
Feb 19 12:32:52 raspizero run[474]:     ensure_loaded(
Feb 19 12:32:52 raspizero run[474]:   File "/home/eldridgea/wyoming-openwakeword/wyoming_openwakeword/handler.py", line 255, in ensure_loaded
Feb 19 12:32:52 raspizero run[474]:     state.ww_threads[model_key].start()
Feb 19 12:32:52 raspizero run[474]:   File "/usr/lib/python3.9/threading.py", line 874, in start
Feb 19 12:32:52 raspizero run[474]:     _start_new_thread(self._bootstrap, ())
Feb 19 12:32:52 raspizero run[474]: RuntimeError: can't start new thread

(Probably unrelated but for context, the reason I'm running it on the Pi, is I was running the Wyoming satellite on the Pi and openwakeword on my Home Assistant instance, and a recent update meant that HA's openwakeword would only detect once and then not again until it was rebooted. So I moved to running it directly on the Pi, but hit this issue)

The official instructions aren't compatible with 32bit hardware (onnxruntime won't install), which the RasPi Zero is. Are you using a RasPi Zero 2?