bluetooth: Add no volume control quirk for Thinkplus XT99

When this headset works in HFP/HSP profile, the input/output volume
adjustment doesn't work if the headset is playing sth or capturing
sth. Through the btmon log, we could see "+VGS" and "+VGM" were sent
to headset and headset replied "command success", but the volume was
not changed.

It is something like once the SCO connecton is built, the volume
couldn't be changed by "+VGS" and "+VGM" commands. Here add a quirk
for this headset, skip to set set_sink_volume and set_source_volume,
after this change, the pulseaudio will apply the software volume
adjustment to this headset in the HFP/HSP mode. This change doesn't
impact A2DP volume adjustment for this headset.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
This commit is contained in:
Hui Wang 2024-04-06 18:40:27 +08:00
parent 6c77b0191a
commit 68f1107bd2
3 changed files with 31 additions and 2 deletions

View file

@ -917,7 +917,7 @@ static void rfcomm_io_callback(pa_mainloop_api *io, pa_io_event *e, int fd, pa_i
* RING: Sent by AG to HS to notify of an incoming call. It can safely be ignored because
* it does not expect a reply. */
if (sscanf(buf, "AT+VGS=%d", &gain) == 1 || sscanf(buf, "\r\n+VGM%*[=:]%d\r\n", &gain) == 1) {
if (!t->set_sink_volume) {
if (!t->set_sink_volume && !(t->device->quirk & PA_BLUETOOTH_QUIRK_NO_VOLUME_CTL)) {
pa_log_debug("HS/HF peer supports speaker gain control");
t->set_sink_volume = set_sink_volume;
}
@ -927,7 +927,7 @@ static void rfcomm_io_callback(pa_mainloop_api *io, pa_io_event *e, int fd, pa_i
do_reply = true;
} else if (sscanf(buf, "AT+VGM=%d", &gain) == 1 || sscanf(buf, "\r\n+VGS%*[=:]%d\r\n", &gain) == 1) {
if (!t->set_source_volume) {
if (!t->set_source_volume && !(t->device->quirk & PA_BLUETOOTH_QUIRK_NO_VOLUME_CTL)) {
pa_log_debug("HS/HF peer supports microphone gain control");
t->set_source_volume = set_source_volume;
}