No Voice Detection

Hello!!
I’ve an issue with audio detection and wake word on Rhasspy 2.5.9.

My setup is:

Rapsberry Pi 3B+ running Raspbian Buster
USB microphone (plug and play one)
Headphone connected to 3.5mm jack for audio output
Rhasspy 2.5.9 on Docker
wake word: Porcupine 

I double checked (refer image) my mic and headphone through arecord -l and aplay -l they both are available. I’ve also confirmed that both are working fine on Rpi by recording audio wav file and taking speaker test and /home/pi/.asoundrc changed device and card number accordingly.

device

I don’t know what went wrong here. why rhasspy is not able to catch audio when hitting wake up button, I get the “Listening for command” pop-up, but it doesn’t respond to anything I say, and eventually times out. So I guess that no audio input is getting through to Rhasspy at all even though I used --device /dev/snd:/dev/snd in docker run. Even I re-installed docker and rhasspy image but didn’t solve problem.

Another strange thing is when I select arecord as audio recording, it does not show me USB PnP device even after refreshing multiple times. Same goes with aplay in audio playing (refer image). Conversely, when I select Pyaudio as audio recording it does give me USB PnP option but after setting it on Pyaudio and USB PnP device still it does not detect any voice.
mic

Secondly, wake word Porcupine is also not working may be because of above stated issues.
I’ve been struggling with this issue for more than 3 days. I read couple of threads on it but did not get any solution or work around. I would be happy if any one can guide me in this case or advocate me to solve this problem.
Thanks in advance.

/home/pi/.asoundrc will not be in your docker container you also have to share any alsa config such as /etc/asound.conf or /home/pi/.asoundrc

Delete your container add those resources to your docker run and try again with a docker run

Thanks a lot for your quick response. I’m new to this things so sorry to say I exactly don’t know how to share ALSA Config file to docker. Could you please guide me How can I do that to proceed further.

Thanks a lot again.

the docker run command

docker run -d -p 12101:12101 \
      --name rhasspy \
      --restart unless-stopped \
      -v "$HOME/.config/rhasspy/profiles:/profiles" \
      -v "/etc/localtime:/etc/localtime:ro" \
      --device /dev/snd:/dev/snd \
      rhasspy/rhasspy \
      --user-profiles /profiles \
      --profile en

The line -v "$HOME/.config/rhasspy/profiles:/profiles shares the host $HOME/.config/rhasspy/profiles dir and in the container it becomes /profiles

So another line with -v "/etc/asound.conf:/etc/asound.conf" \ sets up a system wide asound control file as that saves any confusion of user so copy your settings to /etc/asound.conf and delete you user based .asound.rc

My memory is terrible is it docker ls to list or ps? Anyway after you do, do a docker stop [container-name] then a docker prune will remove all stopped docker containers edit your run command and run docker again an any change to the host /etc/asound.conf wil be reflected in the container as that file will be being shared and at the right location.

I am not sure what your setup was or even if that is the fix but often people are confused that the docker container will have its own asound files unless shared via the above. In fact it will have none but editing the host files will have no effect until you do.

If that doesn’t work docker exec -it <container name> /bin/bash and try your aplay -l from inside the container as what it sees and setup might be different to what you are expecting on the host as they are essentially separate instances.

Thanks @rolyan_trauts for sparing your precious time.

I did follow all steps as you directed. Re-installed docker and rhasspy image, added -v "/etc/asound.conf:/etc/asound.conf" to docker run command after configuring /etc/asound.conf. Also checked docker exec -it rhasspy /bin/bash with aplay -l it does show same device and card number of headphone I’m using.
It went well so far Okay.

Now main part Rhasspy GUI, I set audio recording to arecord and audio playing to aplay with default devices, because when ever I search for devices it doesn’t give me USB PnP and Headphone in drop down menu. After setting this parameters I moved to test wake up button, as usual I got the “Listening for command” pop-up with no transcription of speech. It didn’t detect any words stating “No Intent Recognized” on Screen with beep sound at the end.

Here’s log file:

rhasspyserver_hermes: Sent 260 [DEBUG:2021-03-01 09:13:04,237] rhasspyserver_hermes: Sent 260 char(s) to websocket
rhasspyserver_hermes: Sent 260 char(s) to websocket
rhasspyserver_hermes: Sent 260 char(s) to websocket
rhasspyserver_hermes: Handling NluIntentNotRecognized (topic=hermes/nlu/intentNotRecognized, id=3ebc19a8-7a0f-491b-ac43-aa1b4cfe8561)
rhasspyserver_hermes: <- NluIntentNotRecognized(input=’’, site_id=‘default’, id=‘d8be0aae-4bcc-40dd-990e-a58dcd6f408f’, custom_data=None, session_id=‘d8be0aae-4bcc-40dd-990e-a58dcd6f408f’)
rhasspyserver_hermes: Publishing 189 bytes(s) to hermes/nlu/query
rhasspyserver_hermes: -> NluQuery(input=’’, site_id=‘default’, id=‘d8be0aae-4bcc-40dd-990e-a58dcd6f408f’, intent_filter=None, session_id=‘d8be0aae-4bcc-40dd-990e-a58dcd6f408f’, wakeword_id=None, lang=None)
rhasspyserver_hermes: Publishing 74 bytes(s) to hermes/asr/stopListening
rhasspyserver_hermes: -> AsrStopListening(site_id=‘default’, session_id=‘d8be0aae-4bcc-40dd-990e-a58dcd6f408f’)
rhasspyserver_hermes: Waiting for intent (session_id=d8be0aae-4bcc-40dd-990e-a58dcd6f408f)
rhasspyserver_hermes: Handling AsrTextCaptured (topic=hermes/asr/textCaptured, id=25e9ea1b-4292-4f4e-a9f4-c665faab41f4)

After this I tried several times to re-run the docker command but unfortunately I got same output every time and in some cases “Time Out”. This was the case with arecord for audio recording.
Now changed it to Pyaudio where I get my choice of device in drop down menu but If I set it to USB PnP device I don’t get any respond too as stated above case, Only Time out.

Here’s Log file:

rhasspyserver_hermes:
Traceback (most recent call last):
File “/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/quart/app.py”, line 1821, in full_dispatch_request
result = await self.dispatch_request(request_context)
File “/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/quart/app.py”, line 1869, in dispatch_request
return await handler(**request_.view_args)
File “/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/main.py”, line 908, in api_listen_for_command
handle_captured(), messages, message_types
File “/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/init.py”, line 971, in publish_wait
result_awaitable, timeout=timeout_seconds
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 449, in wait_for
raise futures.TimeoutError()
concurrent.futures._base.TimeoutError

I really don’t know what’s happening or what’s the real error here.
I apologize for long post but I thought It may help you to get clear picture of my problem. I’m running out of time as will have presentation in this week So I need to complete this ASAP.

Thanks again.

Finally, I got it though it’s not working well so got more work to do.
Anyway!!

I set both mic and speaker to default devices, here’s my rhasspy profile:

},
"microphone": {
    "system": "arecord"
},
"sounds": {
    "system": "aplay"
},
1 Like