Скачиваний:
31
Добавлен:
02.05.2014
Размер:
3.51 Mб
Скачать

Chapter 4

 

Data Flow Model

Wireless Universal Serial Bus Specification, Revision 1.0

4.11.5 Wireless USB Isochronous OUT Example

This section walks through a simple high level example to illustrate the basic steps that occur in the operation of a wireless USB isochronous OUT endpoint. The wireless USB isochronous OUT example is similar to the isochronous IN example in reverse. When a device with an isochronous OUT endpoint exchanges configuration information with the wireless USB host, it reports the amount of buffering that it has for use with each isochronous OUT endpoint. The buffering amount is reported in the wMaxStreamDelay field in the endpoint companion descriptor described in 7.4.4.

Figure 4-32. Configuring Wireless USB Isochronous OUT Endpoint

The isochronous OUT endpoint in this example produces an average of 30 1024 byte packets every 65.536 milliseconds. The device contains enough buffering to store 8 of these packets. The endpoint descriptor reports a maximum packet size of 1024, a maximum burst size of 2, a service interval of 4.096 milliseconds, and a wMaxStreamDelay of 16.384 milliseconds.

Figure 4-32 shows the size of the isochronous OUT endpoint. The buffer positions are indexed for reference throughout the example. The host buffering must be able to store enough data for the isochronous OUT stream that the host will only discard data when it is no longer usable by the device. The rest of this example describes exactly when the host will discard data. Both buffers are empty before the stream starts. When the Wireless USB host first receives data for the stream it attempts to send it to the isochronous OUT endpoint.

Figure 4-33. Initial Data Sent To Isochronous OUT Function Endpoint

Figure 4-33 shows the initial data as it is received by the host and sent to the Wireless USB isochronous OUT endpoint. The wireless USB host will continue to send data as it receives data from the application. Each data packet sent to the isochronous OUT function endpoint contains header information that indicates the Wireless USB Channel time when the data is intended for consumption. These presentation times can be used by the device to place data in the proper buffer locations and determine when data should be consumed by the function endpoint. When the isochronous OUT function endpoint has data with the current presentation time it will consume the data. The endpoint function must examine the presentation time in the packet with the first sequence number when the stream starts. The endpoint function begins consuming data when the Wireless USB channel time reaches the presentation time of the initial data. The host must attempt to apply initial presentation times and schedule the stream start up such that the isochronous OUT function endpoint buffering will be full when it begins to consume data based on the initial presentation time. This allows the isochronous output buffering to provide the maximum delay and short term error tolerance for the stream. Figure 4-34 shows the state of the system when data consumption by the function on the isochronous OUT function endpoint begins.

65

Chapter 4

 

Data Flow Model

Wireless Universal Serial Bus Specification, Revision 1.0

Figure 4-34. Data Consumption Starts For Isochronous OUT Function Endpoint

When the stream starts the host starts sending the first packet to the isochronous OUT function endpoint at Wireless USB channel time zero. The packet is marked with the presentation time 16 milliseconds (presentation times are rounded to even milliseconds for simplicity in the example). The isochronous OUT function endpoint buffer fills. When the Wireless USB channel time reaches 16 milliseconds the endpoint function begins to consume data starting with the first packet received with presentation time 16. Unless there have been significant errors during the start up of the stream, the isochronous OUT function endpoint buffer will be full when it begins consuming data. A delay of approximately 16 milliseconds has been added to the system by the buffering and stream startup conditions. This delay provides tolerance to short term errors and glitches in the stream as operation continues. If the isochronous OUT function endpoint had desired greater tolerance to short term error bursts and glitches it could have used additional buffering. The amount of buffering to use is a device designer’s decision. It is a tradeoff between cost, error tolerance, and the amount of acceptable delay/latency in the stream. The tradeoff is discussed in more detail in section 4.11.6.

During normal operation the isochronous OUT endpoint buffer will stay relatively full. If there is a prolonged period where the error rate is high the presentation time for the oldest un-transmitted data on the host will get closer to the current Wireless USB channel time and the isochronous OUT endpoint buffer will begin to empty. As long as the error rate decreases again before the isochronous OUT endpoint buffer underflows, the system will recover. However, if the errors continue the device buffer will eventually underflow. When errors occur the isochronous OUT endpoint will not have data to consume and the host will discard data if it has not been able to transmit the data and the Wireless USB channel time reaches the presentation time for the data.

Figure 4-35. Buffer Overflows and Host Must Discard Data For Isochronous OUT Function Endpoint

Figure 4-35 shows the case where the error rate has been significant for a prolonged period. The Wireless USB channel time reaches 48 milliseconds and the host must discard the packet with a 48 millisecond presentation time. At this point the host must discard data. The host only discards data when the data is late based on its presentation time. The host will continue to try to send data until it is forced to discard data when the presentation time for data that has not been transmitted has expired. The host must discard data to an isochronous OUT function endpoint if the presentation time for the data has expired. Section 4.11.9 examines error handling in more detail. There are methods for communicating the amount of information that has been discarded and options for attempting to prevent host discards from occurring.

66

Соседние файлы в папке Wireless USB Specification Revision 1.0 May 12, 2005