0

I'm trying to pair a SRS-XB40 portable speaker with my Debian Stretch desktop.

The speaker works fine on a Mint laptop using the setup GUI.

I installed blueman. Since it didn't work I also upgraded firmware-linux to the backport version (20170823).

Hardware

The machine is a Dell XPS 630i.

hciconfig -a
hci0:   Type: Primary  Bus: USB
        BD Address: 00:1C:26:DD:18:A9  ACL MTU: 1017:7  SCO MTU: 64:1
        UP RUNNING PSCAN 
        RX bytes:2607 acl:0 sco:0 events:153 errors:0
        TX bytes:1739 acl:0 sco:0 commands:125 errors:0
        Features: 0xff 0xfe 0x8d 0xfe 0x9b 0xf9 0x00 0x80
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
        Link policy: RSWITCH HOLD SNIFF 
        Link mode: SLAVE ACCEPT 
        Name: 'ChromeLinux_6529'
        Class: 0x1c0104
        Service Classes: Rendering, Capturing, Object Transfer
        Device Class: Computer, Desktop workstation
        HCI Version: 2.0 (0x3)  Revision: 0x214c
        LMP Version: 2.0 (0x3)  Subversion: 0x41f4
        Manufacturer: Broadcom Corporation (15)

Software

Linux 4.15.0-0.bpo.2-amd64 #1 SMP Debian 4.15.11-1~bpo9+1 (2018-04-07) x86_64 GNU/Linux
firmware-amd-graphics 20170823-1~bpo9+1
firmware-linux 20170823-1~bpo9+1
firmware-linux-nonfree 20170823-1~bpo9+1
firmware-misc-nonfree 20170823-1~bpo9+1
bluez 5.43-2+deb9u1
bluez-obexd 5.43-2+deb9u1
blueman 2.0.4-1

bluetooth service startup

The bluetooth service starts correctly.

# systemctl status bluetooth
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2018-05-07 13:47:15 CEST; 33min ago
     Docs: man:bluetoothd(8)
 Main PID: 679 (bluetoothd)
   Status: "Running"
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/bluetooth.service
           └─679 /usr/lib/bluetooth/bluetoothd --noplugin=sap

mai 07 13:47:15 bouzin bluetoothd[679]: Excluding (cli) sap
mai 07 13:47:15 bouzin systemd[1]: Started Bluetooth service.
mai 07 13:47:15 bouzin bluetoothd[679]: Bluetooth management interface 1.14 initialized
mai 07 13:47:15 bouzin bluetoothd[679]: Failed to obtain handles for "Service Changed" characteristic
mai 07 13:50:14 bouzin bluetoothd[679]: Endpoint registered: sender=:1.41 path=/MediaEndpoint/A2DPSource
mai 07 13:50:14 bouzin bluetoothd[679]: Endpoint registered: sender=:1.41 path=/MediaEndpoint/A2DPSink

From what I gathered, the

Failed to obtain handles for "Service Changed" characteristic

warning should be harmless.

Device setup

I can "setup" the speaker in blueman applet but I can't pair with it.

To pair, I push the "pairing" button on the speaker to put it in pairing mode, then ask the applet to pair. I get an error.

Using bluetoothctl, it says:

Failed to pair: org.bluez.Error.AuthenticationFailed

Old blueman bug

I got those errors in the logs:

mai 07 14:23:30 bouzin bluetoothd[679]: vendor 0x0 product: 0x0
mai 07 14:23:30 bouzin bluetoothd[679]: Agent /org/blueman/agent/global replied with an error: org.freedesktop.DBus.Python.KeyError, Traceback (most recent call last):
                                          File "/usr/lib/python3/dist-packages/dbus/service.py", line 707, in _message_cb
                                            retval = candidate_method(self, *args, **keywords)
                                          File "/usr/lib/python3/dist-packages/blueman/main/applet/BluezAgent.py", line 167, in RequestPinCode
                                            self.ask_passkey(device, dialog_msg, notify_msg, False, self.notifications, ok, err)
                                          File "/usr/lib/python3/dist-packages/blueman/main/applet/BluezAgent.py", line 122, in ask_passkey
                                            alias = self.get_device_alias(device_path)
                                          File "/usr/lib/python3/dist-packages/blueman/main/applet/BluezAgent.py", line 95, in get_device_alias
                                            name = props["Name"]
                                        KeyError: 'Name'

This is a bug in blueman that was fixes in this commit. I can't upgrade to the testing/unstable version as it relies on Python 3.6, so I apply the fix to /usr/lib/python3/dist-packages/blueman/main/applet/BluezAgent.py.

No agent available

Now, I get:

mai 07 14:30:30 bouzin bluetoothd[4042]: vendor 0x0 product: 0x0
mai 07 14:30:30 bouzin bluetoothd[4042]: No agent available for request type 0
mai 07 14:30:30 bouzin bluetoothd[4042]: device_request_pin: Operation not permitted

From this answer, I try to launch

bluetoothctl -a

PIN code

This gets me a little further.

pair B8:D5:0B:05:A1:62
Attempting to pair with B8:D5:0B:05:A1:62
Request PIN code
[agent] Enter PIN code: 1324
Failed to pair: org.bluez.Error.AuthenticationFailed

I'm asked for a PIN code.

From this answer and comments, I must enter 0000.

I get a succesful pairing.

In the GUI, I set "trust" on the device and now it apparently pairs automatically when the speaker is switched on.

Audio sink

From blueman, I click "audio sink" and I can hear a check sound coming from the speaker. blueman displays stats about the connection quality, which is excellent.

For a few tens of seconds, the "audio profile" menu is not greyed out. I click "High fidelity playback (A2DP sink)".

I get an error message

Failed to change profile to a2dp_sink

I saw this Debian bug but I don't think it is the same issue. I'm not using gdm but lightdm, and all pulseaudio processes belong to my user.

Of course, I don't see the speaker in the list of audio output devices.

I don't know where to go from here.

I know most paragraphs above are unrelated to this last issue, but I'd like to keep them here hoping they provide useful information to people with the same issues.

0

I saw this Debian bug but I don't think it is the same issue. I'm not using gdm but lightdm, and all pulseaudio processes belong to my user.

Well, that seems to be it, after all. I applied the workaround from this answer and I finally got the speaker working:

Edit the file:

/etc/pulse/default.pa

and comment out (with an # at the beginning of the line) the following line:

#load-module module-bluetooth-discover

now edit the file:

/usr/bin/start-pulseaudio-x11

and after the lines:

   if [ x”$SESSION_MANAGER” != x ] ; then
        /usr/bin/pactl load-module module-x11-xsmp “display=$DISPLAY session_manager=$SESSION_MANAGER” > /dev/null
    fi

add the following line:

/usr/bin/pactl load-module module-bluetooth-discover

I suppose I'll have to repeat the procedure after an upgrade of those files.

0

after logging in I run this script as root "service bluetooth restart"

"pavucontrol". Then I restart the bluetooth device. I select the bluetooth device in pavucontrol and adjust the sound. After that my device connects and plays audio.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.