[PATCH] Fix not calling SetConfiguration on hfp/hsp endpoints before connected

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.dentz-von@xxxxxxxxx>

This cause some clients like PulseAudio to fail to find a proper
transport since connected state is send before transport configuration
is set.

To fix this now SetConfiguration is called early on when headset is still
in connecting phase, this matches sink/source where SetConfiguration is
also called before connected.
---
 audio/media.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/audio/media.c b/audio/media.c
index 0e6ccc9..b28bb33 100644
--- a/audio/media.c
+++ b/audio/media.c
@@ -151,16 +151,13 @@ static void headset_state_changed(struct audio_device *dev,
 
 	switch (new_state) {
 	case HEADSET_STATE_DISCONNECTED:
-		if (old_state != HEADSET_STATE_CONNECTING)
-			media_endpoint_clear_configuration(endpoint);
+		media_endpoint_clear_configuration(endpoint);
+		break;
 	case HEADSET_STATE_CONNECTING:
+		media_endpoint_set_configuration(endpoint, dev, NULL, 0,
+						headset_setconf_cb, dev);
 		break;
 	case HEADSET_STATE_CONNECTED:
-		if (old_state != HEADSET_STATE_PLAY_IN_PROGRESS &&
-				old_state != HEADSET_STATE_PLAYING)
-			media_endpoint_set_configuration(endpoint, dev, NULL,
-							0, headset_setconf_cb,
-									dev);
 		break;
 	case HEADSET_STATE_PLAY_IN_PROGRESS:
 		break;
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux