Alan Stern 写道:
> On Tue, 9 Jan 2007, xiaoxin liu wrote:
>
>   
>> Hi, Alan
>> Thanks for your reply.
>> I still have some questions as follows:
>>     
>
>   
>>> Your driver must keep the endpoint queue full at all times.  In practice 
>>> this means that you must keep several URBs queued, and each time one of 
>>> them completes your completion handler routine must submit another URB.  
>>>   
>>>       
>> You mean that I should resubmit a URB in completion handler in my 
>> driver.
>>     
>
> Yes, that's what I meant.
>
>   
>>  However,
>> Currently I submit isochronous transfer request from user application 
>> through ioctl(), not in a kernel usb device
>> driver. In fact, the completion handler routine is defaultly set as 
>> async_completed(). That is to say,
>> I can't modify the completion handler to resubmit a URB.
>> What suggestions for this situation??
>>     
>
> Do you mean that your driver runs entirely in userspace?
>   
Yes, that is right. In fact, it is a part of libusb, which is an open 
source project in sourceforge.
> You can still keep the endpoint queue full, but the procedure isn't quite
> as reliable.  All you have to do is submit enough URBs in advance so that
> the queue never gets empty, even given the normal overhead and latency of
> running user programs.  So for example, let's assume that your system has
> 100-ms latency for task-switching to your program.  Then you would need to
> keep at least 100 ms worth of data in the endpoint queue at all times.  
> It doesn't all have to be in one URB; in fact you're better off splitting
> it among several URBs.  For instance, you might submit 5 URBs, each of
> which contains 25 ms of data.
>   
you mean while doing isochronous transfer in user space I should submit 
servel URBs
together in the first time. Then resubmit urb in each urb's completion 
handler. Am I right?
> And like I said before, every time an URB completes you must submit a new
> one.  You don't have to resubmit in the completion handler itself; the 
> handler can set a variable telling the main program how many URBs to 
> resubmit.
>
> Alan Stern
>
>   
Xiaoxin

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to