Bluetooth stops working after suspend/resume and requires reloading modules/restarting service to work again

Bug #591298 reported by Jeff Lane 
84
This bug affects 15 people
Affects Status Importance Assigned to Milestone
gnome-bluetooth (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

HARDWARE: System is an Alienware M15x. The device in question is an Apple Magic Mouse connecting via bluetooth. I don't have any other bluetooth devices to test this with...

What happens:
Everything is fine until I suspend the system. Once I suspend (S3) the system and then resume, bluetooth no longer works properly.
  * the bluetooth applet no longer registers any devices (seems like it is not scanning anymore)
  * hcitool shows no devices
  * hcitool scan DOES show devices, but I can not connect.
So, after much trial and error, ignoring the problem with bluetooth-applet, I have to remove all the drivers, reinstall the drivers, restart the bluetooth service and THEN I can manually connect via hcitool (but the applet still doesn't show any devices).

So in reality, there are two issues, but the more serious one for now is the kernel driver issue for bluetooth.

Steps to recreate:
1: Start with running system, bluetooth mouse connected and usable
2: sudo pm-suspend
3: wait a few seconds after suspend and restart the system (I've been doing it automatically for test purposes by echoing a "+60" into /sys/class/rtc/rtc0/wakealarm.
4: after system is fully resumed, check bluetooth applet. No devices found.
5: from the terminal, hcitool scan to get the address of the mouse
6: hcitool cc <address>; echo $?
7: hcitool auth <address>; echo $?
8: mouse never reconnects.

To work around:
1: after system resumes, service bluetooth stop
2: rmmod the following:
  * hidp
  * rfcomm
  * sco
  * bnep
  * btusb
  * l2cap
  * bluetooth
3: modprobe the following:
  * bluetooth
  * l2cap
  * btusb
  * bnep
  * sco
  * rfcomm
  * hidp
4: service bluetooth restart
5: hcitool scan
6: hcitool cc <address>
7: hcitool auth <address>

and the mouse should start working at this point. The bluetooth-applet, however still shows no devices at all.

bladernr@klaatu:~$ lsb_release -d
Description: Ubuntu 10.04 LTS

bladernr@klaatu:~$ sudo apt-cache policy bluez
bluez:
  Installed: 4.60-0ubuntu8
  Candidate: 4.60-0ubuntu8
  Version table:
 *** 4.60-0ubuntu8 0
        500 http://us.archive.ubuntu.com/ubuntu/ lucid/main Packages
        100 /var/lib/dpkg/status

bladernr@klaatu:~$ uname -a
Linux klaatu 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC 2010 x86_64 GNU/Linux

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: linux-image-2.6.32-22-generic 2.6.32-22.36
Regression: No
Reproducible: Yes
ProcVersionSignature: Ubuntu 2.6.32-22.36-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-22-generic x86_64
NonfreeKernelModules: nvidia
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.21.
AplayDevices:
 **** List of PLAYBACK Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
Architecture: amd64
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: bladernr 2041 F.... pulseaudio
CRDA: Error: [Errno 2] No such file or directory
Card0.Amixer.info:
 Card hw:0 'Intel'/'HDA Intel at 0xf0f20000 irq 22'
   Mixer name : 'IDT 92HD83C1X5'
   Components : 'HDA:111d7604,102802a2,00100104'
   Controls : 16
   Simple ctrls : 10
Card1.Amixer.info:
 Card hw:1 'NVidia'/'HDA NVidia at 0xcdefc000 irq 16'
   Mixer name : 'Nvidia ID a'
   Components : 'HDA:10de000a,10de0101,00100100'
   Controls : 0
   Simple ctrls : 0
Card1.Amixer.values:

Date: Tue Jun 8 10:40:40 2010
HibernationDevice: RESUME=UUID=f4e6db09-5257-40b2-ba2a-0718fc0b3f0d
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
MachineType: Alienware M15x
ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.32-22-generic root=UUID=acc23352-13ab-4854-b1d7-a1099a5bf3a5 ro crashkernel=384M-2G:64M,2G-:128M quiet splash
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
RelatedPackageVersions: linux-firmware 1.34
SourcePackage: linux
dmi.bios.date: 03/11/2010
dmi.bios.vendor: Alienware
dmi.bios.version: A05
dmi.board.vendor: Alienware
dmi.board.version: A05
dmi.chassis.type: 8
dmi.chassis.vendor: Alienware
dmi.chassis.version: A05
dmi.modalias: dmi:bvnAlienware:bvrA05:bd03/11/2010:svnAlienware:pnM15x:pvrA05:rvnAlienware:rn:rvrA05:cvnAlienware:ct8:cvrA05:
dmi.product.name: M15x
dmi.product.version: A05
dmi.sys.vendor: Alienware

Revision history for this message
Jeff Lane  (bladernr) wrote :
tags: added: kernel-power
Revision history for this message
Jeremy Foshee (jeremyfoshee) wrote :

Hi Jeff,

If you could also please test the latest upstream kernel available that would be great. It will allow additional upstream developers to examine the issue. Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag. This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text. Please let us know your results.

Thanks in advance.

    [This is an automated message. Apologies if it has reached you inappropriately; please just reply to this message indicating so.]

tags: added: kernel-suspend
tags: added: kj-triage
Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Jeff Lane  (bladernr) wrote :

Ok... tried with the latest upstream. I now need to drop back to the latest Lucid kernel and retest. Part of this may be that I'm just bone headed...

I booted the newest upstream and the mouse was connected and appeared in the bluetooth applet. after suspend, mouse was not connected and did not appear in the bluetooth applet.

HOWEVER, after clicking the mouse and waiting a few seconds, it DID connect automagically and was usable. HOWEVER, hcitool scan showed no devices, and nothing appeared in the bluetooth applet under Devices.

Revision history for this message
Jeff Lane  (bladernr) wrote :

Well now... apparently the whole thing also applies to 2.6.32-22...

After suspend, scan shows nothing but if I click the mouse, it connects.

I think I know what's going on now... it would seem that scan will only show devices that are in pairing mode. If I reset the mouse, then scan will show it, but after it's been connected and no longer in pairing mode, scan stops finding it.

So I am not sure this is a kernel issue at all now... since I discovered that clicking the mouse will allow it to reconnect on resume. I'm not sure why just moving the mouse doesn't work, (and I am reasonably sure that clicking it previously also failed) but at this point, I CAN get the mouse to work after resume.

So this now is just an issue with the Bluetooth applet. I'll change the subject and stuff appropriately.

tags: removed: needs-upstream-testing
Revision history for this message
Jeff Lane  (bladernr) wrote :

actually, on second though, JFO, I'll let you change it appropriately. I don't want to go redirecting things until you've seen the new comments and make the decision. but I have removed the needs-upstream-kernel tag...

Changed in linux (Ubuntu):
status: Incomplete → New
Revision history for this message
Jeremy Foshee (jeremyfoshee) wrote :

Jeff,
    I tend to agree with you to the extent that this could possibly be something that can be addressed in the bluetooth. I'd like to defer to Chase though as he may have some further input on the subject.

~JFo

tags: added: kernel-input kernel-needs-review
Changed in linux (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Chase Douglas (chasedouglas) wrote :

My guess is that this is a bluetooth-applet issue as well. I'm moving this bug to the gnome-bluetooth package. Even if it's not a gnome-bluetooth bug, hopefully the maintainers and developers there would have a better idea of what is going wrong.

affects: linux (Ubuntu) → gnome-bluetooth (Ubuntu)
tags: removed: kernel-input kernel-needs-review kernel-power kernel-suspend
Revision history for this message
Neil Manson (nelydajo) wrote :

This bug also affects my BlueTooth headset. I am using a Lenovo T61 laptop. Is there any other information I should provide that would be helpful?

Revision history for this message
Giovanni Merlino (j0v4nn1) wrote :

Under kernel 2.6.35-7-generic-pae, same problem after suspend/resume cycle: bluetooth-applet doesn't list devices anymore. It seems to only be related to bluetooth-applet, my workaround is "killall bluetooth-applet" and then launching bluetooth-applet; for istance my Magic Mouse appears back again in the list, and I can click on connect as usual, and it works flawlessly then, no rmmod/modprobe involved..

Revision history for this message
brianclements (brianclements) wrote :

I can confirm that for me it's just a problem with the applet and not the modules. "killall bluetooth-applet" and then "bluetooth-applet" worked.

Revision history for this message
MrC (cesar-pirinto) wrote :

I can also confirm it's just the applet and not the modules. "killall bluetooth-applet" and then "bluetooth-applet" worked for me as well.
Running kernel 2.6.32-24-generic

Revision history for this message
Patrick Meidl (patrick-pantheon) wrote :

I have this problem with a Mighty Mouse, and restarting the bluetooth applet doesn't solve the problem (with kernel 2.6.35-22-generic in Maverick final).

Revision history for this message
Patrick Meidl (patrick-pantheon) wrote :

I just tried the workaround described in the original post, and it doesn't work:

$ sudo service bluetooth stop
$ sudo rmmod hidp
ERROR: Module rfcomm is in use

this is surprising, since lsmod doesn't list any dependencies for hidp:

$ lsmod |grep hidp
hidp 15019 3
l2cap 42304 17 hidp,rfcomm,bnep
hid 84678 2 hidp,usbhid
bluetooth 59213 10 hidp,rfcomm,sco,bnep,l2cap,btusb

as I said earlier, restarting the bluetooth-applet also doesn't solve the problem. BTW, bluetooth applet behaves like this after resuming from suspend:

- first, the applet icon is greyed out, no devices are shown in the menu
- after a fairly long time (about 30 seconds), the icon becomes normal, and my mouse shows up in the device menu. but if I click on the menu, the submenu for the mouse is empty.

the only solution to this issue is to reboot :( this is really annoying, because it renders the suspend mode, which is a top prio feature for me on a laptop, unusable.

Revision history for this message
Patrick Meidl (patrick-pantheon) wrote :
Download full text (3.3 KiB)

more diagnostics:

when I open the bluetooth system preferences, it first takes a long time until the preferences come up (saying "starting bluetooth" in the application panel). once the preferences appear, it says "bluetooth is disabled". when I click on "enable bluetooth", I get this stack trace in the kernel log:

Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756719] WARNING: at /build/buildd/linux-2.6.35/fs/sysfs/dir.c:451 sysfs_add_one+0xc5/0x130()
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756723] Hardware name: Latitude E6410
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756726] sysfs: cannot create duplicate filename '/class/bluetooth/hci0:11'
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756729] Modules linked in: hidp iptable_filter ip_tables x_tables binfmt_misc rfcomm sco bnep l2cap vboxnetadp vboxnetflt vboxdrv snd_hda_codec_nvhdmi joydev usbhid arc4 snd_hda_codec_idt snd_seq_midi snd_rawmidi iwlagn snd_seq_midi_event hid snd_seq snd_hda_intel nvidia(P) snd_seq_device snd_hda_codec iwlcore snd_hwdep mac80211 snd_pcm uvcvideo btusb ppdev cfg80211 snd_timer bluetooth dcdbas videodev v4l1_compat v4l2_compat_ioctl32 dell_wmi snd psmouse soundcore serio_raw intel_agp snd_page_alloc parport_pc intel_ips video output lp parport sdhci_pci sdhci firewire_ohci ahci led_class e1000e firewire_core libahci crc_itu_t
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756805] Pid: 2903, comm: hci0 Tainted: P D W 2.6.35-22-generic #35-Ubuntu
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756808] Call Trace:
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756872] [<ffffffff8106077f>] warn_slowpath_common+0x7f/0xc0
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756877] [<ffffffff81060876>] warn_slowpath_fmt+0x46/0x50
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756883] [<ffffffff811bf6a5>] sysfs_add_one+0xc5/0x130
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756888] [<ffffffff811bfefb>] sysfs_do_create_link+0x13b/0x210
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756894] [<ffffffff811c0003>] sysfs_create_link+0x13/0x20
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756903] [<ffffffff813846ac>] device_add_class_symlinks+0x6c/0x100
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756908] [<ffffffff811be126>] ? sysfs_create_file+0x26/0x30
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756914] [<ffffffff813855d8>] device_add+0x238/0x440
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756919] [<ffffffff81384f91>] ? device_private_init+0x71/0x80
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756932] [<ffffffffa0c1de0b>] add_conn+0x5b/0xe0 [bluetooth]
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756941] [<ffffffffa0c1ddb0>] ? add_conn+0x0/0xe0 [bluetooth]
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756949] [<ffffffff8107a765>] run_workqueue+0xc5/0x1a0
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756955] [<ffffffff8107a8e3>] worker_thread+0xa3/0x110
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756961] [<ffffffff8107f610>] ? autoremove_wake_function+0x0/0x40
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756966] [<ffffffff8107a840>] ? worker_thread+0x0/0x110
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756971] [<ffffffff8107f0b6>] kthread+0x96/0xa0
Oct 21 09:30:32 cemmnbk80 kernel: [ 2138.756978] [<ffffffff8100aee4>] kernel_thread_helper+0x4/0x10...

