Hello community,
here is the log from the commit of package alsa-plugins for openSUSE:Factory checked in at 2012-12-03 09:27:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/alsa-plugins (Old)
and /work/SRC/openSUSE:Factory/.alsa-plugins.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "alsa-plugins", Maintainer is "tiwai(a)suse.com"
Changes:
--------
--- /work/SRC/openSUSE:Factory/alsa-plugins/alsa-plugins.changes 2012-10-26 16:57:56.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.alsa-plugins.new/alsa-plugins.changes 2012-12-03 09:27:50.000000000 +0100
@@ -1,0 +2,6 @@
+Fri Nov 30 14:48:08 CET 2012 - tiwai(a)suse.de
+
+- Improve prebuf setup of pulse plugin:
+ 0001-pcm_pulse-set-prebuf-parameter-according-to-software.patch
+
+-------------------------------------------------------------------
New:
----
0001-pcm_pulse-set-prebuf-parameter-according-to-software.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ alsa-plugins.spec ++++++
--- /var/tmp/diff_new_pack.zso2Y9/_old 2012-12-03 09:27:54.000000000 +0100
+++ /var/tmp/diff_new_pack.zso2Y9/_new 2012-12-03 09:27:54.000000000 +0100
@@ -51,6 +51,7 @@
Source1: asound-pulse.conf
Source2: alsa-pulse.conf
Source3: baselibs.conf
+Patch1: 0001-pcm_pulse-set-prebuf-parameter-according-to-software.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@@ -128,6 +129,7 @@
%prep
%setup -q -n %{name}-%{package_version}
+%patch1 -p1
%build
export AUTOMAKE_JOBS="%{?_smp_mflags}"
++++++ 0001-pcm_pulse-set-prebuf-parameter-according-to-software.patch ++++++
>From a4226cfe029f10585eb36fb527fde9a07a534f93 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi(a)remlab.net>
Date: Sun, 18 Nov 2012 12:01:49 +0200
Subject: [PATCH] pcm_pulse: set prebuf parameter according to software
parameters
The current default value for prebuf is very high, almost the full
virtual ALSA buffer. This breaks some application especially where
low latency is involved.
This patch makes pcm_pulse implement the sw_params callback and get
the prebuf value from the ALSA software parameters. Thus the
trigger latency is much more like what an ALSA application should
expect from an ALSA PCM device.
Acked-by: David Henningsson <david.henningsson(a)canonical.com>
Signed-off-by: Takashi Iwai <tiwai(a)suse.de>
---
pulse/pcm_pulse.c | 32 ++++++++++++++++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)
diff --git a/pulse/pcm_pulse.c b/pulse/pcm_pulse.c
index 24fd4da..4226d30 100644
--- a/pulse/pcm_pulse.c
+++ b/pulse/pcm_pulse.c
@@ -854,8 +854,9 @@ static int pulse_hw_params(snd_pcm_ioplug_t * io,
4 * 1024 * 1024;
pcm->buffer_attr.tlength =
io->buffer_size * pcm->frame_size;
- pcm->buffer_attr.prebuf =
- (io->buffer_size - io->period_size) * pcm->frame_size;
+ if (pcm->buffer_attr.prebuf == (uint32_t)-1)
+ 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;
@@ -865,6 +866,31 @@ static int pulse_hw_params(snd_pcm_ioplug_t * io,
return err;
}
+static int pulse_sw_params(snd_pcm_ioplug_t *io, snd_pcm_sw_params_t *params)
+{
+ snd_pcm_pulse_t *pcm = io->private_data;
+ snd_pcm_uframes_t start_threshold;
+
+ assert(pcm);
+
+ if (!pcm->p || !pcm->p->mainloop)
+ return -EBADFD;
+
+ pa_threaded_mainloop_lock(pcm->p->mainloop);
+
+ snd_pcm_sw_params_get_start_threshold(params, &start_threshold);
+
+ /* At least one period to keep PulseAudio happy */
+ if (start_threshold < io->period_size)
+ start_threshold = io->period_size;
+
+ pcm->buffer_attr.prebuf = start_threshold * pcm->frame_size;
+
+ pa_threaded_mainloop_unlock(pcm->p->mainloop);
+
+ return 0;
+}
+
static int pulse_close(snd_pcm_ioplug_t * io)
{
snd_pcm_pulse_t *pcm = io->private_data;
@@ -931,6 +957,7 @@ static const snd_pcm_ioplug_callback_t pulse_playback_callback = {
.poll_revents = pulse_pcm_poll_revents,
.prepare = pulse_prepare,
.hw_params = pulse_hw_params,
+ .sw_params = pulse_sw_params,
.close = pulse_close,
.pause = pulse_pause
};
@@ -1088,6 +1115,7 @@ SND_PCM_PLUGIN_DEFINE_FUNC(pulse)
}
pcm->handle_underrun = handle_underrun;
+ pcm->buffer_attr.prebuf = -1;
err = pulse_connect(pcm->p, server, fallback_name != NULL);
if (err < 0)
--
1.8.0.1
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org