Accepting request 54049 from multimedia:libs

Accepted submit request 54049 from user tiwai

OBS-URL: https://build.opensuse.org/request/show/54049
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/alsa?expand=0&rev=94
This commit is contained in:
Berthold Gunreben 2010-11-29 10:53:06 +00:00 committed by Git OBS Bridge
commit b8728832e4
12 changed files with 737 additions and 1 deletions

View File

@ -0,0 +1,32 @@
From 443c1057379f167639acad5dc197bd50a915b5ab Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@debian.org>
Date: Fri, 8 Oct 2010 09:06:29 +0100
Subject: [PATCH 01/10] Version-check libtool correctly when doing an out-of-tree build
libtool is only created at the end of ./configure, so it doesn't make
sense to grep it in ./configure (the check would always fail the first
time). However, ltmain.sh is copied into the ${srcdir} by libtoolize and
should be safe to check at any time that configure can be run.
Signed-off-by: Simon McVittie <smcv@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
configure.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/configure.in b/configure.in
index abc4687..e904956 100644
--- a/configure.in
+++ b/configure.in
@@ -115,7 +115,7 @@ AC_ARG_WITH(versioned,
versioned="$withval", versioned="yes")
if test "$versioned" = "yes"; then
# it seems that GNU ld versions since 2.10 are not broken
- xres=`grep '^VERSION=' libtool | cut -d = -f 2 | cut -d \" -f 2`
+ xres=`grep '^VERSION=' ${srcdir}/ltmain.sh | cut -d = -f 2 | cut -d \" -f 2`
major=`echo $xres | cut -d . -f 1`
minor=`echo $xres | cut -d . -f 2`
pass=0
--
1.7.3.1

View File

@ -0,0 +1,28 @@
From 5cfa03d2f3a9e6bc62f740640d20bd137b4e3bb5 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@debian.org>
Date: Fri, 8 Oct 2010 09:06:58 +0100
Subject: [PATCH 02/10] configure.in: don't rely on test -a, not all shells support it
Notably, /bin/sh in older Debian and Ubuntu is dash, which doesn't.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
configure.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/configure.in b/configure.in
index e904956..c353759 100644
--- a/configure.in
+++ b/configure.in
@@ -119,7 +119,7 @@ if test "$versioned" = "yes"; then
major=`echo $xres | cut -d . -f 1`
minor=`echo $xres | cut -d . -f 2`
pass=0
- if test $major -eq 1 -a $minor -gt 3; then
+ if test $major -eq 1 && test $minor -gt 3; then
pass=1
else
if test $major -gt 1; then
--
1.7.3.1

View File

