From nobody@FreeBSD.org  Wed Mar 30 17:16:39 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9614716A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 30 Mar 2005 17:16:39 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 0D6C143D31
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 30 Mar 2005 17:16:39 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j2UHGcod064121
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 30 Mar 2005 17:16:38 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j2UHGcKc064120;
	Wed, 30 Mar 2005 17:16:38 GMT
	(envelope-from nobody)
Message-Id: <200503301716.j2UHGcKc064120@www.freebsd.org>
Date: Wed, 30 Mar 2005 17:16:38 GMT
From: Jukka Ukkonen <jau@iki.fi>
To: freebsd-gnats-submit@FreeBSD.org
Subject: moused causes random mouse events with a PS/2 mouse on FreeBSD-4.11
X-Send-Pr-Version: www-2.3

>Number:         79376
>Category:       bin
>Synopsis:       moused(8) causes random mouse events with a PS/2 mouse on FreeBSD-4.11
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       4.x
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 30 17:20:03 GMT 2005
>Closed-Date:    
>Last-Modified:  Sat May 24 23:13:01 UTC 2008
>Originator:     Jukka Ukkonen
>Release:        FreeBSD 4.11-STABLE
>Organization:
>Environment:
FreeBSD mjolnir 4.11-STABLE FreeBSD 4.11-STABLE #3: Tue Mar 29 12:08:01 EEST 2005     root@mjolnir:/usr/obj/home/src/sys/Mjolnir  i386


Additionally there are:
- XFree86-libraries-4.4.0_3 and
- XFree86-Server-4.4.0_7.

>Description:
      When using moused to handle a PS/2 mouse there are a lot of random
mouse events in X11 applications. It is quite typical to see key press and
drag marking something while one is really only moving the mouse to completely
different direction, etc.
This problem is not visible at all when the XFree86 server handles reads
/dev/psm0 itself.
The problem only appears when moused is used to handle /dev/psm0 and pass
the events to /dev/sysmouse.

Without having any deeper understanding about how moused works, I can only
guess what is going on, but I try describe the symptoms I have seen.
It seems like either moused somehow drops out of sync with the mouse data
stream or it fails somehow trying to combine incoming mouse events to larger
events to before passing them to /dev/sysmouse (or something similar).
Anyhow on occasion (actually all too often) moused seems to trigger these
totally erratic bursts of mouse events.
The events really come in bursts and usually they cause a lot of harm and
confusion, because one cannot really know any more what commands might
have been entered to and xterm with a shell, what new files have been
created, what might have been deleted, etc.
The erratic events simply copy and paste random strings or often times
several lines from the screen. Often the copied text might end up in
another xterm window then where the text came from, etc.

The fact that I no similar problems when using the same mouse device
on its own with XFree86 has convinced me that neither the device itself,
nor the psm driver, nor XFree86 is the culprit.
So, this practically leaves only moused left to blame.

>How-To-Repeat:
      Take 4.11-STABLE with a PS/2 intellimouse with roller, moused with options
"-p /dev/psm0 -t auto", and make XFree86-Server-4.4.0_7 read its mouse events
from /dev/sysmouse.
For me this patently repeats the problem within a few minutes.
A quicker means to make the problem appear would probably be pressing the left
mouse button and moving the mouse quickly back and forth a few times.

>Fix:
      I really wish I knew. I'd be posting the fix instead of trying to describe
the symptoms now, if I had any clue. ;-)


>Release-Note:
>Audit-Trail:

From: "Jukka A. Ukkonen" <jau@mawit.com>
To: freebsd-gnats-submit@FreeBSD.org, jau@iki.fi
Cc:  
Subject: Re: bin/79376: moused causes random mouse events with a PS/2 mouse
 on FreeBSD-4.11
Date: Fri, 01 Apr 2005 08:50:20 +0300

 	Apparently the assumption that the culprit is moused was wrong.
 	The same symptoms appear also when moused is not used.
 	The problem only appears a lot more frequently when moused is
 	used. It took me several days to notice the symptoms when I
 	stopped using moused.
 
 	The roots are supposedly somewhere else than moused itself,
 	but using moused makes the problem much worse.
 
 	// jau
 
