bluetooth - bunnyamin/bunnix GitHub Wiki

ArchLinux

Package Arch Linux
Daemons for the bluetooth protocol stack bluez
Tools to manage Bluetooth devices for Linux bluez-tools
Bluetooth support for PulseAudio pulseaudio-bluetooth

bluetoothctl

Add and trust device:

  1. power on controller
  2. Set agent on and default-agent
  3. To find devices scan on
  4. pair aa:bb:cc:dd:ee:ff
    • List paired-devices pair
    • To delete a paired device remove aa:bb:cc:dd:ee:ff
  5. trust aa:bb:cc:dd:ee:ff to enable automatically re-connect
    • untrust aa:bb:cc:dd:ee:ff
  6. Edit /etc/pulse/default.pa Add ### Automatically switch to newly-connected devices Add load-module module-switch-on-connect
  7. scan off

Error, problem, troubleshoot

Event Error Cause Consequence Remedy
Connect device Failed to connect: org.bluez.Error.NotReady br-connection-adapter-not-powered Controller is not powered on. power on
Connect device Failed to connect: org.bluez.Error.Failed br-connection-profile-unavailable Pulseaudio is not started. systemctl start --user pulseaudio
Connect device Failed to connect: org.bluez.Error.Failed br-connection-unknown unknown Cannot connect to device Remove device, and pair it again.

Choppy, degenerated sound

Change latency

  1. Identify device and the port:
    • pactl list | grep -Pzo '.*bluez_card(.*\n)*'
    • headset-output: Headset (type: Headset, priority: 0, latency offset: 0 usec, available) Part of profile(s): a2dp_sink, handsfree_head_unit
  2. Define a new value for latency:
    • pactl set-port-latency-offset <NAME> <PORT> <BUFFER_SIZE_MICROSECONDS>
    • For example: pactl set-port-latency-offset bluez_card.A1_B2_C3_D4_E5_F6 headset-output 100000
  3. Restart bluetooth. For example systemctl restart bluetooth
⚠️ **GitHub.com Fallback** ⚠️