Two module with voice control in the same time



  • 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 ?



  • 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


Log in to reply
 

Looks like your connection to MagicMirror Forum was lost, please wait while we try to reconnect.