configs: Enable compress record for 8909
Enable compress input flag to enable compress capture on 8909.
Add new compress usecases to support multi record and pcm device ids.
Add new io policy file to support apptype config for record path.
CRs-Fixed: 2273661
Change-Id: I090b1e04c85dc7d19fb58378e0470f5e10d3612a
diff --git a/configs/msm8909/audio_io_policy.conf b/configs/msm8909/audio_io_policy.conf
new file mode 100644
index 0000000..dd0f3c1
--- /dev/null
+++ b/configs/msm8909/audio_io_policy.conf
@@ -0,0 +1,97 @@
+# 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
+ }
+ deep_buffer {
+ flags AUDIO_OUTPUT_FLAG_DEEP_BUFFER
+ formats AUDIO_FORMAT_PCM_16_BIT
+ sampling_rates 48000
+ bit_width 16
+ app_type 69936
+ }
+ direct_pcm_16 {
+ flags AUDIO_OUTPUT_FLAG_DIRECT
+ formats AUDIO_FORMAT_PCM_16_BIT
+ sampling_rates 44100|48000|96000|192000
+ bit_width 16
+ app_type 69936
+ }
+ direct_pcm_24 {
+ flags AUDIO_OUTPUT_FLAG_DIRECT
+ formats AUDIO_FORMAT_PCM_24_BIT_PACKED
+ sampling_rates 44100|48000|96000|192000
+ bit_width 24
+ app_type 69940
+ }
+ compress_offload_16 {
+ flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING
+ formats AUDIO_FORMAT_MP3|AUDIO_FORMAT_AC3|AUDIO_FORMAT_E_AC3|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|96000|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
+ sampling_rates 44100|48000|96000|192000
+ bit_width 24
+ app_type 69940
+ }
+}
+
+inputs {
+ primary {
+ flags AUDIO_INPUT_FLAG_NONE
+ formats AUDIO_FORMAT_PCM_16_BIT
+ sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000
+ bit_width 16
+ app_type 69938
+ }
+ record_24bit {
+ profile none
+ flags AUDIO_INPUT_FLAG_NONE
+ formats AUDIO_FORMAT_PCM_24_BIT_PACKED
+ sampling_rates 16000|48000
+ bit_width 24
+ app_type 69945
+ }
+ record_unprocessed {
+ profile record_unprocessed
+ formats AUDIO_FORMAT_PCM_24_BIT_PACKED
+ sampling_rates 16000|48000
+ bit_width 24
+ app_type 69942
+ }
+ record_mec {
+ flags AUDIO_INPUT_FLAG_TIMESTAMP
+ profile record_mec
+ formats AUDIO_FORMAT_PCM_16_BIT
+ sampling_rates 16000|48000
+ bit_width 16
+ app_type 69944
+ }
+ record_fluence {
+ flags AUDIO_INPUT_FLAG_TIMESTAMP
+ profile record_fluence
+ formats AUDIO_FORMAT_PCM_16_BIT
+ sampling_rates 48000
+ bit_width 16
+ app_type 69943
+ }
+}
diff --git a/configs/msm8909/audio_platform_info_extcodec.xml b/configs/msm8909/audio_platform_info_extcodec.xml
index 779b2e2..a49754d 100644
--- a/configs/msm8909/audio_platform_info_extcodec.xml
+++ b/configs/msm8909/audio_platform_info_extcodec.xml
@@ -50,6 +50,9 @@
<usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD2" type="out" id="24"/>
<usecase name="USECASE_AUDIO_EC_REF_LOOPBACK" type="in" id="14"/>
<usecase name="USECASE_AUDIO_PLAYBACK_SILENCE" type="out" id="14"/>
+ <usecase name="USECASE_AUDIO_RECORD_COMPRESS2" type="in" id="43"/>
+ <usecase name="USECASE_AUDIO_RECORD_COMPRESS3" type="in" id="44"/>
+ <usecase name="USECASE_AUDIO_RECORD_COMPRESS4" type="in" id="45"/>
</pcm_ids>
<acdb_metainfo_key>
<param name="aptx" value="456"/>
diff --git a/configs/msm8909/mixer_paths_wcd9326_i2s_tdm.xml b/configs/msm8909/mixer_paths_wcd9326_i2s_tdm.xml
index 6202ecc..61e2bde 100644
--- a/configs/msm8909/mixer_paths_wcd9326_i2s_tdm.xml
+++ b/configs/msm8909/mixer_paths_wcd9326_i2s_tdm.xml
@@ -1019,7 +1019,7 @@
</path>
<path name="audio-record-compress">
- <ctl name="MultiMedia8 Mixer SLIM_0_TX" value="1" />
+ <ctl name="MultiMedia8 Mixer PRI_TDM_TX_0" value="1" />
</path>
<path name="audio-record-compress bt-sco">
@@ -1036,8 +1036,62 @@
<ctl name="MultiMedia8 Mixer AFE_PCM_TX" value="1" />
</path>
+ <path name="audio-record-compress2">
+ <ctl name="MultiMedia17 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="audio-record-compress2 bt-sco">
+ <ctl name="MultiMedia17 Mixer INTERNAL_BT_SCO_TX" value="1" />
+ </path>
+
+ <path name="audio-record-compress2 bt-sco-wb">
+ <ctl name="Internal BTSCO SampleRate" value="BTSCO_RATE_16KHZ" />
+ <ctl name="SLIM_1 SampleRate" value="16000" />
+ <path name="audio-record-compress2 bt-sco" />
+ </path>
+
+ <path name="audio-record-compress2 usb-headset-mic">
+ <ctl name="MultiMedia8 Mixer AFE_PCM_TX" value="1" />
+ </path>
+
+ <path name="audio-record-compress3">
+ <ctl name="MultiMedia18 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="audio-record-compress3 bt-sco">
+ <ctl name="MultiMedia18 Mixer INTERNAL_BT_SCO_TX" value="1" />
+ </path>
+
+ <path name="audio-record-compress3 bt-sco-wb">
+ <ctl name="Internal BTSCO SampleRate" value="BTSCO_RATE_16KHZ" />
+ <ctl name="SLIM_1 SampleRate" value="16000" />
+ <path name="audio-record-compress3 bt-sco" />
+ </path>
+
+ <path name="audio-record-compress3 usb-headset-mic">
+ <ctl name="MultiMedia8 Mixer AFE_PCM_TX" value="1" />
+ </path>
+
+ <path name="audio-record-compress4">
+ <ctl name="MultiMedia19 Mixer PRI_TDM_TX_0" value="1" />
+ </path>
+
+ <path name="audio-record-compress4 bt-sco">
+ <ctl name="MultiMedia19 Mixer INTERNAL_BT_SCO_TX" value="1" />
+ </path>
+
+ <path name="audio-record-compress4 bt-sco-wb">
+ <ctl name="Internal BTSCO SampleRate" value="BTSCO_RATE_16KHZ" />
+ <ctl name="SLIM_1 SampleRate" value="16000" />
+ <path name="audio-record-compress4 bt-sco" />
+ </path>
+
+ <path name="audio-record-compress4 usb-headset-mic">
+ <ctl name="MultiMedia8 Mixer AFE_PCM_TX" value="1" />
+ </path>
+
<path name="low-latency-record">
- <ctl name="MultiMedia5 Mixer SLIM_0_TX" value="1" />
+ <ctl name="MultiMedia5 Mixer PRI_TDM_TX_0" value="1" />
</path>
<path name="low-latency-record bt-sco">
diff --git a/configs/msm8909/msm8909.mk b/configs/msm8909/msm8909.mk
index bb7847d..23cce99 100644
--- a/configs/msm8909/msm8909.mk
+++ b/configs/msm8909/msm8909.mk
@@ -43,6 +43,7 @@
BOARD_SUPPORTS_QAHW := true
BOARD_SUPPORTS_QSTHW_API := true
AUDIO_FEATURE_DISABLED_SOUND_TRIGGER_LEGACY_HAL := true
+AUDIO_FEATURE_ENABLED_COMPRESS_INPUT := true
##AUDIO_FEATURE_FLAGS
@@ -76,7 +77,8 @@
hardware/qcom/audio/configs/msm8909/sound_trigger_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sound_trigger_platform_info.xml \
hardware/qcom/audio/configs/msm8909/sound_trigger_mixer_paths_wcd9335.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sound_trigger_mixer_paths_wcd9335.xml \
hardware/qcom/audio/configs/msm8909/audio_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info.xml \
- hardware/qcom/audio/configs/msm8909/audio_platform_info_extcodec.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info_extcodec.xml
+ hardware/qcom/audio/configs/msm8909/audio_platform_info_extcodec.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info_extcodec.xml \
+ hardware/qcom/audio/configs/msm8909/audio_io_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_io_policy.conf
#XML Audio configuration files
ifeq ($(USE_XML_AUDIO_POLICY_CONF), 1)