Setting up a Bluetooth Headset on Arch Linux
I got a Sennheiser PXC 550 headset that I wanted to setup on my Arch Linux PC recently. The PXC 550 headset is a wireless headset that can be used wirelessly using bluetooth. I'm setting it up on a PC with the following specs
- OS: Linux arch680 5.0.7-arch1-1-ARCH x86_64 GNU/Linux
- Bluetooth: External USB Bluetooth adapter with Broadcom chipset
- Headset: Sennheiser PXC 550
Before we get started make sure your system is up to date. If you don't feel like doing a full system upgrade at least make sure to update your the keyring and packages.
Updating your system
Full upgrade
# pacman -Sy # pacman-key --refresh-keys # pacman -Syu
Minimal upgrade
# pacman -Sy # pacman-key --refresh-keys
Installing necessary packages
# pacman -S pulseaudio-bluetooth # pacman -S pulseaudio-alsa # pacman -S pavucontrol # pacman -S bluez # pacman -S bluez-utils
Make sure bluetooth is running and automatically starts after booting:
# systemctl enable bluetooth # systemctl start bluetooth
Configure PulseAudio and Bluetooth
Add the following to the bottom of the main bluetooth configuration file:
# emacs -nw /etc/bluetooth/main.cf AutoEnable=true
To make sure that your headsets is automatically connected to your bluetooth
device we need to enable the switch-on-connect module. We also copy the
configurations to our user directory because we don't want to change the
system wide settings. If you want you can also change /etc/pulse/* though,
the choice is whatever you prefer.
mkdir -p ~/.config/pulse cp /etc/pulse/* ~/.config/pulse/ # emacs -nw ~/.config/pulse/default.pa load-module module-switch-on-connect -- add this at the bottom
After making these changes restart bluetooth:
# systemctl restart bluetooth
Pairing your headset
Ok we've finally done all the ground work to pair our
PXC 550. Open a terminal and start bluetoothctl. We use
bluetoothctl to pair, trust and connect to the headset.
But before we start we check if the device was already paired and maybe incorrectly configured. To make sure we start off with the same settings check if the device was paired, then remove it and start from scratch:
# bluetoothctl [bluetooth]# paired-devices Device 00:1D:43:6D:03:26 PXC 550 [bluetooth]# remove 00:1D:43:6D:03:26
Ok, now we can start with a clean configuration. Execute the
following commands. After you've given the scan on command (see
below), you need to put your PXC headset into pairing more.
To set your PXC 550 into pairing mode hold down the sound effect button (on the right cap) for 4 seconds. The headset will tell you something like "Pairing..."
You can use the TAB key to autocomplete the device IDs. You don't
have to type them yourself, simply type the first characters and hit TAB.
$ bluetoothctl [bluetooth]# power on [bluetooth]# agent on [bluetooth]# default-agent [bluetooth]# scan on [NEW] Device 00:1D:43:6D:03:26 PXC 550 [bluetooth]# pair 00:1D:43:6D:03:26 -- pair with the device [bluetooth]# connect 00:1D:43:6D:03:26 -- connect with the device [bluetooth]# trust 00:1D:43:6D:03:26 -- trust the device [bluetooth]# scan off [bluetooth]# exit
Verify if your headset is working
You can use pacat or just open a YouTube video. To playback a YouTube
video make sure to restart your browser if you already opened it.
pacat < /dev/urandom
You can also open pavucontrol and see if the bluetooth headset was
found in the output devices tab.
Troubleshooting
Here are some commands that can help you to get more information when you're running into problems.
dmesg
# dmesg | grep -i bluetooth [ 5.114524] Bluetooth: Core ver 2.22 [ 5.114534] Bluetooth: HCI device and connection manager initialized [ 5.114538] Bluetooth: HCI socket layer initialized [ 5.114539] Bluetooth: L2CAP socket layer initialized [ 5.114541] Bluetooth: SCO socket layer initialized [ 5.181918] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 5.181919] Bluetooth: BNEP filters: protocol multicast [ 5.181922] Bluetooth: BNEP socket layer initialized [ 5.264246] Bluetooth: hci1: BCM: chip id 63 [ 5.265242] Bluetooth: hci1: BCM: features 0x07 [ 5.281221] Bluetooth: hci1: arch680 [ 5.282232] Bluetooth: hci1: BCM20702A1 (001.002.014) build 0000 [ 5.282399] bluetooth hci1: Direct firmware load for brcm/BCM20702A1-0a5c-21e8.hcd failed with error -2 [ 5.282400] Bluetooth: hci1: BCM: Patch brcm/BCM20702A1-0a5c-21e8.hcd not found [ 16.534360] Bluetooth: RFCOMM TTY layer initialized [ 16.534366] Bluetooth: RFCOMM socket layer initialized [ 16.534371] Bluetooth: RFCOMM ver 1.11
lsmod
$ lsmod | grep -i bluetooth bluetooth 651264 49 btrtl,btintel,btbcm,bnep,btusb,rfcomm ecdh_generic 24576 3 bluetooth rfkill 28672 4 bluetooth,cfg80211 crc16 16384 2 bluetooth,ext4
btmon
You can run btmon in a separate terminal while you're scanning
for your device and see if there are logs that contain e.g. the
name of your device.
# btmon
Bluetooth monitor ver 5.50
= Note: Linux version 5.0.7-arch1-1-ARCH (x86_64) 0.794111
= Note: Bluetooth subsystem version 2.22 0.794112
= New Index: 5C:F3:70:81:F0:5A (Primary,USB,hci1) [hci1] 0.794113
= Open Index: 5C:F3:70:81:F0:5A [hci1] 0.794114
= Index Info: 5C:F3:70:81:F0:5A (Broadcom Corporation) [hci1] 0.794114
= New Index: 9C:B6:D0:02:2D:64 (Primary,USB,hci0) [hci0] 0.794114
= Open Index: 9C:B6:D0:02:2D:64 [hci0] 0.794114
= Index Info: 9C:B6:D0:02:2D:64 (Qualcomm) [hci0] 0.794115
@ MGMT Open: bluetoothd (privileged) version 1.14 {0x0001} 0.794115
@ MGMT Open: btmon (privileged) version 1.14 {0x0002} 0.794125
> HCI Event: Connect Request (0x04) plen 10 #1 [hci1] 27.312940
Address: 00:16:94:29:CB:82 (Sennheiser Communications A/S)
Class: 0x240404
Major class: Audio/Video (headset, speaker, stereo, video, vcr)
Minor class: Wearable Headset Device
Rendering (Printing, Speaker)
Audio (Speaker, Microphone, Headset)
Link type: ACL (0x01)
lsusb
Because my bluetooth device is a simple USB adapter, I used
lsusb -v to find more information about the type of device that
I use.
# lsusb -v
Bus 001 Device 007: ID 0a5c:21e8 Broadcom Corp. BCM20702A0 Bluetooth 4.0
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 255 Vendor Specific Class
bDeviceSubClass 1
bDeviceProtocol 1
bMaxPacketSize0 64
idVendor 0x0a5c Broadcom Corp.
idProduct 0x21e8 BCM20702A0 Bluetooth 4.0
bcdDevice 1.12
iManufacturer 1 Broadcom Corp
iProduct 2 BCM20702A0
iSerial 3 5CF37081F05A
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x00da
bNumInterfaces 4
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 1
bInterfaceProtocol 1
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0010 1x 16 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Endpoint Descriptor:
pacman
You can use pacman to see what bluetooth packages are currently installed.
Use the pacman -Qs with a search term like blue.
$ pacman -Qs blue
local/blueman 2.0.8-2
GTK+ Bluetooth Manager
local/bluez 5.50-6
Daemons for the bluetooth protocol stack
local/bluez-libs 5.50-6
Deprecated libraries for the bluetooth protocol stack
local/bluez-utils 5.50-6
Development and debugging utilities for the bluetooth protocol stack
local/pulseaudio-bluetooth 12.2-2
Bluetooth support for PulseAudio
local/qt5-connectivity 5.12.2-1 (qt qt5)
Provides access to Bluetooth hardware
local/sbc 1.4-1
Bluetooth Subband Codec (SBC) library
Also checking what pulse audio packages are installed can give your more info while you're running into issues.
$ pacman -Qs pulse
local/libcanberra-pulse 0.30+2+gc0620e4-2
PulseAudio plugin for libcanberra
local/libpulse 12.2-2
A featureful, general-purpose sound server (client library)
local/pavucontrol 1:4.0-1
PulseAudio Volume Control
local/pulseaudio 12.2-2
A featureful, general-purpose sound server
local/pulseaudio-alsa 2-4
ALSA Configuration for PulseAudio
local/pulseaudio-bluetooth 12.2-2
Bluetooth support for PulseAudio
local/pulsemixer 1.4.0-3
CLI and curses mixer for pulseaudio
NAT Types
Building Cabinets
Compiling GStreamer from source on Windows
Debugging CMake Issues
Dual Boot Arch Linux and Windows 10
Mindset Updated Edition, Carol S. Dweck (Book Notes)
How to setup a self-hosted Unifi NVR with Arch Linux
Blender 2.8 How to use Transparent Textures
Compiling FFmpeg with X264 on Windows 10 using MSVC
Blender 2.8 OpenGL Buffer Exporter
Blender 2.8 Baking lightmaps
Blender 2.8 Tips and Tricks
Setting up a Bluetooth Headset on Arch Linux
Compiling x264 on Windows with MSVC
C/C++ Snippets
Reading Chunks from a Buffer
Handy Bash Commands
Building a zero copy parser
Kalman Filter
Saving pixel data using libpng
Compile Apache, PHP and MySQL on Mac 10.10
Fast Pixel Transfers with Pixel Buffer Objects
High Resolution Timer function in C/C++
Rendering text with Pango, Cairo and Freetype
Fast OpenGL blur shader
Spherical Environment Mapping with OpenGL
Using OpenSSL with memory BIOs
Attributeless Vertex Shader with OpenGL
Circular Image Selector
Decoding H264 and YUV420P playback
Fast Fourier Transform
OpenGL Rim Shader
Rendering The Depth Buffer
Delaunay Triangulation
RapidXML
Git Snippets
Basic Shading With OpenGL
Open Source Libraries For Creative Coding
Bouncing particle effect
OpenGL Instanced Rendering
Mapping a texture on a disc
Download HTML page using CURL
Height Field Simulation on GPU
OpenCV
Some notes on OpenGL
Math
Gists to remember
Reverse SSH
Working Set
Consumer + Producer model with libuv
Parsing binary data
C++ file operation snippets
Importance of blur with image gradients
Real-time oil painting with openGL
x264 encoder
Generative helix with openGL
Mini test with vector field
Protractor gesture recognizer
Hair simulation
Some glitch screenshots
Working on video installation
Generative meshes
Converting video/audio using avconv
Auto start terminal app on mac
Export blender object to simple file format