HFP/HSP profile in linux

Leonid Komaryanskiy picture Leonid Komaryanskiy · Aug 3, 2017 · Viewed 11.9k times · Source

I have Ubuntu 16.04 and already installed BlueZ 5.37, PulseAudio 10.0, and ofono 1.20 (clone from github).

And I need to use phone like modem for transmitting my phone calls to computer. I paired my telephone with PC, made device trust and connect (all actions are successfully). I think problem with ofono, because I can play music (which use the A2DP) but if i want use hends free or headset profile - I have no sound on PC.

In pacmd (PulseAudio console tool) list-cards I see my bluetooth device, but Headset Audio Gateway HFP/HSP is not avalible. Also I tested it on different devices and computers.

Thank you in advice.

Answer

Andrea picture Andrea · Aug 5, 2018

I've solved in this way:

  1. Install ofono
  2. In /etc/pulse/default.pa find the line load-module module-bluetooth-discover and change it to load-module module-bluetooth-discover headset=ofono.
  3. If the user pulse is not a member of group bluetooth, then add it: sudo useradd -g bluetooth pulse
  4. VERY IMPORTANT: add this to /etc/dbus-1/system.d/ofono.conf before </busconfig>:
    <policy user="pulse">
     <allow send_destination="org.ofono"/>
    </policy>
    

See: https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Bluetooth/

The good news: Now in pavucontrol I can see that the profile changes automatically from A2DP to HSP / HFP if I make a phone call, and then it magically returns to A2DP!

The bad news: it works only one time per booting (and checking if ofonod is running), then I have to reboot my Debian system.