From 47b8db8fd2f7cf8148ac82da774b83b15d53a5d56b2110181377e23230f38e95 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Tue, 24 Apr 2007 11:57:20 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/pulseaudio?expand=0&rev=2 --- pulseaudio-0.9.5-framesize.patch | 14 ++++ pulseaudio-0.9.5-suspend.patch | 127 +++++++++++++++++++++++++++++++ pulseaudio-0.9.5-userconf.patch | 30 ++++++++ pulseaudio.changes | 11 +++ pulseaudio.spec | 46 +++++++---- 5 files changed, 213 insertions(+), 15 deletions(-) create mode 100644 pulseaudio-0.9.5-framesize.patch create mode 100644 pulseaudio-0.9.5-suspend.patch create mode 100644 pulseaudio-0.9.5-userconf.patch diff --git a/pulseaudio-0.9.5-framesize.patch b/pulseaudio-0.9.5-framesize.patch new file mode 100644 index 0000000..89c524a --- /dev/null +++ b/pulseaudio-0.9.5-framesize.patch @@ -0,0 +1,14 @@ +Index: src/modules/module-alsa-sink.c +=================================================================== +--- src/modules/module-alsa-sink.c (revision 1430) ++++ src/modules/module-alsa-sink.c (revision 1432) +@@ -415,6 +419,9 @@ + goto fail; + } + ++ /* ALSA might tweak the sample spec, so recalculate the frame size */ ++ frame_size = pa_frame_size(&ss); ++ + if (ss.channels != map.channels) + /* Seems ALSA didn't like the channel number, so let's fix the channel map */ + pa_channel_map_init_auto(&map, ss.channels, PA_CHANNEL_MAP_ALSA); diff --git a/pulseaudio-0.9.5-suspend.patch b/pulseaudio-0.9.5-suspend.patch new file mode 100644 index 0000000..7aafd07 --- /dev/null +++ b/pulseaudio-0.9.5-suspend.patch @@ -0,0 +1,127 @@ +Index: src/modules/module-alsa-sink.c +=================================================================== +--- src/modules/module-alsa-sink.c (revision 1431) ++++ src/modules/module-alsa-sink.c (working copy) +@@ -141,6 +141,33 @@ + return ret; + } + ++static int suspend_recovery(struct userdata *u) { ++ int ret; ++ assert(u); ++ ++ pa_log_info("*** ALSA-SUSPEND (playback) ***"); ++ ++ if ((ret = snd_pcm_resume(u->pcm_handle)) < 0) { ++ if (ret == -EAGAIN) ++ return -1; ++ ++ if (ret != -ENOSYS) ++ pa_log("snd_pcm_resume() failed: %s", snd_strerror(-ret)); ++ else { ++ if ((ret = snd_pcm_prepare(u->pcm_handle)) < 0) ++ pa_log("snd_pcm_prepare() failed: %s", snd_strerror(-ret)); ++ } ++ ++ if (ret < 0) { ++ clear_up(u); ++ pa_module_unload_request(u->module); ++ return -1; ++ } ++ } ++ ++ return ret; ++} ++ + static void do_write(struct userdata *u) { + assert(u); + +@@ -176,6 +203,13 @@ + continue; + } + ++ if (frames == -ESTRPIPE) { ++ if (suspend_recovery(u) < 0) ++ return; ++ ++ continue; ++ } ++ + pa_log("snd_pcm_writei() failed: %s", snd_strerror(-frames)); + + clear_up(u); +@@ -207,6 +241,10 @@ + if (xrun_recovery(u) < 0) + return; + ++ if (snd_pcm_state(u->pcm_handle) == SND_PCM_STATE_SUSPENDED) ++ if (suspend_recovery(u) < 0) ++ return; ++ + do_write(u); + } + +Index: src/modules/module-alsa-source.c +=================================================================== +--- src/modules/module-alsa-source.c (revision 1429) ++++ src/modules/module-alsa-source.c (working copy) +@@ -143,6 +143,34 @@ + return 0; + } + ++ ++static int suspend_recovery(struct userdata *u) { ++ int ret; ++ assert(u); ++ ++ pa_log_info("*** ALSA-SUSPEND (capture) ***"); ++ ++ if ((ret = snd_pcm_resume(u->pcm_handle)) < 0) { ++ if (ret == -EAGAIN) ++ return -1; ++ ++ if (ret != -ENOSYS) ++ pa_log("snd_pcm_resume() failed: %s", snd_strerror(-ret)); ++ else { ++ if ((ret = snd_pcm_prepare(u->pcm_handle)) < 0) ++ pa_log("snd_pcm_prepare() failed: %s", snd_strerror(-ret)); ++ } ++ ++ if (ret < 0) { ++ clear_up(u); ++ pa_module_unload_request(u->module); ++ return -1; ++ } ++ } ++ ++ return ret; ++} ++ + static void do_read(struct userdata *u) { + assert(u); + +@@ -175,6 +203,13 @@ + continue; + } + ++ if (frames == -ESTRPIPE) { ++ if (suspend_recovery(u) < 0) ++ return; ++ ++ continue; ++ } ++ + pa_log("snd_pcm_readi() failed: %s", snd_strerror(-frames)); + + clear_up(u); +@@ -210,6 +245,10 @@ + if (xrun_recovery(u) < 0) + return; + ++ if (snd_pcm_state(u->pcm_handle) == SND_PCM_STATE_SUSPENDED) ++ if (suspend_recovery(u) < 0) ++ return; ++ + do_read(u); + } + diff --git a/pulseaudio-0.9.5-userconf.patch b/pulseaudio-0.9.5-userconf.patch new file mode 100644 index 0000000..a933ad3 --- /dev/null +++ b/pulseaudio-0.9.5-userconf.patch @@ -0,0 +1,30 @@ +Index: /trunk/src/pulsecore/core-util.c +=================================================================== +--- /trunk/src/pulsecore/core-util.c (revision 1418) ++++ /trunk/src/pulsecore/core-util.c (revision 1423) +@@ -185,5 +185,5 @@ + } + #else +- pa_log_warn("secure directory creation not supported on Win32."); ++ pa_log_warn("secure directory creation not supported on Win32."); + #endif + +@@ -954,5 +954,6 @@ + #endif + +- if ((f = fopen(fn, mode)) || errno != ENOENT) { ++ f = fopen(fn, mode); ++ if (f != NULL) { + if (result) + *result = pa_xstrdup(fn); +@@ -961,4 +962,9 @@ + } + ++ if (errno != ENOENT) { ++ pa_log_warn("WARNING: failed to open configuration file '%s': %s", ++ lfn, pa_cstrerror(errno)); ++ } ++ + pa_xfree(lfn); + } + diff --git a/pulseaudio.changes b/pulseaudio.changes index 1e88a8a..3755a82 100644 --- a/pulseaudio.changes +++ b/pulseaudio.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Tue Apr 24 12:01:42 CEST 2007 - tiwai@suse.de + +- disable static library, don't use ltdl install +- fix requires of devel package +- fix post and postun +- build documents via doxygen +- fix suspend/resume with alsa backend +- fix the frame size handling in alsa backend +- fix possible NULL dereference + ------------------------------------------------------------------- Mon Oct 16 00:21:13 CEST 2006 - schwab@suse.de diff --git a/pulseaudio.spec b/pulseaudio.spec index b4efdd6..6cb056c 100644 --- a/pulseaudio.spec +++ b/pulseaudio.spec @@ -1,7 +1,7 @@ # # spec file for package pulseaudio (Version 0.9.5) # -# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # @@ -11,14 +11,17 @@ # norootforbuild Name: pulseaudio -BuildRequires: alsa-devel jack-devel liboil-devel libsamplerate-devel libsndfile-devel +BuildRequires: alsa-devel doxygen jack-devel liboil-devel libsamplerate-devel libsndfile-devel Summary: A Networked Sound Server Version: 0.9.5 -Release: 7 -License: LGPL +Release: 38 +License: GNU General Public License (GPL), GNU Library General Public License v. 2.0 and 2.1 (LGPL) Group: System/Sound Daemons Source: %{name}-%{version}.tar.bz2 Source1: default.pa +Patch: pulseaudio-0.9.5-framesize.patch +Patch1: pulseaudio-0.9.5-suspend.patch +Patch2: pulseaudio-0.9.5-userconf.patch URL: http://pulseaudio.org BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -52,7 +55,7 @@ Authors: %package devel Summary: Development package for the pulseaudio library Group: Development/Libraries/C and C++ -Requires: pulseaudio-libs = %{version} libsndfile-devel libsamplerate-devel liboil-devel libtool +Requires: pulseaudio-libs = %{version} %description devel This package contains the files needed to compile programs that use the @@ -67,23 +70,30 @@ Authors: %prep %setup +%patch +%patch1 +%patch2 -p2 +cp /usr/share/gettext/config.rpath . +%{?suse_update_config:%{suse_update_config -f}} +autoreconf --force --install %build -cp /usr/share/gettext/config.rpath . -autoreconf --force --install -%{?suse_update_config:%{suse_update_config -f}} -%configure +%configure --disable-ltdl-install --disable-static --disable-rpath make +make doxygen %install make DESTDIR="$RPM_BUILD_ROOT" install cp %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/pulse/ chmod 755 $RPM_BUILD_ROOT%{_bindir}/* +# remove *.la files +rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.la +rm -f $RPM_BUILD_ROOT%{_libdir}/pulse*/modules/*.la -%post +%post libs %run_ldconfig -%postun +%postun libs %run_ldconfig %clean @@ -104,16 +114,22 @@ test "$RPM_BUILD_ROOT" != "/" -a -d "$RPM_BUILD_ROOT" && rm -rf $RPM_BUILD_ROOT %files devel %defattr(-, root, root) +%doc doxygen/html %{_libdir}/libpulse.so -%{_libdir}/libpulse.*a %{_libdir}/libpulsecore.so -%{_libdir}/libpulsecore.*a %{_libdir}/libpulse-simple.so -%{_libdir}/libpulse-simple.*a %{_libdir}/pkgconfig/*.pc %{_includedir}/pulse* -%changelog -n pulseaudio +%changelog +* Tue Apr 24 2007 - tiwai@suse.de +- disable static library, don't use ltdl install +- fix requires of devel package +- fix post and postun +- build documents via doxygen +- fix suspend/resume with alsa backend +- fix the frame size handling in alsa backend +- fix possible NULL dereference * Mon Oct 16 2006 - schwab@suse.de - Make sure config.rpath is present. * Wed Sep 06 2006 - tiwai@suse.de