State-Changed-From-To: open->feedback 
State-Changed-By: ceri 
State-Changed-When: Fri Nov 4 19:53:44 GMT 2005 
State-Changed-Why:  
Does this issue still exist in 5.x or 6.x?  Bugs outstanding only 
in 4.x are unlikely to get fixed; developers are focussing mainly on 6.x 
releases. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=79376 

From: "=?ISO-8859-1?Q?G=E1bor_G=E1bris?=" <gabrisgabor@gmail.com>
To: bug-followup@FreeBSD.org, jau@iki.fi
Cc:  
Subject: bin/79376 : moused causes random mouse events with a PS/2 mouse on FreeBSD-4.11
Date: Thu, 1 Jun 2006 14:10:49 +0200

 ------=_Part_1863_167829.1149163849650
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 I have the same problem with either FreeBSD 6.0 or 6.1 (and with PC-BSD,
 based on FreeBSD). My mouse is a Samsung optical, type:SMOP5000WX. The best
 results I had was that I could use the mouse very carefully and slowly, but
 when I moved it a bit faster it jumped back to left side/left-bottom corner
 of the screen. Moused flags were:
 
 -p /dev/psm0 -t ps/2
 
 in X the device pointed to dev/sysmouse
 
 ------=_Part_1863_167829.1149163849650
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 I have the same problem with either FreeBSD 6.0 or 6.1 (and with PC-BSD, based on FreeBSD). My mouse is a Samsung optical, type:SMOP5000WX. The best results I had was that I could use the mouse very carefully and slowly, but when I moved it a bit faster it jumped back to left side/left-bottom corner of the screen. Moused flags were: 
 <br><pre>-p /dev/psm0 -t ps/2<br><br>in X the device pointed to dev/sysmouse<br></pre>
 
 ------=_Part_1863_167829.1149163849650--
State-Changed-From-To: feedback->open 
State-Changed-By: linimon 
State-Changed-When: Tue Jun 12 05:04:55 UTC 2007 
State-Changed-Why:  
Apparently the problem still existed as of 6.1.  To submitter: does it still 
exist in RELENG_6? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=79376 

From: linimon@lonesome.com (Mark Linimon)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/79376: moused causes random mouse events with a PS/2 mouse on FreeBSD-4.11
Date: Sun, 22 Jul 2007 22:31:15 -0500

 ----- Forwarded message from "Jukka A. Ukkonen" <jau@iki.fi> -----
 
 Posted-Date: Tue, 12 Jun 2007 10:22:29 +0300 (EEST)
 
 	As far as I can remember (meaning a couple months maybe ;-)
 	I have not seen this to an extent that I had really paid any
 	special attention to it.
 	Just in case these little details might have any effect on
 	how the computer sees the mouse events I have PSM flags set
 	in device.hints to
 
 		hint.psm.0.flags="0x6004"
 
 	and the secondly my mouse is connected through a KVM switch
 	which might actually filter or smooth some unexpected or too
 	sharp movements which might be caused by PS/2 protocol being
 	dropped out of sync or by inductive errors on the mouse cord.
 
 	Obviously I have no idea of the internals of the KVM switch.
 	My guess is though that since it is just a small and cheap
 	box it most likely does not provide a lot of "intelligent"
 	features.
 	So, I have not been actually bothered by the problem for some
 	time, but I do not think it should as such be taken as proving
 	the case one way or the other. Most I can say is that I can
 	not confirm the problem while using 6.2-STABLE/RELENG_6.
 
 
 	Cheers,
 		// jau
 .---  ..-  -.-  -.-  .-    .-  .-.-.-    ..-  -.-  -.-  ---  -.  .  -.
   /    Jukka A. Ukkonen,                             Oxit Ltd, Finland
  /__   M.Sc. (sw-eng & cs)                    (Phone) +358-500-606-671
    /   Internet: Jukka.Ukkonen(a)Oxit.Fi        (Home) +358-9-6215-280
   /    Internet: jau(a)iki.fi
  v
         .---  .-  ..-  ...-.-  ..  -.-  ..  .-.-.-  ..-.  ..
 + + + + My opinions are mine and mine alone, not my employers. + + + +
 
 ----- End forwarded message -----
>Unformatted:
