Linux Audio for Smartphones
System integration basics
1
© 2011 Wolfson Microelectronics plc
April 2011
www.wolfsonmicro.com
Overview
• Android audio stack overview
• Modern smartphone audio subsystems
• Traditional solutions
• ASoC – the Linux solution
• Design overview
• Brief introduction to chip drivers
• Walk through of system audio driver construction
• Debugging tips
• Future directions
2 © 2011 Wolfson Microelectronics plc
April 2011
www.wolfsonmicro.com
Android audio stack
Applications
MediaPlayer
MediaRecorder
AudioFlinger
libaudio
3 © 2011 Wolfson Microelectronics plc
April 2011
www.wolfsonmicro.com
Modern smartphone audio subsystems
HDMI
Mixing
CPU
DSP
Earpiece
Speaker
Headset
Dock
Cellular
modem
Bluetooth
4
© 2011 Wolfson Microelectronics plc
April 2011
www.wolfsonmicro.com
Flexibility and complexity
5 © 2011 Wolfson Microelectronics plc
April 2011
www.wolfsonmicro.com
Traditional driver model
Memory
Processing
Analogue
6 © 2011 Wolfson Microelectronics plc
April 2011
www.wolfsonmicro.com
Traditional driver model
• Monolithic driver for each card
• No structure for managing off-CPU hardware
• Very little reuse
• Tight coupling between application and kernel code
• Per-use case register settings
• Detailed register level knowledge of components
• Time consuming
7 © 2011 Wolfson Microelectronics plc
April 2011
www.wolfsonmicro.com
The Linux solution
• ASoC embedded audio framework
• Merged since 2.6.21, April 2007
• Provides standard ALSA interface to applications
• Reusable drivers for each chip
• Minimal per-system drivers
• Use case configuration done by userspace
• Automatic and transparent power management
• More reuse, less coupling
8 © 2011 Wolfson Microelectronics plc
April 2011
www.wolfsonmicro.com