El Mar 20 Ago 2002 10:10, Clemens Ladisch escribió:
> Pedro Lopez-Cabanillas wrote:
> > I suggest you to add these modules to the /etc/hotplug/blacklist file:
> > # cat /etc/hotplug/blacklist
> > audio
> > usb-midi
> > snd-usb-audio
> > snd-usb-midi
> >
> > You can see that I include the ALSA modules here. This prevents hotplug
> > from loading them when you plug the keyboard, but this is not a problem
> > if you use the right /etc/modules.conf setup, and the alsasound script.
>
> IMHO there's nothing wrong with loading the driver when the keyboard is
> plugged in. I'd suggest to list only the OSS drivers in the blacklist file.

Hotplug can't load the snd-usb-midi module, except for the vendor/product ids 
listed in MODULE_DEVICE_TABLE(usb, snd_usbmidi_usb_id_table). Michael has an 
Evolution keyboard, a standard USB class compliant device, AFAIK.

Hotplug only looks for the first interface descriptor found for each device. 
And the standard for USB MIDI is an AudioControl interface descriptor 
(SubClass=1). This interface don't match with the first entry in your table:

static usb_device_id_t snd_usbmidi_usb_id_table[] = {
        { match_flags: USB_DEVICE_ID_MATCH_INT_CLASS |
                       USB_DEVICE_ID_MATCH_INT_SUBCLASS,
          bInterfaceClass: USB_CLASS_AUDIO,
          bInterfaceSubClass: USB_SUBCLASS_MIDISTREAMING }, ...

But it matches with the corresponding table in usbaudio.c:

static struct usb_device_id usb_audio_ids [] = {
    { .match_flags = (USB_DEVICE_ID_MATCH_INT_CLASS | 
USB_DEVICE_ID_MATCH_INT_SUBCLASS),
      .bInterfaceClass = USB_CLASS_AUDIO,
      .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL },
    { }                                         /* Terminating entry */
};

You can read a bit about this in 
http://linux-hotplug.sourceforge.net/?selected=usb

variable: INTERFACE 
example: 3/1/1 
notes: bInterfaceClass/bInterfaceSubClass/bInterfaceProtocol, from _first_ 
interface descriptor. Available only for device class zero. Numbers are 
decimal. 

As a result, when you plug a true standard USB MIDI thing, hotplug invokes the 
user.agent script with only information about the AudioControl interface, and 
user.agent probe() the snd-usb-audio module, that fails for MIDI-only  
devices. The snd-usb-midi module is never loaded neither probed.

The only workaround I know for now, is blacklist snd-usb-audio module and  
load snd-usb-midi by hand or like any other ALSA module: kmod + modules.conf

A clean solution for future development, IMHO, can be a third snd-usb module, 
a kind of ALSA-USB arbitrator, responsible for the descriptor parsing code, 
register in USB and ALSA subsystems, and for loading the audio or midi 
modules. This can be useful also for integration of some mixed audio/midi 
devices, as Mr. Takashi asked for. 

Regards,
Pedro



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
Alsa-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to