---------- Forwarded message ----------
From: "Ingo Scherzinger" <ingo@miamiwave.com>
To: "'pd-list'" <pd-list@iem.at>
Date: Mon, 17 May 2010 09:10:27 +0200
Subject: [PD] udev & usb midi interfaces

Hi,

 

does anybody know the search path to get udev information about usb midi interfaces?

It should be something like “udevadm info -a -p / ??? …”. I’m not realy sure how to search for the soundcard either.

I was using “lshal” which gives me a lot of information but I can’t tell which part to use for the udev device rules.

I read Daniel Drake’s “writing udev rules” but he doesn’t mention sound at all.

Yeah, it's easy ... try

udevinfo -a -p $(udevinfo -q path -n /dev/your device)

and plug in the device ... this command will list all the udev attributes it sees when it makes the sysfs usb tree. I use it it see what attributes I can use for writing udev rules. Drake may not explciity list "sound" or "midi" devices, but they are covered by the tutorial as well ... just find where the device is mounted in /dev and use that node in udevinfo.

I really need to write some udev rules to straighten out my 2 usb midi interfaces and soundcard that get mixed up all the time.

Why udev rules then ...? I use the portaudio index of the soundcard to pass to pd with -audiodev on startup (I use -nogui and alsa) and another script which parses aconnect -io to determine the alsa mdii index, then calls aconnect again to connect pd with the midi device.

Actually, perhaps you are right as it would be nice to have udev run aconnect whenever my midi device is plugged in.

--
Dan Wilcox
danomatika
www.robotcowboy.com