Você está na página 1de 10

AVB software architecture on ARM Cortex SOCs

Document Number:
990901-FR-60-0108-1

December12, 2012

Shrikant Acharya CTO

Excelfore Corporation
43255 Mission Boulevard Fremont, California 94539 USA


CopyrightNotice:2012ExcelforeCorporation ThisdocumentcontainsproprietaryinformationofExcelforeCorporation.Nopartofthisdocumentmaybe reproduced,stored,copied,ortransmittedinanyformorbymeansofelectronic,mechanical,photocopyingor otherwise,withouttheexpressconsentofExcelforeCorporation.Thisdocumentisintendedfortherecipientonly andnotmeantfordistribution.

Excelfore Confidential

Excellence in Connected Automotive Systems

Table of Contents
1 2 3 4 5 Introduction ........................................................................................................................... 1 Need for AVB in Industry .................................................................................................... 1 AVB System Glossary ........................................................................................................... 2 Basic System Setup ............................................................................................................... 3 Multi-display Projection System under AVB Components .............................................. 4 5.1 Linux Ethernet Driver ..................................................................................................... 4 5.2 Gstreamer ........................................................................................................................ 4 5.3 Media Clock/Vsync Phase Synchronization ................................................................... 5 5.3.1 gPTP (Precision Time Protocol) ................................................................................. 6 6 AVB System Block Diagram ................................................................................................ 7

2012, Excelfore Corporation

Excellence in Connected Automotive Systems

1 Introduction
ThisdocumentisawhitepaperthatdescribesanAVBS/WArchitectureimplemented onARMCortexA8SiliconwithanintegratedEthernet1588MAC. MorespecificallytheAVBimplementationiscreatedonaTexasinstrumentsCentaurus Platform(TI814X).

2 Need for AVB in the Industry


TraditionalclockingsynchronizationinnetworkedA/Vsystemsiselaboratemeans.In theautomotivesector,theclocksynchronizationofdisplaysandmultichannelaudioin aninfotainmentplatformisimplementedusingtheMOST.MOSTBusisanisochronous environment.IntheProA/Vareathedisplaysaresynchronizedthroughacombination ofseparatemasterclockcontrollinkandfixeddelaycompensationdependingonthe lengthofthecontrollink.Synchronizationthushasbeenatediousandtimeconsuming exercise.StandardEthernetdoesnotprovideQoSanditisanasynchronous environment,althoughtopologiesexisttoprovideittoday. TheEthernetAVBProtocol(IEEE1722+IEEE1588or802.1AS)inonesuchstandardthato formallybringsaQoSandsynchronizationimplementationtotheEthernet.By providingglobaltimesynchronizationmechanismcombinedwithaprotocolof prioritizationofstreamsastheypassthroughswitches,makestheEthernetIsochronous liketheMOSTbus.EthernetAVBprotocolwillallowthewidespreadproliferationof EthernetinAutomotive,ProAVandProAudiosystems. ExamplesofEthernetAVBapplicationare: 1)AutomotiveADASinsurroundcameraarchitecture 2)AutomotiveInfotainmentEndpoints 3)ProA/Vvideowallprojectionsystemand 4)MultichannelSoundsystemforAutomotive,StudioEnvironments.
2012, Excelfore Corporation Page 1

Excellence in Connected Automotive Systems

AutomotiveADASSurroundCamerasneedtobringthevideosnapshotsatthesame timetothedriverfromvariouspointsonthecar,ProAVVideoWallsapplicationsneed tohavesynchronizationacrossallscreenssoastoprojectimagesthatarespreadover multiplescreens.EthernetAVBAutomotiveInfotainmentEndpointshavetosynchronize thedisplaysandtheseparatemultichannelamplifiersoundsystemandtheWireless MultichannelAudiothatneedstosynchronizethedelaysamongstspatiallyarranged speakersystems. Thisdocumentpresumesthereaderhasaworkingknowledgeofthestandardssuchas IEEE1722,IEEE1588andIEEL802.ASstandardsthatencompassEthernetAVB.

3 AVB system glossary


ADAS:AdvancedDriverAssistanceSystem A/V:AudioVideoSystem AVBSwitch:EthernetSwitchorHubthatiscompliantwithIEEE1722and802.1AS specifications. InfotainmentSystems:CenterStackinacarthathousestheMediaplaybackofaudio andvideo,system,navigation,phoneconnectivityusingBTetc. BT:Bluetoothhandsfreetechnology Listener:Systemthatreceiveda/vpacketsandsynchronizationsignals.Thea/vpackets aredecodedandpresentedtoascreen. MOST:MediaOrientedSystemsTransport PST:Presentationtimestamp.Theseaccompanytheimagepayloadheader. ProA/V:ProfessionalAudioVideo QoS:QualityofService SyncPackets:Timingsynchronizationpacketsthatprovidingtimingsignalsforallslave nodestobeinsync. Talker:Typicallyacamerasystemorastreamencoderthatencodesvideosignalsand formatsthemasIEEE1722envelope.
2012, Excelfore Corporation Page 2

