[alsa-devel] Translating USB device names to ALSA client numbers
![](https://secure.gravatar.com/avatar/3f59b1412a1f1893aa13742732b242f5.jpg?s=120&d=mm&r=g)
Hello,
I'm trying to write some udev wrappers to automatically connect USB MIDI devices to each other. My logic could be really robust if I had a way of mapping ALSA client numbers (e.g. from 'aconnect -l', such as '20:0') to physical USB devices (either by bus ID, /dev/ symlink name, /proc/asound/ files, etc.) My ultimate goal is so that when a udev rule executes upon hotplugging a MIDI device, I can reference that MIDI device by client number and then execute an aconnect command. Thus, I need some way to map USB device information to the ALSA client numbers that get reported by aconnect.
Is there any way to accomplish this? I tried to review the ALSA source code, but my eyes got jumbly after awhile.
Thanks, Dejay
![](https://secure.gravatar.com/avatar/3f59b1412a1f1893aa13742732b242f5.jpg?s=120&d=mm&r=g)
Hello,
I'm trying to write some udev wrappers to automatically connect USB MIDI devices to each other. My logic could be really robust if I had a way of mapping ALSA client numbers (e.g. from 'aconnect -l', such as '20:0') to physical USB devices (either by bus ID, /dev/ symlink name, /proc/asound/ files, etc.) My ultimate goal is so that when a udev rule executes upon hotplugging a MIDI device, I can reference that MIDI device by client number and then execute an aconnect command. Thus, I need some way to map USB device information to the ALSA client numbers that get reported by aconnect.
Is there any way to accomplish this? I tried to review the ALSA source code, but my eyes got jumbly after awhile.
Thanks, Dejay
participants (1)
-
Dejay