Thanks Tim.
So I think I understand generally how things are supposed to be done.
However I am still getting no errors and TransferBufferLength==0 in the
completion routine. To keep things simple I now only send a single frame.
The completion routine sees packet.Status==0 and packet.Length==176 (the
original length that I set).
I assume if there were something wrong with my frame numbers I would get a
frame related error.
Any ideas why no error but no data sent?
Philip
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Tuesday, September 08, 2009 2:03 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] WdfRequestSend completion routine gives
status=0xC000000D urb USBD_STATUS=0x80000600
xxxxx@cox.net wrote:
Now I have another problem. I get noerrors, but the completion routine
gets zero in urbBuffer->UrbIsochronousTransfer.TransferBufferLength. I
looked at the USB bus and no packets are being sent. One thing of interest
is that I see periodic reset events on the USB bus, and wonder if that could
have something to do with it. In the driver I simply select the interface
and alt setting, get the pipe, and then keep that information until it is
actually time to send packets. If I don’t get any error shouldn’t
TransferBufferLength>0?
Theoretically, yes, but you should check the lengths and the error codes
in the IsoPacket array for more information. The individual packets in
an isochronous transfer are rather independent of one another.
I tried playing around with size and number of packets and this makes no
difference. This particular pipe has bInterval=4 so only one high speed
micro frame per 1ms frame. NumberOfPackets=1 and NumberOfPackets=8 makes no
difference.
Right. The number of packets needs to be a multiple of the number of
transfers per frame. Since bInterval=4 means you have 1 transfer per
frame, there is no restriction on the number of packets per URB. If you
set bInterval=3, then your packet count must be even. bInterval=2 means
you must have a multiple of 4. bInterval=1 means you must have a
multiple of 8.
(Somewhat related side note: the number of transactions per microframe
isn’t involved with this. If you have a maximum bandwidth pipe, with 3
transactions per microframe and an interval of 1 with a packet size of
1024, you must have a multiple of 8 packets in each URB, and the packets
must each be 3072 bytes.)
Regarding my secondary question from before, I am still not clear how to
queue packets if bInterval=3 or bInterval=4. Does the USB stack simply skip
the packets that are not supposed to be sent or should I not include the
packets in the URB? Also, if bInterval=3, does it send packet#0 and
packet#4 in that order?
The IsoPacket array maps 1-to-1 to your assigned transfer
opportunities. So, if you have bInterval=4, and you send 8 packets,
that maps to 8ms of real time. If you send 8 packets with bInterval=3,
that maps to 4ms of real time. You do not need to worry about the
microframes where you are not involved.
The packets are sent in order. With isochronous, there is no guarantee
that each packet will succeed; if the 1st packet fails for some reason,
you’ll get an error code in IsoPacket[0], and it will continue with the
second packet.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer