Skip to content

Commit 7d109cd

Browse files
committed
update bluealsactl manual for volume changes
Documents multi-channel volume management, and also adds extra detail to the codec command documentation.
1 parent e9da8aa commit 7d109cd

File tree

1 file changed

+62
-16
lines changed

1 file changed

+62
-16
lines changed

doc/bluealsactl.1.rst

+62-16
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,45 @@ list-pcms
8282
info *PCM_PATH*
8383
Print the properties and available codecs of the given PCM.
8484
The properties are printed one per line, in the format
85-
'PropertyName: Value'. Values are presented in human-readable format - for
86-
example the Volume property is printed as:
85+
"PropertyName: Value". Values are presented in human-readable format, and
86+
for a property with multiple values they are printed as a space-separated
87+
list.
88+
89+
The Volume property is presented as two lines; "Volume:" indicating
90+
the loudness component of each channel and "Mute:" indicating the mute
91+
component of each channel. Both components are presented with their channel
92+
values in the same order as the ChannelMap. For example:
93+
::
94+
95+
ChannelMap: FC FL FR RL RR LFE
96+
Volume: 127 127 127 127 127 127
97+
Mute: off off off off off off
98+
99+
If the **--verbose** option is given then "Available codecs:" values include
100+
the codec capabilities as a hexadecimal string suffix, separated by a colon.
101+
Similarly, the "Selected codec:" value includes the current codec
102+
configuration as a hexadecimal string separated by a colon. For example:
103+
::
87104

88-
``Volume: 127 127``
105+
Available codecs: SBC:ffff02fa AAC:c0ffff035b60
106+
Selected codec: AAC:400084035b60
107+
108+
A tool such as ``a2dpconf`` can be used to decode the hex string.
89109

90110
The list of available A2DP codecs requires BlueZ SEP support
91111
(BlueZ >= 5.52)
92112

93113
codec [-c NUM] [-r NUM] [--force] *PCM_PATH* [*CODEC*\ [:*CONFIG*]]
94114
Get or set the Bluetooth codec used by the given PCM.
95115

116+
If *CODEC* is not given, print a list of additional codecs supported by the
117+
given PCM and the currently selected codec. With the option **--verbose**
118+
the codec capabilities and current configuration are shown in the same
119+
format as for the **info** command.
120+
96121
If *CODEC* is given, change the codec to be used by the given PCM. This
97122
command will terminate the PCM if it is currently running.
98123

99-
If *CODEC* is not given, print a list of additional codecs supported by the
100-
given PCM and the currently selected codec. The level of detail in the
101-
output depends on the verbosity level.
102-
103124
Optionally, for A2DP codecs, one can specify A2DP codec configuration which
104125
should be selected. The *CONFIG* shall be given as a hexadecimal string. If
105126
this parameter is omitted, BlueALSA will select default configuration based
@@ -112,6 +133,16 @@ codec [-c NUM] [-r NUM] [--force] *PCM_PATH* [*CODEC*\ [:*CONFIG*]]
112133
the configuration. However, this may result in a non-working connection and
113134
in the worst case it may crash remote Bluetooth device!
114135

136+
The options **-c NUM** and **-r ~NUM** may be used to select a specific
137+
channel count and/or sample rate, provided that the given values are
138+
supported by the codec. For example, if the device at path PCM_PATH
139+
supports 5.1 surround sound and 96000 rate with the AAC codec, but is
140+
currently configured as AAC with stereo at 48000, then the configuration
141+
can be changed with:
142+
::
143+
144+
bluealsactl codec -c6 -r96000 PCM_PATH aac
145+
115146
Selecting an A2DP codec and listing available A2DP codecs requires BlueZ
116147
SEP support (BlueZ >= 5.52).
117148

@@ -123,23 +154,31 @@ codec [-c NUM] [-r NUM] [--force] *PCM_PATH* [*CODEC*\ [:*CONFIG*]]
123154
Selecting the HFP codec when using oFono is not supported.
124155

125156
volume *PCM_PATH* [*VOLUME* [*VOLUME*]...]
126-
Get or set the volume value of the given PCM.
157+
Get or set the volume loudness value(s) of the given PCM.
127158

128159
If *VOLUME* is given, set the loudness component of the volume property of
129160
the given PCM.
130161

131162
If only one value *VOLUME* is given it is applied to all channels.
132-
For stereo (2-channel) PCMs the first value *VOLUME* is applied to channel
133-
1 (Left), and the second value *VOLUME* is applied to channel 2 (Right).
163+
164+
For multi-channel PCMs, if multiple *VOLUME* values are given, then each
165+
given value is applied to the corresponding channel of the ChannelMap (see
166+
the **info** command). If the number of values given is less than the
167+
number of channels, then the remaining channels are set to the first given
168+
value.
134169

135170
Valid A2DP values for *VOLUME* are 0-127, valid HFP/HSP values are 0-15.
136171

172+
Note that A2DP does not support independent channel volumes, so such a
173+
setting is better suited to use with soft-volume enabled. See
174+
``bluealsad(8)`` for more details.
175+
137176
mute *PCM_PATH* [*STATE* [*STATE*]...]
138177
Get or set the mute switch of the given PCM.
139178

140179
If *STATE* argument(s) are given, set mute component of the volume property
141-
of the given PCM. The second *STATE* argument is used for stereo PCMs as
142-
described for the **volume** command.
180+
of the given PCM. Multiple *STATE* arguments are used for multi-channel
181+
PCMs as described for the **volume** command.
143182

144183
The *STATE* value can be one of **on**, **yes**, **true**, **y** or **1**
145184
for mute on, or **off**, **no**, **false**, **n** or **0** for mute off.
@@ -207,12 +246,19 @@ monitor [-p[PROPS] | --properties[=PROPS]]
207246

208247
``PropertyChanged PCM_PATH PROPERTY_NAME VALUE``
209248

210-
Property names than can be monitored are **Codec**, **Running**,
249+
Property names that can be monitored are **Codec**, **Running**,
211250
**SoftVolume** and **Volume**.
212251

213-
The value for Volume is a hexadecimal 16-bit encoding where data for
214-
channel 1 is stored in the upper byte, channel 2 is stored in the lower
215-
byte. The highest bit of both bytes determines whether channel is muted.
252+
Volume is an array of values, each showing the loudness and mute components
253+
of a channel. The order of the values corresponds to the ChannelMap
254+
property (see the **info** command). The loudness is shown as a decimal
255+
integer value, with an optional suffix ``[M]`` indicating that the channel
256+
is muted. For example, for a 2-channel (stereo) A2DP PCM at path PCM_PATH
257+
with both channels at full volume and the right channel muted, the event
258+
would be displayed as:
259+
::
260+
261+
PropertyChanged PCM_PATH Volume 127 127[M]
216262

217263
*PROPS* is an optional comma-separated list of property names to be
218264
monitored. If given, only changes to those properties listed will be

0 commit comments

Comments
 (0)