Read more...

Revision history for this message
Patrick Meidl (patrick-pantheon) wrote :

finally found a workaround :)

- disable bluetooth from the bluetooth-applet menu *before* suspending
- supend
- resume
- turn bluetooth back on in bluetooth-applet

not sure if/how you can do this without a mouse, I have a second USB mouse connected to the laptop anyway which I use for this.

Revision history for this message
Olivier Bilodeau (plaxx) wrote :

Experiencing exact same problem as Patrick. Jeff's workaround doesn't work because module hidp can't be rmmod'ed.

olivier@boreale:~$ lsb_release -d
Description: Ubuntu 10.10

olivier@boreale:~$ uname -a
Linux boreale 2.6.35-23-generic #36-Ubuntu SMP Tue Oct 26 17:03:18 UTC 2010 i686 GNU/Linux

olivier@boreale:~$ sudo apt-cache policy bluez
bluez:
  Installé : 4.69-0ubuntu2
  Candidat : 4.69-0ubuntu2
 Table de version :
 *** 4.69-0ubuntu2 0
        500 http://ubuntu.mirror.iweb.ca/ maverick/main i386 Packages
        100 /var/lib/dpkg/status

Hardware: Lenovo Thinkpad T61

Because of the kernel stack trace in dmesg (same as Patrick's), I would be tempted to say that it is somehow related to the kernel. At least the fact that we can't rmmod hidp,

Revision history for this message
Lomu (k-admin-lomunet-org) wrote :

#15 is a good solution if you don't need password after suspend :p

Revision history for this message
Patrick Meidl (patrick-pantheon) wrote :

@Lomu: or if you have a USB keyboard :)

