This commit is contained in:
Rex Dieter 2020-09-22 17:26:57 -05:00
parent 11e1f26b76
commit e01e1253ef
11 changed files with 8 additions and 410 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@
/pulseaudio-12.99.3.tar.xz.sha256
/pulseaudio-13.0.tar.xz.sha256
/pulseaudio-13.99.1.tar.xz.sha256
/pulseaudio-13.99.2.tar.xz.sha256

View File

@ -1,45 +0,0 @@
From 9641a4f5e8601350f67e89480e41aaf3a64b8799 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Tue, 11 Feb 2020 10:54:16 +0100
Subject: [PATCH 1/5] alsa-ucm: correct the channel default logic (stereo)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/modules/alsa/alsa-ucm.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c
index a57be6d22..b7d2c5b9c 100644
--- a/src/modules/alsa/alsa-ucm.c
+++ b/src/modules/alsa/alsa-ucm.c
@@ -377,6 +377,13 @@ static int ucm_get_device_property(
pa_log("UCM playback device %s fetch pcm failed", device_name);
}
+ if (pa_proplist_gets(device->proplist, PA_ALSA_PROP_UCM_SINK) &&
+ device->playback_channels == 0) {
+ pa_log("UCM file does not specify 'PlaybackChannels' "
+ "for device %s, assuming stereo duplex.", device_name);
+ device->playback_channels = 2;
+ }
+
value = pa_proplist_gets(device->proplist, PA_ALSA_PROP_UCM_CAPTURE_CHANNELS);
if (value) { /* input */
/* get channels */
@@ -391,10 +398,10 @@ static int ucm_get_device_property(
pa_log("UCM capture device %s fetch pcm failed", device_name);
}
- if (device->playback_channels == 0 && device->capture_channels == 0) {
- pa_log_warn("UCM file does not specify 'PlaybackChannels' or 'CaptureChannels'"
+ if (pa_proplist_gets(device->proplist, PA_ALSA_PROP_UCM_SOURCE) &&
+ device->capture_channels == 0) {
+ pa_log("UCM file does not specify 'CaptureChannels' "
"for device %s, assuming stereo duplex.", device_name);
- device->playback_channels = 2;
device->capture_channels = 2;
}
--
2.24.1

View File

@ -1,27 +0,0 @@
From faf501ea889e81075fb4a2f0fc2a7bf9f872b137 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Wed, 25 Mar 2020 16:30:23 +0100
Subject: [PATCH 1/3] alsa-ucm: use the right profile name
Use the right profile name or else we could pass NULL to
pa_hashmap_get() and crash.
---
src/modules/alsa/alsa-ucm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c
index 37cbafae5..9d6456162 100644
--- a/src/modules/alsa/alsa-ucm.c
+++ b/src/modules/alsa/alsa-ucm.c
@@ -1315,7 +1315,7 @@ int pa_alsa_ucm_set_profile(pa_alsa_ucm_config *ucm, pa_card *card, const char *
/* select volume controls on ports */
PA_HASHMAP_FOREACH(port, card->ports, state) {
data = PA_DEVICE_PORT_DATA(port);
- data->path = pa_hashmap_get(data->paths, new_profile);
+ data->path = pa_hashmap_get(data->paths, profile);
}
return ret;
--
2.26.2

View File

@ -1,79 +0,0 @@
From d45b84cae0a09b5804669da1bfec228272101664 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Tue, 31 Mar 2020 13:24:36 +0200
Subject: [PATCH 1/2] ucm: fix the port / ucm device activation on boot
The UCM device must be activated using the pa_alsa_ucm_set_port()
call on boot (the sink creation time). In case when the
mixer controls are not defined for the application in the
UCM configuration, the mixer_handle is NULL.
Call the pa_alsa_ucm_set_port() before the mixer_handle check.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/modules/alsa/alsa-sink.c | 11 +++++++----
src/modules/alsa/alsa-source.c | 11 +++++++----
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 65430caed..c7754b60b 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -2138,6 +2138,13 @@ static int setup_mixer(struct userdata *u, bool ignore_dB) {
pa_assert(u);
+ /* First activate the port on the UCM side */
+ /* the UCM device might not define mixer controls */
+ if (u->sink->active_port && u->ucm_context) {
+ if (pa_alsa_ucm_set_port(u->ucm_context, u->sink->active_port, true) < 0)
+ return -1;
+ }
+
if (!u->mixer_handle)
return 0;
@@ -2155,10 +2162,6 @@ static int setup_mixer(struct userdata *u, bool ignore_dB) {
} else {
pa_alsa_ucm_port_data *data;
- /* First activate the port on the UCM side */
- if (pa_alsa_ucm_set_port(u->ucm_context, u->sink->active_port, true) < 0)
- return -1;
-
data = PA_DEVICE_PORT_DATA(u->sink->active_port);
/* Now activate volume controls, if any */
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index c33f81e35..b12deef76 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -1844,6 +1844,13 @@ static int setup_mixer(struct userdata *u, bool ignore_dB) {
pa_assert(u);
+ /* First activate the port on the UCM side */
+ /* the UCM device might not define mixer controls */
+ if (u->source->active_port && u->ucm_context) {
+ if (pa_alsa_ucm_set_port(u->ucm_context, u->source->active_port, false) < 0)
+ return -1;
+ }
+
if (!u->mixer_handle)
return 0;
@@ -1861,10 +1868,6 @@ static int setup_mixer(struct userdata *u, bool ignore_dB) {
} else {
pa_alsa_ucm_port_data *data;
- /* First activate the port on the UCM side */
- if (pa_alsa_ucm_set_port(u->ucm_context, u->source->active_port, false) < 0)
- return -1;
-
data = PA_DEVICE_PORT_DATA(u->source->active_port);
/* Now activate volume controls, if any */
--
2.25.1

View File

@ -1,61 +0,0 @@
From dc0b263d687055e4b58323c5a1ba98222a19c518 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Tue, 31 Mar 2020 13:32:46 +0200
Subject: [PATCH 2/2] alsa sink/source: fix the mixer initialization
- remove duplicate mixer initialization in sink
- use the similar mixer initialization for source like for sink
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/modules/alsa/alsa-sink.c | 2 --
src/modules/alsa/alsa-source.c | 12 +++++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index c7754b60b..a8792ed33 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -2509,8 +2509,6 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
/* ALSA might tweak the sample spec, so recalculate the frame size */
frame_size = pa_frame_size(&ss);
- find_mixer(u, mapping, pa_modargs_get_value(ma, "control", NULL), ignore_dB);
-
pa_sink_new_data_init(&data);
data.driver = driver;
data.module = m;
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index b12deef76..721cda2db 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -2196,8 +2196,6 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
/* ALSA might tweak the sample spec, so recalculate the frame size */
frame_size = pa_frame_size(&ss);
- find_mixer(u, mapping, pa_modargs_get_value(ma, "control", NULL), ignore_dB);
-
pa_source_new_data_init(&data);
data.driver = driver;
data.module = m;
@@ -2252,10 +2250,14 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
goto fail;
}
- if (u->ucm_context)
+ if (u->ucm_context) {
pa_alsa_ucm_add_ports(&data.ports, data.proplist, u->ucm_context, false, card, u->pcm_handle, ignore_dB);
- else if (u->mixer_path_set)
- pa_alsa_add_ports(&data, u->mixer_path_set, card);
+ find_mixer(u, mapping, pa_modargs_get_value(ma, "control", NULL), ignore_dB);
+ } else {
+ find_mixer(u, mapping, pa_modargs_get_value(ma, "control", NULL), ignore_dB);
+ if (u->mixer_path_set)
+ pa_alsa_add_ports(&data, u->mixer_path_set, card);
+ }
u->source = pa_source_new(m->core, &data, PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY|(u->use_tsched ? PA_SOURCE_DYNAMIC_LATENCY : 0));
volume_is_set = data.volume_is_set;
--
2.25.1

View File

@ -1,31 +0,0 @@
From 7790513cb20737d6ff6991b79d6dfbc227d94909 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Sun, 1 Mar 2020 15:55:07 +0100
Subject: [PATCH 2/5] alsa ucm: do not assign JackHWMute when JackControl is
missing for the UCM device
Fixes: https://github.com/alsa-project/alsa-ucm-conf/issues/14
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/modules/alsa/alsa-ucm.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c
index b7d2c5b9c..8df24e7b5 100644
--- a/src/modules/alsa/alsa-ucm.c
+++ b/src/modules/alsa/alsa-ucm.c
@@ -1730,6 +1730,10 @@ static int ucm_create_profile(
/* JackHWMute contains a list of device names. Each listed device must
* be associated with the jack object that we just created. */
jack_hw_mute = pa_proplist_gets(dev->proplist, PA_ALSA_PROP_UCM_JACK_HW_MUTE);
+ if (jack_hw_mute && !jack) {
+ pa_log("[%s] JackHWMute set, but JackControl is missing", name);
+ jack_hw_mute = NULL;
+ }
if (jack_hw_mute) {
char *hw_mute_device_name;
const char *state = NULL;
--
2.24.1

View File

@ -1,45 +0,0 @@
From 80e4f6363e1a9e1937fb6527b64896ec3da43df7 Mon Sep 17 00:00:00 2001
From: Tanu Kaskinen <tanuk@iki.fi>
Date: Tue, 17 Mar 2020 09:26:57 +0200
Subject: [PATCH 3/5] ucm: Don't log errors during normal operation
It's completely normal to not have explicit channel configuration for
stereo devices. In fact, the ALSA developers actively avoid configuring
the channels for stereo devices.
I also dropped the word "duplex" from the messages, because "stereo
duplex" implies bidirectionality, but most devices use one direction
only.
---
src/modules/alsa/alsa-ucm.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c
index 8df24e7b5..37cbafae5 100644
--- a/src/modules/alsa/alsa-ucm.c
+++ b/src/modules/alsa/alsa-ucm.c
@@ -379,8 +379,8 @@ static int ucm_get_device_property(
if (pa_proplist_gets(device->proplist, PA_ALSA_PROP_UCM_SINK) &&
device->playback_channels == 0) {
- pa_log("UCM file does not specify 'PlaybackChannels' "
- "for device %s, assuming stereo duplex.", device_name);
+ pa_log_info("UCM file does not specify 'PlaybackChannels' "
+ "for device %s, assuming stereo.", device_name);
device->playback_channels = 2;
}
@@ -400,8 +400,8 @@ static int ucm_get_device_property(
if (pa_proplist_gets(device->proplist, PA_ALSA_PROP_UCM_SOURCE) &&
device->capture_channels == 0) {
- pa_log("UCM file does not specify 'CaptureChannels' "
- "for device %s, assuming stereo duplex.", device_name);
+ pa_log_info("UCM file does not specify 'CaptureChannels' "
+ "for device %s, assuming stereo.", device_name);
device->capture_channels = 2;
}
--
2.24.1

View File

@ -1,61 +0,0 @@
From 636dca6a61c0ddbd4cfcdde75ac0c97ffa96aebf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali.rohar@gmail.com>
Date: Thu, 19 Mar 2020 14:02:40 +0100
Subject: [PATCH 4/5] bluetooth: Ensure that only one A2DP codec is registered
to bluez
Support for multiple codecs needs to use a new Bluez API which pulseaudio
does not implement yet.
So register explicitly only SBC codec which is provided by pulseaudio A2DP
codec API.
---
src/modules/bluetooth/bluez5-util.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/src/modules/bluetooth/bluez5-util.c b/src/modules/bluetooth/bluez5-util.c
index d95c9c117..a21896ede 100644
--- a/src/modules/bluetooth/bluez5-util.c
+++ b/src/modules/bluetooth/bluez5-util.c
@@ -944,8 +944,9 @@ static void parse_interfaces_and_properties(pa_bluetooth_discovery *y, DBusMessa
pa_assert(dbus_message_iter_get_arg_type(&iface_i) == DBUS_TYPE_ARRAY);
if (pa_streq(interface, BLUEZ_ADAPTER_INTERFACE)) {
+
+ const pa_a2dp_codec *a2dp_codec_sbc;
pa_bluetooth_adapter *a;
- unsigned a2dp_codec_i;
if ((a = pa_hashmap_get(y->adapters, path))) {
pa_log_error("Found duplicated D-Bus path for adapter %s", path);
@@ -960,20 +961,13 @@ static void parse_interfaces_and_properties(pa_bluetooth_discovery *y, DBusMessa
if (!a->valid)
return;
- /* Order is important. bluez prefers endpoints registered earlier.
- * And codec with higher number has higher priority. So iterate in reverse order. */
- for (a2dp_codec_i = pa_bluetooth_a2dp_codec_count(); a2dp_codec_i > 0; a2dp_codec_i--) {
- const pa_a2dp_codec *a2dp_codec = pa_bluetooth_a2dp_codec_iter(a2dp_codec_i-1);
- char *endpoint;
-
- endpoint = pa_sprintf_malloc("%s/%s", A2DP_SINK_ENDPOINT, a2dp_codec->name);
- register_endpoint(y, a2dp_codec, path, endpoint, PA_BLUETOOTH_UUID_A2DP_SINK);
- pa_xfree(endpoint);
-
- endpoint = pa_sprintf_malloc("%s/%s", A2DP_SOURCE_ENDPOINT, a2dp_codec->name);
- register_endpoint(y, a2dp_codec, path, endpoint, PA_BLUETOOTH_UUID_A2DP_SOURCE);
- pa_xfree(endpoint);
- }
+ /* Currently only one A2DP codec is supported, so register only SBC
+ * Support for multiple codecs needs to use a new Bluez API which
+ * pulseaudio does not implement yet, patches are waiting in queue */
+ a2dp_codec_sbc = pa_bluetooth_get_a2dp_codec("sbc");
+ pa_assert(a2dp_codec_sbc);
+ register_endpoint(y, a2dp_codec_sbc, path, A2DP_SINK_ENDPOINT "/sbc", PA_BLUETOOTH_UUID_A2DP_SINK);
+ register_endpoint(y, a2dp_codec_sbc, path, A2DP_SOURCE_ENDPOINT "/sbc", PA_BLUETOOTH_UUID_A2DP_SOURCE);
} else if (pa_streq(interface, BLUEZ_DEVICE_INTERFACE)) {
--
2.24.1

View File

@ -1,41 +0,0 @@
From e414863ec1502664efbc83586028793e08277b76 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Fri, 20 Mar 2020 12:03:08 +0100
Subject: [PATCH 5/5] alsa: handle unavailbale HW volume in UCM
It is possible that UCM doesn't specify hardware volume controls.
Fall back to software controls instead of aborting.
---
src/modules/alsa/alsa-sink.c | 2 +-
src/modules/alsa/alsa-source.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 042d4dfd9..65430caed 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -1654,7 +1654,7 @@ static int sink_set_port_ucm_cb(pa_sink *s, pa_device_port *p) {
pa_assert(u->ucm_context);
data = PA_DEVICE_PORT_DATA(p);
- pa_assert_se(u->mixer_path = data->path);
+ u->mixer_path = data->path;
mixer_volume_init(u);
if (s->flags & PA_SINK_DEFERRED_VOLUME)
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index 104de4e26..c33f81e35 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -1525,7 +1525,7 @@ static int source_set_port_ucm_cb(pa_source *s, pa_device_port *p) {
pa_assert(u->ucm_context);
data = PA_DEVICE_PORT_DATA(p);
- pa_assert_se(u->mixer_path = data->path);
+ u->mixer_path = data->path;
mixer_volume_init(u);
if (s->flags & PA_SOURCE_DEFERRED_VOLUME)
--
2.24.1

View File

@ -1,5 +1,5 @@
%global pa_major 13.99
%global pa_minor 1
%global pa_minor 2
#global snap 20200105
#global gitrel 103
@ -31,7 +31,7 @@
Name: pulseaudio
Summary: Improved Linux Sound Server
Version: %{pa_major}%{?pa_minor:.%{pa_minor}}
Release: 6%{?snap:.%{snap}git%{shortcommit}}%{?dist}
Release: 1%{?snap:.%{snap}git%{shortcommit}}%{?dist}
License: LGPLv2+
URL: http://www.freedesktop.org/wiki/Software/PulseAudio
%if 0%{?gitrel}
@ -55,14 +55,6 @@ Patch201: pulseaudio-autostart.patch
Patch206: pulseaudio-11.1-autospawn_disable.patch
## upstream patches
Patch207: 0001-alsa-ucm-correct-the-channel-default-logic-stereo.patch
Patch208: 0002-alsa-ucm-do-not-assign-JackHWMute-when-JackControl-i.patch
Patch209: 0003-ucm-Don-t-log-errors-during-normal-operation.patch
Patch210: 0004-bluetooth-Ensure-that-only-one-A2DP-codec-is-registe.patch
Patch211: 0005-alsa-handle-unavailbale-HW-volume-in-UCM.patch
Patch212: 0001-alsa-ucm-use-the-right-profile-name.patch
Patch213: 0001-ucm-fix-the-port-ucm-device-activation-on-boot.patch
Patch214: 0002-alsa-sink-source-fix-the-mixer-initialization.patch
## upstreamable patches
@ -261,14 +253,6 @@ This package contains GDM integration hooks for the PulseAudio sound server.
%if 0%{?systemd}
%patch206 -p1 -b .autospawn_disable
%endif
%patch207 -p1 -b .0007
%patch208 -p1 -b .0008
%patch209 -p1 -b .0009
%patch210 -p1 -b .0010
%patch211 -p1 -b .0011
%patch212 -p1 -b .0012
%patch213 -p1 -b .0013
%patch214 -p1 -b .0014
sed -i.no_consolekit -e \
's/^load-module module-console-kit/#load-module module-console-kit/' \
@ -660,6 +644,9 @@ systemctl --no-reload preset --global pulseaudio.socket >/dev/null 2>&1 || :
%changelog
* Tue Sep 22 2020 Rex Dieter <rdieter@fedoraproject.org> - 13.99.2-1
- 13.99.2
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 13.99.1-6
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

View File

@ -1,2 +1,2 @@
SHA512 (pulseaudio-13.99.1.tar.xz) = 426530b6b9dd94dcc848067376857faae42e86878a82784c5bafa615a68dcc7e22702e0cb5835f91160f19fc9934fe3d53b7d387e3f42b6595fa934b172fe2aa
SHA512 (pulseaudio-13.99.1.tar.xz.sha256) = 0fa844c9ece9b4aea1c1d432f31ab58a2487e4c3be6194eb8a63be6cc80c98d097ae48787d1ab03ac9e352691d8562646693c9a559feac56794158c743384710
SHA512 (pulseaudio-13.99.2.tar.xz) = 6a54ded2be3ab49ff11c6280532b98f20b5e6018275f42cfac74b1e25cee8159694886719eb17b878acb4de13b03dcfc2801a0f2c65f66e0ac48857d83161d06
SHA512 (pulseaudio-13.99.2.tar.xz.sha256) = b8b4e9790305f7e4cfd4b0a4294044e6437b1522c28f05de69efe90c9465b15879d73177434e15da9458e91b968d80674fbd271d6380a49fd60d615963f70398