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

  • From: pete.goodeve@xxxxxxxxxxxx
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 10 Feb 2011 17:46:10 -0800

On Thu, Feb 10, 2011 at 09:19:00PM +0100, Philippe Houdoin wrote:
> 
> I just defined those missing MIDI descriptors structs. in r40429.
> You can get some coding inspiration from ACMDevice::AddDevice()
> (src/add-ons/kernel/drivers/ports/usb_serial/ACMDevice.cpp) to see how
> interface generic descriptors are parsed there.
Thanks.  I'll look at those.  I'm slowly getting the hang of all the
convolutions of USB [one of the uglier protocols IMO!].
> 
> BTW, everybody is welcome to attach the "listusb -v" [....]
>  to this ticket:
> That will help us a lot to actually see those descriptors dump and,
> hopefully, how useable are the jack strings given by manufacturers, if
> any.
As I mentioned in my reply to Enrique, I found the Linux 'lsusb' to
provide a lot more understandable output.  I guess all the info is there
in both, but I wasn't (mentally) parsing the listusb output until I was
able to compare it with the Linux version (and got a bit deeper into
USB descriptors).
> 
> >
> > I think we will need one ring-buffer per 'cable'.
> 
> For input demultiplexing, yes.
Yes -- that's what I meant.
> 
> Each bulk endpoint is supposed to advertize a class-specific endpoint
> descriptor giving the list of
> jack id(s) connected to this endpoint. The "cn" field is in midi event
> packet received is the source jack id.
> On output, it should be set to the destination jack id.

Actually this is not correct.  [One of the things I *had* figured out!]
The 'cable numbers' are sequential, starting from 0 (on both Input and Output).
They are actually the index into the array of Jack IDs in the MIDI Endpoint
descriptor.  (They could not actually be the Jack IDs themselves, because
IDs can't be 0, but the default cable number is.)

To be sure of this, I've checked experimentally.  On My MidiSport,
'Port A' is cn=0 for both IN and OUT, 'Port B' is cn=1.  The corresponding
Jack IDs (in the array) are 3, 7, 1, and 5.
> 
> What worry me is, after reading again the spec, I fail to see how you
> could know which MIDI IN and MIDI OUT jacks are actually sharing the
> same *physical* cable.
> :-\
Sorry -- not following you here.  Or were you worrying about matching
up Jack IDs to physical connectors?  As I said, the numbering is sequential,
'A'==''0', 'B'=='1',  and if it exists 'C'=='2' and so on...

        -- Pete --
 

Other related posts: