Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] bluetooth connection fails with BT speakers
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Sat Sep 09, 2017 12:43 pm    Post subject: [SOLVED] bluetooth connection fails with BT speakers Reply with quote

Hi again.

TL;DR : The issue was within my Radius Speaker. Some devices cannot be paired with multiple operating systems from the same bluetooth MAC address, which is the case with multi-boot between Windows and Linux... or when the operating system was replaced, which is true in my case.

All in all I only had to remove the paired device and set pairing again, then connect succeeded.

____________


FTR I'm running Gentoo on my laptop without systemd nor pulseaudio. I have a Blutooth Radius speaker, which I'd like to use to stream audio to. Since I don't have pulseaudio I have installed bluez-alsa.

When I try to connect my laptop with Bluetooth to my Radius speaker I get the following error:
Code:
blueman.bluez.errors.DBusFailedError: Resource temporarily unavailable...

Before that, I was getting a protocol error, this one goes a little bit further but still fails.

If I try to connect to the speaker with bluetoothctl (under root account, just to be sure), here's what I have:
Code:
finn ~ # bluetoothctl
[NEW] Controller 24:FD:52:2F:ED:C4 Finn [default]
[NEW] Device FC:58:FA:52:1E:AA Radius Speaker
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# devices
Device FC:58:FA:52:1E:AA Radius Speaker
[bluetooth]# connect FC:58:FA:52:1E:AA
Attempting to connect to FC:58:FA:52:1E:AA
Failed to connect: org.bluez.Error.Failed
[bluetooth]# connect FC:58:FA:52:1E:AA
Attempting to connect to FC:58:FA:52:1E:AA
[CHG] Device FC:58:FA:52:1E:AA Connected: yes
Failed to connect: org.bluez.Error.Failed
[CHG] Device FC:58:FA:52:1E:AA Connected: no
[CHG] Controller 24:FD:52:2F:ED:C4 Discoverable: yes
[CHG] Controller 24:FD:52:2F:ED:C4 DiscoverableTimeout: 0x00003c
[CHG] Device FC:58:FA:52:1E:AA Connected: yes
[CHG] Device FC:58:FA:52:1E:AA Connected: no
[CHG] Controller 24:FD:52:2F:ED:C4 Discoverable: no

At this stage I powered off the speaker.

I don't know what to do, I just know that when I had Arch installed all of this was working so I guess I just overlooked something. I'm not sure whether I should load some firmware, if that's a problem with a kernel module... On the other hand I've successfully paired my laptop with my Android phone and exchanged files both ways so at least the BT stack is working properly, at least for the most part, I guess. Can anyone help me nail down this issue?

For the record, here's an example of what I can see in the logs.
/var/log/syslog:
Sep  9 14:01:53 finn bluetoothd[24347]: Unable to get connect data for Hands-Free Voice gateway: getpeername: Transport endpoint is not connected (107)
Sep  9 14:01:53 finn bluetoothd[24347]: connect error: Connection refused (111)
Sep  9 14:01:53 finn bluetoothd[24347]: GLib: Source ID 751 was not found when attempting to remove it
Sep  9 14:01:56 finn bluetoothd[24347]: connect error: Connection refused (111)
Sep  9 14:02:10 finn bluetoothd[24347]: Unable to get connect data for Hands-Free Voice gateway: getpeername: Transport endpoint is not connected (107)
Sep  9 14:02:10 finn bluetoothd[24347]: connect error: Connection refused (111)
Sep  9 14:02:10 finn bluetoothd[24347]: GLib: Source ID 813 was not found when attempting to remove it
Sep  9 14:02:12 finn bluetoothd[24347]: connect error: Too many levels of symbolic links (40)
Sep  9 14:07:24 finn bluetoothd[24347]: Endpoint unregistered: sender=:1.194 path=/MediaEndpoint/A2DP_MPEG24_Source
Sep  9 14:07:24 finn bluetoothd[24347]: Endpoint unregistered: sender=:1.194 path=/MediaEndpoint/A2DPSource
Sep  9 14:07:24 finn bluetoothd[24347]: Endpoint unregistered: sender=:1.194 path=/MediaEndpoint/A2DP_MPEG24_Sink
Sep  9 14:07:24 finn bluetoothd[24347]: Endpoint unregistered: sender=:1.194 path=/MediaEndpoint/A2DPSink
Sep  9 14:07:24 finn bluetoothd[24347]: Terminating
Sep  9 14:07:24 finn bluetoothd[24347]: GLib: Source ID 879 was not found when attempting to remove it
Sep  9 14:07:24 finn bluetoothd[24347]: Stopping SDP server
Sep  9 14:07:24 finn bluetoothd[24347]: Exit


Here's the log when I try to connect to my phone audio sink:
Code:
Sep  9 17:49:51 finn bluetoothd[3705]: Can't open input device: No such file or directory (2)
Sep  9 17:49:51 finn bluetoothd[3705]: AVRCP: failed to init uinput for F4:F1:E1:D9:AD:04
Sep  9 17:49:56 finn bluetoothd[3705]: Unable to get io data for Hands-Free unit: getpeername: Transport endpoint is not connected (107)
Sep  9 17:50:01 finn CROND[6668]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons)
Sep  9 17:50:02 finn bluetoothd[3705]: Unable to get io data for Hands-Free unit: getpeername: Transport endpoint is not connected (107)


