Re: Changed default configuration in bluez 4.97 and higher?

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

 



Hi Karol,

On Thu, Jan 26, 2012 at 6:22 PM, Karol Babioch <karol@xxxxxxxxxx> wrote:
> Hi,
>
> Am 26.01.2012 16:17, schrieb Luiz Augusto von Dentz:
>> can you check if you get
>> anything on bluetoothd logs like this:
>
> I'm attaching my logs (with -d enabled) here. Hopefully they are not too
> long. As you can see, the discovery works just fine, but I can't see any
> registration of an endpoint, like you proposed.

Thanks for the log, Ive figure out the problem, here is a patch that
might fix it (also attached):

diff --git a/audio/a2dp.c b/audio/a2dp.c
index c4cdc62..2eebe6b 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
@@ -1441,9 +1441,9 @@ static struct a2dp_server *find_server(GSList
*list, const bdaddr_t *src)

 int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config)
 {
-       int sbc_srcs = 1, sbc_sinks = 1;
+       int sbc_srcs = 0, sbc_sinks = 0;
        int mpeg12_srcs = 0, mpeg12_sinks = 0;
-       gboolean source = TRUE, sink = FALSE, socket = TRUE;
+       gboolean source = TRUE, sink = FALSE, socket = FALSE;
        gboolean delay_reporting = FALSE;
        char *str;
        GError *err = NULL;
@@ -1463,6 +1463,8 @@ int a2dp_register(DBusConnection *conn, const
bdaddr_t *src, GKeyFile *config)
                        source = TRUE;
                if (strstr(str, "Source"))
                        sink = TRUE;
+               if (strstr(str, "Socket"))
+                       socket = TRUE;
                g_free(str);
        }

@@ -1482,18 +1484,14 @@ int a2dp_register(DBusConnection *conn, const
bdaddr_t *src, GKeyFile *config)
        }

        /* Don't register any local sep if Socket is disabled */
-       if (socket == FALSE) {
-               sbc_srcs = 0;
-               sbc_sinks = 0;
-               mpeg12_srcs = 0;
-               mpeg12_sinks = 0;
:

Basically the problem is that the code is assuming that Socket is
enabled by default which is not true anymore.

-- 
Luiz Augusto von Dentz
diff --git a/audio/a2dp.c b/audio/a2dp.c
index c4cdc62..2eebe6b 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
@@ -1441,9 +1441,9 @@ static struct a2dp_server *find_server(GSList *list, const bdaddr_t *src)
 
 int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config)
 {
-	int sbc_srcs = 1, sbc_sinks = 1;
+	int sbc_srcs = 0, sbc_sinks = 0;
 	int mpeg12_srcs = 0, mpeg12_sinks = 0;
-	gboolean source = TRUE, sink = FALSE, socket = TRUE;
+	gboolean source = TRUE, sink = FALSE, socket = FALSE;
 	gboolean delay_reporting = FALSE;
 	char *str;
 	GError *err = NULL;
@@ -1463,6 +1463,8 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config)
 			source = TRUE;
 		if (strstr(str, "Source"))
 			sink = TRUE;
+		if (strstr(str, "Socket"))
+			socket = TRUE;
 		g_free(str);
 	}
 
@@ -1482,18 +1484,14 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config)
 	}
 
 	/* Don't register any local sep if Socket is disabled */
-	if (socket == FALSE) {
-		sbc_srcs = 0;
-		sbc_sinks = 0;
-		mpeg12_srcs = 0;
-		mpeg12_sinks = 0;
+	if (socket == FALSE)
 		goto proceed;
-	}
 
 	str = g_key_file_get_string(config, "A2DP", "SBCSources", &err);
 	if (err) {
 		DBG("audio.conf: %s", err->message);
 		g_clear_error(&err);
+		sbc_srcs = 1;
 	} else {
 		sbc_srcs = atoi(str);
 		g_free(str);
@@ -1512,6 +1510,7 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config)
 	if (err) {
 		DBG("audio.conf: %s", err->message);
 		g_clear_error(&err);
+		sbc_sinks = 1;
 	} else {
 		sbc_sinks = atoi(str);
 		g_free(str);

[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