From owner-freebsd-x11@FreeBSD.ORG Thu Mar 27 23:08:48 2008 Return-Path: Delivered-To: freebsd-x11@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 7AB57106564A; Thu, 27 Mar 2008 23:08:47 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Joe Marcus Clarke Date: Thu, 27 Mar 2008 19:08:32 -0400 User-Agent: KMail/1.6.2 References: <47EA7ED2.8030406@freebsd.org> <47EB9A2B.4060203@FreeBSD.org> <47EBCED1.8060308@freebsd.org> In-Reply-To: <47EBCED1.8060308@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_yjC7HlwdBk6HDMJ" Message-Id: <200803271908.34129.jkim@FreeBSD.org> Cc: freebsd-x11@freebsd.org, cokane@freebsd.org Subject: Re: X pausing until mouse move (collecting commonalities) X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2008 23:08:48 -0000 --Boundary-00=_yjC7HlwdBk6HDMJ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Thursday 27 March 2008 12:44 pm, Joe Marcus Clarke wrote: > Coleman Kane wrote: > > Coleman Kane wrote: > >> Joe Marcus Clarke wrote: > >>> On Wed, 2008-03-26 at 16:54 -0400, Jung-uk Kim wrote: > >>>> On Wednesday 26 March 2008 12:50 pm, Joe Marcus Clarke wrote: > >>>>> I'm trying to get a list of commonalities to better focus my > >>>>> troubleshooting. So far, my two machines that are affected > >>>>> have the following in common: > >>>>> > >>>>> GNOME 2.22 (with hald) > >>>>> nVidia graphics card (though different drivers) > >>>>> PS/2 mouse > >>>>> dual core > >>>>> ULE scheduler > >>>>> > >>>>> My one machine that is not affected differs from this in that > >>>>> it has an Intel graphics card, USB mouse, and is not dual > >>>>> core (but HTT). > >>>>> > >>>>> It looks like Coleman has a PS/2 mouse as well. It's > >>>>> starting to look like the mouse technology might have > >>>>> something to do with this. Anyone seeing this problem with a > >>>>> USB mouse? > >>>> > >>>> I think I know why. Build xorg-server without HAL support > >>>> option and the attached patch. With HAL support (default) and > >>>> hald running, xorg-server auto-detects individual ports with > >>>> input.mouse capability even without configuration lines in > >>>> xorg.conf. If moused is enabled and USB mouse is used, > >>>> /dev/ums0 is directly used because there is a problem in MD > >>>> code (see attached patch). If moused is enabled and PS/2 > >>>> mouse is used, you end up with two input devices via > >>>> /dev/sysmouse and /dev/psm0. I couldn't find a cleaner way to > >>>> fix this problem, though. :-( > >>> > >>> Thanks for finding this. Here is a patch for hal which adds a > >>> mouse addon. The mouse addon polls to find whether or not > >>> moused has a given mouse device open. If it does, it sets the > >>> input device to be /dev/sysmouse instead of the actual device. > >>> Hopefully it will fix the problem without needing to disable > >>> hal support in X. I have also merged your gettimeofday > >>> patches, jkim. > >>> > >>> http://www.marcuscom.com/downloads/hal.diff > >>> > >>> Joe > >> > >> I had to apply the attached change to your patch in order to get > >> it to work (addon/ should be addons/). Attached is the diff to > >> your diff that worked for me. > >> > >> -- > >> Coleman Kane > > > > Unfortunately, I still experience the same mouse-blocked behavior > > after applying this patch, reinstalling the port, and then > > restarting my machine (and setting the mouse device back to > > SysMouse and /dev/sysmouse in xorg.conf, and re-enabling moused). > > Yeah. While the addon is doing its job, X now opens two instances > of /dev/sysmouse :-(. I still don't know why it does this when it > doesn't open two instances of /dev/psm0. I found why. See config/hal.c in xorg-server. It does not add Option "Device" although Linux-specific and undocumented Option "Path" for evdev is added. Thus default mouse device /dev/sysmouse is picked up. Fortunately the bug is fixed in the latest version with the following commit: http://cgit.freedesktop.org/xorg/xserver/commit/?id=47eb658e802775021e3efec109f95431cca188ca This chunk: --------- + /* most drivers use device.. not path. evdev uses both however, but the + * path version isn't documented apparently. support both for now. */ add_option(&options, "path", path); + add_option(&options, "device", path); --------- See the attached patches. Jung-uk Kim --Boundary-00=_yjC7HlwdBk6HDMJ Content-Type: text/plain; charset="iso-8859-1"; name="patch-Xserver-hw-xfree86-os-support-bsd-bsd_mouse.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch-Xserver-hw-xfree86-os-support-bsd-bsd_mouse.c" --- hw/xfree86/os-support/bsd/bsd_mouse.c.orig 2007-08-23 15:05:48.000000000 -0400 +++ hw/xfree86/os-support/bsd/bsd_mouse.c 2008-03-27 17:36:25.000000000 -0400 @@ -75,12 +75,10 @@ /* These are for FreeBSD and DragonFly */ #define DEFAULT_MOUSE_DEV "/dev/mouse" #define DEFAULT_SYSMOUSE_DEV "/dev/sysmouse" -#define DEFAULT_PS2_DEV "/dev/psm0" static const char *mouseDevs[] = { DEFAULT_MOUSE_DEV, DEFAULT_SYSMOUSE_DEV, - DEFAULT_PS2_DEV, NULL }; #elif defined(__OpenBSD__) && defined(WSCONS_SUPPORT) @@ -250,7 +248,7 @@ #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) -#define MOUSED_PID_FILE "/var/run/moused.pid" +#define CMD_FIND_MOUSED "pgrep -nx moused" /* * Try to check if moused is running. DEFAULT_SYSMOUSE_DEV is useless without @@ -262,14 +260,12 @@ FILE *f = NULL; unsigned int pid; - if ((f = fopen(MOUSED_PID_FILE, "r")) != NULL) { + if ((f = popen(CMD_FIND_MOUSED, "r")) != NULL) { if (fscanf(f, "%u", &pid) == 1 && pid > 0) { - if (kill(pid, 0) == 0) { - fclose(f); + pclose(f); return TRUE; - } } - fclose(f); + pclose(f); } return FALSE; } --Boundary-00=_yjC7HlwdBk6HDMJ Content-Type: text/plain; charset="iso-8859-1"; name="patch-config-hal.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch-config-hal.c" --- config/hal.c.orig 2007-08-23 15:04:52.000000000 -0400 +++ config/hal.c 2008-03-27 18:36:36.000000000 -0400 @@ -212,6 +212,7 @@ } add_option(&options, "path", path); + add_option(&options, "device", path); add_option(&options, "driver", driver); add_option(&options, "name", name); config_info = xalloc(strlen(udi) + 5); /* "hal:" and NULL */ --Boundary-00=_yjC7HlwdBk6HDMJ--