May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

24

Transcript of May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

Page 1: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.
Page 2: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 2

Isochrony and SynchronizationIsochrony and

SynchronizationGeert KnapenGeert Knapen

Philips ITCL-USAPhilips ITCL-USA

Page 3: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 3

AgendaAgenda

What is the problem?What is the problem? SynchronizationSynchronization Implementation in USB2.0Implementation in USB2.0 ConclusionsConclusions

Page 4: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 4

Focus on SynchronizationFocus on Synchronization

Isochrony Implies...Isochrony Implies...

Data transport requirementsData transport requirements SynchronizationSynchronization Latency considerationsLatency considerations Buffer requirementsBuffer requirements Host responsibilitiesHost responsibilities Data error detectionData error detection ……

Page 5: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 5

The Synchronization ProblemThe Synchronization Problem

Establish data connection between source and Establish data connection between source and sinksink– In general, data is synchronous in nature at both endsIn general, data is synchronous in nature at both ends– Source and sink potentially run off independentSource and sink potentially run off independent

sample clockssample clocks Source and sink have their private stream Source and sink have their private stream

characteristicscharacteristics– Sampling rateSampling rate– Synchronization typeSynchronization type– Data formatData format

Page 6: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 6

The Synchronization ProblemThe Synchronization Problem

USB is used to interconnect both devicesUSB is used to interconnect both devices– No support for synchronous streamsNo support for synchronous streams– Isochronous is next best thingIsochronous is next best thing– Source sampling rate gets lostSource sampling rate gets lost

To establish connection, proper conversionsTo establish connection, proper conversionsmust take placemust take place– From synchronous to isochronousFrom synchronous to isochronous– Sampling rate conversion (SRC)Sampling rate conversion (SRC)– SynchronizationSynchronization– Data format translationData format translation

ContinuedContinued

Page 7: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 7

nn n+1n+1 n+2n+2 n+3n+3 n+4n+4 n+5n+5

Sample ClockSample Clock

DataData

(Micro)Frame Time(Micro)Frame Time

00 11 22 33 0 1 2 33 00 11 22 33 0 1 2 3 00 11 22 33 4

PacketizingPacketizing

From Synchronous to Isochronous on USBFrom Synchronous to Isochronous on USB

Page 8: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 8

nn n+5n+5

Sample ClockSample Clock

Frame TimeFrame Timen+1n+1 n+2n+2 n+3n+3 n+4n+4

Back to SynchronousBack to Synchronous

??

Page 9: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 9

AgendaAgenda

What is the problem?What is the problem? SynchronizationSynchronization Implementation in USB2.0Implementation in USB2.0 ConclusionsConclusions

Page 10: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 10

SynchronizationSynchronization

Provides the solution for the missing sample clockProvides the solution for the missing sample clock Source sample clock is ‘reconstructed’ at the sink sideSource sample clock is ‘reconstructed’ at the sink side Different synchronization types needed, depending on Different synchronization types needed, depending on

source and sink naturesource and sink nature– AsynchronousAsynchronous

Sample clock locked to external or free-running internal clockSample clock locked to external or free-running internal clock

– SynchronousSynchronous Sample clock slaved to SOFSample clock slaved to SOF

– AdaptiveAdaptive Sample clock derived from average desired data rateSample clock derived from average desired data rate

Page 11: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 11

SynchronizationSynchronization

Requires additional data rate information exchange Requires additional data rate information exchange between source and sinkbetween source and sink– FeedbackFeedback

Rate info sent against the direction of the data flowRate info sent against the direction of the data flow– FeedforwardFeedforward

Rate info sent in the direction of the data flowRate info sent in the direction of the data flow

Rate info can be conveyed explicitly or implicitlyRate info can be conveyed explicitly or implicitly– ExplicitExplicit

A dedicated isochronous pipe is usedA dedicated isochronous pipe is used– ImplicitImplicit

Rate info is extracted from the data stream or derived from SOFRate info is extracted from the data stream or derived from SOF

ContinuedContinued

Page 12: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 12

AsynchronousAsynchronous

SynchronousSynchronous

AdaptiveAdaptive

SourceSource Free runs

Uses implicitfeedforward

Locked to SOF

Uses implicitfeedback

Locked to sink

Uses explicitfeedback

Free runs

Uses implicitfeedforward

Locked to SOF

Uses implicitfeedback

Locked to sink

Uses explicitfeedback

SinkSink Free runs

Uses explicitfeedback

Locked to SOF

Uses implicitfeedforward

Locked to dataflow

Uses implicitfeedforward

Free runs

Uses explicitfeedback

Locked to SOF

Uses implicitfeedforward

Locked to dataflow

Uses implicitfeedforward

Synchronization CharacteristicsSynchronization Characteristics

Page 13: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 13

AgendaAgenda

What is the problem?What is the problem? SynchronizationSynchronization Implementation in USB2.0Implementation in USB2.0 ConclusionsConclusions

Page 14: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 14

Implementation in USB2.0Implementation in USB2.0

For Adaptive source and Asynchronous sinkFor Adaptive source and Asynchronous sink– Explicit isochronous feedback pipe is necessaryExplicit isochronous feedback pipe is necessary– Feedback information and format definedFeedback information and format defined– Association mechanism between data endpoint(s) and Association mechanism between data endpoint(s) and

feedback endpointfeedback endpoint Device reports its synchronization capabilitiesDevice reports its synchronization capabilities

– Endpoint descriptor fieldsEndpoint descriptor fields Clock Mastering capability has been removed Clock Mastering capability has been removed

