new kvm usb troubles - help!

ted leslie ted.leslie-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Wed Feb 23 23:38:22 UTC 2011


this program allows me to kick the usb device (reset) and this gives
me back mouse control,
but its not ideal because i have to run it each time i return to my
linux pc (on kvm), and
the device # in proc changes every time i port switch the kvm (it
increments). I can lsusb to find it and
then run the reset program below. The program below also take a couple
of seconds to reset the usb and give
me back mouse control. got to be a easier way, i.e. just don't allow
it to accept the ATEN usb device period.
hopefully someone will have an idea that works well.

tl

/* usbreset -- send a USB port reset to a USB device */

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>

#include <linux/usbdevice_fs.h>


int main(int argc, char **argv)
{
	const char *filename;
	int fd;
	int rc;

	if (argc != 2) {
		fprintf(stderr, "Usage: usbreset device-filename\n");
		return 1;
	}
	filename = argv[1];

	fd = open(filename, O_WRONLY);
	if (fd < 0) {
		perror("Error opening output file");
		return 1;
	}

	printf("Resetting USB device %s\n", filename);
	rc = ioctl(fd, USBDEVFS_RESET, 0);
	if (rc < 0) {
		perror("Error in ioctl");
		return 1;
	}
	printf("Reset successful\n");

	close(fd);
	return 0;
}


