Bug 957071 - Blueberry OFF toggle does not actually turn off bluetooth
Blueberry OFF toggle does not actually turn off bluetooth
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Network
Current
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: Alexei Sorokin
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-30 04:48 UTC by S. B.
Modified: 2018-09-09 13:40 UTC (History)
5 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Bluetooth "on" (57.92 KB, image/png)
2015-11-30 14:15 UTC, S. B.
Details
Bluetooth "off" (82.29 KB, image/png)
2015-11-30 14:16 UTC, S. B.
Details
Blueberry closed (43.64 KB, image/png)
2015-11-30 14:17 UTC, S. B.
Details
hwinfo (452.82 KB, text/plain)
2015-11-30 14:18 UTC, S. B.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description S. B. 2015-11-30 04:48:32 UTC
Hello, the current Tumbleweed version of the Blueberry bluetooth management GUI (1.1.0) has a big ON/OFF toggle. However, this toggle does nothing. After toggling it OFF and re-opening Bluberry, it is again shown as ON. I am using the integrated bluetooth device of a Lenovo Thinkpad T530 laptop.
Comment 1 Bernhard Wiedemann 2015-11-30 05:04:38 UTC
you could try calling as root
rfkill list

to see the status while blueberry is running or stopped
Comment 2 Bernhard Wiedemann 2015-11-30 05:11:17 UTC
I cannot reproduce it on my Acer B-115M laptop.
rfkill shows a change in

1: acer-bluetooth: Bluetooth
        Soft blocked: yes
        Hard blocked: no

and when restarting blueberry, it still shows the status as off.

Maybe because you have a different kind of bluetooth adapter?
Comment 3 S. B. 2015-11-30 14:15:17 UTC
Thanks Bernhard for taking a look. I am attaching some screenshots. I'm also attaching some hardware info. I really don't understand why there are two Bluetooth devices listed. I only have one, and it's integrated into the Thinkpad T530 laptop.
Comment 4 S. B. 2015-11-30 14:15:52 UTC
Created attachment 657693 [details]
Bluetooth "on"
Comment 5 S. B. 2015-11-30 14:16:29 UTC
Created attachment 657694 [details]
Bluetooth "off"
Comment 6 S. B. 2015-11-30 14:17:00 UTC
Created attachment 657695 [details]
Blueberry closed
Comment 7 S. B. 2015-11-30 14:18:09 UTC
Created attachment 657696 [details]
hwinfo
Comment 8 Bernhard Wiedemann 2015-11-30 16:30:50 UTC
It looks as if the soft-blocked bit is never set.
Could be a kernel bug around rfkill.
Comment 9 S. B. 2015-11-30 17:00:38 UTC
It doesn't seem to be a kernel bug, because I just tried Blueman 2.0.1 and it correctly turns the bluetooth adapter on/off. With Blueman I disable Bluetooth and my bluetooth connected devices stop working as expected. Here is what I see after disabling bluetooth in Blueman:

-------------------

#> rfkill list

0: tpacpi_bluetooth_sw: Bluetooth
	Soft blocked: yes
	Hard blocked: no
1: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no
Comment 10 Takashi Iwai 2015-12-01 07:57:33 UTC
OK, then this looks more like a blueberry-specific problem.
Reassigned to blueberry maintainer.
Comment 11 Alexei Sorokin 2015-12-13 12:35:29 UTC
Was it ruled out that this is a GNOME Bluetooth bug?
If it was, then this bugreport should be reported upstream.
Comment 12 S. B. 2015-12-14 02:09:31 UTC
Hi Alexei, how can I rule out the possibility of a gnome-bluetooth bug? I have the "gnome-bluetooth" package installed, but it appears to consist of just icons and documentation files.
Comment 13 Alexei Sorokin 2016-03-09 17:11:56 UTC
S.B., well, I don't know, check bluetooth in GNOME Shell :-).
Comment 14 S. B. 2016-12-28 11:52:11 UTC
Bug still present in Tumbleweed and Leap 42.1 and 42.2. I've tried this with dozens of different installations on dozens of devices, and it always fails to turn off bluetooth.
Comment 15 Alexei Sorokin 2017-01-26 20:52:53 UTC
S. B., and it really only happens with blueberry? That's very-very unlikely that it does.
Confirming that it doesn't will allow me to reassign this bug to the GNOME maintenance team as gnome-bluetooth is their package.
Comment 16 S. B. 2017-01-27 00:47:25 UTC
Yes, this only happens with Blueberry. Gnome Bluetooth works correctly, as does Blueman to turn off the bluetooth device.

I'm thinking this might be a missing dependency that Blueberry needs that is declared as "recommended" in the RPM spec? I run a system with installation of recommended packages disabled by default.

Thanks for looking into this.
Comment 17 Maurizio Galli 2018-08-28 15:20:37 UTC
Is there any update on this?
I just noticed I have the same issue. However no problems when using Blueman

