Bluetooth mouse fails to reconnect after suspend + resume

Bug #1481136 reported by Daniel Harvey
32
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Canonical Pocket Desktop
In Progress
High
Unassigned
Canonical System Image
Confirmed
High
John McAleely
bluez (Ubuntu)
In Progress
High
Konrad Zapałowicz

Bug Description

I can connect the bluetooth mouse (Logitech M557) using the GUI and the device works properly.

However, after suspend and resume the mouse fails to reconnect. It does "attempt" to reconnect, in that I see the padlock flashes momentarily onto the bluetooth icon on the toolbar applet. Similarly, if the Bluetooth Settings dialog is open the devices flashes momentarily bold as if connected. Both effects happen whenever the mouse is used (movement or mouse click) but the device does not connect.

I have a workaround, which is to remove the device and pair it using the command line as follows:

sudo bluez-test-device remove 00:1F:20:EF:B1:00
sudo bluez-simple-agent hci0 00:1F:20:EF:B1:00 remove
sudo bluez-simple-agent hci0 00:1F:20:EF:B1:00
sudo bluez-test-device trusted 00:1F:20:EF:B1:00 yes
sudo bluez-test-input connect 00:1F:20:EF:B1:00

Once paired manually in this manner the devices appears in the Bluetooth Settings as normal an successfully reconnects when resuming.

I'm submitted a new bug as this is similar but not the same as other bugs reported. In particular the workarounds presented in other bugs do not work for me and the workaround I'm using was not suggested in other cases.

Thanks.

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: bluez 4.101-0ubuntu25
ProcVersionSignature: Ubuntu 3.19.0-25.26-generic 3.19.8-ckt2
Uname: Linux 3.19.0-25-generic x86_64
ApportVersion: 2.17.2-0ubuntu1.1
Architecture: amd64
CurrentDesktop: Unity
Date: Tue Aug 4 09:53:18 2015
InstallationDate: Installed on 2014-01-23 (557 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1)
InterestingModules: rfcomm bnep btusb bluetooth
MachineType: TOSHIBA KIRA
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.19.0-25-generic.efi.signed root=UUID=a0fdb0ee-bbeb-4872-8e79-1a785c304e91 ro libata.force=noncq vesafb.invalid=1 splash quiet nopat vt.handoff=7
SourcePackage: bluez
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 02/15/2013
dmi.bios.vendor: TOSHIBA
dmi.bios.version: Version 1.30
dmi.board.asset.tag: 0000000000
dmi.board.name: KIRA
dmi.board.vendor: TOSHIBA
dmi.board.version: Version A0
dmi.chassis.asset.tag: 0000000000
dmi.chassis.type: 10
dmi.chassis.vendor: TOSHIBA
dmi.chassis.version: Version 1.0
dmi.modalias: dmi:bvnTOSHIBA:bvrVersion1.30:bd02/15/2013:svnTOSHIBA:pnKIRA:pvrPSU7FA-00T00K:rvnTOSHIBA:rnKIRA:rvrVersionA0:cvnTOSHIBA:ct10:cvrVersion1.0:
dmi.product.name: KIRA
dmi.product.version: PSU7FA-00T00K
dmi.sys.vendor: TOSHIBA
hciconfig:
 hci0: Type: BR/EDR Bus: USB
  BD Address: B4:B6:76:C4:A2:88 ACL MTU: 310:10 SCO MTU: 64:8
  UP RUNNING PSCAN
  RX bytes:587136 acl:36542 sco:0 events:271 errors:0
  TX bytes:2913 acl:109 sco:0 commands:81 errors:0
mtime.conffile..etc.bluetooth.main.conf: 2015-08-01T14:24:23.630880

Revision history for this message
Daniel Harvey (daniel.harvey) wrote :
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in bluez (Ubuntu):
status: New → Confirmed
Revision history for this message
kevin gunn (kgunn72) wrote :

touching this bug as on our unity8 windowed mode i see this as
1. go to system settings
2. select connect device
3. select mouse detected
4. select connect
(put user back to bt first view)
expected: to be connected
result: have to go back to the mouse bt page and hit "connect" again.
this is really obvious, b/c the mouse presence is being used for converting into window mode

Changed in qtmir (Ubuntu):
status: New → Opinion
tags: added: pd
Changed in bluez (Ubuntu):
importance: Undecided → High
Changed in qtmir (Ubuntu):
importance: Undecided → High
kevin gunn (kgunn72)
no longer affects: qtmir (Ubuntu)
no longer affects: qtmir
Revision history for this message
Simon Fels (morphis) wrote :

We now have two things mixed in here.

1. Device doesn't connect directly after it got paired in the UI and needs a second user step to get connected
2. A keyboard doesn't reconnect after it turned off or the using device went to sleep

First problem needs fixes in ubuntu-system-settings which I have at https://code.launchpad.net/~morphis/ubuntu-system-settings/fix-device-actions

Second problem requires to backport fixes from upstream bluez to correctly enable the reconnect mode of HID devices.

Changed in bluez (Ubuntu):
assignee: nobody → Simon Fels (morphis)
status: Confirmed → In Progress
kevin gunn (kgunn72)
Changed in canonical-pocket-desktop:
importance: Undecided → High
status: New → In Progress
Revision history for this message
Daniel Harvey (daniel.harvey) wrote :

Simon, your "two things" analysis seems to fit my observations. I'm not seeing the issue Kevin describes.

I'm only seeing what I originally reported (your number 2 above).

