Bluetooth ON/OFF button switches OFF automatically

Bug #1248720 reported by alkamid on 2013-11-06
76
This bug affects 16 people
Affects Status Importance Assigned to Milestone
OEM Priority Project
High
Unassigned
One Hundred Papercuts
Medium
Unassigned
gnome-control-center (Ubuntu)
Medium
Unassigned
Trusty
Medium
Unassigned
unity-control-center (Ubuntu)
Medium
Unassigned
Trusty
Medium
Bin Li

Bug Description

[Impact]

 * On trusty, we met this issue, you can't turn on/off bluetooth, it affected the other OEM project which needed by Lenovo, HP and Dell.

[Test Case]

 * open the unity-control-center, and select 'Bluetooth', try to turn on/off in top checkbox.

I am on ThinkPad T61 with Ubuntu 13.10 installed. I disabled bluetooth on startup by adding:

"echo disable > /proc/acpi/ibm/bluetooth"

to /etc/rc.local. When I open gnome-control-center -> Bluetooth and click on the "ON/OFF" switch button, it switches on for a fraction of a second and then switches back to off. Below are dmesg lines corresponding to this event:

[ 94.028110] usb 3-1: new full-speed USB device number 5 using uhci_hcd
[ 94.194320] usb 3-1: New USB device found, idVendor=0a5c, idProduct=2110
[ 94.194325] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 94.194328] usb 3-1: Product: BCM2045B
[ 94.194330] usb 3-1: Manufacturer: Broadcom Corp
[ 94.388169] usb 3-1: USB disconnect, device number 5

The workaround is to type "turn connectivity on/off" combination of my keyboard (FN+F5) -- then both wireless and bluetooth go off, and when I type it again, bluetooth comes back ON.

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: gnome-control-center 1:3.6.3-0ubuntu45
ProcVersionSignature: Ubuntu 3.11.0-12.19-generic 3.11.3
Uname: Linux 3.11.0-12-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.12.5-0ubuntu2.1
Architecture: amd64
Date: Wed Nov 6 20:41:45 2013
EcryptfsInUse: Yes
InstallationDate: Installed on 2013-10-18 (19 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1)
MarkForUpload: True
ProcEnviron:
 LANGUAGE=en_GB:en
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: gnome-control-center
UpgradeStatus: No upgrade log present (probably fresh install)
usr_lib_gnome-control-center:
 activity-log-manager 0.9.7-0ubuntu4
 deja-dup 27.3.1-0ubuntu1
 gnome-control-center-datetime 13.10.0+13.10.20131023.2-0ubuntu1
 gnome-control-center-signon 0.1.7~+13.10.20130724.1-0ubuntu1
 gnome-control-center-unity 1.3+13.10.20131004-0ubuntu1

[Regression Potential]

 * The patch was already accepted in lp:unity-control-center, just cherry picked into trusty, so no potential regression.

alkamid (adamkli) wrote :
Launchpad Janitor (janitor) wrote :

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

Changed in gnome-control-center (Ubuntu):
status: New → Confirmed
Sergio Benjamim (sergio-br2) wrote :

There is a workaround for this:

sudo rfkill unblock bluetooth

tags: added: trusty
Changed in gnome-control-center (Ubuntu):
importance: Undecided → Medium
Changed in hundredpapercuts:
importance: Undecided → Medium
status: New → Confirmed

I'm seeing this bug on Ubuntu GNOME 13.10

Chris Kankiewicz (phlak) wrote :

This bug is also present in Ubuntu 14.04 as of 2014-03-27.

Corasol (corasol) wrote :

Same problem on a Thinkpad X230 running Ubuntu 14.04. This bug was not present on 13.10.

Joris Claassen (jorisc90) wrote :

Happens on a Thinkpad T440s running Ubuntu Gnome 14.10.

Yu Ning (yuningdodo) wrote :

