[SOLVED] trying to setup bluetooth headset support in archlabs

Ok, so I first started by reading through arch linux wiki’s Bluetooth and Bluetooth headset page. I installed these packages with pacman:

sudo pacman -Syu bluez bluez-utils blueman pulseaudio-bluetooth

then I checked if btusb kernel module is loaded or not, which it was:

❯ lsmod | grep blue
bluetooth             724992  5 btrtl,btintel,btbcm,btusb
ecdh_generic           16384  1 bluetooth
rfkill                 32768  6 bluetooth,ideapad_laptop,cfg80211
crc16                  16384  2 bluetooth,ext4

then I started bluetooth.service through systemctl.
Then before pairing, I first checked if it is not blocked by rfkill with:

❯ rfkill list
0: ideapad_wlan: Wireless LAN
	Soft blocked: no
	Hard blocked: no
1: ideapad_bluetooth: Bluetooth
	Soft blocked: no
	Hard blocked: no
2: hci0: Bluetooth
	Soft blocked: no
	Hard blocked: no
3: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no

then I followed pairing instructions from arch wiki page with bluetoothctl daemon:

[bluetooth]# select 3C:F8:62:54:C9:1D 
[bluetooth]# power on
[CHG] Controller 3C:F8:62:54:C9:1D Class: 0x0000010c
Changing power on succeeded
[CHG] Controller 3C:F8:62:54:C9:1D Powered: yes
[bluetooth]# devices
Device 20:20:10:22:3B:DA Boult Audio Curve
[bluetooth]# scan on
Discovery started
[CHG] Controller 3C:F8:62:54:C9:1D Discovering: yes
[CHG] Device 20:20:10:22:3B:DA RSSI: -55
[bluetooth]# agent on
Agent is already registered
[bluetooth]# pair 20:20:10:22:3B:DA 
Attempting to pair with 20:20:10:22:3B:DA
Failed to pair: org.bluez.Error.AlreadyExists
[CHG] Device 20:20:10:22:3B:DA RSSI: -68
[CHG] Device 20:20:10:22:3B:DA RSSI: -55
[bluetooth]# trust 20:20:10:22:3B:DA 
[CHG] Device 20:20:10:22:3B:DA Trusted: yes
Changing 20:20:10:22:3B:DA trust succeeded
[bluetooth]# connect 20:20:10:22:3B:DA 
Attempting to connect to 20:20:10:22:3B:DA
[CHG] Device 20:20:10:22:3B:DA Connected: yes
Failed to connect: org.bluez.Error.Failed
[bluetooth]# 

as you can see, it pairs fine (I have it paired initially), but when I try to connect to it, it throws org.bluez.Error.Failed, so at this point, I searched for this error on internet and some suggested to check the status of bluetooth systemctl service. When I checked status, it shows few errors:

❯ sudo systemctl status bluetooth.service
● bluetooth.service - Bluetooth service
     Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: disabled)
     Active: active (running) since Sat 2021-07-10 20:24:57 IST; 1min 14s ago
       Docs: man:bluetoothd(8)
   Main PID: 367 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 4539)
     Memory: 2.8M
        CPU: 41ms
     CGroup: /system.slice/bluetooth.service
             └─367 /usr/lib/bluetooth/bluetoothd

