summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2016-02-17 18:56:16 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-18 07:39:32 +0000
commitbe7b52a7ccd5801a6dbd001c97990590ff434c21 (patch)
treef8fab5c9497f3696647322bbe8df30d2a722f44a /meta
parentc52b8f6c9698e9f42472c9062eb809d853b5b764 (diff)
downloadpoky-be7b52a7ccd5801a6dbd001c97990590ff434c21.tar.gz
pulseaudio: 6.0 -> 8.0
Release notes for 7.0: https://wiki.freedesktop.org/www/Software/PulseAudio/Notes/7.0/ Release notes for 8.0: https://wiki.freedesktop.org/www/Software/PulseAudio/Notes/8.0/ 7.0 added support for soxr resamplers, but neither oe-core nor meta-oe have libsoxr packaged. The default resampler is still speexdsp based, so most people wouldn't be using the soxr resamplers anyway. If someone cares enough to package soxr, then we can enable the feature. Bash completions moved in 7.0 from /etc to the standard location under /usr/share/bash-completion. We now use the bash-completion class to package the completion files. The private library libpulsecore moved from /usr/lib to /usr/lib/pulseaudio. The new routing features advertised in the 8.0 release notes are reverted for now, because they caused regressions. I'll remove the revert once a proper fix is available. Removed two patches, because they are included in the new release. Rebased three patches. Updated Upstream-Status tags to reflect the current situation. (From OE-Core rev: 10351d2e7ab27d0f0311c491b70d0f0056a8f76b) Signed-off-by: Tanu Kaskinen <tanuk@iki.fi> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio.inc8
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio/0001-Revert-module-switch-on-port-available-Route-to-pref.patch268
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio/0001-card-add-pa_card_profile.ports.patch101
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch7
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio/0001-conf-parser-add-support-for-.d-directories.patch196
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio/0002-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch7
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio/0003-card-move-profile-selection-after-pa_card_new.patch131
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio/0004-alsa-set-availability-for-some-unavailable-profiles.patch32
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio/fix-git-version-gen.patch24
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio_8.0.bb (renamed from meta/recipes-multimedia/pulseaudio/pulseaudio_6.0.bb)7
10 files changed, 413 insertions, 368 deletions
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio.inc b/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
index b2781152a9..0b05ce4cac 100644
--- a/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
@@ -12,7 +12,7 @@ DEPENDS = "libatomic-ops libsndfile1 libtool"
12DEPENDS += "udev alsa-lib glib-2.0 gconf" 12DEPENDS += "udev alsa-lib glib-2.0 gconf"
13DEPENDS += "json-c gdbm speexdsp libxml-parser-perl-native libcap" 13DEPENDS += "json-c gdbm speexdsp libxml-parser-perl-native libcap"
14 14
15inherit autotools pkgconfig useradd gettext perlnative bluetooth systemd 15inherit autotools bash-completion pkgconfig useradd gettext perlnative bluetooth systemd
16 16
17# *.desktop rules wont be generated during configure and build will fail 17# *.desktop rules wont be generated during configure and build will fail
18# if using --disable-nls 18# if using --disable-nls
@@ -32,6 +32,10 @@ EXTRA_OECONF = "\
32 ac_cv_header_valgrind_memcheck_h=no \ 32 ac_cv_header_valgrind_memcheck_h=no \
33" 33"
34 34
35# soxr (the SoX Resampler library) doesn't seem to be currently packaged in
36# oe-core nor meta-oe, so let's not add a PACKAGECONFIG entry for it for now.
37EXTRA_OECONF += "--without-soxr"
38
35PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \ 39PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
36 ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \ 40 ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
37 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \ 41 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
@@ -101,7 +105,7 @@ RREPLACES_pulseaudio-server = "libpulse-bin libpulse-conf"
101 105
102PACKAGES_DYNAMIC += "^pulseaudio-lib-.* ^pulseaudio-module-.*" 106PACKAGES_DYNAMIC += "^pulseaudio-lib-.* ^pulseaudio-module-.*"
103 107
104FILES_libpulsecore = "${libdir}/libpulsecore*.so" 108FILES_libpulsecore = "${libdir}/pulseaudio/libpulsecore*.so"
105FILES_libpulsecommon = "${libdir}/pulseaudio/libpulsecommon*.so" 109FILES_libpulsecommon = "${libdir}/pulseaudio/libpulsecommon*.so"
106 110
107# client.conf configures the behaviour of libpulse, so it belongs in the same 111# client.conf configures the behaviour of libpulse, so it belongs in the same
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-Revert-module-switch-on-port-available-Route-to-pref.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-Revert-module-switch-on-port-available-Route-to-pref.patch
new file mode 100644
index 0000000000..1c1e2fbdbc
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-Revert-module-switch-on-port-available-Route-to-pref.patch
@@ -0,0 +1,268 @@
1From b8b9b3da94a0c27090ceba243fdf54fb518c5489 Mon Sep 17 00:00:00 2001
2From: Tanu Kaskinen <tanuk@iki.fi>
3Date: Mon, 1 Feb 2016 15:34:59 +0200
4Subject: [PATCH] Revert "module-switch-on-port-available: Route to preferred
5 profile"
6
7This reverts commit e87100d41ef6d14f8dc7f803582191d9f8d8f183.
8
9The reverted commit had some unwanted consequences:
10https://bugs.freedesktop.org/show_bug.cgi?id=93903
11https://bugs.freedesktop.org/show_bug.cgi?id=93946
12
13The first regression has a fix here:
14https://patchwork.freedesktop.org/patch/72053/
15
16The second regression, however, doesn't have a fix yet. Therefore,
17it's best to revert the offending patch for now.
18
19Upstream-Status: Inappropriate [Upstream plans to fix the issues
20properly.]
21
22Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
23---
24 src/modules/module-switch-on-port-available.c | 172 ++++++++++----------------
25 1 file changed, 67 insertions(+), 105 deletions(-)
26
27diff --git a/src/modules/module-switch-on-port-available.c b/src/modules/module-switch-on-port-available.c
28index 5dd9786..8de68a3 100644
29--- a/src/modules/module-switch-on-port-available.c
30+++ b/src/modules/module-switch-on-port-available.c
31@@ -74,25 +74,22 @@ static bool profile_good_for_input(pa_card_profile *profile) {
32 static int try_to_switch_profile(pa_device_port *port) {
33 pa_card_profile *best_profile = NULL, *profile;
34 void *state;
35- unsigned best_prio = 0;
36
37- pa_log_debug("Finding best profile for port %s, preferred = %s",
38- port->name, pa_strnull(port->preferred_profile));
39+ pa_log_debug("Finding best profile");
40
41 PA_HASHMAP_FOREACH(profile, port->profiles, state) {
42 bool good = false;
43- const char *name;
44- unsigned prio = profile->priority;
45+
46+ if (best_profile && best_profile->priority >= profile->priority)
47+ continue;
48
49 /* We make a best effort to keep other direction unchanged */
50 switch (port->direction) {
51 case PA_DIRECTION_OUTPUT:
52- name = profile->output_name;
53 good = profile_good_for_output(profile);
54 break;
55
56 case PA_DIRECTION_INPUT:
57- name = profile->input_name;
58 good = profile_good_for_input(profile);
59 break;
60 }
61@@ -100,15 +97,7 @@ static int try_to_switch_profile(pa_device_port *port) {
62 if (!good)
63 continue;
64
65- /* Give a high bonus in case this is the preferred profile */
66- if (port->preferred_profile && pa_streq(name ? name : profile->name, port->preferred_profile))
67- prio += 1000000;
68-
69- if (best_profile && best_prio >= prio)
70- continue;
71-
72 best_profile = profile;
73- best_prio = prio;
74 }
75
76 if (!best_profile) {
77@@ -124,125 +113,98 @@ static int try_to_switch_profile(pa_device_port *port) {
78 return 0;
79 }
80
81-struct port_pointers {
82- pa_device_port *port;
83- pa_sink *sink;
84- pa_source *source;
85- bool is_possible_profile_active;
86- bool is_preferred_profile_active;
87- bool is_port_active;
88-};
89-
90-static const char* profile_name_for_dir(pa_card_profile *cp, pa_direction_t dir) {
91- if (dir == PA_DIRECTION_OUTPUT && cp->output_name)
92- return cp->output_name;
93- if (dir == PA_DIRECTION_INPUT && cp->input_name)
94- return cp->input_name;
95- return cp->name;
96-}
97-
98-static struct port_pointers find_port_pointers(pa_device_port *port) {
99- struct port_pointers pp = { .port = port };
100+static void find_sink_and_source(pa_card *card, pa_device_port *port, pa_sink **si, pa_source **so) {
101+ pa_sink *sink = NULL;
102+ pa_source *source = NULL;
103 uint32_t state;
104- pa_card *card;
105-
106- pa_assert(port);
107- pa_assert_se(card = port->card);
108
109 switch (port->direction) {
110 case PA_DIRECTION_OUTPUT:
111- PA_IDXSET_FOREACH(pp.sink, card->sinks, state)
112- if (port == pa_hashmap_get(pp.sink->ports, port->name))
113+ PA_IDXSET_FOREACH(sink, card->sinks, state)
114+ if (port == pa_hashmap_get(sink->ports, port->name))
115 break;
116 break;
117
118 case PA_DIRECTION_INPUT:
119- PA_IDXSET_FOREACH(pp.source, card->sources, state)
120- if (port == pa_hashmap_get(pp.source->ports, port->name))
121+ PA_IDXSET_FOREACH(source, card->sources, state)
122+ if (port == pa_hashmap_get(source->ports, port->name))
123 break;
124 break;
125 }
126
127- pp.is_possible_profile_active =
128- card->active_profile == pa_hashmap_get(port->profiles, card->active_profile->name);
129- pp.is_preferred_profile_active = pp.is_possible_profile_active && (!port->preferred_profile ||
130- pa_safe_streq(port->preferred_profile, profile_name_for_dir(card->active_profile, port->direction)));
131- pp.is_port_active = (pp.sink && pp.sink->active_port == port) || (pp.source && pp.source->active_port == port);
132-
133- return pp;
134+ *si = sink;
135+ *so = source;
136 }
137
138-/* Switches to a port, switching profiles if necessary or preferred */
139-static bool switch_to_port(pa_device_port *port) {
140- struct port_pointers pp = find_port_pointers(port);
141+static pa_hook_result_t port_available_hook_callback(pa_core *c, pa_device_port *port, void* userdata) {
142+ pa_card* card;
143+ pa_sink *sink;
144+ pa_source *source;
145+ bool is_active_profile, is_active_port;
146
147- if (pp.is_port_active)
148- return true; /* Already selected */
149+ if (port->available == PA_AVAILABLE_UNKNOWN)
150+ return PA_HOOK_OK;
151
152- pa_log_debug("Trying to switch to port %s", port->name);
153- if (!pp.is_preferred_profile_active) {
154- if (try_to_switch_profile(port) < 0) {
155- if (pp.is_possible_profile_active)
156- return false;
157- }
158- else
159- /* Now that profile has changed, our sink and source pointers must be updated */
160- pp = find_port_pointers(port);
161- }
162+ card = port->card;
163
164- if (pp.source)
165- pa_source_set_port(pp.source, port->name, false);
166- if (pp.sink)
167- pa_sink_set_port(pp.sink, port->name, false);
168- return true;
169-}
170+ if (!card) {
171+ pa_log_warn("Port %s does not have a card", port->name);
172+ return PA_HOOK_OK;
173+ }
174
175-/* Switches away from a port, switching profiles if necessary or preferred */
176-static bool switch_from_port(pa_device_port *port) {
177- struct port_pointers pp = find_port_pointers(port);
178- pa_device_port *p, *best_port = NULL;
179- void *state;
180+ if (pa_idxset_size(card->sinks) == 0 && pa_idxset_size(card->sources) == 0)
181+ /* This card is not initialized yet. We'll handle it in
182+ sink_new / source_new callbacks later. */
183+ return PA_HOOK_OK;
184
185- if (!pp.is_port_active)
186- return true; /* Already deselected */
187+ find_sink_and_source(card, port, &sink, &source);
188
189- /* Try to find a good enough port to switch to */
190- PA_HASHMAP_FOREACH(p, port->card->ports, state)
191- if (p->direction == port->direction && p != port && p->available != PA_AVAILABLE_NO &&
192- (!best_port || best_port->priority < p->priority))
193- best_port = p;
194+ is_active_profile = card->active_profile == pa_hashmap_get(port->profiles, card->active_profile->name);
195+ is_active_port = (sink && sink->active_port == port) || (source && source->active_port == port);
196
197- pa_log_debug("Trying to switch away from port %s, found %s", port->name, best_port ? best_port->name : "no better option");
198+ if (port->available == PA_AVAILABLE_NO && !is_active_port)
199+ return PA_HOOK_OK;
200
201- if (best_port)
202- return switch_to_port(best_port);
203+ if (port->available == PA_AVAILABLE_YES) {
204+ if (is_active_port)
205+ return PA_HOOK_OK;
206
207- return false;
208-}
209+ if (!is_active_profile) {
210+ if (try_to_switch_profile(port) < 0)
211+ return PA_HOOK_OK;
212
213+ pa_assert(card->active_profile == pa_hashmap_get(port->profiles, card->active_profile->name));
214
215-static pa_hook_result_t port_available_hook_callback(pa_core *c, pa_device_port *port, void* userdata) {
216- pa_assert(port);
217+ /* Now that profile has changed, our sink and source pointers must be updated */
218+ find_sink_and_source(card, port, &sink, &source);
219+ }
220
221- if (!port->card) {
222- pa_log_warn("Port %s does not have a card", port->name);
223- return PA_HOOK_OK;
224+ if (source)
225+ pa_source_set_port(source, port->name, false);
226+ if (sink)
227+ pa_sink_set_port(sink, port->name, false);
228 }
229
230- if (pa_idxset_size(port->card->sinks) == 0 && pa_idxset_size(port->card->sources) == 0)
231- /* This card is not initialized yet. We'll handle it in
232- sink_new / source_new callbacks later. */
233- return PA_HOOK_OK;
234+ if (port->available == PA_AVAILABLE_NO) {
235+ if (sink) {
236+ pa_device_port *p2 = pa_device_port_find_best(sink->ports);
237+
238+ if (p2 && p2->available != PA_AVAILABLE_NO)
239+ pa_sink_set_port(sink, p2->name, false);
240+ else {
241+ /* Maybe try to switch to another profile? */
242+ }
243+ }
244
245- switch (port->available) {
246- case PA_AVAILABLE_YES:
247- switch_to_port(port);
248- break;
249- case PA_AVAILABLE_NO:
250- switch_from_port(port);
251- break;
252- default:
253- break;
254+ if (source) {
255+ pa_device_port *p2 = pa_device_port_find_best(source->ports);
256+
257+ if (p2 && p2->available != PA_AVAILABLE_NO)
258+ pa_source_set_port(source, p2->name, false);
259+ else {
260+ /* Maybe try to switch to another profile? */
261+ }
262+ }
263 }
264
265 return PA_HOOK_OK;
266--
2672.7.0
268
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-card-add-pa_card_profile.ports.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-card-add-pa_card_profile.ports.patch
index 97b2e4064a..84c951940b 100644
--- a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-card-add-pa_card_profile.ports.patch
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-card-add-pa_card_profile.ports.patch
@@ -1,4 +1,4 @@
1From 6f814b40a01d03f93b36184c19339033949de472 Mon Sep 17 00:00:00 2001 1From d1c02971867bea10afcafc82c965414012c4d6bd Mon Sep 17 00:00:00 2001
2From: Tanu Kaskinen <tanuk@iki.fi> 2From: Tanu Kaskinen <tanuk@iki.fi>
3Date: Fri, 23 Oct 2015 12:23:13 +0300 3Date: Fri, 23 Oct 2015 12:23:13 +0300
4Subject: [PATCH 1/4] card: add pa_card_profile.ports 4Subject: [PATCH 1/4] card: add pa_card_profile.ports
@@ -9,23 +9,30 @@ availability (implemented in a later patch).
9 9
10http://bugzilla.yoctoproject.org/show_bug.cgi?id=8448 10http://bugzilla.yoctoproject.org/show_bug.cgi?id=8448
11 11
12Upstream-Status: Submitted [http://lists.freedesktop.org/archives/pulseaudio-discuss/2015-October/024614.html]
13Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> 12Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
13
14Rebased on 8.0.
15
16Upstream-Status: Denied [The patch set needs some work to be accepted.
17The review thread:
18http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/24301]
19
20Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
14--- 21---
15 src/modules/alsa/alsa-mixer.c | 4 +++- 22 src/modules/alsa/alsa-mixer.c | 4 +++-
16 src/modules/alsa/alsa-ucm.c | 1 + 23 src/modules/alsa/alsa-ucm.c | 1 +
17 src/modules/bluetooth/module-bluez4-device.c | 6 ++++++ 24 src/modules/bluetooth/module-bluez4-device.c | 6 ++++++
18 src/modules/bluetooth/module-bluez5-device.c | 6 ++++++ 25 src/modules/bluetooth/module-bluez5-device.c | 6 ++++++
19 src/pulsecore/card.c | 16 ++++++++++++++++ 26 src/pulsecore/card.c | 15 +++++++++++++++
20 src/pulsecore/card.h | 18 ++++++++++++------ 27 src/pulsecore/card.h | 4 ++++
21 src/pulsecore/device-port.c | 7 ++++++- 28 src/pulsecore/device-port.c | 7 ++++++-
22 7 files changed, 50 insertions(+), 8 deletions(-) 29 7 files changed, 41 insertions(+), 2 deletions(-)
23 30
24diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c 31diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
25index 47cbd14..c5b82b0 100644 32index 1fe2a02..5b76b06 100644
26--- a/src/modules/alsa/alsa-mixer.c 33--- a/src/modules/alsa/alsa-mixer.c
27+++ b/src/modules/alsa/alsa-mixer.c 34+++ b/src/modules/alsa/alsa-mixer.c
28@@ -4654,8 +4654,10 @@ static pa_device_port* device_port_alsa_init(pa_hashmap *ports, /* card ports */ 35@@ -4783,8 +4783,10 @@ static pa_device_port* device_port_alsa_init(pa_hashmap *ports, /* card ports */
29 path->port = p; 36 path->port = p;
30 } 37 }
31 38
@@ -38,10 +45,10 @@ index 47cbd14..c5b82b0 100644
38 if (extra) { 45 if (extra) {
39 pa_hashmap_put(extra, p->name, p); 46 pa_hashmap_put(extra, p->name, p);
40diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c 47diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c
41index aa2d601..c8199d6 100644 48index 42f3242..68fcc26 100644
42--- a/src/modules/alsa/alsa-ucm.c 49--- a/src/modules/alsa/alsa-ucm.c
43+++ b/src/modules/alsa/alsa-ucm.c 50+++ b/src/modules/alsa/alsa-ucm.c
44@@ -761,6 +761,7 @@ static void ucm_add_port_combination( 51@@ -791,6 +791,7 @@ static void ucm_add_port_combination(
45 if (cp) { 52 if (cp) {
46 pa_log_debug("Adding profile %s to port %s.", cp->name, port->name); 53 pa_log_debug("Adding profile %s to port %s.", cp->name, port->name);
47 pa_hashmap_put(port->profiles, cp->name, cp); 54 pa_hashmap_put(port->profiles, cp->name, cp);
@@ -50,10 +57,10 @@ index aa2d601..c8199d6 100644
50 57
51 if (hash) { 58 if (hash) {
52diff --git a/src/modules/bluetooth/module-bluez4-device.c b/src/modules/bluetooth/module-bluez4-device.c 59diff --git a/src/modules/bluetooth/module-bluez4-device.c b/src/modules/bluetooth/module-bluez4-device.c
53index db69d34..b40c6a0 100644 60index 9a921a5..adecb32 100644
54--- a/src/modules/bluetooth/module-bluez4-device.c 61--- a/src/modules/bluetooth/module-bluez4-device.c
55+++ b/src/modules/bluetooth/module-bluez4-device.c 62+++ b/src/modules/bluetooth/module-bluez4-device.c
56@@ -2183,6 +2183,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid 63@@ -2180,6 +2180,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid
57 p->max_sink_channels = 2; 64 p->max_sink_channels = 2;
58 p->max_source_channels = 0; 65 p->max_source_channels = 0;
59 pa_hashmap_put(output_port->profiles, p->name, p); 66 pa_hashmap_put(output_port->profiles, p->name, p);
@@ -61,7 +68,7 @@ index db69d34..b40c6a0 100644
61 68
62 d = PA_CARD_PROFILE_DATA(p); 69 d = PA_CARD_PROFILE_DATA(p);
63 *d = PA_BLUEZ4_PROFILE_A2DP; 70 *d = PA_BLUEZ4_PROFILE_A2DP;
64@@ -2194,6 +2195,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid 71@@ -2191,6 +2192,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid
65 p->max_sink_channels = 0; 72 p->max_sink_channels = 0;
66 p->max_source_channels = 2; 73 p->max_source_channels = 2;
67 pa_hashmap_put(input_port->profiles, p->name, p); 74 pa_hashmap_put(input_port->profiles, p->name, p);
@@ -69,7 +76,7 @@ index db69d34..b40c6a0 100644
69 76
70 d = PA_CARD_PROFILE_DATA(p); 77 d = PA_CARD_PROFILE_DATA(p);
71 *d = PA_BLUEZ4_PROFILE_A2DP_SOURCE; 78 *d = PA_BLUEZ4_PROFILE_A2DP_SOURCE;
72@@ -2206,6 +2208,8 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid 79@@ -2203,6 +2205,8 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid
73 p->max_source_channels = 1; 80 p->max_source_channels = 1;
74 pa_hashmap_put(input_port->profiles, p->name, p); 81 pa_hashmap_put(input_port->profiles, p->name, p);
75 pa_hashmap_put(output_port->profiles, p->name, p); 82 pa_hashmap_put(output_port->profiles, p->name, p);
@@ -78,7 +85,7 @@ index db69d34..b40c6a0 100644
78 85
79 d = PA_CARD_PROFILE_DATA(p); 86 d = PA_CARD_PROFILE_DATA(p);
80 *d = PA_BLUEZ4_PROFILE_HSP; 87 *d = PA_BLUEZ4_PROFILE_HSP;
81@@ -2218,6 +2222,8 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid 88@@ -2215,6 +2219,8 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid
82 p->max_source_channels = 1; 89 p->max_source_channels = 1;
83 pa_hashmap_put(input_port->profiles, p->name, p); 90 pa_hashmap_put(input_port->profiles, p->name, p);
84 pa_hashmap_put(output_port->profiles, p->name, p); 91 pa_hashmap_put(output_port->profiles, p->name, p);
@@ -88,7 +95,7 @@ index db69d34..b40c6a0 100644
88 d = PA_CARD_PROFILE_DATA(p); 95 d = PA_CARD_PROFILE_DATA(p);
89 *d = PA_BLUEZ4_PROFILE_HFGW; 96 *d = PA_BLUEZ4_PROFILE_HFGW;
90diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c 97diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c
91index 7238e6f..3321785 100644 98index 84e6d55..b015c67 100644
92--- a/src/modules/bluetooth/module-bluez5-device.c 99--- a/src/modules/bluetooth/module-bluez5-device.c
93+++ b/src/modules/bluetooth/module-bluez5-device.c 100+++ b/src/modules/bluetooth/module-bluez5-device.c
94@@ -1790,6 +1790,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid 101@@ -1790,6 +1790,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid
@@ -126,18 +133,18 @@ index 7238e6f..3321785 100644
126 p = PA_CARD_PROFILE_DATA(cp); 133 p = PA_CARD_PROFILE_DATA(cp);
127 *p = PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY; 134 *p = PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY;
128diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c 135diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
129index 6f9391e..cc4c784 100644 136index b6cbbf7..f92ac87 100644
130--- a/src/pulsecore/card.c 137--- a/src/pulsecore/card.c
131+++ b/src/pulsecore/card.c 138+++ b/src/pulsecore/card.c
132@@ -50,6 +50,7 @@ pa_card_profile *pa_card_profile_new(const char *name, const char *description, 139@@ -45,6 +45,7 @@ pa_card_profile *pa_card_profile_new(const char *name, const char *description,
133 c->n_sinks = c->n_sources = 0; 140 c->name = pa_xstrdup(name);
134 c->max_sink_channels = c->max_source_channels = 0; 141 c->description = pa_xstrdup(description);
135 c->available = PA_AVAILABLE_UNKNOWN; 142 c->available = PA_AVAILABLE_UNKNOWN;
136+ c->ports = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func); 143+ c->ports = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
137 144
138 return c; 145 return c;
139 } 146 }
140@@ -57,11 +58,25 @@ pa_card_profile *pa_card_profile_new(const char *name, const char *description, 147@@ -52,6 +53,14 @@ pa_card_profile *pa_card_profile_new(const char *name, const char *description,
141 void pa_card_profile_free(pa_card_profile *c) { 148 void pa_card_profile_free(pa_card_profile *c) {
142 pa_assert(c); 149 pa_assert(c);
143 150
@@ -149,8 +156,10 @@ index 6f9391e..cc4c784 100644
149+ pa_hashmap_free(c->ports); 156+ pa_hashmap_free(c->ports);
150+ } 157+ }
151+ 158+
159 pa_xfree(c->input_name);
160 pa_xfree(c->output_name);
152 pa_xfree(c->name); 161 pa_xfree(c->name);
153 pa_xfree(c->description); 162@@ -59,6 +68,12 @@ void pa_card_profile_free(pa_card_profile *c) {
154 pa_xfree(c); 163 pa_xfree(c);
155 } 164 }
156 165
@@ -163,47 +172,11 @@ index 6f9391e..cc4c784 100644
163 void pa_card_profile_set_available(pa_card_profile *c, pa_available_t available) { 172 void pa_card_profile_set_available(pa_card_profile *c, pa_available_t available) {
164 pa_core *core; 173 pa_core *core;
165 174
166@@ -198,6 +213,7 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
167
168 c->userdata = NULL;
169 c->set_profile = NULL;
170+ c->active_profile = NULL;
171
172 pa_device_init_description(c->proplist, c);
173 pa_device_init_icon(c->proplist, true);
174diff --git a/src/pulsecore/card.h b/src/pulsecore/card.h 175diff --git a/src/pulsecore/card.h b/src/pulsecore/card.h
175index 3e2c004..1c33958 100644 176index 30bfc0e..fff9057 100644
176--- a/src/pulsecore/card.h 177--- a/src/pulsecore/card.h
177+++ b/src/pulsecore/card.h 178+++ b/src/pulsecore/card.h
178@@ -22,19 +22,21 @@ 179@@ -50,6 +50,8 @@ struct pa_card_profile {
179
180 typedef struct pa_card pa_card;
181
182-#include <pulse/proplist.h>
183-#include <pulsecore/core.h>
184-#include <pulsecore/module.h>
185-#include <pulsecore/idxset.h>
186-
187 /* This enum replaces pa_port_available_t (defined in pulse/def.h) for
188- * internal use, so make sure both enum types stay in sync. */
189+ * internal use, so make sure both enum types stay in sync. This is defined
190+ * before the #includes, because device-port.h depends on this enum. */
191 typedef enum pa_available {
192 PA_AVAILABLE_UNKNOWN = 0,
193 PA_AVAILABLE_NO = 1,
194 PA_AVAILABLE_YES = 2,
195 } pa_available_t;
196
197+#include <pulse/proplist.h>
198+#include <pulsecore/core.h>
199+#include <pulsecore/device-port.h>
200+#include <pulsecore/module.h>
201+#include <pulsecore/idxset.h>
202+
203 typedef struct pa_card_profile {
204 pa_card *card;
205 char *name;
206@@ -43,6 +45,8 @@ typedef struct pa_card_profile {
207 unsigned priority; 180 unsigned priority;
208 pa_available_t available; /* PA_AVAILABLE_UNKNOWN, PA_AVAILABLE_NO or PA_AVAILABLE_YES */ 181 pa_available_t available; /* PA_AVAILABLE_UNKNOWN, PA_AVAILABLE_NO or PA_AVAILABLE_YES */
209 182
@@ -212,7 +185,7 @@ index 3e2c004..1c33958 100644
212 /* We probably want to have different properties later on here */ 185 /* We probably want to have different properties later on here */
213 unsigned n_sinks; 186 unsigned n_sinks;
214 unsigned n_sources; 187 unsigned n_sources;
215@@ -100,6 +104,8 @@ typedef struct pa_card_new_data { 188@@ -107,6 +109,8 @@ typedef struct pa_card_new_data {
216 pa_card_profile *pa_card_profile_new(const char *name, const char *description, size_t extra); 189 pa_card_profile *pa_card_profile_new(const char *name, const char *description, size_t extra);
217 void pa_card_profile_free(pa_card_profile *c); 190 void pa_card_profile_free(pa_card_profile *c);
218 191
@@ -222,10 +195,10 @@ index 3e2c004..1c33958 100644
222 void pa_card_profile_set_available(pa_card_profile *c, pa_available_t available); 195 void pa_card_profile_set_available(pa_card_profile *c, pa_available_t available);
223 196
224diff --git a/src/pulsecore/device-port.c b/src/pulsecore/device-port.c 197diff --git a/src/pulsecore/device-port.c b/src/pulsecore/device-port.c
225index cfe2a80..f16ecef 100644 198index 5807d3e..d12dfbc 100644
226--- a/src/pulsecore/device-port.c 199--- a/src/pulsecore/device-port.c
227+++ b/src/pulsecore/device-port.c 200+++ b/src/pulsecore/device-port.c
228@@ -95,8 +95,13 @@ static void device_port_free(pa_object *o) { 201@@ -107,8 +107,13 @@ static void device_port_free(pa_object *o) {
229 if (p->proplist) 202 if (p->proplist)
230 pa_proplist_free(p->proplist); 203 pa_proplist_free(p->proplist);
231 204
@@ -238,8 +211,8 @@ index cfe2a80..f16ecef 100644
238 pa_hashmap_free(p->profiles); 211 pa_hashmap_free(p->profiles);
239+ } 212+ }
240 213
214 pa_xfree(p->preferred_profile);
241 pa_xfree(p->name); 215 pa_xfree(p->name);
242 pa_xfree(p->description);
243-- 216--
2442.1.4 2172.7.0
245 218
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch
index d19eb7c19b..bc32775836 100644
--- a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch
@@ -7,7 +7,12 @@ Usually autospawning for root is a bad idea, since it can easily
7interfere with other users' PulseAudio instances, but in embedded 7interfere with other users' PulseAudio instances, but in embedded
8environments where only root exists, autospawning is fine. 8environments where only root exists, autospawning is fine.
9 9
10Upstream-Status: Submitted [http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/23549] 10Upstream-Status: Denied [Upstream hasn't so far been convinced that
11this feature is needed. The view is that running the graphical session
12as root doesn't make sense even on embedded systems, or if it does,
13running PulseAudio in the system mode should be a good solution for
14that use case. If someone can prove otherwise, the patch would
15probably be accepted.]
11 16
12Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com> 17Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
13--- 18---
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-conf-parser-add-support-for-.d-directories.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-conf-parser-add-support-for-.d-directories.patch
deleted file mode 100644
index a9f1b2acf3..0000000000
--- a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-conf-parser-add-support-for-.d-directories.patch
+++ /dev/null
@@ -1,196 +0,0 @@
1From 8cb643bbf0a287d67794e680d26f49c503f31053 Mon Sep 17 00:00:00 2001
2From: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
3Date: Thu, 21 May 2015 21:00:59 +0300
4Subject: [PATCH] conf-parser: add support for .d directories
5
6This allows a configuration scheme where prior to loading
7configuration from "somefile", the parser first loads configuration
8from files in directory "somefile.d". This feature is currently
9enabled only for client.conf and daemon.conf.
10
11This makes it easier to create configuration packages in distributions
12when there's need to have different configuration in different setups.
13For example, the graphical Sato environment in OpenEmbedded-core needs
14to set allow-autospawn-for-root=true in client.conf, but the default
15configuration in OpenEmbedded-core should not set that option. With
16this patch, I can create a Sato-specific package that simply installs
1750-sato.conf in /etc/pulse/client.conf.d without conflicting with the
18main client.conf file coming from a different package.
19
20Upstream-Status: Submitted [http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/23592]
21
22Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
23---
24 src/daemon/daemon-conf.c | 2 +-
25 src/modules/alsa/alsa-mixer.c | 4 ++--
26 src/modules/module-augment-properties.c | 2 +-
27 src/pulse/client-conf.c | 2 +-
28 src/pulsecore/conf-parser.c | 42 +++++++++++++++++++++++++++++++--
29 src/pulsecore/conf-parser.h | 8 ++++++-
30 6 files changed, 52 insertions(+), 8 deletions(-)
31
32diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c
33index 21a8edb..1332fc6 100644
34--- a/src/daemon/daemon-conf.c
35+++ b/src/daemon/daemon-conf.c
36@@ -617,7 +617,7 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) {
37 ci.default_channel_map_set = ci.default_sample_spec_set = false;
38 ci.conf = c;
39
40- r = f ? pa_config_parse(c->config_file, f, table, NULL, NULL) : 0;
41+ r = f ? pa_config_parse(c->config_file, f, table, NULL, true, NULL) : 0;
42
43 if (r >= 0) {
44
45diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
46index 2314612..988b4fe 100644
47--- a/src/modules/alsa/alsa-mixer.c
48+++ b/src/modules/alsa/alsa-mixer.c
49@@ -2483,7 +2483,7 @@ pa_alsa_path* pa_alsa_path_new(const char *paths_dir, const char *fname, pa_alsa
50
51 fn = pa_maybe_prefix_path(fname, paths_dir);
52
53- r = pa_config_parse(fn, NULL, items, p->proplist, p);
54+ r = pa_config_parse(fn, NULL, items, p->proplist, false, p);
55 pa_xfree(fn);
56
57 if (r < 0)
58@@ -4288,7 +4288,7 @@ pa_alsa_profile_set* pa_alsa_profile_set_new(const char *fname, const pa_channel
59 pa_run_from_build_tree() ? PA_SRCDIR "/modules/alsa/mixer/profile-sets/" :
60 PA_ALSA_PROFILE_SETS_DIR);
61
62- r = pa_config_parse(fn, NULL, items, NULL, ps);
63+ r = pa_config_parse(fn, NULL, items, NULL, false, ps);
64 pa_xfree(fn);
65
66 if (r < 0)
67diff --git a/src/modules/module-augment-properties.c b/src/modules/module-augment-properties.c
68index 42b6fd9..541f0e7 100644
69--- a/src/modules/module-augment-properties.c
70+++ b/src/modules/module-augment-properties.c
71@@ -204,7 +204,7 @@ static void update_rule(struct rule *r) {
72 table[0].data = &r->application_name;
73 table[1].data = &r->icon_name;
74
75- if (pa_config_parse(fn, NULL, table, NULL, r) < 0)
76+ if (pa_config_parse(fn, NULL, table, NULL, false, r) < 0)
77 pa_log_warn("Failed to parse .desktop file %s.", fn);
78
79 pa_xfree(fn);
80diff --git a/src/pulse/client-conf.c b/src/pulse/client-conf.c
81index 83331f8..3c3384d 100644
82--- a/src/pulse/client-conf.c
83+++ b/src/pulse/client-conf.c
84@@ -149,7 +149,7 @@ void pa_client_conf_load(pa_client_conf *c, bool load_from_x11, bool load_from_e
85
86 f = pa_open_config_file(DEFAULT_CLIENT_CONFIG_FILE, DEFAULT_CLIENT_CONFIG_FILE_USER, ENV_CLIENT_CONFIG_FILE, &fn);
87 if (f) {
88- pa_config_parse(fn, f, table, NULL, NULL);
89+ pa_config_parse(fn, f, table, NULL, true, NULL);
90 pa_xfree(fn);
91 fclose(f);
92 }
93diff --git a/src/pulsecore/conf-parser.c b/src/pulsecore/conf-parser.c
94index 2dcd45a..d473232 100644
95--- a/src/pulsecore/conf-parser.c
96+++ b/src/pulsecore/conf-parser.c
97@@ -21,6 +21,7 @@
98 #include <config.h>
99 #endif
100
101+#include <dirent.h>
102 #include <string.h>
103 #include <stdio.h>
104 #include <errno.h>
105@@ -103,7 +104,7 @@ static int parse_line(pa_config_parser_state *state) {
106 }
107 }
108
109- r = pa_config_parse(fn, NULL, state->item_table, state->proplist, state->userdata);
110+ r = pa_config_parse(fn, NULL, state->item_table, state->proplist, false, state->userdata);
111 pa_xfree(path);
112 return r;
113 }
114@@ -152,8 +153,13 @@ static int parse_line(pa_config_parser_state *state) {
115 return normal_assignment(state);
116 }
117
118+static int conf_filter(const struct dirent *entry) {
119+ return pa_endswith(entry->d_name, ".conf");
120+}
121+
122 /* Go through the file and parse each line */
123-int pa_config_parse(const char *filename, FILE *f, const pa_config_item *t, pa_proplist *proplist, void *userdata) {
124+int pa_config_parse(const char *filename, FILE *f, const pa_config_item *t, pa_proplist *proplist, bool use_dot_d,
125+ void *userdata) {
126 int r = -1;
127 bool do_close = !f;
128 pa_config_parser_state state;
129@@ -163,6 +169,38 @@ int pa_config_parse(const char *filename, FILE *f, const pa_config_item *t, pa_p
130
131 pa_zero(state);
132
133+ if (use_dot_d) {
134+ char *dir_name;
135+ int n;
136+ struct dirent **entries = NULL;
137+
138+ dir_name = pa_sprintf_malloc("%s.d", filename);
139+
140+ n = scandir(dir_name, &entries, conf_filter, alphasort);
141+ if (n >= 0) {
142+ int i;
143+
144+ for (i = 0; i < n; i++) {
145+ char *filename2;
146+
147+ filename2 = pa_sprintf_malloc("%s" PA_PATH_SEP "%s", dir_name, entries[i]->d_name);
148+ pa_config_parse(filename2, NULL, t, proplist, false, userdata);
149+ pa_xfree(filename2);
150+
151+ free(entries[i]);
152+ }
153+
154+ free(entries);
155+ } else {
156+ if (errno == ENOENT)
157+ pa_log_debug("scandir(\"%s\") failed: %s", dir_name, pa_cstrerror(errno));
158+ else
159+ pa_log_warn("scandir(\"%s\") failed: %s", dir_name, pa_cstrerror(errno));
160+ }
161+
162+ pa_xfree(dir_name);
163+ }
164+
165 if (!f && !(f = pa_fopen_cloexec(filename, "r"))) {
166 if (errno == ENOENT) {
167 pa_log_debug("Failed to open configuration file '%s': %s", filename, pa_cstrerror(errno));
168diff --git a/src/pulsecore/conf-parser.h b/src/pulsecore/conf-parser.h
169index dbb6f5c..cc20d7d 100644
170--- a/src/pulsecore/conf-parser.h
171+++ b/src/pulsecore/conf-parser.h
172@@ -59,6 +59,11 @@ struct pa_config_parser_state {
173 * pa_config_items in *t that is terminated by an item where lvalue is
174 * NULL.
175 *
176+ * If use_dot_d is true, then before parsing the file named by the filename
177+ * argument, the function will parse all files ending with ".conf" in
178+ * alphabetical order from a directory whose name is filename + ".d", if such
179+ * directory exists.
180+ *
181 * Some configuration files may contain a Properties section, which
182 * is a bit special. Normally all accepted lvalues must be predefined
183 * in the pa_config_item table, but in the Properties section the
184@@ -68,7 +73,8 @@ struct pa_config_parser_state {
185 * properties, and those properties will be merged into the given
186 * proplist. If proplist is NULL, then sections named "Properties"
187 * are not allowed at all in the configuration file. */
188-int pa_config_parse(const char *filename, FILE *f, const pa_config_item *t, pa_proplist *proplist, void *userdata);
189+int pa_config_parse(const char *filename, FILE *f, const pa_config_item *t, pa_proplist *proplist, bool use_dot_d,
190+ void *userdata);
191
192 /* Generic parsers for integers, size_t, booleans and strings */
193 int pa_config_parse_int(pa_config_parser_state *state);
194--
1951.9.3
196
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/0002-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/0002-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch
index c3f217bc64..be3655b23c 100644
--- a/meta/recipes-multimedia/pulseaudio/pulseaudio/0002-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/0002-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch
@@ -10,8 +10,13 @@ didn't succeed.
10 10
11http://bugzilla.yoctoproject.org/show_bug.cgi?id=8448 11http://bugzilla.yoctoproject.org/show_bug.cgi?id=8448
12 12
13Upstream-Status: Submitted [http://lists.freedesktop.org/archives/pulseaudio-discuss/2015-October/024614.html]
14Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> 13Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
14
15Upstream-Status: Denied [The patch set needs some work to be accepted.
16The review thread:
17http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/24301]
18
19Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
15--- 20---
16 src/modules/alsa/module-alsa-card.c | 10 ++++++++-- 21 src/modules/alsa/module-alsa-card.c | 10 ++++++++--
17 src/modules/bluetooth/module-bluez4-device.c | 6 ++++-- 22 src/modules/bluetooth/module-bluez4-device.c | 6 ++++--
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/0003-card-move-profile-selection-after-pa_card_new.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/0003-card-move-profile-selection-after-pa_card_new.patch
index 9585f3d529..0e7780154d 100644
--- a/meta/recipes-multimedia/pulseaudio/pulseaudio/0003-card-move-profile-selection-after-pa_card_new.patch
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/0003-card-move-profile-selection-after-pa_card_new.patch
@@ -1,4 +1,4 @@
1From cc41c8a3149ef04d4aa2db3d15032605a5504658 Mon Sep 17 00:00:00 2001 1From 13e85dd1763e99d21a60323671b9a5df08bdae75 Mon Sep 17 00:00:00 2001
2From: Tanu Kaskinen <tanuk@iki.fi> 2From: Tanu Kaskinen <tanuk@iki.fi>
3Date: Fri, 23 Oct 2015 12:59:53 +0300 3Date: Fri, 23 Oct 2015 12:59:53 +0300
4Subject: [PATCH 3/4] card: move profile selection after pa_card_new() 4Subject: [PATCH 3/4] card: move profile selection after pa_card_new()
@@ -32,23 +32,30 @@ whether someone else has already set the profile.
32 32
33http://bugzilla.yoctoproject.org/show_bug.cgi?id=8448 33http://bugzilla.yoctoproject.org/show_bug.cgi?id=8448
34 34
35Upstream-Status: Submitted [http://lists.freedesktop.org/archives/pulseaudio-discuss/2015-October/024614.html]
36Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> 35Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
36
37Rebased on 8.0.
38
39Upstream-Status: Denied [The patch set needs some work to be accepted.
40The review thread:
41http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/24301]
42
43Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
37--- 44---
38 src/modules/alsa/module-alsa-card.c | 19 +++--- 45 src/modules/alsa/module-alsa-card.c | 19 +++----
39 src/modules/bluetooth/module-bluez4-device.c | 18 +++--- 46 src/modules/bluetooth/module-bluez4-device.c | 18 +++----
40 src/modules/bluetooth/module-bluez5-device.c | 1 + 47 src/modules/bluetooth/module-bluez5-device.c | 1 +
41 src/modules/macosx/module-coreaudio-device.c | 1 + 48 src/modules/macosx/module-coreaudio-device.c | 1 +
42 src/modules/module-card-restore.c | 24 ++++---- 49 src/modules/module-card-restore.c | 24 +++++----
43 src/pulsecore/card.c | 86 +++++++++++++++------------- 50 src/pulsecore/card.c | 81 +++++++++++++++-------------
44 src/pulsecore/card.h | 7 +++ 51 src/pulsecore/card.h | 7 +++
45 7 files changed, 87 insertions(+), 69 deletions(-) 52 7 files changed, 86 insertions(+), 65 deletions(-)
46 53
47diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c 54diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
48index 32f517e..5b39654 100644 55index 9e8cde2..fe240f0 100644
49--- a/src/modules/alsa/module-alsa-card.c 56--- a/src/modules/alsa/module-alsa-card.c
50+++ b/src/modules/alsa/module-alsa-card.c 57+++ b/src/modules/alsa/module-alsa-card.c
51@@ -754,15 +754,6 @@ int pa__init(pa_module *m) { 58@@ -770,15 +770,6 @@ int pa__init(pa_module *m) {
52 goto fail; 59 goto fail;
53 } 60 }
54 61
@@ -64,7 +71,7 @@ index 32f517e..5b39654 100644
64 u->card = pa_card_new(m->core, &data); 71 u->card = pa_card_new(m->core, &data);
65 pa_card_new_data_done(&data); 72 pa_card_new_data_done(&data);
66 73
67@@ -773,6 +764,16 @@ int pa__init(pa_module *m) { 74@@ -789,6 +780,16 @@ int pa__init(pa_module *m) {
68 u->card->set_profile = card_set_profile; 75 u->card->set_profile = card_set_profile;
69 76
70 init_jacks(u); 77 init_jacks(u);
@@ -82,10 +89,10 @@ index 32f517e..5b39654 100644
82 init_eld_ctls(u); 89 init_eld_ctls(u);
83 90
84diff --git a/src/modules/bluetooth/module-bluez4-device.c b/src/modules/bluetooth/module-bluez4-device.c 91diff --git a/src/modules/bluetooth/module-bluez4-device.c b/src/modules/bluetooth/module-bluez4-device.c
85index 94e6988..5efc5dc 100644 92index dd18217..5d0d3db 100644
86--- a/src/modules/bluetooth/module-bluez4-device.c 93--- a/src/modules/bluetooth/module-bluez4-device.c
87+++ b/src/modules/bluetooth/module-bluez4-device.c 94+++ b/src/modules/bluetooth/module-bluez4-device.c
88@@ -2307,15 +2307,6 @@ static int add_card(struct userdata *u) { 95@@ -2304,15 +2304,6 @@ static int add_card(struct userdata *u) {
89 *d = PA_BLUEZ4_PROFILE_OFF; 96 *d = PA_BLUEZ4_PROFILE_OFF;
90 pa_hashmap_put(data.profiles, p->name, p); 97 pa_hashmap_put(data.profiles, p->name, p);
91 98
@@ -101,7 +108,7 @@ index 94e6988..5efc5dc 100644
101 u->card = pa_card_new(u->core, &data); 108 u->card = pa_card_new(u->core, &data);
102 pa_card_new_data_done(&data); 109 pa_card_new_data_done(&data);
103 110
104@@ -2326,6 +2317,15 @@ static int add_card(struct userdata *u) { 111@@ -2323,6 +2314,15 @@ static int add_card(struct userdata *u) {
105 112
106 u->card->userdata = u; 113 u->card->userdata = u;
107 u->card->set_profile = card_set_profile; 114 u->card->set_profile = card_set_profile;
@@ -118,7 +125,7 @@ index 94e6988..5efc5dc 100644
118 d = PA_CARD_PROFILE_DATA(u->card->active_profile); 125 d = PA_CARD_PROFILE_DATA(u->card->active_profile);
119 126
120diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c 127diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c
121index 3321785..0081a21 100644 128index b015c67..7b90a31 100644
122--- a/src/modules/bluetooth/module-bluez5-device.c 129--- a/src/modules/bluetooth/module-bluez5-device.c
123+++ b/src/modules/bluetooth/module-bluez5-device.c 130+++ b/src/modules/bluetooth/module-bluez5-device.c
124@@ -1959,6 +1959,7 @@ static int add_card(struct userdata *u) { 131@@ -1959,6 +1959,7 @@ static int add_card(struct userdata *u) {
@@ -130,10 +137,10 @@ index 3321785..0081a21 100644
130 p = PA_CARD_PROFILE_DATA(u->card->active_profile); 137 p = PA_CARD_PROFILE_DATA(u->card->active_profile);
131 u->profile = *p; 138 u->profile = *p;
132diff --git a/src/modules/macosx/module-coreaudio-device.c b/src/modules/macosx/module-coreaudio-device.c 139diff --git a/src/modules/macosx/module-coreaudio-device.c b/src/modules/macosx/module-coreaudio-device.c
133index 4bbb5d5..41f151f 100644 140index 0c92d42..7190ee9 100644
134--- a/src/modules/macosx/module-coreaudio-device.c 141--- a/src/modules/macosx/module-coreaudio-device.c
135+++ b/src/modules/macosx/module-coreaudio-device.c 142+++ b/src/modules/macosx/module-coreaudio-device.c
136@@ -764,6 +764,7 @@ int pa__init(pa_module *m) { 143@@ -807,6 +807,7 @@ int pa__init(pa_module *m) {
137 pa_card_new_data_done(&card_new_data); 144 pa_card_new_data_done(&card_new_data);
138 u->card->userdata = u; 145 u->card->userdata = u;
139 u->card->set_profile = card_set_profile; 146 u->card->set_profile = card_set_profile;
@@ -142,10 +149,10 @@ index 4bbb5d5..41f151f 100644
142 u->rtpoll = pa_rtpoll_new(); 149 u->rtpoll = pa_rtpoll_new();
143 pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll); 150 pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
144diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c 151diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c
145index baa2f4f..0501ac8 100644 152index f906843..dce6674 100644
146--- a/src/modules/module-card-restore.c 153--- a/src/modules/module-card-restore.c
147+++ b/src/modules/module-card-restore.c 154+++ b/src/modules/module-card-restore.c
148@@ -485,34 +485,38 @@ static pa_hook_result_t port_offset_change_callback(pa_core *c, pa_device_port * 155@@ -515,34 +515,38 @@ static pa_hook_result_t port_offset_change_callback(pa_core *c, pa_device_port *
149 return PA_HOOK_OK; 156 return PA_HOOK_OK;
150 } 157 }
151 158
@@ -189,24 +196,24 @@ index baa2f4f..0501ac8 100644
189+ pa_log_info("Restoring port latency offsets for card %s.", card->name); 196+ pa_log_info("Restoring port latency offsets for card %s.", card->name);
190 197
191 PA_HASHMAP_FOREACH(p_info, e->ports, state) 198 PA_HASHMAP_FOREACH(p_info, e->ports, state)
192- if ((p = pa_hashmap_get(new_data->ports, p_info->name))) 199- if ((p = pa_hashmap_get(new_data->ports, p_info->name))) {
193+ if ((p = pa_hashmap_get(card->ports, p_info->name))) 200+ if ((p = pa_hashmap_get(card->ports, p_info->name))) {
194 p->latency_offset = p_info->offset; 201 p->latency_offset = p_info->offset;
195 202 if (!p->preferred_profile && p_info->profile)
196 entry_free(e); 203 pa_device_port_set_preferred_profile(p, p_info->profile);
197diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c 204diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
198index cc4c784..1b7f71b 100644 205index f92ac87..1a6e705 100644
199--- a/src/pulsecore/card.c 206--- a/src/pulsecore/card.c
200+++ b/src/pulsecore/card.c 207+++ b/src/pulsecore/card.c
201@@ -151,6 +151,7 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) { 208@@ -148,6 +148,7 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
202 pa_assert(!pa_hashmap_isempty(data->profiles)); 209 pa_assert(!pa_hashmap_isempty(data->profiles));
203 210
204 c = pa_xnew(pa_card, 1); 211 c = pa_xnew0(pa_card, 1);
205+ c->state = PA_CARD_STATE_INIT; 212+ c->state = PA_CARD_STATE_INIT;
206 213
207 if (!(name = pa_namereg_register(core, data->name, PA_NAMEREG_CARD, c, data->namereg_fail))) { 214 if (!(name = pa_namereg_register(core, data->name, PA_NAMEREG_CARD, c, data->namereg_fail))) {
208 pa_xfree(c); 215 pa_xfree(c);
209@@ -159,12 +160,6 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) { 216@@ -156,12 +157,6 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
210 217
211 pa_card_new_data_set_name(data, name); 218 pa_card_new_data_set_name(data, name);
212 219
@@ -219,22 +226,24 @@ index cc4c784..1b7f71b 100644
219 c->core = core; 226 c->core = core;
220 c->name = pa_xstrdup(data->name); 227 c->name = pa_xstrdup(data->name);
221 c->proplist = pa_proplist_copy(data->proplist); 228 c->proplist = pa_proplist_copy(data->proplist);
222@@ -187,30 +182,6 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) { 229@@ -184,38 +179,43 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
223 PA_HASHMAP_FOREACH(port, c->ports, state) 230 PA_HASHMAP_FOREACH(port, c->ports, state)
224 port->card = c; 231 port->card = c;
225 232
226- c->active_profile = NULL;
227- c->save_profile = false;
228-
229- if (data->active_profile) 233- if (data->active_profile)
230- if ((c->active_profile = pa_hashmap_get(c->profiles, data->active_profile))) 234- if ((c->active_profile = pa_hashmap_get(c->profiles, data->active_profile)))
231- c->save_profile = data->save_profile; 235- c->save_profile = data->save_profile;
232- 236+ pa_device_init_description(c->proplist, c);
237+ pa_device_init_icon(c->proplist, true);
238+ pa_device_init_intended_roles(c->proplist);
239
233- if (!c->active_profile) { 240- if (!c->active_profile) {
234- PA_HASHMAP_FOREACH(profile, c->profiles, state) { 241- PA_HASHMAP_FOREACH(profile, c->profiles, state) {
235- if (profile->available == PA_AVAILABLE_NO) 242- if (profile->available == PA_AVAILABLE_NO)
236- continue; 243- continue;
237- 244+ return c;
245+}
246
238- if (!c->active_profile || profile->priority > c->active_profile->priority) 247- if (!c->active_profile || profile->priority > c->active_profile->priority)
239- c->active_profile = profile; 248- c->active_profile = profile;
240- } 249- }
@@ -245,27 +254,10 @@ index cc4c784..1b7f71b 100644
245- c->active_profile = profile; 254- c->active_profile = profile;
246- } 255- }
247- pa_assert(c->active_profile); 256- pa_assert(c->active_profile);
248- }
249-
250 c->userdata = NULL;
251 c->set_profile = NULL;
252 c->active_profile = NULL;
253@@ -219,13 +190,39 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
254 pa_device_init_icon(c->proplist, true);
255 pa_device_init_intended_roles(c->proplist);
256
257- pa_assert_se(pa_idxset_put(core->cards, c, &c->index) >= 0);
258+ return c;
259+}
260
261- pa_log_info("Created %u \"%s\"", c->index, c->name);
262- pa_subscription_post(core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_NEW, c->index);
263+void pa_card_put(pa_card *card) { 257+void pa_card_put(pa_card *card) {
264+ pa_card_profile *profile; 258+ pa_card_profile *profile;
265+ void *state; 259+ void *state;
266 260+
267- pa_hook_fire(&core->hooks[PA_CORE_HOOK_CARD_PUT], c);
268- return c;
269+ pa_assert(card); 261+ pa_assert(card);
270+ 262+
271+ PA_HASHMAP_FOREACH(profile, card->profiles, state) { 263+ PA_HASHMAP_FOREACH(profile, card->profiles, state) {
@@ -274,8 +266,11 @@ index cc4c784..1b7f71b 100644
274+ 266+
275+ if (!card->active_profile || profile->priority > card->active_profile->priority) 267+ if (!card->active_profile || profile->priority > card->active_profile->priority)
276+ card->active_profile = profile; 268+ card->active_profile = profile;
277+ } 269 }
278+ 270
271- pa_device_init_description(c->proplist, c);
272- pa_device_init_icon(c->proplist, true);
273- pa_device_init_intended_roles(c->proplist);
279+ /* If all profiles are unavailable, then we still need to pick one */ 274+ /* If all profiles are unavailable, then we still need to pick one */
280+ if (!card->active_profile) { 275+ if (!card->active_profile) {
281+ PA_HASHMAP_FOREACH(profile, card->profiles, state) 276+ PA_HASHMAP_FOREACH(profile, card->profiles, state)
@@ -283,19 +278,24 @@ index cc4c784..1b7f71b 100644
283+ card->active_profile = profile; 278+ card->active_profile = profile;
284+ } 279+ }
285+ pa_assert(card->active_profile); 280+ pa_assert(card->active_profile);
286+ 281
282- pa_assert_se(pa_idxset_put(core->cards, c, &c->index) >= 0);
287+ pa_hook_fire(&card->core->hooks[PA_CORE_HOOK_CARD_NEW], card); 283+ pa_hook_fire(&card->core->hooks[PA_CORE_HOOK_CARD_NEW], card);
288+ 284
285- pa_log_info("Created %u \"%s\"", c->index, c->name);
286- pa_subscription_post(core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_NEW, c->index);
289+ pa_assert_se(pa_idxset_put(card->core->cards, card, &card->index) >= 0); 287+ pa_assert_se(pa_idxset_put(card->core->cards, card, &card->index) >= 0);
290+ card->state = PA_CARD_STATE_LINKED; 288+ card->state = PA_CARD_STATE_LINKED;
291+ 289
290- pa_hook_fire(&core->hooks[PA_CORE_HOOK_CARD_PUT], c);
291- return c;
292+ pa_log_info("Created %u \"%s\"", card->index, card->name); 292+ pa_log_info("Created %u \"%s\"", card->index, card->name);
293+ pa_hook_fire(&card->core->hooks[PA_CORE_HOOK_CARD_PUT], card); 293+ pa_hook_fire(&card->core->hooks[PA_CORE_HOOK_CARD_PUT], card);
294+ pa_subscription_post(card->core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_NEW, card->index); 294+ pa_subscription_post(card->core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_NEW, card->index);
295 } 295 }
296 296
297 void pa_card_free(pa_card *c) { 297 void pa_card_free(pa_card *c) {
298@@ -292,17 +289,24 @@ int pa_card_set_profile(pa_card *c, pa_card_profile *profile, bool save) { 298@@ -306,20 +306,27 @@ int pa_card_set_profile(pa_card *c, pa_card_profile *profile, bool save) {
299 return 0; 299 return 0;
300 } 300 }
301 301
@@ -317,6 +317,9 @@ index cc4c784..1b7f71b 100644
317 c->active_profile = profile; 317 c->active_profile = profile;
318 c->save_profile = save; 318 c->save_profile = save;
319 319
320 if (save)
321 update_port_preferred_profile(c);
322
320- pa_hook_fire(&c->core->hooks[PA_CORE_HOOK_CARD_PROFILE_CHANGED], c); 323- pa_hook_fire(&c->core->hooks[PA_CORE_HOOK_CARD_PROFILE_CHANGED], c);
321+ if (c->state != PA_CARD_STATE_INIT) { 324+ if (c->state != PA_CARD_STATE_INIT) {
322+ pa_log_info("Changed profile of card %u \"%s\" to %s", c->index, c->name, profile->name); 325+ pa_log_info("Changed profile of card %u \"%s\" to %s", c->index, c->name, profile->name);
@@ -327,22 +330,22 @@ index cc4c784..1b7f71b 100644
327 return 0; 330 return 0;
328 } 331 }
329diff --git a/src/pulsecore/card.h b/src/pulsecore/card.h 332diff --git a/src/pulsecore/card.h b/src/pulsecore/card.h
330index 1c33958..dbbc1c2 100644 333index fff9057..a944301 100644
331--- a/src/pulsecore/card.h 334--- a/src/pulsecore/card.h
332+++ b/src/pulsecore/card.h 335+++ b/src/pulsecore/card.h
333@@ -37,6 +37,11 @@ typedef enum pa_available { 336@@ -34,6 +34,11 @@ typedef enum pa_available {
334 #include <pulsecore/module.h> 337 PA_AVAILABLE_YES = 2,
335 #include <pulsecore/idxset.h> 338 } pa_available_t;
336 339
337+typedef enum pa_card_state { 340+typedef enum pa_card_state {
338+ PA_CARD_STATE_INIT, 341+ PA_CARD_STATE_INIT,
339+ PA_CARD_STATE_LINKED, 342+ PA_CARD_STATE_LINKED,
340+} pa_card_state_t; 343+} pa_card_state_t;
341+ 344+
342 typedef struct pa_card_profile { 345 struct pa_card_profile {
343 pa_card *card; 346 pa_card *card;
344 char *name; 347 char *name;
345@@ -61,6 +66,7 @@ typedef struct pa_card_profile { 348@@ -66,6 +71,7 @@ struct pa_card_profile {
346 349
347 struct pa_card { 350 struct pa_card {
348 uint32_t index; 351 uint32_t index;
@@ -350,7 +353,7 @@ index 1c33958..dbbc1c2 100644
350 pa_core *core; 353 pa_core *core;
351 354
352 char *name; 355 char *name;
353@@ -115,6 +121,7 @@ void pa_card_new_data_set_profile(pa_card_new_data *data, const char *profile); 356@@ -120,6 +126,7 @@ void pa_card_new_data_set_profile(pa_card_new_data *data, const char *profile);
354 void pa_card_new_data_done(pa_card_new_data *data); 357 void pa_card_new_data_done(pa_card_new_data *data);
355 358
356 pa_card *pa_card_new(pa_core *c, pa_card_new_data *data); 359 pa_card *pa_card_new(pa_core *c, pa_card_new_data *data);
@@ -359,5 +362,5 @@ index 1c33958..dbbc1c2 100644
359 362
360 void pa_card_add_profile(pa_card *c, pa_card_profile *profile); 363 void pa_card_add_profile(pa_card *c, pa_card_profile *profile);
361-- 364--
3622.1.4 3652.7.0
363 366
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/0004-alsa-set-availability-for-some-unavailable-profiles.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/0004-alsa-set-availability-for-some-unavailable-profiles.patch
index bb318aa06e..e0efa70f32 100644
--- a/meta/recipes-multimedia/pulseaudio/pulseaudio/0004-alsa-set-availability-for-some-unavailable-profiles.patch
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/0004-alsa-set-availability-for-some-unavailable-profiles.patch
@@ -1,4 +1,4 @@
1From 0136b73158f60d5dc630ae348b18df3b59a2a5c2 Mon Sep 17 00:00:00 2001 1From 690d567e298f6687b61c82660b051df5b25482ee Mon Sep 17 00:00:00 2001
2From: Tanu Kaskinen <tanuk@iki.fi> 2From: Tanu Kaskinen <tanuk@iki.fi>
3Date: Fri, 23 Oct 2015 13:37:11 +0300 3Date: Fri, 23 Oct 2015 13:37:11 +0300
4Subject: [PATCH 4/4] alsa: set availability for (some) unavailable profiles 4Subject: [PATCH 4/4] alsa: set availability for (some) unavailable profiles
@@ -22,28 +22,36 @@ pa_card_profile, however.
22 22
23BugLink: https://bugzilla.yoctoproject.org/show_bug.cgi?id=8448 23BugLink: https://bugzilla.yoctoproject.org/show_bug.cgi?id=8448
24 24
25Upstream-Status: Submitted [http://lists.freedesktop.org/archives/pulseaudio-discuss/2015-October/024614.html]
26Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> 25Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
26
27Rebased on 8.0.
28
29Upstream-Status: Denied [The patch set needs some work to be accepted.
30The review thread:
31http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/24301]
32
33Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
27--- 34---
28 src/modules/alsa/module-alsa-card.c | 24 ++++++++++++++++++++++++ 35 src/modules/alsa/module-alsa-card.c | 25 +++++++++++++++++++++++++
29 1 file changed, 24 insertions(+) 36 1 file changed, 25 insertions(+)
30 37
31diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c 38diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
32index 5b39654..73a846c 100644 39index fe240f0..bdbdc12 100644
33--- a/src/modules/alsa/module-alsa-card.c 40--- a/src/modules/alsa/module-alsa-card.c
34+++ b/src/modules/alsa/module-alsa-card.c 41+++ b/src/modules/alsa/module-alsa-card.c
35@@ -366,6 +366,7 @@ static int report_jack_state(snd_mixer_elem_t *melem, unsigned int mask) { 42@@ -366,6 +366,8 @@ static int report_jack_state(snd_mixer_elem_t *melem, unsigned int mask) {
36 void *state; 43 void *state;
37 pa_alsa_jack *jack; 44 pa_alsa_jack *jack;
38 pa_device_port *port; 45 struct temp_port_avail *tp, *tports;
46+ pa_device_port *port;
39+ pa_card_profile *profile; 47+ pa_card_profile *profile;
40 48
41 pa_assert(u); 49 pa_assert(u);
42 50
43@@ -396,6 +397,29 @@ static int report_jack_state(snd_mixer_elem_t *melem, unsigned int mask) { 51@@ -412,6 +414,29 @@ static int report_jack_state(snd_mixer_elem_t *melem, unsigned int mask) {
44 } 52 pa_device_port_set_available(tp->port, tp->avail);
45 report_port_state(port, u); 53
46 } 54 pa_xfree(tports);
47+ 55+
48+ /* Update profile availabilities. The logic could be improved; for now we 56+ /* Update profile availabilities. The logic could be improved; for now we
49+ * only set obviously unavailable profiles (those that contain only 57+ * only set obviously unavailable profiles (those that contain only
@@ -71,5 +79,5 @@ index 5b39654..73a846c 100644
71 } 79 }
72 80
73-- 81--
742.1.4 822.7.0
75 83
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/fix-git-version-gen.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/fix-git-version-gen.patch
deleted file mode 100644
index ed94250401..0000000000
--- a/meta/recipes-multimedia/pulseaudio/pulseaudio/fix-git-version-gen.patch
+++ /dev/null
@@ -1,24 +0,0 @@
1git-version-gen gets confused if a tarball is being built inside a git directory
2(ie your build directory is a subdirectory of a poky clone), and ends up calling
3the release 6.0-dirty. Add a shortcut exit so if a tarball is detected it
4doesn't attempt to look at the git status.
5
6Upstream-Status: Submitted (https://bugs.freedesktop.org/show_bug.cgi?id=90936)
7Signed-off-by: Ross Burton <ross.burton@intel.com>
8
9diff --git a/git-version-gen b/git-version-gen
10index 7546884..079b93e 100755
11--- a/git-version-gen
12+++ b/git-version-gen
13@@ -84,7 +84,10 @@ then
14 v=`cat $tarball_version_file` || exit 1
15 case $v in
16 *$nl*) v= ;; # reject multi-line output
17- [0-9]*) ;;
18+ [0-9]*)
19+ echo "$v" | tr -d '\012'
20+ exit 0
21+ ;;
22 *) v= ;;
23 esac
24 test -z "$v" \
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio_6.0.bb b/meta/recipes-multimedia/pulseaudio/pulseaudio_8.0.bb
index ec629aa023..b01ba8f689 100644
--- a/meta/recipes-multimedia/pulseaudio/pulseaudio_6.0.bb
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio_8.0.bb
@@ -3,16 +3,15 @@ require pulseaudio.inc
3SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/${BP}.tar.xz \ 3SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/${BP}.tar.xz \
4 file://0001-padsp-Make-it-compile-on-musl.patch \ 4 file://0001-padsp-Make-it-compile-on-musl.patch \
5 file://0001-client-conf-Add-allow-autospawn-for-root.patch \ 5 file://0001-client-conf-Add-allow-autospawn-for-root.patch \
6 file://0001-conf-parser-add-support-for-.d-directories.patch \
7 file://fix-git-version-gen.patch \
8 file://volatiles.04_pulse \ 6 file://volatiles.04_pulse \
9 file://0001-card-add-pa_card_profile.ports.patch \ 7 file://0001-card-add-pa_card_profile.ports.patch \
10 file://0002-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch \ 8 file://0002-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch \
11 file://0003-card-move-profile-selection-after-pa_card_new.patch \ 9 file://0003-card-move-profile-selection-after-pa_card_new.patch \
12 file://0004-alsa-set-availability-for-some-unavailable-profiles.patch \ 10 file://0004-alsa-set-availability-for-some-unavailable-profiles.patch \
11 file://0001-Revert-module-switch-on-port-available-Route-to-pref.patch \
13" 12"
14SRC_URI[md5sum] = "b691e83b7434c678dffacfa3a027750e" 13SRC_URI[md5sum] = "8678442ba0bb4b4c33ac6f62542962df"
15SRC_URI[sha256sum] = "b50640e0b80b1607600accfad2e45aabb79d379bf6354c9671efa2065477f6f6" 14SRC_URI[sha256sum] = "690eefe28633466cfd1ab9d85ebfa9376f6b622deec6bfee5091ac9737cd1989"
16 15
17do_compile_prepend() { 16do_compile_prepend() {
18 mkdir -p ${S}/libltdl 17 mkdir -p ${S}/libltdl