From de4e0b7e7a10c55d676869c9bde1f62f0acdc7fa Mon Sep 17 00:00:00 2001 From: Alexander Koskovich Date: Wed, 1 Jun 2022 08:26:29 -0700 Subject: [PATCH] sm8250-common: Use audio IO policy from IN2025_11.C.33 * Has important stuff for 24 bit playback. Change-Id: I6b51ad80967293856145a0650c4df9971eadeabe --- audio/audio_io_policy.conf | 183 +++++++++++++++++++++++++++++++++++++ common.mk | 2 +- 2 files changed, 184 insertions(+), 1 deletion(-) create mode 100644 audio/audio_io_policy.conf diff --git a/audio/audio_io_policy.conf b/audio/audio_io_policy.conf new file mode 100644 index 0000000..18d216d --- /dev/null +++ b/audio/audio_io_policy.conf @@ -0,0 +1,183 @@ +# List of profiles for the output device session where stream is routed. +# A stream opened with the inputs attributes which match the "flags" and +# "formats" as specified in the profile is routed to a device at +# sample rate specified under "sampling_rates" and bit width under +# "bit_width" and the topology extracted from the acdb data against +# the "app_type". +# +# the flags and formats are specified using the strings corresponding to +# enums in audio.h and audio_policy.h. They are concatenated with "|" +# without space or "\n". +# the flags and formats should match the ones in "audio_policy.conf" + +outputs { + default { + flags AUDIO_OUTPUT_FLAG_PRIMARY + formats AUDIO_FORMAT_PCM_16_BIT + sampling_rates 48000 + bit_width 16 + app_type 69937 + } + #ifdef OPLUS_FEATURE_PLAYBACK_24BIT + #Chunyu.Xie@MULTIMEDIA.AUDIODRIVER.HAL, 2021/07/15, add for support playback with 24bits + default_24 { + flags AUDIO_OUTPUT_FLAG_PRIMARY + formats AUDIO_FORMAT_PCM_24_BIT_PACKED + sampling_rates 48000 + bit_width 24 + app_type 69937 + } + #endif /* OPLUS_FEATURE_PLAYBACK_24BIT */ + proaudio { + flags AUDIO_OUTPUT_FLAG_FAST|AUDIO_OUTPUT_FLAG_RAW + formats AUDIO_FORMAT_PCM_16_BIT + sampling_rates 48000 + bit_width 16 + app_type 69943 + } + voip_rx { + flags AUDIO_OUTPUT_FLAG_VOIP_RX|AUDIO_OUTPUT_FLAG_DIRECT + formats AUDIO_FORMAT_PCM_16_BIT + sampling_rates 8000|16000|32000|48000 + bit_width 16 + app_type 69946 + } + deep_buffer { + flags AUDIO_OUTPUT_FLAG_DEEP_BUFFER + formats AUDIO_FORMAT_PCM_16_BIT + sampling_rates 48000 + bit_width 16 + app_type 69936 + } + #ifdef OPLUS_FEATURE_PLAYBACK_24BIT + #Chunyu.Xie@MULTIMEDIA.AUDIODRIVER.HAL, 2021/07/15, add for support playback with 24bits + deep_buffer_24 { + flags AUDIO_OUTPUT_FLAG_DEEP_BUFFER + formats AUDIO_FORMAT_PCM_24_BIT_PACKED + sampling_rates 48000 + bit_width 24 + app_type 69936 + } + #endif /* OPLUS_FEATURE_PLAYBACK_24BIT */ + direct_pcm_16 { + flags AUDIO_OUTPUT_FLAG_DIRECT + formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT|AUDIO_FORMAT_PCM_32_BIT + sampling_rates 44100|48000|88200|96000|176400|192000 + bit_width 16 + app_type 69936 + } + direct_pcm_24 { + flags AUDIO_OUTPUT_FLAG_DIRECT + formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT|AUDIO_FORMAT_PCM_32_BIT + sampling_rates 44100|48000|88200|96000|176400|192000|352800|384000 + bit_width 24 + app_type 69940 + } + direct_pcm_32 { + flags AUDIO_OUTPUT_FLAG_DIRECT + formats AUDIO_FORMAT_PCM_32_BIT + sampling_rates 44100|48000|88200|96000|176400|192000|352800|384000 + bit_width 32 + app_type 69942 + } + compress_passthrough { + flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING|AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH + formats AUDIO_FORMAT_DTS|AUDIO_FORMAT_DTS_HD|AUDIO_FORMAT_DSD + sampling_rates 32000|44100|48000|88200|96000|176400|192000|352800 + bit_width 16 + app_type 69941 + } + compress_offload_16 { + flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING + formats AUDIO_FORMAT_MP3|AUDIO_FORMAT_PCM_16_BIT_OFFLOAD|AUDIO_FORMAT_PCM_24_BIT_OFFLOAD|AUDIO_FORMAT_FLAC|AUDIO_FORMAT_ALAC|AUDIO_FORMAT_APE|AUDIO_FORMAT_AAC_LC|AUDIO_FORMAT_AAC_HE_V1|AUDIO_FORMAT_AAC_HE_V2|AUDIO_FORMAT_WMA|AUDIO_FORMAT_WMA_PRO|AUDIO_FORMAT_VORBIS|AUDIO_FORMAT_AAC_ADTS_LC|AUDIO_FORMAT_AAC_ADTS_HE_V1|AUDIO_FORMAT_AAC_ADTS_HE_V2 + sampling_rates 44100|48000|88200|96000|176400|192000 + bit_width 16 + app_type 69936 + } + compress_offload_24 { + flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING + formats AUDIO_FORMAT_PCM_24_BIT_OFFLOAD|AUDIO_FORMAT_FLAC|AUDIO_FORMAT_ALAC|AUDIO_FORMAT_APE|AUDIO_FORMAT_VORBIS|AUDIO_FORMAT_WMA|AUDIO_FORMAT_WMA_PRO + sampling_rates 44100|48000|88200|96000|176400|192000 + bit_width 24 + app_type 69940 + } +} + +inputs { + record_16bit { + formats AUDIO_FORMAT_PCM_16_BIT +#ifndef OPLUS_BUG_COMPATIBILITY +#//Yongpei.Yao@MULTIMEDIA.AUDIODRIVER.HAL.1825796, 2020/04/13, Modify for not support rate +# sampling_rates 8000|16000|32000|44100|48000|88200|96000|176400|192000 +#else + sampling_rates 8000|16000|32000|48000 +#endif /* OPLUS_BUG_COMPATIBILITY */ + bit_width 16 + app_type 69938 + } + record_24bit { + formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_24_BIT +#ifndef OPLUS_BUG_COMPATIBILITY +#//Yongpei.Yao@MULTIMEDIA.AUDIODRIVER.HAL.1825796, 2020/04/13, Modify for not support rate +# sampling_rates 44100|48000|88200|96000|176400|192000 +#else + sampling_rates 48000|88200|96000|176400|192000 +#endif /* OPLUS_BUG_COMPATIBILITY */ + bit_width 24 + app_type 69948 + } + record_32bit { + formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_FLOAT +#ifndef OPLUS_BUG_COMPATIBILITY +#//Yongpei.Yao@MULTIMEDIA.AUDIODRIVER.HAL.1825796, 2020/04/13, Modify for not support rate +# sampling_rates 44100|48000|88200|96000|176400|192000 +#else + sampling_rates 48000|88200|96000|176400|192000 +#endif /* OPLUS_BUG_COMPATIBILITY */ + bit_width 32 + app_type 69949 + } +#ifdef OPLUS_ARCH_EXTENDS + +#//Nan.Zhong@MULTIMEDIA.AUDIODRIVER.HAL, 2020/08/27, Add for support rate for record_compress + record_compress_16 { + flags AUDIO_INPUT_FLAG_COMPRESS + formats AUDIO_FORMAT_PCM_16_BIT + sampling_rates 8000|16000|32000|48000 + bit_width 16 + app_type 69938 + } + record_compress_24 { + flags AUDIO_INPUT_FLAG_COMPRESS + formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_24_BIT + sampling_rates 48000|88200|96000|176400|192000 + bit_width 24 + app_type 69948 + } + record_compress_32 { + flags AUDIO_INPUT_FLAG_COMPRESS + formats AUDIO_FORMAT_PCM_32_BIT|AUDIO_FORMAT_PCM_FLOAT + sampling_rates 48000|88200|96000|176400|192000 + bit_width 32 + app_type 69949 + } +#endif /* OPLUS_ARCH_EXTENDS */ + +#//RiCheng.Wang@MULTIMEDIA.AUDIODRIVER.HAL.1825796, 2020/09/27, Modify for #CR2762808 audio record voip low latency + voip_tx { + flags AUDIO_INPUT_FLAG_VOIP_TX + formats AUDIO_FORMAT_PCM_16_BIT + sampling_rates 8000|16000|32000|48000 + bit_width 16 + app_type 69946 + } + low_latency_voip_tx { + flags AUDIO_INPUT_FLAG_FAST|AUDIO_INPUT_FLAG_VOIP_TX + formats AUDIO_FORMAT_PCM_16_BIT + sampling_rates 48000 + bit_width 16 + app_type 69946 + } +#endif/* OPLUS_ARCH_EXTENDS */ + +} diff --git a/common.mk b/common.mk index 0a01299..f342fcb 100644 --- a/common.mk +++ b/common.mk @@ -72,8 +72,8 @@ PRODUCT_COPY_FILES += \ $(AUDIO_HAL_DIR)/configs/kona/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.xml \ $(AUDIO_HAL_DIR)/configs/kona/audio_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info.xml \ $(AUDIO_HAL_DIR)/configs/kona/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \ - $(AUDIO_HAL_DIR)/configs/kona/audio_io_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_io_policy.conf \ $(AUDIO_HAL_DIR)/configs/kona/audio_tuning_mixer.txt:$(TARGET_COPY_OUT_VENDOR)/etc/audio_tuning_mixer.txt \ + $(LOCAL_PATH)/audio/audio_io_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_io_policy.conf \ $(LOCAL_PATH)/audio/audio_platform_info_intcodec.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info_intcodec.xml \ $(LOCAL_PATH)/audio/sound_trigger_mixer_paths.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sound_trigger_mixer_paths.xml \ $(LOCAL_PATH)/audio/sound_trigger_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sound_trigger_platform_info.xml