pulseaudio: fix crash with alsa_ucm devices

Pulseaudio 17 crashes in certain situations with alsa_ucm devices, see https://gitlab.archlinux.org/archlinux/packaging/packages/pulseaudio/-/issues/4.
This happens for example on the PinePhone, leaving it with no audio.
Applying the two patches as done on Arch Linux solves this for me.
This commit is contained in:
Luflosi 2024-03-16 13:16:30 +01:00
parent b00700a4e4
commit 28248506ae
No known key found for this signature in database
GPG Key ID: 743C5DD6900A1FF0

View File

@ -6,6 +6,7 @@
, soxr, speexdsp, systemd, webrtc-audio-processing_1
, gst_all_1
, check, libintl, meson, ninja, m4, wrapGAppsHook
, fetchpatch2
, x11Support ? false
@ -48,6 +49,19 @@ stdenv.mkDerivation rec {
# Install sysconfdir files inside of the nix store,
# but use a conventional runtime sysconfdir outside the store
./add-option-for-installation-sysconfdir.patch
# Fix crashes with some UCM devices
# See https://gitlab.archlinux.org/archlinux/packaging/packages/pulseaudio/-/issues/4
(fetchpatch2 {
name = "alsa-ucm-Check-UCM-verb-before-working-with-device-status.patch";
url = "https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/f5cacd94abcc47003bd88ad7ca1450de649ffb15.patch";
hash = "sha256-WyEqCitrqic2n5nNHeVS10vvGy5IzwObPPXftZKy/A8=";
})
(fetchpatch2 {
name = "alsa-ucm-Replace-port-device-UCM-context-assertion-with-an-error.patch";
url = "https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/ed3d4f0837f670e5e5afb1afa5bcfc8ff05d3407.patch";
hash = "sha256-fMJ3EYq56sHx+zTrG6osvI/QgnhqLvWiifZxrRLMvns=";
})
];
outputs = [ "out" "dev" ];