From: Jindrich Makovicka <makovick@gmail.com>
To: kvm@vger.kernel.org
Subject: Re: Mouse motion lags
Date: Wed, 7 Jan 2009 00:04:23 +0100 [thread overview]
Message-ID: <20090107000423.44925189@holly> (raw)
In-Reply-To: <7bed83ad0901011408k261bf1d3g14c6483429a9474@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1351 bytes --]
On Fri, 2 Jan 2009 00:08:27 +0200
"Volodymyr Buell" <vbuell@gmail.com> wrote:
> On Thu, Jan 1, 2009 at 11:44 PM, Todd Deshane <deshantm@gmail.com>
> wrote:
> > On Thu, Jan 1, 2009 at 12:05 PM, Volodymyr Buell <vbuell@gmail.com>
> > wrote:
> >> Hi everybody,
> >>
> >> I switched to KVM some time ago from vmware and VB. Everything
> >> works great but there are noticeable lags in mouse motion in
> >> comparison with other VMs.
> >> Is this a known issue? Are there any optimizations for that?
> >>
> >> KVM: 79
> >> Distr: Ubuntu Intrepid & Jaunty
> >> Command line: QEMU_AUDIO_DRV=sdl; kvm -net nic -net user -soundhw
> >> es1370 -m 750 -smp 2 win.qcow
> >>
> >
> > Try adding -usb -usbdevice tablet
> >
> > Hope that helps.
>
> Unfortunately it brings yet more laggy result. It looks like mouse
> filtering in first person action games but again with the delay I
> mentioned before it's nearly unusable...
You can try the attached patch - it shortens the screen update interval
when the mouse moves. It's just a proof of concept and a little bit
ugly, but should work.
I once tried to submit something similar to QEMU upstream, when the
screen update interval was still hardcoded, but the patch wasn't
accepted. There could be some chance now when the update interval is
already dynamic so the modification is trivial.
--
Jindrich Makovicka
[-- Attachment #2: sdl.c.diff --]
[-- Type: text/x-patch, Size: 919 bytes --]
--- sdl.c.orig 2008-12-24 15:24:58.000000000 +0100
+++ sdl.c 2009-01-06 23:53:26.282639309 +0100
@@ -356,6 +356,7 @@
SDL_Event ev1, *ev = &ev1;
int mod_state;
int buttonstate = SDL_GetMouseState(NULL, NULL);
+ int moved = 0;
if (last_vm_running != vm_running) {
last_vm_running = vm_running;
@@ -484,6 +485,7 @@
absolute_enabled) {
sdl_send_mouse_event(ev->motion.xrel, ev->motion.yrel, 0,
ev->motion.x, ev->motion.y, ev->motion.state);
+ moved = 1;
}
break;
case SDL_MOUSEBUTTONDOWN:
@@ -536,6 +538,10 @@
break;
}
}
+ if (moved && ds->gui_timer_interval == 0)
+ ds->gui_timer_interval = 10;
+ else if (!moved && ds->gui_timer_interval == 10)
+ ds->gui_timer_interval = 0;
}
static void sdl_fill(DisplayState *ds, int x, int y, int w, int h, uint32_t c)
next prev parent reply other threads:[~2009-01-06 23:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-01 17:05 Mouse motion lags Volodymyr Buell
2009-01-01 21:44 ` Todd Deshane
2009-01-01 22:08 ` Volodymyr Buell
2009-01-06 23:04 ` Jindrich Makovicka [this message]
2009-01-04 13:27 ` Avi Kivity
2009-01-04 19:58 ` nuitari
2009-01-04 19:57 ` Avi Kivity
2009-01-06 6:26 ` Antoine Martin
2009-01-06 7:11 ` Jamie Kirkpatrick
2009-01-06 13:05 ` Antoine Martin
2009-01-06 7:36 ` Ian Kirk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090107000423.44925189@holly \
--to=makovick@gmail.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox