diff options
author | Praneeth Bajjuri | 2017-09-28 18:54:54 -0500 |
---|---|---|
committer | Praneeth Bajjuri | 2017-10-02 17:35:19 -0500 |
commit | 9c829fc09970dd7f20d364a07fd0abf94cc0db8e (patch) | |
tree | 4004b3d8f2ea5c8e28b1ce14f1dd22d258ee53a5 | |
parent | 64424441ab46abfc53daa8a327d2e0f7f3be84ea (diff) | |
download | device-ti-am57xevm-9c829fc09970dd7f20d364a07fd0abf94cc0db8e.tar.gz device-ti-am57xevm-9c829fc09970dd7f20d364a07fd0abf94cc0db8e.tar.xz device-ti-am57xevm-9c829fc09970dd7f20d364a07fd0abf94cc0db8e.zip |
audio: Use XML audio configuration files
Replace the legacy audio_policy.conf with the new XML-based
audio policy configuration approach.
This version of the audio policy excludes the HDMI
HALs because they're currently not being loaded in the
binderized mode.
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
[picked from http://review.omapzoom.org/#/c/38586
and did not take vendor partition moving change as this is
not working with am57x yet]
Change-Id: Id2fd413a0a4af46ad769512edad9bb10bcf55edb
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
Conflicts:
device.mk
-rw-r--r-- | audio/audio_policy.conf | 102 | ||||
-rw-r--r-- | audio/audio_policy_configuration.xml | 22 | ||||
-rw-r--r-- | audio/primary/audio_policy_configuration.xml | 47 | ||||
-rw-r--r-- | device.mk | 12 |
4 files changed, 79 insertions, 104 deletions
diff --git a/audio/audio_policy.conf b/audio/audio_policy.conf deleted file mode 100644 index f7a6f02..0000000 --- a/audio/audio_policy.conf +++ /dev/null | |||
@@ -1,102 +0,0 @@ | |||
1 | # Global configuration section: lists input and output devices always present on the device | ||
2 | # as well as the output device selected by default. | ||
3 | # Devices are designated by a string that corresponds to the enum in audio.h | ||
4 | |||
5 | global_configuration { | ||
6 | attached_output_devices AUDIO_DEVICE_OUT_SPEAKER | ||
7 | default_output_device AUDIO_DEVICE_OUT_SPEAKER | ||
8 | attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_LINE | ||
9 | } | ||
10 | |||
11 | # audio hardware module section: contains descriptors for all audio hw modules present on the | ||
12 | # device. Each hw module node is named after the corresponding hw module library base name. | ||
13 | # For instance, "primary" corresponds to audio.primary.<device>.so. | ||
14 | # The "primary" module is mandatory and must include at least one output with | ||
15 | # AUDIO_OUTPUT_FLAG_PRIMARY flag. | ||
16 | # Each module descriptor contains one or more output profile descriptors and zero or more | ||
17 | # input profile descriptors. Each profile lists all the parameters supported by a given output | ||
18 | # or input stream category. | ||
19 | # The "channel_masks", "formats", "devices" and "flags" are specified using strings corresponding | ||
20 | # to enums in audio.h and audio_policy.h. They are concatenated by use of "|" without space or "\n". | ||
21 | |||
22 | audio_hw_modules { | ||
23 | primary { | ||
24 | outputs { | ||
25 | primary { | ||
26 | sampling_rates 44100 | ||
27 | channel_masks AUDIO_CHANNEL_OUT_STEREO | ||
28 | formats AUDIO_FORMAT_PCM_16_BIT | ||
29 | devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE | ||
30 | flags AUDIO_OUTPUT_FLAG_PRIMARY | ||
31 | } | ||
32 | } | ||
33 | inputs { | ||
34 | primary { | ||
35 | sampling_rates 8000|11025|16000|22050|32000|44100|48000 | ||
36 | channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO | ||
37 | formats AUDIO_FORMAT_PCM_16_BIT | ||
38 | devices AUDIO_DEVICE_IN_BUILTIN_MIC | ||
39 | } | ||
40 | } | ||
41 | } | ||
42 | hdmi { | ||
43 | outputs { | ||
44 | stereo { | ||
45 | sampling_rates 44100|48000 | ||
46 | channel_masks AUDIO_CHANNEL_OUT_STEREO | ||
47 | formats AUDIO_FORMAT_PCM_16_BIT | ||
48 | devices AUDIO_DEVICE_OUT_AUX_DIGITAL | ||
49 | } | ||
50 | multichannel { | ||
51 | sampling_rates 44100|48000 | ||
52 | channel_masks dynamic | ||
53 | formats AUDIO_FORMAT_PCM_16_BIT | ||
54 | devices AUDIO_DEVICE_OUT_AUX_DIGITAL | ||
55 | flags AUDIO_OUTPUT_FLAG_DIRECT | ||
56 | } | ||
57 | } | ||
58 | } | ||
59 | a2dp { | ||
60 | outputs { | ||
61 | a2dp { | ||
62 | sampling_rates 44100 | ||
63 | channel_masks AUDIO_CHANNEL_OUT_STEREO | ||
64 | formats AUDIO_FORMAT_PCM_16_BIT | ||
65 | devices AUDIO_DEVICE_OUT_ALL_A2DP | ||
66 | } | ||
67 | } | ||
68 | inputs { | ||
69 | a2dp { | ||
70 | sampling_rates 44100|48000 | ||
71 | channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO | ||
72 | formats AUDIO_FORMAT_PCM_16_BIT | ||
73 | devices AUDIO_DEVICE_IN_BLUETOOTH_A2DP | ||
74 | } | ||
75 | } | ||
76 | } | ||
77 | r_submix { | ||
78 | outputs { | ||
79 | r_submix { | ||
80 | sampling_rates 44100|48000 | ||
81 | channel_masks AUDIO_CHANNEL_OUT_STEREO | ||
82 | formats AUDIO_FORMAT_PCM_16_BIT | ||
83 | devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX | ||
84 | } | ||
85 | multichannel { | ||
86 | sampling_rates 44100|48000 | ||
87 | channel_masks AUDIO_CHANNEL_OUT_5POINT1 | ||
88 | formats AUDIO_FORMAT_PCM_16_BIT | ||
89 | devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX | ||
90 | flags AUDIO_OUTPUT_FLAG_DIRECT | ||
91 | } | ||
92 | } | ||
93 | inputs { | ||
94 | r_submix { | ||
95 | sampling_rates 44100|48000 | ||
96 | channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO|AUDIO_CHANNEL_IN_5POINT1EMUL | ||
97 | formats AUDIO_FORMAT_PCM_16_BIT | ||
98 | devices AUDIO_DEVICE_IN_REMOTE_SUBMIX | ||
99 | } | ||
100 | } | ||
101 | } | ||
102 | } | ||
diff --git a/audio/audio_policy_configuration.xml b/audio/audio_policy_configuration.xml new file mode 100644 index 0000000..319fa70 --- /dev/null +++ b/audio/audio_policy_configuration.xml | |||
@@ -0,0 +1,22 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
2 | <audioPolicyConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude"> | ||
3 | <modules> | ||
4 | <!-- Primary Audio HAL --> | ||
5 | <xi:include href="primary_audio_policy_configuration.xml"/> | ||
6 | |||
7 | <!-- A2DP Audio HAL --> | ||
8 | <xi:include href="a2dp_audio_policy_configuration.xml"/> | ||
9 | |||
10 | <!-- USB Audio HAL --> | ||
11 | <xi:include href="usb_audio_policy_configuration.xml"/> | ||
12 | |||
13 | <!-- Remote Submix Audio HAL --> | ||
14 | <xi:include href="r_submix_audio_policy_configuration.xml"/> | ||
15 | |||
16 | </modules> | ||
17 | |||
18 | <!-- Volume section --> | ||
19 | <xi:include href="audio_policy_volumes.xml"/> | ||
20 | <xi:include href="default_volume_tables.xml"/> | ||
21 | |||
22 | </audioPolicyConfiguration> | ||
diff --git a/audio/primary/audio_policy_configuration.xml b/audio/primary/audio_policy_configuration.xml new file mode 100644 index 0000000..f13d1bb --- /dev/null +++ b/audio/primary/audio_policy_configuration.xml | |||
@@ -0,0 +1,47 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <!-- Primary Audio HAL Module Audio Policy Configuration include file --> | ||
3 | <module name="primary" description="Primary Audio HAL" halVersion="2.0"> | ||
4 | <attachedDevices> | ||
5 | <item>Speaker</item> | ||
6 | <item>Built-In Mic</item> | ||
7 | </attachedDevices> | ||
8 | |||
9 | <defaultOutputDevice>Speaker</defaultOutputDevice> | ||
10 | |||
11 | <mixPorts> | ||
12 | <mixPort name="primary output" role="source" flags="AUDIO_OUTPUT_FLAG_PRIMARY"> | ||
13 | <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" | ||
14 | samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> | ||
15 | </mixPort> | ||
16 | <mixPort name="primary input" role="sink"> | ||
17 | <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" | ||
18 | samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000" | ||
19 | channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO"/> | ||
20 | </mixPort> | ||
21 | </mixPorts> | ||
22 | |||
23 | <devicePorts> | ||
24 | <devicePort tagName="Speaker" type="AUDIO_DEVICE_OUT_SPEAKER" role="sink"> | ||
25 | </devicePort> | ||
26 | <devicePort tagName="Wired Headset" type="AUDIO_DEVICE_OUT_WIRED_HEADSET" role="sink"> | ||
27 | </devicePort> | ||
28 | <devicePort tagName="Wired Headphones" type="AUDIO_DEVICE_OUT_WIRED_HEADPHONE" role="sink"> | ||
29 | </devicePort> | ||
30 | |||
31 | <devicePort tagName="Built-In Mic" type="AUDIO_DEVICE_IN_BUILTIN_MIC" role="source"> | ||
32 | </devicePort> | ||
33 | </devicePorts> | ||
34 | |||
35 | <routes> | ||
36 | <route type="mux" sink="Speaker" | ||
37 | sources="primary output"/> | ||
38 | <route type="mux" sink="Wired Headset" | ||
39 | sources="primary output"/> | ||
40 | <route type="mux" sink="Wired Headphones" | ||
41 | sources="primary output"/> | ||
42 | |||
43 | <route type="mix" sink="primary input" | ||
44 | sources="Built-In Mic"/> | ||
45 | </routes> | ||
46 | </module> | ||
47 | |||
@@ -20,6 +20,8 @@ else | |||
20 | LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL) | 20 | LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL) |
21 | endif | 21 | endif |
22 | 22 | ||
23 | USE_XML_AUDIO_POLICY_CONF := 1 | ||
24 | |||
23 | PRODUCT_PACKAGES += \ | 25 | PRODUCT_PACKAGES += \ |
24 | android.hardware.wifi@1.0-service \ | 26 | android.hardware.wifi@1.0-service \ |
25 | android.hardware.graphics.allocator@2.0-impl \ | 27 | android.hardware.graphics.allocator@2.0-impl \ |
@@ -63,8 +65,14 @@ PRODUCT_COPY_FILES += \ | |||
63 | 65 | ||
64 | # Audio | 66 | # Audio |
65 | PRODUCT_COPY_FILES += \ | 67 | PRODUCT_COPY_FILES += \ |
66 | device/ti/am57xevm/audio/primary/mixer_paths.xml:vendor/etc/mixer_paths.xml \ | 68 | frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:system/etc/a2dp_audio_policy_configuration.xml \ |
67 | device/ti/am57xevm/audio/audio_policy.conf:vendor/etc/audio_policy.conf | 69 | frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:system/etc/usb_audio_policy_configuration.xml \ |
70 | frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:system/etc/r_submix_audio_policy_configuration.xml \ | ||
71 | frameworks/av/services/audiopolicy/config/default_volume_tables.xml:system/etc/default_volume_tables.xml \ | ||
72 | frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:system/etc/audio_policy_volumes.xml \ | ||
73 | device/ti/am57xevm/audio/primary/mixer_paths.xml:system/etc/mixer_paths.xml \ | ||
74 | device/ti/am57xevm/audio/primary/audio_policy_configuration.xml:system/etc/primary_audio_policy_configuration.xml \ | ||
75 | device/ti/am57xevm/audio/audio_policy_configuration.xml:system/etc/audio_policy_configuration.xml | ||
68 | 76 | ||
69 | # cpuset configuration | 77 | # cpuset configuration |
70 | PRODUCT_COPY_FILES += \ | 78 | PRODUCT_COPY_FILES += \ |