Accepting request 35100 from multimedia:libs

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

OBS-URL: https://build.opensuse.org/request/show/35100
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/alsa?expand=0&rev=85
This commit is contained in:
OBS User autobuild 2010-03-18 22:15:20 +00:00 committed by Git OBS Bridge
commit 5968473ddd
8 changed files with 855 additions and 2 deletions

View File

@ -0,0 +1,80 @@
From 7fd0d9f42357e49bc28259421de6338122381cb2 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Tue, 2 Mar 2010 14:01:32 +0100
Subject: [PATCH] pcm_dmix: add support for S24_LE format
From: Bart De Vos <bart_dv@eia.be>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_direct.c | 1 +
src/pcm/pcm_dmix.c | 8 ++++++++
src/pcm/pcm_dmix_generic.c | 2 +-
src/pcm/pcm_dmix_i386.c | 1 +
4 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c
index d9e596e..b648f3a 100644
--- a/src/pcm/pcm_direct.c
+++ b/src/pcm/pcm_direct.c
@@ -888,6 +888,7 @@ int snd_pcm_direct_initialize_slave(snd_pcm_direct_t *dmix, snd_pcm_t *spcm, str
SND_PCM_FORMAT_S32 ^ SND_PCM_FORMAT_S32_LE ^ SND_PCM_FORMAT_S32_BE,
SND_PCM_FORMAT_S16,
SND_PCM_FORMAT_S16 ^ SND_PCM_FORMAT_S16_LE ^ SND_PCM_FORMAT_S16_BE,
+ SND_PCM_FORMAT_S24_LE,
SND_PCM_FORMAT_S24_3LE,
SND_PCM_FORMAT_U8,
};
diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c
index 90470e0..3b791c1 100644
--- a/src/pcm/pcm_dmix.c
+++ b/src/pcm/pcm_dmix.c
@@ -174,6 +174,10 @@ static void mix_areas(snd_pcm_direct_t *dmix,
sample_size = 4;
do_mix_areas = (mix_areas_t *)dmix->u.dmix.mix_areas_32;
break;
+ case SND_PCM_FORMAT_S24_LE:
+ sample_size = 4;
+ do_mix_areas = (mix_areas_t *)dmix->u.dmix.mix_areas_24;
+ break;
case SND_PCM_FORMAT_S24_3LE:
sample_size = 3;
do_mix_areas = (mix_areas_t *)dmix->u.dmix.mix_areas_24;
@@ -238,6 +242,10 @@ static void remix_areas(snd_pcm_direct_t *dmix,
sample_size = 4;
do_remix_areas = (mix_areas_t *)dmix->u.dmix.remix_areas_32;
break;
+ case SND_PCM_FORMAT_S24_LE:
+ sample_size = 4;
+ do_remix_areas = (mix_areas_t *)dmix->u.dmix.remix_areas_24;
+ break;
case SND_PCM_FORMAT_S24_3LE:
sample_size = 3;
do_remix_areas = (mix_areas_t *)dmix->u.dmix.remix_areas_24;
diff --git a/src/pcm/pcm_dmix_generic.c b/src/pcm/pcm_dmix_generic.c
index a1086c9..9e9d3c3 100644
--- a/src/pcm/pcm_dmix_generic.c
+++ b/src/pcm/pcm_dmix_generic.c
@@ -122,7 +122,7 @@ static void mix_select_callbacks(snd_pcm_direct_t *dmix)
#define generic_dmix_supported_format \
((1ULL << SND_PCM_FORMAT_S16_LE) | (1ULL << SND_PCM_FORMAT_S32_LE) |\
(1ULL << SND_PCM_FORMAT_S16_BE) | (1ULL << SND_PCM_FORMAT_S32_BE) |\
- (1ULL << SND_PCM_FORMAT_S24_3LE) | \
+ (1ULL << SND_PCM_FORMAT_S24_LE) | (1ULL << SND_PCM_FORMAT_S24_3LE) | \
(1ULL << SND_PCM_FORMAT_U8))
#include <byteswap.h>
diff --git a/src/pcm/pcm_dmix_i386.c b/src/pcm/pcm_dmix_i386.c
index 68c4755..dcc6b9a 100644
--- a/src/pcm/pcm_dmix_i386.c
+++ b/src/pcm/pcm_dmix_i386.c
@@ -77,6 +77,7 @@
#define i386_dmix_supported_format \
((1ULL << SND_PCM_FORMAT_S16_LE) |\
(1ULL << SND_PCM_FORMAT_S32_LE) |\
+ (1ULL << SND_PCM_FORMAT_S24_LE) |\
(1ULL << SND_PCM_FORMAT_S24_3LE))
#define dmix_supported_format \
--
1.7.0.1

View File

@ -0,0 +1,31 @@
From f1713475087027925358c3f9dd3db70723ed8d11 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@t61.perex-int.cz>
Date: Tue, 23 Feb 2010 10:58:00 +0100
Subject: [PATCH] Fix snd_pcm_sw_params_set_period_event() implementation
Fix the PCM timer open subdevice number in the pcm_hw plugin.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_hw.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
index b557912..265335c 100644
--- a/src/pcm/pcm_hw.c
+++ b/src/pcm/pcm_hw.c
@@ -355,9 +355,9 @@ static int snd_pcm_hw_change_timer(snd_pcm_t *pcm, int enable)
if (enable) {
snd_timer_params_alloca(&params);
- err = snd_timer_hw_open(&hw->period_timer, "hw-pcm-period-event", SND_TIMER_CLASS_PCM, SND_TIMER_SCLASS_NONE, hw->card, hw->device, hw->subdevice, SND_TIMER_OPEN_NONBLOCK | SND_TIMER_OPEN_TREAD);
+ err = snd_timer_hw_open(&hw->period_timer, "hw-pcm-period-event", SND_TIMER_CLASS_PCM, SND_TIMER_SCLASS_NONE, hw->card, hw->device, (hw->subdevice << 1) | (pcm->stream & 1), SND_TIMER_OPEN_NONBLOCK | SND_TIMER_OPEN_TREAD);
if (err < 0) {
- err = snd_timer_hw_open(&hw->period_timer, "hw-pcm-period-event", SND_TIMER_CLASS_PCM, SND_TIMER_SCLASS_NONE, hw->card, hw->device, hw->subdevice, SND_TIMER_OPEN_NONBLOCK);
+ err = snd_timer_hw_open(&hw->period_timer, "hw-pcm-period-event", SND_TIMER_CLASS_PCM, SND_TIMER_SCLASS_NONE, hw->card, hw->device, (hw->subdevice << 1) | (pcm->stream & 1), SND_TIMER_OPEN_NONBLOCK);
return err;
}
if (snd_timer_poll_descriptors_count(hw->period_timer) != 1) {
--
1.7.0.1

View File

@ -0,0 +1,84 @@
From 63acb8732933aa9732e3bf2e3affef925dd9c45b Mon Sep 17 00:00:00 2001
From: David Fries <david@fries.net>
Date: Fri, 25 Dec 2009 14:22:38 -0600
Subject: [PATCH] modem.conf Off-hook improve behavior
Only restore the old value if it differs from the requested
value, because if it has changed restoring the old value
overrides the change. Take for example, a voice modem with
a .conf that sets preserve off-hook. Start playback (on-hook
to off-hook), start record (off-hook to off-hook), stop
playback (off-hook to restore on-hook), stop record (on-hook
to restore off-hook), Clearly you don't want to leave the
modem "on the phone" now that there isn't any playback or
recording active.
Signed-off-by: David Fries <david@fries.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/control.h | 1 +
src/control/control.c | 12 ++++++++++++
src/control/setup.c | 12 +++++++++++-
3 files changed, 24 insertions(+), 1 deletions(-)
diff --git a/include/control.h b/include/control.h
index 29ea397..3d6b0a5 100644
--- a/include/control.h
+++ b/include/control.h
@@ -423,6 +423,7 @@ int snd_ctl_elem_value_malloc(snd_ctl_elem_value_t **ptr);
void snd_ctl_elem_value_free(snd_ctl_elem_value_t *obj);
void snd_ctl_elem_value_clear(snd_ctl_elem_value_t *obj);
void snd_ctl_elem_value_copy(snd_ctl_elem_value_t *dst, const snd_ctl_elem_value_t *src);
+int snd_ctl_elem_value_compare(snd_ctl_elem_value_t *left, const snd_ctl_elem_value_t *right);
void snd_ctl_elem_value_get_id(const snd_ctl_elem_value_t *obj, snd_ctl_elem_id_t *ptr);
unsigned int snd_ctl_elem_value_get_numid(const snd_ctl_elem_value_t *obj);
snd_ctl_elem_iface_t snd_ctl_elem_value_get_interface(const snd_ctl_elem_value_t *obj);
diff --git a/src/control/control.c b/src/control/control.c
index 51628ba..b63a28c 100644
--- a/src/control/control.c
+++ b/src/control/control.c
@@ -2249,6 +2249,18 @@ void snd_ctl_elem_value_copy(snd_ctl_elem_value_t *dst, const snd_ctl_elem_value
}
/**
+ * \brief compare one #snd_ctl_elem_value_t to another
+ * \param dst pointer to destination
+ * \param src pointer to source
+ * \return 0 on match, less than or greater than otherwise, see memcmp
+ */
+int snd_ctl_elem_value_compare(snd_ctl_elem_value_t *left, const snd_ctl_elem_value_t *right)
+{
+ assert(left && right);
+ return memcmp(left, right, sizeof(*left));
+}
+
+/**
* \brief Get CTL element identifier of a CTL element id/value
* \param obj CTL element id/value
* \param ptr Pointer to returned CTL element identifier
diff --git a/src/control/setup.c b/src/control/setup.c
index 408244e..eecda45 100644
--- a/src/control/setup.c
+++ b/src/control/setup.c
@@ -192,7 +192,17 @@ int snd_sctl_remove(snd_sctl_t *h)
return err;
}
}
- if (elem->preserve) {
+ /* Only restore the old value if it differs from the requested
+ * value, because if it has changed restoring the old value
+ * overrides the change. Take for example, a voice modem with
+ * a .conf that sets preserve off-hook. Start playback (on-hook
+ * to off-hook), start record (off-hook to off-hook), stop
+ * playback (off-hook to restore on-hook), stop record (on-hook
+ * to restore off-hook), Clearly you don't want to leave the
+ * modem "on the phone" now that there isn't any playback or
+ * recording active.
+ */
+ if (elem->preserve && snd_ctl_elem_value_compare(elem->val, elem->old)) {
err = snd_ctl_elem_write(h->ctl, elem->old);
if (err < 0) {
SNDERR("Cannot restore ctl elem");
--
1.7.0.1

View File

@ -0,0 +1,151 @@
From b9dbee694a94a724670b36f4df1aeceb0dd4a261 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Wed, 3 Mar 2010 10:58:53 +0100
Subject: [PATCH] pcm direct plugins: drain() call might be blocked when threads are used
Add SETUP state checks and do modifications according latest ALSA driver
(passing wrong event identification).
ALSA bug#4914
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_direct.c | 21 ++++++++++++++-------
src/pcm/pcm_direct.h | 7 +++----
src/pcm/pcm_dmix.c | 2 +-
src/pcm/pcm_dshare.c | 2 +-
src/pcm/pcm_dsnoop.c | 2 +-
5 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c
index b648f3a..0a9047d 100644
--- a/src/pcm/pcm_direct.c
+++ b/src/pcm/pcm_direct.c
@@ -540,7 +540,6 @@ void snd_pcm_direct_clear_timer_queue(snd_pcm_direct_t *dmix)
int snd_pcm_direct_timer_stop(snd_pcm_direct_t *dmix)
{
snd_timer_stop(dmix->timer);
- snd_pcm_direct_clear_timer_queue(dmix);
return 0;
}
@@ -567,6 +566,7 @@ int snd_pcm_direct_poll_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned in
switch (snd_pcm_state(dmix->spcm)) {
case SND_PCM_STATE_XRUN:
case SND_PCM_STATE_SUSPENDED:
+ case SND_PCM_STATE_SETUP:
events |= POLLERR;
break;
default:
@@ -577,6 +577,7 @@ int snd_pcm_direct_poll_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned in
switch (snd_pcm_state(pcm)) {
case SND_PCM_STATE_XRUN:
case SND_PCM_STATE_SUSPENDED:
+ case SND_PCM_STATE_SETUP:
events |= POLLERR;
break;
default:
@@ -1126,8 +1127,9 @@ int snd_pcm_direct_initialize_poll_fd(snd_pcm_direct_t *dmix)
snd_timer_poll_descriptors(dmix->timer, &dmix->timer_fd, 1);
dmix->poll_fd = dmix->timer_fd.fd;
- dmix->timer_event_suspend = 1<<SND_TIMER_EVENT_MSUSPEND;
- dmix->timer_event_resume = 1<<SND_TIMER_EVENT_MRESUME;
+ dmix->timer_events = (1<<SND_TIMER_EVENT_MSUSPEND) |
+ (1<<SND_TIMER_EVENT_MRESUME) |
+ (1<<SND_TIMER_EVENT_STOP);
/*
* Some hacks for older kernel drivers
@@ -1146,9 +1148,15 @@ int snd_pcm_direct_initialize_poll_fd(snd_pcm_direct_t *dmix)
* suspend/resume events.
*/
if (ver < SNDRV_PROTOCOL_VERSION(2, 0, 5)) {
- dmix->timer_event_suspend = 1<<SND_TIMER_EVENT_MPAUSE;
- dmix->timer_event_resume = 1<<SND_TIMER_EVENT_MCONTINUE;
+ dmix->timer_events &= ~((1<<SND_TIMER_EVENT_MSUSPEND) |
+ (1<<SND_TIMER_EVENT_MRESUME));
+ dmix->timer_events |= (1<<SND_TIMER_EVENT_MPAUSE) |
+ (1<<SND_TIMER_EVENT_MCONTINUE);
}
+ /* In older versions, use SND_TIMER_EVENT_START too.
+ */
+ if (ver < SNDRV_PROTOCOL_VERSION(2, 0, 6))
+ dmix->timer_events |= 1<<SND_TIMER_EVENT_START;
}
return 0;
}
@@ -1275,8 +1283,7 @@ int snd_pcm_direct_set_timer_params(snd_pcm_direct_t *dmix)
snd_timer_params_set_ticks(params, 1);
if (dmix->tread) {
filter = (1<<SND_TIMER_EVENT_TICK) |
- dmix->timer_event_suspend |
- dmix->timer_event_resume;
+ dmix->timer_events;
snd_timer_params_set_filter(params, filter);
}
ret = snd_timer_params(dmix->timer, params);
diff --git a/src/pcm/pcm_direct.h b/src/pcm/pcm_direct.h
index 006617a..132c281 100644
--- a/src/pcm/pcm_direct.h
+++ b/src/pcm/pcm_direct.h
@@ -142,10 +142,9 @@ struct snd_pcm_direct {
int hw_fd; /* hardware file descriptor */
struct pollfd timer_fd;
int poll_fd;
- int tread;
- int timer_need_poll;
- unsigned int timer_event_suspend;
- unsigned int timer_event_resume;
+ int tread: 1;
+ int timer_need_poll: 1;
+ unsigned int timer_events;
int server_fd;
pid_t server_pid;
snd_timer_t *timer; /* timer used as poll_fd */
diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c
index 3b791c1..cb62de9 100644
--- a/src/pcm/pcm_dmix.c
+++ b/src/pcm/pcm_dmix.c
@@ -605,8 +605,8 @@ static int snd_pcm_dmix_drop(snd_pcm_t *pcm)
snd_pcm_direct_t *dmix = pcm->private_data;
if (dmix->state == SND_PCM_STATE_OPEN)
return -EBADFD;
- snd_pcm_direct_timer_stop(dmix);
dmix->state = SND_PCM_STATE_SETUP;
+ snd_pcm_direct_timer_stop(dmix);
return 0;
}
diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c
index c91fa3b..02782a7 100644
--- a/src/pcm/pcm_dshare.c
+++ b/src/pcm/pcm_dshare.c
@@ -355,9 +355,9 @@ static int snd_pcm_dshare_drop(snd_pcm_t *pcm)
snd_pcm_direct_t *dshare = pcm->private_data;
if (dshare->state == SND_PCM_STATE_OPEN)
return -EBADFD;
+ dshare->state = SND_PCM_STATE_SETUP;
snd_pcm_direct_timer_stop(dshare);
do_silence(pcm);
- dshare->state = SND_PCM_STATE_SETUP;
return 0;
}
diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c
index 9d42c12..15c727a 100644
--- a/src/pcm/pcm_dsnoop.c
+++ b/src/pcm/pcm_dsnoop.c
@@ -280,8 +280,8 @@ static int snd_pcm_dsnoop_drop(snd_pcm_t *pcm)
snd_pcm_direct_t *dsnoop = pcm->private_data;
if (dsnoop->state == SND_PCM_STATE_OPEN)
return -EBADFD;
- snd_timer_stop(dsnoop->timer);
dsnoop->state = SND_PCM_STATE_SETUP;
+ snd_timer_stop(dsnoop->timer);
return 0;
}
--
1.7.0.1

View File

@ -0,0 +1,148 @@
From 2e48439ad93f6c8d99a2d72928ac71285b5211bb Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Sun, 31 Jan 2010 09:40:08 +0100
Subject: [PATCH] pcm: fix read_areas and write_areas
The stream state was wrongly updated and handled.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm.c | 87 +++++++++++++++++++++++++++++++-------------------------
1 files changed, 48 insertions(+), 39 deletions(-)
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index 06d674f..f910189 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -6528,46 +6528,51 @@ snd_pcm_sframes_t snd_pcm_read_areas(snd_pcm_t *pcm, const snd_pcm_channel_area_
{
snd_pcm_uframes_t xfer = 0;
snd_pcm_sframes_t err = 0;
- snd_pcm_state_t state = snd_pcm_state(pcm);
+ snd_pcm_state_t state;
if (size == 0)
return 0;
- switch (state) {
- case SND_PCM_STATE_PREPARED:
- err = snd_pcm_start(pcm);
- if (err < 0)
- goto _end;
- break;
- case SND_PCM_STATE_DRAINING:
- case SND_PCM_STATE_RUNNING:
- break;
- case SND_PCM_STATE_XRUN:
- return -EPIPE;
- case SND_PCM_STATE_SUSPENDED:
- return -ESTRPIPE;
- case SND_PCM_STATE_DISCONNECTED:
- return -ENODEV;
- default:
- return -EBADFD;
- }
-
while (size > 0) {
snd_pcm_uframes_t frames;
snd_pcm_sframes_t avail;
_again:
- if (state == SND_PCM_STATE_RUNNING) {
+ state = snd_pcm_state(pcm);
+ switch (state) {
+ case SND_PCM_STATE_PREPARED:
+ err = snd_pcm_start(pcm);
+ if (err < 0)
+ goto _end;
+ break;
+ case SND_PCM_STATE_RUNNING:
err = snd_pcm_hwsync(pcm);
if (err < 0)
goto _end;
+ break;
+ case SND_PCM_STATE_DRAINING:
+ case SND_PCM_STATE_PAUSED:
+ break;
+ case SND_PCM_STATE_XRUN:
+ err = -EPIPE;
+ goto _end;
+ case SND_PCM_STATE_SUSPENDED:
+ err = -ESTRPIPE;
+ goto _end;
+ case SND_PCM_STATE_DISCONNECTED:
+ err = -ENODEV;
+ goto _end;
+ default:
+ err = -EBADFD;
+ goto _end;
}
avail = snd_pcm_avail_update(pcm);
if (avail < 0) {
err = avail;
goto _end;
}
- if ((snd_pcm_uframes_t)avail < pcm->avail_min &&
- size > (snd_pcm_uframes_t)avail) {
+ if (avail == 0) {
+ if (state == SND_PCM_STATE_DRAINING)
+ goto _end;
if (pcm->mode & SND_PCM_NONBLOCK) {
err = -EAGAIN;
goto _end;
@@ -6602,33 +6607,37 @@ snd_pcm_sframes_t snd_pcm_write_areas(snd_pcm_t *pcm, const snd_pcm_channel_area
{
snd_pcm_uframes_t xfer = 0;
snd_pcm_sframes_t err = 0;
- snd_pcm_state_t state = snd_pcm_state(pcm);
+ snd_pcm_state_t state;
if (size == 0)
return 0;
- switch (state) {
- case SND_PCM_STATE_PREPARED:
- case SND_PCM_STATE_RUNNING:
- break;
- case SND_PCM_STATE_XRUN:
- return -EPIPE;
- case SND_PCM_STATE_SUSPENDED:
- return -ESTRPIPE;
- case SND_PCM_STATE_DISCONNECTED:
- return -ENODEV;
- default:
- return -EBADFD;
- }
-
while (size > 0) {
snd_pcm_uframes_t frames;
snd_pcm_sframes_t avail;
_again:
- if (state == SND_PCM_STATE_RUNNING) {
+ state = snd_pcm_state(pcm);
+ switch (state) {
+ case SND_PCM_STATE_PREPARED:
+ case SND_PCM_STATE_PAUSED:
+ break;
+ case SND_PCM_STATE_RUNNING:
err = snd_pcm_hwsync(pcm);
if (err < 0)
goto _end;
+ break;
+ case SND_PCM_STATE_XRUN:
+ err = -EPIPE;
+ goto _end;
+ case SND_PCM_STATE_SUSPENDED:
+ err = -ESTRPIPE;
+ goto _end;
+ case SND_PCM_STATE_DISCONNECTED:
+ err = -ENODEV;
+ goto _end;
+ default:
+ err = -EBADFD;
+ goto _end;
}
avail = snd_pcm_avail_update(pcm);
if (avail < 0) {
--
1.7.0.1

View File

@ -0,0 +1,336 @@
From a55e1ded9914788c1a02bb25857e17d98ab676b5 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Wed, 10 Mar 2010 09:40:02 +0100
Subject: [PATCH] pcm_hw - show errno codes
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_hw.c | 72 +++++++++++++++++++++++++++---------------------------
1 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
index 265335c..9d243d5 100644
--- a/src/pcm/pcm_hw.c
+++ b/src/pcm/pcm_hw.c
@@ -135,7 +135,7 @@ static int sync_ptr1(snd_pcm_hw_t *hw, unsigned int flags)
err = ioctl((hw)->fd, SNDRV_PCM_IOCTL_SYNC_PTR, (hw)->sync_ptr);
if (err < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_SYNC_PTR failed");
+ SYSMSG("SNDRV_PCM_IOCTL_SYNC_PTR failed (%i)", err);
return err;
}
return 0;
@@ -202,7 +202,7 @@ static int snd_pcm_hw_nonblock(snd_pcm_t *pcm, int nonblock)
if ((flags = fcntl(fd, F_GETFL)) < 0) {
err = -errno;
- SYSMSG("F_GETFL failed");
+ SYSMSG("F_GETFL failed (%i)", err);
return err;
}
if (nonblock)
@@ -211,7 +211,7 @@ static int snd_pcm_hw_nonblock(snd_pcm_t *pcm, int nonblock)
flags &= ~O_NONBLOCK;
if (fcntl(fd, F_SETFL, flags) < 0) {
err = -errno;
- SYSMSG("F_SETFL for O_NONBLOCK failed");
+ SYSMSG("F_SETFL for O_NONBLOCK failed (%i)", err);
return err;
}
return 0;
@@ -225,7 +225,7 @@ static int snd_pcm_hw_async(snd_pcm_t *pcm, int sig, pid_t pid)
if ((flags = fcntl(fd, F_GETFL)) < 0) {
err = -errno;
- SYSMSG("F_GETFL failed");
+ SYSMSG("F_GETFL failed (%i)", err);
return err;
}
if (sig >= 0)
@@ -234,19 +234,19 @@ static int snd_pcm_hw_async(snd_pcm_t *pcm, int sig, pid_t pid)
flags &= ~O_ASYNC;
if (fcntl(fd, F_SETFL, flags) < 0) {
err = -errno;
- SYSMSG("F_SETFL for O_ASYNC failed");
+ SYSMSG("F_SETFL for O_ASYNC failed (%i)", err);
return err;
}
if (sig < 0)
return 0;
if (fcntl(fd, F_SETSIG, (long)sig) < 0) {
err = -errno;
- SYSMSG("F_SETSIG failed");
+ SYSMSG("F_SETSIG failed (%i)", err);
return err;
}
if (fcntl(fd, F_SETOWN, (long)pid) < 0) {
err = -errno;
- SYSMSG("F_SETOWN failed");
+ SYSMSG("F_SETOWN failed (%i)", err);
return err;
}
return 0;
@@ -258,7 +258,7 @@ static int snd_pcm_hw_info(snd_pcm_t *pcm, snd_pcm_info_t * info)
int fd = hw->fd, err;
if (ioctl(fd, SNDRV_PCM_IOCTL_INFO, info) < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_INFO failed");
+ SYSMSG("SNDRV_PCM_IOCTL_INFO failed (%i)", err);
return err;
}
return 0;
@@ -323,7 +323,7 @@ static int snd_pcm_hw_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
int err;
if (hw_params_call(hw, params) < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_HW_PARAMS failed");
+ SYSMSG("SNDRV_PCM_IOCTL_HW_PARAMS failed (%i)", err);
return err;
}
params->info &= ~0xf0000000;
@@ -421,7 +421,7 @@ static int snd_pcm_hw_hw_free(snd_pcm_t *pcm)
snd_pcm_hw_change_timer(pcm, 0);
if (ioctl(fd, SNDRV_PCM_IOCTL_HW_FREE) < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_HW_FREE failed");
+ SYSMSG("SNDRV_PCM_IOCTL_HW_FREE failed (%i)", err);
return err;
}
return 0;
@@ -445,7 +445,7 @@ static int snd_pcm_hw_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t * params)
}
if (ioctl(fd, SNDRV_PCM_IOCTL_SW_PARAMS, params) < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_SW_PARAMS failed");
+ SYSMSG("SNDRV_PCM_IOCTL_SW_PARAMS failed (%i)", err);
return err;
}
params->period_event = old_period_event;
@@ -467,7 +467,7 @@ static int snd_pcm_hw_channel_info(snd_pcm_t *pcm, snd_pcm_channel_info_t * info
i.channel = info->channel;
if (ioctl(fd, SNDRV_PCM_IOCTL_CHANNEL_INFO, &i) < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_CHANNEL_INFO failed");
+ SYSMSG("SNDRV_PCM_IOCTL_CHANNEL_INFO failed (%i)", err);
return err;
}
info->channel = i.channel;
@@ -486,7 +486,7 @@ static int snd_pcm_hw_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
int fd = hw->fd, err;
if (ioctl(fd, SNDRV_PCM_IOCTL_STATUS, status) < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_STATUS failed");
+ SYSMSG("SNDRV_PCM_IOCTL_STATUS failed (%i)", err);
return err;
}
if (SNDRV_PROTOCOL_VERSION(2, 0, 5) > hw->version) {
@@ -511,7 +511,7 @@ static int snd_pcm_hw_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
int fd = hw->fd, err;
if (ioctl(fd, SNDRV_PCM_IOCTL_DELAY, delayp) < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_DELAY failed");
+ SYSMSG("SNDRV_PCM_IOCTL_DELAY failed (%i)", err);
return err;
}
return 0;
@@ -529,7 +529,7 @@ static int snd_pcm_hw_hwsync(snd_pcm_t *pcm)
} else {
if (ioctl(fd, SNDRV_PCM_IOCTL_HWSYNC) < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_HWSYNC failed");
+ SYSMSG("SNDRV_PCM_IOCTL_HWSYNC failed (%i)", err);
return err;
}
}
@@ -555,7 +555,7 @@ static int snd_pcm_hw_prepare(snd_pcm_t *pcm)
int fd = hw->fd, err;
if (ioctl(fd, SNDRV_PCM_IOCTL_PREPARE) < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_PREPARE failed");
+ SYSMSG("SNDRV_PCM_IOCTL_PREPARE failed (%i)", err);
return err;
}
return sync_ptr(hw, SNDRV_PCM_SYNC_PTR_APPL);
@@ -567,7 +567,7 @@ static int snd_pcm_hw_reset(snd_pcm_t *pcm)
int fd = hw->fd, err;
if (ioctl(fd, SNDRV_PCM_IOCTL_RESET) < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_RESET failed");
+ SYSMSG("SNDRV_PCM_IOCTL_RESET failed (%i)", err);
return err;
}
return sync_ptr(hw, SNDRV_PCM_SYNC_PTR_APPL);
@@ -584,7 +584,7 @@ static int snd_pcm_hw_start(snd_pcm_t *pcm)
sync_ptr(hw, 0);
if (ioctl(hw->fd, SNDRV_PCM_IOCTL_START) < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_START failed");
+ SYSMSG("SNDRV_PCM_IOCTL_START failed (%i)", err);
#if 0
if (err == -EBADFD)
SNDERR("PCM state = %s", snd_pcm_state_name(snd_pcm_hw_state(pcm)));
@@ -600,7 +600,7 @@ static int snd_pcm_hw_drop(snd_pcm_t *pcm)
int err;
if (ioctl(hw->fd, SNDRV_PCM_IOCTL_DROP) < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_DROP failed");
+ SYSMSG("SNDRV_PCM_IOCTL_DROP failed (%i)", err);
return err;
} else {
}
@@ -613,7 +613,7 @@ static int snd_pcm_hw_drain(snd_pcm_t *pcm)
int err;
if (ioctl(hw->fd, SNDRV_PCM_IOCTL_DRAIN) < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_DRAIN failed");
+ SYSMSG("SNDRV_PCM_IOCTL_DRAIN failed (%i)", err);
return err;
}
return 0;
@@ -625,7 +625,7 @@ static int snd_pcm_hw_pause(snd_pcm_t *pcm, int enable)
int err;
if (ioctl(hw->fd, SNDRV_PCM_IOCTL_PAUSE, enable) < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_PAUSE failed");
+ SYSMSG("SNDRV_PCM_IOCTL_PAUSE failed (%i)", err);
return err;
}
return 0;
@@ -642,7 +642,7 @@ static snd_pcm_sframes_t snd_pcm_hw_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t fra
int err;
if (ioctl(hw->fd, SNDRV_PCM_IOCTL_REWIND, &frames) < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_REWIND failed");
+ SYSMSG("SNDRV_PCM_IOCTL_REWIND failed (%i)", err);
return err;
}
err = sync_ptr(hw, SNDRV_PCM_SYNC_PTR_APPL);
@@ -663,7 +663,7 @@ static snd_pcm_sframes_t snd_pcm_hw_forward(snd_pcm_t *pcm, snd_pcm_uframes_t fr
if (SNDRV_PROTOCOL_VERSION(2, 0, 4) <= hw->version) {
if (ioctl(hw->fd, SNDRV_PCM_IOCTL_FORWARD, &frames) < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_FORWARD failed");
+ SYSMSG("SNDRV_PCM_IOCTL_FORWARD failed (%i)", err);
return err;
}
err = sync_ptr(hw, SNDRV_PCM_SYNC_PTR_APPL);
@@ -706,7 +706,7 @@ static int snd_pcm_hw_resume(snd_pcm_t *pcm)
int fd = hw->fd, err;
if (ioctl(fd, SNDRV_PCM_IOCTL_RESUME) < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_RESUME failed");
+ SYSMSG("SNDRV_PCM_IOCTL_RESUME failed (%i)", err);
return err;
}
return 0;
@@ -717,7 +717,7 @@ static int hw_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2)
snd_pcm_hw_t *hw1 = pcm1->private_data;
snd_pcm_hw_t *hw2 = pcm2->private_data;
if (ioctl(hw1->fd, SNDRV_PCM_IOCTL_LINK, hw2->fd) < 0) {
- SYSMSG("SNDRV_PCM_IOCTL_LINK failed");
+ SYSMSG("SNDRV_PCM_IOCTL_LINK failed (%i)", -errno);
return -errno;
}
return 0;
@@ -726,7 +726,7 @@ static int hw_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2)
static int snd_pcm_hw_link_slaves(snd_pcm_t *pcm, snd_pcm_t *master)
{
if (master->type != SND_PCM_TYPE_HW) {
- SYSMSG("Invalid type for SNDRV_PCM_IOCTL_LINK");
+ SYSMSG("Invalid type for SNDRV_PCM_IOCTL_LINK (%i)", master->type);
return -EINVAL;
}
return hw_link(master, pcm);
@@ -747,7 +747,7 @@ static int snd_pcm_hw_unlink(snd_pcm_t *pcm)
snd_pcm_hw_t *hw = pcm->private_data;
if (ioctl(hw->fd, SNDRV_PCM_IOCTL_UNLINK) < 0) {
- SYSMSG("SNDRV_PCM_IOCTL_UNLINK failed");
+ SYSMSG("SNDRV_PCM_IOCTL_UNLINK failed (%i)", -errno);
return -errno;
}
return 0;
@@ -847,7 +847,7 @@ static int snd_pcm_hw_mmap_status(snd_pcm_t *pcm)
err = ioctl(hw->fd, SNDRV_PCM_IOCTL_SYNC_PTR, &sync_ptr);
if (err < 0) {
err = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_SYNC_PTR failed");
+ SYSMSG("SNDRV_PCM_IOCTL_SYNC_PTR failed (%i)", err);
return err;
}
hw->sync_ptr = calloc(1, sizeof(struct sndrv_pcm_sync_ptr));
@@ -874,7 +874,7 @@ static int snd_pcm_hw_mmap_control(snd_pcm_t *pcm)
hw->fd, SNDRV_PCM_MMAP_OFFSET_CONTROL);
if (ptr == MAP_FAILED || ptr == NULL) {
err = -errno;
- SYSMSG("control mmap failed");
+ SYSMSG("control mmap failed (%i)", err);
return err;
}
hw->mmap_control = ptr;
@@ -895,7 +895,7 @@ static int snd_pcm_hw_munmap_status(snd_pcm_t *pcm)
} else {
if (munmap((void*)hw->mmap_status, page_align(sizeof(*hw->mmap_status))) < 0) {
err = -errno;
- SYSMSG("status munmap failed");
+ SYSMSG("status munmap failed (%i)", err);
return err;
}
}
@@ -912,7 +912,7 @@ static int snd_pcm_hw_munmap_control(snd_pcm_t *pcm)
} else {
if (munmap(hw->mmap_control, page_align(sizeof(*hw->mmap_control))) < 0) {
err = -errno;
- SYSMSG("control munmap failed");
+ SYSMSG("control munmap failed (%i)", err);
return err;
}
}
@@ -935,7 +935,7 @@ static int snd_pcm_hw_close(snd_pcm_t *pcm)
int err = 0;
if (close(hw->fd)) {
err = -errno;
- SYSMSG("close failed\n");
+ SYSMSG("close failed (%i)\n", err);
}
snd_pcm_hw_munmap_status(pcm);
snd_pcm_hw_munmap_control(pcm);
@@ -1129,7 +1129,7 @@ int snd_pcm_hw_open_fd(snd_pcm_t **pcmp, const char *name,
memset(&info, 0, sizeof(info));
if (ioctl(fd, SNDRV_PCM_IOCTL_INFO, &info) < 0) {
ret = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_INFO failed");
+ SYSMSG("SNDRV_PCM_IOCTL_INFO failed (%i)", ret);
close(fd);
return ret;
@@ -1148,7 +1148,7 @@ int snd_pcm_hw_open_fd(snd_pcm_t **pcmp, const char *name,
if (ioctl(fd, SNDRV_PCM_IOCTL_PVERSION, &ver) < 0) {
ret = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_PVERSION failed");
+ SYSMSG("SNDRV_PCM_IOCTL_PVERSION failed (%i)", ret);
close(fd);
return ret;
}
@@ -1290,14 +1290,14 @@ int snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name,
fd = snd_open_device(filename, fmode);
if (fd < 0) {
ret = -errno;
- SYSMSG("open %s failed", filename);
+ SYSMSG("open '%s' failed (%i)", filename, ret);
goto _err;
}
if (subdevice >= 0) {
memset(&info, 0, sizeof(info));
if (ioctl(fd, SNDRV_PCM_IOCTL_INFO, &info) < 0) {
ret = -errno;
- SYSMSG("SNDRV_PCM_IOCTL_INFO failed");
+ SYSMSG("SNDRV_PCM_IOCTL_INFO failed (%i)", ret);
goto _err;
}
if (info.subdevice != (unsigned int) subdevice) {
--
1.7.0.2

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Mon Mar 8 14:33:52 CET 2010 - tiwai@suse.de
- backport upstream fixes:
* modem.conf Off-hook improve behavior
* pcm: fix read_areas and write_areas
* Fix snd_pcm_sw_params_set_period_event() implementation
* pcm_dmix: add support for S24_LE format
* pcm direct plugins: drain() call might be blocked when threads are used
* pcm: show errno in error messages
-------------------------------------------------------------------
Tue Dec 22 12:03:04 CET 2009 - tiwai@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package alsa (Version 1.0.22)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -34,7 +34,7 @@ Obsoletes: alsa-64bit
#
Summary: Advanced Linux Sound Architecture
Version: 1.0.22
Release: 2
Release: 3
Source: ftp://ftp.alsa-project.org/pub/lib/alsa-lib-%{package_version}.tar.bz2
Source2: baselibs.conf
Source8: 40-alsa.rules
@ -54,6 +54,12 @@ Source34: alsa-init.sh
# Patch: alsa-lib-git-fixes.diff
Patch1: alsa-lib-pcm-close-event-timer.diff
Patch2: alsa-lib-fix-s24-3le-softvol.diff
Patch3: alsa-lib-modem-conf-off-hook.diff
Patch4: alsa-lib-pcm-fix-read-write_areas.diff
Patch5: alsa-lib-fix-snd_pcm_sw_params_set_period_event.diff
Patch6: alsa-lib-dmix-add-s24-le-support.diff
Patch7: alsa-lib-pcm-direct-drain-enhance.diff
Patch8: alsa-lib-pcm-show-errno.diff
Url: http://www.alsa-project.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -131,6 +137,12 @@ Authors:
# %patch -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
# hack to fix build on older distros
%if %suse_version < 1100
%ifarch %ix86