From 2c376198c923134d8e6c53c02e05f536637dfcf2 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 26 Aug 2021 13:26:54 +0200 Subject: [PATCH] Update to 0.3.34 --- .gitignore | 1 + ...n-t-remove-default.configured-when-d.patch | 264 ------------------ ...e-HW-volume-against-stored-HW-volume.patch | 35 --- ...v-fix-behringer-UMC202-usb-device-id.patch | 26 -- 0005-alsa-free-alibpref-after-use.patch | 24 -- 0006-alsa-Free-global-state.patch | 31 -- pipewire.spec | 14 +- sources | 2 +- 8 files changed, 8 insertions(+), 389 deletions(-) delete mode 100644 0002-media-session-don-t-remove-default.configured-when-d.patch delete mode 100644 0003-acp-compare-the-HW-volume-against-stored-HW-volume.patch delete mode 100644 0004-udev-fix-behringer-UMC202-usb-device-id.patch delete mode 100644 0005-alsa-free-alibpref-after-use.patch delete mode 100644 0006-alsa-Free-global-state.patch diff --git a/.gitignore b/.gitignore index 97a11e3..041bc07 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,4 @@ /pipewire-0.3.31.tar.gz /pipewire-0.3.32.tar.gz /pipewire-0.3.33.tar.gz +/pipewire-0.3.34.tar.gz diff --git a/0002-media-session-don-t-remove-default.configured-when-d.patch b/0002-media-session-don-t-remove-default.configured-when-d.patch deleted file mode 100644 index cff9807..0000000 --- a/0002-media-session-don-t-remove-default.configured-when-d.patch +++ /dev/null @@ -1,264 +0,0 @@ -From b9d6b098a9bdfa4d4295e8a9e05ab4044df9db81 Mon Sep 17 00:00:00 2001 -From: Pauli Virtanen -Date: Sun, 8 Aug 2021 13:11:43 +0300 -Subject: [PATCH 2/6] media-session: don't remove default.configured when - devices go away - -There's no particular problem to have default.configured to point to a -non-existent device, it will be ignored. This was left over when -default and configured default were made separate things. - -default-nodes also doesn't need to track the id of the configured -default, so remove also other stuff that's no longer necessary. It can -simply load the values to metadata on startup, and save them to a file -when they are changed, without needing to understand what the values -mean. - -Also fixes commit 707156233431 causing defaults to be forgotten when -nodes are removed. ---- - src/examples/media-session/default-nodes.c | 153 ++------------------- - 1 file changed, 14 insertions(+), 139 deletions(-) - -diff --git a/src/examples/media-session/default-nodes.c b/src/examples/media-session/default-nodes.c -index 46298a020..c9517079b 100644 ---- a/src/examples/media-session/default-nodes.c -+++ b/src/examples/media-session/default-nodes.c -@@ -34,9 +34,7 @@ - - #include - #include --#include - #include --#include - - #include "pipewire/pipewire.h" - #include "pipewire/extensions/metadata.h" -@@ -48,7 +46,6 @@ - - #define NAME "default-nodes" - #define SESSION_KEY "default-nodes" --#define PREFIX "default." - - #define SAVE_INTERVAL 1 - -@@ -56,14 +53,7 @@ - #define DEFAULT_CONFIG_AUDIO_SOURCE_KEY "default.configured.audio.source" - #define DEFAULT_CONFIG_VIDEO_SOURCE_KEY "default.configured.video.source" - --struct default_node { -- char *key; -- uint32_t value; --}; -- - struct impl { -- struct timespec now; -- - struct sm_media_session *session; - struct spa_hook listener; - -@@ -72,72 +62,14 @@ struct impl { - - struct spa_hook meta_listener; - -- struct default_node defaults[4]; -- - struct pw_properties *properties; -- -- unsigned int sync:1; --}; -- --static struct default_node *find_default(struct impl *impl, const char *key) --{ -- struct default_node *def; -- /* Check that the item key is a valid default key */ -- for (def = impl->defaults; def->key != NULL; ++def) -- if (spa_streq(key, def->key)) -- return def; -- return NULL; --} -- --struct find_data { -- struct impl *impl; -- const char *name; -- uint32_t id; - }; - --static int find_name(void *data, struct sm_object *object) --{ -- struct find_data *d = data; -- const char *str; -- -- if (spa_streq(object->type, PW_TYPE_INTERFACE_Node) && -- object->props && -- (str = pw_properties_get(object->props, PW_KEY_NODE_NAME)) != NULL && -- spa_streq(str, d->name)) { -- d->id = object->id; -- return 1; -- } -- return 0; --} -- --static uint32_t find_id_for_name(struct impl *impl, const char *name) -+static bool is_default_key(const char *key) - { -- struct find_data d = { impl, name, SPA_ID_INVALID }; -- sm_media_session_for_each_object(impl->session, find_name, &d); -- return d.id; --} -- --static int json_object_find(const char *obj, const char *key, char *value, size_t len) --{ -- struct spa_json it[2]; -- const char *v; -- char k[128]; -- -- spa_json_init(&it[0], obj, strlen(obj)); -- if (spa_json_enter_object(&it[0], &it[1]) <= 0) -- return -EINVAL; -- -- while (spa_json_get_string(&it[1], k, sizeof(k)-1) > 0) { -- if (spa_streq(k, key)) { -- if (spa_json_get_string(&it[1], value, len) <= 0) -- continue; -- return 0; -- } else { -- if (spa_json_next(&it[1], &v) <= 0) -- break; -- } -- } -- return -ENOENT; -+ return spa_streq(key, DEFAULT_CONFIG_AUDIO_SINK_KEY) || -+ spa_streq(key, DEFAULT_CONFIG_AUDIO_SOURCE_KEY) || -+ spa_streq(key, DEFAULT_CONFIG_VIDEO_SOURCE_KEY); - } - - static void remove_idle_timeout(struct impl *impl) -@@ -180,35 +112,15 @@ static int metadata_property(void *object, uint32_t subject, - struct impl *impl = object; - int changed = 0; - -- if (impl->sync) -- return 0; -- - if (subject == PW_ID_CORE) { - if (key == NULL) { - pw_properties_clear(impl->properties); - changed++; - } else { -- uint32_t id; -- struct default_node *def; -- char name[1024]; -- -- if ((def = find_default(impl, key)) == NULL) -+ if (!is_default_key(key)) - return 0; - -- if (value == NULL) { -- def->value = SPA_ID_INVALID; -- changed += pw_properties_set(impl->properties, key, NULL); -- } else { -- if (json_object_find(value, "name", name, sizeof(name)) < 0) -- return 0; -- -- if ((id = find_id_for_name(impl, name)) == SPA_ID_INVALID) -- return 0; -- -- def->value = id; -- changed += pw_properties_set(impl->properties, -- key, value); -- } -+ changed += pw_properties_set(impl->properties, key, value); - } - } - if (changed) -@@ -222,51 +134,18 @@ static const struct pw_metadata_events metadata_events = { - .property = metadata_property, - }; - --static void session_create(void *data, struct sm_object *object) -+static void load_metadata(struct impl *impl) - { -- struct impl *impl = data; - const struct spa_dict_item *item; - -- if (!spa_streq(object->type, PW_TYPE_INTERFACE_Node)) -- return; -- - spa_dict_for_each(item, &impl->properties->dict) { -- char name [1024] = "\0"; -- struct find_data d; -- -- if (find_default(impl, item->key) == NULL) -- continue; -- -- if (json_object_find(item->value, "name", name, sizeof(name)) < 0) -+ if (!is_default_key(item->key)) - continue; - -- d = (struct find_data){ impl, name, SPA_ID_INVALID }; -- if (find_name(&d, object)) { -- if (impl->session->metadata != NULL) { -- pw_log_info("found %s with id:%u restore as %s", -- name, d.id, item->key); -- pw_metadata_set_property(impl->session->metadata, -+ if (impl->session->metadata != NULL) { -+ pw_log_info("restoring %s=%s", item->key, item->value); -+ pw_metadata_set_property(impl->session->metadata, - PW_ID_CORE, item->key, "Spa:String:JSON", item->value); -- } -- } -- } --} -- --static void session_remove(void *data, struct sm_object *object) --{ -- struct impl *impl = data; -- struct default_node *def; -- -- if (!spa_streq(object->type, PW_TYPE_INTERFACE_Node)) -- return; -- -- for (def = impl->defaults; def->key != NULL; ++def) { -- if (def->value == object->id) { -- def->value = SPA_ID_INVALID; -- if (impl->session->metadata != NULL) { -- pw_metadata_set_property(impl->session->metadata, -- PW_ID_CORE, def->key, NULL, NULL); -- } - } - } - } -@@ -284,8 +163,6 @@ static void session_destroy(void *data) - - static const struct sm_media_session_events session_events = { - SM_VERSION_MEDIA_SESSION_EVENTS, -- .create = session_create, -- .remove = session_remove, - .destroy = session_destroy, - }; - -@@ -301,11 +178,6 @@ int sm_default_nodes_start(struct sm_media_session *session) - impl->session = session; - impl->context = session->context; - -- impl->defaults[0] = (struct default_node){ DEFAULT_CONFIG_AUDIO_SINK_KEY, }; -- impl->defaults[1] = (struct default_node){ DEFAULT_CONFIG_AUDIO_SOURCE_KEY, }; -- impl->defaults[2] = (struct default_node){ DEFAULT_CONFIG_VIDEO_SOURCE_KEY, }; -- impl->defaults[3] = (struct default_node){ NULL, }; -- - impl->properties = pw_properties_new(NULL, NULL); - if (impl->properties == NULL) { - free(impl); -@@ -323,5 +195,8 @@ int sm_default_nodes_start(struct sm_media_session *session) - &impl->meta_listener, - &metadata_events, impl); - } -+ -+ load_metadata(impl); -+ - return 0; - } --- -2.31.1 - diff --git a/0003-acp-compare-the-HW-volume-against-stored-HW-volume.patch b/0003-acp-compare-the-HW-volume-against-stored-HW-volume.patch deleted file mode 100644 index ecf98f5..0000000 --- a/0003-acp-compare-the-HW-volume-against-stored-HW-volume.patch +++ /dev/null @@ -1,35 +0,0 @@ -From c5dcf6c13db3cb9ff8de9c59e3c197f4b42a43b6 Mon Sep 17 00:00:00 2001 -From: Wim Taymans -Date: Mon, 9 Aug 2021 14:13:51 +0200 -Subject: [PATCH 3/6] acp: compare the HW volume against stored HW volume - -When we store the real_volume we get a hardware_volume as stored -in the mixer and a residual software_volume. - -When we read the volume from the card, we need to compare this against -the hardware_volume we stored to check if something changed, not -against the real_volume that also contains the leftover software_volume. ---- - spa/plugins/alsa/acp/acp.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/spa/plugins/alsa/acp/acp.c b/spa/plugins/alsa/acp/acp.c -index 412588cb6..1ff1c5f95 100644 ---- a/spa/plugins/alsa/acp/acp.c -+++ b/spa/plugins/alsa/acp/acp.c -@@ -1047,10 +1047,10 @@ static int read_volume(pa_alsa_device *dev) - /* Shift down by the base volume, so that 0dB becomes maximum volume */ - pa_sw_cvolume_multiply_scalar(&r, &r, dev->base_volume); - -- if (pa_cvolume_equal(&dev->real_volume, &r)) -+ if (pa_cvolume_equal(&dev->hardware_volume, &r)) - return 0; - -- dev->real_volume = r; -+ dev->real_volume = dev->hardware_volume = r; - - pa_log_info("New hardware volume: min:%d max:%d", - pa_cvolume_min(&r), pa_cvolume_max(&r)); --- -2.31.1 - diff --git a/0004-udev-fix-behringer-UMC202-usb-device-id.patch b/0004-udev-fix-behringer-UMC202-usb-device-id.patch deleted file mode 100644 index 1117e33..0000000 --- a/0004-udev-fix-behringer-UMC202-usb-device-id.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 6af429351a1aac16cf3671ed883d79e3b422a74b Mon Sep 17 00:00:00 2001 -From: Wim Taymans -Date: Tue, 10 Aug 2021 10:45:47 +0200 -Subject: [PATCH 4/6] udev: fix behringer UMC202 usb device id - -See https://usb-ids.gowdy.us/read/UD/1397/0507 ---- - spa/plugins/alsa/90-pipewire-alsa.rules | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/spa/plugins/alsa/90-pipewire-alsa.rules b/spa/plugins/alsa/90-pipewire-alsa.rules -index c8a804093..a3ab23ee6 100644 ---- a/spa/plugins/alsa/90-pipewire-alsa.rules -+++ b/spa/plugins/alsa/90-pipewire-alsa.rules -@@ -112,7 +112,7 @@ ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02bb", ENV{ACP_PROFILE_SET}="kinect- - ATTRS{idVendor}=="041e", ATTRS{idProduct}=="322c", ENV{ACP_PROFILE_SET}="sb-omni-surround-5.1.conf" - ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="4014", ENV{ACP_PROFILE_SET}="dell-dock-tb16-usb-audio.conf" - ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="402e", ENV{ACP_PROFILE_SET}="dell-dock-tb16-usb-audio.conf" --ATTRS{idVendor}=="08bb", ATTRS{idProduct}=="2902", ENV{ACP_PROFILE_SET}="behringer-umc22.conf" -+ATTRS{idVendor}=="1397", ATTRS{idProduct}=="0507", ENV{ACP_PROFILE_SET}="behringer-umc22.conf" - ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="0269", ENV{ACP_PROFILE_SET}="hp-tbt-dock-120w-g2.conf" - ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="0567", ENV{ACP_PROFILE_SET}="hp-tbt-dock-audio-module.conf" - --- -2.31.1 - diff --git a/0005-alsa-free-alibpref-after-use.patch b/0005-alsa-free-alibpref-after-use.patch deleted file mode 100644 index e9f85aa..0000000 --- a/0005-alsa-free-alibpref-after-use.patch +++ /dev/null @@ -1,24 +0,0 @@ -From cde4d53c867b23d97ae37dd9eb518d0a62170c44 Mon Sep 17 00:00:00 2001 -From: Wim Taymans -Date: Tue, 10 Aug 2021 11:14:15 +0200 -Subject: [PATCH 5/6] alsa: free alibpref after use - ---- - spa/plugins/alsa/alsa-pcm.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c -index dfffcb478..30fbbba6e 100644 ---- a/spa/plugins/alsa/alsa-pcm.c -+++ b/spa/plugins/alsa/alsa-pcm.c -@@ -52,6 +52,7 @@ int spa_alsa_init(struct state *state) - spa_scnprintf(name, sizeof(name), "%s%s", alibpref, - state->props.device); - strcpy(state->props.device, name); -+ free((void*)alibpref); - } - } - return 0; --- -2.31.1 - diff --git a/0006-alsa-Free-global-state.patch b/0006-alsa-Free-global-state.patch deleted file mode 100644 index 6b4149c..0000000 --- a/0006-alsa-Free-global-state.patch +++ /dev/null @@ -1,31 +0,0 @@ -From c491e1309f17012e5a7005552afc5dad8443d318 Mon Sep 17 00:00:00 2001 -From: Wim Taymans -Date: Tue, 10 Aug 2021 11:23:48 +0200 -Subject: [PATCH 6/6] alsa: Free global state - -We need to do this or else newly plugged devices might not load. - -It does not seem to harm UCM config on my machine, so this reverts -3d372424ccb96fd2b705c9ed94e76a82ad44e113 - -See #1478 ---- - spa/plugins/alsa/alsa-pcm.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c -index 30fbbba6e..299bf03ff 100644 ---- a/spa/plugins/alsa/alsa-pcm.c -+++ b/spa/plugins/alsa/alsa-pcm.c -@@ -20,6 +20,8 @@ int spa_alsa_init(struct state *state) - { - int err; - -+ snd_config_update_free_global(); -+ - if (state->open_ucm) { - char card_name[64]; - const char *alibpref = NULL; --- -2.31.1 - diff --git a/pipewire.spec b/pipewire.spec index d6779d7..4f888c1 100644 --- a/pipewire.spec +++ b/pipewire.spec @@ -1,6 +1,6 @@ %global majorversion 0 %global minorversion 3 -%global microversion 33 +%global microversion 34 %global apiversion 0.3 %global spaversion 0.2 @@ -8,7 +8,7 @@ %global libversion %{soversion}.%(bash -c '((intversion = (%{minorversion} * 100) + %{microversion})); echo ${intversion}').0 # For rpmdev-bumpspec and releng automation -%global baserelease 3 +%global baserelease 1 #global snapdate 20210107 #global gitcommit b17db2cebc1a5ab2c01851d29c05f79cd2f262bb @@ -54,11 +54,6 @@ Source0: https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/%{ver %endif ## upstream patches -Patch0001: 0002-media-session-don-t-remove-default.configured-when-d.patch -Patch0002: 0003-acp-compare-the-HW-volume-against-stored-HW-volume.patch -Patch0003: 0004-udev-fix-behringer-UMC202-usb-device-id.patch -Patch0004: 0005-alsa-free-alibpref-after-use.patch -Patch0005: 0006-alsa-Free-global-state.patch ## upstreamable patches @@ -298,7 +293,7 @@ This package provides a PulseAudio implementation based on PipeWire %{!?with_media_session:-D session-managers=[]} \ %{!?with_jack:-D pipewire-jack=disabled} \ %{!?with_jackserver_plugin:-D jack=disabled} \ - %{?with_jack:-D jack-devel=enabled} \ + %{?with_jack:-D jack-devel=true} \ %{!?with_alsa:-D pipewire-alsa=disabled} \ %{?with_vulkan:-D vulkan=enabled} %meson_build @@ -527,6 +522,9 @@ systemctl --no-reload preset --global pipewire.socket >/dev/null 2>&1 || : %endif %changelog +* Thu Aug 26 2021 Wim Taymans - 0.3.34-1 +- Update to 0.3.34 + * Wed Aug 11 2021 Wim Taymans - 0.3.33-3 - Add more upstream patches. diff --git a/sources b/sources index 922432c..99c9e15 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pipewire-0.3.33.tar.gz) = bc3d5658d6fda11dd55f22ba5293b4ff6c3e9a8d083b0cf7b3356bc18f4f65967557602a0d6603a2a2a548ecb42c6b7fbb9d315ed0fce435f4bb884ab4dd263b +SHA512 (pipewire-0.3.34.tar.gz) = cbf8eb410d2cd1923e67ac9ee9eca0e74567bb7e8ea407a536e64b3ec27b5bbb1e7fdd74a5a7cbffbac3f9996d8a08f8c723401fb44cb2920f044a3a2f3a6c18