#942360 bluetooth: No automatic connection when power on the device: Device or resource busy

#942360#5
Date:
2019-10-15 07:38:58 UTC
From:
To:
Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
Power on my devices Soundcore
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
   * What was the outcome of this action?
Device is not connected , errors in the log files
oct. 15 09:17:55 debian bluetoothd[644]: a2dp-source profile connect failed for
F4:4E:FD:A7:12:0D: Device or resource busy
oct. 15 09:17:55 debian bluetoothd[644]: Control: Refusing unexpected connect

ystemctl status bluetooth
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor
preset: enabled)
   Active: active (running) since Tue 2019-10-15 08:02:48 CEST; 1h 20min ago
     Docs: man:bluetoothd(8)
 Main PID: 644 (bluetoothd)
   Status: "Running"
    Tasks: 1 (limit: 4287)
   Memory: 2.7M
   CGroup: /system.slice/bluetooth.service
           └─644 /usr/lib/bluetooth/bluetoothd --noplugin=sap

oct. 15 08:14:05 debian bluetoothd[644]: Endpoint registered: sender=:1.223
path=/MediaEndpoint/A2DPSource/sbc
oct. 15 08:14:08 debian bluetoothd[644]: Endpoint registered: sender=:1.239
path=/MediaEndpoint/A2DPSink/sbc
oct. 15 08:14:08 debian bluetoothd[644]: Endpoint registered: sender=:1.239
path=/MediaEndpoint/A2DPSource/sbc
oct. 15 08:14:08 debian bluetoothd[644]: RFCOMM server failed for Headset Voice
gateway: rfcomm_bind: Address already in use (98)
oct. 15 08:14:08 debian bluetoothd[644]: RFCOMM server failed for
:1.239/Profile/HSPHSProfile/00001108-0000-1000-8000-00805f9b34fb: rfcomm_bind:
Address al>
oct. 15 08:14:14 debian bluetoothd[644]: Endpoint unregistered: sender=:1.239
path=/MediaEndpoint/A2DPSink/sbc
oct. 15 08:14:14 debian bluetoothd[644]: Endpoint unregistered: sender=:1.239
path=/MediaEndpoint/A2DPSource/sbc
oct. 15 09:17:55 debian bluetoothd[644]: a2dp-source profile connect failed for
F4:4E:FD:A7:12:0D: Device or resource busy
oct. 15 09:17:55 debian bluetoothd[644]: Control: Refusing unexpected connect
oct. 15 09:17:58 debian bluetoothd[644]:
/org/bluez/hci0/dev_F4_4E_FD_A7_12_0D/fd0: fd(22) ready


   * What outcome did you expect instead?
Connexion of the device, no errors in the log files
*** End of the template - remove these template lines ***

Workaround:
Define a shortcut to launch command

cat /home/guy/connect-soundcore.sh

#!/bin/bash
#set -x

coproc bluetoothctl
echo -e 'paired-devices\nconnect F4:4E:FD:A7:12:0D\nexit' >&${COPROC[1]}
output=$(cat <&${COPROC[0]})
echo $output >> /tmp/resul-connect-soundcore.txt
date >> /tmp/resul-connect-soundcore.txt


So this way, the connection is ok
oct. 15 09:17:58 debian bluetoothd[644]:
/org/bluez/hci0/dev_F4_4E_FD_A7_12_0D/fd0: fd(22) ready


 cat /tmp/resul-connect-soundcore.txt
Agent registered [bluetooth]# paired-devices Device F4:4E:FD:A7:12:0D SoundCore
mini2 [bluetooth]# connect F4:4E:FD:A7:12:0D Attempting to connect to F4:4E:
D:A7:12:0D [bluetooth]# exit [bluetooth]#
mardi 15 octobre 2019, 09:17:54 (UTC+0200)