module-bluetooth-device defaults to the hsp profile and when using
module-bluetooth-discover there does not seem to be a way to tell it to
use the a2dp profile(at least without sending commands to change it
which defeats the automatic nature of module-bluetooth-discover).
   This patch adds the profile argument to module-bluetooth-discover
which is then passed on to each instance of module-bluetooth-device that
it creates.
   This patch allows me to use bluetooth headphones with my media center
without requiring any user interaction to configure them after being
turned on.

Thank You,
    Jess Haas
diff -urN pulseaudio-1.99.2.orig/src/modules/bluetooth/module-bluetooth-discover.c pulseaudio-1.99.2/src/modules/bluetooth/module-bluetooth-discover.c
--- pulseaudio-1.99.2.orig/src/modules/bluetooth/module-bluetooth-discover.c	2012-04-18 23:45:29.596474789 -0700
+++ pulseaudio-1.99.2/src/modules/bluetooth/module-bluetooth-discover.c	2012-04-19 00:10:32.264456163 -0700
@@ -42,13 +42,15 @@
 PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_USAGE("async=<Asynchronous initialization?> "
                 "sco_sink=<name of sink> "
-                "sco_source=<name of source> ");
+                "sco_source=<name of source> "
+		"profile=<a2dp|hsp|hfgw> ");
 PA_MODULE_LOAD_ONCE(TRUE);
 
 static const char* const valid_modargs[] = {
     "sco_sink",
     "sco_source",
     "async",
+    "profile",
     NULL
 };
 
@@ -107,11 +109,12 @@
                 args = tmp;
             }
 
-            if (d->audio_source_state >= PA_BT_AUDIO_STATE_CONNECTED)
-                args = pa_sprintf_malloc("%s profile=\"a2dp_source\" auto_connect=no", args);
-
-            if (d->hfgw_state >= PA_BT_AUDIO_STATE_CONNECTED)
+	    if (pa_modargs_get_value(u->modargs, "profile", NULL)) 
+		args = pa_sprintf_malloc("%s profile=\"%s\"", args, pa_modargs_get_value(u->modargs, "profile", NULL));
+            else if (d->hfgw_state >= PA_BT_AUDIO_STATE_CONNECTED)
                 args = pa_sprintf_malloc("%s profile=\"hfgw\"", args);
+            else if (d->audio_source_state >= PA_BT_AUDIO_STATE_CONNECTED)
+                args = pa_sprintf_malloc("%s profile=\"a2dp_source\" auto_connect=no", args);
 
             pa_log_debug("Loading module-bluetooth-device %s", args);
             m = pa_module_load(u->module->core, "module-bluetooth-device", args);
_______________________________________________
pulseaudio-discuss mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Reply via email to