Hi Vinicius, On 08/15/2013 09:26 PM, Vinicius Costa Gomes wrote: > In the AG case, the voice setting needs to be set before we can > use Transparent SCO mode, which is necessary for Wideband speech > support. > --- > src/handsfree-audio.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c > index c83086f..d550e6e 100644 > --- a/src/handsfree-audio.c > +++ b/src/handsfree-audio.c > @@ -442,6 +442,7 @@ int ofono_handsfree_card_connect_sco(struct ofono_handsfree_card *card) > { > GIOChannel *io; > struct sockaddr_sco addr; > + struct bt_voice voice; > int sk, ret; > > sk = socket(PF_BLUETOOTH, SOCK_SEQPACKET | O_NONBLOCK | SOCK_CLOEXEC, > @@ -465,6 +466,13 @@ int ofono_handsfree_card_connect_sco(struct ofono_handsfree_card *card) > addr.sco_family = AF_BLUETOOTH; > bt_str2ba(card->remote, &addr.sco_bdaddr); > > + memset(&voice, 0, sizeof(voice)); > + voice.setting = codec2setting(card->selected_codec); > + > + if (setsockopt(sk, SOL_BLUETOOTH, BT_VOICE, &voice, sizeof(voice)) < 0) > + ofono_error("Can't set voice settings: %s (%d)", > + strerror(errno), errno); > + Same comment here as for patch 2. - If we fail to set BT_VOICE and our kernel does not support it, then printing an error is superfluous. - If we indeed try to set wideband codec and fail, then continuing with the connection is kinda bad. > ret = connect(sk, (struct sockaddr *) &addr, sizeof(addr)); > if (ret < 0 && errno != EINPROGRESS) { > close(sk); > Regards, -Denis