[meego-commits] 14691: Changes to Trunk:Testing/pulseaudio

Vivian Zhang no_reply at build.meego.com
Fri Mar 11 04:43:20 UTC 2011


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

Thank You,
Vivian Zhang

[This message was auto-generated]

---

Request #14691:

  submit:   devel:multimedia/pulseaudio(r33) -> Trunk:Testing/pulseaudio


Message:
    Add patch for enabling auto route audio to bluetooth sink (BMC #12916)

State:   new          2011-03-10T20:43:18 vivian
Comment: None



changes files:
--------------
--- pulseaudio.changes
+++ pulseaudio.changes
@@ -0,0 +1,3 @@
+* Fri Mar 11 2011 vivian zhang <vivian.zhang at intel.com> - 0.9.19
+- Add patch for enabling auto route audio to bluetooth sink (BMC #12916)
+

new:
----
  fix-9972-auto-route-audio-to-bt-sink.patch

spec files:
-----------
--- pulseaudio.spec
+++ pulseaudio.spec
@@ -50,6 +50,7 @@
 Patch24:     pa-0.9.19-mfld-Module-to-log-PCM-samples-from-sinks-and-sources-HSD.patch
 Patch25:     pa-0.9.19-mfld-Correct-wav-file-creation-for-24-32-and-24-bits-samp.patch
 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
 Requires:   udev >= 145-3
 Requires:   xcb-util
 Requires(post): /sbin/ldconfig
@@ -170,6 +171,8 @@
 %patch25 -p1
 # pa-0.9.19-mfld-Fix-various-bugs-Support-new-option-trace_ports.patch
 %patch26 -p1
+# fix-9972-auto-route-audio-to-bt-sink.patch
+%patch27 -p1
 # >> setup
 # << setup
 

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

++++++ fix-9972-auto-route-audio-to-bt-sink.patch (new)
--- fix-9972-auto-route-audio-to-bt-sink.patch
+++ fix-9972-auto-route-audio-to-bt-sink.patch
+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-10 16:12:13.715225741 +0800
++++ pulseaudio-0.9.19-new/src/modules/bluetooth/module-bluetooth-device.c	2011-03-11 09:49:26.121225664 +0800
+@@ -49,6 +49,8 @@
+ #include <pulsecore/time-smoother.h>
+ #include <pulsecore/namereg.h>
+ #include <pulsecore/dbus-shared.h>
++#include <pulsecore/sink-input.h>
++#include <pulsecore/idxset.h>
+ 
+ #include "module-bluetooth-device-symdef.h"
+ #include "ipc.h"
+@@ -2607,6 +2609,35 @@
+ }
+ 
+ /* Run from main thread */
++static int move_to_bluez_sink(struct userdata *u) {
++
++    pa_assert(u);
++
++    if (u->sink) {
++        if (u->sink == u->core->default_sink) {
++            pa_log_debug("Meego: bluez_sink has been the default sink, do nothing.\n");
++            return 0;
++        } else {
++            pa_namereg_set_default_sink(u->core, u->sink);
++            pa_log_debug("Meego: Set default sink to bluetooth");
++
++            pa_sink_input *i;
++            uint32_t idx = PA_IDXSET_INVALID;
++            for (i = pa_idxset_first(u->core->sink_inputs, &idx); i; i = pa_idxset_next(u->core->sink_inputs, &idx)) {
++                //pa_assert(i->sink);
++                if (i->client)
++                    pa_log_debug("Meego: Move sink-input client: %u <%s> to bluez_sink\n", i->client->index, pa_strnull(pa_proplist_gets(i->client->proplist, PA_PROP_APPLICATION_NAME)));
++
++                if (pa_sink_input_move_to(i, u->sink, TRUE) < 0)
++                    pa_log_debug("Meego: Moved failed.\n");
++            }
++            return 0;
++        }
++    }
++    return 1;
++}
++
++/* Run from main thread */
+ static int init_profile(struct userdata *u) {
+     int r = 0;
+     pa_assert(u);
+@@ -3198,8 +3229,15 @@
+ 
+     if (u->sink || u->source)
+         if (start_thread(u) < 0)
+-            goto fail;    
+-    
++            goto fail; 
++
++    // meego: if not mfld platform
++    if (access(PA_ALSA_MIXER_MFLD, R_OK) != 0)
++        if (u->sink)
++            move_to_bluez_sink(u);
++    else
++        pa_log("Meego: Do not auto-route audio to bluetooth sink on mfld platform");
++
+     return 0;
+ 
+ fail:
+diff -Nur pulseaudio-0.9.19/src/pulsecore/protocol-native.c pulseaudio-0.9.19-new/src/pulsecore/protocol-native.c
+--- pulseaudio-0.9.19/src/pulsecore/protocol-native.c	2011-03-10 16:12:13.731225636 +0800
++++ pulseaudio-0.9.19-new/src/pulsecore/protocol-native.c	2011-03-10 16:50:04.809225578 +0800
+@@ -4014,9 +4014,11 @@
+     CHECK_VALIDITY(c->pstream, c->authorized, tag, PA_ERR_ACCESS);
+     CHECK_VALIDITY(c->pstream, !s || pa_namereg_is_valid_name(s), tag, PA_ERR_INVALID);
+ 
+-    pa_log_warn("Denied access to client %s to set default sink/source.", pa_proplist_gets(c->client->proplist, PA_PROP_APPLICATION_NAME));
+-    pa_pstream_send_error(c->pstream, tag, PA_ERR_ACCESS);
+-    return;
++    if (access(PA_ALSA_MIXER_MFLD, R_OK) == 0)  {
++        pa_log_warn("Denied access to client %s to set default sink/source.", pa_proplist_gets(c->client->proplist, PA_PROP_APPLICATION_NAME));
++        pa_pstream_send_error(c->pstream, tag, PA_ERR_ACCESS);
++        return;
++    }
+ 
+     if (command == PA_COMMAND_SET_DEFAULT_SOURCE) {
+         pa_source *source;

++++++ pulseaudio.yaml
--- pulseaudio.yaml
+++ pulseaudio.yaml
@@ -41,7 +41,7 @@
     - pa-0.9.19-mfld-Module-to-log-PCM-samples-from-sinks-and-sources-HSD.patch
     - pa-0.9.19-mfld-Correct-wav-file-creation-for-24-32-and-24-bits-samp.patch
     - pa-0.9.19-mfld-Fix-various-bugs-Support-new-option-trace_ports.patch
-
+    - fix-9972-auto-route-audio-to-bt-sink.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