[alsa-devel] Where do amidi MIDI port names come from ?
Does someone know where (USB) MIDI port names in Linux come from ?
For example a MIDISport 4x4 shows "Midiman" at lsusb (the same for each one if there is more than one device. This comes from the idVendor, idProduct in the device descriptor)
But "MIDISPORT 4x4 Anniv MIDI 1 to 4" by amidi -l for the device. Thus wonder where amidi (ALSA) gets the product/portname from.
There are other examples where the SUB device ID is not known by Linux but the port name does have the vendor/product name
Microsoft argues that some MIDI devices do not report a name But since Linux does not have a driver for each device I highly doubt so. (have not come across one)
Microsoft chose to use the name from the device driver in their UWP MIDI implementation which has apparantly been not a good idea It has resulted in multiple duplicate device/port names for different devices.
Happy wrote:
For example a MIDISport 4x4 shows "Midiman" at lsusb (the same for each one if there is more than one device. This comes from the idVendor, idProduct in the device descriptor)
The name shown for these items does not come from the device; lsusb has an internal database that maps the idVendor/idProduct values to names.
But "MIDISPORT 4x4 Anniv MIDI 1 to 4" by amidi -l for the device. Thus wonder where amidi (ALSA) gets the product/portname from.
The snd-usb-audio driver gets these names from the device descriptors (iManufacturer/iProduct). Some devices do not have these, so the entries in quirks-table.h can override them. There are no devices that specify port names (AFAIK), so the driver has a hardcoded list for some devices in the port_info array in midi.c, and uses 1/2/... for the rest.
Regards, Clemens
participants (2)
-
Clemens Ladisch
-
Happy