Connecting an Amazon Echo (via Bluetooth and LibreElec)

Level: advanced

HiFiBerry user asked us how he could use an HiFiBerry Amp+ with Amazons Echo Dot. As the Amp+ does not feature an input, you can’t simply connect an audio cable. However, the Echo Dot (any many other players) can connect to an active speaker via Bluetooth. As the Raspberry Pi 3 and the Raspberry Pi Zero-W both have an onboard Bluetooth module, this should be easy. Unfortunately it still requires some work. Bluetooth audio on Linux requires the use of BlueZ and PulseAudio, which are often quite hard to setup – especially for beginners. Therefore most distributions don’t use PulseAudio. However, there is one that comes with PulseAudio installed by default – LibreElec. This guide will show you how to connect your Amazon Echo to your Raspberry Pi using Bluetooth. It will also work with other Bluetooth audio devices, e.g. many mobiles phones and tablets.

The full PulseAudio documentation of LibreElec can be found here, but here we will try a step-by-set guide that you can just follow. Note that there might be changes in both LibreElec, but also Amazon’s Echo speakers. There is no individual support for this guide. If something isn’t working as expected, feel free to post in our community area. Other users might be able to help with some tips.

While this guide should work also with other Bluetooth audio senders, the pairing process might be different. You might need to experiment a bit.

Install LibreElec

First you need to download and configure LibreElec. Configure your HiFiBerry sound card. Make sure everything works fine before you continue.

Configure Bluetooth

First you need to enable Bluetooth in the settings menu:

Pairing the Amazon Echo

In your Amazon Alex App, select your Amazon Echo, then select “Wireless/Bluetooth” and press the “Pair a new device” button.

Now go to the Bluetooth in the LibreElec settings menu, find the Amazon Echo in the Bluetooth device list and pair it:
 
The Amazon Echo will now use your Raspberry Pi as a Bluetooth speaker. However, there are some more steps required before you hear something from the Raspberry Pi.

Configure PulseAudio

Now you need to select PulseAudio as the audio output module in “System Settings/Audio”

Now, the Amazon echo will act as an external speaker for your Raspberry Pi. But that’s not what we want. We want it the other way around.

Configure the audio routing

Unfortunately it now you have to use the command line. To make the configuration easy also for beginners, we have created a script. You don’t have to deal with the Pulseaudio configuration. First, login to your LibreElec system using ssh. Then enter the following command on the LibreElec command line (copy/paste recommended):

curl -s http://www.hifiberry.com/scripts/btlibre.sh | bash

Know issues and limitations

  • If you restart your LibreElec system, you need to re-connect the Bluetooth audio connection on your Amazon Echo using the Echo App
  • If the BT audio device isn’t connected, the btlibre script will fail.
  • Multiple devices sending music via Airplay are not supported.
  • There had been very little testing, therefore something might not work as expected. Please report issues in our forum.