Jul 10 20:25:16 archlabs bluetoothd[367]: Endpoint unregistered: sender=:1.31 path=/MediaEndpoint/A2DPSink/sbc
Jul 10 20:25:16 archlabs bluetoothd[367]: Endpoint unregistered: sender=:1.31 path=/MediaEndpoint/A2DPSource/sbc
Jul 10 20:25:16 archlabs bluetoothd[367]: Endpoint registered: sender=:1.35 path=/MediaEndpoint/A2DPSink/sbc
Jul 10 20:25:16 archlabs bluetoothd[367]: Endpoint registered: sender=:1.35 path=/MediaEndpoint/A2DPSource/sbc
Jul 10 20:25:20 archlabs bluetoothd[367]: Endpoint unregistered: sender=:1.35 path=/MediaEndpoint/A2DPSink/sbc
Jul 10 20:25:20 archlabs bluetoothd[367]: Endpoint unregistered: sender=:1.35 path=/MediaEndpoint/A2DPSource/sbc
Jul 10 20:25:21 archlabs bluetoothd[367]: Endpoint registered: sender=:1.40 path=/MediaEndpoint/A2DPSink/sbc
Jul 10 20:25:21 archlabs bluetoothd[367]: Endpoint registered: sender=:1.40 path=/MediaEndpoint/A2DPSource/sbc
Jul 10 20:26:03 archlabs bluetoothd[367]: profiles/audio/avdtp.c:avdtp_connect_cb() connect to 20:20:10:22:3B:DA: Permission denied (13)
Jul 10 20:26:08 archlabs bluetoothd[367]: profiles/audio/avdtp.c:avdtp_connect_cb() connect to 20:20:10:22:3B:DA: Permission denied (13)

why does it says, Permission denied. I am not able to find any solution for this. If someone can help me solve this, it would be really appreciated and I would be thankful for your help. My hardware info is:

❯ inxi -F
System:    Host: archlabs Kernel: 5.12.15-arch1-1 x86_64 bits: 64 Desktop: Openbox 3.6.1 Distro: Arch Linux 
Machine:   Type: Laptop System: LENOVO product: 80UD v: Lenovo ideapad 110-15ISK serial: <superuser required> 
           Mobo: LENOVO model: LNVNB161216 v: No DPK serial: <superuser required> UEFI: LENOVO v: 1TCN27WW(V2.08) 
           date: 07/06/2018 
Battery:   ID-1: BAT1 charge: 0 Wh condition: N/A volts: 12.1 min: 14.4 
CPU:       Info: Dual Core model: Intel Core i3-6006U bits: 64 type: MT MCP cache: L2: 3 MiB 
           Speed: 500 MHz min/max: 400/2000 MHz Core speeds (MHz): 1: 500 2: 500 3: 500 4: 500 
Graphics:  Device-1: Intel Skylake GT2 [HD Graphics 520] driver: i915 v: kernel 
           Device-2: IMC Networks EasyCamera type: USB driver: uvcvideo 
           Display: x11 server: X.Org 1.20.12 driver: loaded: intel unloaded: fbdev,modesetting,vesa resolution: 1366x768~60Hz 
           Message: Unable to show advanced data. Required tool glxinfo missing. 
Audio:     Device-1: Intel Sunrise Point-LP HD Audio driver: snd_hda_intel 
           Sound Server-1: ALSA v: k5.12.15-arch1-1 running: yes 
Network:   Device-1: Realtek RTL810xE PCI Express Fast Ethernet driver: r8169 
           IF: enp1s0 state: down mac: fc:45:96:95:f5:a8 
           Device-2: Intel Dual Band Wireless-AC 3165 Plus Bluetooth driver: iwlwifi 
           IF: wlan0 state: up mac: 3c:f8:62:54:c9:19 
Bluetooth: Device-1: Intel Bluetooth wireless interface type: USB driver: btusb 
           Report: rfkill ID: hci0 state: up address: see --recommends 
Drives:    Local Storage: total: 223.57 GiB used: 5.71 GiB (2.6%) 
           ID-1: /dev/sda vendor: Crucial model: CT240BX500SSD1 size: 223.57 GiB 
Partition: ID-1: / size: 48.97 GiB used: 5.64 GiB (11.5%) fs: ext4 dev: /dev/sda2 
           ID-2: /boot size: 511 MiB used: 70.1 MiB (13.7%) fs: vfat dev: /dev/sda1 
Swap:      ID-1: swap-1 type: partition size: 1024 MiB used: 0 KiB (0.0%) dev: /dev/sda3 
Sensors:   System Temperatures: cpu: 40.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Info:      Processes: 171 Uptime: 4m Memory: 3.71 GiB used: 1.04 GiB (28.1%) Shell: Zsh inxi: 3.3.04

By any chance, did you check which groups your login is in?

Hi, thanks for replying. Yes, I have checked it as arch wiki suggested. My login user does belong to lp group if that is what you were hinting to. :sweat_smile:

