Commit 06b53340 authored by Giuseppe's avatar Giuseppe

synced with lib32

parent d421b14c
#!/bin/bash
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
_script_name="check files"
_cur_repo=$(pwd | awk -F '/' '{print $NF}')
_build_arch="$_arch"
source _buildscripts/functions/config_handling
source _buildscripts/functions/helpers
source _buildscripts/functions/messages
# Determine the sync folder
if [[ ${_cur_repo} = *-testing ]] && [[ ${_cur_repo} != lib32-testing ]] ; then
_sync_folder="_testing/"
else
_sync_folder="_repo/remote/"
fi
title "${_script_name} - $_cur_repo"
check_configs
load_configs
check_rsync
check_accounts
question() {
echo -e -n "\033[1;32m::\033[1;0m\033[1;0m $1\033[1;0m"
}
sync_down()
{
msg "syncing down"
export RSYNC_PASSWORD=$(echo ${_rsync_pass})
if [ "${_sync_folder}" == "_testing/" ] ; then
rsync -avh --progress ${_rsync_user}@${_rsync_server}::dev/testing/$_build_arch/* ${_sync_folder}
else
rsync -avh --progress ${_rsync_user}@${_rsync_server}::${_rsync_dir}/* ${_sync_folder}
fi
}
remove_packages()
{
# remove the package(s) from sync folder
msg "removing the packages(s) from ${_sync_folder}"
pushd ${_sync_folder} &>/dev/null
rm -rf ${remove_list}
popd &>/dev/null
}
sync_down
# Get the file list in the server
export RSYNC_PASSWORD=$(echo ${_rsync_pass})
if [ "${_sync_folder}" == "_testing/" ] ; then
repo_files=`rsync -avh --list-only ${_rsync_user}@${_rsync_server}::dev/testing/$_arch/* | cut -d ":" -f 3 | cut -d " " -f 2`
else
repo_files=`rsync -avh --list-only ${_rsync_user}@${_rsync_server}::${_rsync_dir}/* | cut -d ":" -f 3 | cut -d " " -f 2`
fi
# Get the file list in sync folder
local_files=`ls -a ${_sync_folder}* | cut -d "/" -f 3`
# Get the list of files to remove
remove_list=""
for _file in ${local_files} ; do
file_exist="false"
for _compare_file in ${repo_files} ; do
if [ "${_file}" = "${_compare_file}" ] ; then
file_exist="true"
fi
done
if [ "${file_exist}" = "false" ] ; then
remove_list="${remove_list} ${_file}"
fi
done
if [ "${remove_list}" != "" ] ; then
msg "The following packages in _repo/remote don't exist in the sever:"
newline
echo "${remove_list}"
newline
question "Do you want to remove the package(s)? (y/n)"
while true ; do
read yn
case ${yn} in
[yY]* )
newline ;
remove_packages ;
break ;
;;
[nN]* )
newline ;
title "The files will be keeped..." ;
newline ;
break ;
;;
* )
echo "Enter (y)es or (n)o" ;
;;
esac
done
fi
title "All done"
newline
From: Takashi Iwai <tiwai@suse.de>
Date: Fri, 9 Jul 2010 12:05:03 +0000 (+0200)
Subject: pulse: Add handle_underrun option
X-Git-Url: http://git.alsa-project.org/?p=alsa-plugins.git;a=commitdiff_plain;h=c20d516e229620129ee20175d8fee8511cc3a4bd
pulse: Add handle_underrun option
Added a config option "handle_underrun" to specify whether pulse plugin
handles the underrun reported from PA. The default value is now set to
false, i.e. it will ignore underruns in PA (for good reasons below).
You can take back to the old behavior by setting handle_underrun true.
The original idea was brought by David Henningsson <diwic@ubuntu.com>,
while this patch is simplified and makes the behavior configurable.
The reasons for avoiding underruns (cited from David's original patch):
Reporting underruns to ALSA seems to do more bad than good, for these reasons:
* If pulseaudio gets an underrun, the normal way to end that underrun is to
feed it with more buffers. This is different from the ALSA way of dealing
with underruns, which requires hardware buffer pointers to be reset.
* In addition, underrun signals are delivered asynchronously from pulseaudio.
This means that there might be more buffers on the way to pulseaudio when
the underrun is reported, making the underrun obsolete. Unfortunately,
there is currently no known way to determine whether this is the case or
not.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
diff --git a/pulse/pcm_pulse.c b/pulse/pcm_pulse.c
index b322898..2df0a80 100644
--- a/pulse/pcm_pulse.c
+++ b/pulse/pcm_pulse.c
@@ -39,6 +39,7 @@ typedef struct snd_pcm_pulse {
size_t last_size;
size_t ptr;
int underrun;
+ int handle_underrun;
size_t offset;
@@ -696,8 +697,9 @@ static int pulse_prepare(snd_pcm_ioplug_t * io)
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);
+ if (pcm->handle_underrun)
+ pa_stream_set_underflow_callback(pcm->stream,
+ stream_underrun_cb, pcm);
r = pa_stream_connect_playback(pcm->stream, pcm->device,
&pcm->buffer_attr,
PA_STREAM_AUTO_TIMING_UPDATE |
@@ -980,6 +982,7 @@ SND_PCM_PLUGIN_DEFINE_FUNC(pulse)
snd_config_iterator_t i, next;
const char *server = NULL;
const char *device = NULL;
+ int handle_underrun = 0;
int err;
snd_pcm_pulse_t *pcm;
@@ -1005,6 +1008,14 @@ SND_PCM_PLUGIN_DEFINE_FUNC(pulse)
}
continue;
}
+ if (strcmp(id, "handle_underrun") == 0) {
+ if ((err = snd_config_get_bool(n)) < 0) {
+ SNDERR("Invalid value for %s", id);
+ return -EINVAL;
+ }
+ handle_underrun = err;
+ continue;
+ }
SNDERR("Unknown field %s", id);
return -EINVAL;
}
@@ -1028,6 +1039,8 @@ SND_PCM_PLUGIN_DEFINE_FUNC(pulse)
goto error;
}
+ pcm->handle_underrun = handle_underrun;
+
err = pulse_connect(pcm->p, server);
if (err < 0)
goto error;
From: David Henningsson <diwic@ubuntu.com>
Date: Sat, 9 Jan 2010 08:09:14 +0000 (+0100)
Subject: pulse: Fix invalid buffer pointer return value
X-Git-Url: http://git.alsa-project.org/?p=alsa-plugins.git;a=commitdiff_plain;h=1675414eca06dcfc20899adf104ace05acfe26a0
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@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
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);
#
# Lib32 Packages for Chakra, part of chakra-project.org
#
# maintainer (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
# maintainer (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
_pkgbasename=alsa-plugins
pkgname=lib32-$_pkgbasename
pkgver=1.0.23
pkgrel=7
pkgdesc="Extra alsa plugins (32-bit)"
arch=(x86_64)
url="http://www.alsa-project.org"
license=(GPL)
depends=(lib32-alsa-lib $_pkgbasename)
makedepends=(lib32-{libpulse,jack,speex,libsamplerate} gcc-multilib)
optdepends=('lib32-libpulse: PulseAudio plugin'
'lib32-jack: Jack plugin'
'lib32-libsamplerate: libsamplerate resampling plugin'
'lib32-speex: libspeexdsp resampling plugin')
options=('!libtool')
source=("ftp://ftp.alsa-project.org/pub/plugins/$_pkgbasename-$pkgver.tar.bz2"
Fix_invalid_buffer_pointer_return_value.patch
Add_handle_underrun_option.patch)
md5sums=('a671f8102366c5b388133e948e1c85cb'
'067a51a5157a42989f60078d5225b6c1'
'56fb0e9cbef9714504ecaa1bb62d7acf')
build() {
cd "$srcdir/$_pkgbasename-$pkgver"
export CC="gcc -m32"
export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
# Improve pulse underrun handling
patch -Np1 -i "$srcdir/Fix_invalid_buffer_pointer_return_value.patch"
patch -Np1 -i "$srcdir/Add_handle_underrun_option.patch"
./configure --prefix=/usr --libdir=/usr/lib32 --disable-avcodec
make
}
package() {
cd "$srcdir/$_pkgbasename-$pkgver"
make DESTDIR="$pkgdir" install
}
This diff is collapsed.
......@@ -5,7 +5,7 @@
_pkgbasename=nvidia-utils
pkgname=lib32-$_pkgbasename
pkgver=260.19.29
pkgver=260.19.36
pkgrel=1
pkgdesc="NVIDIA drivers utilities and libraries. (32-bit)"
arch=('x86_64')
......@@ -19,7 +19,7 @@ options=('!strip')
_arch='x86'
_pkg="NVIDIA-Linux-${_arch}-${pkgver}"
source=("http://us.download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
md5sums=('e982a05a85c68130acfe1d48086250e3')
md5sums=('2826484d87827351774449382e45c4a9')
build() {
cd $srcdir
......
#!/bin/bash
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
#
# (c) 2010 - Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
#
# global vars
#
_script_name="Remove Package(s)"
_cur_repo=`pwd | awk -F '/' '{print $NF}'`
_needed_functions="config_handling helpers messages"
_args=`echo $1`
_build_arch="$_arch"
# helper functions
for subroutine in ${_needed_functions} ; do
source _buildscripts/functions/${subroutine}
done
# Determine the sync folder
if [[ ${_cur_repo} = *-testing ]] && [[ ${_cur_repo} != lib32-testing ]] ; then
_sync_folder="_testing/"
else
_sync_folder="_repo/remote/"
fi
#
# main
#
sync_down()
{
msg "syncing down"
export RSYNC_PASSWORD=$(echo ${_rsync_pass})
if [ "${_sync_folder}" == "_testing/" ] ; then
rsync -avh --progress ${_rsync_user}@${_rsync_server}::dev/testing/$_build_arch/* ${_sync_folder}
else
rsync -avh --progress ${_rsync_user}@${_rsync_server}::${_rsync_dir}/* ${_sync_folder}
fi
}
remove_packages()
{
# remove the package(s) from sync folder
msg "removing the packages(s) from ${_sync_folder}"
pushd $_sync_folder &>/dev/null
rm -rf ${_pkgz_to_remove}
popd &>/dev/null
}
sync_up()
{
# create new pacman database
msg "creating pacman database"
rm -rf ${_sync_folder}*.db.tar.*
pushd ${_sync_folder}
if [ "${_sync_folder}" == "_testing/" ] ; then
repo-add testing.db.tar.gz *.pkg.*
else
repo-add ${_cur_repo}.db.tar.gz *.pkg.*
fi
popd
# sync local -> server, removing the packages
msg "sync local -> server"
if [ "${_sync_folder}" == "_testing/" ] ; then
rsync -avh --progress --delay-updates --delete-after ${_sync_folder} ${_rsync_user}@${_rsync_server}::dev/testing/$_arch/
else
rsync -avh --progress --delay-updates --delete-after ${_sync_folder} ${_rsync_user}@${_rsync_server}::${_rsync_dir}
fi
}
#
# startup
#
clear
title "${_script_name} - $_cur_repo-$_build_arch"
if [ "${_args}" = "" ] ; then
error " !! You need to specify a target to remove,"
error " single names like \"attica\" or wildcards (*) are allowed."
newline
exit 1
fi
check_configs
load_configs
check_rsync
check_accounts
# First get the actual packages from the repo
sync_down
# Generate the list of packages to remove
newline
_args=${_args}*
_pkgz_to_remove=`ls ${_sync_folder}/${_args} | cut -d/ -f3`
if [ "${_pkgz_to_remove}" = "" ] ; then
exit
fi
warning "The following packages will be removed:"
newline
echo "${_pkgz_to_remove}"
newline
question "Do you really want to remove the package(s)? (y/n)"
while true ; do
read yn
case $yn in
[yY]* )
newline ;
remove_packages ;
sync_up ;
newline ;
title "All done" ;
newline ;
break
;;
[nN]* )
exit
;;
q* )
exit
;;
* )
echo "Enter (y)es or (n)o"
;;
esac
done
......@@ -4,13 +4,13 @@
# maintainer (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
pkgname=wine
pkgver=1.3.11
pkgrel=2
pkgver=1.3.12
pkgrel=1
_pkgbasever=${pkgver/rc/-rc}
source=(http://ibiblio.org/pub/linux/system/emulators/$pkgname/$pkgname-$_pkgbasever.tar.bz2)
md5sums=('c7ddaa2b8a408839475784c7033ba809')
md5sums=('a36a5e9ec4b72dc4fa8e0a10a23e8dee')
pkgdesc="A compatibility layer for running Windows programs"
url="http://www.winehq.com"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment