* [PATCH] audio: permit concurrent use of AG and HF roles
@ 2012-06-22 14:11 Frédéric Dalleau
2012-06-28 10:09 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Frédéric Dalleau @ 2012-06-22 14:11 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Frédéric Dalleau
If a device supports both HF and AG roles, then if a SCO connection related
to AG profile happens, the connection is rejected because HF is not connected.
One consequence is pulseaudio failing to load bluetooth module.
---
audio/main.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/audio/main.c b/audio/main.c
index 5c751af..a48c8b8 100644
--- a/audio/main.c
+++ b/audio/main.c
@@ -102,7 +102,7 @@ static void sco_server_cb(GIOChannel *chan, GError *err, gpointer data)
if (device->headset) {
if (headset_get_state(device) < HEADSET_STATE_CONNECTED) {
DBG("Refusing SCO from non-connected headset");
- goto drop;
+ goto gateway;
}
if (!headset_get_hfp_active(device)) {
@@ -115,7 +115,11 @@ static void sco_server_cb(GIOChannel *chan, GError *err, gpointer data)
goto drop;
headset_set_state(device, HEADSET_STATE_PLAYING);
- } else if (device->gateway) {
+ goto connect;
+ }
+
+gateway:
+ if (device->gateway) {
if (!gateway_is_connected(device)) {
DBG("Refusing SCO from non-connected AG");
goto drop;
@@ -126,6 +130,7 @@ static void sco_server_cb(GIOChannel *chan, GError *err, gpointer data)
} else
goto drop;
+connect:
sk = g_io_channel_unix_get_fd(chan);
fcntl(sk, F_SETFL, 0);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] audio: permit concurrent use of AG and HF roles
2012-06-22 14:11 [PATCH] audio: permit concurrent use of AG and HF roles Frédéric Dalleau
@ 2012-06-28 10:09 ` Johan Hedberg
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2012-06-28 10:09 UTC (permalink / raw)
To: Frédéric Dalleau; +Cc: linux-bluetooth
Hi Frédéric,
On Fri, Jun 22, 2012, Frédéric Dalleau wrote:
> If a device supports both HF and AG roles, then if a SCO connection related
> to AG profile happens, the connection is rejected because HF is not connected.
> One consequence is pulseaudio failing to load bluetooth module.
> ---
> audio/main.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
Applied, thanks (after fixing your commit message width to stay at max
72 chars).
Johan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-28 10:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-22 14:11 [PATCH] audio: permit concurrent use of AG and HF roles Frédéric Dalleau
2012-06-28 10:09 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).