Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IOUSBPipe->Read() performance



Mike,

I have another question. Could this be an issue that it takes us too long to prepare the internal descriptors on your Read call (it is a big read, after all) after the issuance of the Write call to get the device going? In other words, could the problem be that there is too large a latency between when the device receives the command to start generating data and when the first IN token comes to it. Could the device have already overflowed its buffer by then, but we get the first two packets?

Is it possible to issue the Read and have it pending before you issue the write? How will the device respond to a Read if you haven't issued the command yet?

If that is not possible, what happens if you issue a 8*512 byte read in one read, followed immediately by a 232*512 byte read in a second command? Try something like that and see what happens.

Rhoads Hollowell
USB Software Team
Apple Computer, Inc.

On Jul 6, 2005, at 11:59 AM, Mike Smith wrote:

Hi David,

Thanks for your last e-mail. .

> This should not normally be a problem (and a
> single read of 240*512 is the way to go),
Well that what I thought....

> however you are sharing the USB bus with other devices,
> and you may not be able to count on this
> throughput depending upon the bus topology (ie, what other devices are connected).


I am not connecting any other USB device, but I am still having trouble getting all the 240*512
packets.


I'll try to explain better how does the device handle the bulk transaction:
1 - The host needs to send a command using the bulk transfer (bulk
out) to request the data.
2- If the device accepts the command, the host will start receiving
data through the bulk In endpoint
3 - The device checks periodically for buffer over run to make sure
there is no data lost. If it detects that the data wasn't pulled out fast
enough (512 bytes in 256 us) then it will terminates the current
transaction and wait for another request.


>-- Does the host issue IN token with sufficient frequency?
Well I am just requesting a single read of 240*512. When I use smaller buffers and overlap the transfers, I am able to get more data from the device than if I use a single read of 240*512..


>-- Does the device respond with data, or is it sending NYET tokens?
It does until the device detects a buffer over run which means that the data wasn't pulled out fast enough.Then the device will terminate the transaction.


>- Are the packets received correctly (host sends ACK), or retried?
>-- Does the data toggle seem to be working correctly? (DATA0/ DATA1) packets
This device works fine on different platform, so I am assuming the data toggle is working correctly....



> If you IOUSBPipeRead() function is timing out, that indicates your device isn't sending the
> data... Perhaps you have the timeout value set to small value, and the device isn't ready to
> start sending data yet...
The device sends the first 2 packets,but after that it detects that the data wasn't pulled out fast enough (512 bytes in 256 us), it terminates the transaction and stop sending data.
Since I set the IOUSBPipe->Read() function to time out after 5s of no bus activity, and since the device stops sending data waiting for a new request, the IOUSBPipeRead() function is timing out after 5 s.



> Or the device isn't handling PING correctly....
I am assuming that shouldn't be the problem since the device is working on windows...


Thanks,
Mike



__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden

This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Usb mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/usb/email@hidden

This email sent to email@hidden
References: 
 >Re: IOUSBPipe->Read() performance (From: Mike Smith <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.