Page 15: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 15

Feedback Rate Info FfFeedback Rate Info Ff

Goal is to measure sample clock Goal is to measure sample clock FFss– Accuracy better than 1 HzAccuracy better than 1 Hz

FFff indicates the desired sampling clock indicates the desired sampling clock FFss referenced to USB’s notion of time, (referenced to USB’s notion of time, ()SOF)SOF

Expressed in number of samples per USB (Expressed in number of samples per USB ()frame)frame– Can be fractional numberCan be fractional number– Measuring Measuring FFff can take multiple ( can take multiple ()frames)frames

Used by adaptive source and generated by Used by adaptive source and generated by asynchronous sinkasynchronous sink

Page 16: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 16

Ff Format for Full SpeedFf Format for Full Speed

Integer part needs 10 bits to encode up to 1023 Integer part needs 10 bits to encode up to 1023 one-byte samples per frameone-byte samples per frame

Fraction needs 10 bits to resolve sampling Fraction needs 10 bits to resolve sampling frequency to < 1 Hz within a 1 kHz frame ratefrequency to < 1 Hz within a 1 kHz frame rate

Lower 4 bits are reserved for future useLower 4 bits are reserved for future use

002323 13131414

IntegerInteger FractionFraction

3344

RFURFU

Page 17: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 17

IntegerInteger FractionFraction RFURFURFURFU

002828 15151616 223329293131

Ff Format for High SpeedFf Format for High Speed

Integer part needs 12 bits to encode up to 3072 Integer part needs 12 bits to encode up to 3072 one-byte samples per one-byte samples per frameframe

Fraction needs 13 bits to resolve sampling Fraction needs 13 bits to resolve sampling frequency to < 1 Hz within a 8 kHz frequency to < 1 Hz within a 8 kHz frame rateframe rate

Lower 3 bits and upper 4 bits are RFULower 3 bits and upper 4 bits are RFU

Page 18: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 18

Association D/FB EndpointAssociation D/FB Endpoint

Based on Endpoint Number matching Based on Endpoint Number matching (EPN)(EPN)

– Data EP(s) and feedback EP always haveData EP(s) and feedback EP always haveopposite directionopposite direction

– Feedback EP must have same EPN as first data EPFeedback EP must have same EPN as first data EP– Additional data EPs must have ascending EPNsAdditional data EPs must have ascending EPNs

(not necessarily contiguous)(not necessarily contiguous)– Data EP uses first feedback EP with EPN numberData EP uses first feedback EP with EPN number

< its own EPN< its own EPN

Page 19: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 19

Endpoint DescriptorEndpoint Descriptor

Bits 1..0: Transfer TypeBits 1..0: Transfer Type– 01: Isochronous01: Isochronous

Bits 3..2: Synchronization Type Bits 3..2: Synchronization Type – 00: No Synchronization00: No Synchronization– 01: Asynchronous01: Asynchronous– 10: Adaptive10: Adaptive– 11: Synchronous11: Synchronous

Bits 5..4: Usage Type Bits 5..4: Usage Type – 00: Data endpoint00: Data endpoint– 01: Feedback endpoint01: Feedback endpoint– 10: Implicit feedback data endpoint10: Implicit feedback data endpoint– 11: Reserved11: Reserved

bmAttributes fieldbmAttributes field

New!New!New!New!

Page 20: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 20

Implicit Feedback Data EPImplicit Feedback Data EP

Bi-directional isochronous endpoint pair that uses the Bi-directional isochronous endpoint pair that uses the same sample clocksame sample clock

Two possible cases:Two possible cases:– Asynch sink/source EP pairAsynch sink/source EP pair

Source EP can serve as feedback EP for sink EPSource EP can serve as feedback EP for sink EP

– Adaptive source/sink EP pairAdaptive source/sink EP pair Sink EP can serve as feedback EP for source EPSink EP can serve as feedback EP for source EP

RemarksRemarks– USB2.0 spec does not define how feedback info is retrievedUSB2.0 spec does not define how feedback info is retrieved– Multiple data EPs can use same implicit feedback data EPMultiple data EPs can use same implicit feedback data EP

Page 21: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 21

Endpoint DescriptorEndpoint Descriptor

For isochronous endpoints, defines bus access For isochronous endpoints, defines bus access period as period as 22(bInterval-1)(bInterval-1) ( ()frames)frames– bIntervalbInterval in the range [1,16] in the range [1,16]

Usually set to 1 for data endpointsUsually set to 1 for data endpoints Indicates how often new feedback info (Indicates how often new feedback info (FFff) is ) is

available for feedback endpointsavailable for feedback endpoints

bInterval FieldbInterval Field

Page 22: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 22

AgendaAgenda

What is the problem?What is the problem? SynchronizationSynchronization Implementation in USB2.0Implementation in USB2.0 ConclusionsConclusions

Page 23: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.

May 17, 2000 23

ConclusionsConclusions

Descriptors now contain all necessary informationDescriptors now contain all necessary information– Support for bi-directional EP pairsSupport for bi-directional EP pairs

Explicit feedback data and format is well definedExplicit feedback data and format is well defined USB2.0 synchronization mechanisms allowUSB2.0 synchronization mechanisms allow

for high-quality ‘synchronous’ source tofor high-quality ‘synchronous’ source tosink connectionssink connections

All other requirements for ‘high-quality isochrony’ All other requirements for ‘high-quality isochrony’ must be in placemust be in place

Page 24: May 17, 20002 Isochrony and Synchronization Geert Knapen Philips ITCL-USA.