Mycroft won't listen to webcam's microphone


I have a Gigbyte Brix running Ubuntu 17.04, Mycroft downloaded on Sept 18, 2017. I have a usb webcam. I can’t get Mycroft to take audio input from the webcam’s microphone.

arecord -l shows:
**** List of CAPTURE Hardware Devices ****
card 1: PCH [HDA Intel PCH], device 0: ALC283 Analog [ALC283 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: U0x46d0x8b2 [USB Device 0x46d:0x8b2], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

Despite much mucking around with ~/.asoundrc I can’t get arecord to treat card 2 as default input device - it always defaults to card 1. I’m running pulseaudio, and setting

pacmd set-default-source alsa_input.usb-046d_08b2-01.analog-mono

now means that arecord will record from the usb mic as default:

arecord -f dat test.wav

works okay. But Mycroft still doesn’t hear it.

I looked in the code and there is a flag “device_index” which I set to various values in mycroft.conf, but to no effect. I’ve found the code

def record(file_path, duration, rate, channels):
if duration > 0:
return subprocess.Popen(
[“arecord”, “-r”, str(rate), “-c”, str(channels), “-d”,
str(duration), file_path])
return subprocess.Popen(
[“arecord”, “-r”, str(rate), “-c”, str(channels), file_path])

which I assume is recording the input but it doesn’t use device_index anyway.

The log file mycroft-voice.log shows no voice activity.

What do I try next?


"pactl list sources"
will show you the device index numbers, find your webcam in that list and use its number to run:
"pactl set-default-source $indexnumber"
restart mycroft services.
Hopefully that gets you going.