Accepting request 1079582 from home:XRevan86

OBS-URL: https://build.opensuse.org/request/show/1079582
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/pipewire?expand=0&rev=123
This commit is contained in:
Antonio Larrosa 2023-04-17 04:41:51 +00:00 committed by Git OBS Bridge
parent f8f49c3b4b
commit fbda19a448
4 changed files with 100 additions and 1 deletions

View File

@ -0,0 +1,43 @@
From 916f1cdfbfdc414d83031aef941a9909d1e603bd Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Fri, 14 Apr 2023 16:32:18 +0200
Subject: [PATCH] Revert "alsa-mixer: allow to re-attach the mixer control
element"
This reverts commit b554fc20e9ff97064721c89eb15b1b45870584e5.
---
spa/plugins/alsa/acp/alsa-util.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/spa/plugins/alsa/acp/alsa-util.c b/spa/plugins/alsa/acp/alsa-util.c
index 38ae934eb3..c76cef3e21 100644
--- a/spa/plugins/alsa/acp/alsa-util.c
+++ b/spa/plugins/alsa/acp/alsa-util.c
@@ -1648,20 +1648,12 @@ static int mixer_class_event(snd_mixer_class_t *class, unsigned int mask,
} else if (mask & SND_CTL_EVENT_MASK_ADD) {
snd_ctl_elem_iface_t iface = snd_hctl_elem_get_interface(helem);
if (iface == SND_CTL_ELEM_IFACE_CARD || iface == SND_CTL_ELEM_IFACE_PCM) {
- snd_mixer_t *mixer = snd_mixer_class_get_mixer(class);
- snd_ctl_elem_iface_t iface = snd_hctl_elem_get_interface(helem);
- const char *name = snd_hctl_elem_get_name(helem);
- const int index = snd_hctl_elem_get_index(helem);
- const int device = snd_hctl_elem_get_device(helem);
snd_mixer_elem_t *new_melem;
- new_melem = pa_alsa_mixer_find(mixer, iface, name, index, device);
- if (!new_melem) {
- /* Put the hctl pointer as our private data - it will be useful for callbacks */
- if ((err = snd_mixer_elem_new(&new_melem, SND_MIXER_ELEM_PULSEAUDIO, 0, helem, NULL)) < 0) {
- pa_log_warn("snd_mixer_elem_new failed: %s", pa_alsa_strerror(err));
- return 0;
- }
+ /* Put the hctl pointer as our private data - it will be useful for callbacks */
+ if ((err = snd_mixer_elem_new(&new_melem, SND_MIXER_ELEM_PULSEAUDIO, 0, helem, NULL)) < 0) {
+ pa_log_warn("snd_mixer_elem_new failed: %s", pa_alsa_strerror(err));
+ return 0;
}
if ((err = snd_mixer_elem_attach(new_melem, helem)) < 0) {
--
2.40.0

View File

@ -0,0 +1,43 @@
From ea7781d7d07870871a3703c1b32fe177b8ba7a18 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Fri, 14 Apr 2023 17:52:26 +0200
Subject: [PATCH] alsa: fix area pointers
We should use the first and step fields to get to the first byte in the
area.
See #3069
---
spa/plugins/alsa/alsa-pcm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c
index 53407f4b0..fd941ceb3 100644
--- a/spa/plugins/alsa/alsa-pcm.c
+++ b/spa/plugins/alsa/alsa-pcm.c
@@ -2179,7 +2179,7 @@ again:
if (SPA_LIKELY(state->use_mmap)) {
for (i = 0; i < b->buf->n_datas; i++) {
- spa_memcpy(SPA_PTROFF(my_areas[i].addr, off * frame_size, void),
+ spa_memcpy(snd_pcm_channel_area_addr(&my_areas[i], off),
SPA_PTROFF(d[i].data, offs, void), n_bytes);
}
} else {
@@ -2290,11 +2290,11 @@ push_frames(struct state *state,
for (i = 0; i < b->buf->n_datas; i++) {
spa_memcpy(d[i].data,
- SPA_PTROFF(my_areas[i].addr, offset * frame_size, void),
+ snd_pcm_channel_area_addr(&my_areas[i], offset),
l0);
if (SPA_UNLIKELY(l1 > 0))
spa_memcpy(SPA_PTROFF(d[i].data, l0, void),
- my_areas[i].addr,
+ snd_pcm_channel_area_addr(&my_areas[i], 0),
l1);
d[i].chunk->offset = 0;
d[i].chunk->size = n_bytes;
--
2.40.0

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Sat Apr 15 10:08:51 UTC 2023 - Alexei Sorokin <sor.alexei@meowr.ru>
- Add patch from upstream for https://bugs.archlinux.org/task/78195
* 0001-Revert-alsa-mixer-allow-to-re-attach-the-mixer-control.patch
- Add patch from upstream to fix some potentially broken devices:
* 0002-alsa-fix-area-pointers.patch
-------------------------------------------------------------------
Fri Apr 14 08:58:53 UTC 2023 - Antonio Larrosa <alarrosa@suse.com>

View File

@ -62,7 +62,12 @@ Group: Development/Libraries/C and C++
URL: https://pipewire.org/
Source0: %{name}-%{version}.tar.xz
Source99: baselibs.conf
# PATCH-FIX-OPENSUSE reduce-meson-dependency.patch
Patch0: reduce-meson-dependency.patch
# PATCH-FIX-UPSTREAM 0001-Revert-alsa-mixer-allow-to-re-attach-the-mixer-control.patch
Patch1: 0001-Revert-alsa-mixer-allow-to-re-attach-the-mixer-control.patch
# PATCH-FIX-UPSTREAM 0002-alsa-fix-area-pointers.patch
Patch2: 0002-alsa-fix-area-pointers.patch
BuildRequires: docutils
BuildRequires: doxygen
BuildRequires: fdupes
@ -72,7 +77,7 @@ BuildRequires: gcc9
BuildRequires: gcc9-c++
%endif
BuildRequires: graphviz
BuildRequires: meson >= 0.59.0
BuildRequires: meson >= 0.59.4
BuildRequires: pam-devel
BuildRequires: pkgconfig
BuildRequires: readline-devel