bluetooth can not be enabled sometimes (when booting with flight mode on being one case)

Bug #1421249 reported by Jamie Strandboge
58
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Confirmed
High
John McAleely
lxc-android-config (Ubuntu)
Triaged
High
Mathieu Trudel-Lapierre
urfkill (Ubuntu)
Triaged
High
Unassigned

Bug Description

The bluetooth indicator and the bluetooth page in system settings sometimes won't turn on bluetooth until after a reboot. What I expect to happen is that if bluetooth is off in the indicator/system settings and I tap the switch, the switch will go green and in a moment the bluetooth indicator will show up and bluetooth is enabled. When bluetooth is on, I expect to go into the indicator/system settings and turn the switch off, the switch will go gray and the bluetooth indicator will hide and bluetooth is disabled. I expect this to work whenever I want while the phone is on.

Sometimes, this does not work. For example, yesterday I disabled bluetooth at some point in the evening and later I went to sleep. When I woke up, I tried to turn it on via the indicator and also system settings and it wouldn't turn on. In the indicator, the switch moves to the green position briefly, then moves back to gray (the bluetooth indicator remains hidden and bluetooth is disabled). In system settings, the switch will stay green, but the bluetooth indicator remains hidden and bluetooth is disabled. If I leave system settings and come back, the the switch is now in the off position.

/var/lib/urfkill/saved-states has:
[BLUETOOTH]
soft=false
prev-soft=false

bluetoothd is confirmed to be running before and after using the indicator and system settings when bluetooth cannot be enabled.

Workaround: reboot the phone and bluetooth will be enabled.

Note: this is not new behavior-- I'm only reporting it now (partly because I thought it was fixed for a while, but that might have been because I was rebooting a lot at the time)

$ system-image-cli -i
current build number: 194
device name: mako
channel: ubuntu-touch/ubuntu-rtm/14.09-proposed
last update: 2015-02-11 15:34:27
version version: 194
version ubuntu: 20150211.1
version device: 20150116
version custom: mako-1.1

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Adding an ubuntu-system-settings task because of the inconsistent behavior of the switch between the indicator and system settings (the indicator seems to have the proper behavior).

description: updated
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

The inconsistency of behavior between the indicator and the system settings is now being tracked in bug #1421253. Removing ubuntu-system-settings task from this bug.

no longer affects: ubuntu-system-settings (Ubuntu)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in urfkill (Ubuntu):
status: New → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

it's easy to trigger on vivid
- enable flight mode
- restart the device
- disable flight mode
- bluetooth is still disabled and can't be enabled

summary: - bluetooth can not be enabled sometimes
+ bluetooth can not be enabled sometimes (when booting with flight mode on
+ being one case)
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

I'm pretty sure this has to do with the ordering of the bluetooth-touch, bluetooth (bluez) and urfkill jobs. IIRC bluetooth-touch jobs do some firmware tweaks that can't work if the device isn't available or rfkill blocked, but we also need to be very sure that the radios are off all the while flight mode is enabled and bluetooth isn't, since this is part of regulatory requirements.

Since it's probably changes in the upstart jobs and only that, I'm adding a task for lxc-android-config. Let's keep the urfkill task in case there is any work needed there, but it seems to me like the logic in urfkill is already correct.

Changed in urfkill (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → High
Changed in lxc-android-config (Ubuntu):
assignee: nobody → Mathieu Trudel-Lapierre (mathieu-tl)
importance: Undecided → High
status: New → Triaged
Revision history for this message
Sam Bull (dreamsorcerer) wrote :

Note, this doesn't even need flight mode, I can reproduce it 100% just by switching off Bluetooth:

  Disable bluetooth.
  Reboot phone.
  Enable bluetooth.

This fails to enable bluetooth. If bluetooth is disabled when the phone booted, the only was to enable it is to click enable and reboot the phone.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

I noticed this does not seem to affect arale (at least I couldn't reproduce it), but it is easily reproducible on mako.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

This appears to be fixed with the new bluetooth stack:
$ system-image-cli -i
current build number: 109
device name: mako
channel: ubuntu-touch/rc-proposed/bq-aquaris.en

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

@Jamie: really?

Will double check that on monday.

tags: added: bluetooth bluez5
tags: added: after-bluez5
removed: bluez5
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

@Simon: yes, I was pleasantly surprised too. I had always heard that it was a hardware issue so when I read that rc-proposed had the new bluetooth kernel stack I thought maybe they worked around the issue in some manner in the kernel. Initially after booting into r109 I used the indicator and it all appeared to work properly (like on arale). Satisfied, I went and looked at bug #1318360 again (unrelated to this but...) then I updated the radio firmware as described in https://lists.launchpad.net/ubuntu-phone/msg08514.html. Then I saw your 'really' comment and decided to try this bug for real in my car. I enabled bluetooth via the indicator, it paired with the car. I played a song with the music-app via bluetooth. I disabled bluetooth via the indicator. It unpaired with the car. I enabled bluetooth via the indicator and it paired and I played a song with the music-app via bluetooth. All without rebooting.

I mention the updated radio firmware only because while I don't think it had anything to do with fixing this bug, because I didn't test pairing with the car prior to updating it, I'm not 100% sure it isn't needed.

Revision history for this message
Sam Bull (dreamsorcerer) wrote :

"All without rebooting."

You need to reboot to reproduce the issue. Disable bluetooth, then reboot. Then enable bluetooth and see if it works. The issue only occurs (for me atleast) when booting the phone with bluetooth already disabled.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

@Sam, that wasn't how I remembered it, but I tried as you said. Disabled bluetooth, reboot. Enable bluetooth. It worked. I then disabled and enabled again and it works.

Revision history for this message
Sam Bull (dreamsorcerer) wrote : Re: [Bug 1421249] bluetooth can not be enabled sometimes (whenbooting with flight mode on being one case)

That's excellent news. Looking forward to this landing in an OTA.

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

The case where we reboot with flight mode being enable is still valid. I did some further analysis on this as I stumbled upon this again during my current BlueZ 5 work and the underlaying problems goes down to the kernel.

The bluetooth driver we have on krillin isn't implemented as a module but is initialized by a subsystem it uses. It now turns out that this is bound to the WiFi driver being initialized too. If WiFi doesn't get enabled at boot time the Bluetooth driver can proceed providing a HCI device and we end up without any Bluetooth functionality.

Needs further investigation on the kernel side what we can do to work around this.

tags: added: krillin
Changed in canonical-devices-system-image:
assignee: nobody → John McAleely (john.mcaleely)
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Steven Austen (ausbuscon) wrote :

I'm on a Nexus 7 (LTE) r.23 from ubuntu-touc/ ubuntu-rtm/proposed from system-image.tasemnice.eu/

Bluetooth does not even become discoverable - it just times out - even when I have my bluetooth keyboard scanning

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.