@ -0,0 +1,137 @@
From 13b5d972d2e7a5f0e6f3c066684dbb01fafd5121 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Fri, 29 Oct 2010 17:36:41 +0200
Subject: [PATCH 03/10] pcm direct plugins: change timestamping in dsnoop
Do not use own timestamps, try to sync hw.ptr with real timestamp.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_direct.h | 1 +
src/pcm/pcm_dmix.c | 2 +-
src/pcm/pcm_dshare.c | 2 +-
src/pcm/pcm_dsnoop.c | 31 +++++++++++++++++++++++++------
4 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/src/pcm/pcm_direct.h b/src/pcm/pcm_direct.h
index 132c281..7f16481 100644
--- a/src/pcm/pcm_direct.h
+++ b/src/pcm/pcm_direct.h
@@ -137,6 +137,7 @@ struct snd_pcm_direct {
int (*sync_ptr)(snd_pcm_t *pcm);
snd_pcm_state_t state;
snd_htimestamp_t trigger_tstamp;
+ snd_htimestamp_t update_tstamp;
int server, client;
int comm_fd; /* communication file descriptor (socket) */
int hw_fd; /* hardware file descriptor */
diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c
index cb62de9..434fc65 100644
--- a/src/pcm/pcm_dmix.c
+++ b/src/pcm/pcm_dmix.c
@@ -852,7 +852,7 @@ static int snd_pcm_dmix_htimestamp(snd_pcm_t *pcm,
if (ok && *avail == avail1)
break;
*avail = avail1;
- *tstamp = snd_pcm_hw_fast_tstamp(pcm);
+ *tstamp = snd_pcm_hw_fast_tstamp(dmix->spcm);
}
return 0;
}
diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c
index 02782a7..77789a5 100644
--- a/src/pcm/pcm_dshare.c
+++ b/src/pcm/pcm_dshare.c
@@ -542,7 +542,7 @@ static int snd_pcm_dshare_htimestamp(snd_pcm_t *pcm,
if (ok && *avail == avail1)
break;
*avail = avail1;
- *tstamp = snd_pcm_hw_fast_tstamp(pcm);
+ *tstamp = snd_pcm_hw_fast_tstamp(dshare->spcm);
}
return 0;
}
diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c
index 15c727a..988f1f4 100644
--- a/src/pcm/pcm_dsnoop.c
+++ b/src/pcm/pcm_dsnoop.c
@@ -54,6 +54,23 @@ const char *_snd_module_pcm_dsnoop = "";
*
*/
+static int snoop_timestamp(snd_pcm_t *pcm)
+{
+ snd_pcm_direct_t *dsnoop = pcm->private_data;
+ snd_pcm_uframes_t ptr1 = -2LL /* invalid value */, ptr2;
+
+ /* loop is required to sync hw.ptr with timestamp */
+ while (1) {
+ ptr2 = *dsnoop->spcm->hw.ptr;
+ if (ptr1 == ptr2)
+ break;
+ ptr1 = ptr2;
+ dsnoop->update_tstamp = snd_pcm_hw_fast_tstamp(dsnoop->spcm);
+ }
+ dsnoop->slave_hw_ptr = ptr1;
+ return 0;
+}
+
static void snoop_areas(snd_pcm_direct_t *dsnoop,
const snd_pcm_channel_area_t *src_areas,
const snd_pcm_channel_area_t *dst_areas,
@@ -126,7 +143,8 @@ static int snd_pcm_dsnoop_sync_ptr(snd_pcm_t *pcm)
if (dsnoop->slowptr)
snd_pcm_hwsync(dsnoop->spcm);
old_slave_hw_ptr = dsnoop->slave_hw_ptr;
- slave_hw_ptr = dsnoop->slave_hw_ptr = *dsnoop->spcm->hw.ptr;
+ snoop_timestamp(pcm);
+ slave_hw_ptr = dsnoop->slave_hw_ptr;
diff = slave_hw_ptr - old_slave_hw_ptr;
if (diff == 0) /* fast path */
return 0;
@@ -172,7 +190,7 @@ static int snd_pcm_dsnoop_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
state = snd_pcm_state(dsnoop->spcm);
status->state = state == SND_PCM_STATE_RUNNING ? dsnoop->state : state;
status->trigger_tstamp = dsnoop->trigger_tstamp;
- gettimestamp(&status->tstamp, pcm->monotonic);
+ status->tstamp = dsnoop->update_tstamp;
status->avail = snd_pcm_mmap_capture_avail(pcm);
status->avail_max = status->avail > dsnoop->avail_max ? status->avail : dsnoop->avail_max;
dsnoop->avail_max = 0;
@@ -254,7 +272,7 @@ static int snd_pcm_dsnoop_reset(snd_pcm_t *pcm)
snd_pcm_direct_t *dsnoop = pcm->private_data;
dsnoop->hw_ptr %= pcm->period_size;
dsnoop->appl_ptr = dsnoop->hw_ptr;
- dsnoop->slave_appl_ptr = dsnoop->slave_hw_ptr = *dsnoop->spcm->hw.ptr;
+ dsnoop->slave_appl_ptr = dsnoop->slave_hw_ptr;
return 0;
}
@@ -266,12 +284,13 @@ static int snd_pcm_dsnoop_start(snd_pcm_t *pcm)
if (dsnoop->state != SND_PCM_STATE_PREPARED)
return -EBADFD;
snd_pcm_hwsync(dsnoop->spcm);
- dsnoop->slave_appl_ptr = dsnoop->slave_hw_ptr = *dsnoop->spcm->hw.ptr;
+ snoop_timestamp(pcm);
+ dsnoop->slave_appl_ptr = dsnoop->slave_hw_ptr;
err = snd_timer_start(dsnoop->timer);
if (err < 0)
return err;
dsnoop->state = SND_PCM_STATE_RUNNING;
- gettimestamp(&dsnoop->trigger_tstamp, pcm->monotonic);
+ dsnoop->trigger_tstamp = dsnoop->update_tstamp;
return 0;
}
@@ -437,7 +456,7 @@ static int snd_pcm_dsnoop_htimestamp(snd_pcm_t *pcm,
if (ok && *avail == avail1)
break;
*avail = avail1;
- *tstamp = snd_pcm_hw_fast_tstamp(pcm);
+ *tstamp = snd_pcm_hw_fast_tstamp(dsnoop->spcm);
}
return 0;
}
--
1.7.3.1

