SlideShare a Scribd company logo
1 of 24
Download to read offline
Public
Android Audio HAL
Audio overview
Senior Software Engineer Piotr Krawczyk
© Tieto Corporation
Public
About
Me:
• Senior Software Engineer in Tieto;
• 7 years of experience with Android platform;
• 3 years of experience with Android Automotive;
2
© Tieto Corporation
Public
Building the Connected world
Cloud Born
Hybrid & Multi
vendor, NFVi,
Cloud Native
Ever reaching
5G NR, HetNet,
NB-IoT, Cloud RAN
Dynamic
Software defined
Infrastructure,
Zero Touch
Autonomous
Orchestration,
Automation, Slicing,
Open source
Enabling Tomorrow’s Mobility Innovating for Smart Living
Connected
Telematics, V2X,
Connected car
Safe
ADAS,
ISO 26262
Aware
HERE technologies,
Location based
services
As a service
Fleet management,
Mobility Services,
Use based insurance
Mobile
Platforms, Apps,
AI, Multimedia
Fun
Multimedia,
Multiroom Audio,
Smart TV apps
Cozy
Smart Home,
Homekit, Alexa,
Google Home
Healthy
Wearable, DevOPS,
Automated
Tieto Product Development Services
© Tieto Corporation
Public
Agenda
• Audio in Android – overview;
• Integration challenges;
• Possible improvements;
• Impact of Android 10;
4
Public
Audio overview
© Tieto Corporation
Public
Typical Android flow
6
Application
HAL
Framework Service
HW
3rd party developers
Google
Vendors
Silicon vendors
API
HIDL
Driver/Linux subsystem
© Tieto Corporation
Public
Audio in Android
7
© Tieto Corporation
Public
Audio HAL interfaces
8
© Tieto Corporation
Public
Audio HIDL
• IDevice – represents Audio HW module (e.g. primary, USB, A2DP);
• IDevicesFactory – connect to one of the Audio HW modules;
• IPrimaryDevice – interface for primary Audio HW module, extends
IDevice;
• IStream – controls audio streams;
• IStreamIn – specialization for input streams;
• IStreamOut – specialization for output streams;
• IAudioControl - interacts with the car's audio subsystem to manage
audio sources and volumes.
9
© Tieto Corporation
Public
Audio Effects
Control effect lifecycle:
• IEffectsFactory
Generic effect interface:
• IEffect
Effect specializations (defined by Google):
• IAcousticEchoCancelerEffect
• IAutomaticGainControlEffect
• IBassBoostEffect
• IDownmixEffect
• IEffectBufferProviderCallback
• IEnvironmentalReverbEffect
• IEqualizerEffect
• ILoudnessEnhancerEffect
• INoiseSuppressionEffect
• IPresetReverbEffect
• IVirtualizerEffect
• IVisualizerEffect
10
Public
Integration
© Tieto Corporation
Public
Configuration challenge
Configurable:
• attached audio output/input devices,
• audio effects,
• audio codecs configuration,
• audio hardware paths,
• audio features (CDD),
• default sounds.
Methods:
• global settings (for all processes),
• user / profile settings,
• car variant specific,
• static vs dynamic.
Related files:
• audio_policy_configuration.xml (bus address definition),
• AudioControl.cpp (sContextToBusMap),
• car_volume_groups.xml (mapping of buses to volume
groups),
• config.xml (audioUseDynamicRouting),
• audio_effects.[xml|conf],
• media_profiles_*.xml,
• media_codecs_*.xml,
• other.
12
© Tieto Corporation
Public
What if framework needs to be
changed?
• Overlays
• Resource overlay – configuration changes;
• Fork application – LOCAL_OVERRIDES_PACKAGES
(Android.mk);
• Manual changes in framework
• Keep Treble compliance – keep API, keep HIDL;
• Adding new interfaces is allowed, keep ABI compliance.
13
Public
Places for improvements
© Tieto Corporation
Public
Common solution
Challenge: Audio HALs are provided by silicon vendors or 3rd party
suppliers.
Improvement: create common Audio HAL that will work on different
platforms.
Why:
• common usage of TinyALSA as audio subsystem, ALSA and OSS is
rarely used;
• HIDL interfaces guaranteed by VTS.
Limitations:
• HW dependency for audio effects,
15
© Tieto Corporation
Public
Common solution benefits
• Add new features to Audio HAL – shared between platforms, e.g.
• Global effect handling;
• Speed dependent volume control;
• Audio HW module direct communication;
• End user tool portability between platforms, e.g.
• Audio calibration tool;
• Configuration helpers;
• Faster integration – short time to market;
• Less dependency to external deliveries.
16
© Tieto Corporation
Public
Common HAL idea
17
© Tieto Corporation
Public
Configuration helper
Challenge: Configuration is scattered, poorly documented, difficult to
maintain.
Improvement: create set of configuration helpers tool.
Why:
• common usage of TinyALSA as audio subsystem, ALSA and OSS is
rarely used,
• verification checks can assure dependency between configuration
modules.
Limitations:
• Track changes between Android updates.
18
© Tieto Corporation
Public
Configuration helper benefits
• Automatic dependency check between configuration
modules;
• Faster bring-up by inheriting configuration from other
platforms;
• Easier comparison of products;
• Easier control of features;
• Better visibility on product configuration.
19
© Tieto Corporation
Public
Configuration helper idea
20
Public
Android 10
New features, possible impact
© Tieto Corporation
Public
New in Android 10
• Multi-Zone
22
Media playback
Navigation
Media playback
Notification
Primary zone
Secondary zone
Media playback
Nav playback
Media playback
Notify playback
• Application can be played in zone
• Zone audio contains devices
• Zones have separate volume
• Zone can be requested by app
• In future zone could be binded
with display
© Tieto Corporation
Public
New in Android 10
CarAudioFocus
interaction matrix
• Row selected by playing sound
(labels along the right)
• Column selected by incoming
request (labels along the top)
23
Music Nav Voice Ring Call Alarm Notifica
tion
System
Music E C E E E E C E
Nav C C E C E C C C
Voice C R C E E R R R
Ring R C C C C R R C
Context R C R C C C C R
Alarm C C E E E C C C
Notificati
on
C C E E E C C C
System C C E E E C C C
R – reject
E – exclusive
C – concurrent
Public

More Related Content

Similar to Android-Audio-HAL-Overview-Flow-WithHIDL-

Optimizing your Android App for Mass Market Devices
Optimizing your Android App for Mass Market DevicesOptimizing your Android App for Mass Market Devices
Optimizing your Android App for Mass Market Devices
Motorola Mobility - MOTODEV
 

Similar to Android-Audio-HAL-Overview-Flow-WithHIDL- (20)

Taking android beyond smartphones
Taking android beyond smartphonesTaking android beyond smartphones
Taking android beyond smartphones
 
Current trends in open source and automotive
Current trends in open source and automotiveCurrent trends in open source and automotive
Current trends in open source and automotive
 
Optimizing your Android App for Mass Market Devices
Optimizing your Android App for Mass Market DevicesOptimizing your Android App for Mass Market Devices
Optimizing your Android App for Mass Market Devices
 
Android OS 2019
Android OS 2019Android OS 2019
Android OS 2019
 
VOS_Cloud-Native_Software_Customer Presentation_Short - Nov. 2020.pptx
VOS_Cloud-Native_Software_Customer Presentation_Short - Nov. 2020.pptxVOS_Cloud-Native_Software_Customer Presentation_Short - Nov. 2020.pptx
VOS_Cloud-Native_Software_Customer Presentation_Short - Nov. 2020.pptx
 
InTouch Machine Edition Advantages and Features
InTouch Machine Edition Advantages and FeaturesInTouch Machine Edition Advantages and Features
InTouch Machine Edition Advantages and Features
 
ANDROID.SREE
ANDROID.SREEANDROID.SREE
ANDROID.SREE
 
[Webinar] Automotive Media Management in Future IVI Systems
[Webinar] Automotive Media Management in Future IVI Systems[Webinar] Automotive Media Management in Future IVI Systems
[Webinar] Automotive Media Management in Future IVI Systems
 
Window IoT Mod 1.pdf
Window IoT Mod 1.pdfWindow IoT Mod 1.pdf
Window IoT Mod 1.pdf
 
Managed Services for the New Millennium - J Barr
Managed Services for the New Millennium - J BarrManaged Services for the New Millennium - J Barr
Managed Services for the New Millennium - J Barr
 
