Latest MyCroft using ALSA instead of Pulse


#1

I just did a PiCroft install, using the setup shell script as I have many, many times. After todays install I’m not getting any microphone input like I have for the last several installs over the last few weeks. I’ve got Pulse audio configured as a system service and it’s been working all along, but a recent change somewhere in mycroft appears to be using ALSA now instead of pulse. From the /var/log/mycroft/audio.log (only a few lines of many similar):

ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_a52.c:823:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'

Pulse is up and working, audio output from mycroft appears to be working, just the audio source isn’t.

root@aud-reader:/var/log/mycroft# pactl info
Server String: /var/run/pulse/native
Library Protocol Version: 32
Server Protocol Version: 32
Is Local: yes
Client Index: 26
Tile Size: 65496
User Name: pulse
Host Name: aud-reader
Server Name: pulseaudio
Server Version: 12.2
Default Sample Specification: s16le 2ch 44100Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.usb-SEEED_ReSpeaker_4_Mic_Array__UAC1.0_-00.analog-stereo
Default Source: alsa_input.usb-SEEED_ReSpeaker_4_Mic_Array__UAC1.0_-00.multichannel-input
Cookie: 03d7:6222

Those ALSA errors are new on this latest install, any clues how I might correct this to use Pulse as it was before?

TIA,
Jody


#2

Solved… added “device”: “pulse” to the listener section of .mycroft/mycroft.conf and restarted and this appears to have fixed it. Wasn’t needed before but I can make sure to include this line from now on.


#3

Hi Jody, not sure if this is what happened here, but something I’ve seen in the past is the system loading audio devices in a different order which results in the card numbers getting mismatched. Using the device name seems like a better approach. Something we’ve got on the list to look at to make this more robust.