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.
    • ? Offline
      A Former User @Cr4z33
      last edited by A Former User

      @cr4z33 Details are dependent with also your asound config. But,
      Can you record and play some audio in Terminal?

      arecord -t 5 test.wav & aplay test.wav
      

      Can you execute this? tell me the result.

      (I haven’t had voiceHAT, so cannot guaranteed, but same name could be available.)

      Cr4z33C 1 Reply Last reply Reply Quote 0
      • Cr4z33C Offline
        Cr4z33 @Guest
        last edited by Cr4z33

        @sean
        I get an error and please note that I’ve tried to translate to English. :winking_face:

        arecord -t 5 test.wav & aplay test.wav
        [1] 2911
        arecord: main:574: unrecognized file format 5
        test.wav: File or directory does not exist
        [1]+  Output 1                arecord -t 5 test.wav
        
        ? 1 Reply Last reply Reply Quote 0
        • ? Offline
          A Former User @Cr4z33
          last edited by A Former User

          @cr4z33
          Try this.

          arecord -t 5 -D hw:0,0 test.wav
          

          Does this make test.wav?
          If so, try this again.

          aplay -D hw:0,0 test.wav
          
          Cr4z33C 1 Reply Last reply Reply Quote 0
          • Cr4z33C Offline
            Cr4z33 @Guest
            last edited by

            @sean
            Nope. :pensive_face:

            arecord -t 5 -D hw:0,0 test.wav
            arecord: main:574: unrecognized file format 5
            
            ? 2 Replies Last reply Reply Quote 0
            • ? Offline
              A Former User @Cr4z33
              last edited by

              @cr4z33

              cat ~/.asoundrc
              

              Tell me the result.

              How you can setup previously? (I think you purchased that device for Google AIY project. Was there any instructions?)

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

                @cr4z33
                Oops ! my mistake!

                arecord -d 5 -D hw:0,0 test.wav
                
                1 Reply Last reply Reply Quote 0
                • Cr4z33C Offline
                  Cr4z33 @Guest
                  last edited by Cr4z33

                  @sean said in MMM-AssistantMk2 & MMM-GAction:

                  @cr4z33

                  cat ~/.asoundrc
                  

                  Tell me the result.

                  How you can setup previously? (I think you purchased that device for Google AIY project. Was there any instructions?)

                  pi@raspberrypi:~ $ cat ~/.asoundrc
                  cat: /home/pi/.asoundrc: File or directory does not exist
                  

                  It’s the so- called Google Voice Kit AIY (https://aiyprojects.withgoogle.com/voice-v1/).

                  I used a ready meal Raspbian image made by Google.
                  Apart from creating the JSON file everything else consists of ready scripts (i.e assistant_library_demo.py is a script to runs and uses Google Assistant):
                  https://github.com/google/aiyprojects-raspbian/tree/voicekit

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

                    @cr4z33
                    Hmmm… As I know,

                    arecord -d 5 test.wav
                    aplay test.wav
                    

                    This should work because there is no other suspicious things. your card and device no is 0,0 and that is the default.

                    Cr4z33C 2 Replies Last reply Reply Quote 0
                    • Cr4z33C Offline
                      Cr4z33 @Guest
                      last edited by

                      @sean
                      Again I made a noob error… I ran both commands at once lol! :smiling_face_with_open_mouth_cold_sweat:

                      Running them separately worked like a charm! :thumbs_up_medium-light_skin_tone:

                      I am going now to retry with the module addition.

                      1 Reply Last reply Reply Quote 0
                      • Cr4z33C Offline
                        Cr4z33 @Guest
                        last edited by

                        @sean
                        So after following the installation instructions I ran a test by using the ‘Very simple version but limited’ module.

                        As a result all I get now from MM is a black empty screen (no config.js message and no trace of other modules can be seen).

                        S 1 Reply Last reply Reply Quote 0
                        • S Offline
                          sgopala @Cr4z33
                          last edited by sgopala

                          @cr4z33 There is a small typo in the config file, please correct as under:

                          Incorrect: [replace this]
                          play: { // Full values are in FOR EXPERTS section.
                          playProgram: “mpg321”, // recommended.
                          }

                          Correct: [with this]
                          play: { // Full values are in FOR EXPERTS section.
                          playProgram: “mpg321”, // recommended.
                          },

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

                            @sgopala Thank you!! I’ve fixed. I think I had assumed that was the last field of ESSENTIALS parts, so I might have missed the last comma.

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

                              @sean Thanks a ton for your modules sir, you are a rockstar. But somehow I liked the previous version because of the following reasons:

                              (i) there is a delay after the hotword detection in the new version
                              (ii) the hotword detection hangs after 1st interaction with the assistant
                              (iii) the output window (iframe) was better sized and placed, too small on this version

                              Request to please see if these are feasible.

                              Once again, thanks a lot for this lovely module.

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

                                @sgopala
                                You can always checkout the older version from github (use 1.x.x-final-snap)
                                And for the issues;

                                • some delay is added intentionally to avoid possible collision. I’ll modify it could be customizable in next patch.
                                • output size could be controllable with screenZoom field.

                                Thanks.

                                Cr4z33C 1 Reply Last reply Reply Quote 0
                                • Cr4z33C Offline
                                  Cr4z33 @Guest
                                  last edited by

                                  @sgopala Thanks for pointing this out. ;)

                                  @sean I keep getting either a black MM screen or the ‘config.js’ message.

                                  At this point I prefer to work with a config with MMM-AssistantMk2 only and no other modules until everything is working 100%.

                                  If you could help me by giving please a look at the below config? :)
                                  Please note that I am trying to use

                                  0:0
                                  

                                  as device Id.

                                  https://pastebin.com/ePfrtR75

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

                                    @cr4z33
                                    Try this.

                                    {
                                      module: "MMM-AssistantMk2",
                                      position: "top_right",
                                      config: {
                                        record: {
                                          recordProgram: "arecord",
                                          device: null        // or device: "hw:0,0"
                                        },
                                    
                                        play: {
                                          playProgram: "mpg321",
                                        },
                                      }
                                    },
                                    
                                    Cr4z33C 1 Reply Last reply Reply Quote 0
                                    • citizendevpiC Offline
                                      citizendevpi @Guest
                                      last edited by citizendevpi

                                      @sean sweet i added a bunch of outher modules and now get a memory error how do i update to the newer version so hopefully these errors sort themselvs out

                                      1 Reply Last reply Reply Quote 0
                                      • citizendevpiC Offline
                                        citizendevpi
                                        last edited by

                                        !!! { audioFormat: 1,
                                        endianness: ‘LE’,
                                        channels: 1,
                                        sampleRate: 16000,
                                        byteRate: 32000,
                                        blockAlign: 2,
                                        bitDepth: 16,
                                        signed: true }
                                        mmap() failed: Cannot allocate memory
                                        Failed to create permanent mapping for memfd region with ID = 3246537711
                                        Ignoring received block reference with non-registered memfd ID = 3246537711
                                        ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Protocol error

                                        […/deps/mpg123/src/output/alsa.c:165] error: cannot open device default
                                        Error: open() failed: -1
                                        at Speaker._open (/home/pi/MagicMirror/modules/MMM-AssistantMk2/node_modules/speaker/index.js:106:13)
                                        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 Reader. (/home/pi/MagicMirror/modules/MMM-AssistantMk2/node_helper.js:287:17)
                                        at emitNone (events.js:111:20)
                                        at Reader.emit (events.js:208:7)
                                        at /home/pi/MagicMirror/modules/MMM-AssistantMk2/node_modules/wav/node_modules/readable-stream/lib/_stream_readable.js:934:16
                                        at _combinedTickCallback (internal/process/next_tick.js:131:7)
                                        Some error happens. Try again.
                                        Whoops! There was an uncaught exception…
                                        TypeError: this.sendSocketNotification is not a function
                                        at Reader. (/home/pi/MagicMirror/modules/MMM-AssistantMk2/node_helper.js:296:20)
                                        at emitNone (events.js:111:20)
                                        at Reader.emit (events.js:208:7)
                                        at /home/pi/MagicMirror/modules/MMM-AssistantMk2/node_modules/wav/node_modules/readable-stream/lib/_stream_readable.js:934:16
                                        at _combinedTickCallback (internal/process/next_tick.js:131:7)
                                        at process._tickCallback (internal/process/next_tick.js:180:9)

                                        ya looks like speaker error

                                        1 Reply Last reply Reply Quote 0
                                        • Cr4z33C Offline
                                          Cr4z33 @Guest
                                          last edited by

                                          @Sean
                                          If I use null I get a black MMM screen.

                                          If I use hw:0,0 I get the config.js message.

                                          Finally if I use "hw:0,0" (with quotes) I get a black MM screen again.

                                          :smiling_face_with_open_mouth_cold_sweat:

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

                                            @cr4z33
                                            Ok… Are you using Telegram?
                                            I can give more direct help on Telegram. My id is @eouia.
                                            Here is not so good place to talk these things.

                                            Cr4z33C 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
                                            • 18
                                            • 19
                                            • 20
                                            • 21
                                            • 22
                                            • 21 / 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