A little understanding of USB synchronous Transmission Feedback

Source: Internet
Author: User
Tags time interval

This period of time has been doing the development of USB Audio device (UAC) devices. Because UAC uses isochronous endpoint to transmit data, the clock is more demanding. But unfortunately our embedded platform clock is not allowed, data synchronization becomes a problem. After research, it is found that only asynchronous patterns can be used to solve this problem.
The so-called asynchronous mode, is to establish a feedback endpoint at a fixed time interval feedback local clock to host, so that the host side can be real-time understanding of the client side of the clock changes, adjust the length of the packet, so as to avoid receiving or sending buffer overflow.
USB 2.0 spec in 5.12.4.2 clearly defined how to provide feedback to host, personally feel a bit more complex, summed up as follows:
1. The Feedback endpoint data length is 3 bytes, and the send interval is determined by Brefresh.
2. FM = FS * 2^P, FM is the local clock frequency, Fs is the sampling frequency.
3. tmeas=2^k/2^p=2^ (k-p), Tmeas is the measurement time, for full speed, k= 10, for high speed, k=13
4. At every tmeasframe/subframe time interval, write the local clock number to feedback endpoint.

The above section looks very complicated, but the basic idea is simple. is not the clock is not synchronized, want to let everyone in sync, how to do it. For example, if the sampling rate is 48000, if the clock is synchronized, then there should be 48,000 samples in 1s of time. If not synchronized, then the measurement of 1s, the actual sample number in 1s to return to the host side on it. The above formula is actually meant to be expressed. As to note the return format, spec says for full speed, the data format is 10.14, and for high speed, the data format is 16.16. If your UAC device is 1.0 version, then you define it as a device with a high speed, and the return data format is 10.14.
For example:
48000 Sample Rate –> Feedback (* 2^14) = 0xc0000
47000 Sample Rate –> Feedback (* 2^14) = 0xbc000

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.