synesthesiam / rhasspy

Rhasspy voice assistant for offline home automation
https://rhasspy.readthedocs.io
MIT License
944 stars 101 forks source link

A few errors #74

Closed KiboOst closed 4 years ago

KiboOst commented 4 years ago

Hi,

Here are a few errors I got. No community so trying to put them here to help:

My config: Config:

Started : rhasspy/run-venv.sh --profile fr

Problems. Let me know if I can do something to help.

===========At startup: [2019-12-13 09:54:30,501] ASGI Framework Lifespan error, continuing without Lifespan support WARNING:quart.serving:ASGI Framework Lifespan error, continuing without Lifespan support

===========Starting then wake with mic: DEBUG:ARecordAudioRecorder:Recording from microphone (arecord) -> saying wake word: arecord: main:828: audio open error: Device or resource busy -> after some time: WARNING:WebrtcvadCommandListener:Timeout DEBUG:WebrtcvadCommandListener:listening -> loaded DEBUG:ARecordAudioRecorder:recording -> started DEBUG:DialogueManager:awake -> decoding DEBUG:ARecordAudioRecorder:Stopped recording from microphone (arecord) DEBUG:APlayAudioPlayer:['aplay', '-q', '/home/pi/rhasspy/etc/wav/beep_lo.wav'] DEBUG:PocketsphinxDecoder:rate=16000, width=2, channels=1. DEBUG:PocketsphinxDecoder:Decoded WAV in 0.010403156280517578 second(s) DEBUG:DialogueManager: (confidence=0) DEBUG:DialogueManager:decoding -> recognizing ERROR:FsticuffsRecognizer:in_loaded Traceback (most recent call last): File "/home/pi/rhasspy/rhasspy/intent.py", line 208, in in_loaded assert recognitions, "No intent recognized" AssertionError: No intent recognized DEBUG:DialogueManager:{'text': '', 'intent': {'name': '', 'confidence': 0}, 'entities': [], 'speech_confidence': 0} DEBUG:DialogueManager:recognizing -> handling DEBUG:WebSocketObserver:{"text": "", "intent": {"name": "", "confidence": 0}, "entities": [], "speech_confidence": 0, "slots": {}} DEBUG:DialogueManager:handling -> ready INFO:DialogueManager:Automatically listening for wake word DEBUG:DialogueManager:ready -> asleep DEBUG:SnowboyWakeListener:loaded -> listening DEBUG:ARecordAudioRecorder:started -> recording DEBUG:ARecordAudioRecorder:['arecord', '-q', '-r', '16000', '-f', 'S16_LE', '-c', '1', '-t', 'raw', '-D', 'sysdefault:CARD=seeed2micvoicec'] DEBUG:ARecordAudioRecorder:Recording from microphone (arecord)

