Subject: wsmux vs. keyboard w/ X?
To: NetBSD/macppc list <port-macppc@netbsd.org>
From: John Valdes <valdes@uchicago.edu>
List: port-macppc
Date: 02/14/2001 22:59:57
Hello again,

Still more questions (though this will be the last for today)... :)

I can't seem to get wsmux, the keyboard and X to all work together.
This is on NetBSD 1.5 (release) on a PowerBook G3 Lombard (you all
know that by now, right? :) ).  I want to be able to use the PB
trackpad, a USB mouse, and the keyboard (of course) all at the same
time with X.  For reference, the keyboard comes up as wskbd0, the
trackpad as wsmouse0, and the mouse as wsmouse1.

Using Xmacppc w/ the stock, GENERIC kernel, I can get X to work w/ the
keyboard and either the trackpad or mouse.  For the trackpad, I let
Xmacppc open /dev/wsmouse0 as it normally does; for the USB mouse, I
move the real /dev/wsmouse0 out of the way and make a symlink wsmouse0
pointing to /dev/wsmouse1.  This works fine, but of course I can't use
the trackpad and mouse simultaneously.

If I now compile wsmux into the kernel:

  pseudo-device  wsmux       2       # keyboard/mouse multiplexor for wscons
  wskbd0 at akbd? console ? mux 1
  wsmouse0 at ams? mux 0
  wsmouse* at ums? mux 0

I can then use both trackpad and mouse if I point Xmacppc at
/dev/wsmouse (eg, /dev/wsmouse0 -> /dev/wsmouse).  However, the X
server is unable to open /dev/wskbd0, complaining that the device is
busy, and so the server doesn't start.  If I point Xmacppc at
/dev/wskbd instead, the server starts (and I can then use both mice),
but it doesn't receive any keyboard input (all keyboard input goes to
the underlying shell from which I started X).  I've played briefly w/
the XFree86 server, but so far, I see the same results.

Is this what's supposed to happen, or am I missing something?  Do I
need to do anything with wsconscfg or wsconsctl (or some other
command)?  I've tried running "wsconscfg -k 1" (or maybe that was
"-k 0", I forget; neither worked in either case), but that likewise
gives "Device busy".  "wsconscfg -m 0" always works, but that doesn't
seem to be required in order for X to see both mice (X sees them whether
I run this command or not).

Here's what the kernel sees at boot when wsmux is enabled:

 /netbsd: akbd0 at adb0 addr 2: mapped device (195)
 /netbsd: wskbd0 at akbd0 (mux 1 ignored for console): console keyboard
 /netbsd: ams0 at adb0 addr 3: EMP trackpad <tpad> 2-button, 400 dpi
 /netbsd: wsmouse0 at ams0 mux 0
 /netbsd: ums0 at uhub0 port 2 configuration 1 interface 0
 /netbsd: ums0: Primax Electronics Sony PCGA-UMS1, rev 1.00/4.41, addr 2, iclass 3/1
 /netbsd: ums0: 3 buttons and Z dir.
 /netbsd: wsmouse1 at ums0 mux 0

Any suggestions?

TIA,

John