MagicMirror² v2.13.0 is available! For more information about this release, check out this topic.

MMM-Hotword Listening, but not doing

  • Re: MMM-Hotword
    Hello, and hopefully hello to Sean, if you see this.

    I have Hotword installed with MMM-AssistantMk2 on the latest build of MM2 (2.90), running on an RPi3. Everything except Hotword is running great! At one point, before upgrading everything, I had all this working fine, but now my pm2 logs show

    0|mm  | [HOTWORD] Detector starts listening.
    0|mm  | [HOTWORD] Final Result: { detected: false }
    0|mm  | [HOTWORD] begins.

    over and over in a loop… No attempt on my part gets it to recognize anything. I even removed all modules except Hotword (and the clock so I’d know it was running) and I get the same results.

    I have deinstalled and reinstalled Hotword via the automatic script And the manual method. Installation appears to be fine, and components are there. Using this config:

    			module: "MMM-Hotword",
    			config: {
    				mic: {
    				  recordProgram : "arecord",  
    				  device        : "plughw:0",
    				models: [
    					hotwords    : "smart_mirror",
    					file        : "smart_mirror.umdl",
    					sensitivity : "0.5",
    				defaultCommand: {
    				  notificationExec: {
    					notification: "ASSISTANT_ACTIVATE",
    					payload: (detected, afterRecord) => {
    					  return {profile:"default"}

    The line for “device : “plughw:0”,” is because I’m using the Google HAT and mic/speakers/etc. That’s not the issue, I don’t think, because the HAT has worked fine in the past with Hotword.

    Please tell me I’m an idiot and that this is an easy fix I’m just not seeing right now.

    Thanks, and thanks to Sean for all the good work on this module!

  • Module Developer

    There is an issue about HAT.
    Usually, VOICE HAT is a 2-in-1 kit, so commonly the same device name is assigned to mic and speaker. It would be not the issue at all in usual usage. People can record-then-play by turns.

    My modules are working like this;

    1. Opening Mic and Recording
    2. After time or silence, closing the mic
    3. Some processing
    4. Opening the Speaker
    5. Streaming output to the speaker
    6. After time or EOS, closing the speaker
    7. repeat the whole process

    Ideally, the HAT should have no issue with my module, but…
    Physically Step 2. (closing Mic) could take some time to finish closing. (not predictable)
    So, sometimes Step 2. will be started before but ended after step 4. With separated Mic and Speaker, It will not be the problem at all.
    But with the HAT, This could be an issue. Closing Device:0(mic) is ended after Opening Device:0(speaker) and it will make Re-closing Device:0(speaker). Vice versa would be same.


    • give different device names to the mic and speaker.

    As far as I know, it could be done by ALSA configuration. However, I’m not that kind of expert so cannot give you exact instruction or example. sorry.

  • @Sean
    VERY interesting!

    FWIW, there was NO issue with HAT previously! That’s why I thought it would be OK going forward with it. Dammit, I should have left well enough alone and not upgraded! Too late now, everything’s changed!

    I don’t know enough about ALSA to fight my way out of a wet paper bag. But it is worth figuring out, because I’m not the only one who picked up a cheap HAT for $5 and figured it would work - the form factor is nice.

    So I guess I’ll take this on and report back when I work it out. OR blow it off, connect some externals and get my Mirror done. Either way, thanks so much for the suggestion!

  • @nakedrabbit I have the same issue I think but I’m using an all-in one PC and its internal sound card. Every once in a while, it stops processing and gets into a loop like you’ve shown above

  • Module Developer

    I’ll launch AMK2 ver 3. in a few weeks. (I hope. I have not enough time nowadays). In that version, this annoying dependency for sound output will be deprecated, so you may use your HAT without issue. Wait a while and sorry again for your inconvenience.

Log in to reply