1CRAS dbus methods and signals. 2============================== 3 4Service org.chromium.cras 5Interface org.chromium.cras.Control 6Object Path /org/chromium/cras 7 8Methods void SetOutputVolume(int32 volume) 9 10 Sets the volume of the system. Volume ranges from 11 0 to 100, and will be translated to dB based on the 12 output-specific volume curve. 13 14 void SetOutputNodeVolume(uint64 node_id, int32 volume) 15 16 Sets the volume of the given node. Volume ranges from 17 0 to 100, and will be translated to dB based on the 18 output-specific volume curve. 19 20 void SwapLeftRight(uint64 node_id, boolean swap) 21 22 Swap the left and right channel of the given node. 23 Message will be dropped if this feature is not supported. 24 25 void SetOutputMute(boolean mute_on) 26 27 Sets the system output mute. 28 29 void SetOutputUserMute(boolean mute_on) 30 31 Sets the system output mute from user action. 32 33 void SetInputGain(int32 gain) 34 35 Sets the capture gain of the system. Gain is specified 36 in dBFS * 100. For example 5dB of gain would be 37 specified with an argument of 500, while -10 would be 38 specified with -1000, and 11.5 maps to 1150. 39 40 void SetInputNodeGain(uint64 node_id, int32 gain) 41 42 Sets the capture gain of the node. Gain is specified 43 in dBFS * 100. For example 5dB of gain would be 44 specified with an argument of 500, while -10 would be 45 specified with -1000, and 11.5 maps to 1150. 46 47 void SetInputMute(boolean mute_on) 48 49 Sets the capture mute state of the system. Recordings 50 will be muted when this is set. 51 52 void GetVolumeState() 53 54 Returns the volume and capture gain as follows: 55 int32 output_volume (0-100) 56 boolean output_mute 57 int32 input_gain (in dBFS * 100) 58 boolean input_mute 59 boolean output_user_mute 60 61 void GetDefaultOutputBufferSize() 62 63 Returns the default output buffer size in frames. 64 65 {dict},{dict},... GetNodes() 66 67 Returns information about nodes. A node can be either 68 output or input but not both. An output node is 69 something like a speaker or a headphone, and an input 70 node is like a microphone. The return value is a 71 sequence of dicts mapping from strings to variants 72 (e.g. signature "a{sv}a{sv}" for two nodes). Each dict 73 contains information about a node. 74 75 Each dict contains the following properties: 76 boolean IsInput 77 false for output nodes, true for input 78 nodes. 79 uint64 Id 80 The id of this node. It is unique among 81 all nodes including both output and 82 input nodes. 83 string Type 84 The type of this node. It can be one of 85 following values: 86 /* for output nodes. */ 87 "INTERNAL_SPEAKER","HEADPHONE", "HDMI", 88 /* for input nodes. */ 89 "INTERNAL_MIC", "MIC", 90 /* for both output and input nodes. */ 91 "USB", "BLUETOOTH", "UNKNOWN", 92 string Name 93 The name of this node. For example, 94 "Speaker" or "Internal Mic". 95 string DeviceName 96 The name of the device that this node 97 belongs to. For example, 98 "HDA Intel PCH: CA0132 Analog:0,0" or 99 "Creative SB Arena Headset". 100 uint64 StableDeviceId 101 The stable ID does not change due to 102 device plug/unplug or reboot. 103 uint64 StableDeviceIdNew 104 The new stable ID. Keeping both stable 105 ID and stable ID new is for backward 106 compatibility. 107 boolean Active 108 Whether this node is currently used 109 for output/input. There is one active 110 node for output and one active node for 111 input. 112 uint64 PluggedTime 113 The time that this device was plugged 114 in. This value is in microseconds. 115 string MicPositions 116 The string formed by floating numbers 117 describing the position of mic array. 118 unit64 NodeVolume 119 The node volume indexed from 0 to 100. 120 unit64 NodeCaptureGain 121 The capture gain of node in dBFS * 100. 122 string HotwordModels 123 A string of comma-separated hotword 124 language model locales supported by this 125 node. e.g. "en_au,en_gb,en_us" 126 The string is empty if the node type is 127 not HOTWORD. 128 129 void GetSystemAecSupported(); 130 131 Returns 1 if system echo cancellation is supported, 132 otherwise return 0. 133 134 void SetActiveOutputNode(uint64 node_id); 135 136 Requests the specified node to be used for 137 output. If node_id is 0 (which is not a valid 138 node id), cras will choose the active node 139 automatically. 140 141 void SetActiveInputNode(uint64 node_id); 142 143 Requests the specified node to be used for 144 input. If node_id is 0 (which is not a valid 145 node id), cras will choose the active node 146 automatically. 147 148 int32 GetNumberOfActiveStreams() 149 150 Returns the number of streams currently being 151 played or recorded. 152 153 int32 GetNumberOfActiveInputStreams() 154 155 Returns the number of streams currently using input hardware. 156 157 int32 GetNumberOfActiveOutputStreams() 158 159 Returns the number of streams currently using output hardware. 160 161 int32 IsAudioOutputActive() 162 163 Returns 1 if there are currently any active output streams, 164 excluding 'dummy' streams that are not actually outputting any 165 audio. Returns 0 if there are no active streams, or all active 166 streams are 'dummy' streams. 167 168 void SetGlobalOutputChannelRemix(int32 num_channels, 169 array:double coefficient) 170 171 Sets the conversion matrix for global output channel 172 remixing. The coefficient array represents an N * N 173 conversion matrix M, where N is num_channels, with 174 M[i][j] = coefficient[i * N + j]. 175 The remix is done by multiplying the conversion matrix 176 to each N-channel PCM data, i.e M * [L, R] = [L', R'] 177 For example, coefficient [0.1, 0.9, 0.4, 0.6] will 178 result in: 179 L' = 0.1 * L + 0.9 * R 180 R' = 0.4 * L + 0.6 * R 181 182 int32 SetHotwordModel(uint64_t node_id, string model_name) 183 184 Set the hotword language model on the specified node. 185 The node must have type HOTWORD and the model_name must 186 be one of the supported locales returned by 187 GetNodes() HotwordModels string. 188 Returns 0 on success, or a negative errno on failure. 189 190Signals OutputVolumeChanged(int32 volume) 191 192 Indicates that the output volume level has changed. 193 194 OutputMuteChanged(boolean muted, boolean user_muted) 195 196 Indicates that the output mute state has changed. muted 197 is true if the system is muted by a system process, such 198 as suspend or device switch. user_muted is set if the 199 system has been muted by user action such as the mute 200 key. 201 202 InputGainChanged(int32 gain) 203 204 Indicates what the system capture gain is now. gain 205 expressed in dBFS*100. 206 207 InputMuteChanged(boolean muted) 208 209 Indicates that the input mute state has changed. 210 211 NodesChanged() 212 213 Indicates that nodes are added/removed. 214 215 ActiveOutputNodeChanged(uint64 node_id) 216 217 Indicates that the active output node has changed. 218 219 ActiveInputNodeChanged(uint64 node_id) 220 221 Indicates that the active input node has changed. 222 223 OutputNodeVolumeChanged(uint64 node_id, int32 volume) 224 225 Indicates the volume of the given node. 226 227 NodeLeftRightSwappedChanged(uint64 node_id, boolean swapped) 228 229 Indicates the left and right channel swapping state of the 230 given node. 231 232 InputNodeGainChanged(uint64 node_id, int32 gain) 233 234 Indicates that the capture gain for the node is now gain 235 expressed in dBFS*100. 236 237 NumberOfActiveStreamsChanged(int32 num_active_streams) 238 239 Indicates the number of active streams has changed. 240 241 AudioOutputActiveStateChanged(boolean active) 242 243 Indicates active output state has changed. 244 See IsAudioOutputActive for details. 245 246 HotwordTriggered(int64 tv_sec, int64 tv_nsec) 247 248 Indicates that hotword was triggered at the given timestamp. 249