Skip to content

Instantly share code, notes, and snippets.

@sidward35
Last active June 16, 2017 22:24
Show Gist options
  • Save sidward35/56939bd00852bd236b469202cf586c08 to your computer and use it in GitHub Desktop.
Save sidward35/56939bd00852bd236b469202cf586c08 to your computer and use it in GitHub Desktop.
AlexaPi Troubleshooting

Setting up your devices

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.

Checking if your system audio works

  1. To test playback, run aplay /usr/share/sounds/alsa/Front_Center.wav
  2. To rest recording, run
    1. arecord -f S16_LE -r 16000 -D plughw:CARD=CameraB409241,DEV=0 test.wav - exit with CTRL+C and
    2. aplay -f S16_LE -r 16000 test.wav to play

Checking AlexaPi's recordings

If you get null responses, you might wanna check the sound AlexaPi records. First, run in the Debug mode and then check the directory /tmp/AlexaPi-runtime-xxx (where xxx is some random string) for the file recording.wav. This has to be played with special aplay settings:

aplay -r 16000 -f S16_LE recording.wav

Debug mode

For better debugging, stop the AlexaPi service: sudo systemctl stop AlexaPi.service

and run AlexaPi interactively in debug mode: /opt/AlexaPi/src/main.py -d

Always make sure that the service is stopped before you try to run AlexaPi interactively, because otherwise the service will be using your sound card and it won't work.

3. Post-installation steps

Now that you have installed AlexaPi there's a couple of things you need to do.

DO NOT REPORT AN ISSUE UNLESS YOU HAVE READ THIS THOROUGHLY!

  • Reboot your machine or start AlexaPi with

    sudo systemctl start AlexaPi.service
    
  • Check the status of AlexaPi with

    sudo systemctl status AlexaPi.service
    

    If it is not running, be sure to see the full logs.

  • In a lot of cases, you have to setup your input / output devices properly in the configuration file. Read the Audio setup & debugging section in the documentation.

  • If you have a desktop OS (such as default Raspbian), you have to set up system-wide PulseAudio. You usually get dbus and pulseaudio error in the log if you don't do this.

  • If you got this working, but audio playback is choppy, try changing the playback handler in the config from vlc to sox. This will be default in later versions of AlexaPi. If you're using pulseaudio, please read audio setup guide.

  • READ THE WHOLE DOCUMENTATION BEFORE ASKING.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment