From 3c1a37828ca9dc47d9bb63bbf8183b8d6c29ba02 Mon Sep 17 00:00:00 2001 From: Cosmin Tanislav Date: Tue, 7 Sep 2021 00:23:15 +0300 Subject: [PATCH] sm8350-common: audio: use mi audio policy configuration Xiaomi overrides the default audio policy configuration from vendor/etc/audio/sku_lahaina inside of AudioPolicyManager, and uses vendor/etc/audio_policy_configuration_mi.xml. Use the proper configuration, but keep copying it into the old location, since our AudioPolicyManager only knows how to load it from there. --- audio/audio_policy_configuration.xml | 362 ++++++++++++++---- ...hearing_aid_audio_policy_configuration.xml | 38 ++ common.mk | 3 +- 3 files changed, 336 insertions(+), 67 deletions(-) create mode 100644 audio/bluetooth_qti_hearing_aid_audio_policy_configuration.xml diff --git a/audio/audio_policy_configuration.xml b/audio/audio_policy_configuration.xml index 2bc6936..3990e62 100644 --- a/audio/audio_policy_configuration.xml +++ b/audio/audio_policy_configuration.xml @@ -1,5 +1,5 @@ - - + + - Speaker - Speaker Safe Earpiece + Speaker Telephony Tx Built-In Mic Built-In Back Mic + FM Tuner Telephony Rx Speaker - + + + + - + + samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO_HAPTIC_A"/> - + samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + flags="AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_VOIP_RX"> + samplingRates="8000,16000,32000,48000" channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/> @@ -101,17 +176,61 @@ samplingRates="8000,16000,48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> - - + + + - - + + channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/> + + + + + + + + + + + + + + + + + + + + + + - @@ -121,116 +240,224 @@ samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000" channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK,AUDIO_CHANNEL_INDEX_MASK_3"/> - - - + + + + - + + - + + + + + + + + + + + + - + + - + + + + + + + + + encodedFormats="AUDIO_FORMAT_SBC AUDIO_FORMAT_AAC AUDIO_FORMAT_APTX AUDIO_FORMAT_APTX_HD AUDIO_FORMAT_LDAC AUDIO_FORMAT_CELT AUDIO_FORMAT_APTX_ADAPTIVE AUDIO_FORMAT_APTX_TWSP VX_AUDIO_FORMAT_LC3 AUDIO_FORMAT_LHDC"> + samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> + encodedFormats="AUDIO_FORMAT_SBC AUDIO_FORMAT_AAC AUDIO_FORMAT_APTX AUDIO_FORMAT_APTX_HD AUDIO_FORMAT_LDAC AUDIO_FORMAT_CELT AUDIO_FORMAT_APTX_ADAPTIVE AUDIO_FORMAT_APTX_TWSP VX_AUDIO_FORMAT_LC3 AUDIO_FORMAT_LHDC"> + samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> + encodedFormats="AUDIO_FORMAT_SBC AUDIO_FORMAT_AAC AUDIO_FORMAT_APTX AUDIO_FORMAT_APTX_HD AUDIO_FORMAT_LDAC AUDIO_FORMAT_CELT AUDIO_FORMAT_APTX_ADAPTIVE AUDIO_FORMAT_APTX_TWSP VX_AUDIO_FORMAT_LC3 AUDIO_FORMAT_LHDC"> + samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> + + + + + + + + + + + + + + + + + + - + + + sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,haptics output"/> - + sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,haptics output"/> + + + + + + + + sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,haptics output"/> + sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,haptics output"/> + sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,haptics output"/> + sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,hifi_playback,haptics output"/> + sources="primary output,raw,deep_buffer,direct_pcm,compressed_offload,voip_rx,mmap_no_irq_out,hifi_playback,haptics output"/> - - - - + + + + + + + sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In,Wired Headset Mic"/> + + + sources="primary output,deep_buffer,direct_pcm,compressed_offload,voip_rx,haptics output"/> + sources="primary output,deep_buffer,direct_pcm,compressed_offload,voip_rx,haptics output"/> + sources="primary output,deep_buffer,direct_pcm,compressed_offload,voip_rx,haptics output"/> + + - - + + + + samplingRates="44100,48000" channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/> + + + + + + + + + + + samplingRates="44100,48000" channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/> + + + + @@ -259,6 +486,9 @@ + + + diff --git a/audio/bluetooth_qti_hearing_aid_audio_policy_configuration.xml b/audio/bluetooth_qti_hearing_aid_audio_policy_configuration.xml new file mode 100644 index 0000000..7707ae1 --- /dev/null +++ b/audio/bluetooth_qti_hearing_aid_audio_policy_configuration.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/common.mk b/common.mk index 816151a..baf6c62 100644 --- a/common.mk +++ b/common.mk @@ -70,7 +70,8 @@ PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/audio/mixer_paths_overlay_dynamic.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/sku_lahaina/mixer_paths_overlay_dynamic.xml \ $(LOCAL_PATH)/audio/mixer_paths_overlay_static.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/sku_lahaina/mixer_paths_overlay_static.xml \ $(LOCAL_PATH)/audio/sound_trigger_mixer_paths.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/sku_lahaina/sound_trigger_mixer_paths.xml \ - $(LOCAL_PATH)/audio/sound_trigger_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/sku_lahaina/sound_trigger_platform_info.xml + $(LOCAL_PATH)/audio/sound_trigger_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio/sku_lahaina/sound_trigger_platform_info.xml \ + $(LOCAL_PATH)/audio/bluetooth_qti_hearing_aid_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_qti_hearing_aid_audio_policy_configuration.xml PRODUCT_COPY_FILES += \ frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \