Step-by-step guide to solving Raspberry Pi microphone wakeup issues
When wukong-robot fails to wake up through the microphone on a Raspberry Pi, it is usually the result of a sound card configuration or device recognition issue. The following is a systematic solution:
- Detecting Hardware Recognition::
fulfillmentarecord -l
command to view the recording devices recognized by the system to confirm that the microphone is recognized (usually shown as USB Audio Device) - Configuring Sound Card Priority::
Create or modify~/.asoundrc
file, explicitly specify the sound card device to be used (e.g. ReSpeaker 2-Mics should be configured as hw:1,0):pcm.!default {
type asym
playback.pcm { type plug slave.pcm "hw:1,0" }
capture.pcm { type plug slave.pcm "hw:1,0" }
} - Test Recording Function::
Test the base functionality via the command line:arecord -d 5 test.wav && aplay test.wav
If this fails try to force the device to be specified:arecord -D plughw:1,0 test.wav
If the above steps still do not work, it is recommended to: 1) replace the USB port; 2) update the firmwaresudo rpi-update
; 3) Refer to GitHub Issue #57 to check for specific hardware configurations.
This answer comes from the articlewukong-robot: a smart speaker project to create personalized Chinese voice conversationsThe