SlideShare a Scribd company logo
11
Most read
13
Most read
16
Most read
Android Audio System
Introduction
Outline
•
•
•
•

Background
Android Audio System
Audio Framework
Audio HAL

2
Background
3
Background
• Information about this slide
• Software
• Android 4.0/4.2

4
Android Audio System
5
Architecture Audio System
• The complexity of android audio system
• Soft real-time requirement
• Large number of usage scenarios
• Software
• phone/media player/…
• different volume setting/…

• Hardware
• earpiece/speaker/hdmi/…
• mic/bluetooth/…

• Flexibility design
• good design pattern
• performance (Java/JNI/binder/…)
6
Architecture Audio System
Java App

Android Framework

Audio HAL

Linux Driver
7
Android Audio System
pcm data
app
data flow
control flow
AudioTrack/AudioRecord/…
(AudioPolicy/AudioFlinger/…)

Audio
Policy

Audio
Flinger

Audio HAL
(open/read/write/…)

Audio Driver
8
Audio Framework
9
Audio Framework
Network Packet Routing

sender 1

router

receiver 1

sender 2
Routing path

receiver 2

sender 3
receiver 3
sender 4

10
Audio Framework
Audio Routing (play audio)

AudioTrack 1

Audio
Policy

Hardware 1

AudioTrack 2
Audio Flinger

Hardware 2

AudioTrack 3
Hardware 3

AudioTrack 4

Java App

11

Audio Framework
Audio HAL
Audio Policy
• Decide which thread in AudioFlinger should sound be
attached.
• stream  strategy  output
• stream : VOICE_CALL, TTS, MUSIC, …
• strategy : PHONE, MUSIC, …
• output : a thread in AudioFlinger

• strategy : bridge between software data stream and hardware

12
Audio Policy

13
Audio Policy
• IOProfile (audio_policy.conf)
• Content
• Define all the possible I/O devices
• Define default I/O device

• Hierarchical structure
• hardware module
• profile
• sampling_rates/channels/formats/devices/flags

• With IOProfile, audio policy gets better OO structure.

14
Audio Policy

15
Audio Flinger
• Several thread to read/write data
• Create thread by AudioPolicy
• mixer thread
• duplicating thread
• direct output thread

• Resampler
• Non-blocking audio I/O
• AudioWatchdog

16
Audio HAL
17
Audio HAL
app

AudioTrack/AudioRecord/…
(AudioPolicy/AudioFlinger/…)

Audio HAL
(open/read/write/…)

Audio Driver
18
Audio HAL
• ALSA (Advanced Linux Sound Architecture)
• unified interface/SMP/thread-safe/…
• usespace library
• alsa-lib
• tinyalsa

• tinyplay/tinycap/ tinymix

• Audio HAL interface
• volume setting
• I/O function
• …
19

More Related Content

PDF
Embedded Android : System Development - Part III (Audio / Video HAL)
PDF
Android Multimedia Framework
PPT
Linux Audio Drivers. ALSA
PDF
Android's Multimedia Framework
PDF
Embedded Android : System Development - Part IV
PDF
Linux systems - Getting started with setting up and embedded platform
PDF
Android's HIDL: Treble in the HAL
PDF
Kalman filter for Beginners
Embedded Android : System Development - Part III (Audio / Video HAL)
Android Multimedia Framework
Linux Audio Drivers. ALSA
Android's Multimedia Framework
Embedded Android : System Development - Part IV
Linux systems - Getting started with setting up and embedded platform
Android's HIDL: Treble in the HAL
Kalman filter for Beginners

What's hot (20)

PPTX
Android audio system(audioflinger)
ODP
Embedded Android : System Development - Part III
PDF
Embedded Android : System Development - Part I
PDF
Android media framework overview
PDF
Embedded Android : System Development - Part II (HAL)
PDF
Android Things : Building Embedded Devices
PPTX
Android audio system(audio_hardwareinterace)
PDF
PPTX
Android audio system(오디오 출력-트랙생성)
PPTX
Android Booting Sequence
PDF
Understanding the Android System Server
PDF
Android Boot Time Optimization
PDF
Android IPC Mechanism
PDF
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
PPTX
Android audio system(audioplicy_service)
PDF
Android presentation
PDF
Embedded Android : System Development - Part II (Linux device drivers)
PPT
Learning AOSP - Android Booting Process
PDF
Embedded Android Workshop with Pie
PDF
Android Binder IPC for Linux
Android audio system(audioflinger)
Embedded Android : System Development - Part III
Embedded Android : System Development - Part I
Android media framework overview
Embedded Android : System Development - Part II (HAL)
Android Things : Building Embedded Devices
Android audio system(audio_hardwareinterace)
Android audio system(오디오 출력-트랙생성)
Android Booting Sequence
Understanding the Android System Server
Android Boot Time Optimization
Android IPC Mechanism
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Android audio system(audioplicy_service)
Android presentation
Embedded Android : System Development - Part II (Linux device drivers)
Learning AOSP - Android Booting Process
Embedded Android Workshop with Pie
Android Binder IPC for Linux
Ad

