[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Unidentified subject!



rhkramer@gmail.com wrote: 
> (Intentionally cross posted)
> 
> The following quotes are from an email to a rosegarden mail list -- Rosegarden 
> is a music notation (mcow) program.
> 
> A user is describing a problem in which it appears the MIDI ports (connected 
> via USB ports) change on each boot (or maybe even each start of the Rosegarden 
> program).
> 
> I just wondered if this is similar to the current Linux behavior related to 
> disks wherein, in the old days, disks came up in a consistent order, but 
> nowadays (maybe because of systemd?) they (or some of them) can start in 
> parallel and thus their device numbers are not consistent.
> 
> If a similar problem does exist with USB ports, is there a way to force them 
> to be identified in a consistent way on each boot (i.e., something like using 
> UUIDs or labels for disks)?
> 

Yes, and yes-but-no.

You want to ignore the USB ports and focus on the attached
devices. udev is the mechanism here.

For example, in /etc/udev/rules.d/70-ups  I have:

SUBSYSTEM=="usb", ATTR{idVendor}=="0764", ATTR{idProduct}=="0501", SYMLINK+="ups0", GROUP="nut"

Which means that /dev/ups0 will be assigned to the USB device
that has an idVendor of 0764 and an idProduct of 0501, and be
accessible by anyone in the group nut.

So if you have a MIDI keyboard with idVendor 0499 (Yamaha) and 
idProduct 1617 (PSR-E353 digital keyboard) then you could plug
those numbers into a rule like the one above and whenever it was
connected, it would appear at, say, "/dev/midikb0".

SUBSYSTEM=="usb", ATTR{idVendor}=="0499", ATTR{idProduct}=="1617", SYMLINK+="midikb0", GROUP="audio"

lsusb (possibly with a -v) will help you find the currently
attached devices and their numbers.

Does that help?



Reply to: