MycroftAI / enclosure-picroft

Mycroft interface for Raspberry Pi environment
https://mycroft.ai/documentation/picroft
GNU Lesser General Public License v3.0
806 stars 192 forks source link

RASPI 4B - cannot get audio-out to work #170

Open wita-sec opened 1 year ago

wita-sec commented 1 year ago

Describe the bug I have setup a Raspberry Pi 4B Desktop edition. uname -a tells me: Linux berry 5.15.84-v8+ #1613 SMP PREEMPT Thu Jan 5 12:03:08 GMT 2023 aarch64 GNU/Linux I have followed the step-by-step instructions of the Mycroft documents to install MycroftAI. I can start Mycroft services and the mycroft-cli-client. Client can process my (over the MIC) spoken uterances.

Problem: I cannot get audio out to work. The mycroft-cli-client debug window however gives me a valid written answer on my uterance.

I tested MIC and audio out on the system, e.g. with arecord and aplay, this works well.

Log files Here is an extract from the voice.log which probably shows what happens. It would be great to get a hint from you whats going wrong in my environment.

2023-02-13 22:07:38.189 | INFO | 3923 | main:handle_wakeword:71 | Wakeword Detected: hey mycroft Wiedergabe: WAVE '/home/pi/mycroft-core/mycroft/res/snd/start_listening.wav' : Signed 16 bit Little Endian, Rate: 48000 Hz, stereo 2023-02-13 22:07:38.622 | INFO | 3923 | main:handle_record_begin:41 | Begin Recording... 2023-02-13 22:07:42.533 | INFO | 3923 | main:handle_record_end:49 | End Recording... 2023-02-13 22:07:43.878 | INFO | 3923 | main:handle_utterance:76 | Utterance: ['how about the weather'] ALSA lib pcm.c:8545:(snd_pcm_recover) overrun occurred ALSA lib pcm.c:8548:(snd_pcm_recover) cannot recovery from overrun, prepare failed: Input/output error Expression 'alsa_snd_pcm_prepare( stream->capture.pcm )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2932 Expression 'AlsaStart( stream, 0 )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3246 Expression 'AlsaRestart( self )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3313 Expression 'PaAlsaStream_HandleXrun( stream )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4531

wita-sec commented 1 year ago

Solved: thanks to mycroft audio troubleshooting at https://mycroft-ai.gitbook.io/docs/using-mycroft-ai/troubleshooting/audio-troubleshooting. Steps: mycroft-config edit system updated the aplay command to: "play_wav_cmdline": "aplay -D plughw:2,0 %1", plughw:2,0 is audio-out of my USB audio card according to "aplay -l"

This is a bit wired, because plughw:2,0 is the pluseaudio default of my system, whereas Picroft uses hw:0,0 as its default.