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

Chapter 4

 

Data Flow Model

Wireless Universal Serial Bus Specification, Revision 1.0

4.11.6Choosing an Isochronous IN or Isochronous OUT Endpoint Buffer Size

Buffer size is an application specific decision involving the following factors:

1.Desired short term error tolerance.

2.Cost.

3.Acceptable stream delay/latency.

At a minimum an isochronous OUT function endpoint must have enough buffering associated with it to tolerate the longest possible over the air latency between service attempts – 8.192 milliseconds. Additional buffering provides additional short term error tolerance.

Warning: If only 8.192 milliseconds of buffering is provided the stream may fail with only a single error on an over the air transmission if it occurs immediately before or after the longest gap in over the air service.

Additional error tolerance is provided by using additional buffering to provide delay in the stream. If the stream has latency requirements, the amount of buffering that can be added is limited.

Note: An isochronous stream may have different latency requirements in different use situations. An isochronous device can provide alternate settings that report buffer sizes less than the physical buffering available. The endpoint must only use the amount of buffering (delay) reported in the selected alternate setting.

When there are no latency requirements, or the latency requirements allow a large amount of latency, the implementer must make a trade-off between short term error tolerance and buffering cost.

The endpoint buffer size is reported as wMaxStreamDelay in the Wireless USB Endpoint Companion descriptor, see Section 7.4.4. The wMaxStreamDelay parameter is reported in units of time. For an isochronous IN endpoint the value indicates the smallest amount of time it will take to fill the buffer from empty and cause the first discard if no data is being drained from the endpoint buffer by the host. For an isochronous OUT endpoint buffer, wMaxStreamDelay represents the smallest range in presentation times for data that can completely fill the endpoint buffer if it is not passing data to the data sink. The time is measured specifically from the first (smallest) presentation time in the buffer to the presentation time of the first packet that could not be accepted due to lack of buffering.

4.11.7Isochronous OUT endpoint receiver implementation options

A host must discard any packets whose presentation time has expired. When a host discards data packets during a burst to an isochronous endpoint it must not reuse the same sequence numbers to transmit new data packets and must start including in its MMC a Discard Packet IE (refer to Section 7.5.10).

How an Isochronous OUT endpoint receiver determines which packets have been discarded by the host is implementation specific. This section presents some informative examples of receiver implementations.

Figure 4-36 shows the transmit and receive window characteristics for an example receiver burst engine that will be used as the basis for discussing different implementation options.

67

Chapter 4

Data Flow Model

Host Transmit Window

7

S

0

S

 

6

S

S

1

5

2

S

S

 

S

3

4

S

Wireless Universal Serial Bus Specification, Revision 1.0

Device Receive Window

 

T

7

S

0

0

S

 

6

 

 

T

 

 

1

S

 

S

 

1

S0, S1, S2

 

2

 

5

 

2

S

 

S

 

 

 

T

S

 

S

 

 

4

3

 

 

 

 

)

 

 

 

0

 

 

 

0

 

 

 

0

 

 

 

1

 

 

 

1

 

 

 

1

 

 

 

0

 

 

 

0

 

 

 

