Mouse input (warp and clipping) broken in Wine 1.4rc6

Bug #948938 reported by Loris Zinsou
72
This bug affects 15 people
Affects Status Importance Assigned to Milestone
X.Org X server
In Progress
Medium
xorg-server (Ubuntu)
Fix Released
Medium
Chase Douglas

Bug Description

Mouse warp and clipping are broken with Wine (tested with Wine 1.3.37 to 1.4rc6) and Ubuntu 12.04.
It works fine with Ubuntu 11.10 and the same versions of Wine.
The bug is present with both xserver 1.11.x and 1.12rc.
I tried on a desktop and a laptop (with mouse and touchpad), same result.

Any application needing these functionalities is unusable (this includes many 3D apps, mostly games).
Either the cursor moves too quickly (Crysis, Bioshock), or to the opposite direction it was expected to go (Mass Effect). It may depend on the way the app handles mouse input.
Reports confirm that Mass Effect, Crysis 2 and Bioshock are broken (they wereworking fine on Ubuntu 11.10), as long as some 3D level design tools.

Here is the bug report on Wine bug tracker :
http://bugs.winehq.org/show_bug.cgi?id=30057

On Xorg bugtracker :
https://bugs.freedesktop.org/show_bug.cgi?id=46976

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: xinput 1.5.99.1-0ubuntu2
ProcVersionSignature: Ubuntu 3.2.0-18.28-generic 3.2.9
Uname: Linux 3.2.0-18-generic x86_64
.tmp.unity.support.test.0:

ApportVersion: 1.94-0ubuntu2
Architecture: amd64
CompizPlugins: [core,composite,opengl,decor,mousepoll,vpswitch,regex,animation,snap,expo,move,compiztoolbox,place,grid,imgpng,gnomecompat,wall,ezoom,workarounds,resize,fade,unitymtgrabhandles,scale,session,unityshell]
CompositorRunning: compiz
Date: Wed Mar 7 13:47:42 2012
DistUpgraded: Log time: 2012-01-17 05:55:15.049263
DistroCodename: precise
DistroVariant: ubuntu
GraphicsCard:
 Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller [8086:0116] (rev 09) (prog-if 00 [VGA controller])
   Subsystem: ASUSTeK Computer Inc. Device [1043:15f2]
 NVIDIA Corporation GF108 [GeForce GT 540M] [10de:0df4] (rev ff) (prog-if ff)
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
MachineType: ASUSTeK Computer Inc. N43SL
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.2.0-18-generic root=UUID=ebdeb263-7f5c-476d-82e6-5f71b9331c78 ro quiet splash vt.handoff=7
SourcePackage: xinput
UpgradeStatus: Upgraded to precise on 2012-01-17 (50 days ago)
dmi.bios.date: 02/15/2011
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: N43SL.302
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: N43SL
dmi.board.vendor: ASUSTeK Computer Inc.
dmi.board.version: 1.0
dmi.chassis.asset.tag: No Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: ASUSTeK Computer Inc.
dmi.chassis.version: 1.0
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrN43SL.302:bd02/15/2011:svnASUSTeKComputerInc.:pnN43SL:pvr1.0:rvnASUSTeKComputerInc.:rnN43SL:rvr1.0:cvnASUSTeKComputerInc.:ct10:cvr1.0:
dmi.product.name: N43SL
dmi.product.version: 1.0
dmi.sys.vendor: ASUSTeK Computer Inc.
version.compiz: compiz 1:0.9.7.0+bzr3035-0ubuntu1~ppa1
version.ia32-libs: ia32-libs 20090808ubuntu33
version.libdrm2: libdrm2 2.4.31+git20120302.be30d350-0ubuntu0sarvatt
version.libgl1-mesa-dri: libgl1-mesa-dri 8.0.1+git20120301+8.0.a3080987-0ubuntu0sarvatt
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 8.0.1+git20120301+8.0.a3080987-0ubuntu0sarvatt
version.xserver-xorg-core: xserver-xorg-core 2:1.11.99.903+git20120301.2416ee4a-0ubuntu0ricotz
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.6.99.901+git20120126-0ubuntu2
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:6.14.99+git20120302.878454ae-0ubuntu0sarvatt
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.18.0+git20120302.aaed9e97-0ubuntu0sarvatt
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:0.0.16+git20120120.b0d7f4dd-0ubuntu0sarvatt

Revision history for this message
In , Loris Zinsou (nepenthes) wrote :

According to this ( http://bugs.winehq.org/show_bug.cgi?id=30057 ) bug report, any application needing mouse warp or window clipping is broken with Wine 1.4 and any xserver from 1.11 to 1.12 and later.
Many 3D apps controlled by mouse are affected, and as a result are unusable.

According to Wine developper Alexandre Julliard : "The devices claim to report relative motion but they send absolute coordinates. I don't think there's anything we can do about that, you'll have to report it to xorg."

Revision history for this message
In , Loris Zinsou (nepenthes) wrote :

Created attachment 58055
Wine trace for Mass Effect (Steam version)

I do not know if this is useful in any way, but here is a wine trace for Mass Effect (Steam version).
I runs perfectly with wine 1.4rc6 and xserver 1.10, but mouse input is broken with xserver 1.11 and 1.12.
Whatever direction I try to turn the pointer, it first goes to the right for half a second, then either continues to turn in the wrong direction, or goes in right direction.
It seems it depends on pointer movement speed or touch pressure (I use a touchpad), I 'm not sure.

That makes the game unplayable.

This behaviour is even worse with Crysis, Bioshock and other apps, with the sensitivity being much to high, and the view going in every direction and ending pointing to the floor with a minor mouse movement.

Revision history for this message
In , Loris Zinsou (nepenthes) wrote :

Created attachment 58056
Wine trace for Crysis 2

Revision history for this message
Loris Zinsou (nepenthes) wrote :
Revision history for this message
Loris Zinsou (nepenthes) wrote :

This a test program by Henri Verbeet.
According to its author :
"It prints the mouse coordinates to the terminal,
you mostly care about "delta" for this bug. Press 'C' to enable / disable
clipping, press 'W' to warp the mouse. Note that this doesn't necessarily
behave the same as those games, but it should be enough for basic testing of
relative mouse events."

Revision history for this message
Loris Zinsou (nepenthes) wrote :

This the log i get from the program, maybe more readble than full Mass Effect output.

Revision history for this message
Loris Zinsou (nepenthes) wrote :

Here is a video showing mouse par int the first part (that places my cursor to an arbitrary position, then does nothing, no warp).
In the second part, I start clipping, but the clipping zone does not fit in the white test window.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in xinput (Ubuntu):
status: New → Confirmed
Revision history for this message
Rocko (rockorequin) wrote :

This program illustrates the problem, displaying a window and the output results (to compile, use: gcc rawmotion.c -o rawmotion -lX11 -lXi).

In xserver 1.11, the raw_values it displays are relative and the valuators.values are absolute. In xserver 1.10, the two streams are both relative.

Revision history for this message
entonjackson (aj-mysc) wrote :

Same here. Specially annoying when playing fullscreen games!

Revision history for this message
In , Leif Walsh (leif.walsh) wrote :

Created attachment 58461
trace for borderlands

generated by setting WINEDEBUG=+cursor and running borderlands, playing enough to expose the bug, and quitting, then filtering out any lines without ':cursor:'

Revision history for this message
Rocko (rockorequin) wrote :

FYI, I uploaded a patch for wine (http://bugs.winehq.org/attachment.cgi?id=39256) that either fixes it (if XI2 is intentionally returning absolute values) or works around the problem (if it's a regression in xserver).

Revision history for this message
In , Rocko (rockorequin) wrote :

Created attachment 58533
program illustrating the issue

The attached program illustrates the regression. It prints out the raw_values and (transformed) valuator.values reported for XI_RawMotion mouse movement events.

On xserver 1.10, the raw_values and valuator.values are the same (on my system, at least), ie both are relative, which makes sense because my mouse is a relative device.

On xserver 1.11, the raw_values are relative but the valuator.values are absolute.

Revision history for this message
entonjackson (aj-mysc) wrote :

I cannot apply the patch, because i can't compile it on amd64.
it tells me there are 32bit X libraries missing... anyway.
Please commit the fix, if it's really fixing this issue without creating another.

Revision history for this message
Rocko (rockorequin) wrote :

The problem is that the patch doesn't allow for any acceleration or clipping that X normally supplies, so it is unlikely to be committed.

If you are having trouble building wine on ubuntu 12.04, there are some workarounds you can try that I detailed in https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/949606. One of them is to install all the i386 dev libraries that you need, even though it breaks amd64 compilation (you can reverse the process afterwards).

Revision history for this message
Bryce Harrington (bryce) wrote :

xinput's actually a client tool used on the console, I don't think it has anything to do with this issue. Bumping back to xorg package for re-triage.

affects: xinput (Ubuntu) → xorg (Ubuntu)
Changed in xorg (Ubuntu):
status: Confirmed → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Bryce Harrington (bryce)
affects: xorg (Ubuntu) → xorg-server (Ubuntu)
Changed in xorg-server (Ubuntu):
status: New → Confirmed
Bryce Harrington (bryce)
Changed in xorg-server (Ubuntu):
assignee: nobody → Chase Douglas (chasedouglas)
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
In , Peter Hutterer (peter-hutterer) wrote :
Revision history for this message
In , Sven Arvidsson (sa) wrote :

(In reply to comment #5)
> http://patchwork.freedesktop.org/patch/9595/

Thank you! Wine is working fine with the patch applied.

Changed in xorg-server:
importance: Unknown → Medium
status: Unknown → In Progress
Revision history for this message
In , Loris Zinsou (nepenthes) wrote :

It works ! Thanks.

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xorg-server - 2:1.11.4-0ubuntu8

---------------
xorg-server (2:1.11.4-0ubuntu8) precise; urgency=low

  [ Chase Douglas ]
  * Fix crash at startup due to input option abi break (LP: #931397)
    - Revert two commits from upstream 1.12 input stack

  [ Bryce Harrington ]
  * debian/patches/227_null_ptr_midispcur.patch:
    - Check for NULL pointer before dereferencing pointer from
      miGetDCDevice. Fixes crash after connecting a bluetooth keyboard.
      (LP: #930936)

  [ Chase Douglas ]
  * Fix mouse warping and clipping (LP: #948938)
    - Add temporary patch 503_fix_mouse_warp.patch
  * Implement passive touch ungrab (LP: #968726)
    - Add temporary patch 503_implement_passive_touch_ungrab.patch
  * Bump lintian standards to 3.9.3
 -- Chase Douglas <email address hidden> Thu, 29 Mar 2012 18:09:19 -0700

Changed in xorg-server (Ubuntu):
status: Triaged → Fix Released
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.