Indicator disappears entirely when disabling / turning off bluetooth

Bug #1126108 reported by Martin Pitt on 2013-02-15
320
This bug affects 79 people
Affects Status Importance Assigned to Milestone
indicator-bluetooth (Ubuntu)
Medium
Unassigned

Bug Description

Bug 1116289 made the BT indicator disappear when there is no hardware. However, with that version I now also have it disappear when my existing BT hardware is merely disabled. I. e. I disable BT from the indicator, then it disappears, leaving me no obvious method to turn it back on again. I can re-enabble it in control-center, and then the indicator comes back.

I think when it sees no actual BT hardware it ought to check rfkill whether there is disabled BT hardware:

$ grep -r . /sys/class/rfkill/rfkill0/{type,state,soft,persistent}
/sys/class/rfkill/rfkill0/type:bluetooth
/sys/class/rfkill/rfkill0/state:1
/sys/class/rfkill/rfkill0/soft:0
/sys/class/rfkill/rfkill0/persistent:1

After disabling BT from the indicator, "soft" changes to 1:

$ grep -r . /sys/class/rfkill/rfkill0/{type,state,soft,persistent}
/sys/class/rfkill/rfkill0/type:bluetooth
/sys/class/rfkill/rfkill0/state:0
/sys/class/rfkill/rfkill0/soft:1
/sys/class/rfkill/rfkill0/persistent:1

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: indicator-bluetooth 0.0.6-0ubuntu1
ProcVersionSignature: Ubuntu 3.8.0-6.13-generic 3.8.0-rc7
Uname: Linux 3.8.0-6-generic x86_64
ApportVersion: 2.8-0ubuntu4
Architecture: amd64
Date: Fri Feb 15 12:08:26 2013
EcryptfsInUse: Yes
InstallationDate: Installed on 2013-02-08 (7 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Alpha amd64 (20130207.1)
MarkForUpload: True
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
SourcePackage: indicator-bluetooth
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Martin Pitt (pitti) wrote :
Martin Pitt (pitti) wrote :

Note that "sudo hcitool dev" and /sys/class/bluetooth/ are both empty once the soft rfkill is enabled. I assume it's only looking at sysfs, not rfkill?

Martin Pitt (pitti) wrote :

For Sebastien the indicator is greyed out when he disables BT. For him, hcitool dev is empty as well, but /sys/class/bluetooth/ still has a hci0 device.

Robert Ancell (robert-ancell) wrote :

For me also the indicator just greys out when disabled - the logic in indicator-bluetooth is visible if gnome-bluetooth shows any adapters present. We could use the logic "visible = n_adapters > 0 || locked" though I don't know if there's the case where a lock could be active and there's no adapters.

Martin Pitt (pitti) wrote :

That's the case for me -- when I soft or hard killswitch bluetooth, the adapter disappears entirely; that's what I meant with empty /sys/class/bluetooth/.

Robert Ancell (robert-ancell) wrote :

Martin - I mean the case where you have no bluetooth adapter at all (physically), but you have the killswitch enabled. In that case you would see a greyed out indicator but it would be misleading. I don't know if the kernel doesn't allow this case.

Robert Ancell [2013-02-18 9:33 -0000]:
> Martin - I mean the case where you have no bluetooth adapter at all
> (physically), but you have the killswitch enabled. In that case you
> would see a greyed out indicator but it would be misleading. I don't
> know if the kernel doesn't allow this case.

Ah, but then you shouldn't have a /sys/class/rfkill/rfkill*/type with
"bluetooth"?

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

Changed in indicator-bluetooth (Ubuntu):
status: New → Confirmed
Shiba (shiba89) wrote :

I have the same problem on my system. Using rfkill I have a sony-bluetooth and a hci0 devices, the latter only existing if the former is not blocked. These are the three possible scenarios:

1) Physical switch on, bluetooth on
Behavior: correct
The indicator is shown regularly.
rfkill:
1: sony-bluetooth: Bluetooth
        Soft blocked: no
        Hard blocked: no
3: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no

2) Physical switch on, bluetooth off
Behavior: wrong
There is no indicator in the panel, though it is needed to soft unblock the bluetooth.
rfkill:
1: sony-bluetooth: Bluetooth
        Soft blocked: yes
        Hard blocked: no

3) Physical switch off
Behavior: uncertain
There is no indicator in the panel, as it can't be used to switch the bluetooth on. However it may be useful to notify the presence of a bluetooth adapter.
1: sony-bluetooth: Bluetooth
        Soft blocked: yes
        Hard blocked: yes

Giovanni Mellini (merlos) wrote :

This is the output of my rfkill

giovanni@trumpet-fish:~$ sudo rfkill list
0: hp-wifi: Wireless LAN
 Soft blocked: no
 Hard blocked: no
