Hi everybody!
I have problem with USB isochronous transfer.
I develop USB video streamming driver, so I need
USB traffic as much as possible.
My device can send me up to 895 bytes in one USB-frame.
When I call sequentually the "IssueIsochTransfer" function, I
get some empty USB frames between calls.
The article in KB
http://support.microsoft.com/default.aspx?scid=kb;en-us;317434
explains why it happends and how get rid of these empty frames.
In the article it's recommended to queue transfers.
I tried this code. It really works, but with limitation of required
memory about 10.5 kBytes. For example: I queue 3 transfers, 4 USB-frames
per transfer, 895 bytes per frame: 3*4*895 = 10740. It works, but if I
increase count of transfers in queue or USB-frames per transfer - one or two
first transfers occur and after them I get error 14 -
"USB_NOT_ACCESSED_ERROR".
I must decrease number bytes per frame in order to get USB data.
So I can't use all potential banwith of USB.
I'm not sure, but may be, the problem is in USB-host driver. May be it
allocs
memory of it's own, stores incoming USB data in it, and after that copies
the
recieved data in the buffer, that I pass to the "IssueIsochTransfer"
function.
May be there is some limitation for memory that driver can alloc.
In favour of this suggestion I can add that when in the parameter 7 (
lpdwLengths )
of the "IssueIsochTransfer" function I passed numbers less then 895 it
worked.
For example: I queue 4 transfers, 8 USB-frames per transfer ( as in
article ),
895 bytes per frame: 4*8*895 = 28640 - doesn't work. But when I passed in
the
parameter 7 ( lpdwLengths ) 300 bytes for every USB-frame it worked,
USB-transfers occured OK, on the output buffer I got 300 bytes for every
frame,
in spite of that my device still was configured for 895 bytes per USB-frame
and on
analizer I saw that every USB-frame transports 895 bytes of data. When I
passed
in parameter 7 ( lpdwLengths ) 350 bytes for every USB-frame it didn't work.
Simple calculations show that in the first case, when needed memory was:
4*8*300 = 9600 bytes "IssueIsochTransfer" function works OK,
but in the second: 4*8*350 = 11200 bytes the second or third queued transfer
failed
and the "GetLastError" function returns "USB_NOT_ACCESSED_ERROR".
I got the same behavior on WinCE 3.0 ( "Cassiopeia E-200" ), and on
WinCE 4.2 ( "BitsyX" ). The only difference was that on WinCE 3.0 (
"Cassiopeia E-200" )
I can get up to 11 USB frames per one function call, and on WinCE 4.2 (
"BitsyX" ) up to 13.
My question: how can I use all potential bandwith of USB ?
If there is really limitation of USB-host driver, may be there is come patch
for
Platform Builder that fixes this problem ?
Thak you in advance.