getting real-time performance and voice quality on single core risc devices

39
1 Matt Randmaa, VP of Engineering D2 Technologies www.d2tech.com Getting Real-time Performance and Voice Quality on Single Core RISC Devices

Upload: elisa

Post on 11-Jan-2016

21 views

Category:

Documents


0 download

DESCRIPTION

Matt Randmaa, VP of Engineering D2 Technologies www.d2tech.com. Getting Real-time Performance and Voice Quality on Single Core RISC Devices. Presentation Outline. VoIP Endpoint Device Software Overview VoIP Endpoint Example, Functionality, Software Blocks - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

1

Matt Randmaa, VP of Engineering

D2 Technologieswww.d2tech.com

Getting Real-time Performance and Voice

Quality on Single Core RISC Devices

Page 2: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

2

Presentation Outline

• VoIP Endpoint Device Software Overviewo VoIP Endpoint Example, Functionality, Software Blockso Traditional Software Architecture (RISC + DSP)o New Software Architecture – VoIP on RISC

• Real-time requirements in VoIPo Hard Real-Time, Soft Real-Time, Best Effort

• RISC SoC Design Considerations• Toolchain/BSP Considerations• Software Design Considerations• Conclusion

Page 3: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

3

VoIP Endpoint Example:Analog Telephony Adaptor

(ATA)• Ethernet to FXS adaptor

o Optional second Ethernet port for bridging/routing; FXO for PSTN

• Enables a POTS phone to make VoIP calls

o May support FAX• SIP User Agent application

o Uses SIP protocol to establish calls

• Implements many CLASS features

o Call Waiting, Caller ID, 3-way Calling, Call Transfer, Call Forwarding, etc

WIFI Router

AnalogTelephony

Adaptor (ATA)

Computer

Phone

Cable / DSLModem

Page 4: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

4

Other Endpoint examples

• SOHO Router with VoIP• WIFI AP with VoIP• WIFI ATA• WIFI handset• Dual mode phones• VoIP enabled PDAs, Game Units, MP3

players, iPods• Etc etc.

Page 5: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

5

Legacy HW/SW Architecture:RISC + DSP

DSPAlgorithm

DSPAlgorithm

DSPAlgorithm

V

IP Stack, NAT

O/S

Host Processor

Voice Application

Voice PacketizationRTP

Jitter Buffer

DSPDriver

Voice SignallingProtocol

(SIP, H323,MGCP) Host

InterfaceDSP

Application

ChannelDriver

Audio/TelephoneInterface

Driver

HostDriver

DSP Processor

FXOFXS

SPKR/MIC

O/S Adaptation Layer

RISC Processor Responsible for:• Voice Application, Protocol• IP Stack, Data/Voice Packets• DSP Driver

DSP Processor Responsible for:• Hard real-time telephony interface• DSP algorithms (MHz intensive)• Separate DSP application

o Required to be semi-autonomous

Page 6: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

6

V

IP Stack, NAT

O/S

SoC Processor

Voice Application

Audio/TelephoneInterface

Driver

FXSFXO

SPKR/MIC

Voice SignallingProtocol

(SIP, H323, MGCP)

O/S Adaptation Layer

Soft DSP(DSP Algorithms, Voice Packetization,

RTP, Jitter Buffer)

New SW/HW Architecture:Single CPU

Page 7: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

7

Single CPUAdvantages / Challenges

• Advantages:o Eliminates DSPo Leverages existing SoC

chipso No Interprocessor

communicationo Single Tools /

Development Environment

• Challenges:o Hard real-time

requirementso MHz burden on RISCo Data/Voice/Application

software must co-existo Telephony interface

peripheral

Page 8: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

8

Real-time Requirements in VoIP

• VoIP Endpoint Device Software Overviewo VoIP Endpoint Examples, Functionality, Software Blockso Traditional Software Architecture (RISC + DSP)o New Software Architecture – VoIP on RISC