Device: Lenovo Thinkpad T460
DE: Xfce
OS: Tumbleweed
Blueberry version: 1.2.3-2.1
Comment 18 S. B. 2018-08-28 15:30:53 UTC
At some point during the past few months in Tumbleweed it seems to have just magically started working.
Comment 19 Maurizio Galli 2018-08-28 15:34:38 UTC
(In reply to S. B. from comment #18)
> At some point during the past few months in Tumbleweed it seems to have just
> magically started working.

ok well I run a few more tests and if I don't get anywhere I will open a new report
Comment 20 Bernhard Wiedemann 2018-08-30 02:55:00 UTC
I guess it requires rfkill which was its own small package before,
but now is part of util-linux so it is always there.
Comment 21 Alexei Sorokin 2018-08-30 10:05:13 UTC
> I guess it requires rfkill which was its own small package before, but now is part of util-linux so it is always there.

Bernhard, it was always taken into account.
Comment 22 S. B. 2018-08-30 11:40:45 UTC
I don't think it was `rfkill`, as I've always had it installed. But I do think it was some missing dependency that was marked as recommended that should have been required, since I run a system with recommended package installation disabled.
Comment 23 Alexei Sorokin 2018-08-30 13:40:12 UTC
S. B., no, that is probably not it.
When that button is toggled, this is exactly what happens: https://github.com/linuxmint/blueberry/blob/1.2.3/usr/lib/blueberry/rfkillMagic.py#L113
That is, "/usr/sbin/rfkill block bluetooth" is being executed wrapped in magic.

Maurizio, can you check if the above command works on its own?
Comment 24 Alexei Sorokin 2018-08-30 14:07:28 UTC
Maurizio, also check please if /usr/bin/rfkill exists (it should not).
Comment 25 Maurizio Galli 2018-08-30 20:41:37 UTC
(In reply to Alexei Sorokin from comment #24)
> Maurizio, also check please if /usr/bin/rfkill exists (it should not).

The command /usr/sbin/rfkill block bluetooth as root works and also I have rhe file /usr/sbin/rfkill
Comment 26 Maurizio Galli 2018-08-30 20:54:43 UTC
Could it be that the switch doesnt work because rfkill needs root privileges to work?
Comment 27 Alexei Sorokin 2018-08-30 21:00:59 UTC
Maurizio, whether /usr/bin/rfkill exists, in /usr/bin/, not /usr/sbin/

Do I understand it right that from the user "/usr/sbin/rfkill block bluetooth" does not work?
Comment 28 Maurizio Galli 2018-08-30 21:07:27 UTC
(In reply to Alexei Sorokin from comment #27)
> Maurizio, whether /usr/bin/rfkill exists, in /usr/bin/, not /usr/sbin/
> 
> Do I understand it right that from the user "/usr/sbin/rfkill block
> bluetooth" does not work?

/usr/bin/rfkill does not exist
/usr/sbin/rfkill exists

Correct. I cannot execute "/usr/sbin/rfkill block bluetooth" as user, only as root or with sudo.
Comment 29 Maurizio Galli 2018-09-01 08:50:51 UTC
(In reply to Alexei Sorokin from comment #27)
> Maurizio, whether /usr/bin/rfkill exists, in /usr/bin/, not /usr/sbin/
> 
> Do I understand it right that from the user "/usr/sbin/rfkill block
> bluetooth" does not work?

Same as when I run the command alone, when using the switch I get the following "rfkill: cannot open /dev/rfkill: Permission denied"

I posted a screenshot here: https://imgur.com/a/WUU03on
Comment 30 Alexei Sorokin 2018-09-01 17:52:12 UTC
Maurizio, I think I know what's going on…
Try to install gnome-settings-daemon, reboot and see if it works then.

I think existence of /usr/lib/udev/rules.d/61-gnome-settings-daemon-rfkill.rules is what does it.
Comment 31 Maurizio Galli 2018-09-01 18:05:45 UTC
(In reply to Alexei Sorokin from comment #30)
> Maurizio, I think I know what's going on…
> Try to install gnome-settings-daemon, reboot and see if it works then.
> 
> I think existence of
> /usr/lib/udev/rules.d/61-gnome-settings-daemon-rfkill.rules is what does it.

I will try but I hope there is a more graceful way to achieve this... There are too many recommended Gnome dependencies pulled in by gnome-settings-daemon
Comment 32 Alexei Sorokin 2018-09-01 18:07:09 UTC
Maurizio, yeah, I'm just trying to prove a theory :-).
Comment 33 Maurizio Galli 2018-09-01 18:13:34 UTC
(In reply to Alexei Sorokin from comment #32)
> Maurizio, yeah, I'm just trying to prove a theory :-).

:-) your theory was correct. The switch works now


PS: I temporarily disabled "recommended packages" because I didn't wanna deal with that mess ;)
Comment 34 Alexei Sorokin 2018-09-01 18:59:06 UTC
S. B., Maurizio, there you go: https://build.opensuse.org/request/show/632659
This bug is finally figured out :-).
Comment 35 Swamp Workflow Management 2018-09-01 19:30:06 UTC
This is an autogenerated message for OBS integration:
This bug (957071) was mentioned in
https://build.opensuse.org/request/show/632659 Factory / blueberry
Comment 36 Bernhard Wiedemann 2018-09-01 20:29:29 UTC
Shouldnt this udev config file go into util-linux?

Otherwise I'd have to install blueberry, if I want to use rfkill as non-root.
Even if I dont want/need a GUI.
Comment 37 Alexei Sorokin 2018-09-02 09:57:04 UTC
Bernhard, I just mirrored the decision made in gnome-settings-daemon's upstream to get the fix as fast as possible (with the precedence).

Really not sure why access to /dev/rfkill is not permitted by default to a regular user in 50-udev-default.rules.
Comment 38 Maurizio Galli 2018-09-02 14:53:50 UTC
(In reply to Alexei Sorokin from comment #34)
> S. B., Maurizio, there you go: https://build.opensuse.org/request/show/632659
> This bug is finally figured out :-).

Awesome! Thanks a lot for doing this :)
Comment 39 Maurizio Galli 2018-09-09 11:01:41 UTC
Alexei, sorry just to be clear is gnome-settings-daemon still needed for Blueberry to work properly or it can be removed?

PS: I'm on Xfce
Comment 40 Alexei Sorokin 2018-09-09 13:40:49 UTC
Maurizio, no, it can be safely removed.