diff -Nru pulseaudio-11.1/debian/changelog pulseaudio-11.1/debian/changelog --- pulseaudio-11.1/debian/changelog 2019-01-23 14:54:58.000000000 +0800 +++ pulseaudio-11.1/debian/changelog 2019-07-01 14:59:43.000000000 +0800 @@ -1,3 +1,12 @@ +pulseaudio (1:11.1-1ubuntu7.3) bionic; urgency=medium + + * Add patches to resolve the most common pulseaudio crashes in 18.04: + - 0810-lp1556439-sink-source-Don-t-finish-move-if-unlink-happens-afte.patch + - 0811-lp1663528-alsa-card-fix-null-dereference.patch + (LP: #1556439, LP: #1663528) + + -- Daniel van Vugt Mon, 01 Jul 2019 14:59:43 +0800 + pulseaudio (1:11.1-1ubuntu7.2) bionic; urgency=medium * Add steelseries headset support. This provides sufficient support to diff -Nru pulseaudio-11.1/debian/patches/0810-lp1556439-sink-source-Don-t-finish-move-if-unlink-happens-afte.patch pulseaudio-11.1/debian/patches/0810-lp1556439-sink-source-Don-t-finish-move-if-unlink-happens-afte.patch --- pulseaudio-11.1/debian/patches/0810-lp1556439-sink-source-Don-t-finish-move-if-unlink-happens-afte.patch 1970-01-01 08:00:00.000000000 +0800 +++ pulseaudio-11.1/debian/patches/0810-lp1556439-sink-source-Don-t-finish-move-if-unlink-happens-afte.patch 2019-07-01 14:58:36.000000000 +0800 @@ -0,0 +1,55 @@ +From 59d264ac56d644f626251daa44ef7b39a9a9fe03 Mon Sep 17 00:00:00 2001 +From: Georg Chini +Date: Sun, 3 Dec 2017 22:29:09 +0100 +Subject: [PATCH] sink, source: Don't finish move if unlink happens after + pa_*_move_all_start() + +When a sink input was unlinked between the calls to pa_sink_move_all_start() and +pa_sink_move_all_finish(), pa_sink_move_all_finish() tried to finish the move +of the already unlinked sink input, which lead to an assertion in +pa_sink_input_finish_move(). The same applies for the source side. + +This patch fixes the problem by checking the state of the sink input or +source output in pa_*_move_all_finish(). + +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103752 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1556439 +Forwarded: not-needed +Last-Update: 2019-07-01 + +Index: pulseaudio/src/pulsecore/sink.c +=================================================================== +--- pulseaudio.orig/src/pulsecore/sink.c ++++ pulseaudio/src/pulsecore/sink.c +@@ -920,9 +920,11 @@ void pa_sink_move_all_finish(pa_sink *s, + pa_assert(q); + + while ((i = PA_SINK_INPUT(pa_queue_pop(q)))) { +- if (pa_sink_input_finish_move(i, s, save) < 0) +- pa_sink_input_fail_move(i); ++ if (PA_SINK_INPUT_IS_LINKED(i->state)) { ++ if (pa_sink_input_finish_move(i, s, save) < 0) ++ pa_sink_input_fail_move(i); + ++ } + pa_sink_input_unref(i); + } + +Index: pulseaudio/src/pulsecore/source.c +=================================================================== +--- pulseaudio.orig/src/pulsecore/source.c ++++ pulseaudio/src/pulsecore/source.c +@@ -860,9 +860,11 @@ void pa_source_move_all_finish(pa_source + pa_assert(q); + + while ((o = PA_SOURCE_OUTPUT(pa_queue_pop(q)))) { +- if (pa_source_output_finish_move(o, s, save) < 0) +- pa_source_output_fail_move(o); ++ if (PA_SOURCE_OUTPUT_IS_LINKED(o->state)) { ++ if (pa_source_output_finish_move(o, s, save) < 0) ++ pa_source_output_fail_move(o); + ++ } + pa_source_output_unref(o); + } + diff -Nru pulseaudio-11.1/debian/patches/0811-lp1663528-alsa-card-fix-null-dereference.patch pulseaudio-11.1/debian/patches/0811-lp1663528-alsa-card-fix-null-dereference.patch --- pulseaudio-11.1/debian/patches/0811-lp1663528-alsa-card-fix-null-dereference.patch 1970-01-01 08:00:00.000000000 +0800 +++ pulseaudio-11.1/debian/patches/0811-lp1663528-alsa-card-fix-null-dereference.patch 2019-07-01 14:58:26.000000000 +0800 @@ -0,0 +1,36 @@ +From 9e5be0899f60208046f1c5e2d32a2dd207d8fa00 Mon Sep 17 00:00:00 2001 +From: Tanu Kaskinen +Date: Thu, 24 May 2018 20:31:51 +0300 +Subject: [PATCH] alsa-card: fix null dereference + +jack->melem can be null if the jack disappears between probing the card +and the init_jacks() call. I don't know if jacks actually ever disappear +like that (seems unlikely), but this check is in any case needed as long +as init_jacks() has proper handling for the jack disappearing case +(rather than just an assert). + +There was a crash report[1] that indicated that card_suspend_changed() +called report_jack_state() with a null melem. I don't know if that was +because the jack actually disappeared, or is there some other bug too. + +[1] https://bugs.freedesktop.org/show_bug.cgi?id=104385 + +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104385 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1663528 +Forwarded: not-needed +Last-Update: 2019-07-01 + +Index: pulseaudio/src/modules/alsa/module-alsa-card.c +=================================================================== +--- pulseaudio.orig/src/modules/alsa/module-alsa-card.c ++++ pulseaudio/src/modules/alsa/module-alsa-card.c +@@ -625,7 +625,8 @@ static pa_hook_result_t card_suspend_cha + if (card->suspend_cause == 0) { + /* We were unsuspended, update jack state in case it changed while we were suspended */ + PA_HASHMAP_FOREACH(jack, u->jacks, state) { +- report_jack_state(jack->melem, 0); ++ if (jack->melem) ++ report_jack_state(jack->melem, 0); + } + } + diff -Nru pulseaudio-11.1/debian/patches/series pulseaudio-11.1/debian/patches/series --- pulseaudio-11.1/debian/patches/series 2019-01-23 14:54:58.000000000 +0800 +++ pulseaudio-11.1/debian/patches/series 2019-07-01 14:57:27.000000000 +0800 @@ -23,6 +23,8 @@ memfd-glibc2.27.patch 0804-bluez5-device-Rewrite-of-thread-function-reduce-send.patch 0805-bluez5-device-Fix-memory-leak-in-sco_process_render.patch +0810-lp1556439-sink-source-Don-t-finish-move-if-unlink-happens-afte.patch +0811-lp1663528-alsa-card-fix-null-dereference.patch # Bug fixes for Steelseries all backported from PulseAudio 12 steelseries.1.15386a710.patch