===========Restarting after saving settings: DEBUG:main:Restarting Rhasspy ... DEBUG:ARecordAudioRecorder:Recording from microphone (arecord) INFO:main:Started INFO:main:Restarted Rhasspy [2019-12-13 10:04:25,713] 192.168.0.10:55299 POST /api/restart 1.1 200 17 1008084 INFO:quart.serving:192.168.0.10:55299 POST /api/restart 1.1 200 17 1008084 ERROR:main:api_events_log Traceback (most recent call last): File "app.py", line 977, in api_events_log text = await q.get() File "/usr/lib/python3.7/asyncio/queues.py", line 159, in get await getter concurrent.futures._base.CancelledError [2019-12-13 10:04:25,765] Error in ASGI Framework Traceback (most recent call last): File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/hypercorn/asgi/wsproto.py", line 91, in handle_asgi_app await asgi_instance(self.asgi_receive, self.asgi_send) File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/quart/asgi.py", line 106, in call await _cancel_tasks(pending) File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/quart/asgi.py", line 189, in _cancel_tasks raise task.exception() File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/quart/asgi.py", line 157, in handle_websocket 'code': 1000, File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/hypercorn/asgi/wsproto.py", line 149, in asgi_send await self.asend(CloseConnection(code=int(message["code"]))) File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/hypercorn/asyncio/wsproto.py", line 93, in asend self.write(self.connection.send(event)) File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/wsproto/init.py", line 64, in send data += self.connection.send(event) File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/wsproto/connection.py", line 101, in send "Connection cannot be closed in state %s" % self.state wsproto.utilities.LocalProtocolError: Connection cannot be closed in state ConnectionState.CLOSED ERROR:quart.serving:Error in ASGI Framework Traceback (most recent call last): File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/hypercorn/asgi/wsproto.py", line 91, in handle_asgi_app await asgi_instance(self.asgi_receive, self.asgi_send) File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/quart/asgi.py", line 106, in call await _cancel_tasks(pending) File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/quart/asgi.py", line 189, in _cancel_tasks raise task.exception() File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/quart/asgi.py", line 157, in handle_websocket 'code': 1000, File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/hypercorn/asgi/wsproto.py", line 149, in asgi_send await self.asend(CloseConnection(code=int(message["code"]))) File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/hypercorn/asyncio/wsproto.py", line 93, in asend self.write(self.connection.send(event)) File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/wsproto/init.py", line 64, in send data += self.connection.send(event) File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/wsproto/connection.py", line 101, in send "Connection cannot be closed in state %s" % self.state wsproto.utilities.LocalProtocolError: Connection cannot be closed in state ConnectionState.CLOSED [2019-12-13 10:04:25,805] 192.168.0.10:55299 GET / 1.1 200 1029 4869 INFO:quart.serving:192.168.0.10:55299 GET / 1.1 200 1029 4869 [2019-12-13 10:04:25,910] 192.168.0.10:55299 GET /css/bootstrap.min.css 1.1 200 140930 20753 ... [2019-12-13 10:04:26,396] 192.168.0.10:55304 GET /api/problems 1.1 200 293 14139 INFO:quart.serving:192.168.0.10:55304 GET /api/problems 1.1 200 293 14139

===========Ctrl C to quit: Traceback (most recent call last): File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/hypercorn/asgi/wsproto.py", line 78, in handle_websocket await self.handle_asgi_app(event) File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/hypercorn/asgi/wsproto.py", line 99, in handle_asgi_app await self.asend(CloseConnection(code=CloseReason.ABNORMAL_CLOSURE)) File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/hypercorn/asyncio/wsproto.py", line 93, in asend self.write(self.connection.send(event)) File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/wsproto/init.py", line 64, in send data += self.connection.send(event) File "/home/pi/rhasspy/.venv/lib/python3.7/site-packages/wsproto/connection.py", line 101, in send "Connection cannot be closed in state %s" % self.state wsproto.utilities.LocalProtocolError: Connection cannot be closed in state ConnectionState.CLOSED

koenvervloesem commented 4 years ago

Did you download resources and train your assistant after visiting Rhasspy's web interface on http://IP:12101?

KiboOst commented 4 years ago

Yes of course. All seems working quiet nice, have set some sentences with some entities and they are recognized etc.

koenvervloesem commented 4 years ago

So you're saying some intents are recognized, but then suddenly this error occurs? In which situation exactly does this happen?

KiboOst commented 4 years ago

I guess you are talking about this error : audio open error: Device or resource busy

It happens after starting rhasspy and wake word is detected (got the wav sound). After it timeout, I can ask something and yes intent is recognized. But immediately after (a few second) having back 'recording' if I say the wake word again, I got again 'resource busy' and have to wait timeout to wake another time and this time it will work.

synesthesiam commented 4 years ago

I've seen this behavior before, but only inside a Docker container (which you're not doing). This typically happens when trying to use /dev/snd via ALSA while pulseaudio is also trying to maintain control. Is there anything else installed on your system like pulseaudio or the JACK audio server?

KiboOst commented 4 years ago

Hi, I have nothing else on the rpi.

Just a raspbian lite buster, installed seed driver (didn't even touched asound.conf) then Rhasspy env and lastly picoTTS

respeaker installed like this:

git clone https://github.com/respeaker/seeed-voicecard cd seeed-voicecard sudo ./install.sh

synesthesiam commented 4 years ago

I've pushed some changes that make Rhasspy no longer stop/re-start audio recording after the wake word is heard. I'm hoping this will fix some of the "busy" errors people are seeing.

@jthomasdewald also found that disabling the built-in Pi audio interface helped. They added this to /boot/config.txt

##turn off onboard alsa interface
dtparam=audio=off