change PulseAudio buffering metrics to saner defaults

This commit is contained in:
Lennart Poettering 2007-09-23 23:47:00 +00:00
parent 0ee08911a9
commit 2eafd7786a
2 changed files with 29 additions and 1 deletions

23
1.0.14-buffer-attr.patch Normal file
View File

@ -0,0 +1,23 @@
--- 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;

View File

@ -1,6 +1,6 @@
Name: alsa-plugins
Version: 1.0.14
Release: 2%{?dist}
Release: 3%{?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,6 +13,7 @@ Source3: pulseaudio.conf
Source4: samplerate.conf
Source5: upmix.conf
Source6: vdownmix.conf
Patch0: 1.0.14-buffer-attr.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: alsa-lib-devel
@ -93,6 +94,7 @@ surround".
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1 -b .buffer_attr
%build
%configure --disable-static \
@ -160,6 +162,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/alsa-lib/libasound_module_pcm_vdownmix.so
%changelog
* Mon Sep 24 2007 Lennart Poettering <lpoetter@redhat.com> - 1.0.14-3
- Change PulseAudio buffering defaults to more sane values
* Tue Aug 14 2007 Eric Moret <eric.moret@epita.fr> - 1.0.14-2
- Adding pulse as ALSA "default" pcm and ctl when the alsa-plugins-pulseaudio
package is installed, fixing #251943.