I got the Sony MDR-ZN770BN connected to my PC via bluetooth. But I can only use A2DP. When I switch it to HSP, I get message "Failed to change profile to headset_head_unit", so no skype calls possible. Any help guys? :/
I had the similar problem with Galaxy Earbuds+ and here is how I solved it:
My earbuds profiles were A2DP, AVRCP and HFP and no support for HSP. Pulseaudio only supports HSP out-of-the-box. That's why I couldn't switch to HSP/HFP. In order to make HSP/HFP work, you have to enable HFP on pulseaudio which needs ofono. Here is how I did it on Ubuntu 18.04:
sudo apt install ofono
- Config pulseaudio to use ofono:
/etc/pulse/default.pafind the line
load-module module-bluetooth-discoverand change it in
load-module module-bluetooth-discover headset=ofono.
- Add the user
bluetoothto grant the permission:
sudo usermod -aG bluetooth pulse(probably it's already correct)
- VERY IMPORTANT: To grant the permission, add this to
<policy user="pulse"> <allow send_destination="org.ofono"/> </policy>
ofono. In order to make ofono work, you have to provide a modem to it! You can install a modem emulator called phonesim (implemented by ofono) to make it work:
ofono-phonesim(in some distros it is called
phonesim). in Ubuntu 18.04 (for Ubuntu 20.04 follow this link):
sudo apt install ofono-phonesim
- Configure phonesim by adding the following lines to
[phonesim] Driver=phonesim Address=127.0.0.1 Port=12345
sudo systemctl restart ofono.service
ofono-phonesim -p 12345 /usr/share/phonesim/default.xml
Note that the command can be
phonesim. To make sure phonesim is started correctly you can clone the ofono repo and use their test scripts:
cd /tmp git clone git://git.kernel.org/pub/scm/network/ofono/ofono.git cd ofono/test ./list-modems
You should see the modem in the result. You might have to first enable the modem by executing
online-modem scripts in the same directory.
- Once the modem is enabled, you should be able to enable HFP profile.
4.autostart phonesim. Since you have executed phonesim manually, after every restart you should execute it again. Instead you can install
ofono-phonesim-autostart which will start the phonesim as a service.
I originally posted this as an edit to @alisabzevari's post, but the edit was rejected :( I still think the information is very valuable, and I wouldn't like to lose it, so I'm posting it as an answer:
As of 2020-10-17, in Ubuntu 20.04
ofono-phonesim-autostart is not available. What you could do is create the following
systemd units to start it as a daemon on startup:
ofono-phonesim -p 12345 /usr/share/phonesim/default.xml on startup as a systemd unit, create the file
/etc/systemd/system/ofono-phonesim.service (as root) with the following contents:
[Unit] Description=Run ofono-phonesim in the background [Service] ExecStart=ofono-phonesim -p 12345 /usr/share/phonesim/default.xml Type=simple RemainAfterExit=yes [Install] WantedBy=multi-user.target
ofono-phonesim runs, you'll need to also enable and put the
phonesim modem online. I (@Zoltán) did this by creating another
systemd unit file that depends on the above
systemd unit. Put the following contents in
[Unit] Description=Enable and online phonesim modem Requires=ofono-phonesim.service [Service] ExecStart=/<path-to-cloned-ofono-git-repo>/test/enable-modem /phonesim ExecStart=/<path-to-cloned-ofono-git-repo>/test/online-modem /phonesim Type=oneshot RemainAfterExit=yes [Install] WantedBy=multi-user.target
Then run the following commands to run both daemons:
sudo systemctl daemon-reload sudo systemctl enable ofono-phonesim.service sudo systemctl enable phonesim-enable-modem.service sudo service phonesim-enable-modem start
Check if the service is running with
sudo service phonesim-enable-modem status
pulseaudio -k. Now you should be able to switch the profile to
I tried everything i possibly could, even the above answers. But i couldn't use the microphone of my headset. So i found another way to use a mic.
All you need is an Android phone which has bluetooth.
Firstly, go to google playstore on your phone and download a bluetooth microphone app.
I used this one (Simple Bluetooth Mic): https://play.google.com/store/apps/details?id=com.app.google.chrischan.simplebluetoothmic
Alternatively, you can use this: https://play.google.com/store/apps/details?id=wimlog.com.myandroidtest4.
Connect the phone's bluetooth to your PC.
Now connect your bluetooth headset to the PC. (Both the devices must be connected simultaneously)
Open the Simple Bluetooth Mic App on your phone, click on speak.
Voila, that's it.
Basically you are using your phone's mic, because we can't use the bluetooth headset for both audio input and output.(changing from A2DP to HSP everytime you need to use the headset mic is irritating af)
If this doesn't work, go to your sound settings and choose the input device as your phone's bluetooth.
HOPE THIS HELPS :)