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.

Re: USB Isochronous problem by Patrick

Patrick
Mon Oct 20 17:38:06 CDT 2003

Which controller (OHCI, UHCI) are you using? and what version?

In old OHCI codes, the following macros in ohcdinc.cpp specfy how many
packets one TD can transfer, Maybe you need to modify this.

const UINT gcMaxTransferSize = 4 * 1024; // 4K
const UINT gcMaxOffsetsPerTd = 4;



"Semion" <semionb@yandex.ru> wrote in message
news:#0JVhYwlDHA.2068@TK2MSFTNGP09.phx.gbl...
> 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.
>
>
>
>



Re: USB Isochronous problem by Jeff

Jeff
Tue Oct 21 02:55:03 CDT 2003

By default the Issue*Transfer calls copy memory buffers around. Memory
copies are slow. Use the physmem options to avoid the buffer data copies;
you'll need to allocate your own physmem and ensure that it's addressable by
the HC on your platform.

- Jeff.


"Semion" <semionb@yandex.ru> wrote in message
news:%230JVhYwlDHA.2068@TK2MSFTNGP09.phx.gbl...
> 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.
>
>
>
>



Re: USB Isochronous problem by Semion

Semion
Tue Oct 21 10:57:27 CDT 2003

Thank you for reply. I use OHCI driver on WinCE 3.0,
and OHCI 2 onWinCE 4.2 - it came with devices and have no choice.

"Patrick Zou" <patrick_zou_nospam@hotmail.com> wrote in message
news:ueZpvt1lDHA.644@TK2MSFTNGP11.phx.gbl...
> Which controller (OHCI, UHCI) are you using? and what version?
>
> In old OHCI codes, the following macros in ohcdinc.cpp specfy how many
> packets one TD can transfer, Maybe you need to modify this.
>
> const UINT gcMaxTransferSize = 4 * 1024; // 4K
> const UINT gcMaxOffsetsPerTd = 4;
>
>
>
> "Semion" <semionb@yandex.ru> wrote in message
> news:#0JVhYwlDHA.2068@TK2MSFTNGP09.phx.gbl...
> > 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.
> >
> >
> >
> >
>
>



Re: USB Isochronous problem by Semion

Semion
Tue Oct 21 11:18:32 CDT 2003

Thank you for reply.

I tried to allocate physical memory with "AllocPhysMem" function on WinCE
4.2. It works a little better - all the transfers occuar OK, but after "Get
IsochResults" function I get a lot of errors "USB_NOT_ACCESSED_ERROR"
in Errors buffer.
On WinCE 3.0 "IssueIsochTransfer" function doesn't work at all ( I alloc
memory with "VirtualAlloc" function ).

May be I don't allocate physical memory rigth. Can you please,
send me any sample or link to sample how to do it.

Thank you.

"Jeff Rosenfeld" <spamophobe@comcast.net> wrote in message
news:KKGdnXHuucrKewmiRVn-uw@comcast.com...
> By default the Issue*Transfer calls copy memory buffers around. Memory
> copies are slow. Use the physmem options to avoid the buffer data copies;
> you'll need to allocate your own physmem and ensure that it's addressable
by
> the HC on your platform.
>
> - Jeff.
>
>
> "Semion" <semionb@yandex.ru> wrote in message
> news:%230JVhYwlDHA.2068@TK2MSFTNGP09.phx.gbl...
> > 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.
> >
> >
> >
> >
>
>



Re: USB Isochronous problem by davli

davli
Tue Oct 21 14:24:01 CDT 2003

Can you tell me which device are you using for testing? I never see problem
like this on WinCE 4.2 OHCI2. Windows CE 3.0 does not support
IssueIsochTransfer with physical address set.


Re: USB Isochronous problem by Semion

Semion
Wed Oct 22 08:09:23 CDT 2003

I work with "BitsyX" ( WinCE 4.2 )

http://www.applieddata.net/products_bitsyX.asp

May be I don't allocate rigth physical memory, and when I don't use it,
I get results only when all buffers are up to 10.5 kBytes.

Thank you.

Semion.

"David Liao" <davli@wingroup> wrote in message
news:5vhskjAmDHA.1544@cpmsftngxa06.phx.gbl...
> Can you tell me which device are you using for testing? I never see
problem
> like this on WinCE 4.2 OHCI2. Windows CE 3.0 does not support
> IssueIsochTransfer with physical address set.
>



Re: USB Isochronous problem by davli

davli
Thu Oct 23 10:53:20 CDT 2003

I do not understand what you post.
When you get error. What is error code return when you called
BOOL GetTransferStatus(
USB_TRANSFER hTransfer,
LPDWORD lpdwBytesTransferred,
LPDWORD lpdwError
);

David Liao