Fix pa crashing on Bay- and Cherry-Trail devices

This commit is contained in:
Hans de Goede 2017-11-09 13:36:15 +01:00
parent e0c8b6bb0a
commit 0ed2aae3cf
2 changed files with 70 additions and 1 deletions

View File

@ -0,0 +1,62 @@
From patchwork Wed Nov 8 12:20:22 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [1/2] card-restore: log the correct profile name
From: Tanu Kaskinen <tanuk@iki.fi>
X-Patchwork-Id: 187101
Message-Id: <20171108122023.8147-2-tanuk@iki.fi>
To: pulseaudio-discuss@lists.freedesktop.org
Date: Wed, 8 Nov 2017 14:20:22 +0200
---
src/modules/module-card-restore.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c
index 3c0307bee..2d3a91c01 100644
--- a/src/modules/module-card-restore.c
+++ b/src/modules/module-card-restore.c
@@ -561,7 +561,7 @@ static pa_hook_result_t card_choose_initial_profile_callback(pa_core *core, pa_c
profile = pa_hashmap_get(card->profiles, e->profile);
if (profile) {
- pa_log_info("Restoring profile '%s' for card %s.", card->active_profile->name, card->name);
+ pa_log_info("Restoring profile '%s' for card %s.", profile->name, card->name);
pa_card_set_profile(card, profile, true);
} else {
pa_log_debug("Tried to restore profile %s for card %s, but the card doesn't have such profile.",
From patchwork Wed Nov 8 12:20:23 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [2/2] card-restore: don't restore unavailable profiles
From: Tanu Kaskinen <tanuk@iki.fi>
X-Patchwork-Id: 187102
Message-Id: <20171108122023.8147-3-tanuk@iki.fi>
To: pulseaudio-discuss@lists.freedesktop.org
Date: Wed, 8 Nov 2017 14:20:23 +0200
---
src/modules/module-card-restore.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c
index 2d3a91c01..b7189ad53 100644
--- a/src/modules/module-card-restore.c
+++ b/src/modules/module-card-restore.c
@@ -561,8 +561,12 @@ static pa_hook_result_t card_choose_initial_profile_callback(pa_core *core, pa_c
profile = pa_hashmap_get(card->profiles, e->profile);
if (profile) {
- pa_log_info("Restoring profile '%s' for card %s.", profile->name, card->name);
- pa_card_set_profile(card, profile, true);
+ if (profile->available != PA_AVAILABLE_NO) {
+ pa_log_info("Restoring profile '%s' for card %s.", profile->name, card->name);
+ pa_card_set_profile(card, profile, true);
+ } else
+ pa_log_debug("Not restoring profile %s for card %s, because the profile is currently unavailable.",
+ profile->name, card->name);
} else {
pa_log_debug("Tried to restore profile %s for card %s, but the card doesn't have such profile.",
e->profile, card->name);

View File

@ -25,7 +25,7 @@
Name: pulseaudio
Summary: Improved Linux Sound Server
Version: %{pa_major}%{?pa_minor:.%{pa_minor}}
Release: 5%{?snap:.%{snap}git%{shortcommit}}%{?dist}
Release: 6%{?snap:.%{snap}git%{shortcommit}}%{?dist}
License: LGPLv2+
URL: http://www.freedesktop.org/wiki/Software/PulseAudio
%if 0%{?gitrel}
@ -72,6 +72,9 @@ Patch103: v5-3-4-bluetooth-add-correct-HFP-rfcomm-negotiation.patch
Patch104: v5-4-4-bluetooth-make-native-the-default-backend.patch
# addendum to patch4 above -- rex
Patch105: 0066-install-dell-dock-tb16-usb-audio.conf.patch
# patchset from https://bugs.freedesktop.org/show_bug.cgi?id=100488 fixing pa
# crashing on Bay/Cherry Trail unless realtime-scheduling=no is set
Patch106: Fix-realtime-scheduling-on-byt-cht.patch
BuildRequires: automake libtool
BuildRequires: pkgconfig(bash-completion)
@ -269,6 +272,7 @@ This package contains GDM integration hooks for the PulseAudio sound server.
%patch104 -p1
%endif
%patch105 -p1
%patch106 -p1
%patch1 -p1 -b .autostart
%patch2 -p1 -b .disable_flat_volumes
@ -612,6 +616,9 @@ exit 0
%changelog
* Wed Nov 08 2017 Hans de Goede <hdegoede@redhat.com> - 11.1-6
- Fix pa crashing on Bay- and Cherry-Trail devices
* Wed Nov 01 2017 Rex Dieter <rdieter@fedoraproject.org> - 11.1-5
- actually install new dell-dock-tb16-usb-audio.conf alsa profile (#1492344)