Bluetooth headset

This article describes the configuration of a Bluetooth headset.

Prerequisites
This article assumes that Bluetooth and ALSA have been previously configured.

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

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


 * Make sure you have emerged Bluez 5, not Bluez 4
 * 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.

{{FileBox|filename=/etc/asound.conf or ~/.asoundrc|1= pcm.btheadset { type plug slave.pcm { type bluealsa device "10:4F:A8:00:11:22" profile "a2dp" }       hint { show on               description "Your description of Bluetooth Headset" } }}
 * 1) Bluetooth headset


 * 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:

ALSA + Bluez 4
If for some reason, you do not want to PulseAudio nor ALSA + Bluez 5 using bluez-alsa as described above, then you could try the following method.

You will probably need to mask Bluez 5 and then re-emerge bluez.
 * Make sure you have emerged Bluez 4, not Bluez 5


 * Add one of the following code snippets to (system-wide) or  (user-level), and substitute the MAC address with the MAC address of your Bluetooth device.

OpenRC
 * Restart ALSA.

systemd

Testing

 * Play a sound file.

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

Audio socket (Bluez 4 only)
The ALSA + Bluez 4 setup needs Socket enabled, if there's no sound.

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

External resources

 * Gentoo Forums - Use headsets with Bluez 5 mini HowTo