bluetooth: add wideband audio codec negotiation to HFP

The HFP protocol supports the ability to negotiate codecs if that is
supported by both AG and HF.  This patch adds advertising of codec
negotiation support and the ability to negotiate a codec change.  The
only currently supported extra codec (as of HF 1.7.1) is mSBC.  mSBC
requires that the transmission be done over an eSCO link with
Transparent Data.  The linux kernel ensures the former, but we have to
manually set the socket to transparent data.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/507>
This commit is contained in:
James Bottomley 2021-02-17 09:44:35 +03:00 committed by PulseAudio Marge Bot
parent f22cfa8f81
commit 4444ecad6f
3 changed files with 72 additions and 5 deletions

View file

@ -219,6 +219,7 @@ static int card_acquire(struct hf_audio_card *card) {
return -1;
}
card->transport->bt_codec = pa_bluetooth_get_hf_codec("CVSD");
card->transport->setsockopt = NULL;
card->fd = fd;
return 0;
}
@ -687,6 +688,7 @@ static DBusMessage *hf_audio_agent_new_connection(DBusConnection *c, DBusMessage
card->connecting = false;
card->fd = fd;
card->transport->bt_codec = pa_bluetooth_get_hf_codec("CVSD");
card->transport->setsockopt = NULL;
pa_bluetooth_transport_set_state(card->transport, PA_BLUETOOTH_TRANSPORT_STATE_PLAYING);