Accepting request 1117660 from multimedia:libs

OBS-URL: https://build.opensuse.org/request/show/1117660
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/pipewire?expand=0&rev=96
This commit is contained in:
Ana Guerrero 2023-10-13 21:13:55 +00:00 committed by Git OBS Bridge
commit a728921b2b
11 changed files with 406 additions and 9 deletions

View File

@ -0,0 +1,73 @@
From 896fea62c2072c836e6d821f7bdafe840ce8540e Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Mon, 9 Oct 2023 10:10:46 +0200
Subject: [PATCH] alsa: add api.alsa.auto-link option
Add an option to automatically use snd_pcm_link when the follower clock
is matching the driver. Only set this to true in pro-audio and when
nodes are scheduled together.
See #3556
---
spa/plugins/alsa/acp/acp.c | 2 ++
spa/plugins/alsa/alsa-pcm.c | 4 +++-
spa/plugins/alsa/alsa-pcm.h | 1 +
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/spa/plugins/alsa/acp/acp.c b/spa/plugins/alsa/acp/acp.c
index 67b1e4654..127379fc4 100644
--- a/spa/plugins/alsa/acp/acp.c
+++ b/spa/plugins/alsa/acp/acp.c
@@ -390,6 +390,7 @@ static int add_pro_profile(pa_card *impl, uint32_t index)
pa_proplist_setf(m->output_proplist, "device.profile.pro", "true");
pa_proplist_setf(m->output_proplist, "node.group", "pro-audio-%u", index);
pa_proplist_setf(m->output_proplist, "node.link-group", "pro-audio-%u", index);
+ pa_proplist_set(m->input_proplist, "api.alsa.auto-link", "true");
pa_alsa_close(&m->output_pcm);
m->supported = true;
pa_channel_map_init_auto(&m->channel_map, m->sample_spec.channels, PA_CHANNEL_MAP_AUX);
@@ -423,6 +424,7 @@ static int add_pro_profile(pa_card *impl, uint32_t index)
pa_proplist_setf(m->input_proplist, "device.profile.pro", "true");
pa_proplist_setf(m->input_proplist, "node.group", "pro-audio-%u", index);
pa_proplist_setf(m->input_proplist, "node.link-group", "pro-audio-%u", index);
+ pa_proplist_set(m->input_proplist, "api.alsa.auto-link", "true");
pa_alsa_close(&m->input_pcm);
m->supported = true;
pa_channel_map_init_auto(&m->channel_map, m->sample_spec.channels, PA_CHANNEL_MAP_AUX);
diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c
index ef148d76b..87dba34b0 100644
--- a/spa/plugins/alsa/alsa-pcm.c
+++ b/spa/plugins/alsa/alsa-pcm.c
@@ -131,6 +131,8 @@ static int alsa_set_param(struct state *state, const char *k, const char *s)
state->multi_rate = spa_atob(s);
} else if (spa_streq(k, "api.alsa.htimestamp")) {
state->htimestamp = spa_atob(s);
+ } else if (spa_streq(k, "api.alsa.auto-link")) {
+ state->auto_link = spa_atob(s);
} else if (spa_streq(k, "latency.internal.rate")) {
state->process_latency.rate = atoi(s);
} else if (spa_streq(k, "latency.internal.ns")) {
@@ -3034,7 +3036,7 @@ 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 (!follower->linked)
+ if (!follower->linked && state->auto_link)
do_link(state, follower);
}
}
diff --git a/spa/plugins/alsa/alsa-pcm.h b/spa/plugins/alsa/alsa-pcm.h
index c770eeabb..ae4574526 100644
--- a/spa/plugins/alsa/alsa-pcm.h
+++ b/spa/plugins/alsa/alsa-pcm.h
@@ -214,6 +214,7 @@ struct state {
unsigned int htimestamp:1;
unsigned int is_pro:1;
unsigned int sources_added:1;
+ unsigned int auto_link:1;
unsigned int linked:1;
uint64_t iec958_codecs;
--
GitLab

View File

@ -0,0 +1,43 @@
From e940361c947cf8519b11c7e6792441c86fc59042 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Thu, 12 Oct 2023 15:28:53 +0200
Subject: [PATCH] alsa: don't check early wakeup when PCM stopped
When the PCM is stopped, don't check for early wakeup because if we
are early, we will never be on time in the next iteration either because the
PCM is stopped and doesn't advance.
Also don't try to align when stopped.
See #3565
---
spa/plugins/alsa/alsa-pcm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c
index 57e7911e7..ddf79f05a 100644
--- a/spa/plugins/alsa/alsa-pcm.c
+++ b/spa/plugins/alsa/alsa-pcm.c
@@ -2408,7 +2408,7 @@ static int alsa_write_sync(struct state *state, uint64_t current_time)
# return res;
# }
if (SPA_UNLIKELY((res = get_status(state, current_time, &avail, &delay, &target)) < 0))
return res;
- if (SPA_UNLIKELY(!following && delay > target + state->max_error)) {
+ if (SPA_UNLIKELY(!following && state->alsa_started && delay > target + state->max_error)) {
spa_log_trace(state->log, "%p: early wakeup %ld %lu %lu", state,
avail, delay, target);
if (delay > target * 3)
@@ -2419,7 +2419,7 @@ static int alsa_write_sync(struct state *state, uint64_t current_time)
if (SPA_UNLIKELY((res = update_time(state, current_time, delay, target, following)) < 0))
return res;
- if (following && !state->linked) {
+ if (following && state->alsa_started && !state->linked) {
if (SPA_UNLIKELY(state->alsa_sync)) {
enum spa_log_level lev;
--
GitLab

View File

@ -0,0 +1,34 @@
From 063805ccb49af859bd06a342ed107e61c9e11af4 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Mon, 9 Oct 2023 10:15:10 +0200
Subject: [PATCH] acp: fix compilation
---
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 127379fc4..1dbc0c2d7 100644
--- a/spa/plugins/alsa/acp/acp.c
+++ b/spa/plugins/alsa/acp/acp.c
@@ -390,7 +390,7 @@ static int add_pro_profile(pa_card *impl, uint32_t index)
pa_proplist_setf(m->output_proplist, "device.profile.pro", "true");
pa_proplist_setf(m->output_proplist, "node.group", "pro-audio-%u", index);
pa_proplist_setf(m->output_proplist, "node.link-group", "pro-audio-%u", index);
- pa_proplist_set(m->input_proplist, "api.alsa.auto-link", "true");
+ pa_proplist_setf(m->input_proplist, "api.alsa.auto-link", "true");
pa_alsa_close(&m->output_pcm);
m->supported = true;
pa_channel_map_init_auto(&m->channel_map, m->sample_spec.channels, PA_CHANNEL_MAP_AUX);
@@ -424,7 +424,7 @@ static int add_pro_profile(pa_card *impl, uint32_t index)
pa_proplist_setf(m->input_proplist, "device.profile.pro", "true");
pa_proplist_setf(m->input_proplist, "node.group", "pro-audio-%u", index);
pa_proplist_setf(m->input_proplist, "node.link-group", "pro-audio-%u", index);
- pa_proplist_set(m->input_proplist, "api.alsa.auto-link", "true");
+ pa_proplist_setf(m->input_proplist, "api.alsa.auto-link", "true");
pa_alsa_close(&m->input_pcm);
m->supported = true;
pa_channel_map_init_auto(&m->channel_map, m->sample_spec.channels, PA_CHANNEL_MAP_AUX);
--
GitLab

View File

@ -0,0 +1,85 @@
From 945be16617dce4254b8a4793e9431d248b43b9c1 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Mon, 9 Oct 2023 10:35:30 +0200
Subject: [PATCH] acp: only join and link when 1 capture and 1 playback
Only schedule nodes together when there is just 1 capture and 1 playback
device. Devices might be mutually exclusive or require special setup
that would break otherwise.
See #3556
---
spa/plugins/alsa/acp/acp.c | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/spa/plugins/alsa/acp/acp.c b/spa/plugins/alsa/acp/acp.c
index 1dbc0c2d7..e2e0b3eb5 100644
--- a/spa/plugins/alsa/acp/acp.c
+++ b/spa/plugins/alsa/acp/acp.c
@@ -296,7 +296,7 @@ static const char *find_best_verb(pa_card *impl)
static int add_pro_profile(pa_card *impl, uint32_t index)
{
snd_ctl_t *ctl_hndl;
- int err, dev, count = 0;
+ int err, dev, count = 0, n_capture = 0, n_playback = 0;
pa_alsa_profile *ap;
pa_alsa_profile_set *ps = impl->profile_set;
pa_alsa_mapping *m;
@@ -304,6 +304,7 @@ static int add_pro_profile(pa_card *impl, uint32_t index)
snd_pcm_info_t *pcminfo;
pa_sample_spec ss;
snd_pcm_uframes_t try_period_size, try_buffer_size;
+ uint32_t idx;
if (impl->use_ucm) {
const char *verb = find_best_verb(impl);
@@ -388,12 +389,10 @@ static int add_pro_profile(pa_card *impl, uint32_t index)
pa_alsa_init_proplist_pcm(NULL, m->output_proplist, m->output_pcm);
pa_proplist_setf(m->output_proplist, "clock.name", "api.alsa.%u", index);
pa_proplist_setf(m->output_proplist, "device.profile.pro", "true");
- pa_proplist_setf(m->output_proplist, "node.group", "pro-audio-%u", index);
- pa_proplist_setf(m->output_proplist, "node.link-group", "pro-audio-%u", index);
- pa_proplist_setf(m->input_proplist, "api.alsa.auto-link", "true");
pa_alsa_close(&m->output_pcm);
m->supported = true;
pa_channel_map_init_auto(&m->channel_map, m->sample_spec.channels, PA_CHANNEL_MAP_AUX);
+ n_playback++;
}
pa_idxset_put(ap->output_mappings, m, NULL);
free(name);
@@ -422,12 +421,10 @@ static int add_pro_profile(pa_card *impl, uint32_t index)
pa_alsa_init_proplist_pcm(NULL, m->input_proplist, m->input_pcm);
pa_proplist_setf(m->input_proplist, "clock.name", "api.alsa.%u", index);
pa_proplist_setf(m->input_proplist, "device.profile.pro", "true");
- pa_proplist_setf(m->input_proplist, "node.group", "pro-audio-%u", index);
- pa_proplist_setf(m->input_proplist, "node.link-group", "pro-audio-%u", index);
- pa_proplist_setf(m->input_proplist, "api.alsa.auto-link", "true");
pa_alsa_close(&m->input_pcm);
m->supported = true;
pa_channel_map_init_auto(&m->channel_map, m->sample_spec.channels, PA_CHANNEL_MAP_AUX);
+ n_capture++;
}
pa_idxset_put(ap->input_mappings, m, NULL);
free(name);
@@ -435,6 +432,18 @@ static int add_pro_profile(pa_card *impl, uint32_t index)
}
snd_ctl_close(ctl_hndl);
+ if (n_capture == 1 && n_playback == 1) {
+ PA_IDXSET_FOREACH(m, ap->output_mappings, idx) {
+ pa_proplist_setf(m->output_proplist, "node.group", "pro-audio-%u", index);
+ pa_proplist_setf(m->output_proplist, "node.link-group", "pro-audio-%u", index);
+ pa_proplist_setf(m->output_proplist, "api.alsa.auto-link", "true");
+ }
+ PA_IDXSET_FOREACH(m, ap->input_mappings, idx) {
+ pa_proplist_setf(m->input_proplist, "node.group", "pro-audio-%u", index);
+ pa_proplist_setf(m->input_proplist, "node.link-group", "pro-audio-%u", index);
+ pa_proplist_setf(m->input_proplist, "api.alsa.auto-link", "true");
+ }
+ }
return 0;
}
--
GitLab

View File

@ -0,0 +1,47 @@
From 2278dd1460e37fd011ca9b1101de478092fd1d74 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Mon, 9 Oct 2023 12:28:10 +0200
Subject: [PATCH] acp: only disable tsched when linking
Disable timer based scheduling only if we are going to link the devices
together.
See #3556
---
spa/plugins/alsa/acp/acp.c | 2 ++
spa/plugins/alsa/alsa-pcm.c | 1 -
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/spa/plugins/alsa/acp/acp.c b/spa/plugins/alsa/acp/acp.c
index e2e0b3eb5..98f6326d1 100644
--- a/spa/plugins/alsa/acp/acp.c
+++ b/spa/plugins/alsa/acp/acp.c
@@ -437,11 +437,13 @@ static int add_pro_profile(pa_card *impl, uint32_t index)
pa_proplist_setf(m->output_proplist, "node.group", "pro-audio-%u", index);
pa_proplist_setf(m->output_proplist, "node.link-group", "pro-audio-%u", index);
pa_proplist_setf(m->output_proplist, "api.alsa.auto-link", "true");
+ pa_proplist_setf(m->output_proplist, "api.alsa.disable-tsched", "true");
}
PA_IDXSET_FOREACH(m, ap->input_mappings, idx) {
pa_proplist_setf(m->input_proplist, "node.group", "pro-audio-%u", index);
pa_proplist_setf(m->input_proplist, "node.link-group", "pro-audio-%u", index);
pa_proplist_setf(m->input_proplist, "api.alsa.auto-link", "true");
+ pa_proplist_setf(m->input_proplist, "api.alsa.disable-tsched", "true");
}
}
return 0;
diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c
index 87dba34b0..ffcf4d5d0 100644
--- a/spa/plugins/alsa/alsa-pcm.c
+++ b/spa/plugins/alsa/alsa-pcm.c
@@ -514,7 +514,6 @@ int spa_alsa_init(struct state *state, const struct spa_dict *info)
state->multi_rate = true;
state->htimestamp = false;
- state->disable_tsched = state->is_pro;
for (i = 0; info && i < info->n_items; i++) {
const char *k = info->items[i].key;
const char *s = info->items[i].value;
--
GitLab

View File

@ -3,7 +3,7 @@
<service name="obs_scm" mode="manual">
<param name="scm">git</param>
<param name="url">https://gitlab.freedesktop.org/pipewire/pipewire.git</param>
<param name="revision">0.3.80</param>
<param name="revision">0.3.81</param>
<param name="versionformat">@PARENT_TAG@</param>
<!--
<param name="revision">master</param>

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e30a4c74f13e1c5498f396bb92dcb3d844489cef5a45355cb6fb362d67aee271
size 12260365

3
pipewire-0.3.81.obscpio Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7c25700316d7b3ed4008003a551ed6b71e52dd6afa6d50559460a2284b0b1920
size 12304397

View File

@ -1,3 +1,103 @@
-------------------------------------------------------------------
Fri Oct 13 08:33:28 UTC 2023 - Antonio Larrosa <alarrosa@suse.com>
- Add patches from upstream that fix pro-audio not producing any
sound in 0.3.81:
* 0001-alsa-add-api.alsa.auto-link-option.patch
* 0002-acp-fix-compilation.patch
* 0003-acp-only-join-and-link-when-1-capture-and-1-playback.patch
* 0004-acp-only-disable-tsched-when-linking.patch
- Add patch from upstream that fixes issues when PCM is stopped,
which includes fixing sound in qemu:
* 0001-alsa-dont-check-early-wakeup-when-PCM-stopped.patch
-------------------------------------------------------------------
Mon Oct 9 11:34:40 UTC 2023 - Antonio Larrosa <alarrosa@suse.com>
- Pipewire now requires vulkan 1.3, so we have to disable vulkan
support if this requirement is not fulfilled in order to build
correctly in Leap.
-------------------------------------------------------------------
Sat Oct 7 15:11:14 UTC 2023 - Alexei Sorokin <sor.alexei@meowr.ru>
- Update to version 0.3.81:
* Highlights
- jackdbus support is now enabled by default.
- IRQ based scheduling in ALSA was improved and enabled by
default for Pro-Audio profile. It will also link the pcms
together to get lower latency. This now matches what JACK
does and gives equal latency to PipeWire for Pro-Audio
profiles.
- Support both old and new versions of webrtc-audio-processing
to make the transition easier.
- Forced quantum changes by nodes or metadata will now also
force a suspend and resume of the graph, like the rate
changes to make sure all nodes adapt to the new quantum.
This is important for Pro-Audio nodes that need to
reconfigure the hardware to a new period in IRQ-based
scheduling.
- Fix a regression in regex parsing.
- Many bugfixes and improvements.
* PipeWire
- jackdbus is by default enabled now. The idea is that when
jackdbus is installed, the real libjack.so is in the path and
we can become a real JACK client.
- Forces quantum changes by nodes or metadata will now also
force a suspend and resume in the graph, like the rate
changes to make sure all nodes adapt to the new quantum.
This is important for Pro-Audio nodes that need to
reconfigure the hardware to a new period.
- The stream now has an EARLY_PROCESS option that can be used
to implement custom buffer fill levels.
- Fix a regression in regex parsing.
- Fix a bug in position reporting in the driver node.
- Destroying a link will now recalculate the graph correctly.
- Fix the rate comparison for finding the best rate in the
graph.
- Use malloc_trim() when available to release memory.
* Tools
- pw-cat now supports DFF DSD files.
- pw-cli avoid some NULL derefs in some cases.
* Modules
- The RAOP sink has seen some cleanups and improvements.
It will now ask for feedback every 2 seconds to keep some
devices alive.
- A bug in filter-chain was fixed where it would fail to apply
the gain when when mixing just one source.
- The filter-chain can now pass the stream volume to a control
in the filter-chain graph.
- Improve volume handling in RAOP sink.
* Pulse-server
- Some cleanup in the pending_stream handling.
- Fix a regression in the event emission code where it failed
to emit a changed event when a node was linked.
- Lower the realtime priority of pulseaudio clients.
- Set pulse.module.id on the echo-cancel streams.
* SPA
- Support both old and new versions of webrtc-audio-processing
to make the transition easier.
- The ALSA driver now does the synch of all followers directly
from the wakeup event. This results in more stable rate
matching.
- IRQ based scheduling in ALSA was improved and enabled by
default for Pro-Audio profile. It will also link the pcms
together to get lower latency. This now matches what JACK
does and gives equal latency to PipeWire for Pro-Audio
profiles.
- GNU/Hurd support was added.
- Some improvements to passthrough handling.
* Bluetooth
- Improvements to the codec handling when PipeWire is used as
Audio Gateway.
- Adapt to new Bluez API for BAP devices.
* JACK
- When the jack library is set in the default library path,
avoid using LD_LIBRARY_PATH because this can cause confusion.
- Handle clearing the latency on a port.
- jack_property now always manages to actually change the
metadata because it waits for a roundtrip before exiting.
-------------------------------------------------------------------
Thu Sep 14 12:01:09 UTC 2023 - Antonio Larrosa <alarrosa@suse.com>

View File

@ -1,4 +1,4 @@
name: pipewire
version: 0.3.80
mtime: 1694682380
commit: 35cca08d2bef14248ac25ff2a1efb0bf274d0a6f
version: 0.3.81
mtime: 1696585026
commit: 181fbfee6d3fcc3afd3c93613f126a8346dad586

View File

@ -23,7 +23,7 @@
%define spa_ver_str 0_2
%define libpipewire libpipewire-%{apiver_str}-0
%if %{pkg_vcmp pkgconfig(vulkan) >= 1.1}
%if %{pkg_vcmp pkgconfig(vulkan) >= 1.3}
%define with_vulkan 1
%else
%define with_vulkan 0
@ -60,7 +60,7 @@
%bcond_with aptx
Name: pipewire
Version: 0.3.80
Version: 0.3.81
Release: 0
Summary: A Multimedia Framework designed to be an audio and video server and more
License: MIT
@ -70,6 +70,16 @@ Source0: %{name}-%{version}.tar.xz
Source99: baselibs.conf
# PATCH-FIX-OPENSUSE reduce-meson-dependency.patch
Patch0: reduce-meson-dependency.patch
# PATCH-FIX-UPSTREAM 0001-alsa-add-api.alsa.auto-link-option.patch
Patch1: 0001-alsa-add-api.alsa.auto-link-option.patch
# PATCH-FIX-UPSTREAM 0002-acp-fix-compilation.patch
Patch2: 0002-acp-fix-compilation.patch
# PATCH-FIX-UPSTREAM 0003-acp-only-join-and-link-when-1-capture-and-1-playback.patch
Patch3: 0003-acp-only-join-and-link-when-1-capture-and-1-playback.patch
# PATCH-FIX-UPSTREAM 0004-acp-only-disable-tsched-when-linking.patch
Patch4: 0004-acp-only-disable-tsched-when-linking.patch
# PATCH-FIX-UPSTREAM 0001-alsa-dont-check-early-wakeup-when-PCM-stopped.patch
Patch5: 0001-alsa-dont-check-early-wakeup-when-PCM-stopped.patch
BuildRequires: docutils
BuildRequires: doxygen
@ -383,6 +393,11 @@ JACK libraries.
sed -ie "s/version : '0.3.72'/version : '%{version}'/" %{P:0}
%patch0 -p1
%endif
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
%if %{pkg_vcmp gcc < 8}