Excellence in Connected Automotive Systems

4 Basic system setup


ThebasicconfigurationofanAVBapplicationsystemisshownintheFigure1.It consistsoffourHDdisplays,eachhavinganARMCortexA8,Centaurussystemwhich actsaslisteners.AnAVBswitchfeedseachofthelistenersystemswithatime synchronizedHDstreamfromatalker. AfullHDstreamisencodedatthetalkerwhichistimestampedandsenttotheAVB switchfordistributiontothelistenersdestinationaddresses.EachCentaurusListener willdecodethecompleteimagethatitreceivesandusingthevideoscalarcropthe imagetoaquarterofitssizeforthespecificspatialquadrant.Thecroppedimagewhich isnowaquadrantwillthenbescaleduptotheresolutionofthedisplay. E.g.,thefullimagerepresentsaresolutionof1920x1080,aquadrantshallrepresent 960x540.EachofthedisplaysintheFigure1.,areHDresolutiondisplays(1920x1080). Soascalarwilltakethequadrantimageof960x540andscaleitbacktothedisplays resolution. EachlistenerwillusethetimestampsandthevsynctimesynchronizedtothegPTP clock.

2012, Excelfore Corporation

Page 3

Excellence in Connected Automotive Systems

5 Multi-display projection system under AVB components


5.1 Linux Ethernet driver
TheLinuxEthernetdriverservicesthenetworkconnectionfortheEthernetAVBstack. ThedriveriswrittenwitharawEthernetsocketandnotasTCP/IPsocket.Excelforehas aclocktimingevent(CPTStimingevent)supportintheTILinuxnetworkkerneldriveron theA8.ThisallowstheAVBtimingtobeimplemented.TheKerneldriverusesthe hardwareassistavailableintheEthernetMAC(1588TimingExtractor)togetaccessto themasternetworkclockcounterdata.Thisdataisusedtosynchronizeallclockevents inthelistenerasshowninFigure2.0.ThisdriverprocessesallSyncPacketscoming throughthenetwork.Otherpayloadsarepassedtoupperblocksforprocessing.

5.2 Gstreamer
TheAVBSystemwillusetheopensourceGstreamer. Gstreamerisalibraryfor constructinggraphsofmediahandlingcomponents.Theapplicationsitsupportsrange fromsimpleaudioplayback,audio/videostreamingtocomplexaudio(mixing)andvideo (nonlinearediting)processingMultimediastreams.Gstreamerwillbeusedforthe videodecoder,scalingandpresentation. TIsupportsGstreamerthroughtheirOpenmaxCodeccomponents.Gstreamerwill providegreaterflexibilitythanusingtheTIOpenmaxcomponentsdirectly.Special featuressuchvideocropping,videoscalingetc.,arebetterhandledinGstreamer. StandardsupportforIEEE1722packetsisavailableaspartoftheAVBstackfrom Excelfore.Howeverinterfacesforspecializedprotocolse.g.RTPcanbeprovidedaspart ofthedelivery. AstandardlistoffilterstoenablemultimediacomponentsisprovidedwiththeSDK.. Thesewillincludeallcomponentsofthefiltergraphusinghelperse.g.playbin,decoder bin.
2012, Excelfore Corporation Page 4

Excellence in Connected Automotive Systems

ThePSThastobeextractedfromtheencodedstreamreceivedatthelistenerandmade availableatthestartofpresentationwhilethecompressedimageisdecodedandready tobedisplayed.AttentionhastobepaidtoFramereorderingfordisplayasFramesare compressedandordereddifferentlyforeaseofdecoding.WeareunlikelytohaveB framesinourh.264.RegardlessevenifthedecoderusesonlyIorbothI&Pframes, thereneedstobetimestamps. WerecommendthattheTalkermulticastasingleHDstreamtoallfourlisteners.An optionalmethodavailableistotransmitfourseparateHDstreams,oneforeach listener,butthisrequiresfourtimesthebandwidth.ThereisaHDstreamdecoderin eachlistenerbox. ThevideorendererwilltimethepresentationofdecodedframesbasedontheMedia clockusingPTS(Presentationtimestamps).Fortypicalvideoprojectionapplications, onlyvideoneedstobesynchronized. ForalltheflexibilitythatisprovidedbygStreamer,itdoescomewithaddedoverhead forprocessingwhichcanbecomeabottleneck.IfCPUprocessinghastobeoptimized thenamorecompactschemeisrecommendedthatbypassesthegStreamer framework.

5.3 Media Clock/Vsync phase synchronization


VSyncsynchronizationwillbeprovidedinvideodriver.Systemclockhastobe synchronizedwiththeEthernetclock.ThissystemclockthensynchronizestheMedia clock. Duringinitialization,thetalkerwillsendmessagestosynchronizeVsyncsforallthe listenersatapointoftimeinthefuture.Allfourlistenerswillthenresettheirvideo controllerattheirprescribedtimeonthereceiptofthesyncmessage.Oncethissync
2012, Excelfore Corporation Page 5

