[PD] hid, routing different devices

Hans-Christoph Steiner hans at eds.org
Sat Apr 14 23:44:59 CEST 2007


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 at 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






More information about the Pd-list mailing list