1

I'm trying to make sound from my phone show up as a pulseaudio input so that I can play music through my computer's speakers using bluetooth A2DP. I'm using arch linux with bluez 5.45.

There are tons of guides about this on the web, but they all seem out of date. In particular, with bluez 5.45 (and bluez-utils 5.45 and bluez-tools 0.2) there is no file /etc/bluetooth/audio.conf anymore. hcitool and sdptool do not exist any more. There is no longer an org.bluez.AudioSource interface I can call on hci devices over dbus. Some web pages suggest things should "just work" now, but I certainly don't see any sources or sinks after pairing my phone (a Pixel) with my computer.

What does work: I am able to pair my phone from bluetoothctl and ping it with l2ping. I placed my user in the lp group and edited /etc/dbus-1/system.d/bluetooth.conf so I have all possible bluetooth permissions. pacmd list-modules shows that I have loaded module-bluetooth-policy, module-bluetooth-discover, and module-bluez5-discover. On my phone's bluetooth menu, my computer shows up as used for "Media audio" (don't know if that's right or not).

However, pacmd list-sources doesn't list anything about bluetooth, and there's not a hint of bluetooth anything under pavucontrol.

1 Answer 1

2

Well, I spent hours working on this and for some reason was unable to connect to my phone. However, I then tried on a different computer, and simply typing connect xx:xx:xx:xx:xx:xx in the bluetoothctl shell was enough to connect and get audio working. Then I went back to the first computer, ran remove xx:xx:xx:xx:xx:xx and re-paired, and then it worked.

The one thing I did differently was to be playing music while pairing and connecting in the cases that worked, while in the first case I tried connecting before sending audio.

So basically to summarize for other people who are trying to get bluetooth working on arch, these are the steps:

pacman --needed -S pulseaudio-bluetooth bluez-utils bluez-tools rfkill
systemctl enable bluetooth
systemctl start bluetooth
rfkill unblock bluetooth
gpasswd -a `logname` lp

Then as yourself run pulseaudio -k, log out, and log in again to get into the lp group (which provides bluetooth access).

Now play music from your phone's built-in speaker and place your phone in pairing mode.

Finally, once again as root run bluetoothctl, and from within the utility run the following commands:

power on
scan on
pair xx:xx:xx:xx:xx:xx
[confirm pin]
scan off
connect xx:xx:xx:xx:xx:xx
trust xx:xx:xx:xx:xx:xx

At this point if things are working the phone will stop playing through its speaker, and you will see a new input under the pavucontrol application.

Note, the trust command is necessary if you want your phone to connect automatically when it is in range, without you needing to run a copy of bt-agent to authorize the phone's access to your sound. Otherwise, you will need to initiate all connections from your computer, either with the connect command in bluetoothctl, or with a command like this:

dbus-send --system --type=method_call --dest=org.bluez \
    /org/bluez/hci0/dev_xx_xx_xx_xx_xx_xx org.bluez.Device1.Connect
1
  • I'm able to get this to connect and it shows up in pavucontrol. My audio also stops playing on my phone as you mentioned. I can't figure out what to do from their though. I've tried choosing combinations of input/output between speakers and phone input and all phone input and output. I can't get any sound though. Do I need to do something to route from input to output? Were there any other steps for you?
    – isaacsloan
    Feb 27, 2018 at 8:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .