Digital audio decoding in portable consumer devices made easy - Embedded.com

Digital audio decoding in portable consumer devices made easy

This “Product How-To” article focuses how to use a certain product in an embedded system and is written by a company representative.

With the market for digital audio exploding in recent years, a wide number of chips or chipsets have been introduced to meet the demands of ever better players. But there are many pitfalls for those entering into the digital audio market. And it's often a question of selecting the proper processing hardware.

The standalone audio and multimedia player has dominated the digital audio market in recent years, and millions of consumers are trying to figure out how to best connect their portable player to their home and car stereos. This has prompted home and car audio vendors to prepare their Hi-Fi systems for the digital age.

Computer parts don't work
Some vendors have tried to adopt computer components and apply them into audio or multimedia players. But while excelling at their intended task of handling vast amounts of data in a multi-tasking computer, these components present some big challenges to the audio engineer because of their relatively slow and unpredictable task switching and poor real-time performance.

Such systems suffer from high power consumption and demand significant overhead in CPU speed before uninterrupted playback can be guaranteed.

They also suffer from their poor level of integration; most systems still require three or four chips including the MPU, SDRAM, NAND flash and audio codec, and further reduction is not yet possible because modern wafer processing technology doesn't allow these technologies to be mixed on the same die.

Other vendors have adopted single-chip ASICs. Because the traditional MCUs offered only a fraction of the processing power required to decode the digital audio content, a custom MP3 or similar decoder was added to existing MCUs.

This solution has long been viewed as preferable by portable audio player manufacturers because the single IC meant a smaller board could be designed. Another advantage of this solution was the reduced power consumption, which allowed much smaller batteries to be used.

The low power consumption is in part made possible because the DSPs required a lower system clock speed, and also because the external memory buses were eliminated.

But while preferred for size and power consumption, this approach has proven to be a very risky bet because the appearance of new standards and rapid shifts in consumer expectations meant that a new product could be outdated even before the first product was ready to ship to stores.

The ideal solution would be an off-the-shelf MCU with a CPU powerful enough to decode the audio content without a custom-built audio decoder. This would offer all the advantages of the single-chip ASIC, but the lack of hardware that could get outdated would also guarantee the platform would be flexible enough to accommodate the unpredictable shifts in customer demand.

Figure 1. The brains of the AVR32 MCUs lie in the AVR32 CPU core that offers a wide range of DSP instructions.

MCU audio decoder
Atmel's AT32UC3A3 32bit MCU (Figure 1 above) offers the required DSP performance and features direct memory access solutions. This translates into a predictable audio decoder capable of achieving high levels of audio quality.

Atmel has also seen the business opportunity in the digital audio sector, and has designed a complete reference design which requires minimal modifications before it can be turned into a production item.

The kit will be covered in more detail towards the end of this article, after a look at what the device itself has to offer. The brains of the AVR 32 MCUs lie in the AVR32 CPU core that offers a wide range of DSP instructions usually only found in high-end CPUs and DSPs.

With its performance, it eliminates the need for custom audio decoder hardware, and it is capable of decoding a stereo MP3 stream while strolling along just above 20MHz. With a maximum speed of up to 72MHz, this means there is plenty of CPU performance left to handle “heavier” audio formats such as AAC and AAC+. There will still be plenty of performance left to run an OS, and the necessary file storage and communication.

To accommodate playback of encrypted audio formats, Atmel offers a variant of its AT32UC3A3 series that has a built-in 256bit Advanced Encryption Standard (AES) crypto unit. This will significantly speed up decryption of encrypted digital audio. But because products containing this AES crypto unit will be subject to strict US export restrictions, it is not intended for traditional consumer audio devices.

High fidelity playback
When the digital audio has been decompressed, it must be converted to analog audio before it can be played back through a set of speakers. For stereo ouput, the AVR32 MCU offers a Hi-Fi stereo 16bit bitstream DAC.

This requires only a small external power amplifier to generate the output voltages required for line, headphones or external speakers. Playback in four channel audio or full surround sound requires an external audio codec, which must be connected to the MCU's I2S interface.

While the AVR32 MCU has enough flash and SRAM to store the firmware, decode the audio and buffer the communication, there is not enough on-chip memory to buffer more than a couple of seconds worth of audio content.

But the AVR32 offers a wide selection of memory storage options, the three most popular being SD/MMC cards, USB mass storage and NAND flash. A device can use any combination of these to store the audio content.

The SD card interface supports up to two high-speed high-capacity SD cards. The USB host interface can interface a regular USB memory stick, but it can also be used to dock a media player, camera or cellphone with a USB plug.

The NAND flash interface supports up to two chips, and has hardware support for both single- and multiple- level cell error correction and control (ECC). For pure streaming applications where only a couple of seconds of audio buffer is required, the on-chip SRAM is sufficiently large, and no external storage is required.

Another important feature for digital audio devices is the speed at which music and other digital content can be transferred in and out of the system. Streaming a single digital audio track may require a bandwidth of just 200Kbit/s or less.

But for applications with mass storage of an audio library, the consumer demands much faster communication for fast synchronization of a large music library. For this purpose, the AVR32 AT32UC3A3 device has a Hi-Speed USB interface and an MMC/SD port which supports WLAN over secure digital I/O.

Other family members such as the AT32UC3A0 and AT32UC3A1 devices also offer full speed USB and a 100Mbit/s Ethernet port. The AVR32 devices are designed with more than just the mainstream consumer device in mind as it offers a wide selection of traditional USART, SPI and I2C interfaces, plenty of timers capable of running DC and stepper motors.

Dual-port SRAM
The many high-speed communication interfaces offered by the AVR32 MCUs means a single SRAM would quickly become the bottleneck of the system. Predicting this, Atmel has added four SRAMs to the AT32UC3A3. Two of these offer dual port access to further speed up communication and avoid collisions.

This ensures that the SRAM bandwidth is never limiting transfer speeds throughout the system. And it guarantees that audio playback quality is never compromised even when highspeed communication is running in the background.

The backbone of the AVR32 MCUs is the multilayer highspeed bus. This allows the CPU and peripherals to share much more data every cycle by allowing simultaneous access between multiple masters and slaves.

Exploiting the possibilities that lie in this multilayer bus, Atmel's engineers have split the main 128Kbyte SRAM of the AT32UC3A3 into three blocks, and each block has been given its own separate memory interface to the bus.

This allows up to three high-speed communication interfaces to access the SRAM simultaneously without waiting for data. Half of the SRAM, is high-speed SRAM embedded into the CPU itself, giving it dual port access performance.

The other half is low-power SRAM for which the CPU and peripherals share the available bandwidth. To complete the design, the Hi-Speed USB interface has its own 1.5Kbyte dual port SRAM to guarantee a full package can be transferred without any risk of data being upset by the main system.

The power consumption of the AVR32 MCU is less than 2mW/MHz, and this allows the delivery of more than 150hrs of audio playback from two AA batteries. In standby mode with only real time clock running, a device can stay in the drawer for more than nine years.

Figure 2. The EVK1104 reference design demonstrates playback from USB mass storage device, SD card or NAND flash.

Reference design with software
To demonstrate the digital audio capabilities of the AVR32 MCUs and reduce time to market for customers, Atmel has designed two reference designs, the EVK1104 (Figure 2 above) and EVK1105.

The kits demonstrate playback from USB mass storage device, SD card or NAND flash, and also show how music can be downloaded or streamed from a PC through the USB interface. An upgrade kit is already planned which will add WLAN, Bluetooth, and Zigbee RF connectivity to the kits. The reference designs also demonstrate Atmel's capacitive touch solutions.

More than 100 million iPod and iPhone devices have been sold in the market, and consumer and automotive audio equipment manufacturers alike have been scrambling to add iPod docking to their existing products.

Because Apple uses a proprietary protocol for interfacing to docking stations, only licensees of Apple technology are able to do this. To registered licensees, Atmel will provide an iPod docking extension kit to the EVK1104 and EVK1105. The kit also contains the firmware and source code required to access and control the iPod and iPhone via the USB port.

Haakon Skar is director of AVR32AP product marketing at Atmel Corp.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.