[haiku-development] Re: (USB MIDI) Device hierarchy

  • From: Jérôme Duval <korli@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 10 Feb 2011 09:36:12 +0100

Hi Pete,

2011/2/10  <pete.goodeve@xxxxxxxxxxxx>:
>   I'm looking into implementing full multi-port support in usb_midi.
> Not quite sure yet how tricky it's going to be, but I have one initial
> question to put to the wider expertise.
>
> I currently have two MIDI-USB interfaces plugged in, and they appear
> as /dev/midi/usb/0 and /dev/midi/usb/1.  However, one of them is
> actually a two-port device (of which I can only currently access
> the first), so both ports will have to eventually show up as separate
> devices.
>
> My question is: should the ports appear as (say) /dev/midi/usb/1
> and /dev/midi/usb/2, or -- as they're actually a single device --
> as /dev/midi/usb/1/0 and /dev/midi/usb/1/1 -- one extra level down?

It's just a naming. One could also have sequential numbers, one for
each device/port combination.

The bigger problem I see is the lack of information about the
availability of such ports in the descriptors: it seems the driver
could have to dynamically publish dev entries. Philippe maybe already
thought about this.
Moreover, the driver is at the moment clearly oriented for a one
endpoint to one dev entry communication, which might not fit very well
with additional dev entries. The midi server also assumes each dev
entry to have one input port and one output port, which might not be
the case hardware side.

Another way to support multiple ports would be to enhance the midi
driver api to something like the multiaudio, this tends to be more
involved.

Bye,
Jérôme

Other related posts: