First, install all needed packages:
Code: Select all
sudo apt-get install bluetooth pulseaudio pulseaudio-module-bluetooth alsa-base alsa-utils blueman pavucontrol
Code: Select all
sudo nano /etc/bluetooth/audio.conf
Code: Select all
Enable=Source,Sink,Media,Socket
Code: Select all
sudo nano /etc/pulse/daemon.conf
Code: Select all
resample-method=trivial
Code: Select all
sudo nano /etc/pulse/system.pa
Code: Select all
load-module module-udev-detect
Code: Select all
load-module module-udev-detect tsched=0
Code: Select all
sudo reboot
Code: Select all
startx
Put your phone into discoverable mode, then click Scan in Blueman, and when your phone pops up right click, then click pair.
After you accept the pin on both devices, right click your phone in Blueman and click Trust.
Now loopback the Bluetooth to the audio out (replace XX_XX_XX_XX_XX_XX with your phone's bluetooth MAC, listed in Blueman):
Code: Select all
pactl load-module module-loopback source=bluez_source.XX_XX_XX_XX_XX_XX sink=alsa_output.platform-bcm2835_AUD0.0.analog-stereo rate=44100 adjust_time=0
Open Pavucontrol:
Code: Select all
pavucontrol
Enjoy!
Note: You may need to change the audio output depending on where you want the audio sent. If you plan on using the headphone jack, I'd recommend buying a cheap USB soundcard instead (the alsa drivers aren't very good yet).
Still need to be fixed/figured out:
Automatically loopback source to sink when bluetooth connects.
When connect is pressed from trusted phone, RPi automatically accepts the request.
Thanks to:
kmonkey (most of the how-to)
Colin CW (fixing the sampling and scheduling)
Tim Bovelander (finding the correct packages to install)