[meego-commits] 6005: Changes to Trunk:Testing/alsa-plugins
Lisa Yue
ling.yue at intel.com
Tue Jul 27 08:58:00 UTC 2010
Hi,
I have made the following changes to alsa-plugins in project Trunk:Testing. Please review and accept ASAP.
Thank You,
Lisa Yue
[This message was auto-generated]
---
Request #6005:
submit: home:lisayue:branches:Trunk:Testing/alsa-plugins(r5)(cleanup) -> Trunk:Testing/alsa-plugins
Message:
* Mon Jul 26 2010 Ling Yue <ling.yue at intel.com> - 1.0.23
- Upgrade to 1.0.23
- Apply patch: pulse: Fix invalid buffer pointer return value
State: new 2010-07-26T20:51:16 lisayue
Comment: None
changes files:
--------------
--- alsa-plugins.changes
+++ alsa-plugins.changes
@@ -0,0 +1,4 @@
+* Mon Jul 26 2010 Ling Yue <ling.yue at intel.com> - 1.0.23
+- Upgrade to 1.0.23
+- Apply patch: pulse: Fix invalid buffer pointer return value
+
old:
----
alsa-plugins-1.0.22.tar.bz2
jack.conf
pcm-oss.conf
new:
----
0001-pulse-Fix-invalid-buffer-pointer-return-value.patch
alsa-plugins-1.0.23.tar.bz2
alsa-plugins.yaml
spec files:
-----------
--- alsa-plugins.spec
+++ alsa-plugins.spec
@@ -1,20 +1,24 @@
-#define prever rc3
-#define prever_dot .%{prever}
+#
+# Do not Edit! Generated by:
+# spectacle version 0.18
+#
+# >> macros
+# << macros
Name: alsa-plugins
-Version: 1.0.22
-Release: 1%{?prever_dot}
Summary: The Advanced Linux Sound Architecture (ALSA) Plugins
-License: GPLv2+ and LGPLv2+
+Version: 1.0.23
+Release: 1
Group: System/Libraries
+License: GPLv2+ and LGPLv2+
URL: http://www.alsa-project.org/
-Source0: ftp://ftp.alsa-project.org/pub/plugins/%{name}-%{version}%{?prever}.tar.bz2
-Source4: samplerate.conf
-Source5: upmix.conf
-Source6: vdownmix.conf
-Source7: pulse-default.conf
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
+Source0: ftp://ftp.alsa-project.org/pub/plugins/%{name}-%{version}.tar.bz2
+Source1: samplerate.conf
+Source2: upmix.conf
+Source3: vdownmix.conf
+Source4: pulse-default.conf
+Source100: alsa-plugins.yaml
+Patch0: 0001-pulse-Fix-invalid-buffer-pointer-return-value.patch
BuildRequires: alsa-lib-devel
%description
@@ -40,10 +44,12 @@
Summary: External rate converter plugin for ALSA
Group: System/Libraries
License: GPLv2+
+
%description samplerate
This plugin is an external rate converter using libsamplerate by Erik de
Castro Lopo.
+
%package upmix
BuildRequires: libsamplerate-devel
Summary: Upmixer channel expander plugin for ALSA
@@ -59,12 +65,14 @@
Summary: Downmixer to stereo plugin for ALSA
Group: System/Libraries
License: LGPLv2+
+
%description vdownmix
The vdownmix plugin is a downmixer from 4-6 channels to 2-channel
stereo headphone output. This plugin processes the input signals with
a simple spacialization, so the output sounds like a kind of "virtual
surround".
+
%package usbstream
Summary: USB stream plugin for ALSA
Group: System/Libraries
@@ -74,19 +82,36 @@
stream to USB specific stream.
%prep
-%setup -q -n %{name}-%{version}%{?prever}
+%setup -q -n %{name}-%{version}
+
+# 0001-pulse-Fix-invalid-buffer-pointer-return-value.patch
+%patch0 -p1
+# >> setup
+# << setup
%build
-%configure --disable-static --without-speex
-make %{?_smp_mflags}
+# >> build pre
+# << build pre
+%configure --disable-static \
+ --without-speex
+
+make %{?jobs:-j%jobs}
+
+# >> build post
+# << build post
%install
+rm -rf %{buildroot}
+# >> install pre
+# << install pre
%make_install
+# >> install post
+
install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/alsa/pcm
-install -m 644 %SOURCE7 \
+install -m 644 %SOURCE4 \
${RPM_BUILD_ROOT}%{_sysconfdir}/alsa
-install -m 644 %SOURCE4 %SOURCE5 %SOURCE6 \
+install -m 644 %SOURCE1 %SOURCE2 %SOURCE3 \
${RPM_BUILD_ROOT}%{_sysconfdir}/alsa/pcm
@@ -95,25 +120,35 @@
-name *_oss.so -o \
-name libasound_module_pcm_alsa_dsp.so \) -exec rm {} \;
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%post -p /sbin/ldconfig
-
-%postun -p /sbin/ldconfig
-
+# << install post
+%post
+# >> post
+/sbin/ldconfig
+# << post
+
+%postun
+# >> postun
+/sbin/ldconfig
+# << postun
+%files
+%defattr(-,root,root,-)
+# >> files
+# << files
%files pulseaudio
%defattr(-,root,root,-)
+# >> files pulseaudio
%doc COPYING COPYING.GPL doc/README-pulse
%config(noreplace) %{_sysconfdir}/alsa/pulse-default.conf
%{_libdir}/alsa-lib/libasound_module_pcm_pulse.so
%{_libdir}/alsa-lib/libasound_module_ctl_pulse.so
%{_libdir}/alsa-lib/libasound_module_conf_pulse.so
+# << files pulseaudio
%files samplerate
%defattr(-,root,root,-)
+# >> files samplerate
%doc COPYING COPYING.GPL doc/samplerate.txt
%config(noreplace) %{_sysconfdir}/alsa/pcm/samplerate.conf
%{_libdir}/alsa-lib/libasound_module_ctl_arcam_av.so
@@ -122,21 +157,29 @@
%{_libdir}/alsa-lib/libasound_module_rate_samplerate_linear.so
%{_libdir}/alsa-lib/libasound_module_rate_samplerate_medium.so
%{_libdir}/alsa-lib/libasound_module_rate_samplerate_order.so
+# << files samplerate
%files upmix
%defattr(-,root,root,-)
+# >> files upmix
%doc COPYING COPYING.GPL doc/upmix.txt
%config(noreplace) %{_sysconfdir}/alsa/pcm/upmix.conf
%{_libdir}/alsa-lib/libasound_module_pcm_upmix.so
+# << files upmix
%files vdownmix
%defattr(-,root,root,-)
+# >> files vdownmix
%doc COPYING COPYING.GPL doc/vdownmix.txt
%config(noreplace) %{_sysconfdir}/alsa/pcm/vdownmix.conf
%{_libdir}/alsa-lib/libasound_module_pcm_vdownmix.so
+# << files vdownmix
+
%files usbstream
%defattr(-,root,root,-)
+# >> files usbstream
%doc COPYING COPYING.GPL
%{_libdir}/alsa-lib/libasound_module_pcm_usb_stream.so
+# << files usbstream
other changes:
--------------
++++++ 0001-pulse-Fix-invalid-buffer-pointer-return-value.patch (new)
--- 0001-pulse-Fix-invalid-buffer-pointer-return-value.patch
+++ 0001-pulse-Fix-invalid-buffer-pointer-return-value.patch
+From 1675414eca06dcfc20899adf104ace05acfe26a0 Mon Sep 17 00:00:00 2001
+From: David Henningsson <diwic at ubuntu.com>
+Date: Sat, 9 Jan 2010 09:09:14 +0100
+Subject: [PATCH] pulse: Fix invalid buffer pointer return value
+
+This patch improves recovering from underruns, and prevents hangs inside
+snd_pcm_write* and snd_pcm_read* due to snd_pcm_avail* returning too
+low values. It especially helps low latency situations.
+
+Signed-off-by: David Henningsson <diwic at ubuntu.com>
+Signed-off-by: Takashi Iwai <tiwai at suse.de>
+---
+ pulse/pcm_pulse.c | 15 ++++++++++++++-
+ 1 files changed, 14 insertions(+), 1 deletions(-)
+
+diff --git a/pulse/pcm_pulse.c b/pulse/pcm_pulse.c
+index 02a837e..b322898 100644
+--- a/pulse/pcm_pulse.c
++++ b/pulse/pcm_pulse.c
+@@ -90,6 +90,10 @@ static int update_ptr(snd_pcm_pulse_t *pcm)
+ if (pcm->io.stream == SND_PCM_STREAM_CAPTURE)
+ size -= pcm->offset;
+
++ /* Prevent accidental overrun of the fake ringbuffer */
++ if (size >= pcm->buffer_attr.tlength)
++ size = pcm->buffer_attr.tlength-1;
++
+ if (size > pcm->last_size) {
+ pcm->ptr += size - pcm->last_size;
+ pcm->ptr %= pcm->buffer_attr.tlength;
+@@ -424,6 +428,7 @@ static snd_pcm_sframes_t pulse_write(snd_pcm_ioplug_t * io,
+ snd_pcm_pulse_t *pcm = io->private_data;
+ const char *buf;
+ snd_pcm_sframes_t ret = 0;
++ size_t writebytes;
+
+ assert(pcm);
+
+@@ -445,13 +450,15 @@ static snd_pcm_sframes_t pulse_write(snd_pcm_ioplug_t * io,
+ (char *) areas->addr + (areas->first +
+ areas->step * offset) / 8;
+
+- ret = pa_stream_write(pcm->stream, buf, size * pcm->frame_size, NULL, 0, 0);
++ writebytes = size * pcm->frame_size;
++ ret = pa_stream_write(pcm->stream, buf, writebytes, NULL, 0, 0);
+ if (ret < 0) {
+ ret = -EIO;
+ goto finish;
+ }
+
+ /* Make sure the buffer pointer is in sync */
++ pcm->last_size -= writebytes;
+ ret = update_ptr(pcm);
+ if (ret < 0)
+ goto finish;
+@@ -528,6 +535,7 @@ static snd_pcm_sframes_t pulse_read(snd_pcm_ioplug_t * io,
+
+ dst_buf = (char *) dst_buf + frag_length;
+ remain_size -= frag_length;
++ pcm->last_size -= frag_length;
+ }
+
+ /* Make sure the buffer pointer is in sync */
+@@ -730,6 +738,11 @@ static int pulse_prepare(snd_pcm_ioplug_t * io)
+ pcm->offset = 0;
+ pcm->underrun = 0;
+
++ /* Reset fake ringbuffer */
++ pcm->last_size = 0;
++ pcm->ptr = 0;
++ update_ptr(pcm);
++
+ finish:
+ pa_threaded_mainloop_unlock(pcm->p->mainloop);
+
+--
+1.7.0.2
+
++++++ alsa-plugins-1.0.22.tar.bz2 -> alsa-plugins-1.0.23.tar.bz2
--- configure
+++ configure
@@ -2302,7 +2302,7 @@
# Define the identity of the package.
PACKAGE=alsa-plugins
- VERSION=1.0.22
+ VERSION=1.0.23
cat >>confdefs.h <<_ACEOF
--- configure.in
+++ configure.in
@@ -1,6 +1,6 @@
AC_PREREQ(2.59)
AC_INIT(oss/pcm_oss.c)
-AM_INIT_AUTOMAKE(alsa-plugins, 1.0.22)
+AM_INIT_AUTOMAKE(alsa-plugins, 1.0.23)
AC_PREFIX_DEFAULT(/usr)
AC_CONFIG_HEADERS(config.h)
--- usb_stream/pcm_usb_stream.c
+++ usb_stream/pcm_usb_stream.c
@@ -1,7 +1,7 @@
/*
* PCM - USB_STREAM plugin
*
- * Copyright (c) 2008 by Karsten Wiese <fzu at wemgehoertderstaat.de>
+ * Copyright (c) 2008, 2010 by Karsten Wiese <fzu at wemgehoertderstaat.de>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
@@ -48,6 +48,8 @@
#define VDBG(f, ...)
#endif
+#define FRAME_SIZE 6
+
#define LCARD 32
struct user_usb_stream {
char card[LCARD];
@@ -70,6 +72,8 @@
unsigned periods_done;
unsigned channels;
+ snd_pcm_uframes_t period_size;
+ unsigned int rate;
} snd_pcm_us_t;
static struct user_usb_stream *uus;
@@ -177,7 +181,7 @@
VDBG("");
us_cfg.version = USB_STREAM_INTERFACE_VERSION;
- us_cfg.frame_size = 6;
+ us_cfg.frame_size = FRAME_SIZE;
us_cfg.sample_rate = io->rate;
us_cfg.period_frames = io->period_size;
@@ -256,8 +260,11 @@
static int snd_pcm_us_stop(snd_pcm_ioplug_t *io)
{
snd_pcm_us_t *us = io->private_data;
- VDBG("%u", us->uus->s->periods_done);
+ if (!us->uus->s)
+ return 0;
+
+ VDBG("%u", us->uus->s->periods_done);
if (io->stream == SND_PCM_STREAM_PLAYBACK)
memset(us->uus->write_area, 0, us->uus->s->write_size);
@@ -370,6 +377,10 @@
};
int err;
+ unsigned int rate_min = us->rate ? us->rate : 44100,
+ rate_max = us->rate ? us->rate : 96000,
+ period_bytes_min = us->period_size ? FRAME_SIZE * us->period_size : 128,
+ period_bytes_max = us->period_size ? FRAME_SIZE * us->period_size : 64*4096;
if ((err = snd_pcm_ioplug_set_param_list(&us->io, SND_PCM_IOPLUG_HW_ACCESS,
ARRAY_SIZE(access_list), access_list)) < 0 ||
@@ -378,9 +389,9 @@
(err = snd_pcm_ioplug_set_param_minmax(&us->io, SND_PCM_IOPLUG_HW_CHANNELS,
us->channels, us->channels)) < 0 ||
(err = snd_pcm_ioplug_set_param_minmax(&us->io, SND_PCM_IOPLUG_HW_RATE,
- 44100, 96000)) < 0 ||
+ rate_min, rate_max)) < 0 ||
(err = snd_pcm_ioplug_set_param_minmax(&us->io, SND_PCM_IOPLUG_HW_PERIOD_BYTES,
- 128, 64*4096)) < 0 ||
+ period_bytes_min, period_bytes_max)) < 0 ||
(err = snd_pcm_ioplug_set_param_minmax(&us->io, SND_PCM_IOPLUG_HW_PERIODS,
2, 2)) < 0)
return err;
@@ -390,7 +401,9 @@
static int snd_pcm_us_open(snd_pcm_t **pcmp, const char *name,
const char *card,
- snd_pcm_stream_t stream, int mode)
+ snd_pcm_stream_t stream, int mode,
+ snd_pcm_uframes_t period_size,
+ unsigned int rate)
{
snd_pcm_us_t *us;
int err;
@@ -421,6 +434,8 @@
snd_hwdep_poll_descriptors(us->hwdep, &us->pfd, 1);
us->channels = 2;
+ us->period_size = period_size;
+ us->rate = rate;
us->io.version = SND_PCM_IOPLUG_VERSION;
us->io.name = "ALSA <-> USB_STREAM PCM I/O Plugin";
@@ -455,6 +470,7 @@
snd_config_iterator_t i, next;
const char *card;
int err;
+ long period_size = 0, rate = 0;
snd_config_for_each(i, next, conf) {
snd_config_t *n = snd_config_iterator_entry(i);
@@ -472,11 +488,27 @@
snd_config_get_string(n, &card);
continue;
}
+ if (strcmp(id, "period_size") == 0) {
+ if (snd_config_get_type(n) != SND_CONFIG_TYPE_INTEGER) {
+ SNDERR("Invalid type for %s", id);
+ return -EINVAL;
+ }
+ snd_config_get_integer(n, &period_size);
+ continue;
+ }
+ if (strcmp(id, "rate") == 0) {
+ if (snd_config_get_type(n) != SND_CONFIG_TYPE_INTEGER) {
+ SNDERR("Invalid type for %s", id);
+ return -EINVAL;
+ }
+ snd_config_get_integer(n, &rate);
+ continue;
+ }
SNDERR("Unknown field %s", id);
return -EINVAL;
}
- err = snd_pcm_us_open(pcmp, name, card, stream, mode);
+ err = snd_pcm_us_open(pcmp, name, card, stream, mode, period_size, rate);
return err;
}
--- version
+++ version
@@ -1 +1 @@
-1.0.22
+1.0.23
++++++ alsa-plugins.yaml (new)
--- alsa-plugins.yaml
+++ alsa-plugins.yaml
+Name: alsa-plugins
+Summary: The Advanced Linux Sound Architecture (ALSA) Plugins
+Version: 1.0.23
+Release: 1
+Group: System/Libraries
+License: GPLv2+ and LGPLv2+
+URL: http://www.alsa-project.org/
+Sources:
+ - ftp://ftp.alsa-project.org/pub/plugins/%{name}-%{version}.tar.bz2
+ - samplerate.conf
+ - upmix.conf
+ - vdownmix.conf
+ - pulse-default.conf
+Patches:
+ - 0001-pulse-Fix-invalid-buffer-pointer-return-value.patch
+Description: |
+ The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI
+ functionality to the Linux operating system.
+ This package includes plugins for ALSA.
+
+PkgBR:
+ - alsa-lib-devel
+Configure: configure
+ConfigOptions:
+ - --without-speex
+Builder: make
+NoFiles: Yes
+AudtoDepend: No
+SubPackages:
+ - Name: pulseaudio
+ Summary: Alsa to PulseAudio backend
+ Group: System/Libraries
+ License: LGPLv2+
+ Description: |
+ This plugin allows any program that uses the ALSA API to access a PulseAudio
+ sound daemon. In other words, native ALSA applications can play and record
+ sound across a network. There are two plugins in the suite, one for PCM and
+ one for mixer control.
+ Requires:
+ - pulseaudio
+ PkgBR:
+ PkgConfigBR:
+ - libpulse
+
+ - Name: samplerate
+ Summary: External rate converter plugin for ALSA
+ Group: System/Libraries
+ License: GPLv2+
+ Description: |
+ This plugin is an external rate converter using libsamplerate by Erik de
+ Castro Lopo.
+ PkgBR:
+ - libsamplerate-devel
+
+ - Name: upmix
+ Summary: Upmixer channel expander plugin for ALSA
+ Group: System/Libraries
+ License: LGPLv2+
+ Description: |
+ The upmix plugin is an easy-to-use plugin for upmixing to 4 or
+ 6-channel stream. The number of channels to be expanded is determined
+ by the slave PCM or explicitly via channel option.
+ PkgBR:
+ - libsamplerate-devel
+
+ - Name: vdownmix
+ Summary: Downmixer to stereo plugin for ALSA
+ Group: System/Libraries
+ License: LGPLv2+
+ Description: |
+ The vdownmix plugin is a downmixer from 4-6 channels to 2-channel
+ stereo headphone output. This plugin processes the input signals with
+ a simple spacialization, so the output sounds like a kind of "virtual
+ surround".
+ PkgBR:
+ - libsamplerate-devel
+
+ - Name: usbstream
+ Summary: USB stream plugin for ALSA
+ Group: System/Libraries
+ License: LGPLv2+
+ Description: |
+ The usbstream plugin is for snd-usb-us122l driver. It converts PCM
+ stream to USB specific stream.
+
++++++ deleted files:
--- jack.conf
--- pcm-oss.conf
More information about the MeeGo-commits
mailing list