[solved] Unable to verify custom wakeword

Hello!
i’m pretty new to snips but i have already been able to integrate this great piece of work into openhab. but for some days i have been struggeling with a custom wakeword…
i followed the instructions given here but every time can’t verify my wakeword on step “4. Test your model and adjust its sensitivity”

this is what i’m doing (what i have done with different wake words - sometimes i have to repeat the wake word many times (15+), somtimes the wake word is saved after few attempts (3-5):

pi@SnipsBerry:~/snips-record-personal-hotword $ sudo systemctl stop snips-audio-server; python script_recording.py my_hotword_test
Your will have to record your personal hotword. Please be sure to be in a quiet environment. Press enter once you are ready.

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock


Press enter to record one sample, say your hotword when "recording..." shows up
recording...
finished recording

ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock


Press enter to record one sample, say your hotword when "recording..." shows up
recording...
finished recording

Your model has been saved in /home/pi/snips-record-personal-hotword/personal_2019_03_18T21_34_01

but on step 4: “Test your model and adjust its sensitivity” nothing happens:

pi@SnipsBerry:~/snips-record-personal-hotword/personal_2019_03_18T21_34_01 $ sudo systemctl stop snips-hotword; sudo systemctl s                                                             top snips-dialogue; sudo systemctl start snips-audio-server;
pi@SnipsBerry:~/snips-record-personal-hotword/personal_2019_03_18T21_34_01 $ snips-hotword --model /home/pi/snips-record-persona                                                             l-hotword/personal_2019_03_18T21_34_01=0.5
[21:38:03.980675] INFO :snips_hotword::server: Using model from /home/pi/snips-record-personal-hotword/personal_2019_03_18T21_34                                                             _01
[21:38:04.137612] INFO :snips_hotword::server: Discovered audio_server default/mqtt, starting hotword listener
[21:38:04.137691] INFO :snips_hotword::server: Connecting using MQTT site-id default
[21:38:04.138323] INFO :snips_hotword_lib::audio: Audio thread for default started
[21:38:04.138728] INFO :snips_hotword_lib::audio: Net and VAD thread for site default started (vad inhibitor: true, vad messages                                                             : false
[21:38:04.142640] INFO :snips_hotword_lib       : Detector "detector.my_hotword_test.default", sensitivity: 0.5, threshold 0.5
[21:38:04.142883] INFO :snips_hotword_lib       : detector.my_hotword_test.default thread started

i’ve said the test hotword 25 times but got absoulte no response…

i’m using a raspberry with “ReSpeaker 2 - Mics Pi HAT” and “hey_snips” works perfectly. all the commands posted above are executed on the raspberry where the HAT is mounted.

What am i doing wrong? I’d be happy to get some help here :slight_smile:

cheers,
Peter

Hi,
The fact that sometime have to record 15 times probably comes from the microphone that behaves strangely when it is start / stoped. Basically a pic in the wave file appears and is considered as noise by the preprocessing checking that your environment is not noisy (this is the python script). The algorithm then trims your samples to remove the silence surrounding them (you can see an illustration below).

.
The solution is to download the recording files, trim them manually with Audacity (keep only the clean part) and replace them in the right folder.
Thibault

I managed to record a wakeword validated by the script but using the microphone of a headset. The microphone built in the computer was picking too much noise, and recording from the dev kit itself was out of the question, the mics are so sensitive they record a constant background noise.

But I also had to raise the sensitivity to 0.6, and sometimes my assistant will think lyrics in a song are waking it up. :smiley:

i have also tried a very short wakeword where the script needed just 3 attempts and was happy with the result. still no recognition in the following test. i’ll try to record the wakeword on a different device.

It’s no coincidence that all major voice assistants have a wakeword with three or four syllables: “Hey Google”, “Alexa”, “Hey Siri”, “Cortana”.

There are some guidelines for choosing a wakeword. They are:

  • avoid short single words;
  • avoid long phrases;
  • choose words with diverse sounds.

Following these guidelines will improve wakeword recognition.

Note that “Hey Snips” isn’t an optimal wakeword according to these guidelines. No wonder Snips sometimes ‘recognizes’ its name when I sneeze :wink:

1 Like

Thanks for the precision koan. Also note that the personal wakeword algorithm is not the same than the one used for the universal one (“Hey Snips” or any other that can be found when you build your assistant). The algorithm for personal wakeword is more sensitive to the ambient noise, and recording of the samples must be done is conditions that are as quiet as possible. Finally the sensitivity usually has to be fine-tuned a little so don’t hesitate to try other values for it.
Thibault

Hey Snips!
i was able to “solve” my problem. the script saved very long wav-files with some noice before and afterwards. i made 3 recordings on a different device and trimmed the files. now snips is listening to his new wake word!
thank you very much!

Mine is 2 syllables and even if I record it 10, 15, 20 times, it doesn’t work. Why is this?