Android Automotive Audio
Total Page:16
File Type:pdf, Size:1020Kb
Public Android Automotive Audio Introduction Bartosz Bialek Senior Software Engineer Tieto, PDS BU Automotive & Smart Devices [email protected] Table of contents Public • Android Automotive Architecture • Audio Framework • Android sounds and streams • Multi-Zone Audio • Audio Signal Arbitration • Audio HAL interfaces 2 © Tieto Corporation Public Audio Framework Architecture overview Android Automotive Architecture Public Applications Android Framework API Car API Android System Services Car Services HAL Automotive HAL Linux Kernel 4 © Tieto Corporation Audio Framework Public Application Car Audio Audio Effect Audio Track Audio Manager Manager Car Audio Audio Service Service Audio Track Audio Effect Audio System Audio Policy Effects Factory Audio Flinger Manager Audio Control Audio HAL HAL TinyALSA ASoC / Drivers 5 © Tieto Corporation Android sounds and streams (1/2) Public Music Player Voice Assistant Navigation Calendar Audio sources Audio Flinger Mixer 0 Mixer 1 Mixer 2 Audio contexts Audio devices MUSIC Bus 0 Bus 1 Bus 2 NAVIGATION VOICE_COMMAND Audio HAL CALL_RING Chime Unit CALL External Mixer ALARM Tuner NOTIFICATION Car Amplifier(s) SYSTEM_SOUND 6 © Tieto Corporation Android sounds and streams (2/2) Public Android 10: New player Radio Navigation HwAudioSource Audio Flinger Tuner Mixer 0 Mixer 1 Tuner Bus 0 Bus 1 Audio HAL Tuner External Mixer Car Amplifier(s) 7 © Tieto Corporation Multi-Zone Audio (Android 10) Public Primary zone • Application can be played in zone Media Player Media playback • Zone contains audio devices Nav playback Navigation • Zones have separate volume • Zone can be requested by app • No app auto-assignment to zone Media Player Secondary zone based on display yet Media playback Notification • HW volume keys controls primary Notify playback zone only 8 © Tieto Corporation Audio Signal Arbitration (1/2) Public • Pre-Android 10: AudioFocus • Not enforced • Android 10: CarAudioFocus • Internal interaction matrix (currently fixed) • Supports multi-zone audio (maintains focus per zone) 9 © Tieto Corporation Audio Signal Arbitration (2/2) Public Music Nav Voice Ring Call Alarm Notifica System tion CarAudioFocus Music ECEEEECE interaction matrix Nav CCECECCC • Row selected by playing sound Voice CRCEERRR (labels along the right) • Column selected by incoming request (labels along the top) Ring RCCCCRRC Context RCRCCCCR R – reject Alarm CCEEECCC E – exclusive Notificati CCEEECCC C – concurrent on System CCEEECCC 10 © Tieto Corporation Audio HAL interfaces Public • HAL interface: hardware/libhardware/include/ hardware/audio.h • HIDL interface: hardware/interfaces/audio/ 11 © Tieto Corporation Audio HIDL Public • 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. 12 © Tieto Corporation Audio Effects HIDL Public Control effect lifecycle: Effect specializations (defined by Google): • IAcousticEchoCancelerEffect • IEffectsFactory • IAutomaticGainControlEffect • IBassBoostEffect Generic effect interface: • IDownmixEffect • IEffect • IEffectBufferProviderCallback • IEnvironmentalReverbEffect • IEqualizerEffect • ILoudnessEnhancerEffect • INoiseSuppressionEffect • IPresetReverbEffect • IVirtualizerEffect • IVisualizerEffect 13 © Tieto Corporation Configuration challenge Public Configurable: • attached audio output/input devices, • audio effects, Related files: • audio codecs configuration, • audio_policy_configuration.xml (bus address definition), • audio hardware paths, • AudioControl.cpp (sContextToBusMap), • audio features (CDD), • car_volume_groups.xml (mapping of buses to volume groups), • default sounds. • config.xml (audioUseDynamicRouting), • audio_effects.[xml|conf], Methods: • media_profiles_*.xml, • global settings (for all processes), • media_codecs_*.xml, • user / profile settings, • other. • car variant specific, • static vs dynamic. 14 © Tieto Corporation Public Bartosz Bialek Senior Software Engineer Tieto, PDS BU Automotive & Smart Devices [email protected].