I’m struggling to set up Mycroft on top of a custom audio configuration required for my bluetooth speaker that has an embedded microphone. I was hoping someone savvy could help me debug the situation. I’ve gotten as far as the audio test working just fine when run as dietpi (it can record sound and play it back, detecting pulse as an audio device). But, weirdly, outside the audiotest, Mycroft can’t hear me and won’t produce any sound. More info below.
Device: Raspberry Pi 3B
Why I (probably) need a different version of pulseaudio than supplied in the official repos: I’m no expert in hardware, but after following multiple tutorials in hopes of getting my bluetooth speaker/mic combo (essentially a headset) working with my Raspberry 3B, I have come to the conclusion that the pulseaudio version in the repos is too old to support my bluetooth card in handsfree_head_unit mode, with only a2dp_sink profile being available (i.e. speaker works but microphone doesn’t).
Steps leading up to the issue:
(following some trial and error, the remains of which I hopefully cleaned up)
sudo apt install pulseaudio pulseaudio-utils
, to make apt mark these packages as installed;
sudo apt-mark hold pulseaudio pulseaudio-utils
, to prevent apt overwriting what I did next;
3. Install the latest pulseaudio from source as per https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/Developer/PulseAudioFromGit, overwriting the official pulseaudio that was already installed;
4. Confirm that parecord and paplay work with my bluetooth device, i.e. both speaker and microphone work after I did
pactl load-module module-bluetooth-discover pacmd set-card-profile [card] handsfree_head_unit
- Install Mycroft via dietpi-software as per https://dietpi.com/docs/software/hardware_projects/#mycroft-ai, following the “Interactive Install” and “Initial Setup” sections. Pairing is successful, although no sound is heard during the whole process.
What I expected to happen: I should be able to use Mycroft with my bluetooth speaker/mic, given that pulseaudio works.
What happens: Mycroft command line works nicely (I tried the “tell me a joke” and “what’s my ip?” skills), but Mycroft produces no sound and can’t hear me. The microphone level in the bottom right corner of the debug screen does not change.
What I tried: I ran
mycroft-start audiotest -l
and this is the part I don’t get: the audiotest does work as expected, I can record my voice and hear it played back with the bluetooth device. The Mycroft Audio Troubleshooting section on their website (https://mycroft-ai.gitbook.io/docs/using-mycroft-ai/troubleshooting/audio-troubleshooting) claims “If the test is successful and you hear the recorded audio back, it should be possible for Mycroft to use the intended microphone.”.
What I think is going on: There’s something wrong with permissions and/or the pulseaudio setup between the users dietpi and mycroft:
User dietpi: Audiotest works when run as dietpi, detecting the audio devices “default” and “pulse”; paplay, aplay, parecord and arecord all work; the bluetooth headset appears under “pacmd list”. But when I try to run mycroft-start debug as dietpi, it retries forever to find “Messagebus websocket”. If I could figure out this messagebus thing, Mycroft might work.
User mycroft: Audiotest (
sudo -u mycroft ./mycroft-start audiotest -l
) detects the “default” and “pulse” audio devices, but I can hear nothing played back. None of parecord, arecord. parecord, arecord work when run as mycroft. “pacmd list” does not show my bluetooth device when run as mycroft. If I could fix pulseaudio for user mycroft, that should also solve the issue.
I don’t really know where to go next. I’m happy to provide any logs or config files or clarifications that are needed to debug this. Thanks in advance! (and please don’t advise me to just buy a USB microphone, where’s the fun in that? :p)