Re: Feedback endpoint poll rate

[email protected]
Newsgroups gmane.comp.lib.libusb.devel.windows
Message-ID <[email protected]>
Børge Strand-Bergesen wrote:
> Hi guys,
>
> I'm maintaining an audio ASIO driver for USB Audio Class 2 (i.e.
> Hi-Speed).  It uses libusbK. Descriptor dump from tdd.exe attached.
> Code: https://github.com/nikkov/Win-Widget/tree/exp_asio It builds
> with VC++08.
>
> Most of it works quite well, but I have trouble setting the poll rate
> for a feedback endpoint. This ep lets the Device tell the Host if the
> latter needs to adjust the audio sample rate. That's at the core of
> asynchronous USB audio.
>
> In line 220 bInterval = 0x04. The Device uses 250us microframes.

Presumably you mean the device is high-speed, which uses 125us (not 
250us) microframes?

> Regardless of what I set this bInterval to, the Windows driver polls
> the endpoint at a 1ms rate. OS X and Linux support it in built-in
> class drivers. OS X polls the ep at quite a different rate. (4 or 8ms
> if I remember correctly.) The 0x04 value is a compromize where both
> libusbK and OS X are functional. In Linux I haven't yet correlated
> bInterval to the actual poll rate.

As I understand it, the valid range of bInterval for a high-speed ISO 
endpoint is 1 to 16, so anything outside of that may not behave 
consistently. Are all the other values you've tried within this range? 
It may be that Windows uses 1ms if an out-of-range value is given, while 
OS X uses 4ms or 8ms.

The actual polling interval is expressed as a number of 125us 
microframes, given by 2^(bInterval-1). A value of 0x04 gives:
     2^(4-1) x 125us
   = 8 x 125us
   = 1ms
so that would seem correct.

> I'd like to significantly slow down the poll rate. A 32 or 64ms
> interval will probably work just fine in the application and reduce
> the load on both Host and Device.

So that would be a bInterval value of 9 or 10? Does that fit with what 
you've tried?

> I don't know if there is a bug in the descriptor.
>
> Question: What part of the chain (OS, low-level USB driver,
> libusbK.sys, libusbk.dll, user mode application) does the actual ep
> poll timing? When parsing this value from the descriptor, how is the
> poll timing set up?

I would assume the host controller or its driver, since that deals with 
scheduling transactions on the bus.

> I have control over the user mode application and Device firmware. And
> in both I see that correct feedback data is received and generated,
> respectively. I just don't know how to trace it through the Host and
> back to the Device.
>
>
> Thanks,
>
> Borge

I don't have personal experience of ISO endpoints, so apologies if I've 
only told what you already know should be the case, and you're 
experiencing something different from this. Just thought it worth 
checking on the allowable range and interpretation, since bInterval 
doesn't directly represent a number of (micro)frames.

Mark.


------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Libusb-win32-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.