Mycroft records audio output instead of microphone input

Hello,

I am trying to set up Mycroft for the first time but it refuses to listen to me…

If I run start-mycroft.sh audiotest, it records the audio I am playing on the computer, so I can run (for example) espeak “hey mycroft”, which it records, but if I speak in the microphone, it does nothing.

Audacity records just fine and I can record on command line with
arecord -f dat -D hw:0,0 -d 5 test.wav
or
arecord -f dat -D sysdefault:CARD=PCH -d 5 test.wav
(it doesn’t work if I leave the -D out though)

pavucontrol and alsamixer don’t give me any useful options.

The mycroft.conf file has options to change how the sound is played, but I can’t find any setting for recording. I changed something in /util/init.py so the command is the same as before (with -f and -D added):

if duration > 0:
    return subprocess.Popen(
        ["arecord", "-f dat -D hw:0,0 -r", str(rate), "-c", str(channels), "-d",
         str(duration), file_path])
else:
    return subprocess.Popen(
        ["arecord", "-f dat -D hw:0,0 -r", str(rate), "-c", str(channels), file_path])

…but of course, this still doesn’t change anything (and it doesn’t even make a difference if I change arecord to xarecordx for example).

I’ve been working on it for the last few hours and ran some commands below, but I’m not sure what to do with it.

arecord --list-devices
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC255 Analog [ALC255 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0

pactl list sources short
0 alsa_output.pci-0000_00_1f.3.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz SUSPENDED

amixer sget Capture
Simple mixer control ‘Capture’,0
Capabilities: cvolume cswitch
Capture channels: Front Left - Front Right
Limits: Capture 0 - 63
Front Left: Capture 51 [81%] [21.00dB] [on]
Front Right: Capture 51 [81%] [21.00dB] [on]

cat /proc/asound/cards
0 [PCH ]: HDA-Intel - HDA Intel PCH
HDA Intel PCH at 0xb4520000 irq 140

vi /etc/pulse/default.pa: disabled suspend-on-idle
pactl set-default-source 0

Can anyone tell me how to record from microphone?

Hi there @Kentor, thanks for providing such good diagnostic information.

There are a couple of other pieces of information I need to know to be able to provide useful advice.

  • What sort of Device are you on - Mark 1, Linux, Picroft
  • If Picroft, what sort of install did you use - ie burn from disk image, or using a git clone install?

Best, Kathy

Hi Kathy,

Thanks for your reply. After all this troubleshooting, I missed one obvious setting in pavucontrol: the internal sound should be set to duplex, not stereo. I overlooked this setting because I thought it was for the speaker only, but it also controls the mic, apparently. Only then it’s possible to start the audiotest, change to the Record tab and change the microphone to ‘capture from int audio’.

Still, it’s strange other applications have no issue recording, only Mycroft. Anyway, this is the solution :slight_smile:

(I’m on Linux Mint by the way)

1 Like

Awesome, thanks for confirming, we’ll keep this in mind for any other Linux Mint installs having similar issues.