The issue can also be reproduced on my 14.04, by adding some prints in the source code I found it's cause by a logic trap:

1. we click the switch in the u-c-c bt panel to turn on the bt
2. in the widget's "notify::active" callback it set the BT state to unblocked
3. the BT "state-changed" callback is triggered with {state: unblocked, powered: off}, in this callback it will update the UI
4. in such a case step 2 is triggered again but this time it set the BT state to blocked.

So after a long repetition the final status is BT is turned off again. Actually I'm wondering if it will run into an endless dead loop under special condition.

Anyway in my side I could fix, or maybe only workaround, the issue with the attached patch, it will temporarily block the widget's "notify::active" callback in the bt killswitch callbacks, so we won't run into step 2 after step 3.

Yu Ning (yuningdodo) wrote :

forgot to mention the patch is for u-c-c, and I only have it tested on the trusty branch: lp:unity-control-center/14.04

Launchpad Janitor (janitor) wrote :

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

Changed in unity-control-center (Ubuntu):
status: New → Confirmed

The attachment "block-power-callback-unless-its-triggered-by-user.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
GH (chili-g) wrote :

vivid 15.04 Beta 2 has same bug on lenovo t450s.
The "sudo rfkill unblock bluetooth" workaround seems to work.

Yu Ning (yuningdodo) wrote :

