On Mon, Feb 16, 2015 at 06:49:30PM -0500, Aaron Fineman wrote: > Hello, > > The KVM switch produces no output when switched away on the console. > Waving it around while focused produces the expected events, but it > stays silent while switched away. For what it's worth, the device is > this one: > http://www.newegg.com/Product/Product.aspx?Item=N82E16817182157&cm_re=rkv-2uc-_-17-182-157-_-Product > > I'm going to try a longer capture while switched away to see if it's > time based.
Can you try to run it with /dev/wsmouuse1 as parameter ? > > Thanks, > > > On Mon, Feb 16, 2015, at 05:53 PM, Matthieu Herrb wrote: > > On Sun, Feb 15, 2015 at 06:28:01PM -0500, Aaron Fineman wrote: > > > >Synopsis: USB KVM switch under Xorg spams read IO errors on detach > > > >(filling up /var) > > > >Category: user > > > >Environment: > > > System : OpenBSD 5.7 > > > Details : OpenBSD 5.7-beta (GENERIC.MP) #854: Fri Feb 13 > > > 12:19:00 MST 2015 > > > > > > [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP > > > > > > Architecture: OpenBSD.amd64 > > > Machine : amd64 > > > >Description: > > > Works under 5.6. Can reproduce on snaps from 8-feb and 15-feb. When > > > using a USB KVM switch under Xorg, toggling the switch (detach) spams > > > read IO errors to /var/log/Xorg.0.log until /var is full. I only notice > > > these for the mouse device, not the keyboard. > > > > > > [ 327.467] (EE) ws: /dev/wsmouse1: read error Input/output error > > > > > > > Hi, > > > > I agree that filling /var with log spam is not nice. However the core > > of the problem is that when the KVM is switched to another input > > device it produces something that lead to I/O errors on the devices. > > There is no spam for the keyboard either because it's not generating > > those I/O errors or because they are not logged by the > > xf68-input-keyboard driver if they happend. > > > > I could just patch xf86-input-ws to silently ignore I/O errors, but it > > would not be particularly nice. > > > > Can you run the test program below in console mode, and do a KVM > > switch away and then back while the program is running. Capture its > > stdout (using '>' or tee(1)) and send us the result. > > > > A good KVM should just generate no events while switched away. > > > > /* wsmouse events dump */ > > #include <sys/time.h> > > #include <dev/wscons/wsconsio.h> > > #include <errno.h> > > #include <fcntl.h> > > #include <stdio.h> > > #include <stdlib.h> > > #include <string.h> > > #include <unistd.h> > > > > int > > main(int argc, char *argv[]) > > { > > int fd, n; > > char *dev; > > struct wscons_event event; > > > > if (argc == 2) { > > dev = argv[1]; > > } else { > > dev = "/dev/wsmouse"; > > } > > > > fd = open(dev, O_RDONLY); > > if (fd < 0) { > > perror("open"); > > exit(1); > > } > > > > while (1) { > > n = read(fd, &event, sizeof(struct wscons_event)); > > if (n <= 0) { > > printf("read: %s\n", strerror(errno)); > > } > > > > switch (event.type) { > > case WSCONS_EVENT_MOUSE_UP: > > printf("MOUSE_UP: 0x%x\n", event.value); > > break; > > case WSCONS_EVENT_MOUSE_DOWN: > > printf("MOUSE_DOWN: 0x%x\n", event.value); > > break; > > case WSCONS_EVENT_MOUSE_DELTA_X: > > printf("MOUSE_DELTA_X: %d\n", event.value); > > break; > > case WSCONS_EVENT_MOUSE_DELTA_Y: > > printf("MOUSE_DELTA_Y: %d\n", event.value); > > break; > > #ifdef WSCONS_EVENT_MOUSE_DELTA_Z > > case WSCONS_EVENT_MOUSE_DELTA_Z: > > printf("MOUSE_DELTA_Z: %d\n", event.value); > > break; > > #endif > > #ifdef WSCONS_EVENT_MOUSE_ABSOLUTE_Z > > case WSCONS_EVENT_MOUSE_ABSOLUTE_Z: > > printf("MOUSE_ABSOLUTE_Z: %d\n", event.value); > > break; > > #endif > > case WSCONS_EVENT_MOUSE_ABSOLUTE_X: > > printf("MOUSE_ABSOLUTE_X: %d\n", event.value); > > break; > > case WSCONS_EVENT_MOUSE_ABSOLUTE_Y: > > printf("MOUSE_ABSOLUTE_Y: %d\n", event.value); > > break; > > case WSCONS_EVENT_SYNC: > > printf("SYNC\n"); > > break; > > default: > > printf("unknown event type 0x%x, value 0x%x\n", > > event.type, event.value); > > } > > } > > } > > > > -- > > Matthieu Herrb -- Matthieu Herrb
