|
Thanks for the follow up. It's commercial code, so what I have attached is the loop with everything but the USB read portion removed.
When I define "DUMP_RAW" and look at the resulting dumped buffer, the results are definitely different from what I get from the same stream when I dump the data from that endpoint off of the wire. I have observed a few things that are of interest:
1) When I preinitialize my buffer with BAD_MAGIC (a token not found in the data stream), I often see bursts of BAD_MAGIC in my buffer. Because they're a multiple of 1024 in length, it looks to me like when a packet is dropped, the driver seeks forward by a packet width without copying things.
2) If I am expecting the values 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, in my stream, I'll sometimes see 1, 2, 3, 4, then 1024 bytes of BAD_MAGIC, and then 5, 6, 7, 8, 9,10. No data lost, just a packet-sized "jump". My guess is that this is the result of the device returning a zero length packet and then starting the data sequence in the next microframe.
3) The observation in (2) is not always true. I modified my parser to seek past any BAD_MAGIC bytes in hopes of getting coherent data out, but there is still a substantial amount of missing data.
4) This loop was quite stable when the endpoint was a bulk endpoint. My first attempt at isochronous logic was simply changing the firmware to an isochronous enpdoint. This gave me clean data on the line, but my host site parser stopped working. I've pared the code down to roughly the loop that I just posted as I debugged it.
I'm sure that this is just a matter of me not understanding what the return codes are trying to tell me, so your guidance is much appreciated.
|