Re: XFree86 xsetpointer causes silo overflows (Was: Re: Fixed my MAMEd sio problem.)

1999-05-20 Thread David Dawes
On Wed, May 19, 1999 at 11:37:51PM +0930, Matthew Thyer wrote:
The big problem is that the silo overflows continue after I have
returned the pointer to the mouse (with xsetpointer pointer).

This should close the joystick device shouldn't it ?

No.  I've had a look through some of the XInput code, and it seems that
it isn't unusual for an Xserver to open all devices at server startup,
and not close them until server exit.  There are provisions for delaying
the open until the device is referenced, and for closing it before the
server exits.  The XFree86-specific XInput code does the former, but
not the latter.

Here are some comments from the Xserver/Xi code (which is not
XFree86-specific):

 * Caller:  ProcXOpenDevice
 * 
 * This is the implementation-dependent routine to open an input device.
 * Some implementations open all input devices when the server is first
 * initialized, and never close them.  Other implementations open only
 * the X pointer and keyboard devices during server initialization,
 * and only open other input devices when some client makes an
 * XOpenDevice request.  This entry point is for the latter type of
 * implementation.
 * 
 * If the physical device is not already open, do it here.  In this case,
 * you need to keep track of the fact that one or more clients has the
 * device open, and physically close it when the last client that has
 * it open does an XCloseDevice.
 *
 * The default implementation is to do nothing (assume all input devices
 * are opened during X server initialization and kept open).


 * Caller:  ProcXCloseDevice
 * 
 * Take care of implementation-dependent details of closing a device.
 * Some implementations may actually close the device, others may just
 * remove this clients interest in that device.
 * 
 * The default implementation is to do nothing (assume all input devices
 * are initialized during X server initialization and kept open).


There is one aspect of XFree86's XInput support that I do consider a
bug, and that is that it doesn't close the extended input devices when
VT switching away from the server.  We'll probably fix that in 4.0.

If it doesn't then there is a problem with either the X server
or FreeBSD.

Bruce has already indicated that there is a problem with the
FreeBSD joystick driver but he thought it should stop when the
joystick device is closed but I see that the problem continues
until I restart the X server so that would seem to indicate a
problem with the X server.

IMHO the problem is in the joystick driver and in your assumptions.  By
configuring the joystick in your Xserver config file, you're giving the
server exclusive use of the device for the lifetime of the X server
process.  Implementing more agressive closing might solve your particular
problem, but it doesn't deal with the real problem of the joystick driver
causing the silo overflows.

David


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-current in the body of the message



Re: XFree86 xsetpointer causes silo overflows (Was: Re: Fixed my MAMEd sio problem.)

1999-05-20 Thread Jean-Marc Zucconi
 David Dawes writes:

  IMHO the problem is in the joystick driver and in your assumptions.  By
  configuring the joystick in your Xserver config file, you're giving the
  server exclusive use of the device for the lifetime of the X server
  process.  Implementing more agressive closing might solve your particular
  problem, but it doesn't deal with the real problem of the joystick driver
  causing the silo overflows.

All interrupts are blocked when you read the joystick position, and
this is the reason of the silo overflows. It is almost impossible to
avoid (it could be possible to use a very high frequency timer and to
check the joystick status during the interrupts, but this has an
impact on the precision of the position).

However keeping the device opened can't cause silo overflows. It
seems rather than the X server continues to read the joystick
position after the client stops using it. This can be considered as a
bug in the X server.

Jean-Marc

-- 
 Jean-Marc ZucconiPGP Key: finger j...@freebsd.org


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-current in the body of the message



Re: XFree86 xsetpointer causes silo overflows (Was: Re: Fixed my MAMEd sio problem.)

1999-05-20 Thread David Dawes
On Thu, May 20, 1999 at 07:23:49PM +0200, Jean-Marc Zucconi wrote:
 David Dawes writes:

  IMHO the problem is in the joystick driver and in your assumptions.  By
  configuring the joystick in your Xserver config file, you're giving the
  server exclusive use of the device for the lifetime of the X server
  process.  Implementing more agressive closing might solve your particular
  problem, but it doesn't deal with the real problem of the joystick driver
  causing the silo overflows.

