From 46585ed51aa411bb1c6df1f0a18349903160cd3d Mon Sep 17 00:00:00 2001 From: Yukari Chiba Date: Thu, 28 Dec 2023 14:04:35 +0800 Subject: [PATCH] [pipewire] 1.0.0-2: fix/update patch from libudev issue origin: https://github.com/illiliti/libudev-zero/issues/26#issuecomment-1848802791 --- PKGBUILD | 4 ++-- fix-udev-zero.patch | 27 +++++++++++---------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index b49ba90b..51d613f5 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,7 +2,7 @@ pkgname=pipewire pkgver=1.0.0 -pkgrel=1 +pkgrel=2 pkgdesc="Low-latency audio/video router and processor" url="https://pipewire.org" arch=(x86_64 aarch64 riscv64) @@ -14,7 +14,7 @@ source=( fix-udev-zero.patch ) sha256sums=('f91ef1d1161b37aae6e21b9671917d97097e2664c83d919ba3a0793d6fbc543d' - 'd23a7ae266619ca46d1d4cc135e6e6d31f0dfd798704d7a7a961a5304e614990') + '5e41f524ac1112cc093858412d948637d31d42da989a1a4ad562aef83f6dda37') prepare() { diff --git a/fix-udev-zero.patch b/fix-udev-zero.patch index 934c2fd3..f2833460 100644 --- a/fix-udev-zero.patch +++ b/fix-udev-zero.patch @@ -1,36 +1,31 @@ ---- pipewire/spa/plugins/alsa/alsa-udev.c -+++ pipewire/spa/plugins/alsa/alsa-udev.c -@@ -162,9 +162,6 @@ +diff --git a/spa/plugins/alsa/alsa-udev.c b/spa/plugins/alsa/alsa-udev.c +index 58ff5032d..b0b7a945d 100644 +--- a/spa/plugins/alsa/alsa-udev.c ++++ b/spa/plugins/alsa/alsa-udev.c +@@ -162,8 +162,6 @@ static unsigned int get_card_nr(struct impl *this, struct udev_device *udev_devi if ((str = udev_device_get_property_value(udev_device, "SOUND_CLASS")) && spa_streq(str, "modem")) return SPA_ID_INVALID; - if (udev_device_get_property_value(udev_device, "SOUND_INITIALIZED") == NULL) - return SPA_ID_INVALID; -- + if ((str = udev_device_get_property_value(udev_device, "DEVPATH")) == NULL) return SPA_ID_INVALID; - -@@ -958,7 +955,7 @@ +@@ -982,7 +982,7 @@ static int enum_cards(struct impl *this) for (udev_devices = udev_enumerate_get_list_entry(enumerate); udev_devices; udev_devices = udev_list_entry_get_next(udev_devices)) { - struct udev_device *udev_device; -+ struct udev_device *udev_device, *pdev_device; ++ struct udev_device *udev_device, *pdev; udev_device = udev_device_new_from_syspath(this->udev, udev_list_entry_get_name(udev_devices)); -@@ -967,6 +964,14 @@ +@@ -991,6 +991,8 @@ static int enum_cards(struct impl *this) process_card(this, ACTION_ADD, udev_device); -+ pdev_device = udev_device_get_parent(udev_device); -+ if (pdev_device) { -+ process_card(this, ACTION_ADD, pdev_device); -+ } -+ -+ /* no need to call udev_device_unref(pdev) here. -+ udev_device_unref() will free parent device implicitly */ -+ ++ if ((pdev = udev_device_get_parent(udev_device))) ++ process_card(this, ACTION_ADD, pdev); udev_device_unref(udev_device); } udev_enumerate_unref(enumerate);