1: hp-bluetooth: Bluetooth
 Soft blocked: no
 Hard blocked: no
2: hci0: Bluetooth
 Soft blocked: no
 Hard blocked: no
3: phy0: Wireless LAN
 Soft blocked: no
 Hard blocked: no

The indicator is not shown and I cannot re-enable in the control center.
I verified using dconf-editor that com.canonical.indicator.bluetooth.visible is set to true.
This happened to me after disabling BT from indicator.

Shiba (shiba89) wrote :

@Giovanni: for me it works enabling it twice in control center (after turning it off, on → off → on).

Giovanni Mellini (merlos) wrote :

@Fabrizio: this trick don't work for me. I cannot use BT anymore

Adolfo Jayme (fitojb) on 2013-03-30
Changed in indicator-bluetooth (Ubuntu):
importance: Undecided → Medium
Robert Ancell (robert-ancell) wrote :

Martin or others, can you try lp:~robert-ancell/indicator-bluetooth/dont-hide-on-rfkill and see if that has the expected behaviour?

Shiba (shiba89) wrote :

@Robert
Works for me, the indicator is shown correctly for both hard and soft block.

Martin Pitt (pitti) wrote :

Works for me, too, both soft and hard rfkill. Thank you!

Eric Nemchik (eric-nemchik) wrote :

im also affected by this as many described above, if BT is turned off by the indicator, it disappears, i can enable it again in settings to get the indicator back

Shiba (shiba89) wrote :

@Robert I see that this has not been merged upstream yet. Do you know why?

AliNâ (alinajafi) on 2013-06-29
tags: added: saucy
AliNâ (alinajafi) wrote :

@Robert Ancell
I’m not much technical. Is there any guide for me to try your package?

Lars Schütze (lschuetze) wrote :

I downloaded 13.10 Beta final and have all updates installed. On my Samsung I have an Network controller: Broadcom Corporation BCM43225 802.11b/g/n (rev 01).

If I shutdown bluetooth via indicator the indicator disappears.

laze@ubutron:~$ sudo rfkill list
[sudo] password for laze:
1: samsung-wlan: Wireless LAN
 Soft blocked: no
 Hard blocked: no
2: samsung-bluetooth: Bluetooth
 Soft blocked: yes
 Hard blocked: no
3: phy0: Wireless LAN
 Soft blocked: no
 Hard blocked: no

laze@ubutron:~$ sudo apt-cache showpkg indicator-bluetooth
Package: indicator-bluetooth
Versions:
0.0.6+13.10.20131004-0ubuntu1 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_saucy_main_binary-amd64_Packages) (/var/lib/dpkg/status)

Ask if you need any more information.

Shiba (shiba89) wrote :

Still broken for me too in 13.10. Moreover the patch in #13 cannot be applied anymore.

Cas (calumlind) on 2013-11-18
summary: - 0.0.6 regression: disappears entirely when disabling BT
+ Indicator disappears entirely when disabling / turning off bluetooth

Patch in #13 works for me... Just need to restart after installing for it to work. and it works until the next time system updates, following which, I need to run sudo dpkg -i again

Cas (calumlind) wrote :

@charlemagne86 The patch in #13 is for an older version of indicator-bluetooth, the latest code is quite different so the patch will not work.

I have been looking in the code and the newly added 'supported' option would work and thought I would update the ticket to show that it is possible with simple changes.

