MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-AssistantMk2

    Scheduled Pinned Locked Moved System
    421 Posts 61 Posters 630.8k Views 57 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      Sun
      last edited by

      Finally, Got the microphone icon in my mirror. Didn’t detect the voice yet I still have to install mmm-hotword.
      But I can ask one question by click the microphone icon and see the pop-up.

      I use hdmi on my tv as well. Still no sound.

      I will install mmm-hotword and test.

      Also the mmm-gaction if it make the mirror better.

      I will keep you update and might need your help if I got struck in some part.

      Thank you very much Mr.Sean.

      1 Reply Last reply Reply Quote 0
      • S Offline
        Sun
        last edited by Sun

        Install mmm-hotword everything went fine during installation and load magic mirror normally. But no hotword detected.

        also show in command promt.

        Refreshed access token because it has expired. Expired at: 18:57:26 now is: 18:57:29
        Refreshed access token because it has expired. Expired at: 19:57:29 now is: 18:57:29
        Refreshed access token because it has expired. Expired at: 19:57:29 now is: 18:57:29
        Refreshed access token because it has expired. Expired at: 19:57:29 now is: 18:57:30

        and when click the microphone icon. I can only click once after restart and ask question. Hotword didn’t detect smart mirror, snowboy.

        in command promt shows
        at Speaker._write (/home/pi/MagicMirror/modules/MMM-AssistantMk2/node_modules/speaker/index.js:183:23)
        at doWrite (/home/pi/MagicMirror/modules/MMM-AssistantMk2/node_modules/readable-stream/lib/_stream_writable.js:428:64)
        at writeOrBuffer (/home/pi/MagicMirror/modules/MMM-AssistantMk2/node_modules/readable-stream/lib/_stream_writable.js:417:5)
        at Speaker.Writable.write (/home/pi/MagicMirror/modules/MMM-AssistantMk2/node_modules/readable-stream/lib/_stream_writable.js:334:11)
        at Conversation.conversation.on (/home/pi/MagicMirror/modules/MMM-AssistantMk2/node_helper.js:75:16)
        at emitOne (events.js:116:13)
        at Conversation.emit (events.js:211:7)
        at ClientDuplexStream.Conversation.conversation.on (/home/pi/MagicMirror/modules/MMM-AssistantMk2/node_modules/google-assistant/components/conversation.js:154:12)
        at emitOne (events.js:116:13)
        Conversation Completed
        [HOTWORD] << snowboy >> is detected.
        [HOTWORD] stops listening

        ? 2 Replies Last reply Reply Quote 0
        • ? Offline
          A Former User @Sun
          last edited by

          @sun
          have you removed or refreshed your credentials.json or default.json in MMM-AssistantMk2?

          I suggest you remove or disable all other modules (including MMM-AssistantMk2) except MMM-Hotword in config.js and test it.

          Definitely success with MMM-Hotword could make things simple and easy.

          After removing all modules except MMM-Hotword in config.js, run MM.(npm start)
          You can see;
          [HOTWORD] begins listening
          say smart mirror
          You can see;

          [HOTWORD] << smart mirror >> is detected.
          [HOTWORD] stop listening
          

          You should confirm this before going forward.

          1 Reply Last reply Reply Quote 0
          • ? Offline
            A Former User @Sun
            last edited by

            @sun
            OK. have you installed “MMM-NotificationTrigger” ?
            Or give me a chat in this forum, or telegram me (@eouia)

            1 Reply Last reply Reply Quote 0
            • S Offline
              Sun
              last edited by

              Not yet install mmm-notificationtrigger.
              Do I have to install mmm-notificationtrigger as well?
              I manage to get
              [HOTWORD] << smart mirror >> is detected.
              [HOTWORD] stop listening

              but when I say something. it won’t detect what I said. Only detect the hotword.

              1 Reply Last reply Reply Quote 0
              • S Offline
                Sun
                last edited by

                Got it done. Very nice. However, the sound is so lag. Might be because I run on rp3 and quite many modules in magic mirror.

                ? 1 Reply Last reply Reply Quote 0
                • ? Offline
                  A Former User @Sun
                  last edited by

                  @sun
                  Maybe. I always use BT speaker for my RPI and ATB. I cannot bear the crumpled sounds from analog or USB.

                  1 Reply Last reply Reply Quote 0
                  • J Offline
                    jomwells
                    last edited by

                    This is fantastic thank you, I have got everything set up, it hears and responds (on screen) to every request - but unfortunately I get no sound (no speaking feedback), when a youtube video plays, the sound works fine, do I need to change the output device somewhere? I’m struggling to find the config for it.

                    ? S 2 Replies Last reply Reply Quote 0
                    • ? Offline
                      A Former User @jomwells
                      last edited by

                      @jomwells is there any suspicious errors?

                      S J 2 Replies Last reply Reply Quote 0
                      • S Offline
                        Sun @jomwells
                        last edited by

                        @jomwells Are you using rp3 as magic mirror? I did get sound respond now and it really ugly. I do try both sound on tv via hdmi and from usb sound card. Assume that too much modules from magic mirror load.

                        1 Reply Last reply Reply Quote 0
                        • S Offline
                          Sun @Guest
                          last edited by

                          @sean I would like to know more about MMM-Gaction regarding the deviceModelId - this should be done since register the device in mmm-assistantmk2. What about deviceInstanceId, where and how to?

                          ? 2 Replies Last reply Reply Quote 0
                          • ? Offline
                            A Former User @Sun
                            last edited by A Former User

                            @sun read this page carefully.
                            https://developers.google.com/assistant/sdk/reference/device-registration/register-device-manual#get-access-token

                            1 Reply Last reply Reply Quote 0
                            • ? Offline
                              A Former User @Sun
                              last edited by A Former User

                              @sun But In most cases, you might not need instance, because your mirror might be only one instance of your project. Instance is needed when action should select specific device for response. Try without instanceid first.

                              S 1 Reply Last reply Reply Quote 0
                              • S Offline
                                Sun @Guest
                                last edited by

                                @sean Thank you so much.

                                1 Reply Last reply Reply Quote 0
                                • J Offline
                                  jomwells @Guest
                                  last edited by

                                  @sean Yes, the pm2 error logs show some alsa related errors, I assume this is why the assistant doesn’t produce audio?

                                  /home/pi/.pm2/logs/MagicMirror-error.log:
                                  
                                  [../deps/mpg123/src/output/alsa.c:90] error: initialize_device(): cannot set format S16_LE
                                  MESA-LOADER: failed to retrieve device information
                                  libGL error: MESA-LOADER: failed to retrieve device information
                                  [../deps/mpg123/src/output/alsa.c:94] error: initialize_device(): cannot set 1 channels
                                  

                                  I have a pretty fresh install of MagicMirror so shouldn’t be an issue of too many modules, im using an RPI3, and a USB sound card, thanks
                                  on a side note, to get the Hotword and Assistant module to choose the correct microphone, I have had to change the input device to

                                  device: 'plughw:1',
                                  

                                  however each time I reboot, the input devices change order and I need to edit the config file again, is there a way to stop them changing device number?

                                  ? 1 Reply Last reply Reply Quote 0
                                  • ? Offline
                                    A Former User @jomwells
                                    last edited by A Former User

                                    @jomwells
                                    Frankly says, I’m not an expert of system administration. Especially Alsa configuration is out of my ability.
                                    Anyway you should success this test.

                                    arecord -d 10 test.wav & aplay test.wav

                                    It should record your voice and play again.

                                    It means, your mic and speaker should be default device.

                                    1 Reply Last reply Reply Quote 0
                                    • J Offline
                                      jomwells
                                      last edited by

                                      To anyone having issues with RPI3 and a USB sound card, the solution to this was to change ‘/home/pi/.asoundrc’ to:

                                      pcm.!default {
                                        type plug
                                        slave {
                                          pcm "hw:1,0"
                                        }
                                      }
                                      
                                      ctl.!default {
                                          type hw
                                          card 1
                                      }
                                      

                                      (where the USB device is card 1)
                                      Thank you @Sean for your help, it is now working brilliantly, this is by far the best voice assistant module for MM!
                                      Is there any way to configure how long the result card displays on screen before hiding itself? If not, could this be added in a later version? thanks!

                                      ? S T 3 Replies Last reply Reply Quote 0
                                      • ? Offline
                                        A Former User @jomwells
                                        last edited by A Former User

                                        @jomwells
                                        Card display time is decided by card itself. Maybe I can hook the duration, but with some painful effort, not even clearly.
                                        The card itself is hardcoded, so there isn’t enough margin to manipulate. Originally the card would be planned to be used on specific device - smart tv, so ours has some limitation for full usage.
                                        For example, In smart tv, a user can decide to play or not the result of a YouTube search by remote controller, but we haven’t. That is why I implement YouTube player in this module. Other functions are the same.

                                        J 1 Reply Last reply Reply Quote 0
                                        • J Offline
                                          jomwells @Guest
                                          last edited by

                                          @sean Ah I see, its not essential at all! one minor bug I seem to have, that I have noticed does not occur for you in your demonstration video is that now, having finished the audio reply, there is often a very short sound, it sounds like the last half a second of text is repeated, sometimes it is more of a ‘buzz’, I attempted changing the encodingOut setting to one of the other options (MP3 or OPUS_IN_OGG) but both of these just give white noise (like an old tv with no signal) in place of any audio, is this something you have come across at all, and is there anything you can suggest to fix it? maybe getting the alternative encoding to work? thanks

                                          ? J 3 Replies Last reply Reply Quote 0
                                          • ? Offline
                                            A Former User @jomwells
                                            last edited by A Former User

                                            @jomwells
                                            I’m not sure.
                                            Voice output is just buffered stream, so just piping it to the speaker is all of mechanism. So at the moment I have no idea why last data is duplicated(?) in your environment.
                                            Voice output stream comes chunked, so there is some possibility of the time gap between incoming stream chunks.

                                            Maybe instead piping Linear16 to speaker directly, writing response stream to mp3(or ogg) file then playing that file could be one of solutions.(sorry, I didn’t implement that)

                                            S 1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 9
                                            • 10
                                            • 11
                                            • 12
                                            • 13
                                            • 21
                                            • 22
                                            • 11 / 22
                                            • First post
                                              Last post
                                            Enjoying MagicMirror? Please consider a donation!
                                            MagicMirror created by Michael Teeuw.
                                            Forum managed by Sam, technical setup by Karsten.
                                            This forum is using NodeBB as its core | Contributors
                                            Contact | Privacy Policy