Taco Steemers

A personal blog.

Using Bluetooth audio devices on Debian

In this article I explain how I get high quality audio with my Bluetooth headset.

Connecting to a Bluetooth headset with Debian can be a bit tricky. In some situations it fails to get stereo working, and instead only gives choppy mono sound. The part that gives us stereo audio is the AD2P sink, that may be handy to know if you are still searching for a solution. My descriptions are based on Debian with PulseAudio and the bluetoothctl application.

Connecting

To get the high quality stereo audio working I connect in two ways. I connect to my device with bluetoothctl first and then again with the bluetooth section on the Gnome taskbar. The applet normally works as a graphical interface to bluetoothctl , but on my machine this does not work, and the two get ot of sync. For me the applet is located somewhere near the start and sleep buttons in the menu on the taskbar. If you are not using Gnome I think any other kind of user control on your system can be tried at that point.

These steps are not all required every time. Connecting again later works without much extra work.

Let's get started. Make sure that the Bluetooth adapter is on.

LG HBS-FN6

For this model specifically we need to make sure that we connect to the bluetooth device labelled LG HBS-FN6 . Do not connect to LG HBS-FN6_LE , that won't work.

Initial setup

First we start bluetoothctl and check if we are paired

[bluetooth]# paired-devices

Nothing. That means we are not connected yet. We can ask bluetoothctl to connect to the Media Access Controll address. First we need to find the MAC address, with the scan on command. The MAC address is a hexadecimal string of 6 groups of 2 characters, separated by :. When the scan has found the device we want, we type scan off .

Let's connect:

[bluetooth]# connect DE:AD:BE:EF:CA:FE
[bluetooth]# paired-devices
Device DE:AD:BE:EF:CA:FE LG HBS-FN6

We can type exit to leave bluetoothctl.

At this point you may already be able to see the headset in the PulseAudio Volume Control. If so, skip to that section.

Connecting in daily usage

Now we may need to connect to the headphones again. I use the gnome applet. By gnome applet I mean a button somewhere near the start and sleep buttons on the menu bar on the Gnome desktop. The individual pieces of functionality there are called applets. If you are not using Gnome I think any other kind of user control on your system can be tried at that point.

According to the Gnome Bluetooth applet I am not connected, even though I know I already have connected with bluetoothctl. I connect to the headphone here as well.

PulseAudio Volume Control

In the PulseAudio Volume Control application we should now be able to configure the headset to use the AD2P sink instead of mono. Go to the configuration tab. Go to your device's profile dropdown and select the AD2P sink. There may be multiple options to try out.

Now we are almost done! All that is left is to actually set the headset as the currently active speaker.

Problems after reconnecting

On of my colleagues only gets mono audio after reconnecting. The device fails to switch to the a2dp_sink profile. Restarting the bluetooth stack resolves this for them.

sudo systemctl restart bluetooth

I'd recommend putting that in a script or alias if this is true for you as well.

Problems detecting the bluetooth device

If your system has trouble finding your device it might help to unload and load the discovery module:

unload-module module-bluetooth-discover
load-module module-bluetooth-discover

About the microphone

There is a microphone function on this model. When I tried to use it I was able to select it but the application did not seem to receive sound from it. I haven't tried it recently, but when I did earlier I found some logging in /var/log/syslog that might provide clues:

... pulseaudio[32014]: E: [pulseaudio] backend-ofono.c: Failed to register as 
a handsfree audio agent with ofono: org.freedesktop.DBus.Error.ServiceUnknown: 
The name org.ofono was not provided by any .service files
...
... bluetoothd[32006]: RFCOMM server failed for Headset Voice 
gateway: rfcomm_bind: Address already in use (98)

These probably are related to why the microphone function doesn't work. I have not looked into it further.