From 319595e8264af32c54ba6324e220eb4ec43b7565 Mon Sep 17 00:00:00 2001 From: Tanu Kaskinen Date: Wed, 20 Jul 2016 03:20:22 +0300 Subject: pulseaudio: 8.0 -> 9.0 Release notes: https://www.freedesktop.org/wiki/Software/PulseAudio/Notes/9.0/ Rebased 0001-client-conf-Add-allow-autospawn-for-root.patch. Removed 0001-Revert-module-switch-on-port-available-Route-to-pref.patch, because the issues that were caused by the reverted commit have been fixed. The patch set that fixes the initial selection of HDMI profiles (YOCTO#8448) is replaced with updated patches cherry-picked from upstream. Signed-off-by: Tanu Kaskinen Signed-off-by: Ross Burton --- ...le-switch-on-port-available-Route-to-pref.patch | 268 --------------- ...oth-fail-if-user-requested-profile-doesn-.patch | 61 ++++ .../0001-card-add-pa_card_profile.ports.patch | 218 ------------ ...-client-conf-Add-allow-autospawn-for-root.patch | 18 +- ...oth-fail-if-user-requested-profile-doesn-.patch | 65 ---- ...ard-don-t-allow-the-CARD_NEW-hook-to-fail.patch | 37 ++ ...-move-profile-selection-after-pa_card_new.patch | 373 ++++++++++++--------- ...vailability-for-some-unavailable-profiles.patch | 83 ----- ...rd-remove-pa_card_new_data.active_profile.patch | 72 ++++ ...vailability-for-some-unavailable-profiles.patch | 79 +++++ .../pulseaudio/pulseaudio_8.0.bb | 19 -- .../pulseaudio/pulseaudio_9.0.bb | 19 ++ 12 files changed, 495 insertions(+), 817 deletions(-) delete mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio/0001-Revert-module-switch-on-port-available-Route-to-pref.patch create mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio/0001-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch delete mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio/0001-card-add-pa_card_profile.ports.patch delete mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio/0002-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch create mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio/0002-card-don-t-allow-the-CARD_NEW-hook-to-fail.patch delete mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio/0004-alsa-set-availability-for-some-unavailable-profiles.patch create mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio/0004-card-remove-pa_card_new_data.active_profile.patch create mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio/0005-alsa-set-availability-for-some-unavailable-profiles.patch delete mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio_8.0.bb create mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio_9.0.bb (limited to 'meta') 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 deleted file mode 100644 index 1c1e2fbdbc..0000000000 --- a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-Revert-module-switch-on-port-available-Route-to-pref.patch +++ /dev/null @@ -1,268 +0,0 @@ -From b8b9b3da94a0c27090ceba243fdf54fb518c5489 Mon Sep 17 00:00:00 2001 -From: Tanu Kaskinen -Date: Mon, 1 Feb 2016 15:34:59 +0200 -Subject: [PATCH] Revert "module-switch-on-port-available: Route to preferred - profile" - -This reverts commit e87100d41ef6d14f8dc7f803582191d9f8d8f183. - -The reverted commit had some unwanted consequences: -https://bugs.freedesktop.org/show_bug.cgi?id=93903 -https://bugs.freedesktop.org/show_bug.cgi?id=93946 - -The first regression has a fix here: -https://patchwork.freedesktop.org/patch/72053/ - -The second regression, however, doesn't have a fix yet. Therefore, -it's best to revert the offending patch for now. - -Upstream-Status: Inappropriate [Upstream plans to fix the issues -properly.] - -Signed-off-by: Tanu Kaskinen ---- - src/modules/module-switch-on-port-available.c | 172 ++++++++++---------------- - 1 file changed, 67 insertions(+), 105 deletions(-) - -diff --git a/src/modules/module-switch-on-port-available.c b/src/modules/module-switch-on-port-available.c -index 5dd9786..8de68a3 100644 ---- a/src/modules/module-switch-on-port-available.c -+++ b/src/modules/module-switch-on-port-available.c -@@ -74,25 +74,22 @@ static bool profile_good_for_input(pa_card_profile *profile) { - static int try_to_switch_profile(pa_device_port *port) { - pa_card_profile *best_profile = NULL, *profile; - void *state; -- unsigned best_prio = 0; - -- pa_log_debug("Finding best profile for port %s, preferred = %s", -- port->name, pa_strnull(port->preferred_profile)); -+ pa_log_debug("Finding best profile"); - - PA_HASHMAP_FOREACH(profile, port->profiles, state) { - bool good = false; -- const char *name; -- unsigned prio = profile->priority; -+ -+ if (best_profile && best_profile->priority >= profile->priority) -+ continue; - - /* We make a best effort to keep other direction unchanged */ - switch (port->direction) { - case PA_DIRECTION_OUTPUT: -- name = profile->output_name; - good = profile_good_for_output(profile); - break; - - case PA_DIRECTION_INPUT: -- name = profile->input_name; - good = profile_good_for_input(profile); - break; - } -@@ -100,15 +97,7 @@ static int try_to_switch_profile(pa_device_port *port) { - if (!good) - continue; - -- /* Give a high bonus in case this is the preferred profile */ -- if (port->preferred_profile && pa_streq(name ? name : profile->name, port->preferred_profile)) -- prio += 1000000; -- -- if (best_profile && best_prio >= prio) -- continue; -- - best_profile = profile; -- best_prio = prio; - } - - if (!best_profile) { -@@ -124,125 +113,98 @@ static int try_to_switch_profile(pa_device_port *port) { - return 0; - } - --struct port_pointers { -- pa_device_port *port; -- pa_sink *sink; -- pa_source *source; -- bool is_possible_profile_active; -- bool is_preferred_profile_active; -- bool is_port_active; --}; -- --static const char* profile_name_for_dir(pa_card_profile *cp, pa_direction_t dir) { -- if (dir == PA_DIRECTION_OUTPUT && cp->output_name) -- return cp->output_name; -- if (dir == PA_DIRECTION_INPUT && cp->input_name) -- return cp->input_name; -- return cp->name; --} -- --static struct port_pointers find_port_pointers(pa_device_port *port) { -- struct port_pointers pp = { .port = port }; -+static void find_sink_and_source(pa_card *card, pa_device_port *port, pa_sink **si, pa_source **so) { -+ pa_sink *sink = NULL; -+ pa_source *source = NULL; - uint32_t state; -- pa_card *card; -- -- pa_assert(port); -- pa_assert_se(card = port->card); - - switch (port->direction) { - case PA_DIRECTION_OUTPUT: -- PA_IDXSET_FOREACH(pp.sink, card->sinks, state) -- if (port == pa_hashmap_get(pp.sink->ports, port->name)) -+ PA_IDXSET_FOREACH(sink, card->sinks, state) -+ if (port == pa_hashmap_get(sink->ports, port->name)) - break; - break; - - case PA_DIRECTION_INPUT: -- PA_IDXSET_FOREACH(pp.source, card->sources, state) -- if (port == pa_hashmap_get(pp.source->ports, port->name)) -+ PA_IDXSET_FOREACH(source, card->sources, state) -+ if (port == pa_hashmap_get(source->ports, port->name)) - break; - break; - } - -- pp.is_possible_profile_active = -- card->active_profile == pa_hashmap_get(port->profiles, card->active_profile->name); -- pp.is_preferred_profile_active = pp.is_possible_profile_active && (!port->preferred_profile || -- pa_safe_streq(port->preferred_profile, profile_name_for_dir(card->active_profile, port->direction))); -- pp.is_port_active = (pp.sink && pp.sink->active_port == port) || (pp.source && pp.source->active_port == port); -- -- return pp; -+ *si = sink; -+ *so = source; - } - --/* Switches to a port, switching profiles if necessary or preferred */ --static bool switch_to_port(pa_device_port *port) { -- struct port_pointers pp = find_port_pointers(port); -+static pa_hook_result_t port_available_hook_callback(pa_core *c, pa_device_port *port, void* userdata) { -+ pa_card* card; -+ pa_sink *sink; -+ pa_source *source; -+ bool is_active_profile, is_active_port; - -- if (pp.is_port_active) -- return true; /* Already selected */ -+ if (port->available == PA_AVAILABLE_UNKNOWN) -+ return PA_HOOK_OK; - -- pa_log_debug("Trying to switch to port %s", port->name); -- if (!pp.is_preferred_profile_active) { -- if (try_to_switch_profile(port) < 0) { -- if (pp.is_possible_profile_active) -- return false; -- } -- else -- /* Now that profile has changed, our sink and source pointers must be updated */ -- pp = find_port_pointers(port); -- } -+ card = port->card; - -- if (pp.source) -- pa_source_set_port(pp.source, port->name, false); -- if (pp.sink) -- pa_sink_set_port(pp.sink, port->name, false); -- return true; --} -+ if (!card) { -+ pa_log_warn("Port %s does not have a card", port->name); -+ return PA_HOOK_OK; -+ } - --/* Switches away from a port, switching profiles if necessary or preferred */ --static bool switch_from_port(pa_device_port *port) { -- struct port_pointers pp = find_port_pointers(port); -- pa_device_port *p, *best_port = NULL; -- void *state; -+ if (pa_idxset_size(card->sinks) == 0 && pa_idxset_size(card->sources) == 0) -+ /* This card is not initialized yet. We'll handle it in -+ sink_new / source_new callbacks later. */ -+ return PA_HOOK_OK; - -- if (!pp.is_port_active) -- return true; /* Already deselected */ -+ find_sink_and_source(card, port, &sink, &source); - -- /* Try to find a good enough port to switch to */ -- PA_HASHMAP_FOREACH(p, port->card->ports, state) -- if (p->direction == port->direction && p != port && p->available != PA_AVAILABLE_NO && -- (!best_port || best_port->priority < p->priority)) -- best_port = p; -+ is_active_profile = card->active_profile == pa_hashmap_get(port->profiles, card->active_profile->name); -+ is_active_port = (sink && sink->active_port == port) || (source && source->active_port == port); - -- pa_log_debug("Trying to switch away from port %s, found %s", port->name, best_port ? best_port->name : "no better option"); -+ if (port->available == PA_AVAILABLE_NO && !is_active_port) -+ return PA_HOOK_OK; - -- if (best_port) -- return switch_to_port(best_port); -+ if (port->available == PA_AVAILABLE_YES) { -+ if (is_active_port) -+ return PA_HOOK_OK; - -- return false; --} -+ if (!is_active_profile) { -+ if (try_to_switch_profile(port) < 0) -+ return PA_HOOK_OK; - -+ pa_assert(card->active_profile == pa_hashmap_get(port->profiles, card->active_profile->name)); - --static pa_hook_result_t port_available_hook_callback(pa_core *c, pa_device_port *port, void* userdata) { -- pa_assert(port); -+ /* Now that profile has changed, our sink and source pointers must be updated */ -+ find_sink_and_source(card, port, &sink, &source); -+ } - -- if (!port->card) { -- pa_log_warn("Port %s does not have a card", port->name); -- return PA_HOOK_OK; -+ if (source) -+ pa_source_set_port(source, port->name, false); -+ if (sink) -+ pa_sink_set_port(sink, port->name, false); - } - -- if (pa_idxset_size(port->card->sinks) == 0 && pa_idxset_size(port->card->sources) == 0) -- /* This card is not initialized yet. We'll handle it in -- sink_new / source_new callbacks later. */ -- return PA_HOOK_OK; -+ if (port->available == PA_AVAILABLE_NO) { -+ if (sink) { -+ pa_device_port *p2 = pa_device_port_find_best(sink->ports); -+ -+ if (p2 && p2->available != PA_AVAILABLE_NO) -+ pa_sink_set_port(sink, p2->name, false); -+ else { -+ /* Maybe try to switch to another profile? */ -+ } -+ } - -- switch (port->available) { -- case PA_AVAILABLE_YES: -- switch_to_port(port); -- break; -- case PA_AVAILABLE_NO: -- switch_from_port(port); -- break; -- default: -- break; -+ if (source) { -+ pa_device_port *p2 = pa_device_port_find_best(source->ports); -+ -+ if (p2 && p2->available != PA_AVAILABLE_NO) -+ pa_source_set_port(source, p2->name, false); -+ else { -+ /* Maybe try to switch to another profile? */ -+ } -+ } - } - - return PA_HOOK_OK; --- -2.7.0 - diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch new file mode 100644 index 0000000000..2f72ceb33b --- /dev/null +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch @@ -0,0 +1,61 @@ +From 9c3cdfcd198ef9727ea542f284ac6d8c1bcd7a3a Mon Sep 17 00:00:00 2001 +From: Tanu Kaskinen +Date: Fri, 23 Oct 2015 12:36:34 +0300 +Subject: [PATCH 1/5] alsa, bluetooth: fail if user-requested profile doesn't + exist + +If we can't fulfill the user request fully, I think we shouldn't +fulfill it at all, to make it clear that the requested operation +didn't succeed. + +Upstream-Status: Accepted [expected in 10.0] + +Signed-off-by: Tanu Kaskinen +--- + src/modules/alsa/module-alsa-card.c | 11 +++++++++-- + src/modules/bluetooth/module-bluez4-device.c | 7 +++++-- + 2 files changed, 14 insertions(+), 4 deletions(-) + +diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c +index e5cc4ae..d761683 100644 +--- a/src/modules/alsa/module-alsa-card.c ++++ b/src/modules/alsa/module-alsa-card.c +@@ -799,8 +799,15 @@ int pa__init(pa_module *m) { + goto fail; + } + +- if ((profile = pa_modargs_get_value(u->modargs, "profile", NULL))) +- pa_card_new_data_set_profile(&data, profile); ++ if ((profile = pa_modargs_get_value(u->modargs, "profile", NULL))) { ++ if (pa_hashmap_get(data.profiles, profile)) ++ pa_card_new_data_set_profile(&data, profile); ++ else { ++ pa_log("No such profile: %s", profile); ++ pa_card_new_data_done(&data); ++ goto fail; ++ } ++ } + + u->card = pa_card_new(m->core, &data); + pa_card_new_data_done(&data); +diff --git a/src/modules/bluetooth/module-bluez4-device.c b/src/modules/bluetooth/module-bluez4-device.c +index 9a921a5..a2de525 100644 +--- a/src/modules/bluetooth/module-bluez4-device.c ++++ b/src/modules/bluetooth/module-bluez4-device.c +@@ -2301,8 +2301,11 @@ static int add_card(struct userdata *u) { + if ((default_profile = pa_modargs_get_value(u->modargs, "profile", NULL))) { + if (pa_hashmap_get(data.profiles, default_profile)) + pa_card_new_data_set_profile(&data, default_profile); +- else +- pa_log_warn("Profile '%s' not valid or not supported by device.", default_profile); ++ else { ++ pa_log("Profile '%s' not valid or not supported by device.", default_profile); ++ pa_card_new_data_done(&data); ++ return -1; ++ } + } + + u->card = pa_card_new(u->core, &data); +-- +2.8.1 + 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 deleted file mode 100644 index 84c951940b..0000000000 --- a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-card-add-pa_card_profile.ports.patch +++ /dev/null @@ -1,218 +0,0 @@ -From d1c02971867bea10afcafc82c965414012c4d6bd Mon Sep 17 00:00:00 2001 -From: Tanu Kaskinen -Date: Fri, 23 Oct 2015 12:23:13 +0300 -Subject: [PATCH 1/4] card: add pa_card_profile.ports - -Having ports accessible from pa_card_profile allows checking whether all ports -of a profile are unavailable, and therefore helps with managing the profile -availability (implemented in a later patch). - -http://bugzilla.yoctoproject.org/show_bug.cgi?id=8448 - -Signed-off-by: Jussi Kukkonen - -Rebased on 8.0. - -Upstream-Status: Denied [The patch set needs some work to be accepted. -The review thread: -http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/24301] - -Signed-off-by: Tanu Kaskinen ---- - src/modules/alsa/alsa-mixer.c | 4 +++- - src/modules/alsa/alsa-ucm.c | 1 + - src/modules/bluetooth/module-bluez4-device.c | 6 ++++++ - src/modules/bluetooth/module-bluez5-device.c | 6 ++++++ - src/pulsecore/card.c | 15 +++++++++++++++ - src/pulsecore/card.h | 4 ++++ - src/pulsecore/device-port.c | 7 ++++++- - 7 files changed, 41 insertions(+), 2 deletions(-) - -diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c -index 1fe2a02..5b76b06 100644 ---- a/src/modules/alsa/alsa-mixer.c -+++ b/src/modules/alsa/alsa-mixer.c -@@ -4783,8 +4783,10 @@ static pa_device_port* device_port_alsa_init(pa_hashmap *ports, /* card ports */ - path->port = p; - } - -- if (cp) -+ if (cp) { - pa_hashmap_put(p->profiles, cp->name, cp); -+ pa_card_profile_add_port(cp, p); -+ } - - if (extra) { - pa_hashmap_put(extra, p->name, p); -diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c -index 42f3242..68fcc26 100644 ---- a/src/modules/alsa/alsa-ucm.c -+++ b/src/modules/alsa/alsa-ucm.c -@@ -791,6 +791,7 @@ static void ucm_add_port_combination( - if (cp) { - pa_log_debug("Adding profile %s to port %s.", cp->name, port->name); - pa_hashmap_put(port->profiles, cp->name, cp); -+ pa_card_profile_add_port(cp, port); - } - - if (hash) { -diff --git a/src/modules/bluetooth/module-bluez4-device.c b/src/modules/bluetooth/module-bluez4-device.c -index 9a921a5..adecb32 100644 ---- a/src/modules/bluetooth/module-bluez4-device.c -+++ b/src/modules/bluetooth/module-bluez4-device.c -@@ -2180,6 +2180,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid - p->max_sink_channels = 2; - p->max_source_channels = 0; - pa_hashmap_put(output_port->profiles, p->name, p); -+ pa_card_profile_add_port(p, output_port); - - d = PA_CARD_PROFILE_DATA(p); - *d = PA_BLUEZ4_PROFILE_A2DP; -@@ -2191,6 +2192,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid - p->max_sink_channels = 0; - p->max_source_channels = 2; - pa_hashmap_put(input_port->profiles, p->name, p); -+ pa_card_profile_add_port(p, input_port); - - d = PA_CARD_PROFILE_DATA(p); - *d = PA_BLUEZ4_PROFILE_A2DP_SOURCE; -@@ -2203,6 +2205,8 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid - p->max_source_channels = 1; - pa_hashmap_put(input_port->profiles, p->name, p); - pa_hashmap_put(output_port->profiles, p->name, p); -+ pa_card_profile_add_port(p, input_port); -+ pa_card_profile_add_port(p, output_port); - - d = PA_CARD_PROFILE_DATA(p); - *d = PA_BLUEZ4_PROFILE_HSP; -@@ -2215,6 +2219,8 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid - p->max_source_channels = 1; - pa_hashmap_put(input_port->profiles, p->name, p); - pa_hashmap_put(output_port->profiles, p->name, p); -+ pa_card_profile_add_port(p, input_port); -+ pa_card_profile_add_port(p, output_port); - - d = PA_CARD_PROFILE_DATA(p); - *d = PA_BLUEZ4_PROFILE_HFGW; -diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c -index 84e6d55..b015c67 100644 ---- a/src/modules/bluetooth/module-bluez5-device.c -+++ b/src/modules/bluetooth/module-bluez5-device.c -@@ -1790,6 +1790,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid - cp->max_sink_channels = 2; - cp->max_source_channels = 0; - pa_hashmap_put(output_port->profiles, cp->name, cp); -+ pa_card_profile_add_port(cp, output_port); - - p = PA_CARD_PROFILE_DATA(cp); - *p = PA_BLUETOOTH_PROFILE_A2DP_SINK; -@@ -1801,6 +1802,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid - cp->max_sink_channels = 0; - cp->max_source_channels = 2; - pa_hashmap_put(input_port->profiles, cp->name, cp); -+ pa_card_profile_add_port(cp, input_port); - - p = PA_CARD_PROFILE_DATA(cp); - *p = PA_BLUETOOTH_PROFILE_A2DP_SOURCE; -@@ -1813,6 +1815,8 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid - cp->max_source_channels = 1; - pa_hashmap_put(input_port->profiles, cp->name, cp); - pa_hashmap_put(output_port->profiles, cp->name, cp); -+ pa_card_profile_add_port(cp, input_port); -+ pa_card_profile_add_port(cp, output_port); - - p = PA_CARD_PROFILE_DATA(cp); - *p = PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT; -@@ -1825,6 +1829,8 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid - cp->max_source_channels = 1; - pa_hashmap_put(input_port->profiles, cp->name, cp); - pa_hashmap_put(output_port->profiles, cp->name, cp); -+ pa_card_profile_add_port(cp, input_port); -+ pa_card_profile_add_port(cp, output_port); - - p = PA_CARD_PROFILE_DATA(cp); - *p = PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY; -diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c -index b6cbbf7..f92ac87 100644 ---- a/src/pulsecore/card.c -+++ b/src/pulsecore/card.c -@@ -45,6 +45,7 @@ pa_card_profile *pa_card_profile_new(const char *name, const char *description, - c->name = pa_xstrdup(name); - c->description = pa_xstrdup(description); - c->available = PA_AVAILABLE_UNKNOWN; -+ c->ports = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func); - - return c; - } -@@ -52,6 +53,14 @@ pa_card_profile *pa_card_profile_new(const char *name, const char *description, - void pa_card_profile_free(pa_card_profile *c) { - pa_assert(c); - -+ if (c->ports) { -+ pa_device_port *port; -+ void *state; -+ PA_HASHMAP_FOREACH(port, c->ports, state) -+ pa_hashmap_remove (port->profiles, c->name); -+ pa_hashmap_free(c->ports); -+ } -+ - pa_xfree(c->input_name); - pa_xfree(c->output_name); - pa_xfree(c->name); -@@ -59,6 +68,12 @@ void pa_card_profile_free(pa_card_profile *c) { - pa_xfree(c); - } - -+void pa_card_profile_add_port(pa_card_profile *profile, pa_device_port *port) { -+ pa_assert(profile); -+ -+ pa_hashmap_put(profile->ports, port->name, port); -+} -+ - void pa_card_profile_set_available(pa_card_profile *c, pa_available_t available) { - pa_core *core; - -diff --git a/src/pulsecore/card.h b/src/pulsecore/card.h -index 30bfc0e..fff9057 100644 ---- a/src/pulsecore/card.h -+++ b/src/pulsecore/card.h -@@ -50,6 +50,8 @@ struct pa_card_profile { - unsigned priority; - pa_available_t available; /* PA_AVAILABLE_UNKNOWN, PA_AVAILABLE_NO or PA_AVAILABLE_YES */ - -+ pa_hashmap *ports; /* port name -> pa_device_port */ -+ - /* We probably want to have different properties later on here */ - unsigned n_sinks; - unsigned n_sources; -@@ -107,6 +109,8 @@ typedef struct pa_card_new_data { - pa_card_profile *pa_card_profile_new(const char *name, const char *description, size_t extra); - void pa_card_profile_free(pa_card_profile *c); - -+void pa_card_profile_add_port(pa_card_profile *profile, pa_device_port *port); -+ - /* The profile's available status has changed */ - void pa_card_profile_set_available(pa_card_profile *c, pa_available_t available); - -diff --git a/src/pulsecore/device-port.c b/src/pulsecore/device-port.c -index 5807d3e..d12dfbc 100644 ---- a/src/pulsecore/device-port.c -+++ b/src/pulsecore/device-port.c -@@ -107,8 +107,13 @@ static void device_port_free(pa_object *o) { - if (p->proplist) - pa_proplist_free(p->proplist); - -- if (p->profiles) -+ if (p->profiles) { -+ pa_card_profile *profile; -+ void *state; -+ PA_HASHMAP_FOREACH(profile, p->profiles, state) -+ pa_hashmap_remove (profile->ports, p->name); - pa_hashmap_free(p->profiles); -+ } - - pa_xfree(p->preferred_profile); - pa_xfree(p->name); --- -2.7.0 - 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 bc32775836..33f7709ae4 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 @@ -1,4 +1,4 @@ -From 1cb5647f76dc8cd7bacbce2a64fac9e6c2dc3b16 Mon Sep 17 00:00:00 2001 +From babec3a50dd710d26b72f6c6d43bd79b04e954a6 Mon Sep 17 00:00:00 2001 From: Tanu Kaskinen Date: Tue, 28 Apr 2015 14:32:43 +0300 Subject: [PATCH] client-conf: Add allow-autospawn-for-root @@ -24,10 +24,10 @@ Signed-off-by: Tanu Kaskinen 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/man/pulse-client.conf.5.xml.in b/man/pulse-client.conf.5.xml.in -index 1002dbe..0058490 100644 +index b88898c..e737c96 100644 --- a/man/pulse-client.conf.5.xml.in +++ b/man/pulse-client.conf.5.xml.in -@@ -71,6 +71,15 @@ License along with PulseAudio; if not, see . +@@ -82,6 +82,15 @@ License along with PulseAudio; if not, see .