Bluetooth headset

This article headsets within Gentoo Linux.]]

Prerequisites
The configurations for Bluetooth and ALSA must have been previously completed.

PulseAudio
Following instructions from PulseAudio and BlueZ 5 should be sufficient to make Bluetooth headsets work (through pavucontrol for instance).

There is two protocols for handling microphone input (and button input) from headsets: HSP and HFP. In order for the microphone to work the headset has to switch from the A2DP protocol to HSP/HFP. Headset using HSP will usually work out-of-the-box with the current pulseaudio version.

pulseaudio 13.0 does not support HFP properly. There is ongoing work on this. You might have luck building the current development version from source using this merge request 288 and the accompanying hsphfpd.

ALSA + Bluez 5
If you do not want to use PulseAudio, you can use bluez-alsa to provide integration between Bluez and ALSA.


 * Install bluez-alsa:
 * In your ALSA configuration, (system-wide) or  (user-level), specify the parameters of the Bluetooth connection (replace the MAC address with the MAC address of your device)

A static ALSA configuration is also possible, make sure to change the device name in the below examples for aplay.


 * Make sure the bluetooth and bluealsa services are started. You probably want to add them to your default runlevel via rc-config.
 * Make sure the device is paired and connected to your computer. See Bluetooth for details.
 * Test with e.g. aplay, passing the PCM device 'bluealsa'


 * For other applications, the precise option to set the output device may differ.


 * Hardware volume control:

Testing

 * Play a sound file.

Or with mpv:

If it works, please add your device to the table of working devices.

Can't open input device
Compile and load the uinput kernel module, when things don't work, and the logs show this error:

No audio service is available
After updating to -5.xx it might happen, that a Bluetooth headset is connected, but ALSA / PulseAudio fails to pick up the connected device.

An error message like this might be shown in the output of PulseAudio:

To fix this, the following needs to be done:
 * 1) Enable the audio socket of bluetoothd


 * 1) Restart bluetoothd by doing one of the following things:
 * 2) * Turn the software wireless kill switch off and on again


 * 1) * Turn the hardware wireless kill switch off and on again
 * 2) * Reboot the computer
 * 3) Reconnect the Bluetooth headset

Audio device not visible when using GDM
If you are using GDM, but not logging into GNOME (e.g. i3 instead), GDM might block your headset, which will it not being available for PulseAudio. This will result in your headset being connected, but the applications won't see it.

As a workaround, you can switch to a different display manager (e.g. LXDM), or disable PulseaAudio for GDM :

If you have created the file, make sure that GDM can read it:

Audio device not visible using PulseAudio volume control (but working with ALSA)
According to this forum post, add the following to (and possibly ):

Ensure that the  and   USE flags are enabled

External resources

 * Gentoo Forums - Use headsets with Bluez 5 mini HowTo