초보자: MMM-AssistantMk2 및 MMM-Hotword와 함께 사용할 마이크 및 스피커를 구성할 수 없습니다.

초보자: MMM-AssistantMk2 및 MMM-Hotword와 함께 사용할 마이크 및 스피커를 구성할 수 없습니다.

Google의 AIY HAT만 구성해 보았는데 단일 카드와 장치 아래에 스피커와 마이크(hw:0,0)가 표시됩니다.

Blue Snowball(hw:1,0)이라는 독립형 USB 마이크와 스피커용 google AIY HAT(hw:0)도 사용해 보았지만 작동하지 않았습니다.

실수:

2020-04-26 15:48:17.583] [LOG]    [HOTWORD] Detector starts listening.
[2020-04-26 15:48:17.701] [LOG]    [HOTWORD:LPCM16] arecord: main:828: 
[2020-04-26 15:48:17.703] [LOG]    [HOTWORD:LPCM16] audio open error: Device or resource busy

[2020-04-26 15:48:17.706] [LOG]    [HOTWORD] Final Result: { detected: false }
[2020-04-26 15:48:17.724] [LOG]    [HOTWORD] begins.
[2020-04-26 15:48:17.726] [LOG]    [HOTWORD] Detector starts listening.
[2020-04-26 15:48:17.808] [LOG]    [HOTWORD:LPCM16] arecord: main:828: audio open error: Device or resource busy

라즈베리 파이 버전:

pi@raspberrypi:~ $ cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
pi@raspberrypi:~ $ 

기록 -l:

@raspberrypi:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: sndrpigooglevoi [snd_rpi_googlevoicehat_soundcar], device 0: Google voiceHAT SoundCard HiFi voicehat-codec-0 [Google voiceHAT SoundCard HiFi voicehat-codec-0]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: Snowball [Blue Snowball], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

플레이 -l:

pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndrpigooglevoi [snd_rpi_googlevoicehat_soundcar], device 0: Google voiceHAT SoundCard HiFi voicehat-codec-0 [Google voiceHAT SoundCard HiFi voicehat-codec-0]
  Subdevices: 0/1

.asoundrc:

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

ctl.!default{
  type hw
  card 0
}

구성 파일

/* Magic Mirror Config Sample
 *
 * By Michael Teeuw http://michaelteeuw.nl
 * MIT Licensed.
 *
 * For more information how you can configurate this file
 * See https://github.com/MichMich/MagicMirror#configuration
 *
 */

var 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, is "localhost"
    port: 8080,
    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"],

    language: "en",
    timeFormat: 24,
    units: "metric",
    // 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: [
        {
            module: "alert",
        },
        {
            module: "updatenotification",
            position: "top_bar"
        },
        {
            module: "clock",
            position: "top_left"
        },
        {
            module: "calendar",
            header: "US Holidays",
            position: "top_left",
            config: {
                calendars: [
                    {
                        symbol: "calendar-check",
                        url: "webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics"                   }
                ]
            }
        },
        {
            module: "compliments",
            position: "lower_third"
        },
        {
            module: "currentweather",
            position: "top_right",
            config: {
                location: "New York",
                locationID: "",  //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
                appid: "YOUR_OPENWEATHER_API_KEY"
            }
        },
        {
            module: "weatherforecast",
            position: "top_right",
            header: "Weather Forecast",
            config: {
                location: "New York",
                locationID: "5128581",  //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
                appid: "YOUR_OPENWEATHER_API_KEY"
            }
        },
        {
            module: "newsfeed",
            position: "bottom_bar",
            config: {
                feeds: [
                    {
                        title: "New York Times",
                        url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"
                    }
                ],
                showSourceTitle: true,
                showPublishDate: true,
                broadcastNewsFeeds: true,
                broadcastNewsUpdates: true
            }
        },
        {
            module: "MMM-Hotword",
            position: "top_right",
            config: {
                    chimeOnFinish: null,
                    mic: {
                            recordProgram: "arecord",
                            device: "plughw:1"
                    },
                    models: [
                            {
                                hotwords    : "smart_mirror",
                                file        : "smart_mirror.umdl",
                                sensitivity : "0.5",
                            },
                    ],
                    commands: {
                            "smart_mirror": {
                                    notificationExec: {
                                            notification: "ASSISTANT_ACTIVATE",
                                            payload: (detected, afterRecord) => {
                                                    return {profile:"default"}
                                            }
                                    },
                                    restart:false,
                                    afterRecordLimit:0
                            }
                    }
            }
        },
        {
        module: "MMM-AssistantMk2",
        position: "top_right",
        config: {
                deviceLocation: {
                        coordinates: {
                                latitude: 37.5650168, // -90.0 - +90.0
                                longitude: 126.8491231, // -180.0 - +180.0
                        },
                },
                record: {
                        recordProgram : "arecord",  
                        device        : "plughw:1",
                },
                notifications: {
                        ASSISTANT_ACTIVATED: "HOTWORD_PAUSE",
                        ASSISTANT_DEACTIVATED: "HOTWORD_RESUME",
                },
                useWelcomeMessage: "brief today",
                profiles: {
                        "default" : {
                                lang: "en-US"
                        }
                },
        }
        },
    ]   
};

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

답변1

나는 이것이 오래되었다는 것을 알고 있으며 이것이 내 .asoundrc이지만 잘 작동하므로 도움이 되기를 바랍니다. 그러나 MMM-Hotword를 사용하여 MMM-AssistaneMK를 실행할 수 없습니다.

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

관련 정보