commit 33c90a0b5c365d9096538d8fd486587798ee1bd3
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Mon Oct 18 20:48:20 2021 +0100
Fix pipewire samplerate
mpd.spec | 8 +++++++-
pipewire_samplerate.patch | 30 ++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+), 1 deletion(-)
---
diff --git a/mpd.spec b/mpd.spec
index 0218e71..81d65f3 100644
--- a/mpd.spec
+++ b/mpd.spec
@@ -17,7 +17,7 @@
Name: mpd
Epoch: 1
Version: 0.23
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: The Music Player Daemon
License: GPLv2+
URL:
https://www.musicpd.org
@@ -34,6 +34,8 @@ Source4: mpd.tmpfiles.d
Source5: mpd.xml
Patch0: mpd-0.22-mpdconf.patch
Patch1: mpd-0.20-remove_NoNewPrivileges.patch
+#
https://github.com/MusicPlayerDaemon/MPD/commit/d5be8c74b009cdfc16b2b637a...
+Patch2: pipewire_samplerate.patch
BuildRequires: alsa-lib-devel
BuildRequires: audiofile-devel
@@ -128,6 +130,7 @@ This package contains FirewallD file for MPD.
%setup -q
%patch0 -p1
%patch1 -p1
+%patch2 -p1
# Force python3-sphinx
sed -i -e 's@sphinx-build@sphinx-build-3@g' doc/meson.build
@@ -244,6 +247,9 @@ fi
%changelog
+* Mon Oct 18 2021 Leigh Scott <leigh123linux(a)gmail.com> - 1:0.23-2
+- Fix pipewire samplerate
+
* Thu Oct 14 2021 Leigh Scott <leigh123linux(a)gmail.com> - 1:0.23-1
- Update to 0.23
diff --git a/pipewire_samplerate.patch b/pipewire_samplerate.patch
new file mode 100644
index 0000000..2a5a6f7
--- /dev/null
+++ b/pipewire_samplerate.patch
@@ -0,0 +1,30 @@
+From d5be8c74b009cdfc16b2b637aa9c4edb11cf105d Mon Sep 17 00:00:00 2001
+From: Max Kellermann <max(a)musicpd.org>
+Date: Mon, 18 Oct 2021 16:45:21 +0200
+Subject: [PATCH] output/pipewire: attempt to change the graph sample rate
+
+Requires PipeWire 0.3.32.
+
+Closes
https://github.com/MusicPlayerDaemon/MPD/issues/1283
+---
+ src/output/plugins/PipeWireOutputPlugin.cxx | 7 +++++++
+ 1 files changed, 7 insertions(+)
+
+diff --git a/src/output/plugins/PipeWireOutputPlugin.cxx
b/src/output/plugins/PipeWireOutputPlugin.cxx
+index 6579c93b6..db7c36823 100644
+--- a/src/output/plugins/PipeWireOutputPlugin.cxx
++++ b/src/output/plugins/PipeWireOutputPlugin.cxx
+@@ -383,6 +383,13 @@ PipeWireOutput::Open(AudioFormat &audio_format)
+ if (target != nullptr && target_id == PW_ID_ANY)
+ pw_properties_setf(props, PW_KEY_NODE_TARGET, "%s", target);
+
++#ifdef PW_KEY_NODE_RATE
++ /* ask PipeWire to change the graph sample rate to ours
++ (requires PipeWire 0.3.32) */
++ pw_properties_setf(props, PW_KEY_NODE_RATE, "1/%u",
++ audio_format.sample_rate);
++#endif
++
+ const PipeWire::ThreadLoopLock lock(thread_loop);
+
+ stream = pw_stream_new_simple(pw_thread_loop_get_loop(thread_loop),