You can set the LDAC quality between High, Standard, and Mobile quality, corresponding to 990/660/330 kbps. You can do it either statically or dynamically.
Static Configuration
Place the following configuration in ~/.config/wireplumber/wireplumber.conf.d/10-bluez.conf
:
monitor.bluez.rules = [
{
matches = [
{
## This matches all Bluetooth devices.
device.name = "~bluez_card.*"
}
]
actions = {
update-props = {
bluez5.a2dp.ldac.quality = "sq"
}
}
}
]
The value of quality
can be set to either hq
, sq
, mq
, or auto
.
You can also change the match fragment to match only a specific device. Use the following command to list all currently available devices:
$ pw-cli ls | grep device.name
After changing the configuration, you’ll have to restart WirePlumber:
$ systemctl --user restart wireplumber
Dynamic Configuration
This method is less user-friendly. The first step is to find the id
of the relevant output node. You can do this by examining the output of pw-cli ls
or wpctl status
. Make sure you pick the id of the corresponding node and not the device. Next, use pw-cli set-param
to set the quality, for example:
$ pw-cli set-param 93 Props '{quality=0}'
Object: size 32, type Spa:Pod:Object:Param:Props (262146), id Spa:Enum:ParamId:Props (2)
Prop: key Spa:Pod:Object:Param:Props:quality (269), flags 00000000
Int 0
Where 93 is our node id, and 0 corresponds to hq
quality. Other possible values are: -1 for auto
, 0 for hq
, 1 for sq
, and 2 for mq
.
Empirically Verifying Bitrate
You can deduce the actual bitrate by sniffing the Bluetooth traffic and analyzing the capture using Wireshark.
$ sudo btmon -w btsnoop.log
$ wireshark btsnoop.log
In Wireshark, go to Statistics -> Capture File Properties, and there you can see the average bits/s and compare it to the bitrate of the expected quality setting.