All interrupts are blocked when you read the joystick position, and
this is the reason of the silo overflows. It is almost impossible to
avoid (it could be possible to use a very high frequency timer and to
check the joystick status during the interrupts, but this has an
impact on the precision of the position).

However keeping the device opened can't cause silo overflows. It
seems rather than the X server continues to read the joystick
position after the client stops using it. This can be considered as a
bug in the X server.

That's implicit in the device remaining open.  In the context of the X
server's input device handling, Open means make active, and Close
means make inactive.  For most devices, the fd is added to the list of
fds to select() on.  For the joystick device, a timer callback is
installed to check the device at regular intervals.  This is never
disabled once it has been started.

If someone has a fix for this, please submit it to pa...@xfree86.org
and it can be included in our next 3.3.x release.  I'll keep this issue
in mind while working on the input device code for XFree86 4.0.

David


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-current in the body of the message



Re: XFree86 xsetpointer causes silo overflows (Was: Re: Fixed my MAMEd sio problem.)

1999-05-19 Thread David Dawes
On Wed, May 19, 1999 at 01:20:01AM +0930, Matthew Thyer wrote:
I have confirmed that the problem occurs if I just do:

  xsetpointer Joystick
  sleep 1
  xsetpointer pointer

So M.A.M.E. is unrelated to the problem as Bruce Evans would suggest.

So the problem appears to be with XFree86 not closing the joystick
device after I've used it as a pointer with 'xsetpointer'.

The problem is in the joystick driver (or are silo overflows acceptable
while you actually want to use the joystick?).

I am sure I am using xsetpointer correctly as I can use my PC joystick
as a pointing device (once I calibrate it).

I was just using xsetpointer with an incorrectly calibrated joystick
so it moved the pointer to the top left corner of the screen in my
xmame.sh shell script (I'd like to know how to do this another way).

A better way would be a small X client that uses XWarpPointer(3).

David


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-current in the body of the message



Re: XFree86 xsetpointer causes silo overflows (Was: Re: Fixed my MAMEd sio problem.)

1999-05-19 Thread Matthew Thyer
The big problem is that the silo overflows continue after I have
returned the pointer to the mouse (with xsetpointer pointer).

This should close the joystick device shouldn't it ?

If it doesn't then there is a problem with either the X server
or FreeBSD.

Bruce has already indicated that there is a problem with the
FreeBSD joystick driver but he thought it should stop when the
joystick device is closed but I see that the problem continues
until I restart the X server so that would seem to indicate a
problem with the X server.

David Dawes wrote:
 
 On Wed, May 19, 1999 at 01:20:01AM +0930, Matthew Thyer wrote:
 I have confirmed that the problem occurs if I just do:
 
   xsetpointer Joystick
   sleep 1
   xsetpointer pointer
 
 So M.A.M.E. is unrelated to the problem as Bruce Evans would suggest.
 
 So the problem appears to be with XFree86 not closing the joystick
 device after I've used it as a pointer with 'xsetpointer'.
 
 The problem is in the joystick driver (or are silo overflows acceptable
 while you actually want to use the joystick?).
 
 I am sure I am using xsetpointer correctly as I can use my PC joystick
 as a pointing device (once I calibrate it).
 
 I was just using xsetpointer with an incorrectly calibrated joystick
 so it moved the pointer to the top left corner of the screen in my
 xmame.sh shell script (I'd like to know how to do this another way).
 
 A better way would be a small X client that uses XWarpPointer(3).
 
 David
 
 To Unsubscribe: send mail to majord...@freebsd.org
 with unsubscribe freebsd-current in the body of the message

-- 
/===\
| Work: matthew.th...@dsto.defence.gov.au | Home: thy...@camtech.net.au |
\===/
If it is true that our Universe has a zero net value for all conserved
quantities, then it may simply be a fluctuation of the vacuum of some
larger space in which our Universe is imbedded. In answer to the
question of why it happened, I offer the modest proposal that our
Universe is simply one of those things which happen from time to time.
 E. P. Tryon   from Nature Vol.246 Dec.14, 1973


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-current in the body of the message