Many thanks in advance.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!


Last edited by VinzC on Sat Sep 09, 2017 6:42 pm; edited 4 times in total
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Sat Sep 09, 2017 3:17 pm    Post subject: Reply with quote

Hello,

maybe bluez-alsa do not allow you to manage Bluetooth audio devices like Pulseaudio do.

One thing you can try is to put a normal user to the lp group. If you read the file /etc/dbus-1/system.d/bluetooth.conf you will see that Dbus only allow the access to the Bluetooth sybsystem to users who are in the lp group.

After that, close your user sessions and open a new graphical one or maybe just from a Linux terminal out of X. Try to connect to your Radius speakers with this user using Blueman or bluetoothctl. I always manage Bluetooth as normal user.
_________________
Paul
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Sat Sep 09, 2017 3:42 pm    Post subject: Reply with quote

Hello Logicien.

I did indeed try to connect to my BT speaker using my normal account, which is part of groups lp and plugdev. I still have those error messages. And as far as I've read bluez-alsa is just a proxy to bluetooth audio. Here's how my bluetooth configuration file looks like from system DBUS.
/etc/dbus-1/system.d/bluetooth.conf:
<!-- This configuration file specifies the required security policies
     for Bluetooth core daemon to work. -->

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

  <!-- ../system.conf have denied everything, so we just punch some holes -->

  <policy user="root">
    <allow own="org.bluez"/>
    <allow send_destination="org.bluez"/>
    <allow send_interface="org.bluez.Agent1"/>
    <allow send_interface="org.bluez.HandsfreeAgent1"/>
    <allow send_interface="org.bluez.MediaEndpoint1"/>
    <allow send_interface="org.bluez.MediaPlayer1"/>
    <allow send_interface="org.bluez.Watcher1"/>
    <allow send_interface="org.bluez.ThermometerWatcher1"/>
    <allow send_interface="org.bluez.AlertAgent1"/>
    <allow send_interface="org.bluez.Profile1"/>
    <allow send_interface="org.bluez.HeartRateWatcher1"/>
    <allow send_interface="org.bluez.CyclingSpeedWatcher1"/>
    <allow send_interface="org.bluez.GattCharacteristic1"/>
    <allow send_interface="org.bluez.GattDescriptor1"/>
    <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
    <allow send_interface="org.freedesktop.DBus.Properties"/>

    <!-- These lines come from https://bbs.archlinux.org/viewtopic.php?id=166678&p=2 -->
    <allow send_destination="org.bluez.Manager"/>
    <allow receive_sender="org.bluez.Manager"/>
    <allow send_destination="org.bluez.Adapter"/>
    <allow receive_sender="org.bluez.Adapter"/>
    <allow send_destination="org.bluez.Device"/>
    <allow receive_sender="org.bluez.Device"/>
    <allow send_destination="org.bluez.Service"/>
    <allow receive_sender="org.bluez.Service"/>
    <allow send_destination="org.bluez.Database"/>
    <allow receive_sender="org.bluez.Database"/>
    <allow send_destination="org.bluez.Security"/>
    <allow receive_sender="org.bluez.Security"/>
  </policy>

  <policy at_console="true">
    <allow send_destination="org.bluez"/>
  </policy>

  <!-- allow users of lp group (printing subsystem) to communicate with bluetoothd -->
  <policy group="lp">
    <allow send_destination="org.bluez"/>
  </policy>

  <policy group="plugdev">
    <allow send_destination="org.bluez"/>
  </policy>

  <policy context="default">
    <deny send_destination="org.bluez"/>
  </policy>

</busconfig>

Just note that keywords here have "1" as a suffix and I don't know if that's intended or if it's a mistake. The prefix was there before I edited the file.

EDIT: I'm making a small progress! It turns out module uinput was *not* loaded automatically — I have no idea if/how it can be though. At least when I load module uinput I only have these errors:
/var/log/syslog:
Sep  9 18:02:05 finn bluetoothd[3705]: Unable to get io data for Hands-Free unit: getpeername: Transport endpoint is not connected (107)
Sep  9 18:02:09 finn kernel: [10861.260187] input: F4:F1:E1:D9:AD:04 as /devices/virtual/input/input20
Sep  9 18:02:18 finn bluetoothd[3705]: Unable to get io data for Hands-Free unit: getpeername: Transport endpoint is not connected (107)

_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Sat Sep 09, 2017 5:50 pm    Post subject: Reply with quote

At least I can play sound coming from my android phone. This means audio sink is working.

So far then only sourcing remains problematic. To be continued...
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Sat Sep 09, 2017 6:27 pm    Post subject: Reply with quote

OMG 8O ! Does it work!?

I found in Arch wiki that some devices don't support being paired from multiple operating systems... which is the case with my laptop: it once was installed with Arch/Manjaro then I wiped it and installed Gentoo, now.

I'm now getting errors trying to play audio files through A2DP using my BT speaker. Closing in...

EDIT: No longer getting errors but only noise on my BT speaker...

EDIT: I'm not getting noise with *.wav files so... IT WORKS! :D

Case closed.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum