• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

Two module with voice control in the same time

Scheduled Pinned Locked Moved Troubleshooting
2 Posts 1 Posters 1.2k Views 1 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.
  • R Offline
    romain
    last edited by romain Apr 18, 2017, 10:04 AM Apr 18, 2017, 10:02 AM

    Hello, I wanted to use the MMM-alexa module but it need to be trigger and I do not have a button. The alternative is to send a notification to trigger it. Which is working (I tryed by sending a notification every 30 second and ask a question then).
    The next natural step was to use a voice detection module to send the notification right ? So I cloned alexyak voicecontrole module. The idea of that module is that it would send a notification to others module when a specific keywork is detected .
    Even though a bunch of error show up on the screen, I am able to make that module works. I can say “Alexa” and it does send the notification I chosed to other module.
    So, both module work separatly.
    But if I run both module in the same time, It doesn’t work anymore.
    I noticed that If a module is using my mic, I can’t do an “arecord” on the terminal. So I’m guession that the MMM-alexa module prevent other programme to use it in the same time.

    Is it a way to use the same mic with two different module ?

    1 Reply Last reply Reply Quote 0
    • R Offline
      romain
      last edited by Apr 19, 2017, 1:46 PM

      I did it, It wasn’t easy but it’s work, I can use voicecontrol and others voicecontrol driven module at the same time.
      I had to change my /etc/asound.conf file again (yes, again. Because changing it already solve some of my issue on the past)

      before my file looked like this:

      pcm.!default {
              type asym
              playback.pcm {
                      type plug
                      slave.pcm "hw:0,0"
              }
              capture.pcm {
                      type plug
                      slave.pcm "hw:1,0"
              }
      }
      

      Easy enough when you know what your doing (that wasn’t my case). this file is there to say what is the default device to playback and capture (A lot of application or software just use the default device so if the default configuration isn’t working for you, you need to change it for you.) In my cas ethe microphone is the “hw:1,0” and my speaker is the “hw:0,0”

      That worked well when my microphone is used by one application at the time. However, not so much when it need to be used by multiple ones.
      So my new /etc/asound.conf file is looking like this now

      pcm.myTest {
          type dsnoop
          ipc_key 2241234
          slave {
              pcm "hw:1,0"
              channels 1
          }
      }
      
      pcm.!default {
              type asym
              playback.pcm {
                      type plug
                      slave.pcm "hw:0,0"
              }
              capture.pcm {
                      type plug
                      slave.pcm "myTest"
              }
      }
      

      instead of directly say that my input device is the “hw:1,0” I say it’s “myTest”, which is describe above. myTest’s type is “dsnoop” , that’s whats allow the michrophone to be use by multiple application at the same time. The ipc_key is there with a random value because when I tested with arecord, it asked me to put one. The channels is there because it was on the documentation ( http://alsa.opensrc.org/Dsnoop ) >.> not sure what it does though.
      And there you go, after that I could use two voice control things at the time

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