Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 7459 - /dev/psaux can't be opened (gpm and X)
Summary: /dev/psaux can't be opened (gpm and X)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-04 07:55 UTC by eekaikko
Modified: 2003-02-04 19:42 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
kernel config (.config,24.49 KB, text/plain)
2002-09-05 03:03 UTC, eekaikko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description eekaikko 2002-09-04 07:55:03 UTC
I have installed gentoo from 1.4beta stage1, then rsync'ed, updated
and installed new packeges several times. I have installed and built
my own kernel from gentoo-sources (2.4.19). When I installed X, the
server started by startx couldn't open mouse:


(**) Option "Protocol" "IMPS/2"
(**) Mouse1: Protocol: "IMPS/2"
(**) Option "CorePointer"
(**) Mouse1: Core Pointer
(**) Option "Device" "/dev/psaux"
(EE) xf86OpenSerial: Cannot open device /dev/psaux
	No such device or address.
(EE) Mouse1: cannot open input device
(EE) PreInit failed for input device "Mouse1"
(II) UnloadModule: "mouse"
(II) Keyboard "Keyboard1" handled by legacy driver
(WW) No core pointer registered
No core pointer

Fatal server error:
failed to initialize core devices


I try to start gpm:

gpm -m /dev/psaux
oops(): [...path... gpm.c(956)]:
Could not open /dev/psaux


First of all, I have to remove /var/run/gpm.pid manually (this is
gpm bug, I think). Then I can start gpm normally - no error messages.
After that X can also open mouse normally. If I now quit X, kill gpm
and try to start X again, it starts normally but mouse will not work.
The pointer just stays in one place. So, gpm must be running for X to
work.

Other devices pointing to my psaux-mouse didn't work either.

I don't know if this is related to devfs, but for me it looks like that.
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2002-09-04 16:08:24 UTC
1) To what bus is the mouse attatched ?

2) Did you compile in "input" support in kernel, and also mouse support
   under caracter devices (i think) ?
Comment 2 eekaikko 2002-09-05 03:03:52 UTC
Created attachment 3674 [details]
kernel config

Here is my kernel configuration.
Comment 3 eekaikko 2002-09-05 03:11:40 UTC
My mouse is a normal ps2 mouse in the ps2 mouse bus. It works well in 
Debian and Red Hat, which I also use in this machine. 
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2002-09-05 14:37:03 UTC
Hmm.  Does /dev/psaux exist ?  On devfs it is a symlink ... the link valid ?
Try using /dev/misc/psaux ?

About gpm .. it just too braindead to clean the pid after itself.
Comment 5 eekaikko 2002-09-06 05:21:27 UTC
Script started on Fri Sep  6 13:01:42 2002
# ls -l /dev/psaux 
lr-xr-xr-x    1 root     root           10 Sep  6 13:01 /dev/psaux -> misc/psaux
# ls -l /dev/misc/psaux 
crw-r-----    1 root     root      10,   1 Jan  1  1970 /dev/misc/psaux
# ls -l /dev/mouse 
lr-xr-xr-x    1 root     root           10 Sep  6 13:01 /dev/mouse -> misc/psaux
# gpm -m /dev/misc/psaux 
# oops(): [/var/tmp/portage/gpm-1.20.0-r3/work/gpm-1.20.0/src/gpm.c(956)]: 
Could not open /dev/misc/psaux.

# rm /var/run/gpm.pid 
# gpm -m /dev/misc/psaux 
# 
# #Now I start X, it should do fine
# startx


