You are not logged in.

#1 2020-12-30 17:03:16

Registered: 2018-10-12
Posts: 58

[solved] Cannot connect to bluetooth audio device using pulseaudio

I am using a bluetooth headset which pairs and connects fine on windows and android. It is fairly new and supports bluetooth v5.

The issue is on a thinkpad. rfkill gives

ID TYPE      DEVICE                   SOFT      HARD
 0 bluetooth tpacpi_bluetooth_sw unblocked unblocked
 1 wlan      phy0                unblocked unblocked
 5 bluetooth hci0                unblocked unblocked

I have tried a few options related to pulseaudio as far as I know.

1. Installed pulseaudio-bluetooth, bluez, bluez-utils, bluez-hid2hci.
2. Changed ControllerMode from dual to bredr (then back again).
3. remove+pair+reboot everything after each trial.
4. Tried loading module-bluez5-device (doesn't seem to work).

None of these seem to work.

When I tried to pair the device using bluetoothctl, the laptop says "pairing successful" but the bluetooth headset says "ready to pair" once again. But when I try to connect it gives something like this

Attempting to connect to 00:11:22:33:FF:EE
[CHG] Device 00:11:22:33:FF:EE Connected: yes
Failed to connect: org.bluez.Error.Failed
[CHG] Device 00:11:22:33:FF:EE Connected: no
[CHG] Device 00:11:22:33:FF:EE Connected: yes
[CHG] Device 00:11:22:33:FF:EE Connected: no

If I use blueman-applet instead of bluetoothctl for connecting, it says "resource temporarily busy or unavailable".

Journalctl gives -

Dec 30 11:44:48 archlinux bluetoothd[15733]: profiles/audio/avdtp.c:avdtp_connect_cb() connect to 00:11:22:33:FF:EE: Permission denied (13)

More information,
1. I am using a bare X environment and am starting things like pulseaudio by myself (I masked the socket), but I don't think this is the problem.
2. Pulseaudio is started as non-root, bluetoothd is started as root.
3. /var/lib/bluetooth has the permissions 0755 (recursive).
4. Pulseaudio uses the default config shipped with the archlinux package, except that I added module-bluez5-device, though it doesn't seem to show up when I try to list all the loaded pulseaudio modules.
5. User is in the groups "realtime libvirt storage lp audio wheel user plugdev bluetooth".

Can someone help me out?

Last edited by desperado (2020-12-31 06:30:04)


#2 2020-12-30 17:52:19

Forum Moderator
Registered: 2012-10-16
Posts: 17,728

Re: [solved] Cannot connect to bluetooth audio device using pulseaudio

How are you starting xorg? That reads like device permissions not properly handled as they would be on proper sessions, what's your output for

loginctl session-status

? Did you read the xinitrc page if you use startx and carry over the relevant lines from the template? What's the reason for the non systemd based pulse activation? Do you have specific requirements here?

What headset exactly? Depending on how new you might need additional codec support, there's an out of tree pulse modules package: … odules-bt/

Last edited by V1del (2020-12-30 17:53:41)


#3 2020-12-30 18:24:07

Registered: 2018-10-12
Posts: 58

Re: [solved] Cannot connect to bluetooth audio device using pulseaudio

I'm using xinit (startx).

1 - user (1000)
          Leader: 458 (login)
            Seat: seat0; vc1
             TTY: tty1
         Service: login; type tty; class user
           State: active
            Unit: session-1.scope
                  |-  458 login -- user
                  |- 1017 -zsh
                  |- 1074 /bin/sh /usr/bin/startx
                  |- 1092 xinit /home/user/.xinitrc -- /etc/X11/xinit/xserverrc :0 vt1 -keeptty -auth /tmp/serverauth.wiogHOE8gX
                  |- 1093 /usr/lib/Xorg -nolisten tcp :0 vt1 -keeptty -auth /tmp/serverauth.wiogHOE8gX
                  |- 1097 xf86-video-intel-backlight-helper intel_backlight
                  |- 1103 /bin/sh /home/user/.xinitrc
                  |- 1104 bspwm -s /tmp/bspwm_0_0-state -o 4
                  |-13090 dxhd
                  |-13098 lxqt-powermanagement
                  |-13099 pulseaudio
                  |-13100 nm-applet
                  |-13101 picom --experimental-backends
                  |-13102 /usr/bin/python /usr/bin/blueman-applet
                  |-13104 lxqt-notificationd
                  |-13105 lxqt-panel
                  |-13106 lxqt-policykit-agent
                  |-13113 emacs --daemon
                  |-13137 /usr/lib/pulse/gsettings-helper
                  |-13164 /usr/bin/python /usr/bin/blueman-tray
                  |-18948 alacritty
                  |-18953 /usr/bin/zsh
                  |-20751 loginctl session-status
                  `-20752 less

My xinitrc -



# merge in defaults and keymaps
[ -f $sysresources ] && xrdb -merge $sysresources
[ -f $sysmodmap ] && xmodmap $sysmodmap
[ -f "$userresources" ] && xrdb -merge "$userresources"
[ -f "$usermodmap" ] && xmodmap "$usermodmap"

# start some nice programs
[ -d /etc/X11/xinit/xinitrc.d ] && {
    for f in /etc/X11/xinit/xinitrc.d/?*.sh
    do [ -x "$f" ] && . "$f"
    unset f

# start the window manager

I'm trying to get a uniform setup across the distributions I use using dotfiles alone. Some of them don't use the pulseaudio socket (which starts it when X is started). So I unmasked it and started it manually.

It's a beats headset, this one to be precise. … aht&sr=1-2

Last edited by desperado (2020-12-31 05:35:38)


#4 2020-12-31 06:29:44

Registered: 2018-10-12
Posts: 58

Re: [solved] Cannot connect to bluetooth audio device using pulseaudio

Many forums say removing and re-pairing works, but it didn't for me.

Also very strange, when I pair using bluetoothctl, bluetoothctl says pairing successful and "paired:yes", but about two seconds later, the bluetooth device (not bluetoothctl) says "ready to pair" again and bluetoothctl says "connected:no". If I connect before the said two seconds, the connection WORKS, but if I do it too late, it fails.

I have no idea why this is the case. Anyways journalctl shows this new line after the connection is successful, EVEN WHEN it is successful.

profiles/audio/avctp.c:avctp_control_confirm() Control: Refusing unexpected connect

Anyways, it all works, for now.


Board footer

Powered by FluxBB