Transcript
Hard.qxp:Tech Temp
5/11/07
15:31
Page 39
COMMUNICATIONS HARDWARE
INTER DESIGN
Loud and clear Integrating the Advanced Audio Distribution profile into Bluetooth enabled devices. By Almansor Kerroum.
B
luetooth uses profiles to define various classes of functionality. In the audio domain, earlier versions of Bluetooth provided only telephony services – the so called Headset Profile, which offered only speech quality audio. This profile was unable to satisfy the consumer craving for hifi stereo headsets, so the Advanced Audio Distribution Profile (A2DP) was introduced Using A2DP (also called Bluetooth stereo), consumers can now stream high quality audio from portable devices – like media players, mobile phones and PDAs – to a Bluetooth stereo headset.
Hardware and software
processor also runs the application, which interfaces to the user and to the Upper Protocol Stack APIs.
CSR’s BlueCore3-Multimedia silicon provides the Bluetooth connectivity for Motorola’s HT820 Bluetooth stereo headphones, allowing the user to listen
SCO and eSCO
to stereo audio streamed wirelessly from a range of
The Headset Profile uses a synchronous connection oriented (SCO) link, but due to latency requirements, this approach does not use cyclic redundancy checking (CRC) or retransmission and is therefore called ‘unreliable’. Speech data is typically not transmitted over the HCI but is instead managed directly by the baseband. Bluetooth Specification 1.2 introduced an extended SCO (eSCO), which provides ‘reliable’ connections by using CRC and retransmissions. It also
different devices, while remaining connected to a
A complete Bluetooth solution consists of multiple components: • The radio transmits and receives Bluetooth signals. It typically consists of analogue (rf ) and digital hardware components (mixed signal technology). • The baseband provides link control and link management functions (link controller/manager), partitioned between digital hardware and software running on a microcontroller. This software, called the Lower Protocol Stack, is actually the device firmware. The Bluetooth specification defines a host control interface (HCI) to access the lower layers. • The upper layer software, which accesses the lower layers through the HCI, is the Upper Protocol Stack. This typically runs on a separate microprocessor and includes the higher level components of the Bluetooth protocol stack. The
New Electronics www.newelectronics.co.uk 13 November 2007
mobile phone for hands free voice calling.
features more bandwidth for speech than the 64kbit/s SCO (wideband speech). Unfortunately, the two devices need to agree on a range of parameters, making a fallback to the old SCO link likely. In addition to this limited interoperability, there is no efficient speech codec standardised for bit rates higher than 64kbit/s, which makes widespread use of eSCO more unlikely.
39
Hard.qxp:Tech Temp
5/11/07
15:31
Page 40
COMMUNICATIONS HARDWARE
Figure 1: Bluetooth protocol stack with A2DP and headset profile buttons/leds
speech
SBC detector HS application A2DP app A2DP HS profile RFCOMM SDP TCS L2CAP DM HCI top
upper protocol stack
lower protocol stack (firmware)
hi-fi stereo
audio codec h/w
HCI bottom link manager link controller baseband radio
new
software
hardware
HiFi stereo quality Since eSCO is not a suitable candidate for high quality audio streaming, system designers need to rely on asynchronous connectionless links (ACL). Packet based transmission with CRC and retransmission guarantees the reliability needed. A2DP defines different codecs to use
“At first sight, implementing A2DP seems straightforward; however, it does pose several problems.” Almansor Kerroum, IPextreme
for efficient transmission of audio data. The SBC codec is mandatory and guarantees interoperability between different Bluetooth devices. Other codecs, like MP3 and AAC, are optional. The source (SRC) or music player (an iPod, for example) connects to one or more sinks (SNKs), which are basically the stereo headsets. After establishing a connection successfully, the SRC starts streaming ACL data containing compressed audio. The SNK decompresses the audio data and outputs it to the speakers. At first sight, implementing A2DP seems straightforward; however, it does pose several problems. The most important change in the
40
architecture compared to the Headset Profile is that a decoder is required for SBC packets. The application running on the SNK has to deal with the decoding directly whereas, in the Headset Profile, this burden is typically delegated to the baseband. This implies that ACL packets containing SBC audio data have to be transmitted over the HCI, which imposes significantly larger bandwidth requirements than before since SBC bit rates may go up to 510kbit/s. Decoding SBC packets requires a dedicated dsp – another microprocessor in the Bluetooth system. In total, you end up with three different microprocessors, all likely to require different toolchains. It is also difficult to ensure proper communication between the components. Managing the data flow through the buffers between the computing components becomes tricky and latency and synchronisation are key issues in this regard. The type of dsp required is dictated by the availability of an SBC decoder software implementation. Special care needs to be taken, since the software has to be ‘qualified’, which means it needs to pass the relevant conformance tests. The implementation also needs to be efficient, otherwise the dsp drains too much power and requires too much memory, which increases total system cost. Finding a suitable dsp is critical, especially when it needs to fit into the overall architecture.
Implementation Several architectures are possible, each with several benefits and drawbacks. • Two microcontrollers plus one dsp. The Upper and Lower Protocol Stacks are housed on separate microcontrollers, with the SBC decoder handled by a dsp. This solution presents clearly defined interfaces, easing integration and test – and thus time
INTER DESIGN
to market. It also has a small memory footprint and low MIPS requirements, leading to low power requirements and low cost. Meanwhile, fewer interrupts per processor allows a lower clock frequency. On the downside, you need to deal with toolchains for three different targets and the tasks of integration and exchanging data between the different processors increase the engineering effort. Using three processors also increases system cost. • One processor plus dsp (hosted). In this approach, the Upper Protocol Stack and SBC decoder are housed on a dsp, with the Lower Protocol Stack handled by a microcontroller. This solution combines the advantages of the different architectures, but avoids their drawbacks. A dedicated processor can be used to run the firmware and HCI can be used to interface the upper components of the stack. The Upper Protocol Stack and the A2DP SNK application both run on one dsp, which also decodes the SBC packets if A2DP is selected. Running the Upper Protocol Stack on a dedicated audio dsp in an efficient manner, can bring significant savings in chip area, resulting in lower power consumption and lower system cost. Also, integration effort is lower, since designers only need to work with two toolchains.
Integration tasks IPextreme has ported Cambridge Consultants’ Bluetooth Protocol Stack to NXP’s CoolFlux dsp platform. It then built an A2DP SNK application that interfaces to the SBC decoder. In addition, drivers were developed to interface the audio codec hardware that connects to the speakers and the UART driver to ensure proper communication over HCI. The prototype was shown to have interoperability with multiple Bluetooth protocol stack providers and has since been demonstrated widely.
Samsung’s YP-T9 music player features
Author profile:
Bluetooth connectivity.
Almansor Kerroum is a senior design engineer with IPextreme.
New Electronics www.newelectronics.co.uk 13 November 2007