From 28248506ae9c6544587c75c98959e5180667063d Mon Sep 17 00:00:00 2001 From: Luflosi Date: Sat, 16 Mar 2024 13:16:30 +0100 Subject: [PATCH] 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. --- pkgs/servers/pulseaudio/default.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkgs/servers/pulseaudio/default.nix b/pkgs/servers/pulseaudio/default.nix index 5f078d2f6fcf..e32ef9bc1df6 100644 --- a/pkgs/servers/pulseaudio/default.nix +++ b/pkgs/servers/pulseaudio/default.nix @@ -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" ];