Backport a patch for pulseaudio crash at startup
This fixes an issue with jack detection code that led to assertion failures at startup, depending on the hardware configuration. https://bugzilla.redhat.com/show_bug.cgi?id=1000966 http://lists.freedesktop.org/archives/pulseaudio-discuss/2013-September/018741.html
This commit is contained in:
parent
afd6826cb6
commit
9c4013651f
111
0001-alsa-mixer-Drop-all-unused-paths-not-only-unsupporte.patch
Normal file
111
0001-alsa-mixer-Drop-all-unused-paths-not-only-unsupporte.patch
Normal file
@ -0,0 +1,111 @@
|
||||
From c07cf2017076cf00fa344f6fc7d188bbba06dc28 Mon Sep 17 00:00:00 2001
|
||||
From: David Henningsson <david.henningsson@canonical.com>
|
||||
Date: Mon, 23 Sep 2013 14:00:57 +0200
|
||||
Subject: [PATCH] alsa-mixer: Drop all unused paths, not only unsupported paths
|
||||
|
||||
This is a cleaner solution, because it also removes paths that are
|
||||
being removed because they are subsets of other paths.
|
||||
|
||||
Otherwise, the lingering paths could cause jack detection related
|
||||
assertion failures.
|
||||
|
||||
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=69676
|
||||
Reported-and-tested-by: Kalev Lember <kalevlember@gmail.com>
|
||||
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
|
||||
---
|
||||
src/modules/alsa/alsa-mixer.c | 23 +++++++++++++++--------
|
||||
1 file changed, 15 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
|
||||
index 71dfa79..95c7628 100644
|
||||
--- a/src/modules/alsa/alsa-mixer.c
|
||||
+++ b/src/modules/alsa/alsa-mixer.c
|
||||
@@ -3748,7 +3748,7 @@ fail:
|
||||
}
|
||||
|
||||
static void mapping_paths_probe(pa_alsa_mapping *m, pa_alsa_profile *profile,
|
||||
- pa_alsa_direction_t direction) {
|
||||
+ pa_alsa_direction_t direction, pa_hashmap *used_paths) {
|
||||
|
||||
pa_alsa_path *p;
|
||||
void *state;
|
||||
@@ -3793,6 +3793,9 @@ static void mapping_paths_probe(pa_alsa_mapping *m, pa_alsa_profile *profile,
|
||||
if (mixer_handle)
|
||||
snd_mixer_close(mixer_handle);
|
||||
|
||||
+ PA_HASHMAP_FOREACH(p, ps->paths, state)
|
||||
+ pa_hashmap_put(used_paths, p, p);
|
||||
+
|
||||
pa_log_debug("Available mixer paths (after tidying):");
|
||||
pa_alsa_path_set_dump(ps);
|
||||
}
|
||||
@@ -4281,16 +4284,18 @@ static snd_pcm_t* mapping_open_pcm(pa_alsa_mapping *m,
|
||||
&try_buffer_size, 0, NULL, NULL, true);
|
||||
}
|
||||
|
||||
-static void paths_drop_unsupported(pa_hashmap* h) {
|
||||
+static void paths_drop_unused(pa_hashmap* h, pa_hashmap *keep) {
|
||||
|
||||
void* state = NULL;
|
||||
const void* key;
|
||||
pa_alsa_path* p;
|
||||
|
||||
pa_assert(h);
|
||||
+ pa_assert(keep);
|
||||
+
|
||||
p = pa_hashmap_iterate(h, &state, &key);
|
||||
while (p) {
|
||||
- if (p->supported <= 0) {
|
||||
+ if (pa_hashmap_get(keep, p) == NULL) {
|
||||
pa_hashmap_remove(h, key);
|
||||
pa_alsa_path_free(p);
|
||||
}
|
||||
@@ -4308,7 +4313,7 @@ void pa_alsa_profile_set_probe(
|
||||
void *state;
|
||||
pa_alsa_profile *p, *last = NULL;
|
||||
pa_alsa_mapping *m;
|
||||
- pa_hashmap *broken_inputs, *broken_outputs;
|
||||
+ pa_hashmap *broken_inputs, *broken_outputs, *used_paths;
|
||||
|
||||
pa_assert(ps);
|
||||
pa_assert(dev_id);
|
||||
@@ -4319,6 +4324,7 @@ void pa_alsa_profile_set_probe(
|
||||
|
||||
broken_inputs = pa_hashmap_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
|
||||
broken_outputs = pa_hashmap_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
|
||||
+ used_paths = pa_hashmap_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
|
||||
|
||||
PA_HASHMAP_FOREACH(p, ps->profiles, state) {
|
||||
uint32_t idx;
|
||||
@@ -4406,12 +4412,12 @@ void pa_alsa_profile_set_probe(
|
||||
if (p->output_mappings)
|
||||
PA_IDXSET_FOREACH(m, p->output_mappings, idx)
|
||||
if (m->output_pcm)
|
||||
- mapping_paths_probe(m, p, PA_ALSA_DIRECTION_OUTPUT);
|
||||
+ mapping_paths_probe(m, p, PA_ALSA_DIRECTION_OUTPUT, used_paths);
|
||||
|
||||
if (p->input_mappings)
|
||||
PA_IDXSET_FOREACH(m, p->input_mappings, idx)
|
||||
if (m->input_pcm)
|
||||
- mapping_paths_probe(m, p, PA_ALSA_DIRECTION_INPUT);
|
||||
+ mapping_paths_probe(m, p, PA_ALSA_DIRECTION_INPUT, used_paths);
|
||||
}
|
||||
|
||||
/* Clean up */
|
||||
@@ -4419,10 +4425,11 @@ void pa_alsa_profile_set_probe(
|
||||
|
||||
pa_alsa_profile_set_drop_unsupported(ps);
|
||||
|
||||
- paths_drop_unsupported(ps->input_paths);
|
||||
- paths_drop_unsupported(ps->output_paths);
|
||||
+ paths_drop_unused(ps->input_paths, used_paths);
|
||||
+ paths_drop_unused(ps->output_paths, used_paths);
|
||||
pa_hashmap_free(broken_inputs);
|
||||
pa_hashmap_free(broken_outputs);
|
||||
+ pa_hashmap_free(used_paths);
|
||||
|
||||
ps->probed = true;
|
||||
}
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -26,6 +26,10 @@ Source1: default.pa-for-gdm
|
||||
|
||||
## upstream patches
|
||||
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1000966
|
||||
# http://lists.freedesktop.org/archives/pulseaudio-discuss/2013-September/018741.html
|
||||
Patch0: 0001-alsa-mixer-Drop-all-unused-paths-not-only-unsupporte.patch
|
||||
|
||||
BuildRequires: m4
|
||||
BuildRequires: libtool-ltdl-devel
|
||||
BuildRequires: intltool
|
||||
@ -198,6 +202,7 @@ This package contains GDM integration hooks for the PulseAudio sound server.
|
||||
|
||||
%prep
|
||||
%setup -q -T -b0 -n %{name}-%{version}%{?gitrel:-%{gitrel}-g%{shortcommit}}
|
||||
%patch0 -p1
|
||||
|
||||
sed -i.no_consolekit -e \
|
||||
's/^load-module module-console-kit/#load-module module-console-kit/' \
|
||||
@ -477,6 +482,7 @@ exit 0
|
||||
%changelog
|
||||
* Mon Sep 23 2013 Kalev Lember <kalevlember@gmail.com> - 4.0-4.gita89ca
|
||||
- Update to today's git snapshot
|
||||
- Backport a patch for pulseaudio crash at startup (#1000966)
|
||||
|
||||
* Thu Aug 15 2013 Kalev Lember <kalevlember@gmail.com> - 4.0-3.gitbf9b3
|
||||
- Update to git snapshot bf9b3f0 for BlueZ 5 support
|
||||
|
||||
Loading…
Reference in New Issue
Block a user