Apple Magic Trackpad (hid-magicmouse) input freezes on 3 or 4 finger touch

Bug #862085 reported by Daniel van Vugt
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Open Input Framework
Invalid
Undecided
Unassigned
Unity
Invalid
Undecided
Unassigned
linux (Ubuntu)
In Progress
Undecided
Daniel van Vugt
unity (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Update: The cause has been traced down to either a kernel or hardware issue as per comment #4.

TEST CASE:

Test case without X or Unity:

1. Pair the trackpad using hcitool/hidd utilities.
2. Run: evtest /dev/input/whatever
You will see lots of input events for 1 or 2 finger touches. However the evtest event stream freezes when 3 or more fingers are touched.

Test case in Unity:

Touch 3 fingers: After a second or two (?!) the grab handles appear but the trackpad goes dead. Only my mouse continues to work. The trackpad comes back to life a while after the grab handles vanish, and I've moved the pointer with the mouse.
Touch 4 fingers: Trackpad goes dead again. Takes a while before it starts responding again. This also triggers bug 859069.
I can reproduce the above bugs in Ubuntu 11.04 and 11.10 beta 2 (live).

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: xserver-xorg-input-synaptics 1.3.99+git20110116.0e27ce3a-0ubuntu12.1
ProcVersionSignature: Ubuntu 2.6.38-11.50-generic 2.6.38.8
Uname: Linux 2.6.38-11-generic x86_64
Architecture: amd64
CompizPlugins: [core,bailer,detection,composite,opengl,compiztoolbox,decor,vpswitch,place,imgpng,regex,unitymtgrabhandles,grid,session,snap,mousepoll,resize,move,animation,expo,ezoom,workarounds,resizeinfo,wall,staticswitcher,fade,scale,unityshell]
CompositorRunning: compiz
Date: Thu Sep 29 15:00:41 2011
DistUpgraded: Fresh install
DistroCodename: natty
DistroVariant: ubuntu
DkmsStatus:
 bcmwl, 5.100.82.38+bdcom, 2.6.38-11-generic, x86_64: installed
 vboxhost, 4.0.10, 2.6.38-11-generic, x86_64: installed
 vboxhost, 4.0.10, 2.6.38-10-generic, x86_64: installed
GraphicsCard:
 Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller [8086:0102] (rev 09) (prog-if 00 [VGA controller])
   Subsystem: Dell Device [1028:047e]
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
MachineType: Dell Inc. OptiPlex 990
ProcEnviron:
 LANGUAGE=en_AU:en
 LANG=en_AU.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.38-11-generic root=UUID=e79b78d3-ed94-4285-8af0-4c7803ef2097 ro quiet splash vt.handoff=7
Renderer: Unknown
SourcePackage: xserver-xorg-input-synaptics
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 05/28/2011
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A05
dmi.board.name: 0D6H9T
dmi.board.vendor: Dell Inc.
dmi.board.version: A00
dmi.chassis.type: 15
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.:bvrA05:bd05/28/2011:svnDellInc.:pnOptiPlex990:pvr01:rvnDellInc.:rn0D6H9T:rvrA00:cvnDellInc.:ct15:cvr:
dmi.product.name: OptiPlex 990
dmi.product.version: 01
dmi.sys.vendor: Dell Inc.
version.compiz: compiz 1:0.9.4+bzr20110606-0ubuntu1~natty2vv4
version.ia32-libs: ia32-libs 20090808ubuntu13
version.libdrm2: libdrm2 2.4.23-1ubuntu6
version.libgl1-mesa-dri: libgl1-mesa-dri 7.10.2-0ubuntu2
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 7.10.2-0ubuntu2
version.xserver-xorg: xserver-xorg 1:7.6+4ubuntu3.1
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:6.14.0-0ubuntu4.1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.14.0-4ubuntu7.1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:0.0.16+git20110107+b795ca6e-0ubuntu7

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Stephen M. Webb (bregma) wrote :

Previous analyses of this problem concluded there was a missing XSync call in Unity.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

A missing XSync call sounds like a plausible explanation. But where is it missing from exactly? I'd like to try hacking it in.

Also, if there are previous analyses of this problem then is there an existing bug this one is a duplicate of?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I've traced the problem to a kernel or hardware issue (hid-magicmouse module).

After stopping Xorg, and using just a virtual terminal, I paired the device manually and ran evtest. Same problem running just evtest and no X or Unity. The evtest event stream freezes for a little while if I touch 3 or more fingers at once.

It's also possible my cheap Bluetooth dongle is to blame so I've ordered a new one to try. But I suspect the problem is a kernel bug, in the hid-magicmouse module.

affects: xserver-xorg-input-synaptics (Ubuntu) → linux (Ubuntu)
Changed in unity (Ubuntu):
status: New → Invalid
Changed in utouch:
status: New → Invalid
Changed in unity:
status: New → Invalid
summary: - Apple Magic Trackpad input freezes on 3 or 4 finger touch
+ Apple Magic Trackpad (hid-magicmouse) input freezes on 3 or 4 finger
+ touch
Brad Figg (brad-figg)
Changed in linux (Ubuntu):
status: New → Confirmed
description: updated
tags: added: testcase
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This bug looks very similar:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=cc5e0f08ca2a66fc4c6984ccff74fd529e969fac

However natty-updates and oneiric already have the above fix. I suspect it may still require more fixing... ?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I can almost certainly exclude the hid-magicmouse kernel module now. I removed the module and dumped the raw bluetooth data using 'hcidump -X'. The problem STILL continued. When I used more than 2 fingers, hcidump stuttered and froze.

So it seems my problem is either hardware (the cheap bluetooth dongle) or the kernel bluetooth code (unlikely).

P.S.
Interestingly, I notice the event buffer size used by hid-magicmouse may still not be big enough, even after I find a bluetooth dongle that works. Because hid-magicmouse uses an event buffer size of 60 events, but hcidump showed that when using 3 or more fingers, the bluetooth data packets became bigger than 60 bytes. Not sure if an event is a byte though...

#fingers : bluetooth_packet_length
1 : 18
2 : 27
3 : 36-69
4 : 45-87
5 : 54-105
6 : 63-105
7 : 72+
8 : 81+
9 : 90+
10 : 99+

Paul Sladen (sladen)
Changed in linux (Ubuntu):
assignee: nobody → Chase Douglas (chasedouglas)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

As mentioned above, I suspect this is a hardware problem. Need to wait for the new bluetooth dongle to be delivered so I can verify.

Changed in linux (Ubuntu):
assignee: Chase Douglas (chasedouglas) → Daniel van Vugt (vanvugt)
status: Confirmed → In Progress
Revision history for this message
Chase Douglas (chasedouglas) wrote :

Daniel,

Great job digging into this! It's really interesting that you see the same issues when dumping from the bluetooth stack directly.

The evdev event buffer is after the bluetooth stack has handed events off to the hid-magicmouse. Also, the input event buffer is set to 60 events, not 60 bytes. Based on these two observations, I agree with your thoughts that it is either a bluetooth hardware/driver bug or a bug in the bluetooth stack.

I would suggest posting your findings to the linux-bluetooth mailing list: http://vger.kernel.org/vger-lists.html#linux-bluetooth. That's where the core bluetooth developers hang out. They may have seen the issue before and know how to fix it, or they may know off the top of their head where to look in the stack.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Based on what I've read about other people using Apple Magic Trackpad, it seems no one has had as many problems as I have. So a broken dongle sounds likely. If the problem persists after I've tried 1 or 2 new dongles then I might think about calling it a linux bug... :)

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK, I found a duplicate of this one. It seems I was right -- the "Cambridge Silicon Radio" bluetooth dongle I have is the same type that other people are having trouble with.

Revision history for this message
Ashish Khimani (ashp8) wrote :

This also happens with my internal bluetooth ar3011 and I believe it is a combinations of bad drivers/firmware on my rubbish Bluetooth

Revision history for this message
Johan Janez (johanjanezer9) wrote :

Hi, i've been seeing the same issue with a magic mouse and the "Cambridge Silicon Radio" bluetooth dongle on one of my pc's on gentoo running kernel versions 3.12.x as well as on my main desktop running windows 7 64 bit with an asus builtin motherboard bluetooth adapter of the make from atheros "ar3011" as mentioned by Mr Khimani. Seeing same behavior on both, works great with 1 or 2 finger touch, but locks up with 3 or more touches on the touch surface of the mouse. Reading this bug report i now understand why it works normally with the microsoft driver on windows, as its not even registering the touches (more than 1). The mouse however works both on gentoo and windows on two other laptops with a broadcomm bluetooth adapter (on each). So its in fact either the dongle itself or the firmware/drivers t hat are bugged for the bt adapter

Revision history for this message
bleathem (bleathem) wrote :

I am also getting this same problem with my Apple Magic Trackpad on my Lenovo T540 using only the bluetooth built-in to the laptop, running Ubuntu 14.04.

My trackpad worked fine on older T510 running Ubuntu 12.04.

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.