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.

    Hello-Lucy using Adafruit Voice Bonnet

    Scheduled Pinned Locked Moved Solved Troubleshooting
    24 Posts 2 Posters 3.2k Views 2 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
      sinbad339
      last edited by sinbad339

      I’m trying to bring up Hello-Lucy on a “new” Magic Mirror. I’m running on a Pi 3B+, and installed the Adafruit Voice Bonnet for audio.

      I can do
      arecord --format cd --duration 7 --channels 1 test2.wav
      then
      aplay test2.wav
      and I hear the recording from the Voice Bonnet speaker. I don’t have to specify he device for these to work.

      When I list my audio devices, I get:
      pi@Magic:~/MagicMirror/config $ aplay -l
      **** List of PLAYBACK Hardware Devices ****
      card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
      Subdevices: 8/8
      Subdevice #0: subdevice #0
      Subdevice #1: subdevice #1
      Subdevice #2: subdevice #2
      Subdevice #3: subdevice #3
      Subdevice #4: subdevice #4
      Subdevice #5: subdevice #5
      Subdevice #6: subdevice #6
      Subdevice #7: subdevice #7
      card 1: vc4hdmi [vc4-hdmi], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
      card 2: seeed2micvoicec [seeed-2mic-voicecard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 [bcm2835-i2s-wm8960-hifi wm8960-hifi-0]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
      pi@Magic:~/MagicMirror/config $ arecord -l
      **** List of CAPTURE Hardware Devices ****
      card 2: seeed2micvoicec [seeed-2mic-voicecard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 [bcm2835-i2s-wm8960-hifi wm8960-hifi-0]
      Subdevices: 1/1
      Subdevice #0: subdevice #0

      Card 2 for both play and capture is the Voice Bonnet.

      When I restart MMM with Hello-Lucy, I hear the default greeting, but always get the microphone shown with ERROR. Even though the lists indicate card 2, I’ve tried 0 and 1 since card 2 is the only thing listed, but still no microphone.

      Here’s my config.js file:
      /* Magic Mirror Config Sample
      *

      • By Michael Teeuw https://michaelteeuw.nl
      • MIT Licensed.

      let config = {
      address: “localhost”, // Address to listen on, can be:
      // - “localhost”, “127.0.0.1”, “::1” to listen on loopback interface
      // - another specific IPv4/6 to listen on a specific interface
      // - “0.0.0.0”, “::” to listen on any interface
      // Default, when address config is left out or empty, is “localhost”
      port: 8081,
      basePath: “/”, // The URL path where MagicMirror is hosted. If you are using a Reverse proxy
      // you must set the sub path here. basePath must end with a /
      ipWhitelist: [“127.0.0.1”, “::ffff:127.0.0.1”, “::1”], // Set [] to allow all IP addresses
      // or add a specific IPv4 of 192.168.1.5 :
      // [“127.0.0.1”, “::ffff:127.0.0.1”, “::1”, “::ffff:192.168.1.5”],
      // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
      // [“127.0.0.1”, “::ffff:127.0.0.1”, “::1”, “::ffff:192.168.3.0/28”],

          useHttps: false,                // Support HTTPS or not, default "false" will use HTTP
          httpsPrivateKey: "",    // HTTPS private key path, only require when useHttps is true
          httpsCertificate: "",   // HTTPS Certificate path, only require when useHttps is true
      
          language: "en",
          locale: "en-US",
          logLevel: ["INFO", "LOG", "WARN", "ERROR"], // Add "DEBUG" for even more logging
          timeFormat: 24,
          units: "imperial",
          // serverOnly:  true/false/"local" ,
          // local for armv6l processors, default
          //   starts serveronly and then starts chrome browser
          // false, default for all NON-armv6l devices
          // true, force serveronly mode, because you want to.. no UI on this device
      
          modules: [
                  {
                  disabled: false,
                  module: "Hello-Lucy",
                  position: "top_center",
                  config: {
                      keyword: 'HELLO LUCY',              // keyword to activate listening for a command/sentence
                      timeout: 15,                        // timeout listening for a command/sentence
                      standByMethod: 'DPMS',              // 'DPMS' = anything else than RPi or 'PI'
                      microphone: "1,0",                  // run "arecord -l" card # and device # mine is "0,0"
                      sounds: ["1.mp3", "11.mp3"],        // welcome sound at startup. Add several for a random greetings
                      confirmationSound: "ding.mp3",      // name and extension of sound file
                      startHideAll: true,                 // All modules start as hidden EXCEPT PAGE ONE
                      // *** Page One is your default startup page *** This overrides startHideAll: true,
                      pageOneModules: ["Hello-Lucy","MMM-EasyPix"],                     // default modules to show on page one/startup
                      pageTwoModules: ["Hello-Lucy", "MMM-BMW-DS", "MMM-EventHorizon"], // modules to show on page two
                      pageThreeModules: ["Hello-Lucy", "MMM-Lunartic"],                 // modules to show on page three
                      pageFourModules: ["Hello-Lucy", "MMM-PC-Stats"],                  // modules to show on page four
                      pageFiveModules: ["Hello-Lucy", "MMM-Searchlight"],               // modules to show on page five
                      pageSixModules: ["Hello-Lucy", "MMM-NOAA3"],                      // modules to show on page six
                      pageSevenModules: ["Hello-Lucy", "MMM-Recipe"],                   // modules to show on page seven
                      pageEightModules: ["Hello-Lucy", "MMM-rfacts"],                   // modules to show on page eight
                      pageNineModules: ["Hello-Lucy", "MMM-History"],                   // modules to show on page nine
                      pageTenModules: ["Hello-Lucy", "MMM-HardwareMonitor"]             // modules to show on page ten
                      }
                  },
          ]
      

      };

      /*************** DO NOT EDIT THE LINE BELOW ***************/
      if (typeof module !== “undefined”) {module.exports = config;}

      Any help would be appreciated.

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

        Well, I gave up on the Adafruit Voice Bonnet, and instead installed a USB microphone with output (Samson GoMic). Now, mic and speakers work every time whether MM/Hello-Lucy starts up automatically at boot, or if I start it using npm start.

        I’ll probably mark it resolved, even thought the fundamental issue is not.

        A BIG thanks to @sdetweil for all of his patience and help.

        1 Reply Last reply Reply Quote 0
        • S Away
          sdetweil @sinbad339
          last edited by sdetweil

          @sinbad339 said in Hello-Lucy using Adafruit Voice Bonnet:

            microphone: "1,0",                  
          

          so arecord says card 2,0

           arecord -l
          **** List of CAPTURE Hardware Devices ****
          card 2: seeed2micvoicec [seeed-2mic-voicecard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 [bcm2835-i2s-wm8960-hifi wm8960-hifi-0]
          Subdevices: 1/1
          Subdevice #0: subdevice #0
          

          so it should be

           microphone: "2,0",
          

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sinbad339 @sdetweil
            last edited by

            @sdetweil said in Hello-Lucy using Adafruit Voice Bonnet:

            so it should be
            microphone: “2,0”,

            Thanks for replying. This config is what I had when I posted. As I mentioned, I’ve tried “0,0”, “1,0”, and “2,0”; all result in the microphone error.

            S 1 Reply Last reply Reply Quote 0
            • S Away
              sdetweil @sinbad339
              last edited by

              @sinbad339 can u try this

              arecord -D default -q  -r 16000 -c 1 -t wav -f S16_LE >test.wav
              

              the replace default with

              arecord -D hw:2,0  -q -r 16000 -c 1 -t wav -f S16_LE >test.wav
              

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                sinbad339 @sdetweil
                last edited by

                @sdetweil
                With MM running, if I issue

                arecord -D default -q  -r 16000 -c 1 -t wav -f S16_LE >test.wav
                

                I get a good .wave file that I can play.
                With MM still running, specifying the hw explicitly results in an error.

                arecord -D hw:2,0  -q -r 16000 -c 1 -t wav -f S16_LE >test2.wav
                arecord: main:830: audio open error: Device or resource busy
                pi@Magic:~/MagicMirror/config $ arecord -l
                **** List of CAPTURE Hardware Devices ****
                card 2: seeed2micvoicec [seeed-2mic-voicecard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 [bcm2835-i2s-wm8960-hifi wm8960-hifi-0]
                  Subdevices: 0/1
                  Subdevice #0: subdevice #0
                
                
                S 1 Reply Last reply Reply Quote 0
                • S Away
                  sdetweil @sinbad339
                  last edited by

                  @sinbad339 said in Hello-Lucy using Adafruit Voice Bonnet:

                  With MM still running, specifying the hw explicitly results in an error.

                  ok, so MM is using that device

                  while mm is running do

                  ps -ef | grep arec

                  u should see the arecord process and the parms passed
                  from one of my apps that uses arecord

                  arecord -D default -q -r 16000 -c 1 -t wav -f S16_LE -
                  

                  the trailing dash means stream content to stdout (which is captured by the upstream library)

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  S 1 Reply Last reply Reply Quote 0
                  • S Away
                    sdetweil @sdetweil
                    last edited by

                    @sinbad339

                    arecord -D default

                    the question is, what is ‘default’

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    S 1 Reply Last reply Reply Quote 0
                    • S Offline
                      sinbad339 @sdetweil
                      last edited by

                      @sdetweil
                      So the arecord -l lists card2 as my expected capture device (seeed-2mic-voicecard). I find it interesting that it enumverates as #2 with no #0 or #1.

                      Anyway, I ran your ps command; not sure what this output means (as I’m sure you’re aware by now, I’m a Noob on Linux).

                      ps -ef | grep arec
                      pi        1953  1927  0 11:04 pts/0    00:00:00 grep --color=auto arec
                      
                      
                      S 1 Reply Last reply Reply Quote 0
                      • S Away
                        sdetweil @sinbad339
                        last edited by

                        @sinbad339 hm…

                        should have used arecord…

                        try

                        ps -ef | grep rec
                        

                        (there are only 2 apps… arecord or rec )

                        the output from ps

                        pi        1953  1927  0 11:04 pts/0    00:00:00 grep --color=auto arec
                        

                        user that started process
                        the process id
                        the parent process id +
                        (i don’t know, 0)
                        the time the process was started
                        (i don’t know, pts/ )
                        how much cpu time has been used since started, in seconds
                        the string used to start the process, pgm name and then parms

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        S 1 Reply Last reply Reply Quote 0
                        • S Offline
                          sinbad339 @sdetweil
                          last edited by sinbad339

                          @sdetweil

                          ps -ef | grep rec
                          root        76     2  0 11:02 ?        00:00:00 [vchiq-recy/0]
                          pi        2320  1927  0 11:24 pts/0    00:00:00 grep --color=auto rec
                          

                          Not sure what vchiq-recy is…
                          But no arec or arecord.

                          S 1 Reply Last reply Reply Quote 0
                          • 1
                          • 2
                          • 3
                          • 1 / 3
                          • 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