GNOME Bugzilla – Bug 663044
Cannot reconnect paired device
Last modified: 2017-11-20 14:38:36 UTC
Hi. I have a Bluetooth headset that I use on my laptop. But every time I need to use it after it has been turned off, I have to go to the bluetooth settings and remove the prev. pair. Then I need to re-search and re-pair the device in order for it to connect. Efter it has been connected, I need to go to sound settings and change the output from the speakers to the headset. When I have the device paired, It does get saved, and it should be possible to use the connect button in the bluetooth applet dropdown in the panel to re-connect after the device has been turned off, but this does not work. Also the sound settings should restore the bluetooth settings when connecting to the bluetooth headset, instead of manually having to change these output settings every time I re-connect the headset. Packages being used: - gnome-bluetooth 3.2.0 - libbluetooth3 4.96 - libgnome-bluetooth8 3.2.0 - pulseaudio-module-bluetooth 1:1.0 OS: - Ubuntu 11.10 Desktop - Gnome Shell (Not Unity)
(In reply to comment #0) > Hi. > I have a Bluetooth headset that I use on my laptop. But every time I need to > use it after it has been turned off, I have to go to the bluetooth settings and > remove the prev. pair. <snip> > When I have the device paired, It does get saved, and it should be possible to > use the connect button in the bluetooth applet dropdown in the panel to > re-connect after the device has been turned off, but this does not work. Just how do you expect the headset to magically turn on when you click on a menu on your computer? So, _why_ do you need to remove the previous pairing? Doesn't the headset try to connect to your computer when turned on?
Created attachment 200703 [details] Screenshot of the bluetooth panel dropdown
I do not expect the headset to be turned on. I expect my computer to be able to reconnect to an already paired device when I turn bluetooth on and HAVE my headset turned on. Or at least letting me do it manually by clicking on the "On" button next to my paired device in the bluetooth list of paired devices, placed in the panel dropdown. But this does not work. The bluetooth software in Gnome will not let me reconnect to paired devices. I have to remove the pair and establish a new connection. In the screenshot that I have included, you can see the device "Jabra CLIPPER". On the right next to the text "Connection" there is a button "On/Off". If I press that, it goes to "On" and then right back to "Off". If refuses to reconnect. The same happends if I try from within the bluetooth settings. And also, when I connect to a headset, it would be nice if the computer automatically switched to use that headset for Input/Output. It's why anyone would connect a headset in the first place.
(In reply to comment #3) > I do not expect the headset to be turned on. I expect my computer to be able to > reconnect to an already paired device when I turn bluetooth on and HAVE my > headset turned on. The computer will not be the one connecting to your device, the device should be started after the computer's Bluetooth has been turned on. > Or at least letting me do it manually by clicking on the > "On" button next to my paired device in the bluetooth list of paired devices, > placed in the panel dropdown. Did you consider that the device might be refusing to be connected to? Please attach the debug output from bluetoothd which should be in /var/log/messages (or equivalent on your distribution). Attempting to connect to a turned off Bluetooth device shows: Nov 4 19:39:24 novo bluetoothd[1104]: Unable to get service record: Host is down (112) Nov 4 19:39:24 novo bluetoothd[1104]: bluetoothd[1104]: Unable to get service record: Host is down (112) > And also, when I connect to a headset, it would be nice if the computer > automatically switched to use that headset for Input/Output. It's why anyone > would connect a headset in the first place. This should be PulseAudio's job, and irrelevant to the discussion above.
The message I get is "Permission denied (13)". I use the same headset on my Android phone, and there it reconnects fine regardless of which of the devices I turn on first. So whatever "Permission denied" referrers to, I don't think it's a restriction in the headset. Is there another log file that contains some more specific information? I checked "dmesg" and found nothing.
(In reply to comment #5) > The message I get is "Permission denied (13)". That means that the headset refused your connection to it. > I use the same headset on my Android phone, You use it with your phone, at the same time? You can only use it with a single device at any time. > and there it reconnects fine > regardless of which of the devices I turn on first. So whatever "Permission > denied" referrers to, I don't think it's a restriction in the headset. It is, the refusal comes from the headset. > Is there another log file that contains some more specific information? I > checked "dmesg" and found nothing.
No I don't use it on both at the same time. I keep bluetooth turned off on my phone whenever it is not used. It eats my battery. But my phone is not refused from reconnecting, so I can't see why my computer would be? And it's not like I can't connect my computer at all. When I establish a new connection it works fine. The problem is only when I try to reconnect it after it has been paired.
I tried this pair thing with my phone as well, and I get the same problem. When I try to reconnect by sending a file, I get "Connection refused (111)" and no messages pops up on my phone.
It's the headset refusing the connection. In any case, if you want to discuss this further, feel free to send an e-mail out to the bluez-users list, as this isn't a gnome-bluetooth specific failure.
You say that this is not a Gnome problem? Well, first of all like I said above, it works in Android which also uses Bluez. Also, I downloaded a copy of a Kubuntu live disk. And KDE has no problems with the headset. When I turn off bluetooth on my computer and turn it back on, it reconnects automatically without problems. Also, it restores my audio output automatically to use the headset. Both desktops uses bluez and both desktops uses PulseAudio. And since I tested this in Kubuntu 11.10 and Ubuntu 11.10, the package versions is the same. So as I see it, gnome-bluetooth is the only thing that differs here? And gnome is the only one with the problem.
(In reply to comment #10) > You say that this is not a Gnome problem? > > Well, first of all like I said above, it works in Android which also uses > Bluez. It uses a different version of BlueZ, heavily patched, heavily forked, heavily buggy in its early versions. Nothing comparable. > Also, I downloaded a copy of a Kubuntu live disk. And KDE has no problems with > the headset. When I turn off bluetooth on my computer and turn it back on, it > reconnects automatically without problems. What reconnects to what? You need to help me a bit here, there are many ways in which 2 Bluetooth devices can interact, and I don't know whether you're talking about the headset connecting to the computer, the computer connecting to the headset, or you clicking on the "Connect" button somewhere (in which case, it's not automatic anymore). > Also, it restores my audio output > automatically to use the headset. KDE uses extensions to PulseAudio to do that, GNOME is waiting on PulseAudio to integrate those extensions to implement this functionality. > Both desktops uses bluez and both desktops uses PulseAudio. And since I tested > this in Kubuntu 11.10 and Ubuntu 11.10, the package versions is the same. > > So as I see it, gnome-bluetooth is the only thing that differs here? And gnome > is the only one with the problem. Have you verified that both use the same version of bluez and the same kernel? Did you pair the headset again under KDE? So, is the problem, again, that the "Connect" button works in KDE, but not in GNOME? If so, get the "object path" for the headset by running: BLUETOOTH_DEBUG=1 gnome-control-center bluetooth and clicking on the headset in the treeview (there will be a lot of information about the device printed, attach everything) Then run: gdbus call --system --dest org.bluez --object-path /org/bluez/1104/hci0/dev_00_22_A6_09_AA_AA --method org.bluez.Audio.Connect Replacing: /org/bluez/1104/hci0/dev_00_22_A6_09_AA_AA with the object path listed in the terminal output just above.
In KDE it auto connects when I turn on bluetooth on the computer while having my headset turned on. And it also auto connects when I turn on my headset while having bluetooth on my computer turned on. No need to press any connect buttons. When I launch bluetooth settings via your command above I get the fallowing output in the terminal (Attached file below) When I run the second command trying to connect I get the fallowing message Error: GDBus.Error:org.bluez.Error.Failed: Connect Failed (According to introspection data, you need to pass `')
Created attachment 200898 [details] Terminal dump
Could you please upgrade to gnome-bluetooth 3.2.1 so we can get some non-broken debug output? (all those warnings are fixed in that version) Once you've made the connection using KDE, could you check the output of this command: for i in org.bluez.Audio.GetProperties org.bluez.Headset.GetProperties org.bluez.AudioSink.GetProperties ; do echo $i: ; gdbus call --system --dest org.bluez --object-path /org/bluez/1104/hci0/dev_00_22_A6_09_90_A6 --method $i ; echo ; done (replacing the object path appropriately).
Ok I have build and installed version 3.2.1 and the error messages are gone. But the other thing does not work, I get this output. org.bluez.Audio.GetProperties: Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Method "GetProperties" with signature "" on interface "org.bluez.Audio" doesn't exist org.bluez.Headset.GetProperties: Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Method "GetProperties" with signature "" on interface "org.bluez.Headset" doesn't exist org.bluez.AudioSink.GetProperties: Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Method "GetProperties" with signature "" on interface "org.bluez.AudioSink" doesn't exist However, it seams like auto-connect does kind of work in gnome. I checked bluetooth settings while turning bluetooth on, and as long as the headset was turned on, gnome-bluetooth tried to auto-connect to it over and over again. So the problem seams to be only the "Connection refused" part and not gnome-bluetooth's lack of trying. I just don't see why kde-bluetooth and Anndroid's bluetooth can do it without getting a refused message when gnome-bluetooth can't.
Ok I have no idea how the bluetooth tools are build up in gnome, but this is strange. 1: I make a new connection to the headset. 2: I turn off bluetooth using the panel dropdown. 3: I turn on bluetooth using the panel dropdown. 4: It tries to connect to the headset, but it can't. 5: I try to press the connect button in panel dropdown. It fails to connect. 6: I try to press the connect button from within bluetooth settings, same problem. 7: I turn off bluetooth using the bluetooth settings. 8: I turn on bluetooth using the bluetooth settings, it auto-connects in 1 sec. 9: I turn off my headset. 10: I turn on my headset, again it auto-connects in 1 sec. 11: I try again to turn off bluetooth and back on using panel dropdown. Again I'm not able to connect in any way. 12: I turn off bluetooth using bluetooth settings and then back on, it auto-connects right away. 13: I try once more to turn off headset and back on, it auto-connects. For some reason, the panel dropdown is the problem. Avoiding using it in any way fixes the problem. I'm sure that bluetooth settings had the same problems as the panel dropdown before. I guess that the 3.2.0 to 3.2.1 update fixed bluetooth settings.
Please test with GNOME 3.10, which is based on BlueZ 5.x and includes a lot of bug fixes.