audio: initial aidl config

Bug: 316056633
Test: manual test

Change-Id: I610dff4963dce89378b583ca78a9d4ac82e35809
Signed-off-by: Jasmine Cha <chajasmine@google.com>
This commit is contained in:
Jasmine Cha 2023-12-12 14:01:30 +08:00
parent 4e761e85ce
commit 0b5893f3d8
5 changed files with 1857 additions and 0 deletions

View file

@ -0,0 +1,63 @@
// Copyright (C) 2023 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
soong_namespace {
imports: [
"frameworks/av/services/audiopolicy/config",
]
}
package {
default_applicable_licenses: [
"Android-Apache-2.0",
],
}
prebuilt_etc {
name: "audio_policy_volumes.xml",
src: "audio_policy_volumes.xml",
soc_specific: true,
}
prebuilt_etc {
name: "imported_default_volume_tables.xml",
src: "//frameworks/av/services/audiopolicy/config:default_volume_tables.xml",
soc_specific: true,
filename_from_src: true,
}
prebuilt_etc {
name: "audio_platform_configuration.xml",
src: "audio_platform_configuration.xml",
soc_specific: true,
required: [
"audio_policy_volumes.xml",
"imported_default_volume_tables.xml",
],
}
prebuilt_etc {
name: "mixer_paths_aidl.xml",
src: "mixer_paths_aidl.xml",
soc_specific: true,
}
phony {
name: "audio_aidl_configs",
soc_specific: true,
required: [
"audio_platform_configuration.xml",
"mixer_paths_aidl.xml"
],
}

View file

@ -0,0 +1,116 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Copyright (C) 2023 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<audioPlatformConfiguration xmlns:xi="http://www.w3.org/2001/XInclude">
<features>
<feature name="BatteryThrottle">
<argument name="Type" value="BCL_VOLTAGE" />
<argument name="Name" value="BCL_AUDIO_BAACL" />
<argument name="Strategy" value="MediaSpeakerAndScreenOn" />
</feature>
<feature name="PlaybackThermalThrottle">
<argument name="PollWaitMs" value="20000" />
<argument name="ThermistorName" value="VIRTUAL-SKIN-SPEAKER" />
<argument name="ThermistorType" value="UNKNOWN" />
<argument name="ThrottlingSeverity" value="LIGHT" />
<argument name="SpeakerPowerPollWaitMs" value="2000" />
</feature>
<feature name="RuntimeTuningDump" />
</features>
<voipVolume>
<path voipDevice="VoipDevice::kUsb">
<gain>0.01</gain>
<gain>0.02</gain>
<gain>0.04</gain>
<gain>0.10</gain>
<gain>0.21</gain>
<gain>0.47</gain>
<gain>1.00</gain>
</path>
</voipVolume>
<devices>
<device name="bluetooth" />
<device name="usb" />
<device name="speaker" codec="cs35l41">
<argument name="SpeakerNum" value="2" />
<argument name="Rotation" />
<argument name="AcousticShockProtection" />
</device>
</devices>
<tuners>
<tuner type="playback" name="waves">
<argument name="Sink" value="SPK" />
<argument name="ThermistorsName" value="VIRTUAL-SKIN-SPEAKER" />
<argument name="Extensions" value="SpeakerPowerLinkLaw" />
</tuner>
<tuner type="telephony" name="fortemedia">
<argument name="VoIP_DLCHs" value="SPK:2,USB:2" />
<argument name="VoIP_Rate" value="32000" />
<argument name="BOOST_USB_SWB_CLK" value="y" />
<argument name="BOOST_HANDSET_SWB_CLK" value="y" />
<argument name="CCA" value="UnsupportBands:48000,ExSharedBands:48000,VoIPMode:Dl" />
</tuner>
<tuner type="capture" name="gs_capture" />
<tuner type="compensation" name="TelephonySpeakerCompensation">
<scenario condition="HingeAngle:0,20"
output="LeftChannel:spk_compens_profile_1_l.conf RightChannel:spk_compens_profile_1_r.conf" />
<scenario condition="HingeAngle:21,180"
output="LeftChannel:spk_compens_profile_2_l.conf RightChannel:spk_compens_profile_2_r.conf" />
</tuner>
</tuners>
<latencies>
<latency source="primary-playback" sink="speaker" milliseconds="20" />
<latency source="primary-playback" sink="usb-device" milliseconds="10" />
<latency source="primary-playback" sink="usb-headset" milliseconds="10" />
<latency source="primary-playback" sink="bluetooth-a2dp-device" milliseconds="10" />
<latency source="primary-playback" sink="bluetooth-low-energy-speaker" milliseconds="10" />
<latency source="deep-buffer-playback" sink="speaker" milliseconds="70" />
<latency source="deep-buffer-playback" sink="usb-device" milliseconds="70" />
<latency source="deep-buffer-playback" sink="usb-headset" milliseconds="70" />
<latency source="deep-buffer-playback" sink="bluetooth-a2dp-device" milliseconds="180" />
<latency source="compress-offload-playback" sink="speaker" milliseconds="40" />
<latency source="compress-offload-playback" sink="usb-device" milliseconds="40" />
<latency source="compress-offload-playback" sink="usb-headset" milliseconds="40" />
<latency source="compress-offload-playback" sink="bluetooth-a2dp-device" milliseconds="70" />
<latency source="immersive-playback" sink="bluetooth-a2dp-device" milliseconds="100" />
<latency source="microphones" sink="primary-capture" milliseconds="160" />
<latency source="back-microphones" sink="primary-capture" milliseconds="160" />
<latency source="bluetooth-sco-headset" sink="primary-capture" milliseconds="40" />
</latencies>
<spatialCapture>
<enablement useCase="primary-capture" deviceInterface="microphones">
<source>MIC</source>
<source>CAMCORDER</source>
<source>VOICE_RECOGNITION</source>
</enablement>
<enablement useCase="primary-capture" deviceInterface="back-microphones">
<source>MIC</source>
<source>CAMCORDER</source>
<source>VOICE_RECOGNITION</source>
</enablement>
</spatialCapture>
<xi:include href="audio_policy_volumes.xml" />
<xi:include href="default_volume_tables.xml" />
</audioPlatformConfiguration>

View file

@ -0,0 +1,265 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2015 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Volume section defines a volume curve for a given use case and device category.
It contains a list of points of this curve expressing the attenuation in Millibels for a given
volume index from 0 to 100.
<volume stream=”AUDIO_STREAM_MUSIC” deviceCategory=””>
<point>0,-9600</point>
<point>100,0</point>
</volume>
-->
<volumes>
<volume stream="AUDIO_STREAM_VOICE_CALL" deviceCategory="DEVICE_CATEGORY_HEADSET">
<point>0,-4200</point>
<point>33,-2800</point>
<point>66,-1400</point>
<point>100,0</point>
</volume>
<volume stream="AUDIO_STREAM_VOICE_CALL" deviceCategory="DEVICE_CATEGORY_SPEAKER">
<point>0,-2400</point>
<point>33,-1600</point>
<point>66,-800</point>
<point>100,0</point>
</volume>
<volume stream="AUDIO_STREAM_VOICE_CALL" deviceCategory="DEVICE_CATEGORY_EARPIECE">
<point>0,-2400</point>
<point>33,-1600</point>
<point>66,-800</point>
<point>100,0</point>
</volume>
<volume stream="AUDIO_STREAM_VOICE_CALL" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_VOICE_CALL" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
ref="DEFAULT_NON_MUTABLE_HEARING_AID_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_SYSTEM" deviceCategory="DEVICE_CATEGORY_HEADSET">
<point>1,-3000</point>
<point>33,-2600</point>
<point>66,-2200</point>
<point>100,-1800</point>
</volume>
<volume stream="AUDIO_STREAM_SYSTEM" deviceCategory="DEVICE_CATEGORY_SPEAKER">
<point>1,-5200</point>
<point>13,-5000</point>
<point>28,-4400</point>
<point>56,-3380</point>
<point>71,-3120</point>
<point>85,-2750</point>
<point>100,-2150</point>
</volume>
<volume stream="AUDIO_STREAM_SYSTEM" deviceCategory="DEVICE_CATEGORY_EARPIECE"
ref="DEFAULT_SYSTEM_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_SYSTEM" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_SYSTEM" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_RING" deviceCategory="DEVICE_CATEGORY_HEADSET"
ref="DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_RING" deviceCategory="DEVICE_CATEGORY_SPEAKER">
<point>1,-4935</point>
<point>14,-3320</point>
<point>28,-2960</point>
<point>71,-1400</point>
<point>100,0</point>
</volume>
<volume stream="AUDIO_STREAM_RING" deviceCategory="DEVICE_CATEGORY_EARPIECE"
ref="DEFAULT_DEVICE_CATEGORY_EARPIECE_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_RING" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_RING" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_MUSIC" deviceCategory="DEVICE_CATEGORY_HEADSET"
ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_MUSIC" deviceCategory="DEVICE_CATEGORY_SPEAKER">
<point>1,-6920</point>
<point>4,-6920</point>
<point>8,-6664</point>
<point>12,-6374</point>
<point>16,-6082</point>
<point>20,-5759</point>
<point>24,-5410</point>
<point>28,-5038</point>
<point>32,-4807</point>
<point>36,-4577</point>
<point>40,-4339</point>
<point>44,-4132</point>
<point>48,-3860</point>
<point>52,-3569</point>
<point>56,-3223</point>
<point>60,-2823</point>
<point>64,-2452</point>
<point>68,-2078</point>
<point>72,-1795</point>
<point>76,-1561</point>
<point>80,-1226</point>
<point>84,-956</point>
<point>88,-789</point>
<point>92,-635</point>
<point>96,-505</point>
<point>100,0</point>
</volume>
<volume stream="AUDIO_STREAM_MUSIC" deviceCategory="DEVICE_CATEGORY_EARPIECE"
ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_MUSIC" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_MUSIC" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_ALARM" deviceCategory="DEVICE_CATEGORY_HEADSET"
ref="DEFAULT_NON_MUTABLE_HEADSET_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_ALARM" deviceCategory="DEVICE_CATEGORY_SPEAKER">
<point>0,-5600</point>
<point>14,-4670</point>
<point>28,-3060</point>
<point>71,-1050</point>
<point>100,-100</point>
</volume>
<volume stream="AUDIO_STREAM_ALARM" deviceCategory="DEVICE_CATEGORY_EARPIECE"
ref="DEFAULT_NON_MUTABLE_EARPIECE_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_ALARM" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
ref="DEFAULT_NON_MUTABLE_EXT_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_ALARM" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
ref="DEFAULT_NON_MUTABLE_HEARING_AID_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_NOTIFICATION" deviceCategory="DEVICE_CATEGORY_HEADSET"
ref="DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_NOTIFICATION" deviceCategory="DEVICE_CATEGORY_SPEAKER">
<point>1,-6350</point>
<point>14,-4300</point>
<point>28,-3710</point>
<point>66,-2100</point>
<point>85,-1550</point>
<point>100,-780</point>
</volume>
<volume stream="AUDIO_STREAM_NOTIFICATION" deviceCategory="DEVICE_CATEGORY_EARPIECE"
ref="DEFAULT_DEVICE_CATEGORY_EARPIECE_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_NOTIFICATION" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_NOTIFICATION" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
ref="DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_BLUETOOTH_SCO" deviceCategory="DEVICE_CATEGORY_HEADSET">
<point>0,-4200</point>
<point>33,-2800</point>
<point>66,-1400</point>
<point>100,0</point>
</volume>
<volume stream="AUDIO_STREAM_BLUETOOTH_SCO" deviceCategory="DEVICE_CATEGORY_SPEAKER">
<point>0,-2400</point>
<point>33,-1600</point>
<point>66,-800</point>
<point>100,0</point>
</volume>
<volume stream="AUDIO_STREAM_BLUETOOTH_SCO" deviceCategory="DEVICE_CATEGORY_EARPIECE">
<point>0,-4200</point>
<point>33,-2800</point>
<point>66,-1400</point>
<point>100,0</point>
</volume>
<volume stream="AUDIO_STREAM_BLUETOOTH_SCO" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_BLUETOOTH_SCO" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_ENFORCED_AUDIBLE" deviceCategory="DEVICE_CATEGORY_HEADSET">
<point>1,-3000</point>
<point>33,-2600</point>
<point>66,-2200</point>
<point>100,-1800</point>
</volume>
<volume stream="AUDIO_STREAM_ENFORCED_AUDIBLE" deviceCategory="DEVICE_CATEGORY_SPEAKER">
<point>1,-5200</point>
<point>13,-5000</point>
<point>28,-4400</point>
<point>56,-3380</point>
<point>71,-3120</point>
<point>85,-2750</point>
<point>100,-2150</point>
</volume>
<volume stream="AUDIO_STREAM_ENFORCED_AUDIBLE" deviceCategory="DEVICE_CATEGORY_EARPIECE"
ref="DEFAULT_SYSTEM_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_ENFORCED_AUDIBLE" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_ENFORCED_AUDIBLE" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_DTMF" deviceCategory="DEVICE_CATEGORY_HEADSET">
<point>1,-3000</point>
<point>33,-2600</point>
<point>66,-2200</point>
<point>100,-1800</point>
</volume>
<volume stream="AUDIO_STREAM_DTMF" deviceCategory="DEVICE_CATEGORY_SPEAKER">
<point>1,-6600</point>
<point>13,-6220</point>
<point>28,-5500</point>
<point>42,-4600</point>
<point>57,-4250</point>
<point>100,-2780</point>
</volume>
<volume stream="AUDIO_STREAM_DTMF" deviceCategory="DEVICE_CATEGORY_EARPIECE"
ref="DEFAULT_SYSTEM_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_DTMF" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_DTMF" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_TTS" deviceCategory="DEVICE_CATEGORY_HEADSET"
ref="SILENT_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_TTS" deviceCategory="DEVICE_CATEGORY_SPEAKER"
ref="FULL_SCALE_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_TTS" deviceCategory="DEVICE_CATEGORY_EARPIECE"
ref="SILENT_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_TTS" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
ref="SILENT_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_TTS" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
ref="SILENT_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_ACCESSIBILITY" deviceCategory="DEVICE_CATEGORY_HEADSET"
ref="DEFAULT_NON_MUTABLE_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_ACCESSIBILITY" deviceCategory="DEVICE_CATEGORY_SPEAKER"
ref="DEFAULT_NON_MUTABLE_SPEAKER_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_ACCESSIBILITY" deviceCategory="DEVICE_CATEGORY_EARPIECE"
ref="DEFAULT_NON_MUTABLE_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_ACCESSIBILITY" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
ref="DEFAULT_NON_MUTABLE_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_ACCESSIBILITY" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
ref="DEFAULT_NON_MUTABLE_HEARING_AID_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_ASSISTANT" deviceCategory="DEVICE_CATEGORY_HEADSET"
ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_ASSISTANT" deviceCategory="DEVICE_CATEGORY_SPEAKER"
ref="DEFAULT_DEVICE_CATEGORY_SPEAKER_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_ASSISTANT" deviceCategory="DEVICE_CATEGORY_EARPIECE"
ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_ASSISTANT" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_ASSISTANT" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
ref="DEFAULT_HEARING_AID_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_REROUTING" deviceCategory="DEVICE_CATEGORY_HEADSET"
ref="FULL_SCALE_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_REROUTING" deviceCategory="DEVICE_CATEGORY_SPEAKER"
ref="FULL_SCALE_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_REROUTING" deviceCategory="DEVICE_CATEGORY_EARPIECE"
ref="FULL_SCALE_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_REROUTING" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
ref="FULL_SCALE_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_REROUTING" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
ref="FULL_SCALE_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_PATCH" deviceCategory="DEVICE_CATEGORY_HEADSET"
ref="FULL_SCALE_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_PATCH" deviceCategory="DEVICE_CATEGORY_SPEAKER"
ref="FULL_SCALE_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_PATCH" deviceCategory="DEVICE_CATEGORY_EARPIECE"
ref="FULL_SCALE_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_PATCH" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
ref="FULL_SCALE_VOLUME_CURVE"/>
<volume stream="AUDIO_STREAM_PATCH" deviceCategory="DEVICE_CATEGORY_HEARING_AID"
ref="FULL_SCALE_VOLUME_CURVE"/>
</volumes>

File diff suppressed because it is too large Load diff