ola
i'm playing around with a lot of usb-devices (joysticks/gamepads)..
my problem is i want to route all this devices, but choosing a device by its hex value or name don't work with my hid. (compiled on Oct 9 2006 on übüntü däppr, i also tried a hid from a recent autobuild..)
Because i want to connect the devices ignoring the order of plugging in, the devices are every time on a different /dev/input/*..
how can i route the different devices? the [info( -message outputs me a stressful symbol with spaces in the name.
thanx for any hints..
eo
moritz
Hallo, moritz hat gesagt: // moritz wrote:
i'm playing around with a lot of usb-devices (joysticks/gamepads)..
my problem is i want to route all this devices, but choosing a device by its hex value or name don't work with my hid. (compiled on Oct 9 2006 on ÌbÌntÌ dÀppr, i also tried a hid from a recent autobuild..)
Because i want to connect the devices ignoring the order of plugging in, the devices are every time on a different /dev/input/*..
how can i route the different devices? the [info( -message outputs me a stressful symbol with spaces in the name.
Are you already using udev? It has this nice automatic labelling system, where you can access devices by id and by name. For example here it looks like this:
$ ls -l /dev/input/by-id/ total 0 lrwxrwxrwx 1 root root 9 Apr 14 19:16 usb-6666_0667-event-joystick -> ../event5 lrwxrwxrwx 1 root root 9 Mar 4 11:53 usb-Logitech_USB-PS.2_Optical_Mouse-event-mouse -> ../event4 lrwxrwxrwx 1 root root 9 Mar 4 11:53 usb-Logitech_USB-PS.2_Optical_Mouse-mouse -> ../mouse0
The device IDs will always stay the same. It is probably possible to use these for [hid].
Frank Barknecht _ ______footils.org_ __goto10.org__
On Apr 14, 2007, at 1:18 PM, Frank Barknecht wrote:
Hallo, moritz hat gesagt: // moritz wrote:
i'm playing around with a lot of usb-devices (joysticks/gamepads)..
my problem is i want to route all this devices, but choosing a
device by its hex value or name don't work with my hid. (compiled on Oct 9
2006 on übüntü däppr, i also tried a hid from a recent autobuild..)Because i want to connect the devices ignoring the order of
plugging in, the devices are every time on a different /dev/input/*..how can i route the different devices? the [info( -message outputs
me a stressful symbol with spaces in the name.Are you already using udev? It has this nice automatic labelling system, where you can access devices by id and by name. For example here it looks like this:
$ ls -l /dev/input/by-id/ total 0 lrwxrwxrwx 1 root root 9 Apr 14 19:16 usb-6666_0667-event-joystick -
../event5
lrwxrwxrwx 1 root root 9 Mar 4 11:53 usb-Logitech_USB-PS. 2_Optical_Mouse-event-mouse -> ../event4 lrwxrwxrwx 1 root root 9 Mar 4 11:53 usb-Logitech_USB-PS. 2_Optical_Mouse-mouse -> ../mouse0
The device IDs will always stay the same. It is probably possible
to use these for [hid].
How does it do keep the device ID the same (i.e. what's the device ID
based on)? From what I have seen, there isn't a way to do this is
the USB serial number field isn't used (and it's rarely used).
Usually, USB device IDs are built up from port number, bus number and
maybe some info from the device plugged in. But obviously, if you
plug a device into a different port, such a device ID will change.
Also, how does udev deal with multiple USB devices of the exact same
type?
.hc
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
There is no way to peace, peace is the way. -A.J. Muste
Hallo, Hans-Christoph Steiner hat gesagt: // Hans-Christoph Steiner wrote:
How does it do keep the device ID the same (i.e. what's the device ID
based on)?
I'm no kernel developer. ;) But it's taken from the info you also see in the syslog when plugging in a device or from "lsusb -v" or /sys/bus/usb/devices/ etc.
From what I have seen, there isn't a way to do this is
the USB serial number field isn't used (and it's rarely used).
Usually, USB device IDs are built up from port number, bus number and
maybe some info from the device plugged in. But obviously, if you
plug a device into a different port, such a device ID will change.
USB devices send their own info as well. For example to configure the order of USB soundcards with ALSA you can use the Vendor and Product IDs as module options. These are independent from port or bus number of course.
I discovered the "by-id" and "by-name" directories in the /dev-tree when configuring automatic mounting of USB storage devices like card reader or external disks. There you can use the permanent names in the automount config (or in /etc/fstab etc.) Here's a snippet of /etc/auto.usbdisk where I configure automounting the three partitions on my Maxtor USB drive:
m1 -fstype=auto,rw :/dev/disk/by-id/usb-Maxtor_3200_UA076GPC-part1 m2 -fstype=auto,rw :/dev/disk/by-id/usb-Maxtor_3200_UA076GPC-part2 m3 -fstype=auto,rw :/dev/disk/by-id/usb-Maxtor_3200_UA076GPC-part3
Also, how does udev deal with multiple USB devices of the exact same
type?
I tested this now with a second mouse of the same type. This is what happened after I plugged in a second mouse:
(~)-$ ls -l /dev/input/by-id/ total 0 lrwxrwxrwx 1 root root 9 Apr 15 11:52 usb-Logitech_USB-PS.2_Optical_Mouse-event-mouse -> ../event5 lrwxrwxrwx 1 root root 9 Apr 15 11:52 usb-Logitech_USB-PS.2_Optical_Mouse-mouse -> ../mouse1
Somehow the previous entry (mouse0 and event4, see prev. mail) was overwritten. But now I get more devices in /dev/input/by-path/:
(~)-$ ls -l /dev/input/by-path/ total 0 lrwxrwxrwx 1 root root 9 Mar 4 11:53 pci-0000:00:0a.0--event-ir -> ../event2 lrwxrwxrwx 1 root root 9 Mar 4 11:53 pci-0000:00:10.0-usb-0:2:1.0-event-mouse -> ../event4 lrwxrwxrwx 1 root root 9 Mar 4 11:53 pci-0000:00:10.0-usb-0:2:1.0-mouse -> ../mouse0 lrwxrwxrwx 1 root root 9 Apr 15 11:52 pci-0000:00:10.3-usb-0:1:1.0-event-mouse -> ../event5 lrwxrwxrwx 1 root root 9 Apr 15 11:52 pci-0000:00:10.3-usb-0:1:1.0-mouse -> ../mouse1 lrwxrwxrwx 1 root root 9 Mar 4 11:53 pci-0000:00:10.4-usb-0:1.4:1.3-event- -> ../event3 lrwxrwxrwx 1 root root 9 Mar 4 11:53 platform-i8042-serio-1-event-kbd -> ../event0 lrwxrwxrwx 1 root root 9 Mar 4 11:53 platform-pcspkr-event-spkr -> ../event1
Both mouses work. Unplugging the second mouse again has strange results: Now the whole "by-id" directory disappears:
$ ls -l /dev/input/by-id/ ls: /dev/input/by-id/: No such file or directory
but "by-path" correctly shows the removal of one mouse:
$ ls -l /dev/input/by-path/ total 0 lrwxrwxrwx 1 root root 9 Mar 4 11:53 pci-0000:00:0a.0--event-ir -> ../event2 lrwxrwxrwx 1 root root 9 Mar 4 11:53 pci-0000:00:10.0-usb-0:2:1.0-event-mouse -> ../event4 lrwxrwxrwx 1 root root 9 Mar 4 11:53 pci-0000:00:10.0-usb-0:2:1.0-mouse -> ../mouse0 lrwxrwxrwx 1 root root 9 Mar 4 11:53 pci-0000:00:10.4-usb-0:1.4:1.3-event- -> ../event3 lrwxrwxrwx 1 root root 9 Mar 4 11:53 platform-i8042-serio-1-event-kbd -> ../event0 lrwxrwxrwx 1 root root 9 Mar 4 11:53 platform-pcspkr-event-spkr -> ../event1
I guess this is a bug in udev.
Anyway, the "by-something" entries are generated automatically and they arwe very conventient.
However it is also possible to create device entries by hand with udev-rules. This is documented on several websites for dealing with USB storage devices, e.g. http://www.debian-administration.org/articles/126
It shouldn't be too hard to adapt these to HID devices as well if needed.
Frank Barknecht _ ______footils.org_ __goto10.org__
Very helpful, thanks! I haven't worked with udev. Sounds like it's
an improvement, tho there is still work to be done. David Merrill
used dbus to get info about USB HIDs. You can use his
[input_noticer] for this.
.hc
On Apr 15, 2007, at 6:12 AM, Frank Barknecht wrote:
Hallo, Hans-Christoph Steiner hat gesagt: // Hans-Christoph Steiner wrote:
How does it do keep the device ID the same (i.e. what's the device ID based on)?
I'm no kernel developer. ;) But it's taken from the info you also see in the syslog when plugging in a device or from "lsusb -v" or /sys/bus/usb/devices/ etc.
From what I have seen, there isn't a way to do this is the USB serial number field isn't used (and it's rarely used). Usually, USB device IDs are built up from port number, bus number and maybe some info from the device plugged in. But obviously, if you plug a device into a different port, such a device ID will change.
USB devices send their own info as well. For example to configure the order of USB soundcards with ALSA you can use the Vendor and Product IDs as module options. These are independent from port or bus number of course.
I discovered the "by-id" and "by-name" directories in the /dev-tree
when configuring automatic mounting of USB storage devices like card
reader or external disks. There you can use the permanent names in the
automount config (or in /etc/fstab etc.) Here's a snippet of /etc/auto.usbdisk where
I configure automounting the three partitions on my Maxtor USB drive:m1 -fstype=auto,rw :/dev/disk/by-id/usb- Maxtor_3200_UA076GPC-part1 m2 -fstype=auto,rw :/dev/disk/by-id/usb- Maxtor_3200_UA076GPC-part2 m3 -fstype=auto,rw :/dev/disk/by-id/usb- Maxtor_3200_UA076GPC-part3
Also, how does udev deal with multiple USB devices of the exact same type?
I tested this now with a second mouse of the same type. This is what happened after I plugged in a second mouse:
(~)-$ ls -l /dev/input/by-id/ total 0 lrwxrwxrwx 1 root root 9 Apr 15 11:52 usb-Logitech_USB-PS. 2_Optical_Mouse-event-mouse -> ../event5 lrwxrwxrwx 1 root root 9 Apr 15 11:52 usb-Logitech_USB-PS. 2_Optical_Mouse-mouse -> ../mouse1
Somehow the previous entry (mouse0 and event4, see prev. mail) was
overwritten. But now I get more devices in /dev/input/by-path/:(~)-$ ls -l /dev/input/by-path/ total 0 lrwxrwxrwx 1 root root 9 Mar 4 11:53 pci-0000:00:0a.0--event-ir -
../event2
lrwxrwxrwx 1 root root 9 Mar 4 11:53 pci-0000:00:10.0-usb-0:2:1.0- event-mouse -> ../event4 lrwxrwxrwx 1 root root 9 Mar 4 11:53 pci-0000:00:10.0-usb-0:2:1.0- mouse -> ../mouse0 lrwxrwxrwx 1 root root 9 Apr 15 11:52 pci-0000:00:10.3-usb-0:1:1.0- event-mouse -> ../event5 lrwxrwxrwx 1 root root 9 Apr 15 11:52 pci-0000:00:10.3-usb-0:1:1.0- mouse -> ../mouse1 lrwxrwxrwx 1 root root 9 Mar 4 11:53 pci-0000:00:10.4- usb-0:1.4:1.3-event- -> ../event3 lrwxrwxrwx 1 root root 9 Mar 4 11:53 platform-i8042-serio-1-event- kbd -> ../event0 lrwxrwxrwx 1 root root 9 Mar 4 11:53 platform-pcspkr-event-spkr -
../event1
Both mouses work. Unplugging the second mouse again has strange
results: Now the whole "by-id" directory disappears:$ ls -l /dev/input/by-id/ ls: /dev/input/by-id/: No such file or directory
but "by-path" correctly shows the removal of one mouse:
$ ls -l /dev/input/by-path/ total 0 lrwxrwxrwx 1 root root 9 Mar 4 11:53 pci-0000:00:0a.0--event-ir -
../event2
lrwxrwxrwx 1 root root 9 Mar 4 11:53 pci-0000:00:10.0-usb-0:2:1.0- event-mouse -> ../event4 lrwxrwxrwx 1 root root 9 Mar 4 11:53 pci-0000:00:10.0-usb-0:2:1.0- mouse -> ../mouse0 lrwxrwxrwx 1 root root 9 Mar 4 11:53 pci-0000:00:10.4- usb-0:1.4:1.3-event- -> ../event3 lrwxrwxrwx 1 root root 9 Mar 4 11:53 platform-i8042-serio-1-event- kbd -> ../event0 lrwxrwxrwx 1 root root 9 Mar 4 11:53 platform-pcspkr-event-spkr -
../event1
I guess this is a bug in udev.
Anyway, the "by-something" entries are generated automatically and they arwe very conventient.
However it is also possible to create device entries by hand with udev-rules. This is documented on several websites for dealing with USB storage devices, e.g. http://www.debian-administration.org/articles/126
It shouldn't be too hard to adapt these to HID devices as well if needed.
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
http://at.or.at/hans/
Frank Barknecht wrote:
Hallo, moritz hat gesagt: // moritz wrote:
i'm playing around with a lot of usb-devices (joysticks/gamepads)..
my problem is i want to route all this devices, but choosing a device by its hex value or name don't work with my hid. (compiled on Oct 9 2006 on übüntü däppr, i also tried a hid from a recent autobuild..)
Because i want to connect the devices ignoring the order of plugging in, the devices are every time on a different /dev/input/*..
how can i route the different devices? the [info( -message outputs me a stressful symbol with spaces in the name.
Are you already using udev? It has this nice automatic labelling system, where you can access devices by id and by name. For example here it looks like this:
$ ls -l /dev/input/by-id/ total 0 lrwxrwxrwx 1 root root 9 Apr 14 19:16 usb-6666_0667-event-joystick -> ../event5 lrwxrwxrwx 1 root root 9 Mar 4 11:53 usb-Logitech_USB-PS.2_Optical_Mouse-event-mouse -> ../event4 lrwxrwxrwx 1 root root 9 Mar 4 11:53 usb-Logitech_USB-PS.2_Optical_Mouse-mouse -> ../mouse0
The device IDs will always stay the same. It is probably possible to use these for [hid].
Ciao
alo
do i understand it right, i can for example the x-joystick allocate forever on /dev/input/event5 with udev?
thanx
moritz
Hallo, moritz hat gesagt: // moritz wrote:
do i understand it right, i can for example the x-joystick allocate forever on /dev/input/event5 with udev?
Maybe you can, I've no idea and this wasn't what my mail was about.
I was recommending to use device names from /dev/input/by-id/... instead of the /dev/input/eventX names.
Frank Barknecht _ ______footils.org_ __goto10.org__
Frank Barknecht wrote:
Hallo, moritz hat gesagt: // moritz wrote:
do i understand it right, i can for example the x-joystick allocate forever on /dev/input/event5 with udev?
Maybe you can, I've no idea and this wasn't what my mail was about.
I was recommending to use device names from /dev/input/by-id/... instead of the /dev/input/eventX names.
Ciao
thanx! now i understand.
but here it only works very well with the "deprecated" (e.g.) [linuxevent /dev/input/by-id/usb-bla-company-joystick].
e.g. with [hidio /dev/input/by-id/usb-bla-company-joystick] or [hid /dev/input/by-id/usb-bla-company-joystick] it does not work :
[hidio] using 0x0000 0x0000 for /dev/input/by-id/usb-bla-company-joystick hid_open [hidio] device does not exist info: open 1
ola
MorITz
I don't quite understand what you want to do. You want to be able to
select the same device everytime using the hex value? If that's what
you mean, unfortunately that onyl works on Mac OS X right now. We
are working on [hidio] now, the [hid] replacement, which should
support this on all platforms.
.hc
On Apr 14, 2007, at 12:28 PM, moritz wrote:
ola
i'm playing around with a lot of usb-devices (joysticks/gamepads)..
my problem is i want to route all this devices, but choosing a
device by its hex value or name don't work with my hid. (compiled on Oct 9
2006 on übüntü däppr, i also tried a hid from a recent autobuild..)Because i want to connect the devices ignoring the order of
plugging in, the devices are every time on a different /dev/input/*..how can i route the different devices? the [info( -message outputs
me a stressful symbol with spaces in the name.thanx for any hints..
eo
moritz
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
News is what people want to keep hidden and everything else is
publicity. - Bill Moyers
Hans-Christoph Steiner wrote:
I don't quite understand what you want to do. You want to be able to
select the same device everytime using the hex value? If that's what
you mean, unfortunately that onyl works on Mac OS X right now. We
are working on [hidio] now, the [hid] replacement, which should
support this on all platforms..hc
yes, that is what i want, so i have to wait for hidio..
thanx!
moritz
yes, that is what i want, so i have to wait for hidio..
thanx!
hidio has been working fine for me for a few months (mostly OSX
autobuild 0.39.2 from 2006-12-08, G4, 10.4.8 - using Spaceballs, some
joysticks and keypads - but seems ok on Debian as well) - selecting
by ID etc works well. I have experienced very occasional crashes
which I haven't been able to tie down, but they are not when I'm
running a patch, more when I am changing things. The main thing I had
to do was send [debug 0( to [hidio] so the console isn't flooded with
messages.
simon
On Apr 15, 2007, at 10:19 PM, simon wise wrote:
yes, that is what i want, so i have to wait for hidio..
thanx!
hidio has been working fine for me for a few months (mostly OSX
autobuild 0.39.2 from 2006-12-08, G4, 10.4.8 - using Spaceballs,
some joysticks and keypads - but seems ok on Debian as well) -
selecting by ID etc works well. I have experienced very occasional
crashes which I haven't been able to tie down, but they are not
when I'm running a patch, more when I am changing things. The main
thing I had to do was send [debug 0( to [hidio] so the console
isn't flooded with messages.
That's good to know, thanks for the report. Now we just need to get
it working as well on GNU/Linux and.... gulp Windows (that's the hard
part).
.hc
simon
I have the audacity to believe that peoples everywhere can have three
meals a day for their bodies, education and culture for their minds,
and dignity, equality and freedom for their spirits. - Martin
Luther King, Jr.
On Apr 15, 2007, at 7:20 PM, moritz wrote:
Hans-Christoph Steiner wrote:
I don't quite understand what you want to do. You want to be able
to select the same device everytime using the hex value? If
that's what you mean, unfortunately that onyl works on Mac OS X
right now. We are working on [hidio] now, the [hid] replacement,
which should support this on all platforms. .hcyes, that is what i want, so i have to wait for hidio..
Or help code it! :D That part shouldn't be too hard on GNU/Linux and
is a nice chunk to make a little project.
.hc
thanx!
moritz
"[W]e have invented the technology to eliminate scarcity, but we are
deliberately throwing it away to benefit those who profit from
scarcity." -John Gilmore