Revision history for this message
Simon Fels (morphis) wrote :

Fixes for 1. and 2. are in Silo 009 and 059. Wily should be not affected as we already landed bluez5 there.

@Daniel: If you want to test get and install packages from silo 059 in your vivid desktop installation.

Revision history for this message
Kaarel (krlk89) wrote :

I have the same Bluetooth mouse and had the same issue, a script fixed this problem for me (http://ubuntuforums.org/showthread.php?t=1387211).

Revision history for this message
kevin gunn (kgunn72) wrote :

it's better, but i still see failure about 25% of the time

Changed in canonical-pocket-desktop:
importance: High → Medium
Changed in bluez (Ubuntu):
importance: High → Medium
Simon Fels (morphis)
tags: added: after-bluez5
Revision history for this message
Simon Fels (morphis) wrote :

Can somebody retest this with bluez5 landed in rc-proposed?

Changed in canonical-pocket-desktop:
assignee: nobody → Simon Fels (morphis)
Simon Fels (morphis)
tags: added: bt-retest
kevin gunn (kgunn72)
Changed in canonical-pocket-desktop:
importance: Medium → High
Changed in bluez (Ubuntu):
importance: Medium → High
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

FWIW my trackpad connects every time on N4

Changed in canonical-devices-system-image:
assignee: nobody → John McAleely (john.mcaleely)
importance: Undecided → High
milestone: none → ww04-2016
status: New → Confirmed
Revision history for this message
kevin gunn (kgunn72) wrote :

I'm seeing this with an HP bt mouse and a logitech keyboard.
I'd say 30% of the time.
I was testing N7 convergence pretty heavily yesterday.
I was having to hit "forget device" then reconnect.

Changed in canonical-devices-system-image:
milestone: ww04-2016 → ww08-2016
no longer affects: linux (Ubuntu)
Revision history for this message
kevin gunn (kgunn72) wrote :

I'm not sure if this needs a new bug or if i am correct in adding this information.
But I made a quick video to show exactly the problem i'm seeing

https://www.youtube.com/watch?v=Mkql0gSq1RQ

hope that helps.

Changed in canonical-devices-system-image:
milestone: ww08-2016 → backlog
Revision history for this message
Simon Fels (morphis) wrote :

@kgunn: it looks like you're enabling the pairing mode on your BT keyboard again (long press of the connect button) in your video. If that is the case the keyboard will erase its part of the pairing where the phone will still keep its part. If the phone now tries to reconnect the connection simply fails. We don't have a user-side support story yet for this case to show some tips or to help him removing the device and repair. However reinitiate the pairing from the accessory side will always render the the remembered device information on the phone unusable and you have to remove it.

Can you check if a long press on your BT keyboard triggers the pairing process or does a simple connect?

Changed in bluez (Ubuntu):
assignee: Simon Fels (morphis) → Konrad Zapałowicz (kzapalowicz)
Changed in canonical-pocket-desktop:
assignee: Simon Fels (morphis) → nobody
Revision history for this message
Daniel Harvey (daniel.harvey) wrote :

I'm still seeing this issue with 16.04.

Running the rkfill suggested by some does not work:

rfkill block bluetooth
rfkill unblock bluetooth

The only thing that works is running the following after the system resumes:

service bluetooth restart

Note that if I have rfkill'ed, then after I have restarted the service, I need to unblock again before the bluetooth will work again.

Revision history for this message
Ubfan (ubfan1) wrote :

The last update of Ubuntu 16.04 (kernel 4.4.0-36 to 4.4.0-38) reduced the failure to reconnect of my Microsoft Sculpt Comfort BT mouse from 90% to 15%. Something improved a lot. The fix I have been using was to pull up the settings/bluetooth, turn off bluetooth (it says on when the window is started), turn it back on, and up in the title bar notifications, turn the bluetooth on there too (it comes back from the suspend in the off setting and is not changed by the bluetooth settings window). Then it reconnects. Just trying to turn bluetooth back on from the title app results in the momentary padlock flashing described in initial post.

Revision history for this message
Ubfan (ubfan1) wrote :

Ubuntu 16.04 patched to date.
Below is the sequence of re-enabling the bluetooth mouse after suspend. Note that
either of two different things being blocked, tpacpi_bluetooth_sw, and hci0, will
keep the mouse from working.

After a resume from suspend, the title bar bluetooth icon is greyed out.
$ rfkill list
0: tpacpi_bluetooth_sw: Bluetooth
    Soft blocked: yes
    Hard blocked: no
2: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no

From title bar bluetooth icon, started bluetooth settings, and in the
settings, turned the bluetooth switch off, then on. Title bar icon disappeared,
then reappeared greyed out.
$ rfkill list
0: tpacpi_bluetooth_sw: Bluetooth
    Soft blocked: no
    Hard blocked: no
2: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
26: hci0: Bluetooth
    Soft blocked: yes
    Hard blocked: no

After turning on the bluetooth switch from the title bar bluetooth icon
the icon became white, and connected with the bluetooth mouse.
$ rfkill list
0: tpacpi_bluetooth_sw: Bluetooth
    Soft blocked: no
    Hard blocked: no
2: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
26: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This particular bug has already been reported and is a duplicate of bug 1246981, so it is being marked as such. Please look at the other bug report to see if there is any missing information that you can provide, or to see if there is a workaround for the bug. Additionally, any further discussion regarding the bug should occur in the other report. Feel free to continue to report any other bugs you may find.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.