XFree86 Version 4.2.0 / X Window System
(protocol Version 11, revision 0, vendor release 6600)
Release Date: 18 January 2002
	If the server is older than 6-12 months, or if your card is
	newer than the above date, look for a newer version before
	reporting problems.  (See http://www.XFree86.Org/)
Build Operating System: Linux 2.4.19-gentoo-r7 i686 [ELF] 
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
         (++) from command line, (!!) notice, (II) informational,
         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/XFree86.0.log", Time: Fri Sep  6 13:06:43 2002
(==) Using config file: "/etc/X11/XF86Config"
(EE) MGA: Failed to load module "mga_hal" (module does not exist, 0)
(EE) MGA(0): Static buffer allocation failed, not initializing the DRI
(EE) MGA(0): Need at least 9216 kB video memory at this resolution, bit depth
Could not init font path element /usr/X11R6/lib/X11/fonts/Speedo/, removing from list!
X connection to :0.0 broken (explicit kill or server shutdown).
xinit:  connection to X server lost.
# 
# #Yes, it did fine. Now, let's kill gpm...
# killall gpm
# #and startx X again...
# startx


XFree86 Version 4.2.0 / X Window System
(protocol Version 11, revision 0, vendor release 6600)
Release Date: 18 January 2002
	If the server is older than 6-12 months, or if your card is
	newer than the above date, look for a newer version before
	reporting problems.  (See http://www.XFree86.Org/)
Build Operating System: Linux 2.4.19-gentoo-r7 i686 [ELF] 
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
         (++) from command line, (!!) notice, (II) informational,
         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/XFree86.0.log", Time: Fri Sep  6 13:08:24 2002
(==) Using config file: "/etc/X11/XF86Config"
(EE) MGA: Failed to load module "mga_hal" (module does not exist, 0)
(EE) MGA(0): Static buffer allocation failed, not initializing the DRI
(EE) MGA(0): Need at least 9216 kB video memory at this resolution, bit depth
(EE) xf86OpenSerial: Cannot open device /dev/psaux
	No such device or address.
Could not init font path element /usr/X11R6/lib/X11/fonts/Speedo/, removing from list!
login:  fatal IO error 32 (Broken pipe) or KillClient on X server ":0.0"
xinit:  connection to X server lost.
# 
# #Nothing wrong with the error message, but X still started. However, mouse did
# #not work at all. If I try to start X before starting gpm once, X will not start
# #at all, as you saw in the first message.
# 
# #script is fine little program, pity that I didn't remember it at first time...
# 
Script done on Fri Sep  6 13:11:28 2002
Comment 6 Martin Schlemmer (RETIRED) gentoo-dev 2002-09-08 12:40:35 UTC
Funky.  Please attach your /etc/X11/XF86Config* files.
Comment 7 eekaikko 2002-09-09 04:33:28 UTC
I don't think X config gives any information, but here is mouse
section from XF86Config.

# **********************************************************************
# Core Pointer's InputDevice section
# **********************************************************************

Section "InputDevice"

# Identifier and driver

    Identifier	"Mouse1"
    Driver	"mouse"
    Option "Protocol"    "IMPS/2"
    Option "Device"      "/dev/psaux"
    Option "ZAxisMapping" "4 5"

# When using XQUEUE, comment out the above two lines, and uncomment
# the following line.

#    Option "Protocol"	"Xqueue"

# Baudrate and SampleRate are only for some Logitech mice. In
# almost every case these lines should be omitted.

#    Option "BaudRate"	"9600"
#    Option "SampleRate"	"150"

# Emulate3Buttons is an option for 2-button Microsoft mice
# Emulate3Timeout is the timeout in milliseconds (default is 50ms)

#    Option "Emulate3Buttons"
#    Option "Emulate3Timeout"    "50"

# ChordMiddle is an option for some 3-button Logitech mice

#    Option "ChordMiddle"

EndSection


Here is something more relevant. A small promgram I extracted and
moulded from gpm source:

#include <stdio.h>
#include <sys/fcntl.h>
int main() 
{
   int *fdptr;
   if ((*fdptr=open("/dev/psaux" ,O_RDWR))<0)
     printf("Failed\n");
   else
     printf("Succeeded\n");
   
   while(1);
}


Here is a typescript again... a.out is that previous program compiled
with just "gcc psaux.c". When I start it first time after booting the
computer, it fails.

Script started on Mon Sep  9 10:30:40 2002
# ./a.out 
Succeeded

# ./a.out 
Failed

# ./a.out 
Succeeded

# ./a.out 
Failed

# # I killed them with ctrl-c
# # Now, no program running...
# startx


XFree86 Version 4.2.0 / X Window System
(protocol Version 11, revision 0, vendor release 6600)
Release Date: 18 January 2002
	If the server is older than 6-12 months, or if your card is
	newer than the above date, look for a newer version before
	reporting problems.  (See http://www.XFree86.Org/)
Build Operating System: Linux 2.4.19-gentoo-r7 i686 [ELF] 
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
         (++) from command line, (!!) notice, (II) informational,
         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/XFree86.0.log", Time: Mon Sep  9 10:32:25 2002
(==) Using config file: "/etc/X11/XF86Config"
(EE) MGA: Failed to load module "mga_hal" (module does not exist, 0)
(EE) MGA(0): Static buffer allocation failed, not initializing the DRI
(EE) MGA(0): Need at least 9216 kB video memory at this resolution, bit depth
(EE) xf86OpenSerial: Cannot open device /dev/psaux
	No such device or address.
Could not init font path element /usr/X11R6/lib/X11/fonts/Speedo/, removing from list!
login:  fatal IO error 32 (Broken pipe) or KillClient on X server ":0.0"
xinit:  connection to X server lost.
# 
# # X started but mouse didn't work
# 
# ./a.out
Succeeded

# ./a.out 
Failed

# ./a.out &
[1] 3909
# Succeeded

# startx


XFree86 Version 4.2.0 / X Window System
(protocol Version 11, revision 0, vendor release 6600)
Release Date: 18 January 2002
	If the server is older than 6-12 months, or if your card is
	newer than the above date, look for a newer version before
	reporting problems.  (See http://www.XFree86.Org/)
Build Operating System: Linux 2.4.19-gentoo-r7 i686 [ELF] 
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
         (++) from command line, (!!) notice, (II) informational,
         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/XFree86.0.log", Time: Mon Sep  9 10:33:58 2002
(==) Using config file: "/etc/X11/XF86Config"
(EE) MGA: Failed to load module "mga_hal" (module does not exist, 0)
(EE) MGA(0): Static buffer allocation failed, not initializing the DRI
(EE) MGA(0): Need at least 9216 kB video memory at this resolution, bit depth
Could not init font path element /usr/X11R6/lib/X11/fonts/Speedo/, removing from list!
login:  fatal IO error 32 (Broken pipe) or KillClient on X server ":0.0"
xinit:  connection to X server lost.
# 
# # X started and mouse worked ok.
# killall a.out
# 
[1]+  Terminated              ./a.out
# startx


XFree86 Version 4.2.0 / X Window System
(protocol Version 11, revision 0, vendor release 6600)
Release Date: 18 January 2002
	If the server is older than 6-12 months, or if your card is
	newer than the above date, look for a newer version before
	reporting problems.  (See http://www.XFree86.Org/)
Build Operating System: Linux 2.4.19-gentoo-r7 i686 [ELF] 
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
         (++) from command line, (!!) notice, (II) informational,
         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/XFree86.0.log", Time: Mon Sep  9 10:35:10 2002
(==) Using config file: "/etc/X11/XF86Config"
(EE) MGA: Failed to load module "mga_hal" (module does not exist, 0)
(EE) MGA(0): Static buffer allocation failed, not initializing the DRI
(EE) MGA(0): Need at least 9216 kB video memory at this resolution, bit depth
(EE) xf86OpenSerial: Cannot open device /dev/psaux
	No such device or address.
Could not init font path element /usr/X11R6/lib/X11/fonts/Speedo/, removing from list!
login:  fatal IO error 32 (Broken pipe) or KillClient on X server ":0.0"
xinit:  connection to X server lost.
# 
# # mouse did not work.
# 
# ./a.out &
[1] 3999
# Succeeded

# startx


XFree86 Version 4.2.0 / X Window System
(protocol Version 11, revision 0, vendor release 6600)
Release Date: 18 January 2002
	If the server is older than 6-12 months, or if your card is
	newer than the above date, look for a newer version before
	reporting problems.  (See http://www.XFree86.Org/)
Build Operating System: Linux 2.4.19-gentoo-r7 i686 [ELF] 
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
         (++) from command line, (!!) notice, (II) informational,
         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/XFree86.0.log", Time: Mon Sep  9 10:36:05 2002
(==) Using config file: "/etc/X11/XF86Config"
(EE) MGA: Failed to load module "mga_hal" (module does not exist, 0)
(EE) MGA(0): Static buffer allocation failed, not initializing the DRI
(EE) MGA(0): Need at least 9216 kB video memory at this resolution, bit depth
Could not init font path element /usr/X11R6/lib/X11/fonts/Speedo/, removing from list!
login:  fatal IO error 32 (Broken pipe) or KillClient on X server ":0.0"
xinit:  connection to X server lost.
# 
# # and mouse worked.
# 
# #how about many a.outs, 3999 is still running?
# ./a.out
Succeeded

# ./a.out
Succeeded

# ./a.out
Succeeded

# killall a.out
# 
[1]+  Terminated              ./a.out
#./a.out &
[1] 4048
# Succeeded

# killall a.out
./a.out &
[2] 4050
[1]   Terminated              ./a.out
# Failed

# ps
  PID TTY          TIME CMD
 3858 pts/0    00:00:00 bash
 4050 pts/0    00:00:17 a.out
 4051 pts/0    00:00:00 ps
# ./a.out
Succeeded

# ./a.out
Failed

# ./a.out
Succeeded

# ./a.out
Failed

# killall a.out
# 
[2]+  Terminated              ./a.out
# 
Script done on Mon Sep  9 10:40:40 2002


So it seems to be that psaux can be opened successfully every time
if and only if it has been opened successfully and is currently open,
otherwise it can be opened succesfully only every second time.
However, gpm starts every time after it has once started successfully,
and X works only if some other program has psaux opened.

I don't know anything about opening and closing devices, so someone
else must continue on if necessary. Maybe this is kernel bug, but
gcc3.2 is not for kernel anyway. Or maybe I just have some odd
configuration and problem goes away with next emerge -e world or
kernel recompilation.

Btw, my mouse is Logitech optical usb/ps2 wheel mouse, if it makes any
difference. And gpm is not really working, it flashes the screen etc.,
but it reads the mouse nevertheless.
Comment 8 eekaikko 2002-09-09 08:48:40 UTC
I found the problem. I have keyboard in USB. When I tried that small
program in Debian, it printed on console and into kernel logfiles:

Timeout - AT keyboard not present?(f4)

Probably due to different configs and/or version gentoo-kernel does
not do this. in Debian and Gentoo this shows up in boot-time logs
couple of times.

However, in Debian mouse can be opened every time. When I moved the
keyboard to ps/2, Gentoo started to work also.

So this really seems to be a kernel problem. Devfs, input layer,
something else?
Comment 9 Martin Schlemmer (RETIRED) gentoo-dev 2002-09-09 13:12:54 UTC
Preempt/jiffies can cause wierdness like this.  Care to try a vanilla kernel?
Comment 10 eekaikko 2002-09-23 05:11:42 UTC
Yes, at last:)
Vanilla works fine, no problems in opening /dev/psaux.
Comment 11 Whit Blauvelt 2002-10-19 12:35:08 UTC
To get rid of a bad gpm session: gpm -k
Comment 12 Martin Schlemmer (RETIRED) gentoo-dev 2003-01-19 17:43:02 UTC
Kernel issues.