From 811cb8f3ff2fef11e6fedf96f53f363cbe319b25 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Sat, 8 Mar 2008 15:00:45 +0000 Subject: [PATCH] Fix pidgin crash --- .cvsignore | 2 +- 1.0.14-buffer-attr.patch | 23 ------- 1.0.14-pulse-SND_PCM_STATE_PREPARED.patch | 22 ------ 1.0.14-state-xrun.patch | 82 ----------------------- alsa-plugins-1.0.16-pulseclose.patch | 22 ++++++ alsa-plugins.spec | 16 ++--- sources | 2 +- 7 files changed, 32 insertions(+), 137 deletions(-) delete mode 100644 1.0.14-buffer-attr.patch delete mode 100644 1.0.14-pulse-SND_PCM_STATE_PREPARED.patch delete mode 100644 1.0.14-state-xrun.patch create mode 100644 alsa-plugins-1.0.16-pulseclose.patch diff --git a/.cvsignore b/.cvsignore index 2ebeeb4..0cfb126 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -alsa-plugins-1.0.15.tar.bz2 +alsa-plugins-1.0.16.tar.bz2 diff --git a/1.0.14-buffer-attr.patch b/1.0.14-buffer-attr.patch deleted file mode 100644 index 155dfd2..0000000 --- a/1.0.14-buffer-attr.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- alsa-plugins-1.0.14/pulse/pcm_pulse.c 2007-05-31 10:06:51.000000000 +0200 -+++ alsa-plugins-1.0.14.lennart/pulse/pcm_pulse.c 2007-09-24 01:43:01.000000000 +0200 -@@ -57,7 +57,7 @@ - - if (size > pcm->last_size) { - pcm->ptr += size - pcm->last_size; -- pcm->ptr %= pcm->buffer_attr.maxlength; -+ pcm->ptr %= pcm->buffer_attr.tlength; - } - - pcm->last_size = size; -@@ -533,9 +533,9 @@ - pcm->ss.rate = io->rate; - pcm->ss.channels = io->channels; - -- pcm->buffer_attr.maxlength = io->buffer_size * pcm->frame_size; -+ pcm->buffer_attr.maxlength = (io->buffer_size*3)/2 * pcm->frame_size; - pcm->buffer_attr.tlength = io->buffer_size * pcm->frame_size; -- pcm->buffer_attr.prebuf = io->period_size * pcm->frame_size; -+ pcm->buffer_attr.prebuf = (io->buffer_size-io->period_size) * pcm->frame_size; - pcm->buffer_attr.minreq = io->period_size * pcm->frame_size; - pcm->buffer_attr.fragsize = io->period_size * pcm->frame_size; - diff --git a/1.0.14-pulse-SND_PCM_STATE_PREPARED.patch b/1.0.14-pulse-SND_PCM_STATE_PREPARED.patch deleted file mode 100644 index 56959d8..0000000 --- a/1.0.14-pulse-SND_PCM_STATE_PREPARED.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -up alsa-plugins-1.0.14/pulse/pcm_pulse.c.pulse alsa-plugins-1.0.14/pulse/pcm_pulse.c ---- alsa-plugins-1.0.14/pulse/pcm_pulse.c.pulse 2008-01-08 09:34:40.000000000 -1000 -+++ alsa-plugins-1.0.14/pulse/pcm_pulse.c 2008-01-08 09:38:25.000000000 -1000 -@@ -512,14 +512,16 @@ finish: - static int pulse_hw_params(snd_pcm_ioplug_t *io, snd_pcm_hw_params_t *params) - { - snd_pcm_pulse_t *pcm = io->private_data; -+ snd_pcm_t *base = io->pcm; - int err = 0; - - assert(pcm); - assert(pcm->p); - -- pa_threaded_mainloop_lock(pcm->p->mainloop); -+ if (!(base && snd_pcm_state(base) == SND_PCM_STATE_PREPARED)) -+ assert(!pcm->stream); - -- assert(!pcm->stream); -+ pa_threaded_mainloop_lock(pcm->p->mainloop); - - pcm->frame_size = (snd_pcm_format_physical_width(io->format) * io->channels) / 8; - diff --git a/1.0.14-state-xrun.patch b/1.0.14-state-xrun.patch deleted file mode 100644 index 97b2ad6..0000000 --- a/1.0.14-state-xrun.patch +++ /dev/null @@ -1,82 +0,0 @@ ---- alsa-plugins-1.0.14.lennart/pulse/pcm_pulse.c 2007-09-24 01:43:01.000000000 +0200 -+++ alsa-plugins-1.0.14/pulse/pcm_pulse.c 2007-10-01 21:36:53.000000000 +0200 -@@ -36,6 +36,7 @@ - /* Since ALSA expects a ring buffer we must do some voodoo. */ - size_t last_size; - size_t ptr; -+ int underrun; - - size_t offset; - -@@ -90,7 +91,9 @@ - if (err < 0) { - err = -EIO; - goto finish; -- } -+ } else -+ pcm->underrun = 0; -+ - - finish: - pa_threaded_mainloop_unlock(pcm->p->mainloop); -@@ -200,6 +203,9 @@ - - err = snd_pcm_bytes_to_frames(io->pcm, pcm->ptr); - -+ if (pcm->underrun) -+ err = -EPIPE; -+ - finish: - pa_threaded_mainloop_unlock(pcm->p->mainloop); - -@@ -231,6 +237,10 @@ - - *delayp = snd_pcm_bytes_to_frames(io->pcm, pa_usec_to_bytes(lat, &pcm->ss)); - -+ /* Yes, this is evil, and we're not supposed to do this. */ -+ if (pcm->underrun && pcm->io.state == SND_PCM_STATE_RUNNING) -+ pcm->io.state = SND_PCM_STATE_XRUN; -+ - finish: - pa_threaded_mainloop_unlock(pcm->p->mainloop); - -@@ -273,6 +283,7 @@ - pulse_poll_deactivate(pcm->p); - - err = size; -+ pcm->underrun = 0; - - finish: - pa_threaded_mainloop_unlock(pcm->p->mainloop); -@@ -354,6 +365,15 @@ - pulse_poll_activate(pcm->p); - } - -+static void stream_underrun_cb(pa_stream *p, void *userdata) { -+ snd_pcm_pulse_t *pcm = userdata; -+ -+ assert(pcm); -+ assert(pcm->p); -+ -+ pcm->underrun = 1; -+} -+ - static int pulse_pcm_poll_descriptors_count(snd_pcm_ioplug_t *io) - { - snd_pcm_pulse_t *pcm = io->private_data; -@@ -461,6 +481,7 @@ - - if (io->stream == SND_PCM_STREAM_PLAYBACK) { - pa_stream_set_write_callback(pcm->stream, stream_request_cb, pcm); -+ pa_stream_set_underflow_callback(pcm->stream, stream_underrun_cb, pcm); - pa_stream_connect_playback(pcm->stream, pcm->device, &pcm->buffer_attr, - PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_INTERPOLATE_TIMING, NULL, NULL); - } else { -@@ -480,6 +501,7 @@ - pcm->last_size = 0; - pcm->ptr = 0; - pcm->offset = 0; -+ pcm->underrun = 0; - - finish: - pa_threaded_mainloop_unlock(pcm->p->mainloop); diff --git a/alsa-plugins-1.0.16-pulseclose.patch b/alsa-plugins-1.0.16-pulseclose.patch new file mode 100644 index 0000000..e023081 --- /dev/null +++ b/alsa-plugins-1.0.16-pulseclose.patch @@ -0,0 +1,22 @@ +If stream connection failes, don't assume that stream is connected upon closing. + +diff -urp alsa-plugins-1.0.16.orig/pulse/pcm_pulse.c alsa-plugins-1.0.16/pulse/pcm_pulse.c +--- alsa-plugins-1.0.16.orig/pulse/pcm_pulse.c 2008-02-05 10:25:00.000000000 +0100 ++++ alsa-plugins-1.0.16/pulse/pcm_pulse.c 2008-03-08 14:33:43.000000000 +0100 +@@ -112,12 +112,14 @@ static int pulse_stop(snd_pcm_ioplug_t * + + pa_threaded_mainloop_lock(pcm->p->mainloop); + +- assert(pcm->stream); +- + err = pulse_check_connection(pcm->p); + if (err < 0) + goto finish; + ++ /* If stream connection fails, this gets called anyway */ ++ if (pcm->stream == NULL) ++ goto finish; ++ + o = pa_stream_flush(pcm->stream, pulse_stream_success_cb, pcm->p); + assert(o); + diff --git a/alsa-plugins.spec b/alsa-plugins.spec index 56408f5..02a915e 100644 --- a/alsa-plugins.spec +++ b/alsa-plugins.spec @@ -1,6 +1,6 @@ Name: alsa-plugins -Version: 1.0.15 -Release: 4%{?dist} +Version: 1.0.16 +Release: 1%{?dist} Summary: The Advanced Linux Sound Architecture (ALSA) Plugins # All packages are LGPLv2+ with the exception of samplerate which is GPLv2+ License: GPLv2+ and LGPLv2+ @@ -13,10 +13,8 @@ Source4: samplerate.conf Source5: upmix.conf Source6: vdownmix.conf Source7: pulse-default.conf -Patch0: 1.0.14-buffer-attr.patch -Patch1: 1.0.14-state-xrun.patch -Patch2: 1.0.14-pulse-SND_PCM_STATE_PREPARED.patch Patch3: alsa-plugins-1.0.15-pulsehint.patch +Patch4: alsa-plugins-1.0.16-pulseclose.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: alsa-lib-devel @@ -98,10 +96,8 @@ surround". %prep %setup -q -n %{name}-%{version} -%patch0 -p1 -b .buffer_attr -%patch1 -p1 -b .state_xrun -%patch2 -p1 -b .pulse-SND_PCM_STATE_PREPARED %patch3 -p1 -b .pulsehint +%patch4 -p1 -b .pulseclose %build %configure --disable-static \ @@ -175,6 +171,10 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/alsa-lib/libasound_module_pcm_vdownmix.so %changelog +* Sat Mar 08 2008 Lubomir Kundrak - 1.0.16-1 +- New upstream, dropping upstreamed patches +- Do not assert fail when pulseaudio is unavailable (#435148) + * Tue Mar 04 2008 Lubomir Kundrak - 1.0.15-4 - Be more heplful when there's PulseAudio trouble. - This may save us some bogus bug reports diff --git a/sources b/sources index 84280ff..58987a1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -908c2dd7ec33bc8e1fcd5e92c7e5e125 alsa-plugins-1.0.15.tar.bz2 +5906aff0d0dc84dee9624d395db4cfc6 alsa-plugins-1.0.16.tar.bz2