smart-mirror icon indicating copy to clipboard operation
smart-mirror copied to clipboard

Speech recognizer problem

Open SebDuboisMIAGE opened this issue 10 years ago • 8 comments

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

SebDuboisMIAGE avatar Jul 06 '16 09:07 SebDuboisMIAGE

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:

  1. Have they installed all necessary dependencies?
  2. Have they created chromium speech keys?
  3. 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.

evancohen avatar Jul 07 '16 04:07 evancohen

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.

Keopss avatar Jul 07 '16 10:07 Keopss

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

SebDuboisMIAGE avatar Jul 07 '16 12:07 SebDuboisMIAGE

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 detector = snowboydecoder.HotwordDetector(model, sensitivity=detectionSensitivity) File "/home/pi/smart-mirror/speech/snowboydecoder.py", line 115, in init stream_callback=audio_callback) File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 747, in open stream = Stream(self, _args, *_kwargs) File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 442, in init self._stream = pa.open(**arguments) IOError: [Errno Invalid sample rate] -9997

stantonb avatar Jul 07 '16 13:07 stantonb

@Keopss @stantonb A few questions to help sort this out:

  1. Have you gone through all the steps I listed above (including step 3 which is to remove PulseAudio and try another method)?
  2. Are you guys using the Pi or another device?
  3. What USB microphone are you using?
  4. Can you confirm that the filename for the model matches what you have put in config.js?

evancohen avatar Jul 07 '16 17:07 evancohen

@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 avatar Jul 07 '16 21:07 Keopss

@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

evancohen avatar Jul 07 '16 22:07 evancohen

This issue is resolved in #307

evancohen avatar Jul 15 '16 07:07 evancohen