On Wed, Feb 23, 2011 at 6:28 PM, ted leslie <ted.leslie-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
> I just bought a 4 port dual view dual-dvi kvm from iogear 1644
> The first bad but not surprising news is that the hot keys don't work,
> i have to actually press the port select on the device to get it to
> route my monitors to the selected computer. The reason for this is, my
> keyboard and mouse is a all in one unit (single usb connect),
> so it plugs to the usb peripherals jack on the kvm (this kvm switches
> usb, audio, keyboard, mouse, and video),
> but the device (confirmed by tech support call just now), only
> recognized the hot key from the usb keyboard port (on kvm),
> and not a keyboard on a generic usb (i.e. mine is keyboard   mouse all in one).
> But this isn't to bad provided i can place the unit wthin arms-fingers
> reach (and i have another idea - more later).
> (i worry however that over the years i  may wear out buttons on the
> devices console as apposed to using keyboard issued hot keys).
>
> The serious issue i have is, on the switch between ports (computers),
> the usb devices are reoffered, but the order is problematic.
> If i switch using the kvm, the mouse stops when i come back to my main
> linux machine. If i physically unplug the  usb at the computer (cable
> between kvm and computer),
> it comes back, and the device order is opposite (see below), if i
> issue a soft usb reset from the hot keys (on a second keyboard into
> the kvm in keyboard port)
> it also works, but it doesn't work (usb device come up in opposite
> order) if i use kvm port switch.
> xinput shows the usbPS2 devices and ATEN but i can  not get
> xsetpointer of xinput set-pointer to work as device names are same ,
> and if i use device # it fails as well.
>
> usb black list doesn't seem to help, because from what i see, it is
> for modules only, and that doesn't work for me. I also tried removing
> the hid usb module and reinserting
> but this has it come up in the wrong order again :(  it's odd that
> depending on how i reset the usb bus, the order is consistently
> different, i.e.:
>
> phyiscal usb cable in/out  comes up with order i want,
>  kvm port switch not the right order,
>  kvm usb bus soft reset is right order,
>  linux module out/in wrong order.
>
>
> SO, my question is, can i some how in linux control the order, or
> better yet get it to not accept the ATEN device?
>
> Also, if i plug my mouse/keyboard combo into the dedicated keyboard or
> mouse jack i (not so surprisingly) only get the one functionality,
> but (ok maybe dumb question here), isn't a usb device a usb device? if
> i plug my combo keyboard and mouse into    the "keyboard kvm port",
> why can't it intercept my keyboard strokes (for hot key detection),
> and pass across whatever "mouse" data is on it too?
>
> If i can just get control over the usb device order (or blacklist
> ATEN) i can fix this one issue, any suggestions?
> b.t.w. the soft reset issued from the keyboard is a pain as it
> involves a hold this, hold this, release, release, press type
> pain-in-the-ass keyboard combination
> (and i don't want to have to have a 2nd keyboard present just to issue
> kvm hot key sequences).
>
> and on a really why out thought, could i get a usb port on my computer
> to act as a keyboard usb device to the kvm?
> i.e. connect a usb to usb cable from pc to kvm (in kvm dedicated
> keyboard usb jack), and I can feed the usb data to
> the kvm (not by a keyboard , but from a usb port on computer faking as
> a keyboard)? (ok i did say "why out thought here!").
>
> the iogear 1644 kvm does however do the core piece i needed, which is
> KVM for dual monitor dual-dvi  two monitors ( at 2560x1600 res) to 3
> or more (it can route upto 4 computers) to share the dual dual dvi
> view set up.
> unfortunately on the switching, the monitors (or is it the unit, i
> don't know), its about a 1/3-2/3 of a second to switch between views,
> which is a little disappointing (last i used a kvm on crt monitor,
> monitor switching had no detectable switching lag, i am guessing the
> dvi add some lag in the loop for some hand shaking or something).
> I couldn't find any other kvm devices close to the 550$ price range of
> this one, so not sure there are others that work better.
> To solve the hot key issue, i may get a programmable keyboard
> (hopefully find a cheap one), that i could program the port switch
> keyboard sequence in a macro and get it to fire on a singe keypress,
> but i have to solve the linux usb order detection issue first.
>
> below is dmesg , one where it works (notice order), and one where doesn't:
> DOESNT WORK
> [4814267.775320] input: ATEN CS1644 V1.2.11? as
> /devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5.4/2-5.4:1.0/input/input103
> [4814267.800288] generic-usb 0003:0557:2213.0063: input,hidraw2: USB
> HID v1.00 Keyboard [ATEN CS1644 V1.2.11?] on
> usb-0000:00:1d.7-5.4/input0
> [4814267.820815] input: ATEN CS1644 V1.2.11? as
> /devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5.4/2-5.4:1.1/input/input104
> [4814267.852309] generic-usb 0003:0557:2213.0064: input,hidraw3: USB
> HID v1.00 Mouse [ATEN CS1644 V1.2.11?] on usb-0000:00:1d.7-5.4/input1
> [4814982.125905] usb 2-5.2: USB disconnect, address 46
> [4814989.252313] usb 2-5.1: new low speed USB device using ehci_hcd
> and address 48
> [4814989.368340] usb 2-5.1: configuration #1 chosen from 1 choice
> [4814989.371921] input: USBPS2 as
> /devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5.1/2-5.1:1.0/input/input105
> [4814989.400282] generic-usb 0003:0D3D:0001.0065: input,hidraw0: USB
> HID v1.00 Keyboard [USBPS2] on usb-0000:00:1d.7-5.1/input0
> [4814989.404536] input: USBPS2 as
> /devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5.1/2-5.1:1.1/input/input106
> [4814989.448434] generic-usb 0003:0D3D:0001.0066: input,hidraw1: USB
> HID v1.00 Mouse [USBPS2] on usb-0000:00:1d.7-5.1/input1
>
>
>
> WORKS
> [4815033.912365] input: USBPS2 as
> /devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5.1/2-5.1:1.0/input/input107
> [4815033.936282] generic-usb 0003:0D3D:0001.0067: input,hidraw0: USB
> HID v1.00 Keyboard [USBPS2] on usb-0000:00:1d.7-5.1/input0
> [4815033.940429] input: USBPS2 as
> /devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5.1/2-5.1:1.1/input/input108
> [4815033.988347] generic-usb 0003:0D3D:0001.0068: input,hidraw1: USB
> HID v1.00 Mouse [USBPS2] on usb-0000:00:1d.7-5.1/input1
> [4815039.725105] usb 2-5.4: USB disconnect, address 47
> [4815042.252326] usb 2-5.4: new low speed USB device using ehci_hcd
> and address 50
> [4815042.415105] usb 2-5.4: configuration #1 chosen from 1 choice
> [4815042.435925] input: ATEN CS1644 V1.2.11? as
> /devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5.4/2-5.4:1.0/input/input109
> [4815042.460282] generic-usb 0003:0557:2213.0069: input,hidraw2: USB
> HID v1.00 Keyboard [ATEN CS1644 V1.2.11?] on
> usb-0000:00:1d.7-5.4/input0
> [4815042.480161] input: ATEN CS1644 V1.2.11? as
> /devices/pci0000:00/0000:00:1d.7/usb2/2-5/2-5.4/2-5.4:1.1/input/input110
> [4815042.520317] generic-usb 0003:0557:2213.006A: input,hidraw3: USB
> HID v1.00 Mouse [ATEN CS1644 V1.2.11?] on usb-0000:00:1d.7-5.4/input1
> --
> The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
>
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list