Android
AndroidAndroid
Android
 
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_osEnhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
 
160811_오토테크컨퍼런스_vault micro
160811_오토테크컨퍼런스_vault micro160811_오토테크컨퍼런스_vault micro
160811_오토테크컨퍼런스_vault micro
 
2022 Portfolio English
2022 Portfolio English2022 Portfolio English
2022 Portfolio English
 
Open Source on Wheels - Tech Day by Init 2017
Open Source on Wheels - Tech Day by Init 2017Open Source on Wheels - Tech Day by Init 2017
Open Source on Wheels - Tech Day by Init 2017
 
LCA13: George Grey Keynote
LCA13: George Grey KeynoteLCA13: George Grey Keynote
LCA13: George Grey Keynote
 
Hip case study tcs iitb
Hip case study tcs iitbHip case study tcs iitb
Hip case study tcs iitb
 
Teksun Corporate Overview 2014
Teksun Corporate Overview 2014Teksun Corporate Overview 2014
Teksun Corporate Overview 2014
 
RDE12_John_Ousby
RDE12_John_OusbyRDE12_John_Ousby
RDE12_John_Ousby
 
Basics of embedded systems
Basics of embedded systemsBasics of embedded systems
Basics of embedded systems
 

Recently uploaded

electrical installation and maintenance.
electrical installation and maintenance.electrical installation and maintenance.
electrical installation and maintenance.
benjamincojr
 
Seizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networksSeizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networks
IJECEIAES
 
21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx
rahulmanepalli02
 

Recently uploaded (20)

handbook on reinforce concrete and detailing
handbook on reinforce concrete and detailinghandbook on reinforce concrete and detailing
handbook on reinforce concrete and detailing
 
electrical installation and maintenance.
electrical installation and maintenance.electrical installation and maintenance.
electrical installation and maintenance.
 
5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...
 
analog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptxanalog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptx
 
21scheme vtu syllabus of visveraya technological university
21scheme vtu syllabus of visveraya technological university21scheme vtu syllabus of visveraya technological university
21scheme vtu syllabus of visveraya technological university
 
Piping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdfPiping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdf
 
Linux Systems Programming: Semaphores, Shared Memory, and Message Queues
Linux Systems Programming: Semaphores, Shared Memory, and Message QueuesLinux Systems Programming: Semaphores, Shared Memory, and Message Queues
Linux Systems Programming: Semaphores, Shared Memory, and Message Queues
 
Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...
 
Seizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networksSeizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networks
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
 
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
 
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
 
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdfInvolute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1
 
Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2
 
21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx
 
Software Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfSoftware Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdf
 
Low Altitude Air Defense (LAAD) Gunner’s Handbook
Low Altitude Air Defense (LAAD) Gunner’s HandbookLow Altitude Air Defense (LAAD) Gunner’s Handbook
Low Altitude Air Defense (LAAD) Gunner’s Handbook
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
What is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, FunctionsWhat is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, Functions
 

