Skip to content

Instantly share code, notes, and snippets.

@0xMDIV
Forked from mill1000/README.md
Created October 2, 2019 21:36
Show Gist options
  • Save 0xMDIV/47875bc2c7d2e2c34b0a78be5bfd2bc5 to your computer and use it in GitHub Desktop.
Save 0xMDIV/47875bc2c7d2e2c34b0a78be5bfd2bc5 to your computer and use it in GitHub Desktop.
Headless A2DP Audio Streaming on Raspbian Stretch

About

This gist will show how to setup Raspbian Stretch as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.

Motivation

A quick search will turn up a plethora of tutorials on setting up A2DP on the Raspberry Pi. However, I felt this gist was necessary beacuse this solution is:

  • Automatic & Headless - Once setup, the system is entirely automatic. No user iteration is required to pair, connect or start playback. Therefore the Raspberry Pi can be run headless.
  • Simple - This solution has few dependencies, readily available packages and minimal configuration.
  • Up to date - As of December 2017. Written for Raspbian Stretch & Bluez 5.43

Pre-requisites

Disabling Integrated Bluetooth

If you are using a separate USB Bluetooth dongle, disbale the integrated Bluetooth to prevent conflicts.

To disable the integrated Bluetooth Add the following line to /boot/config.txt dtoverlay=pi3-disable-bt

Execute the following command

sudo systemctl disable hciuart.service

Initial Setup

First execute the following commands to make sure the system is up to date.

sudo apt-get update
sudo apt-get upgrade

Then reboot the Pi to ensure the latest kernal is loaded.

Install the pre-requisite packages.

sudo apt-get install bluealsa python-dbus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment