XFree86/QNX SerialRead blocking change

Hi Frank,

I ran into a problem with using a serial touch screen (ELO) with XFree86.
The problem was that events seemed blocked when using the serial touch
screen - I think other people experienced the same problem with serial mouse

  • if they don’t use devi-hirun.

Following will solve the problem:

change line 198 in posix_tty.c (in
xc/programs/Xserver/hw/xfree86/os-support/nto) from:

i &= ~O_NONBLOCK;

to:

i |= O_NONBLOCK;

I don’t think it will break anything else.


Jens

I haven’t seen that problem since I am using “devi-hirun” and let
the OS deal with mouse (serial, PS2, or any other qnx supported types).
Touch screen devices can probably be dealt same way, say, “devi-elo”.
The good side is we can leave the dirty work to QNX :slight_smile:

I can understand that sometimes you may need to access the pointer
devices raw. I will pass your email to the XFree86 developers because
the “posix_tty.c” is actually a symlink to
xc/programs/Xserver/hw/xfree86/os-support/shared directory. The symlink
is created dynamicallly during the make. Since “posix_tty.c” is
in the “shared” directory and being shared by other OSes, I want
to make sure your change won’t break other people.
Thanks for all your work!

Frank

On Mon, 25 Mar 2002 JHJ=UiaQT4aTYH8AvxtiuMwx3w@public.gmane.org wrote:

Hi Frank,

I ran into a problem with using a serial touch screen (ELO) with XFree86.
The problem was that events seemed blocked when using the serial touch
screen - I think other people experienced the same problem with serial mouse

  • if they don’t use devi-hirun.

Following will solve the problem:

change line 198 in posix_tty.c (in
xc/programs/Xserver/hw/xfree86/os-support/nto) from:

i &= ~O_NONBLOCK;

to:

i |= O_NONBLOCK;

I don’t think it will break anything else.


Jens

Here is an reply from a guy from MetroLink, who donated that code.
Hope it’s helpful.
Frank

Date: Mon, 25 Mar 2002 18:01:11 -0500 (EST)
From: Chris Bare <chris=Xj3gvuFHFKZiLUuM0BA3LQ@public.gmane.org>
Reply-To: devel=72qDnkntNoRAfugRpC6u6w@public.gmane.org
To: devel=72qDnkntNoRAfugRpC6u6w@public.gmane.org
Subject: Re: xf-4.2, event blocking

When MetroLink donated that code, the XInput drivers we also donated
were designed to operate with the port opened in blocking mode. If you
use non-blocking, the server can chew up a lot of unnecessary CPU cycles
waiting for the incredibly slow serial input.

I recommend that he look at the implementation of the elo driver. It
could be that the VMIN and VTIME settings are not correct. VMIN is the
minimum number of bytes that must be recieved by the kernel before the
calling process will return from a read. If VMIN is set too large for
the protocol you are using it could cause this type of problem.

I wouldn’t recommend making this change for all OS’s, as this code has
been in use for quite a while and I’m not aware of similar complaints on
Linux etc. Perhaps it’s a QNX thing, but I’d be more suspicious of the
driver.

The original code we donated also supported a config file option to set
non blocking. That would have been an easy work around, but that feature
has been removed.