On Thu, Jan 24, 2013 at 2:33 AM, Tim Roberts <t...@probo.com> wrote:
> Wander Lairson Costa wrote:
>> I observed that benchmark firmware always expects isochronous transfer
>> of a size multiple of packet size. Is this just a convention on the
>> firmware or is there something about isochronous that I am missing
>> out?
>
> Isochronous requests are different from other requests.  The "multiple
> of packet size" thing really only applies to isochronous IN requests.

For isochronous OUT request, since the host know (at least it
should know) the size of each packet, so this is not an issue, right?

> The reason is that isochronous data is not packed into your data
> buffer.  Instead, each packet in your isoch request stands alone, and
> gets mapped directly to a single microframe in time.  If your device has
> an interval of 1, so that you get a shot in each microframe, and you
> include 16 packets in your request, those 16 packets will span exactly
> two milliseconds.  The first packet gets whatever is read in the first
> microframe, the second packet gets whatever is read in the second
> microframe, and so on.
>
> So, if your device skips one interval, you will have a gap in your
> buffer.  If your device sends short data in one interval, again you will
> have a gap in your buffer.

How does the host program deal with this kind of gap in the buffer?

> Remember, in the USB protocol, a device is never told how large the read
> buffer is.  All it sees is a signal that says "GO!".  Thus, at every
> interval, the device has the right to send up to its maximum packet
> size.  As a result, your buffer has to be ready to accept that much
> data, every time.

So it is clear that the host program should use multiple of the
isochronous IN endpoint max packet size as the read buffer.

But isn't it the same for interrupt transfer or bulk IN transfer in the
case you do not know the expected data the device will send?
In that case, you will have to use multiple of the IN endpoint
max packet size as the read buffer. Right? On the occasion
that you know exactly how many data to expect, then of course it
is okay to use the that.


-- 
Xiaofan

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to