Home | History | Annotate | Download | only in cras
      1 CRAS dbus methods and signals.
      2 ==============================
      3 
      4 Service		org.chromium.cras
      5 Interface	org.chromium.cras.Control
      6 Object Path	/org/chromium/cras
      7 
      8 Methods		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 				string HotwordModels
    119 					A string of comma-separated hotword
    120 					language model locales supported by this
    121 					node. e.g. "en_au,en_gb,en_us"
    122 					The string is empty if the node type is
    123 					not HOTWORD.
    124 
    125 		void GetSystemAecSupported();
    126 
    127 			Returns 1 if system echo cancellation is supported,
    128 			otherwise return 0.
    129 
    130 		void SetActiveOutputNode(uint64 node_id);
    131 
    132 			Requests the specified node to be used for
    133 			output. If node_id is 0 (which is not a valid
    134 			node id), cras will choose the active node
    135 			automatically.
    136 
    137 		void SetActiveInputNode(uint64 node_id);
    138 
    139 			Requests the specified node to be used for
    140 			input. If node_id is 0 (which is not a valid
    141 			node id), cras will choose the active node
    142 			automatically.
    143 
    144 		int32 GetNumberOfActiveStreams()
    145 
    146 			Returns the number of streams currently being
    147 			played or recorded.
    148 
    149 		int32 GetNumberOfActiveInputStreams()
    150 
    151 			Returns the number of streams currently using input hardware.
    152 
    153 		int32 GetNumberOfActiveOutputStreams()
    154 
    155 			Returns the number of streams currently using output hardware.
    156 
    157 		int32 IsAudioOutputActive()
    158 
    159 			Returns 1 if there are currently any active output streams,
    160 			excluding 'dummy' streams that are not actually outputting any
    161 			audio. Returns 0 if there are no active streams, or all active
    162 			streams are 'dummy' streams.
    163 
    164 		void SetGlobalOutputChannelRemix(int32 num_channels,
    165 						 array:double coefficient)
    166 
    167 			Sets the conversion matrix for global output channel
    168 			remixing. The coefficient array represents an N * N
    169 			conversion matrix M, where N is num_channels, with
    170 			M[i][j] = coefficient[i * N + j].
    171 			The remix is done by multiplying the conversion matrix
    172 			to each N-channel PCM data, i.e M * [L, R] = [L', R']
    173 			For example, coefficient [0.1, 0.9, 0.4, 0.6] will
    174 			result in:
    175 			L' = 0.1 * L + 0.9 * R
    176 			R' = 0.4 * L + 0.6 * R
    177 
    178 		int32 SetHotwordModel(uint64_t node_id, string model_name)
    179 
    180 			Set the hotword language model on the specified node.
    181 			The node must have type HOTWORD and the model_name must
    182 			be one of the supported locales returned by
    183 			GetNodes() HotwordModels string.
    184 			Returns 0 on success, or a negative errno on failure.
    185 
    186 Signals		OutputVolumeChanged(int32 volume)
    187 
    188 			Indicates that the output volume level has changed.
    189 
    190 		OutputMuteChanged(boolean muted, boolean user_muted)
    191 
    192 			Indicates that the output mute state has changed.  muted
    193 			is true if the system is muted by a system process, such
    194 			as suspend or device switch.  user_muted is set if the
    195 			system has been muted by user action such as the mute
    196 			key.
    197 
    198 		InputGainChanged(int32 gain)
    199 
    200 			Indicates what the system capture gain is now. gain
    201 			expressed in dBFS*100.
    202 
    203 		InputMuteChanged(boolean muted)
    204 
    205 			Indicates that the input mute state has changed.
    206 
    207 		NodesChanged()
    208 
    209 			Indicates that nodes are added/removed.
    210 
    211 		ActiveOutputNodeChanged(uint64 node_id)
    212 
    213 			Indicates that the active output node has changed.
    214 
    215 		ActiveInputNodeChanged(uint64 node_id)
    216 
    217 			Indicates that the active input node has changed.
    218 
    219 		OutputNodeVolumeChanged(uint64 node_id, int32 volume)
    220 
    221 			Indicates the volume of the given node.
    222 
    223 		NodeLeftRightSwappedChanged(uint64 node_id, boolean swapped)
    224 
    225 			Indicates the left and right channel swapping state of the
    226 			given node.
    227 
    228 		InputNodeGainChanged(uint64 node_id, int32 gain)
    229 
    230 			Indicates that the capture gain for the node is now gain
    231 			expressed in dBFS*100.
    232 
    233 		NumberOfActiveStreamsChanged(int32 num_active_streams)
    234 
    235 			Indicates the number of active streams has changed.
    236 
    237 		AudioOutputActiveStateChanged(boolean active)
    238 
    239 			Indicates active output state has changed.
    240 			See IsAudioOutputActive for details.
    241 
    242 		HotwordTriggered(int64 tv_sec, int64 tv_nsec)
    243 
    244 			Indicates that hotword was triggered at the given timestamp.
    245