Audio setup & debugging
If you want to change your playback / recording device (also because the default setting doesn't work for you), you can do that in the configuration file. If you installed into /opt
as recommended, it is /etc/opt/AlexaPi/config.yaml
. If you installed elsewhere, the file config.yaml
is in your AlexaPi/src
directory.
You may need to adjust the volume and/or input gain for the microphone, you can do this with alsamixer
.
Once the adjustments have been made, you can save the settings using alsactl store
.
If there is an error in your log file complaining about alsaaudio you may need to check the name of your sound card input device.
These errors might look like this:
alsaaudio.ALSAAudioError: Device or resource busy [plughw:1]
alsaaudio.ALSAAudioError: No such file or directory [plughw:1]
However, make sure that no other application is using your sound card and that your playback / recording works with other applications.
- To test playback, run
aplay /usr/share/sounds/alsa/Front_Center.wav
- To rest recording, run
arecord -D yourdevice test.wav
- exit with CTRL+C andaplay test.wav
Selecting the device default
for input and / or output often works.
You can use these commands to figure out your device names (look for the "plughw:" line):
arecord -l
arecord -L
aplay -l
aplay -L
To help in debugging and tracking down audio issues, please use the following command as a standard form of data collection:
cd ~ && wget https://raw.githubusercontent.com/alexa-pi/AlexaPi-misc/master/alsa-info.sh && bash alsa-info.sh
This site has some good information regarding alsa: http://www.volkerschatz.com/noise/alsa.html
If you can't figure it out yourself, be sure to post the output of those commands when asking for help
If you are using HDMI out and are losing the first part of audio playback try running vcgencmd force_audio hdmi 1
. See the Raspberry Pi section in Devices for details.
Right now it might not work. We're discussing this in #38. You can find some tips in there for the time being. Any help on that is also appreciated.
All under root:
mkdir -p /var/lib/AlexaPi/.config/pulse
chown -R alexapi:alexapi /var/lib/AlexaPi/
usermod --home /var/lib/AlexaPi alexapi
cp /etc/pulse/client.conf /var/lib/AlexaPi/.config/pulse/
# edit /var/lib/AlexaPi/.config/pulse/client.conf and set "autospawn = no"
This is the preferred (and possibly the only sensible) way to run PA with AlexaPi.
TODO How-To.