blob: 9b83fefb48156027c7598c8d0c5132781f609dbf [file] [log] [blame]
Eric Laurenteb108a42014-06-06 14:56:52 -07001#
2# Template audio policy configuration file
3#
4
5# Global configuration section:
6# - before audio HAL version 3.0:
7# lists input and output devices always present on the device
8# as well as the output device selected by default.
9# Devices are designated by a string that corresponds to the enum in audio.h
10#
11# global_configuration {
12# attached_output_devices AUDIO_DEVICE_OUT_SPEAKER
13# default_output_device AUDIO_DEVICE_OUT_SPEAKER
14# attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_REMOTE_SUBMIX
15# }
16#
17# - after and including audio HAL 3.0 the global_configuration section is included in each
18# hardware module section.
19# it also includes the audio HAL version of this hw module:
20# global_configuration {
21# ...
22# audio_hal_version <major.minor> # audio HAL version in e.g. 3.0
23# }
24# other attributes (attached devices, default device) have to be included in the
25# global_configuration section of each hardware module
26
27
28# audio hardware module section: contains descriptors for all audio hw modules present on the
29# device. Each hw module node is named after the corresponding hw module library base name.
30# For instance, "primary" corresponds to audio.primary.<device>.so.
31# The "primary" module is mandatory and must include at least one output with
32# AUDIO_OUTPUT_FLAG_PRIMARY flag.
33# Each module descriptor contains one or more output profile descriptors and zero or more
34# input profile descriptors. Each profile lists all the parameters supported by a given output
35# or input stream category.
36# The "channel_masks", "formats", "devices" and "flags" are specified using strings corresponding
37# to enums in audio.h and audio_policy.h. They are concatenated by use of "|" without space or "\n".
38#
39# For audio HAL version posterior to 3.0 the following sections or sub sections can be present in
40# a hw module section:
41# - A "global_configuration" section: see above
42# - Optionally a "devices" section:
43# This section contains descriptors for audio devices with attributes like an address or a
44# gain controller. The syntax for the devices section and device descriptor is as follows:
45# devices {
46# <device name> { # <device name>: any string without space
47# type <device type> # <device type> e.g. AUDIO_DEVICE_OUT_SPEAKER
48# address <address> # optional: device address, char string less than 64 in length
49# }
50# }
51# - one or more "gains" sections can be present in a device descriptor section.
52# If present, they describe the capabilities of gain controllers attached to this input or
53# output device. e.g. :
54# <device name> { # <device name>: any string without space
55# type <device type> # <device type> e.g. AUDIO_DEVICE_OUT_SPEAKER
56# address <address> # optional: device address, char string less than 64 in length
57# gains {
58# <gain name> {
59# mode <gain modes supported> # e.g. AUDIO_GAIN_MODE_CHANNELS
60# channel_mask <controlled channels> # needed if mode AUDIO_GAIN_MODE_CHANNELS
61# min_value_mB <min value in millibel>
62# max_value_mB <max value in millibel>
63# default_value_mB <default value in millibel>
64# step_value_mB <step value in millibel>
65# min_ramp_ms <min duration in ms> # needed if mode AUDIO_GAIN_MODE_RAMP
66# max_ramp_ms <max duration ms> # needed if mode AUDIO_GAIN_MODE_RAMP
67# }
68# }
69# }
70# - when a device descriptor is present, output and input profiles can refer to this device by
71# its name in their "devices" section instead of specifying a device type. e.g. :
72# outputs {
73# primary {
74# sampling_rates 44100
75# channel_masks AUDIO_CHANNEL_OUT_STEREO
76# formats AUDIO_FORMAT_PCM_16_BIT
77# devices <device name>
78# flags AUDIO_OUTPUT_FLAG_PRIMARY
79# }
80# }
81# sample audio_policy.conf file below
82
83audio_hw_modules {
84 primary {
85 global_configuration {
86 attached_output_devices AUDIO_DEVICE_OUT_SPEAKER
87 default_output_device AUDIO_DEVICE_OUT_SPEAKER
88 attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC
89 audio_hal_version 3.0
90 }
91 devices {
92 speaker {
93 type AUDIO_DEVICE_OUT_SPEAKER
94 gains {
95 gain_1 {
96 mode AUDIO_GAIN_MODE_JOINT
97 min_value_mB -8400
98 max_value_mB 4000
99 default_value_mB 0
100 step_value_mB 100
101 }
102 }
103 }
104 }
105 outputs {
106 primary {
107 sampling_rates 48000
108 channel_masks AUDIO_CHANNEL_OUT_STEREO
109 formats AUDIO_FORMAT_PCM_16_BIT
110 devices speaker
111 flags AUDIO_OUTPUT_FLAG_PRIMARY
112 }
113 }
114 inputs {
115 primary {
116 sampling_rates 8000|16000
117 channel_masks AUDIO_CHANNEL_IN_MONO
118 formats AUDIO_FORMAT_PCM_16_BIT
119 devices AUDIO_DEVICE_IN_BUILTIN_MIC
120 }
121 }
122 }
123 r_submix {
124 global_configuration {
125 attached_input_devices AUDIO_DEVICE_IN_REMOTE_SUBMIX
126 audio_hal_version 2.0
127 }
128 outputs {
129 submix {
130 sampling_rates 48000
131 channel_masks AUDIO_CHANNEL_OUT_STEREO
132 formats AUDIO_FORMAT_PCM_16_BIT
133 devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX
134 }
135 }
136 inputs {
137 submix {
138 sampling_rates 48000
139 channel_masks AUDIO_CHANNEL_IN_STEREO
140 formats AUDIO_FORMAT_PCM_16_BIT
141 devices AUDIO_DEVICE_IN_REMOTE_SUBMIX
142 }
143 }
144 }
145}