Excellence in Connected Automotive Systems

eventhappens,ateveryVsyncInterrupttheSystemclockismonitoredtomakeany adjustmentstothevideoclockfrequency,tomaintainthesynchronization.Thisisthe phasesynchronizationoftheVsync. Amechanismhastobeaddedthatwillallowallsystemstosynchronizeandstarttheir presentationatthesametime.Thecontrolsystemcandecidehowtomovethevideo duringthevsyncinterrupte.g.ifitisslowtoskipaframeandiffaster,thentorepeata frame.AVCOcontrollerHWclockcanmakethingseasierasitprovidesmoreprecise timingcontrol. AllvideocontrollersystemsetupisthesamewitheveryCentaurusplatform.Firstthe videodriverhastobesynchronized.Theneverylistenerhastobesetupwithprecise timesoastostartinsync.Thereissomemaintenancecodethatisrunningduringthe vsyncinterrupttomakesurethatclocksinthelistenersarenotdriftingawayandare undercontrol. Whenthesystembootsupthevideoisgoingtobefreerunningandtheremaynotbea control.Howevercontrolcanbeexercisedthroughthevideodriverandaresetcanbe executedataspecifiedsystemtime.Videocanbedisabledandthenenabledona specifiedtimee.g.asystemmessagecanbeissuedtohavearesetin1ms.Targetisto maintainVsyncSynchronizationacrossallfourtalkersataprecisionbetterthan1ms drift.

5.3.1 gPTP (Precision Time Protocol)

TheCPTSdriverisalreadyimplementedontheCentaurususingtheHWtimestampin thekernelspace.APTPdaemoncanbecreatedinuserspacethatcanaccessthisHW timestamp.TheEthernetclockavailablethroughthenetworkshouldsynctheHWtime stampinthelistener.ThiswillphaselockthevideoclocktotheEthernetclock.Video driveralsoaccessestheHWtimestampasshowninthediagram.All4orfivesystems arephaselockedwithsomejitterbutwithinthelimits.


2012, Excelfore Corporation Page 6

Excellence in Connected Automotive Systems

AlthoughtheSOWrecommendsusingptpdv2approachtotimingsynchronization,a moreconsistentapproachwouldbetousegPTPforboththePCandtheEVM.Our beliefisthatTIusedtheptpdv2approachasexpedientonthePCsidewhenthey developedtheLinuxcodeforthePC.OntheEVMsideTIcontinuestousethegPTPd. SiriusmodifiedptpdcodeisunifiedforbothPCLinuxandTIBIOS6.Itcanbeeasily appliedforTILinux.IfthecpswdriverworksontheEVMboardswithoutanyissues thenwecanintegratethecurrentcodetoworkonTILinux.

6 AVB system block diagram


TheAVBProA/Vsystemhassixcomponentstocontrolthedeliveryofsynchronized videofromtalkertothelisteners. Thecomponentshavealreadybeendescribedabove.Thisblockdiagramprovidesthe interactionbetweentheblocks. Thesystemcomponentsare 1. LinuxKernelDrivers 2. NetworkDriver 3. CPTSDriver 4. 802.1ASgPTPTiming 5. VideoApplication 6. Gstreamer 7. VideoSubSystem 8. VideoOutHWClock ThepayloadandsynctimingdataisreceivedintheNetworkDriver.Thesynctiming messagesarepassedtotheCPTSdriverforclocksynchronizationtothe802.1ASblock, whilethevideopayloadisforwardedtoaTCP/UDPdriverwhichforwardsthepacketsto Gstreamer.
2012, Excelfore Corporation Page 7

Excellence in Connected Automotive Systems

VideoApplicationbuildsthefiltergraphandprovidesthehigherlevelmessagesfor videopresentatione.g.Play,Start,Stop,FF,RW.Thevideopayloadgetsdecoded, formattedandmadeavailabletotheVideoSubSystemforapresentation.Ahigh precisionclocksourcewhichisphaselockedwiththeClockDriverSync,isusedto generatetheSystemclockandtheCPTSclock.TheSystemclocksynchronizesthevideo subsystemclock,Mediaclockand802.1AgPTPlayer.TheCPTSclockdrivestheCPTS HWTimestampcontrol,whichisthenmadeavailabletothegPTPlayer.Synch MessageswhichcomeasrawEthernetpacketsandarepresentedtothegPTPlayer.Th e802.1ASlayer,phaselockstheclockdrivertotheEthernetclock.TheSourceclock providestriggerstotheclockdriverandthesystemclock.TheSystemandClockdriver serveasinputstotheCPTSsystemwhichisbeingsynchronizedwiththesystemtime throughthesyncmessages. TheSystemclockismadeavailabletotheentiresystemblocktosynchronizetheir operations.

2012, Excelfore Corporation

Page 8

Você também pode gostar