(

 

 

 

K

 

 

 

C

 

 

 

A

 

 

 

Figure 4-36 - Receive window for isochronous OUT function endpoint with a burst size of 3 and maximum burst sequence number of 8.

Each isochronous data packet is associated with a burst sequence number SN, and a presentation time TN. Burst sequence-numbers are used to keep transmit and receive windows synchronized as described in Section 5.4. Presentation-time is used by the host for determining when data packets should be discarded and can be used by the device for determining when the data should be consumed. A host must discard isochronous packets when their presentation time has expired. When a discard occurs the host must start transmitting a Wireless USB Isochronous Packet Discard IE (WISOCH_DISCARD_IE) containing the first sequence number of the isochronous data packet that the host will transmit for that endpoint (bFirstReceiveWindowPosition), together with the new value for the transmitter’s window (bmDeviceReceiveWindow), the number of isochronous data segments that were discarded (wNumberDiscardedSegments), and the number of isochronous data packet that were discarded (wNumberDiscardedPackets). Every time the host starts a new sequence of discards (i.e. after it receives a valid handshake packet from the device’s endpoint) it must increment the identifier for the discard sequence (bDiscardID).

The WISOCH_DISCARD_IE is then used by the device to determine if one or more data packets were discarded at the host’s side and to reconstruct the gaps between received packets.

In Figure 4-36 the device has correctly received the data packets associated with S0, S1 and S2 and notified the host that it is ready to receive that next burst of data (S3, S4, S5).

After the next burst the data packet associated with S3 is not received. The other two packets associated with S4 and S5, are received successfully as shown in Figure 4-37.

68

Chapter 4

 

Data Flow Model

Wireless Universal Serial Bus Specification, Revision 1.0

Host Transmit Window

7

S

0

S

 

6

S

S

1

 

5

2

S

S

 

S

3

4

S

7

S

0

S

 

6

S

S

1

 

5

2

S

S

 

S

3

4

S

S3, S4, S5

X

) 0 0 0 1 0 0 1 1 ( K C A

Device Receive Window

7

S

S

0

6

S

S

1

 

T5

2

S

S

 

5

 

S

3

4

S

T

 

4

 

Figure 4-37 – Receive window after 2 of 3 packets are received successfully in second burst.

At this point, the presentation time T3 expires and the host discards the packet associated with S3. It will construct a WISOCH_DISCARD IE containing the following values:

bFirstReceiveWindowPosition = 6

bmDeviceReceiveWindow = 11000001

wNumberDiscardedPackets = 1

bDiscardID = x (must be a different value than last WISOCH_DISCARD_IE sent to the function endpoint)

The host will transmit the WISOCH_DISCARD IE in the next MMC together with a WDRCTA (for transmission of data packets S6, S7 and S0) and a WDTCTA for handshake.

4.11.7.1Presentation Time aware implementation

This section describes an implementation of an Isochronous OUT endpoint receiver for a device capable of processing the presentation time associated with each isochronous data packet. In this implementation, after receiving the WISOCH_DISCARD IE the device examines the bFirstReceiveWindowPosition field to determine the first packet that will be transmitted by the host.

This information will allow the burst engine to properly update the pointer for its receive window.

The device will also reset the window to the state specified in the bmDeviceReceiveWindow field, before the start of the next WDRCTA in which the endpoint will receive the next burst of data. The data sink will have retrieved all the data available in the buffer (in the example considered: the data packets associated with S4 and S5) and will process the data at the appropriate presentation time (in the example considered: T4 and T5). If the stream is periodic, the data sink will see a gap between the presentation times of received packets and will be able to determine how many data packets were discarded by the host (in the example considered: the data packet associated with T3).

69

Chapter 4

 

Data Flow Model

Wireless Universal Serial Bus Specification, Revision 1.0

The next burst transmitted by the host will contain data packets containing timestamps T6, T7 and T8 associated respectively with S6, S7 and S0.

If the packets are all received correctly, the receive window will look like the one depicted in Figure 4-38.

Host Transmit Window

7

S

0

S

 

6

 

S

S

 

1

5

 

 

2

 

S

 

 

S

 

 

 

 

 

S

3

 

 

4

S

 

S3 Discard

 

 

 

 

7

S

0

 

 

S

 

 

Discard IE

 

 

 

 

6

 

 

 

bFirstReceiveWindowPosition=6

 

 

S

wNumberDiscardedPackets=1

 

 

 

S

 

 

1

 

 

 

 

 

 

 

 

 

bmDeviceReceiveWindow=0xC1

 

 

 

2

S6, S7, S0

5

 

 

 

S

 

 

S

 

 

 

 

 

S

3

 

 

4

S

 

 

 

 

 

 

)

 

 

 

 

0

 

 

 

 

1

 

 

 

 

1

 

 

 

 

1

 

 

 

 

0

 

 

 

 

0

 

 

 

 

0

 

 

 

 

0

 

 

 

 

(

 

 

 

 

CK

 

 

 

 

A

Device Receive Window

 

7

T

8

 

T

S

 

7

 

 

S

0

6

6

 

 

T

 

S

 

S

 

1

 

 

 

T5

2

S

S

 

5

 

S

3

4

S

T4

 

Figure 4-38 Receive window after receiving WISOCH_DISCARD IE and burst for sequences S6, S7, and S0 correctly.

4.11.7.2Presentation time aware implementation with “false” acknowledgement

An ISO receiver endpoint implementation may produce “false” acknowledgments in anticipation of a discard notification by the host.

In the case where the data packet associated with S3 is not received and the two packets associated with S4 and S5 are received correctly, this type of implementation will attempt to acknowledge successful reception of all three packets before the expected presentation time for the original packet associated with S3 expires (and therefore before the host starts including a WISOCH_DISCARD IE in its MMC). The updated receive window for this case is shown in Figure 4-39.

70

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