Android-Audio-HAL-Overview-Flow-WithHIDL-

  • 1. Public Android Audio HAL Audio overview Senior Software Engineer Piotr Krawczyk
  • 2. © Tieto Corporation Public About Me: • Senior Software Engineer in Tieto; • 7 years of experience with Android platform; • 3 years of experience with Android Automotive; 2
  • 3. © Tieto Corporation Public Building the Connected world Cloud Born Hybrid & Multi vendor, NFVi, Cloud Native Ever reaching 5G NR, HetNet, NB-IoT, Cloud RAN Dynamic Software defined Infrastructure, Zero Touch Autonomous Orchestration, Automation, Slicing, Open source Enabling Tomorrow’s Mobility Innovating for Smart Living Connected Telematics, V2X, Connected car Safe ADAS, ISO 26262 Aware HERE technologies, Location based services As a service Fleet management, Mobility Services, Use based insurance Mobile Platforms, Apps, AI, Multimedia Fun Multimedia, Multiroom Audio, Smart TV apps Cozy Smart Home, Homekit, Alexa, Google Home Healthy Wearable, DevOPS, Automated Tieto Product Development Services
  • 4. © Tieto Corporation Public Agenda • Audio in Android – overview; • Integration challenges; • Possible improvements; • Impact of Android 10; 4
  • 6. © Tieto Corporation Public Typical Android flow 6 Application HAL Framework Service HW 3rd party developers Google Vendors Silicon vendors API HIDL Driver/Linux subsystem
  • 9. © Tieto Corporation Public Audio HIDL • IDevice – represents Audio HW module (e.g. primary, USB, A2DP); • IDevicesFactory – connect to one of the Audio HW modules; • IPrimaryDevice – interface for primary Audio HW module, extends IDevice; • IStream – controls audio streams; • IStreamIn – specialization for input streams; • IStreamOut – specialization for output streams; • IAudioControl - interacts with the car's audio subsystem to manage audio sources and volumes. 9
  • 10. © Tieto Corporation Public Audio Effects Control effect lifecycle: • IEffectsFactory Generic effect interface: • IEffect Effect specializations (defined by Google): • IAcousticEchoCancelerEffect • IAutomaticGainControlEffect • IBassBoostEffect • IDownmixEffect • IEffectBufferProviderCallback • IEnvironmentalReverbEffect • IEqualizerEffect • ILoudnessEnhancerEffect • INoiseSuppressionEffect • IPresetReverbEffect • IVirtualizerEffect • IVisualizerEffect 10
  • 12. © Tieto Corporation Public Configuration challenge Configurable: • attached audio output/input devices, • audio effects, • audio codecs configuration, • audio hardware paths, • audio features (CDD), • default sounds. Methods: • global settings (for all processes), • user / profile settings, • car variant specific, • static vs dynamic. Related files: • audio_policy_configuration.xml (bus address definition), • AudioControl.cpp (sContextToBusMap), • car_volume_groups.xml (mapping of buses to volume groups), • config.xml (audioUseDynamicRouting), • audio_effects.[xml|conf], • media_profiles_*.xml, • media_codecs_*.xml, • other. 12
  • 13. © Tieto Corporation Public What if framework needs to be changed? • Overlays • Resource overlay – configuration changes; • Fork application – LOCAL_OVERRIDES_PACKAGES (Android.mk); • Manual changes in framework • Keep Treble compliance – keep API, keep HIDL; • Adding new interfaces is allowed, keep ABI compliance. 13
  • 15. © Tieto Corporation Public Common solution Challenge: Audio HALs are provided by silicon vendors or 3rd party suppliers. Improvement: create common Audio HAL that will work on different platforms. Why: • common usage of TinyALSA as audio subsystem, ALSA and OSS is rarely used; • HIDL interfaces guaranteed by VTS. Limitations: • HW dependency for audio effects, 15
  • 16. © Tieto Corporation Public Common solution benefits • Add new features to Audio HAL – shared between platforms, e.g. • Global effect handling; • Speed dependent volume control; • Audio HW module direct communication; • End user tool portability between platforms, e.g. • Audio calibration tool; • Configuration helpers; • Faster integration – short time to market; • Less dependency to external deliveries. 16
  • 18. © Tieto Corporation Public Configuration helper Challenge: Configuration is scattered, poorly documented, difficult to maintain. Improvement: create set of configuration helpers tool. Why: • common usage of TinyALSA as audio subsystem, ALSA and OSS is rarely used, • verification checks can assure dependency between configuration modules. Limitations: • Track changes between Android updates. 18
  • 19. © Tieto Corporation Public Configuration helper benefits • Automatic dependency check between configuration modules; • Faster bring-up by inheriting configuration from other platforms; • Easier comparison of products; • Easier control of features; • Better visibility on product configuration. 19
  • 22. © Tieto Corporation Public New in Android 10 • Multi-Zone 22 Media playback Navigation Media playback Notification Primary zone Secondary zone Media playback Nav playback Media playback Notify playback • Application can be played in zone • Zone audio contains devices • Zones have separate volume • Zone can be requested by app • In future zone could be binded with display
  • 23. © Tieto Corporation Public New in Android 10 CarAudioFocus interaction matrix • Row selected by playing sound (labels along the right) • Column selected by incoming request (labels along the top) 23 Music Nav Voice Ring Call Alarm Notifica tion System Music E C E E E E C E Nav C C E C E C C C Voice C R C E E R R R Ring R C C C C R R C Context R C R C C C C R Alarm C C E E E C C C Notificati on C C E E E C C C System C C E E E C C C R – reject E – exclusive C – concurrent