=== modified file 'src/bluez.vala'
   void on_default_adapter_changed (string? object_path)
   {
     clear_adapter ();
+ supported = object_path != null;

=== modified file 'src/desktop.vala'
- visible = bluetooth.enabled && settings.get_boolean("visible");
+ visible = (bluetooth.enabled || bluetooth.supported) && settings.get_boolean("visible");

However this uncovers a bug whereby turning bluetooth on/off from indicator or settings works only once then fails on further attempts and stays off with only a restart of the bluetooth service fixing the issue.

The requirement that hiding the indicator when no adaptor is physically available is also possible but need to do a bit more testing as the above issue confused things.

ramgorur (code-icted) wrote :

I am having same problem on ThinkPad S431 (after upgrade), the comment #13 did not solve.

tags: added: trusty
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package indicator-bluetooth - 0.0.6+14.04.20140124-0ubuntu1

---------------
indicator-bluetooth (0.0.6+14.04.20140124-0ubuntu1) trusty; urgency=low

  [ Charles Kerr ]
  * Gets us a little closer to the spec in two ways: 1. Indicator
    Visibility On the desktop, the indicator's header icon is visible
    whenever a default adapter is available (whether the adapter is
    powered or not) and the user's preference settings call for a
    visible Bluetooth indicator. On the phone, the indicator's header
    icon is visible whenever a default adapter is available *and* the
    adapter is powered. 2. Header Icon If Bluetooth is off, the header
    icon now uses the "bluetooth-disabled" icon. If Bluetooth is on, it
    now uses the "bluetooth-active" icon. If Bluetooth is on and has a
    connected device, it now uses the "bluetooth-paired" icon. (LP:
    #1126108)
  * Switching DBus service to an Upstart Job.

  [ Robert Ancell ]
  * Use unity-control-center if it is available. (LP: #1257505)

  [ Ubuntu daily release ]
  * Automatic snapshot from revision 79
 -- Ubuntu daily release <email address hidden> Fri, 24 Jan 2014 10:59:56 +0000

Changed in indicator-bluetooth (Ubuntu):
status: Confirmed → Fix Released

Just updated and I can confirm that this bug is now fixed.

Fabian (waving-gradient) wrote :

that's cool. how can i upgrade?

Edwin Pujols (edwinpm5) wrote :

I got the update, but when I run:

      /usr/lib/i386-linux-gnu/indicator-bluetooth/indicator-bluetooth-service

I get:

** (process:5350): CRITICAL **: bluez.vala:104: GDBus.Error:org.bluez.Error.NoSuchAdapter: No such adapter

And the indicator won't be shown. Actually, I haven't seen the Bluetooth indicator in a very long time (I am on trusty-proposed and my laptop is an hp nx7400).

Cas (calumlind) wrote :

@Edwin That has nothing to do with this bug then, please submit a new bug.

Edwin Pujols (edwinpm5) wrote :

@Cas Funny, but after cold booting the indicator is functional. Very nice :)

Shiba (shiba89) wrote :

It doesn't disappear anymore, but turning bluetooth off using the indicator only brings down the interface (hci0 on my PC) and it doesn't actually power off the adapter (according to rfkill). Is that the desired behavior?

Edwin Pujols (edwinpm5) wrote :

After I started my laptop today the indicator wasn't shown. I guess this is a separate issue. I mean, it's not that it disappears after switching the bluetooth off, but that it isn't shown after logging in.

Edwin Pujols (edwinpm5) wrote :

Please, check out bug #1283621, which I filed (not sure if it's a duplicate). Looks like it's a problem with newer versions of the kernel/udev.

Waldemar Szostak (wszostak) wrote :

The indicator actually still disappears in 14.04 (indicator-bluetooth: 0.0.6+14.04.20140207-0ubuntu2 + 3.13.0-37-generic #64-Ubuntu SMP)..

keldo (keldo) wrote :

I am facing this issue on my 15.10 x64 install. I expected the bluetooth and the WiFi indicators to exhibit the same behavior, i.e., grayed out but visible when in the off/disabled state. However, the bluetooth icon completely disappears and I have to reenable bluetooth from System Settings > Hardware to get it back.

Is this by design or is it a bug?

generalnie (general-nie) wrote :

I'm still having this issue on 16.04. Is there any workaround to make bluetooth indicator always visable? I'm turning it on and off many times every day and it's bugging me a lot.

Dave (qorpus) wrote :

Also having this problem in 16.04, if the bluetooth is off, the icon dissappears, if its on, it seems fine.

Gabriel Smith (yodal) wrote :

Having similar problem in 16.04 as well, though the reason might be different.

With everything enabled this is the output of rfkill:

2: phy0: Wireless LAN
 Soft blocked: no
 Hard blocked: no
5: Toshiba Bluetooth: Bluetooth
 Soft blocked: no
 Hard blocked: no
7: hci0: Bluetooth
 Soft blocked: no
 Hard blocked: no

When either the switch in System Settings or the Indicator menu is turned Off Toshiba Bluetooth is soft blocked, hci0 disappears, and the Indicator icon disappears. When the System Settings switch is On, Toshiba Bluetooth unblocked, hci0 appears soft blocked, and the Indicator icon appears with it's menu switch Off. When the Indicator menu switch is On hci0 is unblocked.

It appears that each switch is grabbing the earliest bluetooth radio to effect rather than just one.

Ryan (carbonfreeze) wrote :

This issue also effects 16.10.

generalnie (general-nie) wrote :

This bug is marked as fixed, so if you still have this problem please say you are affected at:
https://bugs.launchpad.net/ubuntu/+source/indicator-bluetooth/+bug/1595695

Iiro Laiho (iiro) wrote :

Still affects xenial. Should the fix be backported?

Iiro Laiho (iiro) wrote :

And my machine is a Latitude E6320 and it has a Dell DW375 internal USB Bluetooth adapter.

Kenny Worden (kenny-worden) wrote :

Having this issue on yakkety (16.10) as well.

leo (leoetchaas) wrote :

This bug is (sadly ?) marked as fixed, so if you still have this problem like me please say you are affected at:
https://bugs.launchpad.net/ubuntu/+source/indicator-bluetooth/+bug/1595695

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

Other bug subscribers