Real-time requirements in VoIPo Hard Real-Time, Soft Real-Time, Best Effort

• RISC SoC Design Considerations• Toolchain/BSP Considerations• Software Design Considerations• Conclusion

Page 9: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

9

Information Flow in VoIP

Voice Samples(125 us)

Voice Blocks(10 ms)

Voice Packets(< jitter buffer size)

Voice Packets(< jitter buffer size)

Commands/Events(10's of ms)

SIP Packets(100's of ms)

Data Packets(Best Effort)

CODEC NetworkInterface(s)

VoiceISR

VoiceProcessing

Task

NetworkDriver

VoiceApplication and

Protocol

LegendHard Real-timeSoft Real-timeBest Effort

Page 10: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

10

Hard Real-Time in VoIP

• Hard Real-Time: Deadline-based processes in which a failure to meet the deadline will result in loss of voice data and unacceptable system behavior.

• Hard real-time requirements in VoIP:o Telephony Drivero DSP Algorithms

Page 11: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

11

Hard Real-Time Requirement:Telephony Driver

• Telephony Driver: Transmits voice samples to/from the hardware CODEC

• Nature of communication: Synchronous serial interface, 64_kbps per channelo 8000 samples/s, 8 bits/sampleo One sample transmitted/received every

125 us

Page 12: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

12

Hard Real-Time Requirement:Telephony Driver (continued)

Failure in copying in/out each sample before the 125_us deadline results in dropping a voice sample.o Resulting impacts on voice quality

• Can be a noticeable click.• Echo canceller can fail, resulting in perceptible echo to far end.• FAX pass-through or FAX Relay can fail.• Causes drift in jitter buffers, which will may cause dropped

packets

o If subsequent deadlines are missed (domino effect), call failure and system instability can result.

Page 13: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

13

Hard Real-Time Requirement:DSP Algorithms

• DSP Algorithms in ATA: Process the voice stream from Telephony Driver and from IP stack to do:o Voice Compressiono Echo Cancellationo Tone Generation / Detection

• DTMF, FAX/Modem, Call Progress, Caller ID

o Packet Loss Compensation

• Nature of communication: Block based processingo Typically 80 voice samples per blocko One block processed every 10 ms

Page 14: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

14

Hard Real-Time Requirement:DSP Algorithms (continued)

• Failure in completing DSP algorithm processing by the end of the 10 ms deadline results in:o Telephony driver will play out old data to hardware

CODEC.o Far side also gets bad data due to loss of codec

data.o Echo canceller can diverge, causing echo to be

heard on subsequent blocks.o Tone detection can fail, resulting in mis-detection of

DTMF digits or FAX tones.o Again, if subsequent deadlines are missed (domino

effect), call failure and system instability can result.

Page 15: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

15

Soft Real-Time in VoIP

• Soft Real-Time: Processes which should execute in a timely manner, for which system behavior degrades (but may not be unacceptable) if the deadline is missed.

• Soft real-time requirements in VoIP:o Voice Packetization and Transport o Voice Application and Protocol

Page 16: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

16

Soft Real-Time Requirement:Voice Packetization and

Transport• Voice packetization and transport: Packetize the

compressed audio and send it out the IP interface; alternatively, receive a packet from the IP interface and provide it to the VoIP software.

• Nature of communication:o Transmission: Normally, one packet ready every 10, 20, or

30 ms.o Reception: Subject to network jitter, one every 10, 20, or 30

ms.

• Deadline for processing:o Processing should complete within the packet duration (10,

20, 30 ms), in order to keep from getting behind.

Page 17: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

17

Soft Real-Time Requirement:Voice Packetization and Transport (continued)

• Repercussions of failure to meeting deadline:o May be handled by the Jitter Buffer on the receiving

side.o Best-case

• Missing deadline causes jitter buffer to grow, but does not cause lost packets; Results in increased latency because of a larger jitter buffer.

o Worst-case• Missing deadline causes jitter buffer to discard a too-late packet;

Packet loss compensation used to minimize impact on voice quality.

Page 18: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

18

Soft Real-Time Requirement:Voice Application and Protocol

• Nature of communication:o Responds to reception of SIP packets, telephony

events, and internal timers in order to drive Telephony Application functionality.

• Deadline for processing:o Processing should be responsive enough for

successful user experience.o Certain time-outs exist in SIP; however,

retransmission techniques in the protocol allow recovery of some missed deadlines.

Page 19: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

19

Soft Real-Time Requirement:Voice Application and Protocol

(continued)• Repercussions of failure to meeting deadline:

o Noticeable lack of responsiveness of device.o Call failures are possible for excessive delays.

• However, voice application and protocol deadlines are typically on the order of hundreds of milliseconds to several seconds.o As long as the Voice Application and Protocol are

not blocked indefinitely, they should meet timing requirements.

Page 20: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

20

Best Effort in VoIP

• Best Effort: Processes for which there is no deadline, but for which faster execution results in better system performance.

• Best Effort requirements in VoIP:o Data IP Packet Transport

Page 21: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

21

Best Effort Requirement:Data Packet IP transport

• Data Packet IP transport: Process the reception, transmission, forwarding, and bridging of TCP packets.

• Nature of communication:o Packets can be received at wireline speeds (e.g. 100 Mbps).o Device processes as many packets as it can, discarding others.

• Deadline for processing:o No deadline for processing, other than TCP ACK timeout.

• Repercussions of failure to meeting deadline:o TCP packets retransmitted. o Lower data bandwidth.

• These repercussions are intentional and acceptable.

Page 22: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

22

Implications of Real-time Requirements

• A VoIP device has multiple processes with different MHz consumption and real-time needs.

• This places stringent requirements on the OS, BSP, Memory, Cache, other software running on the RISC core, and the SoC design itself.o Each of these areas needs careful consideration.

• This requires a system-wide approach rather than ad-hoc optimization of each piece.

Page 23: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

23

RISC SoC Design Considerations

• VoIP Endpoint Device Software Overviewo VoIP Endpoint Examples, Functionality, Software Blockso Traditional Software Architecture (RISC + DSP)o New Software Architecture – VoIP on RISC

• Real-time requirements in VoIPo Hard real-time, soft real-time, best effort

RISC SoC Design Considerations• Toolchain/BSP Considerations• Software Design Considerations• Conclusion

Page 24: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

24

RISC SoC Design Considerations

• If VoIP requirements are taken into consideration at SoC design time, changes to the SoC design can result in improved VoIP system performance.

• Areas of importance for VoIP:o Cache size and typeo Memory bandwidtho On-chip scratch memoryo Telephony Interface Hardware

Page 25: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

25

Cache size and type, and its effect on G.729AB MHz

performance

80%

82%

84%

86%

88%

90%

92%

94%

96%

98%

100%

8 kb prog / 8 kb data W rite Through

8 kb prog / 8 kb data W rite Back + W rite Allocate

16 kb prog / 8 kb data W rite Through

16 kb prog / 8 kb data W rite Back + W rite Allocate

Re

lati

ve

MH

z

Page 26: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

26

Memory bandwidth and its effect on G.729AB MHz

performance

50%

55%

60%

65%

70%

75%

80%

85%

90%

95%

100%

Bus speed = 1/2 CPU speed Bus speed = CPU speed

Rel

ativ

e M

Hz

Page 27: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

27

On-chip scratch memory and its effect on VoIP performance

• Use of on-chip SRAM can speed system performance by preventing cache miss penalties.

• With a large enough on-chip SRAM, significant savings can result (>30%).

• However, the software has to be modified to take advantage of on-chip SRAM.

Page 28: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

28

Telephony Interface Hardware: SoC’s Without a TDM port

• Currently most RISC based SoCs have no synchronous serial interface appropriate for CODECs.o VoIP designs require a CPLD, increasing Bill of

Materials (BOM).o Minimization of CPLD size will consume more MHz.

• Costs to support 2-channel telephony interface:o > $.50 CPLD costo ~10 MHz consumed by telephony interface softwareo More complicated Board and Software design

Page 29: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

29

SoC’s With a TDM port

• The next generation of VoIP-capable RISC chips add:o Telephony interfaceo DMA capabilities

• Benefits of using TDM/DMA for 2-channel telephony interface:o < $.10 to add TDM port to SoCo ~1 MHz consumed by telephony interface softwareo Real-time deadline loosened from 125 us to as high

as 10 ms.o Simpler Board and Software design

Page 30: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

30

Toolchain / BSP Considerations

• VoIP Endpoint Device Software Overviewo VoIP Endpoint Examples, Functionality, Software Blockso Traditional Software Architecture (RISC + DSP)o New Software Architecture – VoIP on RISC

• Real-time requirements in VoIPo Hard real-time, soft real-time, best effort

• RISC SoC Design Considerations Toolchain/BSP Considerations• Software Design Considerations• Conclusion

Page 31: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

31

Toolchain / BSP Considerations:RTOS

• OS requirements:o Guaranteed worst-case task switch latency that meets the

VoIP latency deadlines.o A preemptive kernel.o A scheduler that prioritizes real-time tasks above non real-

time tasks.

• Examples:o Wind River VxWorkso MontaVista Linux (contains real-time improvements in the

2.6 Linux kernel)o Others (Nucleus, SuperTask, eCOS)

Page 32: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

32

Toolchain / BSP Considerations:RTOS (continued)

Final OS choice involves cost tradeoffs:o License/royalty costo Flash / Memory footprint.o Strong Tools Development Environment.o Bundled network/application software can

lower development costs.

Page 33: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

33

Toolchain / BSP Considerations:Optimizing Compiler

G729AB relative MHz consum ption due to C vs. Assem bly Im plem entation

50%

55%

60%

65%

70%

75%

80%

85%

90%

95%

100%

Optimized CImplementation

Mixed C/AssemblyImplementation

Full AssemblyImplementation

Rel

ativ

e M

Hz

Page 34: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

34

Toolchain / BSP Considerations:Peripheral Drivers

• Peripheral drivers (Ethernet, Serial, USB, etc) may have a hard real-time impact on Voice software:o Peripheral ISR’s can hold off tasks past deadlines.

• To avoid this, peripheral drivers may have to be modified to:o Separate the time critical portions of the driver

from portions that can be run at lower priority.o Minimize the task latency imposed on real-time

VoIP processes due to ISR’s.

Page 35: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

35

Software Design Considerations

• VoIP Endpoint Device Software Overviewo VoIP Endpoint Examples, Functionality, Software Blockso Traditional Software Architecture (RISC + DSP)o New Software Architecture – VoIP on RISC

• Real-time requirements in VoIPo Hard real-time, soft real-time, best effort

• RISC SoC Design Considerations• Toolchain/BSP Considerations Software Design Considerations• Conclusion

Page 36: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

36

Software Design Considerations

• VoIP Software Partitioningo VoIP software should be partitioned into

different tasks based on priority, not function.

o This minimizes the MHz consumed in hard real-time tasks

• This decreases negative effects due to the latency it imposes on other tasks.

Page 37: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

37

Software Design Considerations, continued

• Task Priority Organizationo Care has to be taken to make the

optimal priority assignments for each task.• Sub-optimal assignment of task priorities can

easily result in 40% higher MHz load due to the creation of unnecessary task switching.

Page 38: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

38

Conclusion

• Single-core RISC SoC’s are the new approach for low-cost VoIP endpoints.

• Combining Voice, Data, and Application Software has challenges.

• A strong systems-level approach is required to conquer the challenges.

Page 39: Getting Real-time Performance and Voice Quality on Single Core RISC Devices

39

Questions…Thank You.