[haiku-bugs] Re: [Haiku] #9311: usb_midi fix to handle more "Class-Compliant" devices

  • From: "Pete" <trac@xxxxxxxxxxxx>
  • Date: Thu, 10 Jan 2013 03:49:35 -0000

#9311: usb_midi fix to handle more "Class-Compliant" devices
---------------------------+-------------------------
   Reporter:  Pete         |      Owner:  mmlr
       Type:  bug          |     Status:  new
   Priority:  normal       |  Milestone:  R1
  Component:  Drivers/USB  |    Version:  R1/alpha4.1
 Resolution:               |   Keywords:
 Blocked By:               |   Blocking:
Has a Patch:  1            |   Platform:  All
---------------------------+-------------------------

Comment (by Pete):

 Replying to [comment:5 mmlr]:
 > Replying to [comment:4 phoudoin]:
 > > I wonder if in fact the root issue is not deeper, in the USB stack
 itself. There is absolutely no reason to pass the bulk request with 2048
 size while the stack knows that this endpoint only support 4 bytes max per
 request.
 >
 > That is not how it works. The max packet size is just that, the maximum
 size of each packet. A request will be fulfilled using as many packets as
 is required to move the amount of data it is given. The stack splits these
 buffers correctly into multiple packets internally. It's an implementation
 detail if you will. It allows a device to work with a fixed and small
 amount of storage if needed.
 Ahh.  I'm glad you jumped in on this...  I'm still not quite clear on
 what's going on, though.  How does the iCON device "get the idea" that it
 should wait until it has accumulated 2048 bytes before sending any?  My
 M-Audio units have a max packet size of 64, yet they don't wait for 16
 events before sending.
 >
 >
 > Looking at the specs the packet sizes aren't specified. Looking at the
 linux usb midi driver (http://lxr.linux.no/linux+v3.7.1/sound/usb/midi.c)
 they use the max packet size as the max transfer size by default. It is
 also clear from looking at this driver that there are quite a few broken
 devices and a lot of vendor specific protocols that are slightly
 different.
 Indeed... (:-/)
 >
 > So using the max packet size probably makes sense.

 So, in summary, I guess my patch is probably right(?).  (At some point I
 guess we have to copy all the Linux quirk workarounds, but that's probably
 down the road.)

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

Other related posts: