Skip to content

Instantly share code, notes, and snippets.

View colerd24's full-sized avatar

RC-Friedrich colerd24

View GitHub Profile
@mill1000
mill1000 / README.md
Last active April 22, 2024 07:24
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 because 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

Prerequisites

@ragusa87
ragusa87 / bluetooth-a2dp
Last active January 30, 2020 19:08
Enable bluetooth A2DP on Raspberry-PI via pulseaudio. To install, edit /etc/udev/rules.d/99-input.rules and add the line: SUBSYSTEM=="bluetooth", RUN+="/usr/lib/udev/bluetooth" Then save this script as /usr/lib/udev/bluetooth and set it executable. Bluetooth devices must be linked first.
#!/bin/bash
# This script is called by udev when you link a bluetooth device with your computer
# It's called to add or remove the device from pulseaudio
#
#
# Output to this file
LOGFILE="/var/log/bluetooth_dev"
# Name of the local sink in this computer