Skip to content
This repository was archived by the owner on Sep 8, 2024. It is now read-only.
This repository was archived by the owner on Sep 8, 2024. It is now read-only.

Cannot get Porcupine wakeword detection working with Raspberry-pi #2720

@butteryak

Description

@butteryak

Trying to use Porcupine for wake word detection, and not having any success: As there is no way to create a custom wakeword as optimizer is no longer part of the porcupine package, I do see there is a way with the picovoice console tool to create custom wake word, but the free version only allows creation of wake for for x86 not ARM based machines....so trying to work with the existing models that are included with Procupine package. I have set mycroft.conf as this:

"listener": {
  "wake_word": "blueberry"
},

"hotwords": {
  "blueberry": {
    "module": "porcupine",
    "porcupine_path": "~/.mycroft/Porcupine",
    "keyword_file_path": "~/.mycroft/Porcupine/resources/keyword_files/raspberry-pi/blueberry_raspberry-pi.ppn"
    }
}

Porcupine wake word appears to be attempint to load, but having this error:

2020-10-13 18:03:22.296 | INFO     |  6577 | mycroft.client.speech.listener:create_wake_word_recognizer:328 | Creating wake word engine
2020-10-13 18:03:22.299 | INFO     |  6577 | mycroft.client.speech.listener:create_wake_word_recognizer:351 | Using hotword entry for blueberry
2020-10-13 18:03:22.302 | WARNING  |  6577 | mycroft.client.speech.listener:create_wake_word_recognizer:353 | Phonemes are missing falling back to listeners configuration
2020-10-13 18:03:22.305 | WARNING  |  6577 | mycroft.client.speech.listener:create_wake_word_recognizer:357 | Threshold is missing falling back to listeners configuration
2020-10-13 18:03:22.310 | INFO     |  6577 | mycroft.client.speech.hotword_factory:load_module:403 | Loading "blueberry" wake word via porcupine
2020-10-13 18:03:22.315 | INFO     |  6577 | mycroft.client.speech.hotword_factory:__init__:331 | Adding /home/pi/.mycroft/Porcupine/binding/python to Python path
2020-10-13 18:03:22.338 | INFO     |  6577 | mycroft.client.speech.hotword_factory:__init__:356 | Loading Porcupine using library path /home/pi/.mycroft/Porcupine/lib/linux/armv7l/libpv_porcupine.so and keyword paths ['/home/pi/.mycroft/Porcupine/resources/keyword_files/raspberry-pi/blueberry_raspberry-pi.ppn']
2020-10-13 18:03:22.341 | ERROR    |  6577 | mycroft.client.speech.hotword_factory:initialize:423 | Could not create hotword. Falling back to default.
Traceback (most recent call last):
  File "/home/pi/mycroft-core/mycroft/client/speech/hotword_factory.py", line 411, in initialize
    instance = clazz(hotword, config, lang=lang)
  File "/home/pi/mycroft-core/mycroft/client/speech/hotword_factory.py", line 361, in __init__
    sensitivities=sensitivities)
TypeError: __init__() got an unexpected keyword argument 'model_file_path'
2020-10-13 18:03:22.345 | INFO     |  6577 | mycroft.client.speech.hotword_factory:load_module:403 | Loading "blueberry" wake word via pocketsphinx
2020-10-13 18:03:22.475 | INFO     |  6577 | mycroft.client.speech.listener:create_wakeup_recognizer:365 | creating stand up word engine
2020-10-13 18:03:22.478 | INFO     |  6577 | mycroft.client.speech.hotword_factory:load_module:403 | Loading "wake up" wake word via pocketsphinx
2020-10-13 18:03:22.602 | INFO     |  6577 | __main__:on_ready:175 | Speech client is ready.

I saw the Phenome and Threshold warnings, so tried to set those in mycroft.conf, but it did not make any difference, I got exactly the same errors.

Interestingly enough, I ask mycroft what the listener is and it tells me it's "Porcupine" although any sound seems to trigger it, and it is not recogizing speech commands after trigger.

I"m noting that the library that is loaded is "Loading Porcupine using library path /home/pi/.mycroft/Porcupine/lib/linux/armv7l/libpv_porcupine.so " which could be an issue, as this is raspberry-pi and the Procupine package has a specific library for raspberry-pi. I tried adjusting the code in "hotword_factory.py" to use the raspberry pi library.

 library_path = join(
            porcupine_path, 'lib/raspberry-pi/arm11/libpv_porcupine.so')
        model_file_path = join(
            porcupine_path, 'lib/common/porcupine_params.pv')

but I get the same error. So, how to go about getting this setup on raspberry-pi using the included raspberry-pi wakewords?

Originally posted by @butteryak in #2139 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions