Accepting request 17660 from multimedia:libs

Copy from multimedia:libs/alsa based on submit request 17660 from user tiwai

OBS-URL: https://build.opensuse.org/request/show/17660
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/alsa?expand=0&rev=75
This commit is contained in:
OBS User autobuild 2009-08-13 15:31:01 +00:00 committed by Git OBS Bridge
parent 655b556c21
commit f91aaf52d2
5 changed files with 162 additions and 28 deletions

View File

@ -417,7 +417,12 @@ ARTSINST=$(which artsd 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
JACKINST=$(which jackd 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
DMIDECODE=$(which dmidecode 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
if [ -x $DMIDECODE ]; then
#Check for DMI data
if [ -d /sys/class/dmi/id ]; then
# No root privileges are required when using sysfs method
DMI_SYSTEM_MANUFACTURER=$(cat /sys/class/dmi/id/sys_vendor 2>/dev/null)
DMI_SYSTEM_PRODUCT_NAME=$(cat /sys/class/dmi/id/product_name 2>/dev/null)
elif [ -x $DMIDECODE ]; then
DMI_SYSTEM_MANUFACTURER=$($DMIDECODE -s system-manufacturer 2>/dev/null)
DMI_SYSTEM_PRODUCT_NAME=$($DMIDECODE -s system-product-name 2>/dev/null)
fi

View File

@ -111,7 +111,7 @@ index df92164..58256a6 100644
snd_mixer_elem_type_t type,
int compare_weight,
diff --git a/include/pcm.h b/include/pcm.h
index 15e9cb2..2c7dce9 100644
index 15e9cb2..f3618c3 100644
--- a/include/pcm.h
+++ b/include/pcm.h
@@ -526,8 +526,6 @@ int snd_pcm_hw_params_is_batch(const snd_pcm_hw_params_t *params);
@ -123,6 +123,16 @@ index 15e9cb2..2c7dce9 100644
int snd_pcm_hw_params_can_pause(const snd_pcm_hw_params_t *params);
int snd_pcm_hw_params_can_resume(const snd_pcm_hw_params_t *params);
int snd_pcm_hw_params_is_half_duplex(const snd_pcm_hw_params_t *params);
@@ -1022,7 +1020,8 @@ snd_pcm_uframes_t snd_pcm_meter_get_boundary(snd_pcm_t *pcm);
int snd_pcm_meter_add_scope(snd_pcm_t *pcm, snd_pcm_scope_t *scope);
snd_pcm_scope_t *snd_pcm_meter_search_scope(snd_pcm_t *pcm, const char *name);
int snd_pcm_scope_malloc(snd_pcm_scope_t **ptr);
-void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope, snd_pcm_scope_ops_t *val);
+void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope,
+ const snd_pcm_scope_ops_t *val);
void snd_pcm_scope_set_name(snd_pcm_scope_t *scope, const char *val);
const char *snd_pcm_scope_get_name(snd_pcm_scope_t *scope);
void *snd_pcm_scope_get_callback_private(snd_pcm_scope_t *scope);
diff --git a/include/pcm_ioplug.h b/include/pcm_ioplug.h
index b5968f1..6331cf0 100644
--- a/include/pcm_ioplug.h
@ -206,7 +216,7 @@ index d211e09..4d70df2 100644
}
#endif
diff --git a/src/conf.c b/src/conf.c
index c86f819..570c90f 100644
index c86f819..3f0dfe1 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -440,7 +440,7 @@ struct _snd_config {
@ -1975,15 +1985,20 @@ index c86f819..570c90f 100644
*/
int snd_config_hook_load_for_all_cards(snd_config_t *root, snd_config_t *config, snd_config_t **dst, snd_config_t *private_data ATTRIBUTE_UNUSED)
{
@@ -2899,6 +3480,7 @@ int snd_config_hook_load_for_all_cards(snd_config_t *root, snd_config_t *config,
if (snd_config_search(root, fdriver, &n) >= 0) {
if (snd_config_get_string(n, &driver) < 0)
goto __err;
@@ -2896,9 +3477,9 @@ int snd_config_hook_load_for_all_cards(snd_config_t *root, snd_config_t *config,
err = snd_determine_driver(card, &fdriver);
if (err < 0)
return err;
- if (snd_config_search(root, fdriver, &n) >= 0) {
- if (snd_config_get_string(n, &driver) < 0)
- goto __err;
+ if (snd_config_search(root, fdriver, &n) >= 0 &&
+ snd_config_get_string(n, &driver) >= 0) {
+ assert(driver);
while (1) {
char *s = strchr(driver, '.');
if (s == NULL)
@@ -2931,20 +3513,30 @@ SND_DLSYM_BUILD_VERSION(snd_config_hook_load_for_all_cards, SND_CONFIG_DLSYM_VER
@@ -2931,20 +3512,30 @@ SND_DLSYM_BUILD_VERSION(snd_config_hook_load_for_all_cards, SND_CONFIG_DLSYM_VER
/**
* \brief Updates a configuration tree by rereading the configuration files (if needed).
@ -2023,7 +2038,7 @@ index c86f819..570c90f 100644
*/
int snd_config_update_r(snd_config_t **_top, snd_config_update_t **_update, const char *cfgs)
{
@@ -3090,16 +3682,19 @@ static pthread_mutex_t snd_config_update_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -3090,16 +3681,19 @@ static pthread_mutex_t snd_config_update_mutex = PTHREAD_MUTEX_INITIALIZER;
/**
* \brief Updates #snd_config by rereading the global configuration files (if needed).
@ -2051,7 +2066,7 @@ index c86f819..570c90f 100644
*/
int snd_config_update(void)
{
@@ -3117,7 +3712,7 @@ int snd_config_update(void)
@@ -3117,7 +3711,7 @@ int snd_config_update(void)
/**
* \brief Frees a private update structure.
@ -2060,7 +2075,7 @@ index c86f819..570c90f 100644
* \return Zero if successful, otherwise a negative error code.
*/
int snd_config_update_free(snd_config_update_t *update)
@@ -3135,6 +3730,12 @@ int snd_config_update_free(snd_config_update_t *update)
@@ -3135,6 +3729,12 @@ int snd_config_update_free(snd_config_update_t *update)
/**
* \brief Frees the global configuration tree in #snd_config.
* \return Zero if successful, otherwise a negative error code.
@ -2073,7 +2088,7 @@ index c86f819..570c90f 100644
*/
int snd_config_update_free_global(void)
{
@@ -3157,23 +3758,40 @@ int snd_config_update_free_global(void)
@@ -3157,23 +3757,40 @@ int snd_config_update_free_global(void)
}
/**
@ -2125,7 +2140,7 @@ index c86f819..570c90f 100644
*/
snd_config_iterator_t snd_config_iterator_next(const snd_config_iterator_t iterator)
{
@@ -3181,20 +3799,31 @@ snd_config_iterator_t snd_config_iterator_next(const snd_config_iterator_t itera
@@ -3181,20 +3798,31 @@ snd_config_iterator_t snd_config_iterator_next(const snd_config_iterator_t itera
}
/**
@ -2165,7 +2180,7 @@ index c86f819..570c90f 100644
*/
snd_config_t *snd_config_iterator_entry(const snd_config_iterator_t iterator)
{
@@ -3209,7 +3838,7 @@ typedef enum _snd_config_walk_pass {
@@ -3209,7 +3837,7 @@ typedef enum _snd_config_walk_pass {
} snd_config_walk_pass_t;
#endif
@ -2174,7 +2189,7 @@ index c86f819..570c90f 100644
/* Return 2 if compound is replaced with standard node */
#ifndef DOC_HIDDEN
typedef int (*snd_config_walk_callback_t)(snd_config_t *src,
@@ -3327,10 +3956,21 @@ static int _snd_config_copy(snd_config_t *src,
@@ -3327,10 +3955,21 @@ static int _snd_config_copy(snd_config_t *src,
/**
* \brief Creates a copy of a configuration node.
@ -2199,7 +2214,7 @@ index c86f819..570c90f 100644
*/
int snd_config_copy(snd_config_t **dst,
snd_config_t *src)
@@ -3350,7 +3990,7 @@ static int _snd_config_expand(snd_config_t *src,
@@ -3350,7 +3989,7 @@ static int _snd_config_expand(snd_config_t *src,
switch (pass) {
case SND_CONFIG_WALK_PASS_PRE:
{
@ -2208,7 +2223,7 @@ index c86f819..570c90f 100644
return 0;
err = snd_config_make_compound(dst, id, src->u.compound.join);
if (err < 0)
@@ -3395,7 +4035,7 @@ static int _snd_config_expand(snd_config_t *src,
@@ -3395,7 +4034,7 @@ static int _snd_config_expand(snd_config_t *src,
snd_config_t *val;
snd_config_t *vars = private_data;
snd_config_get_string(src, &s);
@ -2217,7 +2232,7 @@ index c86f819..570c90f 100644
s++;
if (snd_config_search(vars, s, &val) < 0)
return 0;
@@ -3447,6 +4087,7 @@ static int _snd_config_evaluate(snd_config_t *src,
@@ -3447,6 +4086,7 @@ static int _snd_config_evaluate(snd_config_t *src,
SNDERR("Invalid type for @func");
return err;
}
@ -2225,7 +2240,7 @@ index c86f819..570c90f 100644
err = snd_config_search_definition(root, "func", str, &func_conf);
if (err >= 0) {
snd_config_iterator_t i, next;
@@ -3531,14 +4172,14 @@ static int _snd_config_evaluate(snd_config_t *src,
@@ -3531,14 +4171,14 @@ static int _snd_config_evaluate(snd_config_t *src,
/**
* \brief Evaluates a configuration node at runtime.
@ -2247,7 +2262,7 @@ index c86f819..570c90f 100644
*/
int snd_config_evaluate(snd_config_t *config, snd_config_t *root,
snd_config_t *private_data, snd_config_t **result)
@@ -3859,7 +4500,7 @@ static int parse_args(snd_config_t *subs, const char *str, snd_config_t *defs)
@@ -3859,7 +4499,7 @@ static int parse_args(snd_config_t *subs, const char *str, snd_config_t *defs)
goto _err;
}
err = snd_config_get_string(typ, &tmp);
@ -2256,7 +2271,7 @@ index c86f819..570c90f 100644
goto _invalid_type;
if (strcmp(tmp, "integer") == 0) {
long v;
@@ -3932,14 +4573,21 @@ static int parse_args(snd_config_t *subs, const char *str, snd_config_t *defs)
@@ -3932,14 +4572,21 @@ static int parse_args(snd_config_t *subs, const char *str, snd_config_t *defs)
}
/**
@ -2285,7 +2300,7 @@ index c86f819..570c90f 100644
*/
int snd_config_expand(snd_config_t *config, snd_config_t *root, const char *args,
snd_config_t *private_data, snd_config_t **result)
@@ -3995,20 +4643,33 @@ int snd_config_expand(snd_config_t *config, snd_config_t *root, const char *args
@@ -3995,20 +4642,33 @@ int snd_config_expand(snd_config_t *config, snd_config_t *root, const char *args
}
/**
@ -2597,7 +2612,7 @@ index 4d2c739..0bb8f86 100644
#ifdef SUPPORT_ALOAD
if (! snd_card_load(card))
diff --git a/src/control/control.c b/src/control/control.c
index c090797..c9b04a1 100644
index c090797..ae70e76 100644
--- a/src/control/control.c
+++ b/src/control/control.c
@@ -211,7 +211,7 @@ int snd_ctl_poll_descriptors_revents(snd_ctl_t *ctl, struct pollfd *pfds, unsign
@ -2609,6 +2624,60 @@ index c090797..c9b04a1 100644
* \param ctl CTL handle
* \param subscribe 0 = unsubscribe, 1 = subscribe
* \return 0 on success otherwise a negative error code
@@ -674,8 +674,8 @@ int snd_ctl_read(snd_ctl_t *ctl, snd_ctl_event_t *event)
int snd_ctl_wait(snd_ctl_t *ctl, int timeout)
{
struct pollfd *pfd;
- unsigned short *revents;
- int i, npfds, pollio, err, err_poll;
+ unsigned short revents;
+ int i, npfds, err, err_poll;
npfds = snd_ctl_poll_descriptors_count(ctl);
if (npfds <= 0 || npfds >= 16) {
@@ -683,7 +683,6 @@ int snd_ctl_wait(snd_ctl_t *ctl, int timeout)
return -EIO;
}
pfd = alloca(sizeof(*pfd) * npfds);
- revents = alloca(sizeof(*revents) * npfds);
err = snd_ctl_poll_descriptors(ctl, pfd, npfds);
if (err < 0)
return err;
@@ -691,26 +690,20 @@ int snd_ctl_wait(snd_ctl_t *ctl, int timeout)
SNDMSG("invalid poll descriptors %d\n", err);
return -EIO;
}
- do {
+ for (;;) {
err_poll = poll(pfd, npfds, timeout);
if (err_poll < 0)
return -errno;
if (! err_poll)
- break;
- err = snd_ctl_poll_descriptors_revents(ctl, pfd, npfds, revents);
+ return 0;
+ err = snd_ctl_poll_descriptors_revents(ctl, pfd, npfds, &revents);
if (err < 0)
return err;
- pollio = 0;
- for (i = 0; i < npfds; i++) {
- if (revents[i] & (POLLERR | POLLNVAL))
- return -EIO;
- if ((revents[i] & (POLLIN | POLLOUT)) == 0)
- continue;
- pollio++;
- }
- } while (! pollio);
-
- return err_poll > 0 ? 1 : 0;
+ if (revents & (POLLERR | POLLNVAL))
+ return -EIO;
+ if (revents & (POLLIN | POLLOUT))
+ return 1;
+ }
}
/**
diff --git a/src/control/control_ext.c b/src/control/control_ext.c
index d1fe8ea..e20d4f3 100644
--- a/src/control/control_ext.c
@ -2899,6 +2968,28 @@ index e43d354..c582f5a 100644
functions after calling #snd_pcm_ioplug_create().
The former defines the minimal and maximal acceptable values for the
given hw_params parameter (SND_PCM_IOPLUG_HW_XXX).
diff --git a/src/pcm/pcm_meter.c b/src/pcm/pcm_meter.c
index 0357921..5acc7bc 100644
--- a/src/pcm/pcm_meter.c
+++ b/src/pcm/pcm_meter.c
@@ -46,7 +46,7 @@ const char *_snd_module_pcm_meter = "";
struct _snd_pcm_scope {
int enabled;
char *name;
- snd_pcm_scope_ops_t *ops;
+ const snd_pcm_scope_ops_t *ops;
void *private_data;
struct list_head list;
};
@@ -960,7 +960,7 @@ const char *snd_pcm_scope_get_name(snd_pcm_scope_t *scope)
* \param scope PCM meter scope
* \param val callbacks
*/
-void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope, snd_pcm_scope_ops_t *val)
+void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope, const snd_pcm_scope_ops_t *val)
{
scope->ops = val;
}
diff --git a/src/pcm/pcm_mmap_emul.c b/src/pcm/pcm_mmap_emul.c
index 0dc1973..e356e0b 100644
--- a/src/pcm/pcm_mmap_emul.c
@ -2920,7 +3011,7 @@ index 0dc1973..e356e0b 100644
/*
* here goes a really tricky part; hw_refine falls back to ACCESS_RW_* type
diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
index a97a5de..c705875 100644
index a97a5de..ecf0022 100644
--- a/src/pcm/pcm_rate.c
+++ b/src/pcm/pcm_rate.c
@@ -69,12 +69,17 @@ struct _snd_pcm_rate {
@ -2968,6 +3059,15 @@ index a97a5de..c705875 100644
params->info &= ~(SND_PCM_INFO_MMAP | SND_PCM_INFO_MMAP_VALID);
return 0;
}
@@ -186,7 +195,7 @@ static int snd_pcm_rate_hw_refine_cchange(snd_pcm_t *pcm, snd_pcm_hw_params_t *p
if (!snd_interval_checkempty(period_size) &&
period_size->openmin && period_size->openmax &&
period_size->min + 1 == period_size->max) {
- if ((buffer_size->min / period_size->min) * period_size->min == buffer_size->min) {
+ if (period_size->min > 0 && (buffer_size->min / period_size->min) * period_size->min == buffer_size->min) {
snd_interval_set_value(period_size, period_size->min);
} else if ((buffer_size->max / period_size->max) * period_size->max == buffer_size->max) {
snd_interval_set_value(period_size, period_size->max);
@@ -1178,6 +1187,9 @@ static void snd_pcm_rate_dump(snd_pcm_t *pcm, snd_output_t *out)
snd_output_printf(out, "Rate conversion PCM (%d, sformat=%s)\n",
rate->srate,
@ -3495,6 +3595,19 @@ index b5caa1b..ddaac5a 100644
if (cmd != dev->lastcmd && !dev->nostat) {
if (count < 9)
return -ENOMEM;
diff --git a/src/timer/timer_local.h b/src/timer/timer_local.h
index 19cadfe..8040b05 100644
--- a/src/timer/timer_local.h
+++ b/src/timer/timer_local.h
@@ -64,7 +64,7 @@ struct _snd_timer_query {
snd_timer_type_t type;
int mode;
int poll_fd;
- snd_timer_query_ops_t *ops;
+ const snd_timer_query_ops_t *ops;
void *private_data;
};
#endif /* DOC_HIDDEN */
diff --git a/test/Makefile.am b/test/Makefile.am
index 2d7e92b..ae524a4 100644
--- a/test/Makefile.am

View File

@ -1,3 +1,19 @@
-------------------------------------------------------------------
Thu Aug 13 08:46:04 CEST 2009 - tiwai@suse.de
- fix fuser usage in alsasound init script
- updated alsa-info.sh: check /sys/class/dmi first
-------------------------------------------------------------------
Mon Aug 10 14:40:32 CEST 2009 - tiwai@suse.de
- Misc fixes backported from upstream:
* Fix zero-division in pcm_rate.c
* snd_pcm_scope_set_ops: make ops parameter const
* timer_query: make ops structure constant
* control.c: snd_ctl_wait: fix revents handling
* Fix driver conf parsing in snd_config_hook_load_for_all_cards()
-------------------------------------------------------------------
Wed Aug 5 14:24:43 CEST 2009 - tiwai@suse.de

View File

@ -34,7 +34,7 @@ Obsoletes: alsa-64bit
#
Summary: Advanced Linux Sound Architecture
Version: 1.0.20
Release: 8
Release: 9
Source: ftp://ftp.alsa-project.org/pub/lib/alsa-lib-%{package_version}.tar.bz2
Source8: 40-alsa.rules
Source11: alsasound

View File

@ -132,11 +132,11 @@ start_all() {
}
do_kill() {
fuser $1 /dev/admmidi* /dev/adsp* /dev/amidi* /dev/audio* /dev/dmfm* \
fuser $* /dev/admmidi* /dev/adsp* /dev/amidi* /dev/audio* /dev/dmfm* \
/dev/dmmidi* /dev/dsp* /dev/dspW* /dev/midi* /dev/mixer* /dev/music \
/dev/patmgr* /dev/sequencer* /dev/sndstat >/dev/null 2>&1
if [ -d /dev/snd ]; then
fuser $1 /dev/snd/* >/dev/null 2>&1
fuser $* /dev/snd/* >/dev/null 2>&1
fi
}
@ -144,7 +144,7 @@ terminate() {
#
# Kill processes holding open sound devices
#
do_kill -TERM
do_kill -TERM -k
sleep 1
do_kill -k