[pulseaudio/f19] backport patch from upstream to fix crash in alsa-ucm module

Kyle McMartin kyle at fedoraproject.org
Wed Jul 24 15:30:36 UTC 2013


commit 9ad54055bb0a81ea68a6b56bad0393dc2f01ba68
Author: Kyle McMartin <kyle at mcmartin.ca>
Date:   Wed Jul 24 10:55:40 2013 -0400

    backport patch from upstream to fix crash in alsa-ucm module

 0008-alsa_ucm-fallback-to-stereo-duplex.patch |   30 +++++++++++++++++++++++++
 pulseaudio.spec                               |    8 +++++-
 2 files changed, 37 insertions(+), 1 deletions(-)
---
diff --git a/0008-alsa_ucm-fallback-to-stereo-duplex.patch b/0008-alsa_ucm-fallback-to-stereo-duplex.patch
new file mode 100644
index 0000000..62715ae
--- /dev/null
+++ b/0008-alsa_ucm-fallback-to-stereo-duplex.patch
@@ -0,0 +1,30 @@
+commit 83d44139d3550ebd867d61cf1b4564370d56e5e4
+Author: David Henningsson <david.henningsson at canonical.com>
+Date:   Tue Feb 5 09:22:17 2013 +0100
+
+    alsa-ucm: Fallback to stereo duplex
+    
+    If 'PlaybackChannels' and 'CaptureChannels' are absent in the UCM
+    file for a device, assume the device is stereo duplex.
+    
+    Reported-by: Luke Yelavich <luke.yelavich at canonical.com>
+    Signed-off-by: David Henningsson <david.henningsson at canonical.com>
+
+diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c
+index 80e98ea..9e62dcb 100644
+--- a/src/modules/alsa/alsa-ucm.c
++++ b/src/modules/alsa/alsa-ucm.c
+@@ -247,7 +247,12 @@ static int ucm_get_device_property(
+         }
+     }
+ 
+-    pa_assert(device->playback_channels || device->capture_channels);
++    if (device->playback_channels == 0 && device->capture_channels == 0) {
++        pa_log_warn("UCM file does not specify 'PlaybackChannels' or 'CaptureChannels'"
++                    "for device %s, assuming stereo duplex.", device_name);
++        device->playback_channels = 2;
++        device->capture_channels = 2;
++    }
+ 
+     /* get priority of device */
+     if (device->playback_channels) { /* sink device */
diff --git a/pulseaudio.spec b/pulseaudio.spec
index b68aaa6..3b77ce7 100644
--- a/pulseaudio.spec
+++ b/pulseaudio.spec
@@ -8,7 +8,7 @@
 Name:           pulseaudio
 Summary:        Improved Linux Sound Server
 Version:        %{pa_major}%{?pa_minor:.%{pa_minor}}
-Release:        10%{?dist}
+Release:        11%{?dist}
 License:        LGPLv2+
 URL:            http://www.freedesktop.org/wiki/Software/PulseAudio
 Source0:        http://freedesktop.org/software/pulseaudio/releases/pulseaudio-%{version}.tar.xz
@@ -22,6 +22,7 @@ Patch104: 0004-Call-change_cb-only-when-there-s-an-actual-change.patch
 Patch105: 0005-Initialize-monitor-s-busy-status-to-false-if-we-own-.patch
 Patch106: 0006-reserve-Move-get_name_owner-to-the-public-rd_device-.patch
 Patch107: 0007-reserve-Fix-leaking-NameLost-signals-after-release-a.patch
+Patch108: 0008-alsa_ucm-fallback-to-stereo-duplex.patch
 
 BuildRequires:  m4
 BuildRequires:  libtool-ltdl-devel
@@ -204,6 +205,7 @@ This package contains GDM integration hooks for the PulseAudio sound server.
 %patch105 -p1 -b .0005
 %patch106 -p1 -b .0006
 %patch107 -p1 -b .0007
+%patch108 -p1 -b .0008
 
 ## kill rpaths
 %if "%{_libdir}" != "/usr/lib"
@@ -476,6 +478,10 @@ exit 0
 %attr(0600, gdm, gdm) %{_localstatedir}/lib/gdm/.pulse/default.pa
 
 %changelog
+* Tue Jul 23 2013 Kyle McMartin <kyle at redhat.com> 3.0-11
+- pull an upstream patch to avoid an assert when channels are absent
+  in a ucm file (git commit 83d44139 upstream.)
+
 * Thu May 30 2013 Rex Dieter <rdieter at fedoraproject.org> 3.0-10
 - avoid needless (re)autoconf
 


More information about the scm-commits mailing list