Similar to Android Audio System (20)

PDF
Deep dive into Android’s audio latency problem
PPTX
Android Multimedia Player Project Presentation
PPT
Podcasting sfrome2011 by Maria Grazia Bovo (FAO)
PPTX
Eugen Constantinescu - Genivi - Codecamp 10 may 2014
DOCX
Sound recording glossary by Liam Oven for Unit 73
PPTX
2012 djb software_features & topology
PPT
JAVA Media Player
DOCX
Ig2 task 1 work sheet - JS
PPTX
WebRTC Browsers n Stacks Implementation differences
PDF
Multimedia on android
PPT
Portinig Application, Drivers And Os
PDF
Flexible and Transparent Multimedia Routing on OSGi Environments - Dr. Nativi...
DOCX
Jordan smith ig2 task 1 revisited
PDF
Personnalisation d'Android par Archos 26-10-2011 au PAUG
PPS
Multimedia in Higher Education
PDF
FxOS Audio Playback 101
DOCX
Shaun Warburton IG2 task 1
PPT
Developing Applications Using Host Processing Instead of DSPs
ODP
Introducing Android Media Player
PPTX
Video Streaming: Broadcast quality on a shoe string budget.
Deep dive into Android’s audio latency problem
Android Multimedia Player Project Presentation
Podcasting sfrome2011 by Maria Grazia Bovo (FAO)
Eugen Constantinescu - Genivi - Codecamp 10 may 2014
Sound recording glossary by Liam Oven for Unit 73
2012 djb software_features & topology
JAVA Media Player
Ig2 task 1 work sheet - JS
WebRTC Browsers n Stacks Implementation differences
Multimedia on android
Portinig Application, Drivers And Os
Flexible and Transparent Multimedia Routing on OSGi Environments - Dr. Nativi...
Jordan smith ig2 task 1 revisited
Personnalisation d'Android par Archos 26-10-2011 au PAUG
Multimedia in Higher Education
FxOS Audio Playback 101
Shaun Warburton IG2 task 1
Developing Applications Using Host Processing Instead of DSPs
Introducing Android Media Player
Video Streaming: Broadcast quality on a shoe string budget.
Ad

Recently uploaded (20)

PDF
Modernizing your data center with Dell and AMD
PDF
cuic standard and advanced reporting.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPT
Teaching material agriculture food technology
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Cloud computing and distributed systems.
PDF
Encapsulation theory and applications.pdf
Modernizing your data center with Dell and AMD
cuic standard and advanced reporting.pdf
Electronic commerce courselecture one. Pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
NewMind AI Weekly Chronicles - August'25 Week I
Unlocking AI with Model Context Protocol (MCP)
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Advanced methodologies resolving dimensionality complications for autism neur...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Teaching material agriculture food technology
Understanding_Digital_Forensics_Presentation.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Spectral efficient network and resource selection model in 5G networks
Empathic Computing: Creating Shared Understanding
Digital-Transformation-Roadmap-for-Companies.pptx
Cloud computing and distributed systems.
Encapsulation theory and applications.pdf

Android Audio System

Editor's Notes

  • #5: 以前 Mint 有報告過 只講有改到的地方 不講 code,只分享概念
  • #7: 有些能關有些不能關 有新裝置時聲音要轉移 同一個東西在不同地方有不同名稱 裝置有 FM 7.1 聲道
  • #12: 只講 play 部份,record 反之亦然 有其他諸如 Audio System 之類的裝置管理沒講
  • #17: 4.0 -> 4.2 自 7xxx ~ 9xxx (Leo 3926) 相關的自 14xxx ~ 20xxx TODO : 5 ~ 9 FIXME : 4 ~ 28
  • #19: 1. The original version is provided from SoC vendor. 2. Dynamic library linked by AudioFlinger.
  • #20: Why use Tinyalsa We can use ALSA-lib substitute for Tinyalsacompletely, but we can’t use Tinyalsa substitute for ALSA-lib completely. But,in some times, Tinyalsa can substitute for ALSA-lib to work for some basicfunction. The only reason is that it is smaller and simpler than ALSA-lib. Google Android supplies the Tinyalsa. Audio HAL interface forms changed in Android 4.0.