Speech recognizer problem
Hi,
I have a problem with the speech recognizer. My microphone works fine.
I saw many answers about this problem, but i don't understand what's the issue to fix it.
pi@raspberrypi:~/smart-mirror $ npm start dev
[email protected] start /home/pi/smart-mirror electron main.js "dev"
ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory Cannot connect to server request channel
ack server is not running or cannot be started
Thx
First off, those warnings are nothing to worry about. When I see speech recognition issues like this there are three things that I look at:
- Have they installed all necessary dependencies?
- Have they created chromium speech keys?
- Is their microphone configured to stream to multiple sources simultaneously (see #307)?
If you've done all three of those things and are still having issues I would recommend running npm start dev and seeing what (if any) error you get after you say "smart mirror".
If saying "smart mirror" does nothing:
There is likely an issue with the keyword spotter. You can run it from the smart-mirror directory with
python speech/kws.py smart_mirror.pmdl 0.5
If that doesn't work and you've installed all dependencies then the spotter may not be recognizing your voice. You can train the model on your pi on the latest dev branch by running npm run train-model. More info in #330.
Still not getting the keyword "smart mirror" to work:
Run npm start dev and then manually trigger speech recognition by putting the following into the dev tools:
annyang.start()
If you get a network error:
Something is probably wrong with step 2 above. Double check that this is configured correctly and follow the troubleshooting steps if you get stuck.
If you get an audio-capture error:
This is likely an issue with step 3. To test your microphone you can run
npm microphone-debug
Note: that this will not be streaming to multiple processes, you can simulate this by running the python command mentioned above from another terminal tab.
Hi! I have a problem with keyword i have made my own file but doens´t work. I have try with console annyang.start() command and microphone start to works.
Hi @evancohen,
I retry my microphone and it works !! I think that the micro is very bad, and i will configure the sensibility.
Thx for helping
I have the same problem as Keopss, This is the error im getting
Expression 'paInvalidSampleRate' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2048
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->capture, inParams, self->primeBuffers, hwParamsCapture, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2719
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2843
Traceback (most recent call last):
File "./speech/kws.py", line 32, in
@Keopss @stantonb A few questions to help sort this out:
- Have you gone through all the steps I listed above (including step 3 which is to remove PulseAudio and try another method)?
- Are you guys using the Pi or another device?
- What USB microphone are you using?
- Can you confirm that the filename for the model matches what you have put in
config.js?
@evancohen
1 - I have installed PulseAudio i might to uninstall it? this is the command to do it?:
sudo apt-get autoremove pulseaudio
2- Raspberry Pi 3
3 - USB device micro worked in all others versions and when i type annyang.start()
4 - Yes file match
I followed all steps in http://docs.smart-mirror.io included this:
sudo apt-get install python-pyaudio python3-pyaudio sox pulseaudio-module-jack
@Keopss that's the correct command for uninstalling PulseAudio
When installing you should omit the final pulseaudio module (that will just cause it to be reinstalled):
sudo apt-get install python-pyaudio python3-pyaudio sox
This issue is resolved in #307