diff options
author | Sam James <sam@gentoo.org> | 2023-10-18 19:24:37 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-10-18 19:24:37 +0100 |
commit | 36f2827dbaa21b512ad6df48a1bdebe467482b22 (patch) | |
tree | db9d7de6e08cec1766e8c4aff1fbf14ce23a6fc2 /media-video/pipewire/files | |
parent | sci-mathematics/cadabra: Stabilize 2.4.4.1 amd64, #915950 (diff) | |
download | gentoo-36f2827dbaa21b512ad6df48a1bdebe467482b22.tar.gz gentoo-36f2827dbaa21b512ad6df48a1bdebe467482b22.tar.bz2 gentoo-36f2827dbaa21b512ad6df48a1bdebe467482b22.zip |
media-video/pipewire: backport upstream fixes to 0.3.82
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-video/pipewire/files')
3 files changed, 133 insertions, 0 deletions
diff --git a/media-video/pipewire/files/0.3.82/0001-alsa-Ignore-PCM-devices-with-udev-env-ACP_IGNORE.patch b/media-video/pipewire/files/0.3.82/0001-alsa-Ignore-PCM-devices-with-udev-env-ACP_IGNORE.patch new file mode 100644 index 000000000000..12192fc8678a --- /dev/null +++ b/media-video/pipewire/files/0.3.82/0001-alsa-Ignore-PCM-devices-with-udev-env-ACP_IGNORE.patch @@ -0,0 +1,69 @@ +https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/fd969dab2878836fd8e9ac7d8fb92d1ede594f37 + +From fd969dab2878836fd8e9ac7d8fb92d1ede594f37 Mon Sep 17 00:00:00 2001 +From: Hector Martin <marcan@marcan.st> +Date: Sat, 14 Oct 2023 14:11:15 +0900 +Subject: [PATCH] alsa: Ignore PCM devices with udev env ACP_IGNORE + +When checking that a card has all of its PCM devices available, ignore +any specific device with the ACP_IGNORE udev environment variable. This +mirrors how we ignore whole cards, but specifically allows non-PipeWire +software to own specific PCM devices. + +Note that this does not actually stop PipeWire from using those +subdevices right now, we assume UCM configs take care of that. This +should probably be implemented later to ensure PipeWire always stays +away from them, but for now this fixes the issue where it refuses to +probe the entire card. + +Fixes: #3570 + +Signed-off-by: Hector Martin <marcan@marcan.st> +--- + spa/plugins/alsa/alsa-udev.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/spa/plugins/alsa/alsa-udev.c b/spa/plugins/alsa/alsa-udev.c +index 3048d7363..58ff5032d 100644 +--- a/spa/plugins/alsa/alsa-udev.c ++++ b/spa/plugins/alsa/alsa-udev.c +@@ -329,6 +329,27 @@ static int get_num_compress_offload_devices(unsigned int card_nr) + return errno != 0 ? -errno : num_dev; + } + ++static int check_udev_environment(struct udev *udev, const char *devname) ++{ ++ char path[PATH_MAX]; ++ struct udev_device *dev; ++ int ret = 0; ++ ++ /* Check for ACP_IGNORE on a specific PCM device (not the whole card) */ ++ spa_scnprintf(path, sizeof(path), "/sys/class/sound/%s", devname); ++ ++ dev = udev_device_new_from_syspath(udev, path); ++ if (dev == NULL) ++ return 0; ++ ++ if (udev_device_get_property_value(dev, "ACP_IGNORE")) ++ ret = -ENXIO; ++ ++ udev_device_unref(dev); ++ ++ return ret; ++} ++ + static int check_pcm_device_availability(struct impl *this, struct card *card, + int *num_pcm_devices) + { +@@ -376,6 +397,9 @@ static int check_pcm_device_availability(struct impl *this, struct card *card, + card->card_nr, entry->d_name+3); + if (check_device_pcm_class(path) < 0) + continue; ++ /* Check udev environment */ ++ if (check_udev_environment(this->udev, path) < 0) ++ continue; + + /* Check busy status */ + spa_scnprintf(path, sizeof(path), "/proc/asound/card%u/%s", +-- +GitLab diff --git a/media-video/pipewire/files/0.3.82/0002-alsa-don-t-try-to-link-when-prepare-fails.patch b/media-video/pipewire/files/0.3.82/0002-alsa-don-t-try-to-link-when-prepare-fails.patch new file mode 100644 index 000000000000..c24b63036315 --- /dev/null +++ b/media-video/pipewire/files/0.3.82/0002-alsa-don-t-try-to-link-when-prepare-fails.patch @@ -0,0 +1,27 @@ +https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/840a9487a404916b18bf945662720e8a6d5b3716 + +From 840a9487a404916b18bf945662720e8a6d5b3716 Mon Sep 17 00:00:00 2001 +From: Wim Taymans <wtaymans@redhat.com> +Date: Mon, 16 Oct 2023 10:32:51 +0200 +Subject: [PATCH] alsa: don't try to link when prepare fails + +--- + spa/plugins/alsa/alsa-pcm.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c +index fbd67cf86..df40ea9e5 100644 +--- a/spa/plugins/alsa/alsa-pcm.c ++++ b/spa/plugins/alsa/alsa-pcm.c +@@ -3042,7 +3042,8 @@ int spa_alsa_prepare(struct state *state) + + spa_list_for_each(follower, &state->followers, driver_link) { + if (follower != state && !follower->matching) { +- spa_alsa_prepare(follower); ++ if (spa_alsa_prepare(follower) < 0) ++ continue; + if (!follower->linked && state->auto_link) + do_link(state, follower); + } +-- +GitLab diff --git a/media-video/pipewire/files/0.3.82/0003-context-relax-quantum-change-conditions.patch b/media-video/pipewire/files/0.3.82/0003-context-relax-quantum-change-conditions.patch new file mode 100644 index 000000000000..5827c25c9afc --- /dev/null +++ b/media-video/pipewire/files/0.3.82/0003-context-relax-quantum-change-conditions.patch @@ -0,0 +1,37 @@ +https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/19b02003b051878e46e93584a0eb60420a38abe1 + +From 19b02003b051878e46e93584a0eb60420a38abe1 Mon Sep 17 00:00:00 2001 +From: Wim Taymans <wtaymans@redhat.com> +Date: Mon, 16 Oct 2023 16:18:18 +0200 +Subject: [PATCH] context: relax quantum change conditions + +We can change the quantum of a node while it is running just fine so +relax the check. + +This was copied from the rate change logic, which is avoided while the +node is running. + +This fixes a regression in dynamic quantum switching. + +Fixes #3574 +--- + src/pipewire/context.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/src/pipewire/context.c b/src/pipewire/context.c +index 1f5eaf296..e5ac4076a 100644 +--- a/src/pipewire/context.c ++++ b/src/pipewire/context.c +@@ -1473,9 +1473,7 @@ again: + } + + current_quantum = n->target_quantum; +- if (!restore_quantum && +- (lock_quantum || need_resume || !running || +- (!force_quantum && (n->info.state > PW_NODE_STATE_IDLE)))) { ++ if (!restore_quantum && (lock_quantum || need_resume || !running)) { + pw_log_debug("%p: keep quantum:%u restore:%u lock:%u resume:%u " + "running:%u force:%u state:%s", context, + current_quantum, restore_quantum, lock_quantum, need_resume, +-- +GitLab |