❯ groups $USER
log wheel lp rfkill users
❯ id $USER
uid=1000(arch) gid=985(users) groups=985(users),19(log),998(wheel),991(lp),983(rfkill)

do you see anything unusual in this by any chance? or if I missed some step.

Here are the groups I am in.

network nopasswdlogin autologin users video storage lp audio wheel

You can skip nopasswdlogin & autologin if you’re not using auto-login

ok so I added my $USER into audio, video and storage groups; restarted my system, tried to connect to my bluetooth headset, it still shows the same permission denied error.

Sorry for late response. Do you have pulseaudio-bluetooth installed? If not, install it and remove all previously paired devices, restart your system and pair/connect again.

1 Like

It won’t have anything to do with groups, most of those have been deprecated and aren’t used in Arch/AL.

I have a bluetooth headset I use regularly and I set it up with bluetoothctl and I just use the steps outlined here.

sudo systemctl enable bluetooth.service
sudo systemctl start bluetooth.service
sudo bluetoothctl

Then you’ll enter the bluetooth prompt and follow the guide on the wiki, please read it thoroughly you missed a bit.

Re: you trying the wiki guide but getting errors, the guide has some sections where they show what to do when getting common errors like yours.

If you are getting a connection error org.bluez.Error.Failed retry by killing existing PulseAudio daemon first:

$ pulseaudio -k
[bluetooth]# connect 00:1D:43:6D:03:26

It also looks like you’ve gone half way with other methods which is now causing issues like

[bluetooth]# pair 20:20:10:22:3B:DA 
Attempting to pair with 20:20:10:22:3B:DA
Failed to pair: org.bluez.Error.AlreadyExists

Be sure to check the troubleshooting section of the wiki page as many issues are covered there
such as pairing fail authentication

Hi, thanks for replying, but I would like to point out few things for clarification.

  1. In the guide which you have outlined, bluetoothctl was writtten after a $ sign which, if I’m not wrong, means it is supposed to be run as normal user and not root user (sudo) but on but on Bluetooth pairing section, it was written after # sign which means it is meant to be run as root user. This inconsistency in both guide confused me more, so I ran it as normal user instead following the principle of least priviledge.

  2. I did follow the guide on the wiki step by step, I even tried to kill existing pulseaudio session when it showed connection error, I’m sorry I forgot to mention it in my original post.

  3. To clarify, I did not went half way with other methods, the only time I only discoursed from arch wiki to search for help on errors when I saw Permission denied (13) errors in bluetooth.service status and neither Bluetooth nor Bluetooth headset wiki page have any mention of or reference of said error.

  4. The wiki also mentioned to look at Bluetooth co-existence for Intel combined wifi and bluetooth cards which my WiFi card seems to have and I also tried that approach but that didn’t help too.

I even ran bluetoothctl daemon with sudo and did all the steps again from start as wiki page mentions, but I wasn’t able to connect to headset again and I see same Permission denied (13) errors in bluetooth.service.

Edit: I have also now tried the debugging section of troubleshooting guide.
I did all the steps again while it was in debug mode, but that still failed to connect. I am not able to attach full logs because it exceeds 32000 character limit so I uploaded it to pastebin if anyone want to have a look: ❯ systemctl stop bluetooth.service❯ /usr/lib/bluetooth/bluetoothd -n -dbluet - Pastebin.com

My mistake, we just get people asking for help after not fully reading the guides and missing important bits.

After looking around a bit it seems like it might still be paired with another device? Seems like a lot of people having the same issue have removed the device from the paired devices and re-paired to fix it, I’ve had issues with this in the past. Reading through the logs you linked and can’t find much of use, just the same error descriptions as you posted before.

Have you tried using a GUI and come to the same issue?

Oh, I just tried to connect through blueman-manager GUI and it got connected. I’m confused why it is refusing to connect through CLI haha. I guess this solves my issue. Thanks for all the help. :smiley:
Peek 2021-07-12 11-35

1 Like

Glad that you got it fixed @Eon . Props to @chroot & to @natemaia for the solution.