Hi guys, I have converted my patch (comment #8) to a merge proposal, could anyone help review it? Thanks in advance.

https://code.launchpad.net/~yuningdodo/unity-control-center/unity-control-center.lp1248720-block-power-callback-unless-its-triggered-by-user/+merge/255041

Sebastien Bacher (seb128) wrote :

do you know if that's an issue impacting upstream as well and if it could be sent to GNOME for gnome-control-center?

Yu Ning (yuningdodo) wrote :

Let me install a gnome desktop and have a try. Will update later.

Yu Ning (yuningdodo) wrote :

I installed gnome desktop on ubuntu trusty, and can also reproduce the issue in gnome-control-center.

The package version is:
gnome-control-center 1:3.6.3-0ubuntu56.1

$ gnome-control-center --version
gnome-control-center 3.6.3

Yu Ning (yuningdodo) wrote :

I'll also try with latest upstream version.

Yu Ning (yuningdodo) wrote :

The issue is also reproduced in ubuntu gnome daily image [1], the package version is 1:3.14.2-2ubuntu3

[1]: http://cdimage.ubuntu.com/ubuntu-gnome/daily-live/20150407/

Yu Ning (yuningdodo) wrote :

Tested with gnome live [1], the issue is not reproduced, the g-c-c version is 3.16.0.

I also checked the source code [2], looks like the issue is already fixed via a redesign [3]. The upstream tracker for the redesign is https://bugzilla.gnome.org/show_bug.cgi?id=719565

[1]: https://download.gnome.org/misc/promo-usb/gnome-3.16.x86_64.iso
[2]: https://git.gnome.org/browse/gnome-control-center/tree/panels/bluetooth/cc-bluetooth-panel.c
[3]: https://git.gnome.org/browse/gnome-control-center/commit/?id=28fecc01c46a7b082f9746744c938e499a522e4f

Sebastien Bacher (seb128) wrote :

@Yu, thanks for testing with the newest version, did the redesign address it the same was as you did or differently? In any case should be fine to use your change

Yu Ning (yuningdodo) wrote :

@Sebastien, I just made a quick check for the redesigned code, yes, it does similar blocking&unblocking on power_callback(), that is also what my patch does.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity-control-center - 15.04.0+15.04.20150410-0ubuntu1

---------------
unity-control-center (15.04.0+15.04.20150410-0ubuntu1) vivid; urgency=medium

  [ Yu Ning ]
  * Block power callback unless it's triggered by the user. (LP:
    #1248720)
 -- CI Train Bot <email address hidden> Fri, 10 Apr 2015 14:09:49 +0000

Changed in unity-control-center (Ubuntu):
status: Confirmed → Fix Released
Nara Huang (narahuang) wrote :

I could also reproduce this issue on 14.04.2,
unity-control-center version: 14.04.3+14.04.20140922-0ubuntu1

affects: gnome-control-center → oem-priority
Bin Li (binli) wrote :

@seb128,

 Could we also put this patch into trusty? Thanks!

Changed in oem-priority:
importance: Undecided → High
Sebastien Bacher (seb128) wrote :

@Bin, yes that should be fine, can you update the bug to be SRU compliant (impact/test case/regression potential statements, see https://wiki.ubuntu.com/StableReleaseUpdates) and do a merge proposal against lp:unity-control-center/14.04?
Note that I'm on holidays starting today so you might want to subscribe sponsors or ask on #ubuntu-desktop for sponsoring once it's ready for review

Bin Li (binli) wrote :

@seb128,

 Sorry for late, I've requested a merge request, thanks for your time!

Bin Li (binli) on 2015-09-14
description: updated
Changed in unity-control-center (Ubuntu Trusty):
assignee: nobody → Bin Li (binli)
status: New → In Progress
Will Cooke (willcooke) wrote :

Hi Bin, we still need the standard info as per comment #25. We can sponsor the update but it will be rejected without the information requested. Let us know once that's done and we will move it forward on our side.

Bin Li (binli) wrote :

@Will,

 I have updated the description before, but not obviously, I re-updated again, is it ok? :)
 And the source code was already approved now.

 Thanks a lot!

description: updated
Sebastien Bacher (seb128) wrote :

thanks, I've sponsored the SRU, it's waiting for review next

Launchpad Janitor (janitor) wrote :

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

Changed in gnome-control-center (Ubuntu Trusty):
status: New → Confirmed
yingzs (yingzs) on 2015-10-06
Changed in gnome-control-center (Ubuntu):
status: Confirmed → New
Changed in gnome-control-center (Ubuntu):
status: New → Confirmed
yingzs (yingzs) on 2015-10-06
Changed in gnome-control-center (Ubuntu):
status: Confirmed → New
Bin Li (binli) on 2015-10-13
Changed in unity-control-center (Ubuntu Trusty):
status: In Progress → Fix Committed

Hello alkamid, or anyone else affected,

Accepted unity-control-center into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/unity-control-center/14.04.3+14.04.20150916-0ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Changed in gnome-control-center (Ubuntu Trusty):
importance: Undecided → Medium
Changed in unity-control-center (Ubuntu):
importance: Undecided → Medium
Changed in unity-control-center (Ubuntu Trusty):
importance: Undecided → Medium

Tried to reproduce the error on my Dell M15 with Broadcom 4313 wireless card, but I couldn't. It seems the bug only affects Thinkpad notebooks. I tried to force the bug anyway but couldn't find an equivalent of /proc/acpi/ibm/bluetooth for my device. 😞 Hoping somebody'd test and verify the patch soon, so that our friends on Thinkpads can get a better Ubuntu desktop experience.

Bin Li (binli) wrote :

I've installed the new package from trusty-proposed, the version is 20150916-0ubuntu1.

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity-control-center - 14.04.3+14.04.20150916-0ubuntu1

---------------
unity-control-center (14.04.3+14.04.20150916-0ubuntu1) trusty; urgency=medium

  [ Ning Yu ]
  * Block power callback unless it's triggered by the user.(LP: #1248720)

  [ CI Train Bot ]
  * No-change rebuild.

 -- Sebastien Bacher <email address hidden> Wed, 16 Sep 2015 09:33:42 +0000

Changed in unity-control-center (Ubuntu Trusty):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for unity-control-center has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Ara Pulido (ara) on 2016-01-18
Changed in oem-priority:
status: New → Fix Released
Launchpad Janitor (janitor) wrote :

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

Changed in gnome-control-center (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers