Index: [thread] [date] [subject] [author]
  From: Marcus Sundberg <mackan@stacken.kth.se>
  To  : ggi-develop@eskimo.com
  Date: Wed, 19 May 1999 07:51:59 +0000

Re: Mouse: Error reading mouse: Resource temporarily unavailable

teunis wrote:
> 
> On Tue, 18 May 1999, Marcus Sundberg wrote:
> 
> > teunis wrote:
> > >
> > > Mouse: Error reading mouse: Resource temporarily unavailable
> > >
> > > this error message is always received on any amount of data coming in
> from
> > > /dev/gpmdata pipethrough.  (/dev/gpmdata is a FIFO buffer iirc)
> > >
> > > This -was- fixed before.
> > >
> > > Why is this message back?
> > > (as near as I can tell just disabling the errormessage fixed it before)
> > >
> > > Watching this scroll by -every- slightest movement of the mouse is
> > > highly... irritating.
> > >
> > > Could this -please- be fixed for once and for all... and a note placed?
> > > This only seems to show up when I use GPM as the mouse pipethrough (which
> > > I -always- do as it's used for coordinating X as well... though as I'm
> > > using XGGI it's no longer such a big deal)
> >
> > I need more info in order to fix anything.
> > What application(s) does it appear with and what arguments did you use?
> > Did you set any GGI-related env-vars?
> > Did you config your mouse?
> > What does GGI_DEBUG=255 tell you?
> 
> ALL ggi programs.
> ANY parameters.
> the mouse driver is the problem  - this error message is spat out by the
> linux_mouse driver (iirc) when it can't get any data.
> 
> off of the FIFO gpm pipe (/dev/gpmdata which is incidentally where
> /dev/mouse is pointing) this happens.
> 
> Doesn't anyone else pipe all their mouse stuff through GPM?  Does anyone
> else have a mouse-systems mouse that requires this or the mouse crashes if
> more than one program (ie gpm + -anything- else) is loaded?  X is the
> usual culprit but GGI does it too - it's a problem with how mouse-systems
> mice are initialized;

Yes, i know there are people who does this, but they probably doesn't
try
to have two drivers driving the same mouse. ;-)

> Ideas?  This is a GGI problem dealing with a gpm FIFO!

No, it's a problem when you open the same mouse twice.

> I've tracked this before and I can track it again.  Should I post what
> file and line the prob is?  If so here it is:
> 
> This just watches for errno=EAGAIN and doesn't do perror if this is what
> it is.  AFAIK this -is- a correct patch because as far as I know EAGAIN
> just means check the data again.  It's line ~658 as far as I know...
> also had to include <errno.h> at the top.  That's it.
> 
>         if (read_len <= 0) {
>                 if (read_len == 0) {
>                         /* End-of-file occured */
>                         mpriv->eof = 1;
>                         GIIDPRINT_EVENTS("Mouse: EOF occured on fd: %d\n",
>                                          mpriv->fd);
>                         return 0;
>                 }
>                 /* Error, we try again next time */
>                 if (errno==EAGAIN) return 0; /* this fixes a gpm problem */
>                 perror("Mouse: Error reading mouse");
>                 return 0;
>         }
> 
> It works for me (tm)

I will apply the above diff because it is generally a good thing.
But please consider to fix your problem in the right way like I
describe below.

> Oh an explanation of my GGI_INPUT and why I -don't- use /dev/mouse:
> export GGI_INPUT="(linux-mouse:msc,/dev/gpmdata):(linux-mouse:mman,/dev/ttyS0)"
> 
> Primary mouse : /dev/gpmdata; protocol mouse-systems
>         - at the moment this is a Zoltrix PS/2 mouse with a wheel that GPM
>                 doesn't support going through GPM which turns all mice
>                 into mouse-systems mice.

If you have /dev/mouse as a symlink to gpmdata and update your LibGII
to current CVS you can just remove the first part of GGI_INPUT and 
you will still have both mice.

> Incidentally is it possible to tell mice apart using GGI or GII?  Or
> should I open a seperate GII device for the cyberman?

You can see where events come from by checking the origin field in
them.

//Marcus
-- 
-------------------------------+------------------------------------
        Marcus Sundberg        | http://www.stacken.kth.se/~mackan/
 Royal Institute of Technology |       Phone: +46 707 295404
       Stockholm, Sweden       |   E-Mail: mackan@stacken.kth.se

Index: [thread] [date] [subject] [author]