(.venv) pi@picroft:~ $ sudo apt-get install pulseaudio
Reading package lists… Done
Building dependency tree
Reading state information… Done
pulseaudio is already the newest version (12.2-4+deb10u1+rpi3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
I see one of the troubleshooting steps suggesting switching Sphinx to Precise, but I don’t know if this is relevant as it doesn’t seem the CLI is detecting any audio input.
Quick question: do you have an HDMI monitor connected? I’ve had nothing but problems getting the sound output to work when a monitor is set up. I always connect through SSH anymore.
A quick check I use is to run ALSAMIXER. When everything is working for me, Pulseaudio is the default output. Make certain that the volume levels are good. Then I just verify the default Pulseaudio source and sink.
I have finally gotten the audio issues smoothed out in my animatronics. I use a homemade audio bonnet with an I2S amp and an I2S microphone connection.
I’m using the 7" touch display connected directly to the RPi. The only audio connected to my setup is the Raspiaudio MIC+ HAT which comes with a mic and two speakers.
Default output is Pulseaudio, I have no issues hearing responses from Mycroft if I type the command.
Great info. So, just to make certain that I understand, the microphone works during the setup and testing, but not within Mycroft. If that is the case, then the hardware is good and the basic drivers are properly installed. That just leaves the Pulseaudio-to-Mycroft connection.
Can you check the default Pulseaudio source? Just to make certain that Pulseaudio is using your microphone and not some secondary microphone, like an ambient noise sensor.
Stop and start Mycroft. Don’t reboot, just shutdown the AI and then bring it back up.
(.venv) pi@picroft:~ $ pactl info
Server String: /run/user/1000/pulse/native
Library Protocol Version: 32
Server Protocol Version: 32
Is Local: yes
Client Index: 40
Tile Size: 65496
User Name: pi
Host Name: picroft
Server Name: pulseaudio
Server Version: 12.2
Default Sample Specification: s16le 2ch 44100Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.platform-soc_sound.stereo-fallback Default Source: alsa_input.platform-soc_sound.stereo-fallback
Cookie: 92ac:228c
I have not edited any pulseaudio config files:
(.venv) pi@picroft:~ $ cat /etc/pulse/client.conf | grep default
; default-sink =
; default-source =
; default-server =
; default-dbus-server =
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
(.venv) pi@picroft:~ $ cat /etc/pulse/default.pa | grep default
### Automatically restore the default sink/source when changed by the user
### that look up the default sink/source get the right value
load-module module-default-device-restore
### Automatically move streams to the default sink if the sink they are
### Make some devices default #set-default-sink output #set-default-source input
I tried this but didn’ t change the behavior:
(.venv) pi@picroft:~ $ pactl list sources short
0 alsa_output.platform-soc_sound.stereo-fallback.monitor module-alsa-card.c s32le 2ch 48000Hz IDLE 1 alsa_input.platform-soc_sound.stereo-fallback module-alsa-card.c s32le 2ch 48000Hz IDLE
(.venv) pi@picroft:~ $ pactl set-default-source 1
(.venv) pi@picroft:~ $ mycroft-stop
Stopping all mycroft-core services
Stopping skills (678)…stopped.
Stopping audio (681)…stopped.
Stopping enclosure (687)…stopped.
Stopping messagebus.service (675)…stopped.
(.venv) pi@picroft:~ $ mycroft-start
remote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 20 (delta 10), reused 16 (delta 6), pack-reused 0
Unpacking objects: 100% (20/20), done.
From GitHub - MycroftAI/mycroft-core: Mycroft Core, the Mycroft Artificial Intelligence platform.
8d13afc4e7…9212211614 test-github-actions → origin/test-github-actions
Already up to date.
mycroft-start: Mycroft command/service launcher
<…>
<…>
(.venv) pi@picroft:~ $ mycroft-start all
Already up to date.
Starting all mycroft-core services
Initializing…
Starting background service bus
CAUTION: The Mycroft bus is an open websocket with no built-in security
measures. You are responsible for protecting the local port
8181 with a firewall as appropriate.
Starting background service skills
Starting background service audio
Starting background service voice
Starting background service enclosure
I figured as much. You know what you’re doing. The Mycroft audio setup is a problem for everyone. Most of those audio tests don’t really test the Pulseaudio setup, which is what Mycroft seems to use. If you can get Pulseaudio set up properly with all the right defaults, then Mycroft is happy.
Be aware that pacmd uses pulseaudio as user instance and reading from default.pa, while pactl uses pulseaudio as system service and reading from system.pa
If you start mycroft as service, start pulseaudio as service as well and use system.pa and pactl commands
if you start mycroft as user session from your .bash_profile as example, start pusleaudio as user session and use default.pa and pacmd commands.
Don’t mix and match stuff, because that is the most common reason of all sound troubles.
Also when you use pulse audio use commands susch as paplay. Using alsa, then use commands as aplay within your mycroft.conf
I’m using a picroft image, which I assume runs both mycroft and pulseaudio as a service.
All tests suggested by the Mycroft audio tshoot page are using pactl, aplay and mycroft-start audiotest, all test are successful but still Mycroft does not respond to voice commands, and there are no logs of any wake words detected along with the Mic indicator not moving.
Is there any other information you would like me to collect from my setup?
Picroft really has not received the love it needs the last year. The used sound architecture within picroft started by utilizing alsa, however migrated over later on to pulseaudio. Also kind of forced by the underlying raspbian that is used as based.
So in the current state picroft is at the moment it is mixing and matching both with all the sound issues reported on the forums associated with it.
I can’t comment on when picroft might get some love from the devs again, but that might still be months away.
Me and some other amazing devs are working on an alternative for it. It’s for if you just want to use your rpi as ready to use device. It’s called OpenVoiceOS (started as MycroftOS). Anyhow, even we are running behind planning wise as it was planned to be released last weekend, so…
Anyhow; Know for sure it will be just a few more days, perhaps a week, but certainly not months. With that release we hope to release the pressure on the Mycroft dev’s related to picroft, so that all the current community members and all the new ones to come have an easy to use image again. That way the Mycroft Devs can stay focussed on their own priorities.
Bug reports that we receive for OVOS which are Mycroft related, we can then filter, fix and issues Pull Request to fix them. Bug reports that we receive for it it that are OVOS related are well, for ourselfs. Regardless, we as community can play around, test, fix, create where we as OVOS devs and ofcourse all community members can act as sort of filter for the Mycroft Dev team.
Less support calls, emails, bug reports for the Dev team means, more focus and faster work for them.
My main goal was to make sure there was not an issue with my setup per se, looks like that’s not the case.
I’ve been tracking at your work with OpenVoiceOS fora while and was considering trying it out with my setup as I have a display attached to my RPi in a nice case.
@Charles, what version of picroft are you currently using? (I’m using 20.8.0). Looks like it’s working well with your raspiaudio, is it also a MIC+?
I’m testing the alpha7 for 32bit of the OpenVoiceOS audio is working fine again, but no MIC.
If I try to test the microphone I’m getting:
mycroft@MycroftOS:~ $ arecord -d 10 test.wav
ALSA lib confmisc.c:767:(parse_card) cannot find card ‘0’
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2564:(snd_pcm_open_noupdate) Unknown PCM dsnoop
arecord: main:828: audio open error: No such file or directory
mycroft@MycroftOS:~ $ alsamixer
cannot open mixer: No such file or directory
mycroft@MycroftOS:~ $ mycroft-start audiotest -l
-sh: mycroft-start: command not found