From 09d005aa3ed3c99381380320b0d3820c1233d657 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Wed, 23 Feb 2022 00:44:01 +0200 Subject: [PATCH] impl-client: add workaround for old pipewire-media-session compatibility pipewire-media-session purposefully makes one of its cores to lag the other, and then uses it to bind ids it obtained from the faster core. This no longer works with the registry generation number checks. It's possible to fix in p-m-s, but we can also add a specific workaround for it. This workaround is supposed to be eventually removed. Workarounds for other apps should not be added. --- src/pipewire/impl-client.c | 12 ++++++++++++ src/pipewire/meson.build | 1 + 2 files changed, 13 insertions(+) diff --git a/src/pipewire/impl-client.c b/src/pipewire/impl-client.c index b4a3c2a2e..1279472a6 100644 --- a/src/pipewire/impl-client.c +++ b/src/pipewire/impl-client.c @@ -228,6 +228,18 @@ static int finish_register(struct pw_impl_client *client) pw_global_update_keys(client->global, client->info.props, keys); pw_global_register(client->global); +#ifdef OLD_MEDIA_SESSION_WORKAROUND + /* + * XXX: temporary workaround for pipewire-media-session, see #2159 + */ + if (spa_streq(spa_dict_lookup(client->info.props, PW_KEY_APP_NAME), + "pipewire-media-session")) { + client->recv_generation = UINT64_MAX; + pw_log_info("impl-client %p: enable old pipewire-media-session workaround", + client); + } +#endif + return 0; } diff --git a/src/pipewire/meson.build b/src/pipewire/meson.build index 969f50b22..f96a022bc 100644 --- a/src/pipewire/meson.build +++ b/src/pipewire/meson.build @@ -91,6 +91,7 @@ configure_file(input : 'version.h.in', install_headers(pipewire_headers, subdir : pipewire_headers_dir) libpipewire_c_args = [ + '-DOLD_MEDIA_SESSION_WORKAROUND=1' ] if build_machine.system() != 'freebsd'