View File

@ -0,0 +1,56 @@
From ab6df229015f46bc2c7b50f5278480d996b232c0 Mon Sep 17 00:00:00 2001
From: Clemens Ladisch <clemens@ladisch.de>
Date: Wed, 10 Nov 2010 10:11:51 +0100
Subject: [PATCH 04/10] USB-Audio.conf: fix Audiophile USB card name
The device name of the M-Audio AudioPhile USB is actually "Audiophile USB (tm)".
Also keep the old string, just to be sure.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
---
src/conf/cards/USB-Audio.conf | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/conf/cards/USB-Audio.conf b/src/conf/cards/USB-Audio.conf
index 5849e3f..0726c34 100644
--- a/src/conf/cards/USB-Audio.conf
+++ b/src/conf/cards/USB-Audio.conf
@@ -16,6 +16,7 @@
# here.
USB-Audio.pcm.use_dmix {
"AudioPhile" no # uses big-endian 24-bit samples
+ "Audiophile USB (tm)" no
}
# If a device does not have a four-channel mode for the front/rear outputs,
@@ -25,6 +26,7 @@ USB-Audio.pcm.use_dmix {
# two_stereo_devices - for devices that have two stereo audio interfaces
USB-Audio.pcm.surround40_type {
"AudioPhile" two_stereo_devices
+ "Audiophile USB (tm)" two_stereo_devices
"OmniStudio" two_stereo_devices
"Quattro" two_stereo_devices
"SB Audigy 2 NX" six_channels
@@ -43,7 +45,8 @@ USB-Audio.pcm.iec958_device {
# M-Audio AudioPhile USB:
# device 0: analog output, digital input
# device 1: digital output, analog input
-USB-Audio."AudioPhile".pcm.default {
+USB-Audio."AudioPhile".pcm.default "cards.USB-Audio.Audiophile USB (tm).pcm.default"
+USB-Audio."Audiophile USB (tm)".pcm.default {
@args [ CARD ]
@args.CARD { type string }
type asym
@@ -63,7 +66,8 @@ USB-Audio."AudioPhile".pcm.default {
}
}
}
-USB-Audio."AudioPhile".pcm.iec958 {
+USB-Audio."AudioPhile".pcm.iec958 "cards.USB-Audio.Audiophile USB (tm).pcm.iec958"
+USB-Audio."Audiophile USB (tm)".pcm.iec958 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
--
1.7.3.1

View File

@ -0,0 +1,30 @@
From 70dded6aba653b5f70b48fda22f9b322fd3ae2c9 Mon Sep 17 00:00:00 2001
From: Clemens Ladisch <clemens@ladisch.de>
Date: Mon, 15 Nov 2010 10:33:35 +0100
Subject: [PATCH 05/10] pcm: pass hw_params flags to slave
Fix required before interrupt disabling routines patch can be applied.
Without this fix, the interrupts are only disabled when directly
accessing hw devices.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
---
src/pcm/pcm_params.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/pcm/pcm_params.c b/src/pcm/pcm_params.c
index 3a90bcd..b085d42 100644
--- a/src/pcm/pcm_params.c
+++ b/src/pcm/pcm_params.c
@@ -2126,6 +2126,7 @@ int _snd_pcm_hw_params_refine(snd_pcm_hw_params_t *params,
err = changed;
}
params->info &= src->info;
+ params->flags = src->flags; /* propagate all flags to slave */
return err;
}
--
1.7.3.1

View File

@ -0,0 +1,175 @@
From 7c99bd24bcf6852d55e90e0f42f7ac5ea8f14fbb Mon Sep 17 00:00:00 2001
From: Clemens Ladisch <clemens@ladisch.de>
Date: Mon, 15 Nov 2010 10:43:13 +0100
Subject: [PATCH 06/10] support for period wakeup disabling
Add API to disable period wakeups.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
---
include/pcm.h | 3 ++
include/sound/asound.h | 2 +
src/pcm/pcm.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++-
src/pcm/pcm_local.h | 3 ++
4 files changed, 79 insertions(+), 1 deletions(-)
diff --git a/include/pcm.h b/include/pcm.h
index f3618c3..7243ffb 100644
--- a/include/pcm.h
+++ b/include/pcm.h
@@ -531,6 +531,7 @@ 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);
int snd_pcm_hw_params_is_joint_duplex(const snd_pcm_hw_params_t *params);
int snd_pcm_hw_params_can_sync_start(const snd_pcm_hw_params_t *params);
+int snd_pcm_hw_params_can_disable_period_wakeup(const snd_pcm_hw_params_t *params);
int snd_pcm_hw_params_get_rate_numden(const snd_pcm_hw_params_t *params,
unsigned int *rate_num,
unsigned int *rate_den);
@@ -626,6 +627,8 @@ int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *par
int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
+int snd_pcm_hw_params_set_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
+int snd_pcm_hw_params_get_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val);
int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
diff --git a/include/sound/asound.h b/include/sound/asound.h
index fa88938..17dfe8f 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -278,6 +278,7 @@ enum sndrv_pcm_subformat {
#define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */
#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */
#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */
+#define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */
enum sndrv_pcm_state {
SNDRV_PCM_STATE_OPEN = 0, /* stream is open */
@@ -346,6 +347,7 @@ enum sndrv_pcm_hw_param {
#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */
#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */
+#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */
struct sndrv_interval {
unsigned int min, max;
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index a49b5b9..f378779 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -726,8 +726,11 @@ int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock)
return err;
if (nonblock)
pcm->mode |= SND_PCM_NONBLOCK;
- else
+ else {
+ if (pcm->hw_flags & SND_PCM_HW_PARAMS_NO_PERIOD_WAKEUP)
+ return -EINVAL;
pcm->mode &= ~SND_PCM_NONBLOCK;
+ }
return 0;
}
@@ -3081,6 +3084,23 @@ int snd_pcm_hw_params_can_sync_start(const snd_pcm_hw_params_t *params)
}
/**
+ * \brief Check if hardware can disable period wakeups
+ * \param params Configuration space
+ * \return Boolean value
+ * \retval 0 Hardware cannot disable period wakeups
+ * \retval 1 Hardware can disable period wakeups
+ */
+int snd_pcm_hw_params_can_disable_period_wakeup(const snd_pcm_hw_params_t *params)
+{
+ assert(params);
+ if (CHECK_SANITY(params->info == ~0U)) {
+ SNDMSG("invalid PCM info field");
+ return 0; /* FIXME: should be a negative error? */
+ }
+ return !!(params->info & SNDRV_PCM_INFO_NO_PERIOD_WAKEUP);
+}
+
+/**
* \brief Get rate exact info from a configuration space
* \param params Configuration space
* \param rate_num Pointer to returned rate numerator
@@ -4200,6 +4220,56 @@ int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *par
}
/**
+ * \brief Restrict a configuration space to settings without period wakeups
+ * \param pcm PCM handle
+ * \param params Configuration space
+ * \param val 0 = disable, 1 = enable (default) period wakeup
+ * \return Zero on success, otherwise a negative error code.
+ *
+ * This function must be called only on devices where non-blocking mode is
+ * enabled.
+ *
+ * To check whether the hardware does support disabling period wakeups, call
+ * #snd_pcm_hw_params_can_disable_period_wakeup(). If the hardware does not
+ * support this mode, standard period wakeups will be generated.
+ *
+ * Even with disabled period wakeups, the period size/time/count parameters
+ * are valid; it is suggested to use #snd_pcm_hw_params_set_period_size_last().
+ *
+ * When period wakeups are disabled, the application must not use any functions
+ * that could block on this device. The use of poll should be limited to error
+ * cases. The application needs to use an external event or a timer to
+ * check the state of the ring buffer and refill it apropriately.
+ */
+int snd_pcm_hw_params_set_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val)
+{
+ assert(pcm && params);
+
+ if (!val) {
+ if (!(pcm->mode & SND_PCM_NONBLOCK))
+ return -EINVAL;
+ params->flags |= SND_PCM_HW_PARAMS_NO_PERIOD_WAKEUP;
+ } else
+ params->flags &= ~SND_PCM_HW_PARAMS_NO_PERIOD_WAKEUP;
+
+ return snd_pcm_hw_refine(pcm, params);
+}
+
+/**
+ * \brief Extract period wakeup flag from a configuration space
+ * \param pcm PCM handle
+ * \param params Configuration space
+ * \param val 0 = disabled, 1 = enabled period wakeups
+ * \return Zero on success, otherwise a negative error code.
+ */
+int snd_pcm_hw_params_get_period_wakeup(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
+{
+ assert(pcm && params && val);
+ *val = params->flags & SND_PCM_HW_PARAMS_NO_PERIOD_WAKEUP ? 0 : 1;
+ return 0;
+}
+
+/**
* \brief Extract period time from a configuration space
* \param params Configuration space
* \param val Returned approximate period duration in us
diff --git a/src/pcm/pcm_local.h b/src/pcm/pcm_local.h
index 2f6fcd2..2e901d5 100644
--- a/src/pcm/pcm_local.h
+++ b/src/pcm/pcm_local.h
@@ -91,9 +91,12 @@ typedef enum sndrv_pcm_hw_param snd_pcm_hw_param_t;
#define SND_PCM_INFO_JOINT_DUPLEX SNDRV_PCM_INFO_JOINT_DUPLEX
/** device can do a kind of synchronized start */
#define SND_PCM_INFO_SYNC_START SNDRV_PCM_INFO_SYNC_START
+/** device can disable period wakeups */
+#define SND_PCM_INFO_NO_PERIOD_WAKEUP SNDRV_PCM_INFO_NO_PERIOD_WAKEUP
#define SND_PCM_HW_PARAMS_NORESAMPLE SNDRV_PCM_HW_PARAMS_NORESAMPLE
#define SND_PCM_HW_PARAMS_EXPORT_BUFFER SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER
+#define SND_PCM_HW_PARAMS_NO_PERIOD_WAKEUP SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP
#define SND_PCM_INFO_MONOTONIC 0x80000000
--
1.7.3.1

View File

@ -0,0 +1,47 @@
From ba9332e9192814a5431a3a2505d25d74a9232124 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Thu, 18 Nov 2010 09:27:07 +0100
Subject: [PATCH 07/10] pcm: fix snd_pcm_avail_delay() function
For capture stream, the delay must be obtained as last, but we need to
update the ring buffer pointers for the avail_update call. So, rearrange
the code a bit and add hwsync call as first.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index f378779..7409943 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -2470,18 +2470,22 @@ int snd_pcm_avail_delay(snd_pcm_t *pcm,
snd_pcm_sframes_t *delayp)
{
snd_pcm_sframes_t sf;
+ int err;
assert(pcm && availp && delayp);
if (CHECK_SANITY(! pcm->setup)) {
SNDMSG("PCM not set up");
return -EIO;
}
- sf = pcm->fast_ops->delay(pcm->fast_op_arg, delayp);
- if (sf < 0)
- return (int)sf;
+ err = pcm->fast_ops->hwsync(pcm->fast_op_arg);
+ if (err < 0)
+ return err;
sf = pcm->fast_ops->avail_update(pcm->fast_op_arg);
if (sf < 0)
return (int)sf;
+ err = pcm->fast_ops->delay(pcm->fast_op_arg, delayp);
+ if (err < 0)
+ return err;
*availp = sf;
return 0;
}
--
1.7.3.1

View File

@ -0,0 +1,119 @@
From ade3efbd865967bf78d7f0ae6a2fe9809ea90719 Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Date: Fri, 19 Nov 2010 10:35:31 -0600
Subject: [PATCH 08/10] pcm_plugin: remove unused client_frames and slave_frames routines
plug->client_frames and plug->slave_frames are not used by
any plugin, remove dead code.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_plugin.c | 33 ++++-----------------------------
src/pcm/pcm_plugin.h | 2 --
2 files changed, 4 insertions(+), 31 deletions(-)
diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
index 0ef394a..19d0dee 100644
--- a/src/pcm/pcm_plugin.c
+++ b/src/pcm/pcm_plugin.c
@@ -144,8 +144,6 @@ static int snd_pcm_plugin_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
int err = snd_pcm_delay(plugin->gen.slave, &sd);
if (err < 0)
return err;
- if (plugin->client_frames)
- sd = plugin->client_frames(pcm, sd);
*delayp = sd;
return 0;
}
@@ -208,18 +206,13 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
if (frames == 0)
return 0;
- if (plugin->slave_frames)
- sframes = plugin->slave_frames(pcm, (snd_pcm_sframes_t) frames);
- else
- sframes = frames;
+ sframes = frames;
snd_atomic_write_begin(&plugin->watom);
sframes = snd_pcm_rewind(plugin->gen.slave, sframes);
if (sframes < 0) {
snd_atomic_write_end(&plugin->watom);
return sframes;
}
- if (plugin->client_frames)
- frames = plugin->client_frames(pcm, sframes);
snd_pcm_mmap_appl_backward(pcm, (snd_pcm_uframes_t) frames);
snd_atomic_write_end(&plugin->watom);
return (snd_pcm_sframes_t) frames;
@@ -241,18 +234,13 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_
if (frames == 0)
return 0;
- if (plugin->slave_frames)
- sframes = plugin->slave_frames(pcm, (snd_pcm_sframes_t) frames);
- else
- sframes = frames;
+ sframes = frames;
snd_atomic_write_begin(&plugin->watom);
sframes = INTERNAL(snd_pcm_forward)(plugin->gen.slave, sframes);
if (sframes < 0) {
snd_atomic_write_end(&plugin->watom);
return sframes;
}
- if (plugin->client_frames)
- frames = plugin->client_frames(pcm, sframes);
snd_pcm_mmap_appl_forward(pcm, (snd_pcm_uframes_t) frames);
snd_atomic_write_end(&plugin->watom);
return (snd_pcm_sframes_t) frames;
@@ -469,15 +457,8 @@ static snd_pcm_sframes_t snd_pcm_plugin_avail_update(snd_pcm_t *pcm)
pcm->access != SND_PCM_ACCESS_RW_INTERLEAVED &&
pcm->access != SND_PCM_ACCESS_RW_NONINTERLEAVED)
goto _capture;
- if (plugin->client_frames) {
- *pcm->hw.ptr = plugin->client_frames(pcm, *slave->hw.ptr);
- if (slave_size <= 0)
- return slave_size;
- return plugin->client_frames(pcm, slave_size);
- } else {
- *pcm->hw.ptr = *slave->hw.ptr;
- return slave_size;
- }
+ *pcm->hw.ptr = *slave->hw.ptr;
+ return slave_size;
_capture:
{
const snd_pcm_channel_area_t *areas;
@@ -547,16 +528,10 @@ static int snd_pcm_plugin_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
}
status->appl_ptr = *pcm->appl.ptr;
status->hw_ptr = *pcm->hw.ptr;
- if (plugin->client_frames) {
- status->delay = plugin->client_frames(pcm, status->delay);
- status->avail = plugin->client_frames(pcm, status->avail);
- }
if (!snd_atomic_read_ok(&ratom)) {
snd_atomic_read_wait(&ratom);
goto _again;
}
- if (plugin->client_frames)
- status->avail_max = plugin->client_frames(pcm, (snd_pcm_sframes_t) status->avail_max);
return 0;
}
diff --git a/src/pcm/pcm_plugin.h b/src/pcm/pcm_plugin.h
index dfcf6de..7ee7c7f 100644
--- a/src/pcm/pcm_plugin.h
+++ b/src/pcm/pcm_plugin.h
@@ -44,8 +44,6 @@ typedef struct {
snd_pcm_slave_xfer_areas_func_t write;
snd_pcm_slave_xfer_areas_undo_func_t undo_read;
snd_pcm_slave_xfer_areas_undo_func_t undo_write;
- snd_pcm_sframes_t (*client_frames)(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
- snd_pcm_sframes_t (*slave_frames)(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
int (*init)(snd_pcm_t *pcm);
snd_pcm_uframes_t appl_ptr, hw_ptr;
snd_atomic_write_t watom;
--
1.7.3.1

View File

@ -0,0 +1,29 @@
From a4f71b19407fde8d5fd4f35850543173636b3ee0 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Tue, 23 Nov 2010 13:40:25 +0100
Subject: [PATCH 09/10] pcm: add MMAP_EMUL to type names
If we try to print this then it causes a read past the end of the array
in snd_pcm_type_name().
From: Dan Carpenter <error27@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index 7409943..906b502 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -1633,6 +1633,7 @@ static const char *const snd_pcm_type_names[] = {
PCMTYPE(SOFTVOL),
PCMTYPE(IOPLUG),
PCMTYPE(EXTPLUG),
+ PCMTYPE(MMAP_EMUL),
};
static const char *const snd_pcm_subformat_names[] = {
--
1.7.3.1

View File

@ -0,0 +1,38 @@
From aba87e509898ec9ddb3e319267d7c267409ff100 Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Date: Tue, 23 Nov 2010 08:47:08 -0600
Subject: [PATCH 10/10] pcm_plugin: fix delay
PulseAudio ALSA modules report errors after calling
snd_pcm_avail_delay(), with a delay lower than the number of samples
available.
Correct delay using Jaroslav's recommendation:
"the result should be 'delay(slave) + mmap_capture_avail(pcm)"
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_plugin.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
index 19d0dee..d88e117 100644
--- a/src/pcm/pcm_plugin.c
+++ b/src/pcm/pcm_plugin.c
@@ -144,6 +144,12 @@ static int snd_pcm_plugin_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
int err = snd_pcm_delay(plugin->gen.slave, &sd);
if (err < 0)
return err;
+ if (pcm->stream == SND_PCM_STREAM_CAPTURE &&
+ pcm->access != SND_PCM_ACCESS_RW_INTERLEAVED &&
+ pcm->access != SND_PCM_ACCESS_RW_NONINTERLEAVED) {
+ sd += snd_pcm_mmap_capture_avail(pcm);
+ }
+
*delayp = sd;
return 0;
}
--
1.7.3.1

View File

@ -1,3 +1,24 @@
-------------------------------------------------------------------
Fri Nov 26 09:29:58 CET 2010 - tiwai@suse.de
- don't install udev rule for 11.4, as it's provided in alsa-utils
now
-------------------------------------------------------------------
Wed Nov 24 06:24:00 CET 2010 - tiwai@suse.de
- Backport pending fixes from upstream:
0027-Version-check-libtool-correctly-when-doing-an-out-of.patch
0028-configure.in-don-t-rely-on-test-a-not-all-shells-sup.patch
0029-pcm-direct-plugins-change-timestamping-in-dsnoop.patch
0030-USB-Audio.conf-fix-Audiophile-USB-card-name.patch
0031-pcm-pass-hw_params-flags-to-slave.patch
0032-support-for-period-wakeup-disabling.patch
0033-pcm-fix-snd_pcm_avail_delay-function.patch
0034-pcm_plugin-remove-unused-client_frames-and-slave_fra.patch
0035-pcm-add-MMAP_EMUL-to-type-names.patch
0036-pcm_plugin-fix-delay.patch
-------------------------------------------------------------------
Mon Oct 25 09:33:37 CEST 2010 - tiwai@suse.de

View File

@ -78,6 +78,16 @@ Patch23: 0023-namehint-Fix-hw-device-evaluation-missing-last-devic.patch
Patch24: 0024-namehint-Another-fix-to-properly-evaluate-hw-devices.patch
Patch25: 0025-config-file-processing-rewrite-the-locking-use-one-r.patch
Patch26: 0026-tlv-fix-returned-dB-information-for-min-is-mute-cont.patch
Patch27: 0027-Version-check-libtool-correctly-when-doing-an-out-of.patch
Patch28: 0028-configure.in-don-t-rely-on-test-a-not-all-shells-sup.patch
Patch29: 0029-pcm-direct-plugins-change-timestamping-in-dsnoop.patch
Patch30: 0030-USB-Audio.conf-fix-Audiophile-USB-card-name.patch
Patch31: 0031-pcm-pass-hw_params-flags-to-slave.patch
Patch32: 0032-support-for-period-wakeup-disabling.patch
Patch33: 0033-pcm-fix-snd_pcm_avail_delay-function.patch
Patch34: 0034-pcm_plugin-remove-unused-client_frames-and-slave_fra.patch
Patch35: 0035-pcm-add-MMAP_EMUL-to-type-names.patch
Patch36: 0036-pcm_plugin-fix-delay.patch
Url: http://www.alsa-project.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -179,6 +189,16 @@ Authors:
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
%patch34 -p1
%patch35 -p1
%patch36 -p1
# hack to fix build on older distros
%if %suse_version < 1100
%ifarch %ix86
@ -233,10 +253,12 @@ ln -s ../../etc/init.d/alsasound $RPM_BUILD_ROOT%{_sbindir}/rcalsasound
rm -f $RPM_BUILD_ROOT%{_sbindir}/rcjoystick
ln -s ../../etc/init.d/joystick $RPM_BUILD_ROOT%{_sbindir}/rcjoystick
#
# udev rules
# udev rules (only for non-systemd)
#
%if %suse_version < 1140
mkdir -p $RPM_BUILD_ROOT/etc/udev/rules.d
install -c -m 0644 %{SOURCE8} $RPM_BUILD_ROOT/etc/udev/rules.d
%endif
#
# install template to update rc.config and sysconfig files:
# (updating the actual files is done in the %post-script)
@ -287,7 +309,9 @@ exit 0
/usr/lib/all_notes_off.*
%{_datadir}/sounds/alsa
/var/adm/fillup-templates/*
%if %suse_version < 1140
/etc/udev
%endif
%files devel
%defattr(-, root, root)