forslund / mycroft-porcupine-plugin

Apache License 2.0
3 stars 3 forks source link

Not activating listener after hotword detection #3

Closed builderjer closed 2 years ago

builderjer commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

I got this working with the new version of porcupine, by just adding an access_key to the connect() functions. Everything seems to work as far as detecting the hotword, but it doesn't seem to activate the mycroft listener.

To Reproduce Steps to reproduce the behavior:

Create a free account and get an access_key from the picovoice website. Install the plugin as directed in the README with the exception of adding the changes in the config to:

"hotwords": { "<my_custom_hotword>": { "module": "porcupine_wakeword_plug", "keyword_file_path": "~/.config/mycroft/wakewords/<my_custom_hotword>.ppn", "sensitivity": 0.5, "access_key": "<YOUR_ACCESS_KEY" } NOTE: the addition of "access_key" Also the changes to the init.py shown here

Run mycroft and say the hotword

Expected behavior A clear and concise description of what you expected to happen.

I would expect the listening sound and wait for me to say an utterance.

Log files

tail -f /var/log/mycroft/voice.log 2021-12-31 15:57:37.801 - OVOS - ovos_plugin_manager.wakewords:load_module:66 - INFO - Loaded the Wake Word plugin ovos-ww-plugin-pocketsphinx {'hey mycroft': {'module': 'ovos-precise-lite', 'phonemes': 'HH EY . M AY K R AO F T', 'threshold': 1e-90, 'lang': 'en-us', 'listen': True, 'sound': 'snd/start_listening.wav'}, 'wake up': {'module': 'ovos-ww-plugin-pocketsphinx', 'phonemes': 'W EY K . AH P', 'threshold': 1e-20, 'lang': 'en-us', 'wakeup': True}, 'listen ziggy': {'module': 'porcupine_wakeword_plug', 'keyword_file_path': '~/.config/mycroft/wakewords/listen-zig-e_en_linux_v2_0_0.ppn', 'sensitivity': 0.5, 'access_key': 'xR94CQf6DyT7Y6UlHxZ1TZrndUBEPscuD8tDR2pe/Aqf7NKizvHl7g=='}} 2021-12-31 15:57:37.823 - OVOS - ovos_plugin_manager.wakewords:load_module:56 - INFO - Loading "listen ziggy" wake word via porcupine_wakeword_plug 2021-12-31 15:57:37.824 - OVOS - ovos_plugin_manager.wakewords:load_module:57 - INFO - porcupine_wakeword_plug 2021-12-31 15:57:37.824 - OVOS - ovos_plugin_manager.wakewords:load_module:62 - INFO - NOPE 2021-12-31 15:57:37.830 - OVOS - ovos_plugin_manager.wakewords:load_module:66 - INFO - Loaded the Wake Word plugin porcupine_wakeword_plug 2021-12-31 15:57:37.851 - OVOS - mycroft_porcupine_plugin:__init__:51 - INFO - Loading Porcupine using keyword path ['/home/jbrodie/.config/mycroft/wakewords/listen-zig-e_en_linux_v2_0_0.ppn'] and sensitivities [0.5] 2021-12-31 15:57:37.853 - OVOS - mycroft_porcupine_plugin:__init__:59 - INFO - Loaded Porcupine 2021-12-31 15:57:37.858 - OVOS - mycroft.client.speech.service:on_ready:32 - INFO - Speech client is ready. 2021-12-31 15:57:39.803 - OVOS - mycroft.client.speech.mic:listen:801 - DEBUG - Waiting for wake word... 2021-12-31 15:58:59.881 - OVOS - mycroft.client.speech.service:handle_hotword:96 - INFO - Hotword Detected: listen ziggy 2021-12-31 15:59:02.716 - OVOS - mycroft.configuration.config:load_local:111 - DEBUG - Configuration '/etc/mycroft/mycroft.conf' not defined, skipping 2021-12-31 15:59:02.717 - OVOS - mycroft.configuration.config:load_local:106 - DEBUG - Configuration /home/jbrodie/Software/myhouse/ovos-core/.venv/lib/python3.9/site-packages/mycroft/configuration/mycroft.conf loaded 2021-12-31 15:59:02.720 - OVOS - mycroft.configuration.config:load_local:106 - DEBUG - Configuration /home/jbrodie/Software/myhouse/ovos-core/.venv/lib/python3.9/site-packages/mycroft/configuration/mycroft.conf loaded 2021-12-31 15:59:02.721 - OVOS - mycroft.configuration.config:load_local:111 - DEBUG - Configuration '/etc/mycroft/mycroft.conf' not defined, skipping 2021-12-31 15:59:03.204 - OVOS - mycroft.configuration.config:load_local:106 - DEBUG - Configuration /home/jbrodie/.config/mycroft/mycroft.conf loaded 2021-12-31 15:59:26.052 - OVOS - mycroft.client.speech.service:handle_wakeword:92 - INFO - Wakeword Detected: hey mycroft 2021-12-31 15:59:26.476 - OVOS - mycroft.client.speech.mic:listen:809 - DEBUG - Recording... 2021-12-31 15:59:26.477 - OVOS - mycroft.client.speech.service:handle_record_begin:66 - INFO - Begin Recording... 2021-12-31 15:59:28.152 - OVOS - mycroft.client.speech.service:handle_record_end:73 - INFO - End Recording... 2021-12-31 15:59:29.076 - OVOS - mycroft.client.speech.listener:transcribe:201 - DEBUG - STT: say hello 2021-12-31 15:59:29.076 - OVOS - mycroft.session:get:72 - INFO - New Session Start: 60b2ac07-e7c4-4b4a-bb2e-64a4e47f4186 2021-12-31 15:59:29.077 - OVOS - mycroft.client.speech.service:handle_utterance:106 - INFO - Utterance: ['say hello'] 2021-12-31 15:59:29.118 - OVOS - mycroft.client.speech.mic:listen:801 - DEBUG - Waiting for wake word...

You may also include screenshots, however screenshots of log files are often difficult to read and parse.

If you are running Mycroft, the Support Skill helps to automate gathering this information. Simply say "Create a support ticket" and the Skill will put together a support package and email it to you.

Environment (please complete the following information):

I am running ovos-core

Additional context

As you can see in the logs, it records and picks up my utterance with the "hey mycroft" wakeword, but not my porcupine hotword

Please think carefully about whether you have modified anything in Mycroft's code or configuration files. If so, can you reproduce this on a clean installation of Mycroft? Many "bugs" turn out to be non-standard configuration errors.

I modified a few things in the config file, but only what is necessary for the hotword configuration.

Any ideas would be great.

builderjer commented 2 years ago

maybe this log can help? 2022-01-01 06:14:31.727 - OVOS - mycroft.messagebus.service.event_handler:on_message:38 - DEBUG - {"type": "recognizer_loop:wakeword", "data": {"engine": "PorcupineWakeword", "sound": null, "bus_event": null, "trigger": false, "utterance": null, "stt_lang": "en-us", "listen": false, "wakeup": false, "hotword": "listen ziggy"}, "context": {}}

builderjer commented 2 years ago

Fixed it!! I had to add "listen: True" to my config file