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: Re: USB Isochronous Pipe



> Hi Jonathan, Maruyama,
> 
> if you are programming for a usb 2.0 device then  your trouble is  
> that you are mixing up usb frames and usb microframes. In usb 2.0  
> frames are transfered to the device in microframes. Every usb frame  
> contains 8 microframes.
> 
>> err = (*intf)->ReadIsochPipeAsync(intf,ISO_PIPEREF,isoRequests 
>> [i].buffer,nextFrame,ISO_REQFRAMES,isoRequests[i].frames,  
>> isoCallback, &isoRequests[i]);
> 
> ReadIsocPipe takes usb micro frames as the numFrames argument; so  
> what you are telling the system in this code is to transfer 1 ( !! )  
> usb frame!! That is too little and will fail. In my driver i usually  
> transfer 128 usb frames ( that would be 128 * 8 microframes ). To  
                This means that every  isoch read request include 1024 microframes, 
   It is the same to:
                #define ISO_REQFRAMES 1024
   But I have tested that  the frame list length should be little then 1000
   I have read some code in IOUSBFamily, in file AppleUSBOHCI_UIM.cpp,
   function AppleUSBOHCI::UIMCreateIsochTransfer,
   This function will check numFrames that requested by one isoch read request, as the following:
   if( (frameCount == 0) || (frameCount > 1000) )
   {
      //USBLog(3,
      return kIOReturnBadArgument;
   }
   
  To the code list upper side, the max  frame list reqeust length is 1000
  

> make it even more confusing the currentFrame argument is in usb  
> frames ( not microframes ). So your line
> 
>> nextFrame+=ISO_REQFRAMES;
> 
> is also wrong for usb 2.0 because nextFrame should be in usb frames.  
> nextFrame+=ISO_REQFRAMES/8 would be correct.
> 
> ReadIsochPipeAsync also has problems when you set the frStatus field  
> wrong, ( especially in USB 1.1 ), even though i've seen bug fixes out  
> there that claim that this problem was fixed. Try setting it to  
> kUSBLowLatencyIsochTransferKey before sending the frames on the bus.
> 
> And one more idea: ReadIsochPipeAsync also returns an error if all  
> frames have failed. On my device the first hundred frames just tend  
> to fail so i just ignore the errors until i see that the stream is  
> running. For instance, the usb controller will set the frStatus field  
> to a non zero value if it noticed that not all bytes that were  
> requested were really transferred ( and this happens quite often ).  
> To make it more complicated: sometimes the error code of frStatus is  
> a mac os x error code and sometimes it's the usb error code ( even  
> though, again, apple claims to have fixed this problem, they  
> apparently didn't ( not sure if this still occurs in the newest mac  
> os x version ) ).
> 
> Please tell exactly which error code you are receiving.
> 
> Hope that helped
> 
> Greetings from Germany
> 
> Fabian
> 
> P.S: Oh yeah. As a general advice: update to the newest mac os x  
> version. Some older versions really had problems with iso transactions.
> _______________________________________________
> 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: Re: USB Isochronous Pipe (From: Fabian Renn <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.