[haiku-bugs] Re: [Haiku] #4463: Add multi-ports support to USB MIDI driver

#4463: Add multi-ports support to USB MIDI driver
--------------------------+-----------------------------
  Reporter:  Pete         |        Owner:  nobody
      Type:  enhancement  |       Status:  assigned
  Priority:  normal       |    Milestone:  R1
 Component:  Drivers/USB  |      Version:  R1/pre-alpha1
Resolution:               |     Keywords:
Blocked By:               |  Has a Patch:  1
  Platform:  All          |     Blocking:
--------------------------+-----------------------------

Comment (by phoudoin):

 Replying to [comment:16 Pete]
 > Well it didn't take long to find out how multi-ports ''are'' handled,
 now that the connection is actually working.  All the packets are sent
 over the ''same'' endpoints, distinguished by the first nibble in the
 packet.
 >
 > So, as the current usb_midi simply ignores that number, you can
 currently ''receive'' on any port, but only ''send'' on the first.
 >
 > I'll start studying the reorganization needed to handle that port ID
 properly.

 For each port one distinct /dev/midi/*/* entry should be published in
 order to be handled as distinct port by midi_server.
 That means that depending on ports count for a device, one to several
 entries should published, each one with it's own channel number. But, and
 that's the meat of the code redesign, you still have one single receiving
 "thread" for all ports/device entries, and on the other side parallel
 writes on ports of the same device may needs to be serialized, but I'm
 less sure about it (I hope the USB stack already queues bulk requests on
 same endpoint).

 By multi-devices, I was implying support for both multiple "hardware"
 devices *and* multiple /dev/midi/*/* entries for multi-ports hardware
 device. Sorry about the confusion.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/4463#comment:18>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: