forked from pool/pulseaudio
This commit is contained in:
parent
ae34258785
commit
47b8db8fd2
14
pulseaudio-0.9.5-framesize.patch
Normal file
14
pulseaudio-0.9.5-framesize.patch
Normal file
@ -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);
|
127
pulseaudio-0.9.5-suspend.patch
Normal file
127
pulseaudio-0.9.5-suspend.patch
Normal file
@ -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);
|
||||||
|
}
|
||||||
|
|
30
pulseaudio-0.9.5-userconf.patch
Normal file
30
pulseaudio-0.9.5-userconf.patch
Normal file
@ -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);
|
||||||
|
}
|
||||||
|
|
@ -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
|
Mon Oct 16 00:21:13 CEST 2006 - schwab@suse.de
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package pulseaudio (Version 0.9.5)
|
# 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
|
# This file and all modifications and additions to the pristine
|
||||||
# package are under the same license as the package itself.
|
# package are under the same license as the package itself.
|
||||||
#
|
#
|
||||||
@ -11,14 +11,17 @@
|
|||||||
# norootforbuild
|
# norootforbuild
|
||||||
|
|
||||||
Name: pulseaudio
|
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
|
Summary: A Networked Sound Server
|
||||||
Version: 0.9.5
|
Version: 0.9.5
|
||||||
Release: 7
|
Release: 38
|
||||||
License: LGPL
|
License: GNU General Public License (GPL), GNU Library General Public License v. 2.0 and 2.1 (LGPL)
|
||||||
Group: System/Sound Daemons
|
Group: System/Sound Daemons
|
||||||
Source: %{name}-%{version}.tar.bz2
|
Source: %{name}-%{version}.tar.bz2
|
||||||
Source1: default.pa
|
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
|
URL: http://pulseaudio.org
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
|
||||||
@ -52,7 +55,7 @@ Authors:
|
|||||||
%package devel
|
%package devel
|
||||||
Summary: Development package for the pulseaudio library
|
Summary: Development package for the pulseaudio library
|
||||||
Group: Development/Libraries/C and C++
|
Group: Development/Libraries/C and C++
|
||||||
Requires: pulseaudio-libs = %{version} libsndfile-devel libsamplerate-devel liboil-devel libtool
|
Requires: pulseaudio-libs = %{version}
|
||||||
|
|
||||||
%description devel
|
%description devel
|
||||||
This package contains the files needed to compile programs that use the
|
This package contains the files needed to compile programs that use the
|
||||||
@ -67,23 +70,30 @@ Authors:
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup
|
%setup
|
||||||
|
%patch
|
||||||
|
%patch1
|
||||||
|
%patch2 -p2
|
||||||
|
cp /usr/share/gettext/config.rpath .
|
||||||
|
%{?suse_update_config:%{suse_update_config -f}}
|
||||||
|
autoreconf --force --install
|
||||||
|
|
||||||
%build
|
%build
|
||||||
cp /usr/share/gettext/config.rpath .
|
%configure --disable-ltdl-install --disable-static --disable-rpath
|
||||||
autoreconf --force --install
|
|
||||||
%{?suse_update_config:%{suse_update_config -f}}
|
|
||||||
%configure
|
|
||||||
make
|
make
|
||||||
|
make doxygen
|
||||||
|
|
||||||
%install
|
%install
|
||||||
make DESTDIR="$RPM_BUILD_ROOT" install
|
make DESTDIR="$RPM_BUILD_ROOT" install
|
||||||
cp %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/pulse/
|
cp %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/pulse/
|
||||||
chmod 755 $RPM_BUILD_ROOT%{_bindir}/*
|
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
|
%run_ldconfig
|
||||||
|
|
||||||
%postun
|
%postun libs
|
||||||
%run_ldconfig
|
%run_ldconfig
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
@ -104,16 +114,22 @@ test "$RPM_BUILD_ROOT" != "/" -a -d "$RPM_BUILD_ROOT" && rm -rf $RPM_BUILD_ROOT
|
|||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%defattr(-, root, root)
|
%defattr(-, root, root)
|
||||||
|
%doc doxygen/html
|
||||||
%{_libdir}/libpulse.so
|
%{_libdir}/libpulse.so
|
||||||
%{_libdir}/libpulse.*a
|
|
||||||
%{_libdir}/libpulsecore.so
|
%{_libdir}/libpulsecore.so
|
||||||
%{_libdir}/libpulsecore.*a
|
|
||||||
%{_libdir}/libpulse-simple.so
|
%{_libdir}/libpulse-simple.so
|
||||||
%{_libdir}/libpulse-simple.*a
|
|
||||||
%{_libdir}/pkgconfig/*.pc
|
%{_libdir}/pkgconfig/*.pc
|
||||||
%{_includedir}/pulse*
|
%{_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
|
* Mon Oct 16 2006 - schwab@suse.de
|
||||||
- Make sure config.rpath is present.
|
- Make sure config.rpath is present.
|
||||||
* Wed Sep 06 2006 - tiwai@suse.de
|
* Wed Sep 06 2006 - tiwai@suse.de
|
||||||
|
Loading…
Reference in New Issue
Block a user