I have created:
1) a Thread that reads from a IoCsq Queue an IRP
2) During the IRP creation i have allocated an URB and stored it as
currentStackOfIRP->Parameters.Others.Argument1 = URB
3) The Thread fills the associated URB and then KeWaitForSingleObject a
SyncronizationTimer initialized to fire every 1ms
I use TransferBuffer and not TransferMDL (NULL);
the flag USB_TRANSFER_SHORT_OK is used too.
4) When the SyncTimer fires the Thread sends the IRP to the TopofTheStack.
I use QueryBusTie to get the CurrentFrame and i set StartFrame =
CurrentFrame+5;
5) at Completion the IrpReuse is called and the IRP is reinserted in the
IoCsq Queue.
This works well wihen i send 8 packets with a packetSize of 0x100 but i need
to send 2048 bytes faster and not in 8 frames.
I get Pool corruption and lot of other strange errors on USBPORT.SYS or
EHCIUSB.SYS If i set the Endpoint to get 1024 bytes and i fill the URB with
IsoPacket[0].Length = packetSize( 0x400 )
IsoPacket[0].Offset = 0
IsoPacket[1].Length = packetSize-6;
IsoPacket[1].Offset = packetSize;
and the other 6 packets are filled with 1 byte
( see the proposed algorithmin PerformHighSpeedTransfer Isorw.c example )
I can see data streaming for a while then crash!
Thanks a lot in advance.
bye
emag
Why don't you just submit the URB as soon as you create it? I don't
understand the purpose for the 1ms delay.
>
>5) at Completion the IrpReuse is called and the IRP is reinserted in the
>IoCsq Queue.
If these are IRPs that you created, then there is absolutely no point in
using an IoCsq queue. IoCsq is for you to hold IRPs that you have received
from above, which might be cancelled by others. For IRPs that you created
that are currently idle, just use a LIST_ENTRY linked list.
Alternatively, you could just create the IRP each time you need a new URB.
IRP creation is not an expensive process. If there is a chance that your
queueing is causing the problem, I suggest you eliminate it.
>This works well wihen i send 8 packets with a packetSize of 0x100 but i need
>to send 2048 bytes faster and not in 8 frames.
>I get Pool corruption and lot of other strange errors on USBPORT.SYS or
>EHCIUSB.SYS If i set the Endpoint to get 1024 bytes and i fill the URB with
>IsoPacket[0].Length = packetSize( 0x400 )
>IsoPacket[0].Offset = 0
>IsoPacket[1].Length = packetSize-6;
>IsoPacket[1].Offset = packetSize;
>
>and the other 6 packets are filled with 1 byte
>( see the proposed algorithmin PerformHighSpeedTransfer Isorw.c example )
>
>I can see data streaming for a while then crash!
So, are you saying that SOME of these URBs complete successfully? Are you
able to see chunks of 2048 bytes in your device? If so, then that suggests
there is something wrong with your bookkeeping, not with the requests
themselves.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
Now i send urbs with 3072 bytes, the fifo receives the data and a fpga reads
asyncronously the fifo. The fpga reads the fifo data in 5ms then i send again
3072 but the empty flag of the fifo for 720uS is high indicating no data in
the fifo.
i m trying to send continously Urbs but the empty flag is always high for
720uS.
the irp pool is 15
the fx2lp is configured as EP2 iso 4x polling 0
wMaxPacketSize = 0xc00
it seems impossible i cannot fill the fifo every 2.5 ms or saturate it
doing a test.
bye
emag
Perhaps we should ask, what are you really trying to accomplish? What is
your actual goal here? If we know that, we can suggest to you the best way
to accomplish it.
5ms is a very long time for a high-bandwidth endpoint. With the endpoint
as you have configured it, you will be transferring 3072 bytes every 125us.
How are you deciding when to send your data? As long as you have a URB
submitted and waiting by the time the first URB completes, you will get
continuous transfers.
hello Tim, i need to stream data in a fx2lp fifo then the data are read
asynchronously by a fpga. The problem is the clock of the fpga that is not
the same of the isochronous endpoint that feeds the fifo.
So i don't know how to inform the windows driver to send data when the fifo
is half empty.
Maybe i can use endpoint 2 iso at 3x buffering and i can use another
endpoint in interrupt mode to feedback info about the fifo.
I tried to modify the SyncFrame message to report the fifo status but the
driver needs to poll every time and it doesn't seem a good solution.
I don't know if there is a way to accomplish the isochrounous trasmission
with a feedback.
Thanks in advance for your support
emag
Right. You're using the FX2's slave FIFO mode for this, right?
>So i don't know how to inform the windows driver to send data when the fifo
>is half empty.
The problem is that your situation is not suited to an isochronous pipe.
You should switch to a bulk pipe. That way, when the FIFO is full, the FX2
will refuse additional transfers, and USB will keep retrying until space is
available. Your driver can just send a couple of URBs full of data, and
when one of them is returned to you, you can fill it and send it back.
>I don't know if there is a way to accomplish the isochrounous trasmission
>with a feedback.
There is, but your task is better suited to a bulk pipe.