Skip to content

Instantly share code, notes, and snippets.

@koji
Created April 2, 2019 06:59
Show Gist options
  • Save koji/01111851b90fb5629a4989b68cafb4f4 to your computer and use it in GitHub Desktop.
Save koji/01111851b90fb5629a4989b68cafb4f4 to your computer and use it in GitHub Desktop.
bluetooth and raspberry pi

install

$ sudo apt-get install pulseaudio pavucontrol
$ pulseaudio -D
$ sudo apt-get install pi-bluetooth blueman pulseaudio-module-bluetooth

turn on bluetooth

$ bluetoothctl
[bluetooth]# power on
[bluetooth]# agent on
[bluetooth]# scan on
[bluetooth]# pair your speaker mac address

create a service file

/etc/systemd/system/pulseaudio.service

[Unit]
Description=Pulse Audio

[Service]
Type=simple
ExecStart=/usr/bin/pulseaudio --system --disallow-exit --disable-shm

[Install]
WantedBy=multi-user.target

/etc/dbus-1/system.d/pulseaudio-bluetooth.conf

<busconfig>

  <policy user="pulse">
    <allow send_destination="org.bluez"/> 
  </policy>

</busconfig>
$ sudo systemctl start pulseaudio.service
$ sudo systemctl status pulseaudio.service
$ sudo systemctl enable pulseaudio.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment