[meego-commits] 15410: Changes to devel:multimedia/pulseaudio

Vivian Zhang no_reply at build.meego.com
Tue Mar 29 06:36:54 UTC 2011


Hi,
I have made the following changes to pulseaudio in project devel:multimedia. Please review and accept ASAP.

Thank You,
Vivian Zhang

[This message was auto-generated]

---

Request #15410:

  submit:   home:vivian:branches:devel:multimedia/pulseaudio(r7)(cleanup) -> devel:multimedia/pulseaudio


Message:
    Add hfgw profile support in bluetooth module (BMC #12649)

State:   new          2011-03-28T23:36:49 vivian
Comment: None



changes files:
--------------
--- pulseaudio.changes
+++ pulseaudio.changes
@@ -0,0 +1,3 @@
+* Tue Mar 29 2011 vivian zhang <vivian.zhang at intel.com> - 0.9.19
+- Add hfgw profile support in bluetooth module (BMC #12649)
+

new:
----
  fix-12649-add-hfp-gateway-support.patch

spec files:
-----------
--- pulseaudio.spec
+++ pulseaudio.spec
@@ -50,6 +50,7 @@
 Patch26:     pa-0.9.19-mfld-Fix-various-bugs-Support-new-option-trace_ports.patch
 Patch27:     fix-9972-auto-route-audio-to-bt-sink.patch
 Patch28:     use-a2dp-profile-for-non-mfld.patch
+Patch29:     fix-12649-add-hfp-gateway-support.patch
 Requires:   udev >= 145-3
 Requires:   xcb-util
 Requires(post): /sbin/ldconfig
@@ -174,6 +175,8 @@
 %patch27 -p1
 # use-a2dp-profile-for-non-mfld.patch
 %patch28 -p1
+# fix-12649-add-hfp-gateway-support.patch
+%patch29 -p1
 # >> setup
 # << setup
 

other changes:
--------------

++++++ fix-12649-add-hfp-gateway-support.patch (new)
--- fix-12649-add-hfp-gateway-support.patch
+++ fix-12649-add-hfp-gateway-support.patch
+diff -Nur pulseaudio-0.9.19/src/modules/bluetooth/bluetooth-util.c pulseaudio-0.9.19-new/src/modules/bluetooth/bluetooth-util.c
+--- pulseaudio-0.9.19/src/modules/bluetooth/bluetooth-util.c	2011-03-28 15:20:39.976414071 +0800
++++ pulseaudio-0.9.19-new/src/modules/bluetooth/bluetooth-util.c	2011-03-28 15:21:03.830588202 +0800
+@@ -97,6 +97,7 @@
+     d->audio_sink_state = PA_BT_AUDIO_STATE_INVALID;
+     d->audio_source_state = PA_BT_AUDIO_STATE_INVALID;
+     d->headset_state = PA_BT_AUDIO_STATE_INVALID;
++    d->hfgw_state = PA_BT_AUDIO_STATE_INVALID;
+ 
+     return d;
+ }
+@@ -122,11 +123,11 @@
+     pa_assert(d);
+ 
+     return
+-        d->device_info_valid &&
++        d->device_info_valid && (d->hfgw_state != PA_BT_AUDIO_STATE_INVALID ||
+         (d->audio_state != PA_BT_AUDIO_STATE_INVALID &&
+          (d->audio_sink_state != PA_BT_AUDIO_STATE_INVALID ||
+           d->audio_source_state != PA_BT_AUDIO_STATE_INVALID ||
+-          d->headset_state != PA_BT_AUDIO_STATE_INVALID));
++          d->headset_state != PA_BT_AUDIO_STATE_INVALID)));
+ }
+ 
+ static int parse_device_property(pa_bluetooth_discovery *y, pa_bluetooth_device *d, DBusMessageIter *i) {
+@@ -229,7 +230,10 @@
+                     PA_LLIST_PREPEND(pa_bluetooth_uuid, d->uuids, node);
+ 
+                     /* Vudentz said the interfaces are here when the UUIDs are announced */
+-                    if (strcasecmp(HSP_HS_UUID, value) == 0 || strcasecmp(HFP_HS_UUID, value) == 0) {
++                    if (strcasecmp(HSP_AG_UUID, value) == 0 || strcasecmp(HFP_AG_UUID, value) == 0) {
++                        pa_assert_se(m = dbus_message_new_method_call("org.bluez", d->path, "org.bluez.HandsfreeGateway", "GetProperties"));
++                        send_and_add_to_pending(y, d, m, get_properties_reply);
++                    } else if (strcasecmp(HSP_HS_UUID, value) == 0 || strcasecmp(HFP_HS_UUID, value) == 0) {
+                         pa_assert_se(m = dbus_message_new_method_call("org.bluez", d->path, "org.bluez.Headset", "GetProperties"));
+                         send_and_add_to_pending(y, d, m, get_properties_reply);
+                     } else if (strcasecmp(A2DP_SINK_UUID, value) == 0) {
+@@ -398,6 +402,9 @@
+             }  else if (dbus_message_has_interface(p->message, "org.bluez.AudioSource")) {
+                 if (parse_audio_property(y, &d->audio_source_state, &dict_i) < 0)
+                     goto finish;
++            }  else if (dbus_message_has_interface(p->message, "org.bluez.HandsfreeGateway")) {
++                if (parse_audio_property(y, &d->hfgw_state, &arg_i) < 0)
++                    goto finish;
+             }
+         }
+ 
+@@ -625,6 +632,7 @@
+                dbus_message_is_signal(m, "org.bluez.Headset", "PropertyChanged") ||
+                dbus_message_is_signal(m, "org.bluez.AudioSink", "PropertyChanged") ||
+                dbus_message_is_signal(m, "org.bluez.AudioSource", "PropertyChanged") ||
++               dbus_message_is_signal(m, "org.bluez.HandsfreeGateway", "PropertyChanged") ||
+                dbus_message_is_signal(m, "org.bluez.Device", "PropertyChanged")) {
+ 
+         pa_bluetooth_device *d;
+@@ -655,6 +663,9 @@
+             }  else if (dbus_message_has_interface(m, "org.bluez.AudioSource")) {
+                 if (parse_audio_property(y, &d->audio_source_state, &arg_i) < 0)
+                     goto fail;
++            }  else if (dbus_message_has_interface(m, "org.bluez.HandsfreeGateway")) {
++                if (parse_audio_property(y, &d->hfgw_state, &arg_i) < 0)
++                    goto fail;
+             }
+ 
+             run_callback(y, d, FALSE);
+@@ -671,6 +682,7 @@
+             d->audio_sink_state = PA_BT_AUDIO_STATE_DISCONNECTED;
+             d->audio_source_state = PA_BT_AUDIO_STATE_DISCONNECTED;
+             d->headset_state = PA_BT_AUDIO_STATE_DISCONNECTED;
++            d->hfgw_state = PA_BT_AUDIO_STATE_DISCONNECTED;
+ 
+             run_callback(y, d, FALSE);
+         }
+@@ -800,7 +812,10 @@
+                 "type='signal',sender='org.bluez',interface='org.bluez.Audio',member='PropertyChanged'",
+                 "type='signal',sender='org.bluez',interface='org.bluez.Headset',member='PropertyChanged'",
+                 "type='signal',sender='org.bluez',interface='org.bluez.AudioSink',member='PropertyChanged'",
+-                "type='signal',sender='org.bluez',interface='org.bluez.AudioSource',member='PropertyChanged'", NULL) < 0) {
++                "type='signal',sender='org.bluez',interface='org.bluez.AudioSource',member='PropertyChanged'",
++                "type='signal',sender='org.bluez',interface='org.bluez.HandsfreeGateway',member='PropertyChanged'",
++                NULL) < 0) {
++
+         pa_log("Failed to add D-Bus matches: %s", err.message);
+         goto fail;
+     }
+@@ -854,7 +869,9 @@
+                                "type='signal',sender='org.bluez',interface='org.bluez.Audio',member='PropertyChanged'",
+                                "type='signal',sender='org.bluez',interface='org.bluez.Headset',member='PropertyChanged'",
+                                "type='signal',sender='org.bluez',interface='org.bluez.AudioSink',member='PropertyChanged'",
+-                               "type='signal',sender='org.bluez',interface='org.bluez.AudioSource',member='PropertyChanged'", NULL);
++                               "type='signal',sender='org.bluez',interface='org.bluez.AudioSource',member='PropertyChanged'",
++                               "type='signal',sender='org.bluez',interface='org.bluez.HandsfreeGateway',member='PropertyChanged'",
++                               NULL);
+ 
+         dbus_connection_remove_filter(pa_dbus_connection_get(y->connection), filter_cb, y);
+ 
+diff -Nur pulseaudio-0.9.19/src/modules/bluetooth/bluetooth-util.h pulseaudio-0.9.19-new/src/modules/bluetooth/bluetooth-util.h
+--- pulseaudio-0.9.19/src/modules/bluetooth/bluetooth-util.h	2011-03-28 15:20:39.976414071 +0800
++++ pulseaudio-0.9.19-new/src/modules/bluetooth/bluetooth-util.h	2011-03-28 15:21:03.830588202 +0800
+@@ -89,6 +89,9 @@
+ 
+     /* Headset state */
+     pa_bt_audio_state_t headset_state;
++
++    /* HandsfreeGateway state */
++    pa_bt_audio_state_t hfgw_state;
+ };
+ 
+ pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *core);
+diff -Nur pulseaudio-0.9.19/src/modules/bluetooth/module-bluetooth-device.c pulseaudio-0.9.19-new/src/modules/bluetooth/module-bluetooth-device.c
+--- pulseaudio-0.9.19/src/modules/bluetooth/module-bluetooth-device.c	2011-03-28 15:20:39.975409788 +0800
++++ pulseaudio-0.9.19-new/src/modules/bluetooth/module-bluetooth-device.c	2011-03-28 15:21:03.831597072 +0800
+@@ -74,7 +74,7 @@
+         "source_name=<name for the source> "
+         "source_properties=<properties for the source> "
+         "address=<address of the device> "
+-        "profile=<a2dp|hsp> "
++        "profile=<a2dp|hsp|hfgw> "
+         "rate=<sample rate> "
+         "channels=<number of channels> "
+         "path=<device object path> "
+@@ -142,6 +142,7 @@
+     PROFILE_A2DP_SOURCE,
+     PROFILE_A2DP_PASSTHROUGH,
+     PROFILE_HSP,
++    PROFILE_HFGW,
+     PROFILE_OFF
+ };
+ 
+@@ -389,12 +390,12 @@
+     pa_log_debug("Payload size is %lu %lu", (unsigned long) bytes_left, (unsigned long) sizeof(*codec));
+ 
+     if (((u->profile == PROFILE_A2DP || u->profile == PROFILE_A2DP_SOURCE) && codec->transport != BT_CAPABILITIES_TRANSPORT_A2DP) ||
+-        (u->profile == PROFILE_HSP && codec->transport != BT_CAPABILITIES_TRANSPORT_SCO)) {
++        ((u->profile == PROFILE_HSP || u->profile == PROFILE_HFGW) && codec->transport != BT_CAPABILITIES_TRANSPORT_SCO)) {
+         pa_log_error("Got capabilities for wrong codec.");
+         return -1;
+     }
+ 
+-    if (u->profile == PROFILE_HSP) {
++    if (u->profile == PROFILE_HSP || u->profile == PROFILE_HFGW) {
+ 
+         if (bytes_left <= 0 || codec->length != sizeof(u->hsp.pcm_capabilities))
+             return -1;
+@@ -472,7 +473,7 @@
+     if (u->profile == PROFILE_A2DP || u->profile == PROFILE_A2DP_PASSTHROUGH || u->profile == PROFILE_A2DP_SOURCE)
+         msg->getcaps_req.transport = BT_CAPABILITIES_TRANSPORT_A2DP;
+     else {
+-        pa_assert(u->profile == PROFILE_HSP);
++        pa_assert(u->profile == PROFILE_HSP || u->profile == PROFILE_HFGW);
+         msg->getcaps_req.transport = BT_CAPABILITIES_TRANSPORT_SCO;
+     }
+     msg->getcaps_req.flags = u->auto_connect ? BT_FLAG_AUTOCONNECT : 0;
+@@ -871,7 +872,7 @@
+         if (setup_a2dp(u) < 0)
+             return -1;
+     } else {
+-        pa_assert(u->profile == PROFILE_HSP);
++        pa_assert(u->profile == PROFILE_HSP || u->profile == PROFILE_HFGW);
+ 
+         u->sample_spec.format = PA_SAMPLE_S16LE;
+         u->sample_spec.channels = 1;
+@@ -1172,7 +1173,7 @@
+     int ret = 0;
+ 
+     pa_assert(u);
+-    pa_assert(u->profile == PROFILE_HSP);
++    pa_assert(u->profile == PROFILE_HSP || u->profile == PROFILE_HFGW);
+     pa_assert(u->sink);
+ 
+     /* First, render some data */
+@@ -1237,7 +1238,7 @@
+     pa_memchunk memchunk;
+ 
+     pa_assert(u);
+-    pa_assert(u->profile == PROFILE_HSP);
++    pa_assert(u->profile == PROFILE_HSP || u->profile == PROFILE_HFGW);
+     pa_assert(u->source);
+     pa_assert(u->read_smoother);
+ 
+@@ -1992,7 +1993,7 @@
+             if (pollfd && (pollfd->revents & POLLIN)) {
+                 int n_read;
+ 
+-                if (u->profile == PROFILE_HSP)
++                if (u->profile == PROFILE_HSP || PROFILE_HFGW)
+                     n_read = hsp_process_push(u);
+                 else
+                     n_read = a2dp_process_push(u);
+@@ -2497,7 +2498,7 @@
+         data.module = u->module;
+         pa_source_new_data_set_sample_spec(&data, &u->sample_spec);
+         pa_proplist_sets(data.proplist, "bluetooth.protocol", u->profile == PROFILE_A2DP_SOURCE ? "a2dp_source" : "hsp");
+-        if (u->profile == PROFILE_HSP)
++        if ((u->profile == PROFILE_HSP) || (u->profile == PROFILE_HFGW))
+             pa_proplist_sets(data.proplist, PA_PROP_DEVICE_INTENDED_ROLES, "phone");
+         data.card = u->card;
+         data.name = get_name("source", u->modargs, u->address, &b);
(95 more lines skipped)

++++++ pulseaudio.yaml
--- pulseaudio.yaml
+++ pulseaudio.yaml
@@ -46,6 +46,7 @@
     - pa-0.9.19-mfld-Fix-various-bugs-Support-new-option-trace_ports.patch
     - fix-9972-auto-route-audio-to-bt-sink.patch
     - use-a2dp-profile-for-non-mfld.patch
+    - fix-12649-add-hfp-gateway-support.patch
 Description: |
     PulseAudio is a sound server for Linux and other Unix like operating
     systems. It is intended to be an improved drop-in replacement for the




More information about the MeeGo-commits mailing list