[Bug 30127] New: Perfect World: Noticeable keyboard input lag happens at certain circumstances

wine-bugs at winehq.org wine-bugs at winehq.org
Sat Mar 10 07:32:57 CST 2012


             Bug #: 30127
           Summary: Perfect World: Noticeable keyboard input lag happens
                    at certain circumstances
           Product: Wine
           Version: 1.3.34
          Platform: x86
               URL: http://pwi.perfectworld.com/
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: user32
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: mooroon2 at mail.ru
                CC: julliard at winehq.org
    Classification: Unclassified
   Regression SHA1: cb3b7237925a24ba4c5696dd079fdc5d99a48577

Created attachment 39286
  --> http://bugs.winehq.org/attachment.cgi?id=39286
Patch to disable wined3d usage of EXT_swap_control extension.

Here are bisect results:

[lexa2 at lx2linux build]$ cd /misc/Raid5/Projects/Wine/wine-git/; git reset
--hard ; git bisect good
HEAD is now at 5a30e31 server: Optionally return the global key state when
queueing a hardware message.
cb3b7237925a24ba4c5696dd079fdc5d99a48577 is the first bad commit
commit cb3b7237925a24ba4c5696dd079fdc5d99a48577
Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Dec 15 14:30:41 2011 +0100

    user32: Cache the global key state to avoid performance issues in
applications that poll constantly.

:040000 040000 6fc9980517e631c9e7145313c1634713a36b11f4
dbc782b9be4295845ba663e5830b8114a67b290c M      dlls

System specs: 32bit linux kernel, AMD Phenom II x4 955,
nVIDIA GeForce GTX 550 Ti with 1Gb VRAM, nVIDIA binary drivers v.295.17.

How to reproduce:
This bug is a pretty hard to catch as there's one requirement for it to show
itself up in this game: FPS should be sufficiently high and thus vsync should
be turned off. The game is buggy per itself as it always requests
WINED3DPRESENT_INTERVAL_DEFAULT when being run in window, and it behaves
somewhat unstable when run in fullscreen mode (window contents stuck without
redrawing after a while), so one would have to force-disable VSYNC which isn't
easily possible with current nVIDIA linux drivers and/or Wine. Personally I use
a simple patch which prevents Wine from calling EXT_swap_control and thus
allows me to control vsync using nVIDIA driver control panel. I would attach
this patch to this bug report in a few minutes.

There's another bug that affects FPS in this game heavily, which is major
slowdown in case wined3d utilizes ARB_map_buffer_rage. This usage had been
enabled by commit 68b15bc5f, so I have to revert that commit with another
simple patch (or by using "git show 68b15bc5f | git apply -R --").

Having vsync and ARB_map_buffer_rage usage disabled one may proceed with
starting up the game and heading towards some location where FPS isn't too low
(35+ will do, the more - the better). Easiest way to check current fps is to 
use "+fps" debug channel.

As soon as game character is at the place where fps is 35+ - try to move the
character around by using "WASD" keys. You would notice that about half of
short presses (i.e. quickly tap "A" or "D" key, do not hold it pressed for a
prolonged time) are merely lost, and game reactions to actions like "press and
hold A key" might be delayed for as much as about a second (maybe slightly
less, I'm writing "about a second" basing on personal feel and human senses
aren't that exact).

Then, exit the game, revert commit cb3b7237, recompile Wine and start the game
up again. Proceed with the testing procedure described in the paragraph above
and you would notice that the lag had gone.

>From inspecting the commit cb3b7237 contents it looks like that input lag
should be somewhat expected with this patch in place, but is shouldn't be
larger than 50 ticks - which is not the case obviously, because 50 ticks are
not something that "feels like about a second". On the other hand, I'm not that
good in knowing all the inside chemistry of Wine's user32 implementation when
it comes to handling keyboard input so I might just be misinterpreting the
commit contents.

Another moment to note: when the bug is in place (i.e. running the game with
non-reverted commit cb3b7237 and at a place where FPS is 35+) there's and easy
way to "somewhat workaround" keyboard input lag. All you have to do is to press
and hold right mouse button - and there would be no more keyboard input lag.
Just in case you don't figure it out: click-n-holding RMB is used in game to
change to viewing angle, and the angle changes with the mouse movement while
you hold RMB.

P.S. There's another bug in wined3d blt implementation affecting this game,
about which I had posted another bug report #30115. Patch that fixes blt
implementation for this game had been attached to that bug report, but it is
not required/relevant for reproducing input lag bug. OTOH one may wish to use
that patch also so the in-game icons would be displayed properly making testing

Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.

More information about the wine-bugs mailing list