Revision history for this message
Alden (jason-alden-benoit) wrote :

Not sure if this will work for you guys, but it solved my issues. It is a workaround, but hey better than nothing if it works!

http://ubuntuforums.org/showthread.php?t=1387211

Revision history for this message
madbiologist (me-again) wrote :

Does the new pm-utils 1.3.0-1ubuntu3 package (available in Lucid via Update Manager) help?

Changed in gnome-bluetooth (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for gnome-bluetooth (Ubuntu) because there has been no activity for 60 days.]

Changed in gnome-bluetooth (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Cerin (chrisspen) wrote :

Still experiencing this problem. However, the "killall bluetooth-applet" and then "bluetooth-applet" trick seems to workaround the issue for me.

Revision history for this message
Maxime Ritter (airmax) wrote : you have unread message from ladie

Hello!
I am Alla, 26 yo.
Are you ready to be my boyfriend and to start big friendship?
March is the best time for this :)
wish you good spring time this year!

please check my new photos and message for you here:

http://sonya201010.com.ua/?message_from=Alla

Revision history for this message
Jeff Lane  (bladernr) wrote :

Comment #23 --> Best bug comment ever!

Revision history for this message
Jeff Lane  (bladernr) wrote :

Never seemed to get anywhere, but no new reports and so, closing

Changed in gnome-bluetooth (Ubuntu):
status: Expired → Invalid
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.