Bug 292165

Summary: bluetooth stops working on sleep/resume
Product: [Frameworks and Libraries] solid Reporter: Jonathan Challinger <mr.challinger>
Component: bluetooth-daemonAssignee: Alex Fiestas <afiestas>
Status: RESOLVED UPSTREAM    
Severity: normal CC: lamarque
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description Jonathan Challinger 2012-01-22 07:31:19 UTC
Version:           unspecified (using KDE 4.7.3) 
OS:                Linux

backstory: I have a laptop (system76 gazelle professional) with an Intel wifi/bluetooth adapter (advanced-n 6230.) When I resume from sleep, the bluetooth sometimes ceases to work. This is a major annoyance to me, as I use a bluetooth mouse frequently. I would like some help resolving it, but I hardly know anything about bluetooth in KDE.
I am using kubuntu 11.10. The issue does not occur in gnome, so I can only assume it is a KDE thing.

Here's what I know:
- Occurs on suspend/resume
- Can usually be resolved by suspending and resuming again. Have not found another way of resolving the issue, apart from restarting. This includes cycling the bluetooth power button on my laptop.
- Seems to happen every other suspend/resume cycle, but not quite with perfect reliability.
- lsusb and hciconfig shows my adapter
- kde bluetooth system tray icon disappears, system settings->bluetooth shows no adapter

Thanks for any help - ask me for any logs or other info.

Reproducible: Sometimes

Steps to Reproduce:
- Buy an Intel Advanced-N 6230 card
- Install in laptop with kubuntu 11.10
- Sleep and resume

Actual Results:  
No bluetooth

Expected Results:  
Working bluetooth
Comment 1 Jonathan Challinger 2012-01-22 19:36:52 UTC
grepping syslog for "blue" returns the same stuff on every sleep cycle. The only error message is this:

< Jan 22 11:31:30 jon-laptop pulseaudio[2416]: [pulseaudio] bluetooth-util.c: Error from RegisterEndpoint reply: org.freedesktop.DBus.Error.UnknownMethod

I'm looking for anything else I can do to find the source of the problem.
Comment 2 Jonathan Challinger 2012-02-03 21:34:43 UTC
The following solution worked for me, but I still think the bug is kde-related:
jschall@jon-laptop:~$ cat /etc/pm/sleep.d/49bluetooth
#!/bin/sh

case $1 in
    suspend|suspend_hybrid|hibernate)
        /etc/init.d/bluetooth stop
    ;;
    resume|thaw)
        bash -c "sleep 2;/etc/init.d/bluetooth start"&
    ;;
Comment 3 Alex Fiestas 2012-04-28 00:33:48 UTC
This bug was upstream (BlueZ), seems to be fixed:

https://bugzilla.redhat.com/show_bug.cgi?id=733230
https://bbs.archlinux.org/viewtopic.php?id=122936
https://lists.ubuntu.com/archives/ubuntu-bluetooth/2011-July/010356.html

Many more out there.

So, I'm going to close this bug, if I'm mistaken and you can reproduce this with a distro with modern packages (arch, kubuntu 12.04) please don't hesitate on reopening the bug !