Accepting request 288089 from multimedia:libs

1

OBS-URL: https://build.opensuse.org/request/show/288089
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/alsa?expand=0&rev=160
This commit is contained in:
Dominique Leuenberger 2015-03-05 14:35:49 +00:00 committed by Git OBS Bridge
commit 3d85aae7ff
70 changed files with 79 additions and 5013 deletions

View File

@ -1,42 +0,0 @@
From 7a748af4db17cb0b26d19e5f9939d277128ec94b Mon Sep 17 00:00:00 2001
From: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Date: Thu, 26 Jun 2014 13:30:25 +0300
Subject: [PATCH 01/14] ucm: Document PlaybackPCMIsDummy and CapturePCMIsDummy
values
At least PulseAudio needs special handling for dummy devices. To allow
that to happen automatically, the UCM configuration should contain the
information about which PCMs are dummy.
Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/use-case.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/use-case.h b/include/use-case.h
index 4e13249133e6..f30168f86471 100644
--- a/include/use-case.h
+++ b/include/use-case.h
@@ -258,7 +258,17 @@ int snd_use_case_get_list(snd_use_case_mgr_t *uc_mgr,
* Recommended names for values:
* TQ - Tone Quality
* PlaybackPCM - full PCM playback device name
+ * PlaybackPCMIsDummy - Valid values: "yes" and "no". If set to "yes", the
+ * PCM named by the PlaybackPCM value is a dummy device,
+ * meaning that opening it enables an audio path in the
+ * hardware, but writing to the PCM device has no
+ * effect.
* CapturePCM - full PCM capture device name
+ * CapturePCMIsDummy - Valid values: "yes" and "no". If set to "yes", the
+ * PCM named by the CapturePCM value is a dummy device,
+ * meaning that opening it enables an audio path in the
+ * hardware, but reading from the PCM device has no
+ * effect.
* PlaybackRate - playback device sample rate
* PlaybackChannels - playback device channel count
* PlaybackCTL - playback control device name
--
2.0.1

View File

@ -1,58 +0,0 @@
From 27cc710b5784cb3ab68cff2a9d9daf9fa479149e Mon Sep 17 00:00:00 2001
From: "Alexander E. Patrakov" <patrakov@gmail.com>
Date: Tue, 1 Jul 2014 00:40:48 +0600
Subject: [PATCH 02/14] ICE1712: add surround71 pcm definition
The M-Audio Delta 1010 card has 7.1 analog output, but no ready-made pcm
definition to use it.
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Reported-and-tested-by: Matt Zagrabelny <mzagrabe@d.umn.edu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/conf/cards/ICE1712.conf | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/src/conf/cards/ICE1712.conf b/src/conf/cards/ICE1712.conf
index 398fa7ad5307..db62684e25f2 100644
--- a/src/conf/cards/ICE1712.conf
+++ b/src/conf/cards/ICE1712.conf
@@ -78,6 +78,7 @@ ICE1712.pcm.surround40.0 {
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
+<confdir:pcm/surround71.conf>
ICE1712.pcm.surround51.0 {
@args [ CARD ]
@@ -98,6 +99,27 @@ ICE1712.pcm.surround51.0 {
slave.channels 10
}
+ICE1712.pcm.surround71.0 {
+ @args [ CARD ]
+ @args.CARD {
+ type string
+ }
+ type route
+ ttable.0.0 1
+ ttable.1.1 1
+ ttable.2.2 1
+ ttable.3.3 1
+ ttable.4.4 1
+ ttable.5.5 1
+ ttable.6.6 1
+ ttable.7.7 1
+ slave.pcm {
+ type hw
+ card $CARD
+ }
+ slave.channels 10
+}
+
<confdir:pcm/iec958.conf>
ICE1712.pcm.iec958.0 {
--
2.0.1

View File

@ -1,84 +0,0 @@
From ea865bba4615d906144ae5d4f72a4aad2baffe1f Mon Sep 17 00:00:00 2001
From: Anssi Hannula <anssi.hannula@iki.fi>
Date: Tue, 8 Jul 2014 11:19:20 +0300
Subject: [PATCH 03/14] USB-Audio: Add second S/PDIF device on Phiree U2
Phiree U2 has an unusual configuration. It only has S/PDIF output, but
there are still two devices presented:
- device 0: PCM audio, subject to volume control
- device 1: non-PCM data (passthrough), not subject to volume control
It looks like the AES bits are set according to the selected device,
since outputting PCM data via device 1 will not work (silence).
Currently only the device 0 is shown via the "iec958" alias, and the
second device is not accessible via hinted aliases.
Simply provide access to both of these devices via the "iec958" alias.
Reported-by: touc @ XBMC forum
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/conf/cards/USB-Audio.conf | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/src/conf/cards/USB-Audio.conf b/src/conf/cards/USB-Audio.conf
index ce3ae019f7f6..77a48b9f5562 100644
--- a/src/conf/cards/USB-Audio.conf
+++ b/src/conf/cards/USB-Audio.conf
@@ -52,6 +52,11 @@ USB-Audio.pcm.iec958_device {
"USB Device 0x46d:0x992" 999
}
+# Second iec958 device number, if any.
+USB-Audio.pcm.iec958_2_device {
+ "PHIREE U2" 1 # 0 = PCM S/PDIF, 1 = non-PCM S/PDIF
+}
+
# If a device requires non-standard definitions for front, surround40,
# surround51, surround71 or iec958, they can be defined here.
@@ -422,4 +427,39 @@ USB-Audio.pcm.iec958.0 {
}
}
+USB-Audio.pcm.iec958.1 {
+ @args [ CARD AES0 AES1 AES2 AES3 ]
+ @args.CARD { type string }
+ @args.AES0 { type integer }
+ @args.AES1 { type integer }
+ @args.AES2 { type integer }
+ @args.AES3 { type integer }
+ @func refer
+ name {
+ @func concat
+ strings [
+ "cards.USB-Audio."
+ { @func card_name card $CARD }
+ ".pcm.iec958_2:CARD=" $CARD
+ ",AES0=" $AES0 ",AES1=" $AES1 ",AES2=" $AES2 ",AES3=" $AES3
+ ]
+ }
+ default {
+ # FIXME: we cannot set the AES parameters
+ type hw
+ card $CARD
+ device {
+ @func refer
+ name {
+ @func concat
+ strings [
+ "cards.USB-Audio.pcm.iec958_2_device."
+ { @func card_name card $CARD }
+ ]
+ }
+ default 999
+ }
+ }
+}
+
# vim: ft=alsaconf
--
2.0.1

View File

@ -1,30 +0,0 @@
From 035f196bcdc1e9903ed52ad1859dc23d3aa74e72 Mon Sep 17 00:00:00 2001
From: Shengjiu Wang <shengjiu.wang@freescale.com>
Date: Mon, 14 Jul 2014 16:55:48 +0800
Subject: [PATCH 04/14] pcm: rate: fix hw_ptr exceed the boundary
For long time test case, the hw_ptr will exceed the boundary, then cause
the avail size wrong.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_rate.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
index 7f667d4c6a52..2563d824ddb8 100644
--- a/src/pcm/pcm_rate.c
+++ b/src/pcm/pcm_rate.c
@@ -574,6 +574,8 @@ static inline void snd_pcm_rate_sync_hwptr(snd_pcm_t *pcm)
rate->hw_ptr =
(slave_hw_ptr / rate->gen.slave->period_size) * pcm->period_size +
rate->ops.input_frames(rate->obj, slave_hw_ptr % rate->gen.slave->period_size);
+
+ rate->hw_ptr %= pcm->boundary;
}
static int snd_pcm_rate_hwsync(snd_pcm_t *pcm)
--
2.0.1

View File

@ -1,37 +0,0 @@
From 85e4704151677b8fcc5ccfc396071828e9ec1b8e Mon Sep 17 00:00:00 2001
From: Mark Brown <broonie@linaro.org>
Date: Tue, 8 Jul 2014 16:52:32 +0200
Subject: [PATCH 05/14] pcm: Provide a CLOCK_MONOTONIC_RAW timestamp type
For applications which need to synchronise with external timebases such
as broadcast TV applications the kernel monotonic time is not optimal as
it includes adjustments from NTP and so may still include discontinuities
due to that. A raw monotonic time which does not include any adjustments
is available in the kernel from getrawmonotonic() so provide userspace with
a new timestamp type SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW which provides
timestamps based on this as an option.
Reported-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/sound/asound.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 1774a5c3ef10..9061cdd5b69f 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -457,7 +457,8 @@ struct snd_xfern {
enum {
SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */
SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */
- SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
+ SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW, /* monotonic_raw (no NTP) */
+ SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW,
};
/* channel positions */
--
2.0.1

View File

@ -1,41 +0,0 @@
From 5250a8e212fd927735cfc27612b060c31dc3a230 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Thu, 10 Jul 2014 14:22:33 +0200
Subject: [PATCH 06/14] Add timestamp type to sw_params (internal only)
This patch is just the udpate of sound/asound.h taken from the kernel
commit. The API changes and PCM structure changes will follow after
this.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/sound/asound.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 9061cdd5b69f..552f41bd1ca9 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -136,7 +136,7 @@ struct snd_hwdep_dsp_image {
* *
*****************************************************************************/
-#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 11)
+#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 12)
typedef unsigned long snd_pcm_uframes_t;
typedef signed long snd_pcm_sframes_t;
@@ -386,7 +386,9 @@ struct snd_pcm_sw_params {
snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */
snd_pcm_uframes_t silence_size; /* silence block size */
snd_pcm_uframes_t boundary; /* pointers wrap point */
- unsigned char reserved[64]; /* reserved for future */
+ unsigned int tstamp_type; /* timestamp type */
+ int pads; /* alignment, reserved */
+ unsigned char reserved[56]; /* reserved for future */
};
struct snd_pcm_channel_info {
--
2.0.1

View File

@ -1,181 +0,0 @@
From 0d393c29a272b6fc97e9fca3252fb1c58f86e75b Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Thu, 10 Jul 2014 14:26:37 +0200
Subject: [PATCH 07/14] pcm: Add sw_params API functions to get/set timestamp
type
For obtaining / changing the timestamp type, add the corresponding
sw_params accessor API functions together with the public definitions
of timestamp types.
This patch only adds the functions and defines but doesn't bring the
functional changes yet.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/pcm.h | 9 +++++++++
src/pcm/pcm.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++
src/pcm/pcm_local.h | 1 +
src/pcm/pcm_params.c | 1 +
4 files changed, 64 insertions(+)
diff --git a/include/pcm.h b/include/pcm.h
index 95b8aed6de2a..11e9f0dfba13 100644
--- a/include/pcm.h
+++ b/include/pcm.h
@@ -317,6 +317,13 @@ typedef enum _snd_pcm_tstamp {
SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_ENABLE
} snd_pcm_tstamp_t;
+typedef enum _snd_pcm_tstamp_type {
+ SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /** gettimeofday equivalent */
+ SND_PCM_TSTAMP_TYPE_MONOTONIC, /** posix_clock_monotonic equivalent */
+ SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW, /** monotonic_raw (no NTP) */
+ SND_PCM_TSTAMP_TYPE_LAST = SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW,
+} snd_pcm_tstamp_type_t;
+
/** Unsigned frames quantity */
typedef unsigned long snd_pcm_uframes_t;
/** Signed frames quantity */
@@ -844,6 +851,8 @@ int snd_pcm_sw_params_get_boundary(const snd_pcm_sw_params_t *params, snd_pcm_uf
int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val);
int snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_t *val);
+int snd_pcm_sw_params_set_tstamp_type(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_type_t val);
+int snd_pcm_sw_params_get_tstamp_type(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_type_t *val);
int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
int snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val);
int snd_pcm_sw_params_set_period_event(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, int val);
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index 7e46014627c2..89844430bf35 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -1483,6 +1483,7 @@ int snd_pcm_poll_descriptors_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsign
#define XRUN(v) [SND_PCM_XRUN_##v] = #v
#define SILENCE(v) [SND_PCM_SILENCE_##v] = #v
#define TSTAMP(v) [SND_PCM_TSTAMP_##v] = #v
+#define TSTAMP_TYPE(v) [SND_PCM_TSTAMP_TYPE_##v] = #v
#define ACCESS(v) [SND_PCM_ACCESS_##v] = #v
#define START(v) [SND_PCM_START_##v] = #v
#define HW_PARAM(v) [SND_PCM_HW_PARAM_##v] = #v
@@ -1680,6 +1681,12 @@ static const char *const snd_pcm_tstamp_mode_names[] = {
TSTAMP(NONE),
TSTAMP(ENABLE),
};
+
+static const char *const snd_pcm_tstamp_type_names[] = {
+ TSTAMP_TYPE(GETTIMEOFDAY),
+ TSTAMP_TYPE(MONOTONIC),
+ TSTAMP_TYPE(MONOTONIC_RAW),
+};
#endif
/**
@@ -1826,6 +1833,18 @@ const char *snd_pcm_tstamp_mode_name(snd_pcm_tstamp_t mode)
}
/**
+ * \brief get name of PCM tstamp type setting
+ * \param mode PCM tstamp type
+ * \return ascii name of PCM tstamp type setting
+ */
+const char *snd_pcm_tstamp_type_name(snd_pcm_tstamp_t type)
+{
+ if (type > SND_PCM_TSTAMP_TYPE_LAST)
+ return NULL;
+ return snd_pcm_tstamp_type_names[type];
+}
+
+/**
* \brief get name of PCM state
* \param state PCM state
* \return ascii name of PCM state
@@ -1899,6 +1918,7 @@ int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out)
return -EIO;
}
snd_output_printf(out, " tstamp_mode : %s\n", snd_pcm_tstamp_mode_name(pcm->tstamp_mode));
+ snd_output_printf(out, " tstamp_type : %s\n", snd_pcm_tstamp_type_name(pcm->tstamp_mode));
snd_output_printf(out, " period_step : %d\n", pcm->period_step);
snd_output_printf(out, " avail_min : %ld\n", pcm->avail_min);
snd_output_printf(out, " period_event : %i\n", pcm->period_event);
@@ -5591,6 +5611,7 @@ int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
return -EIO;
}
params->tstamp_mode = pcm->tstamp_mode;
+ params->tstamp_type = pcm->tstamp_type;
params->period_step = pcm->period_step;
params->sleep_min = 0;
params->avail_min = pcm->avail_min;
@@ -5613,6 +5634,7 @@ int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out)
{
snd_output_printf(out, "tstamp_mode: %s\n", snd_pcm_tstamp_mode_name(params->tstamp_mode));
+ snd_output_printf(out, "tstamp_type: %s\n", snd_pcm_tstamp_type_name(params->tstamp_type));
snd_output_printf(out, "period_step: %u\n", params->period_step);
snd_output_printf(out, "avail_min: %lu\n", params->avail_min);
snd_output_printf(out, "start_threshold: %ld\n", params->start_threshold);
@@ -5811,6 +5833,37 @@ int snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params, snd_pcm
}
/**
+ * \brief Set timestamp type inside a software configuration container
+ * \param pcm PCM handle
+ * \param params Software configuration container
+ * \param val Timestamp type
+ * \return 0 otherwise a negative error code
+ */
+int snd_pcm_sw_params_set_tstamp_type(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_type_t val)
+{
+ assert(pcm && params);
+ if (CHECK_SANITY(val > SND_PCM_TSTAMP_TYPE_LAST)) {
+ SNDMSG("invalid tstamp_type value %d", val);
+ return -EINVAL;
+ }
+ params->tstamp_type = val;
+ return 0;
+}
+
+/**
+ * \brief Get timestamp type from a software configuration container
+ * \param params Software configuration container
+ * \param val Returned timestamp type
+ * \return 0 otherwise a negative error code
+ */
+int snd_pcm_sw_params_get_tstamp_type(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_type_t *val)
+{
+ assert(params && val);
+ *val = params->tstamp_type;
+ return 0;
+}
+
+/**
* \brief (DEPRECATED) Set minimum number of ticks to sleep inside a software configuration container
* \param pcm PCM handle
* \param params Software configuration container
diff --git a/src/pcm/pcm_local.h b/src/pcm/pcm_local.h
index 8a6c7431cc40..3ed7e1a88792 100644
--- a/src/pcm/pcm_local.h
+++ b/src/pcm/pcm_local.h
@@ -202,6 +202,7 @@ struct _snd_pcm {
unsigned int period_time; /* period duration */
snd_interval_t periods;
snd_pcm_tstamp_t tstamp_mode; /* timestamp mode */
+ snd_pcm_tstamp_type_t tstamp_type; /* timestamp type */
unsigned int period_step;
snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */
int period_event;
diff --git a/src/pcm/pcm_params.c b/src/pcm/pcm_params.c
index 0b66e8cbbe64..4adbefae0530 100644
--- a/src/pcm/pcm_params.c
+++ b/src/pcm/pcm_params.c
@@ -2258,6 +2258,7 @@ static int snd_pcm_sw_params_default(snd_pcm_t *pcm, snd_pcm_sw_params_t *params
assert(pcm && params);
assert(pcm->setup);
params->tstamp_mode = SND_PCM_TSTAMP_NONE;
+ params->tstamp_type = pcm->tstamp_type;
params->period_step = 1;
params->sleep_min = 0;
params->avail_min = pcm->period_size;
--
2.0.1

View File

@ -1,113 +0,0 @@
From 9b716075de4f2f7f15e428ee7efaa8960ef45b9c Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Thu, 10 Jul 2014 14:32:50 +0200
Subject: [PATCH 08/14] pcm: Implement timestamp type setup in hw plugin
This patch implements the support for sw_params timestamp type in PCM
hw layer. As gettimestamp() is still unchanged, the resultant
timstamps may be still with CLOCK_MONOTONIC even if you pass monotonic
raw type. More fixes will follow.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_hw.c | 37 ++++++++++++++++++++++++++++++++-----
1 file changed, 32 insertions(+), 5 deletions(-)
diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
index ed8319728130..bafa8debeb0b 100644
--- a/src/pcm/pcm_hw.c
+++ b/src/pcm/pcm_hw.c
@@ -304,7 +304,8 @@ static int snd_pcm_hw_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
if (params->info != ~0U) {
params->info &= ~0xf0000000;
- params->info |= (pcm->monotonic ? SND_PCM_INFO_MONOTONIC : 0);
+ if (pcm->tstamp_type != SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY)
+ params->info |= SND_PCM_INFO_MONOTONIC;
}
return 0;
@@ -328,7 +329,8 @@ static int snd_pcm_hw_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
return err;
}
params->info &= ~0xf0000000;
- params->info |= (pcm->monotonic ? SND_PCM_INFO_MONOTONIC : 0);
+ if (pcm->tstamp_type != SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY)
+ params->info |= SND_PCM_INFO_MONOTONIC;
err = sync_ptr(hw, 0);
if (err < 0)
return err;
@@ -435,6 +437,7 @@ static int snd_pcm_hw_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t * params)
int old_period_event = sw_get_period_event(params);
sw_set_period_event(params, 0);
if ((snd_pcm_tstamp_t) params->tstamp_mode == pcm->tstamp_mode &&
+ (snd_pcm_tstamp_type_t) params->tstamp_type == pcm->tstamp_type &&
params->period_step == pcm->period_step &&
params->start_threshold == pcm->start_threshold &&
params->stop_threshold == pcm->stop_threshold &&
@@ -444,11 +447,33 @@ static int snd_pcm_hw_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t * params)
hw->mmap_control->avail_min = params->avail_min;
return sync_ptr(hw, 0);
}
+ if (params->tstamp_type == SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW &&
+ hw->version < SNDRV_PROTOCOL_VERSION(2, 0, 12)) {
+ SYSMSG("Kernel doesn't support SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW");
+ return -EINVAL;
+ }
+ if (params->tstamp_type == SND_PCM_TSTAMP_TYPE_MONOTONIC &&
+ hw->version < SNDRV_PROTOCOL_VERSION(2, 0, 5)) {
+ SYSMSG("Kernel doesn't support SND_PCM_TSTAMP_TYPE_MONOTONIC");
+ return -EINVAL;
+ }
if (ioctl(fd, SNDRV_PCM_IOCTL_SW_PARAMS, params) < 0) {
err = -errno;
SYSMSG("SNDRV_PCM_IOCTL_SW_PARAMS failed (%i)", err);
return err;
}
+ if ((snd_pcm_tstamp_type_t) params->tstamp_type != pcm->tstamp_type) {
+ if (hw->version < SNDRV_PROTOCOL_VERSION(2, 0, 12)) {
+ int on = (snd_pcm_tstamp_type_t) params->tstamp_type ==
+ SND_PCM_TSTAMP_TYPE_MONOTONIC;
+ if (ioctl(fd, SNDRV_PCM_IOCTL_TSTAMP, &on) < 0) {
+ err = -errno;
+ SNDMSG("TSTAMP failed\n");
+ return err;
+ }
+ }
+ pcm->tstamp_type = params->tstamp_type;
+ }
sw_set_period_event(params, old_period_event);
hw->mmap_control->avail_min = params->avail_min;
if (hw->period_event != old_period_event) {
@@ -1381,7 +1406,8 @@ int snd_pcm_hw_open_fd(snd_pcm_t **pcmp, const char *name,
int fd, int mmap_emulation ATTRIBUTE_UNUSED,
int sync_ptr_ioctl)
{
- int ver, mode, monotonic = 0;
+ int ver, mode;
+ snd_pcm_tstamp_type_t tstamp_type = SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY;
long fmode;
snd_pcm_t *pcm = NULL;
snd_pcm_hw_t *hw = NULL;
@@ -1429,7 +1455,7 @@ int snd_pcm_hw_open_fd(snd_pcm_t **pcmp, const char *name,
SNDMSG("TTSTAMP failed\n");
return ret;
}
- monotonic = 1;
+ tstamp_type = SND_PCM_TSTAMP_TYPE_MONOTONIC;
}
} else
#endif
@@ -1471,7 +1497,8 @@ int snd_pcm_hw_open_fd(snd_pcm_t **pcmp, const char *name,
pcm->private_data = hw;
pcm->poll_fd = fd;
pcm->poll_events = info.stream == SND_PCM_STREAM_PLAYBACK ? POLLOUT : POLLIN;
- pcm->monotonic = monotonic;
+ pcm->tstamp_type = tstamp_type;
+ pcm->monotonic = tstamp_type != SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY;
ret = snd_pcm_hw_mmap_status(pcm);
if (ret < 0) {
--
2.0.1

View File

@ -1,602 +0,0 @@
From 65ff6fdafb705b5e2e6d4b9a94a80e5de89f5de1 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Thu, 10 Jul 2014 14:37:49 +0200
Subject: [PATCH 09/14] pcm: Implement timestamp type handling in all plugins
Now all PCM plugins do support the proper timestamp type or pass it
over slaves. The internal monotonic flag is dropped and replaced with
tstamp_type in all places.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_adpcm.c | 2 +-
src/pcm/pcm_alaw.c | 2 +-
src/pcm/pcm_copy.c | 2 +-
src/pcm/pcm_direct.c | 4 ++--
src/pcm/pcm_direct.h | 2 +-
src/pcm/pcm_dmix.c | 8 ++++----
src/pcm/pcm_dshare.c | 8 ++++----
src/pcm/pcm_dsnoop.c | 4 ++--
src/pcm/pcm_file.c | 6 +++---
src/pcm/pcm_generic.c | 2 +-
src/pcm/pcm_hooks.c | 2 +-
src/pcm/pcm_hw.c | 1 -
src/pcm/pcm_iec958.c | 2 +-
src/pcm/pcm_ioplug.c | 9 ++++++---
src/pcm/pcm_ladspa.c | 2 +-
src/pcm/pcm_lfloat.c | 2 +-
src/pcm/pcm_linear.c | 2 +-
src/pcm/pcm_local.h | 45 +++++++++++++++++++++++++++++----------------
src/pcm/pcm_meter.c | 2 +-
src/pcm/pcm_mmap_emul.c | 2 +-
src/pcm/pcm_mulaw.c | 2 +-
src/pcm/pcm_multi.c | 2 +-
src/pcm/pcm_null.c | 2 +-
src/pcm/pcm_plug.c | 2 +-
src/pcm/pcm_rate.c | 4 ++--
src/pcm/pcm_route.c | 2 +-
src/pcm/pcm_share.c | 6 +++---
src/pcm/pcm_softvol.c | 2 +-
28 files changed, 73 insertions(+), 58 deletions(-)
diff --git a/src/pcm/pcm_adpcm.c b/src/pcm/pcm_adpcm.c
index 6f0e7c4cc631..1a83c5a0e21c 100644
--- a/src/pcm/pcm_adpcm.c
+++ b/src/pcm/pcm_adpcm.c
@@ -579,7 +579,7 @@ int snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sfor
pcm->private_data = adpcm;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &adpcm->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &adpcm->plug.appl_ptr, -1, 0);
*pcmp = pcm;
diff --git a/src/pcm/pcm_alaw.c b/src/pcm/pcm_alaw.c
index 1b1bab83c944..db759e3effa4 100644
--- a/src/pcm/pcm_alaw.c
+++ b/src/pcm/pcm_alaw.c
@@ -453,7 +453,7 @@ int snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sform
pcm->private_data = alaw;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &alaw->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &alaw->plug.appl_ptr, -1, 0);
*pcmp = pcm;
diff --git a/src/pcm/pcm_copy.c b/src/pcm/pcm_copy.c
index 56a1f6bcc912..66d3a4719856 100644
--- a/src/pcm/pcm_copy.c
+++ b/src/pcm/pcm_copy.c
@@ -209,7 +209,7 @@ int snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name, snd_pcm_t *slave, int
pcm->private_data = copy;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &copy->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &copy->plug.appl_ptr, -1, 0);
*pcmp = pcm;
diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c
index 5416cf71674c..8e37bcba5e19 100644
--- a/src/pcm/pcm_direct.c
+++ b/src/pcm/pcm_direct.c
@@ -840,6 +840,7 @@ static void save_slave_setting(snd_pcm_direct_t *dmix, snd_pcm_t *spcm)
COPY_SLAVE(period_time);
COPY_SLAVE(periods);
COPY_SLAVE(tstamp_mode);
+ COPY_SLAVE(tstamp_type);
COPY_SLAVE(period_step);
COPY_SLAVE(avail_min);
COPY_SLAVE(start_threshold);
@@ -857,7 +858,6 @@ static void save_slave_setting(snd_pcm_direct_t *dmix, snd_pcm_t *spcm)
COPY_SLAVE(buffer_time);
COPY_SLAVE(sample_bits);
COPY_SLAVE(frame_bits);
- COPY_SLAVE(monotonic);
}
#undef COPY_SLAVE
@@ -1204,6 +1204,7 @@ static void copy_slave_setting(snd_pcm_direct_t *dmix, snd_pcm_t *spcm)
COPY_SLAVE(period_time);
COPY_SLAVE(periods);
COPY_SLAVE(tstamp_mode);
+ COPY_SLAVE(tstamp_type);
COPY_SLAVE(period_step);
COPY_SLAVE(avail_min);
COPY_SLAVE(start_threshold);
@@ -1221,7 +1222,6 @@ static void copy_slave_setting(snd_pcm_direct_t *dmix, snd_pcm_t *spcm)
COPY_SLAVE(buffer_time);
COPY_SLAVE(sample_bits);
COPY_SLAVE(frame_bits);
- COPY_SLAVE(monotonic);
spcm->info &= ~SND_PCM_INFO_PAUSE;
spcm->boundary = recalc_boundary_size(dmix->shmptr->s.boundary, spcm->buffer_size);
diff --git a/src/pcm/pcm_direct.h b/src/pcm/pcm_direct.h
index 5ae39c0e4237..9b1ddbcf424a 100644
--- a/src/pcm/pcm_direct.h
+++ b/src/pcm/pcm_direct.h
@@ -85,8 +85,8 @@ typedef struct {
unsigned int period_size;
unsigned int period_time;
snd_interval_t periods;
- unsigned int monotonic;
snd_pcm_tstamp_t tstamp_mode;
+ snd_pcm_tstamp_type_t tstamp_type;
unsigned int period_step;
unsigned int sleep_min; /* not used */
unsigned int avail_min;
diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c
index 4aa6d4eab4a2..7c535093ea0f 100644
--- a/src/pcm/pcm_dmix.c
+++ b/src/pcm/pcm_dmix.c
@@ -428,7 +428,7 @@ static int snd_pcm_dmix_sync_ptr(snd_pcm_t *pcm)
dmix->avail_max = avail;
if (avail >= pcm->stop_threshold) {
snd_timer_stop(dmix->timer);
- gettimestamp(&dmix->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&dmix->trigger_tstamp, pcm->tstamp_type);
if (dmix->state == SND_PCM_STATE_RUNNING) {
dmix->state = SND_PCM_STATE_XRUN;
return -EPIPE;
@@ -477,7 +477,7 @@ static int snd_pcm_dmix_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
memset(status, 0, sizeof(*status));
status->state = snd_pcm_dmix_state(pcm);
status->trigger_tstamp = dmix->trigger_tstamp;
- gettimestamp(&status->tstamp, pcm->monotonic);
+ gettimestamp(&status->tstamp, pcm->tstamp_type);
status->avail = snd_pcm_mmap_playback_avail(pcm);
status->avail_max = status->avail > dmix->avail_max ? status->avail : dmix->avail_max;
dmix->avail_max = 0;
@@ -596,7 +596,7 @@ static int snd_pcm_dmix_start(snd_pcm_t *pcm)
return err;
snd_pcm_dmix_sync_area(pcm);
}
- gettimestamp(&dmix->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&dmix->trigger_tstamp, pcm->tstamp_type);
return 0;
}
@@ -1104,7 +1104,7 @@ int snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name,
pcm->poll_fd = dmix->poll_fd;
pcm->poll_events = POLLIN; /* it's different than other plugins */
- pcm->monotonic = spcm->monotonic;
+ pcm->tstamp_type = spcm->tstamp_type;
pcm->mmap_rw = 1;
snd_pcm_set_hw_ptr(pcm, &dmix->hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &dmix->appl_ptr, -1, 0);
diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c
index f2d1103a6bfb..b985172825e7 100644
--- a/src/pcm/pcm_dshare.c
+++ b/src/pcm/pcm_dshare.c
@@ -195,7 +195,7 @@ static int snd_pcm_dshare_sync_ptr(snd_pcm_t *pcm)
dshare->avail_max = avail;
if (avail >= pcm->stop_threshold) {
snd_timer_stop(dshare->timer);
- gettimestamp(&dshare->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&dshare->trigger_tstamp, pcm->tstamp_type);
if (dshare->state == SND_PCM_STATE_RUNNING) {
dshare->state = SND_PCM_STATE_XRUN;
return -EPIPE;
@@ -226,7 +226,7 @@ static int snd_pcm_dshare_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
memset(status, 0, sizeof(*status));
status->state = snd_pcm_state(dshare->spcm);
status->trigger_tstamp = dshare->trigger_tstamp;
- gettimestamp(&status->tstamp, pcm->monotonic);
+ gettimestamp(&status->tstamp, pcm->tstamp_type);
status->avail = snd_pcm_mmap_playback_avail(pcm);
status->avail_max = status->avail > dshare->avail_max ? status->avail : dshare->avail_max;
dshare->avail_max = 0;
@@ -346,7 +346,7 @@ static int snd_pcm_dshare_start(snd_pcm_t *pcm)
return err;
snd_pcm_dshare_sync_area(pcm);
}
- gettimestamp(&dshare->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&dshare->trigger_tstamp, pcm->tstamp_type);
return 0;
}
@@ -792,7 +792,7 @@ int snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name,
pcm->poll_fd = dshare->poll_fd;
pcm->poll_events = POLLIN; /* it's different than other plugins */
- pcm->monotonic = spcm->monotonic;
+ pcm->tstamp_type = spcm->tstamp_type;
pcm->mmap_rw = 1;
snd_pcm_set_hw_ptr(pcm, &dshare->hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &dshare->appl_ptr, -1, 0);
diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c
index 76379140c133..0f9c9df481bc 100644
--- a/src/pcm/pcm_dsnoop.c
+++ b/src/pcm/pcm_dsnoop.c
@@ -159,7 +159,7 @@ static int snd_pcm_dsnoop_sync_ptr(snd_pcm_t *pcm)
if (pcm->stop_threshold >= pcm->boundary) /* don't care */
return 0;
if ((avail = snd_pcm_mmap_capture_hw_avail(pcm)) >= pcm->stop_threshold) {
- gettimestamp(&dsnoop->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&dsnoop->trigger_tstamp, pcm->tstamp_type);
dsnoop->state = SND_PCM_STATE_XRUN;
dsnoop->avail_max = avail;
return -EPIPE;
@@ -690,7 +690,7 @@ int snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name,
pcm->poll_fd = dsnoop->poll_fd;
pcm->poll_events = POLLIN; /* it's different than other plugins */
- pcm->monotonic = spcm->monotonic;
+ pcm->tstamp_type = spcm->tstamp_type;
pcm->mmap_rw = 1;
snd_pcm_set_hw_ptr(pcm, &dsnoop->hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &dsnoop->appl_ptr, -1, 0);
diff --git a/src/pcm/pcm_file.c b/src/pcm/pcm_file.c
index b139f7f24dc3..a0b8bf41bf5b 100644
--- a/src/pcm/pcm_file.c
+++ b/src/pcm/pcm_file.c
@@ -781,10 +781,10 @@ int snd_pcm_file_open(snd_pcm_t **pcmp, const char *name,
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
pcm->mmap_shadow = 1;
+ pcm->tstamp_type = SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY;
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
- pcm->monotonic = clock_gettime(CLOCK_MONOTONIC, &timespec) == 0;
-#else
- pcm->monotonic = 0;
+ if (clock_gettime(CLOCK_MONOTONIC, &timespec) == 0)
+ pcm->tstamp_type = SND_PCM_TSTAMP_TYPE_MONOTONIC;
#endif
pcm->stream = stream;
snd_pcm_link_hw_ptr(pcm, slave);
diff --git a/src/pcm/pcm_generic.c b/src/pcm/pcm_generic.c
index f068ee2585bc..9b605911f868 100644
--- a/src/pcm/pcm_generic.c
+++ b/src/pcm/pcm_generic.c
@@ -294,7 +294,7 @@ int snd_pcm_generic_real_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail,
if (ok && (snd_pcm_uframes_t)avail1 == *avail)
break;
*avail = avail1;
- gettimestamp(tstamp, pcm->monotonic);
+ gettimestamp(tstamp, pcm->tstamp_type);
ok = 1;
}
return 0;
diff --git a/src/pcm/pcm_hooks.c b/src/pcm/pcm_hooks.c
index f83728245ecd..0b93c641daaa 100644
--- a/src/pcm/pcm_hooks.c
+++ b/src/pcm/pcm_hooks.c
@@ -240,7 +240,7 @@ int snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name, snd_pcm_t *slave, int
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
pcm->mmap_shadow = 1;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_link_hw_ptr(pcm, slave);
snd_pcm_link_appl_ptr(pcm, slave);
*pcmp = pcm;
diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
index bafa8debeb0b..74cff672a0c1 100644
--- a/src/pcm/pcm_hw.c
+++ b/src/pcm/pcm_hw.c
@@ -1498,7 +1498,6 @@ int snd_pcm_hw_open_fd(snd_pcm_t **pcmp, const char *name,
pcm->poll_fd = fd;
pcm->poll_events = info.stream == SND_PCM_STREAM_PLAYBACK ? POLLOUT : POLLIN;
pcm->tstamp_type = tstamp_type;
- pcm->monotonic = tstamp_type != SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY;
ret = snd_pcm_hw_mmap_status(pcm);
if (ret < 0) {
diff --git a/src/pcm/pcm_iec958.c b/src/pcm/pcm_iec958.c
index 0c61fc17995b..38c4ce7e2421 100644
--- a/src/pcm/pcm_iec958.c
+++ b/src/pcm/pcm_iec958.c
@@ -534,7 +534,7 @@ int snd_pcm_iec958_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sfo
pcm->private_data = iec;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &iec->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &iec->plug.appl_ptr, -1, 0);
*pcmp = pcm;
diff --git a/src/pcm/pcm_ioplug.c b/src/pcm/pcm_ioplug.c
index c1c3a9835d47..85a88911eafc 100644
--- a/src/pcm/pcm_ioplug.c
+++ b/src/pcm/pcm_ioplug.c
@@ -448,7 +448,7 @@ static int snd_pcm_ioplug_start(snd_pcm_t *pcm)
if (err < 0)
return err;
- gettimestamp(&io->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&io->trigger_tstamp, pcm->tstamp_type);
io->data->state = SND_PCM_STATE_RUNNING;
return 0;
@@ -463,7 +463,7 @@ static int snd_pcm_ioplug_drop(snd_pcm_t *pcm)
io->data->callback->stop(io->data);
- gettimestamp(&io->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&io->trigger_tstamp, pcm->tstamp_type);
io->data->state = SND_PCM_STATE_SETUP;
return 0;
@@ -1069,7 +1069,10 @@ int snd_pcm_ioplug_reinit_status(snd_pcm_ioplug_t *ioplug)
{
ioplug->pcm->poll_fd = ioplug->poll_fd;
ioplug->pcm->poll_events = ioplug->poll_events;
- ioplug->pcm->monotonic = (ioplug->flags & SND_PCM_IOPLUG_FLAG_MONOTONIC) != 0;
+ if (ioplug->flags & SND_PCM_IOPLUG_FLAG_MONOTONIC)
+ ioplug->pcm->tstamp_type = SND_PCM_TSTAMP_TYPE_MONOTONIC;
+ else
+ ioplug->pcm->tstamp_type = SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY;
ioplug->pcm->mmap_rw = ioplug->mmap_rw;
return 0;
}
diff --git a/src/pcm/pcm_ladspa.c b/src/pcm/pcm_ladspa.c
index 7d1e3df878b0..631ee0f35b73 100644
--- a/src/pcm/pcm_ladspa.c
+++ b/src/pcm/pcm_ladspa.c
@@ -1641,7 +1641,7 @@ int snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name,
pcm->private_data = ladspa;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &ladspa->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &ladspa->plug.appl_ptr, -1, 0);
*pcmp = pcm;
diff --git a/src/pcm/pcm_lfloat.c b/src/pcm/pcm_lfloat.c
index bbf72c274222..324282f0b7fc 100644
--- a/src/pcm/pcm_lfloat.c
+++ b/src/pcm/pcm_lfloat.c
@@ -412,7 +412,7 @@ int snd_pcm_lfloat_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sfo
pcm->private_data = lfloat;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &lfloat->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &lfloat->plug.appl_ptr, -1, 0);
*pcmp = pcm;
diff --git a/src/pcm/pcm_linear.c b/src/pcm/pcm_linear.c
index 7aa894185444..3d5bbb8a3688 100644
--- a/src/pcm/pcm_linear.c
+++ b/src/pcm/pcm_linear.c
@@ -484,7 +484,7 @@ int snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sfo
pcm->private_data = linear;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &linear->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &linear->plug.appl_ptr, -1, 0);
*pcmp = pcm;
diff --git a/src/pcm/pcm_local.h b/src/pcm/pcm_local.h
index 3ed7e1a88792..2206afe2c4a9 100644
--- a/src/pcm/pcm_local.h
+++ b/src/pcm/pcm_local.h
@@ -191,7 +191,6 @@ struct _snd_pcm {
int poll_fd;
unsigned short poll_events;
int setup: 1,
- monotonic: 1,
compat: 1;
snd_pcm_access_t access; /* access mode */
snd_pcm_format_t format; /* SND_PCM_FORMAT_* */
@@ -960,26 +959,40 @@ typedef union snd_tmp_double {
} snd_tmp_double_t;
/* get the current timestamp */
-static inline void gettimestamp(snd_htimestamp_t *tstamp, int monotonic)
+#ifdef HAVE_CLOCK_GETTIME
+static inline void gettimestamp(snd_htimestamp_t *tstamp,
+ snd_pcm_tstamp_type_t tstamp_type)
{
-#if defined(HAVE_CLOCK_GETTIME)
-#if defined(CLOCK_MONOTONIC)
- if (monotonic) {
- clock_gettime(CLOCK_MONOTONIC, tstamp);
- } else {
-#endif
- clock_gettime(CLOCK_REALTIME, tstamp);
-#else
- struct timeval tv;
+ clockid_t id;
- gettimeofday(&tv, 0);
- tstamp->tv_sec = tv.tv_sec;
- tstamp->tv_nsec = tv.tv_usec * 1000L;
+ switch (tstamp_type) {
+#ifdef CLOCK_MONOTONIC_RAW
+ case SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW:
+ id = CLOCK_MONOTONIC_RAW;
+ break;
#endif
-#if defined(HAVE_CLOCK_GETTIME)
- }
+#ifdef CLOCK_MONOTONIC
+ case SND_PCM_TSTAMP_TYPE_MONOTONIC:
+ id = CLOCK_MONOTONIC;
+ break;
#endif
+ default:
+ id = CLOCK_REALTIME;
+ break;
+ }
+ clock_gettime(id, tstamp);
+}
+#else /* HAVE_CLOCK_GETTIME */
+static inline void gettimestamp(snd_htimestamp_t *tstamp,
+ snd_pcm_tstamp_type_t tstamp_type)
+{
+ struct timeval tv;
+
+ gettimeofday(&tv, 0);
+ tstamp->tv_sec = tv.tv_sec;
+ tstamp->tv_nsec = tv.tv_usec * 1000L;
}
+#endif /* HAVE_CLOCK_GETTIME */
snd_pcm_chmap_query_t **
_snd_pcm_make_single_query_chmaps(const snd_pcm_chmap_t *src);
diff --git a/src/pcm/pcm_meter.c b/src/pcm/pcm_meter.c
index 676fbef89c30..034f582564a8 100644
--- a/src/pcm/pcm_meter.c
+++ b/src/pcm/pcm_meter.c
@@ -591,7 +591,7 @@ int snd_pcm_meter_open(snd_pcm_t **pcmp, const char *name, unsigned int frequenc
pcm->private_data = meter;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_link_hw_ptr(pcm, slave);
snd_pcm_link_appl_ptr(pcm, slave);
*pcmp = pcm;
diff --git a/src/pcm/pcm_mmap_emul.c b/src/pcm/pcm_mmap_emul.c
index 63789bc07c1b..b2b15efd07d9 100644
--- a/src/pcm/pcm_mmap_emul.c
+++ b/src/pcm/pcm_mmap_emul.c
@@ -428,7 +428,7 @@ int __snd_pcm_mmap_emul_open(snd_pcm_t **pcmp, const char *name,
pcm->private_data = map;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &map->hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &map->appl_ptr, -1, 0);
*pcmp = pcm;
diff --git a/src/pcm/pcm_mulaw.c b/src/pcm/pcm_mulaw.c
index 7adce38e9f48..011b2a516be0 100644
--- a/src/pcm/pcm_mulaw.c
+++ b/src/pcm/pcm_mulaw.c
@@ -467,7 +467,7 @@ int snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name, snd_pcm_format_t sfor
pcm->private_data = mulaw;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &mulaw->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &mulaw->plug.appl_ptr, -1, 0);
*pcmp = pcm;
diff --git a/src/pcm/pcm_multi.c b/src/pcm/pcm_multi.c
index a84e0ce48c59..4b8299ed6bcd 100644
--- a/src/pcm/pcm_multi.c
+++ b/src/pcm/pcm_multi.c
@@ -1077,7 +1077,7 @@ int snd_pcm_multi_open(snd_pcm_t **pcmp, const char *name,
pcm->private_data = multi;
pcm->poll_fd = multi->slaves[master_slave].pcm->poll_fd;
pcm->poll_events = multi->slaves[master_slave].pcm->poll_events;
- pcm->monotonic = multi->slaves[master_slave].pcm->monotonic;
+ pcm->tstamp_type = multi->slaves[master_slave].pcm->tstamp_type;
snd_pcm_link_hw_ptr(pcm, multi->slaves[master_slave].pcm);
snd_pcm_link_appl_ptr(pcm, multi->slaves[master_slave].pcm);
*pcmp = pcm;
diff --git a/src/pcm/pcm_null.c b/src/pcm/pcm_null.c
index 655261f74e1f..f11a1020f7e3 100644
--- a/src/pcm/pcm_null.c
+++ b/src/pcm/pcm_null.c
@@ -100,7 +100,7 @@ static int snd_pcm_null_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
memset(status, 0, sizeof(*status));
status->state = null->state;
status->trigger_tstamp = null->trigger_tstamp;
- gettimestamp(&status->tstamp, pcm->monotonic);
+ gettimestamp(&status->tstamp, pcm->tstamp_type);
status->avail = snd_pcm_null_avail_update(pcm);
status->avail_max = pcm->buffer_size;
return 0;
diff --git a/src/pcm/pcm_plug.c b/src/pcm/pcm_plug.c
index 7a6c2b99c639..5639b9ea8044 100644
--- a/src/pcm/pcm_plug.c
+++ b/src/pcm/pcm_plug.c
@@ -1127,7 +1127,7 @@ int snd_pcm_plug_open(snd_pcm_t **pcmp,
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
pcm->mmap_shadow = 1;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_link_hw_ptr(pcm, slave);
snd_pcm_link_appl_ptr(pcm, slave);
*pcmp = pcm;
diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
index 2563d824ddb8..5e811bb7192a 100644
--- a/src/pcm/pcm_rate.c
+++ b/src/pcm/pcm_rate.c
@@ -1069,7 +1069,7 @@ static int snd_pcm_rate_start(snd_pcm_t *pcm)
if (snd_pcm_state(rate->gen.slave) != SND_PCM_STATE_PREPARED)
return -EBADFD;
- gettimestamp(&rate->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&rate->trigger_tstamp, pcm->tstamp_type);
avail = snd_pcm_mmap_playback_hw_avail(rate->gen.slave);
if (avail == 0) {
@@ -1372,7 +1372,7 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
pcm->mmap_rw = 1;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &rate->hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &rate->appl_ptr, -1, 0);
*pcmp = pcm;
diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c
index 751e36f28fdf..2f0be38b1906 100644
--- a/src/pcm/pcm_route.c
+++ b/src/pcm/pcm_route.c
@@ -1122,7 +1122,7 @@ int snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
pcm->private_data = route;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &route->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &route->plug.appl_ptr, -1, 0);
err = route_load_ttable(&route->params, pcm->stream, tt_ssize, ttable, tt_cused, tt_sused);
diff --git a/src/pcm/pcm_share.c b/src/pcm/pcm_share.c
index 118ab2617780..97705447dd6d 100644
--- a/src/pcm/pcm_share.c
+++ b/src/pcm/pcm_share.c
@@ -971,7 +971,7 @@ static int snd_pcm_share_start(snd_pcm_t *pcm)
}
slave->running_count++;
_snd_pcm_share_update(pcm);
- gettimestamp(&share->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&share->trigger_tstamp, pcm->tstamp_type);
_end:
Pthread_mutex_unlock(&slave->mutex);
return err;
@@ -1126,7 +1126,7 @@ static void _snd_pcm_share_stop(snd_pcm_t *pcm, snd_pcm_state_t state)
return;
}
#endif
- gettimestamp(&share->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&share->trigger_tstamp, pcm->tstamp_type);
if (pcm->stream == SND_PCM_STREAM_CAPTURE) {
snd_pcm_areas_copy(pcm->stopped_areas, 0,
pcm->running_areas, 0,
@@ -1526,7 +1526,7 @@ int snd_pcm_share_open(snd_pcm_t **pcmp, const char *name, const char *sname,
pcm->private_data = share;
pcm->poll_fd = share->client_socket;
pcm->poll_events = stream == SND_PCM_STREAM_PLAYBACK ? POLLOUT : POLLIN;
- pcm->monotonic = slave->pcm->monotonic;
+ pcm->tstamp_type = slave->pcm->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &share->hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &share->appl_ptr, -1, 0);
diff --git a/src/pcm/pcm_softvol.c b/src/pcm/pcm_softvol.c
index 5da92049cc88..c6cfd8896b26 100644
--- a/src/pcm/pcm_softvol.c
+++ b/src/pcm/pcm_softvol.c
@@ -903,7 +903,7 @@ int snd_pcm_softvol_open(snd_pcm_t **pcmp, const char *name,
* an extra buffer.
*/
pcm->mmap_shadow = 1;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &svol->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &svol->plug.appl_ptr, -1, 0);
*pcmp = pcm;
--
2.0.1

View File

@ -1,51 +0,0 @@
From 52444bd43afbadb8637f5fac3fe5fd90575ee216 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Mon, 14 Jul 2014 18:12:49 +0200
Subject: [PATCH 10/14] test/audio_time: Set timestamp type explicitly
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
test/audio_time.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/test/audio_time.c b/test/audio_time.c
index 03817c7c673b..7435db6a7fd8 100644
--- a/test/audio_time.c
+++ b/test/audio_time.c
@@ -57,6 +57,7 @@ void gettimestamp(snd_pcm_t *handle, snd_htimestamp_t *timestamp,
#define TRACK_PLAYBACK /* dump playback timing info */
#define TRACK_SAMPLE_COUNTS /* show difference between sample counters and audiotimestamps returned by driver */
#define PLAYBACK_BUFFERS 4
+#define TSTAMP_TYPE SND_PCM_TSTAMP_TYPE_MONOTONIC
int main(void)
@@ -128,6 +129,12 @@ int main(void)
goto _exit;
}
+ err = snd_pcm_sw_params_set_tstamp_type(handle_p, swparams_p, TSTAMP_TYPE);
+ if (err < 0) {
+ printf("Unable to set tstamp type : %s\n", snd_strerror(err));
+ goto _exit;
+ }
+
/* write the sw parameters */
err = snd_pcm_sw_params(handle_p, swparams_p);
if (err < 0) {
@@ -177,6 +184,12 @@ int main(void)
goto _exit;
}
+ err = snd_pcm_sw_params_set_tstamp_type(handle_c, swparams_c, TSTAMP_TYPE);
+ if (err < 0) {
+ printf("Unable to set tstamp type : %s\n", snd_strerror(err));
+ goto _exit;
+ }
+
/* write the sw parameters */
err = snd_pcm_sw_params(handle_c, swparams_c);
if (err < 0) {
--
2.0.1

View File

@ -1,35 +0,0 @@
From de63b942acf520a25ff469cf338a99eb3da65570 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Mon, 21 Jul 2014 16:30:54 +0200
Subject: [PATCH 11/14] pcm: route: Use get/put labels for all 3 byte formats
So far, use_getput flag is set only when the src or dest format is
24bit physical width. But, also 18 and 20 bit physical width formats
should set the flag, too. This patch makes the check broader to cover
all 3 bytes formats.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_route.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c
index 2f0be38b1906..72c198cb25d2 100644
--- a/src/pcm/pcm_route.c
+++ b/src/pcm/pcm_route.c
@@ -644,8 +644,10 @@ static int snd_pcm_route_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
}
if (err < 0)
return err;
- route->params.use_getput = snd_pcm_format_physical_width(src_format) == 24 ||
- snd_pcm_format_physical_width(dst_format) == 24;
+ /* 3 bytes formats? */
+ route->params.use_getput =
+ (snd_pcm_format_physical_width(src_format) + 7) / 3 == 3 ||
+ (snd_pcm_format_physical_width(dst_format) + 7) / 3 == 3;
route->params.get_idx = snd_pcm_linear_get_index(src_format, SND_PCM_FORMAT_S16);
route->params.put_idx = snd_pcm_linear_put32_index(SND_PCM_FORMAT_S32, dst_format);
route->params.conv_idx = snd_pcm_linear_convert_index(src_format, dst_format);
--
2.0.1

View File

@ -1,58 +0,0 @@
From 55c53625212702debf55c719ec62f6c81c780927 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Wed, 16 Jul 2014 17:48:34 +0200
Subject: [PATCH 12/14] pcm: Fill sw_params proto field
Fill the new proto field introduced to sw_params with the current PCM
protocol version. This makes tstamp_type evaluated properly in the
kernel.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/sound/asound.h | 4 ++--
src/pcm/pcm.c | 1 +
src/pcm/pcm_params.c | 1 +
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 552f41bd1ca9..c819df421434 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -386,8 +386,8 @@ struct snd_pcm_sw_params {
snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */
snd_pcm_uframes_t silence_size; /* silence block size */
snd_pcm_uframes_t boundary; /* pointers wrap point */
- unsigned int tstamp_type; /* timestamp type */
- int pads; /* alignment, reserved */
+ unsigned int proto; /* protocol version */
+ unsigned int tstamp_type; /* timestamp type (req. proto >= 2.0.12) */
unsigned char reserved[56]; /* reserved for future */
};
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index 89844430bf35..1399a5b2e671 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -5610,6 +5610,7 @@ int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
SNDMSG("PCM not set up");
return -EIO;
}
+ params->proto = SNDRV_PCM_VERSION;
params->tstamp_mode = pcm->tstamp_mode;
params->tstamp_type = pcm->tstamp_type;
params->period_step = pcm->period_step;
diff --git a/src/pcm/pcm_params.c b/src/pcm/pcm_params.c
index 4adbefae0530..6e57904e445b 100644
--- a/src/pcm/pcm_params.c
+++ b/src/pcm/pcm_params.c
@@ -2257,6 +2257,7 @@ static int snd_pcm_sw_params_default(snd_pcm_t *pcm, snd_pcm_sw_params_t *params
{
assert(pcm && params);
assert(pcm->setup);
+ params->proto = SNDRV_PCM_VERSION;
params->tstamp_mode = SND_PCM_TSTAMP_NONE;
params->tstamp_type = pcm->tstamp_type;
params->period_step = 1;
--
2.0.1

View File

@ -1,342 +0,0 @@
From fd84adc63e307572d05274be44c782a787087cda Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Tue, 22 Jul 2014 11:55:40 +0200
Subject: [PATCH 13/14] pcm: route: Use get32 for multi-source route
calculation
The PCM route plugin can assign the destination value from average of
multiple sources with attenuation. This requires the read of each
channel value, sums and writes the resultant value in the requested
format.
Currently, get_labels is used for reading source values while
put32_labels is used for writing the dest value. This is, however,
a buggy implementation; get_labels gives the value as is only with
endianness and signedness conversions, but put32_labels assumes that
the value is normalized to 32bit int and it shifts down to the dest
format. In addition, the current code lacks get_labels entries for
the 24bit formats, as Shengjiu Wang spotted out.
For fixing these bugs, this patch replaces the read with
get32_labels and use always 64bit int for sum. This simplifies the
code a lot and drops many lines.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_route.c | 128 +++++++++------------------------------------------
src/pcm/plugin_ops.h | 81 --------------------------------
2 files changed, 23 insertions(+), 186 deletions(-)
diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c
index 72c198cb25d2..5dac7ebcb7df 100644
--- a/src/pcm/pcm_route.c
+++ b/src/pcm/pcm_route.c
@@ -60,7 +60,7 @@ typedef struct {
typedef struct snd_pcm_route_ttable_dst snd_pcm_route_ttable_dst_t;
typedef struct {
- enum {UINT32=0, UINT64=1, FLOAT=2} sum_idx;
+ enum {UINT64, FLOAT} sum_idx;
unsigned int get_idx;
unsigned int put_idx;
unsigned int conv_idx;
@@ -233,55 +233,34 @@ static void snd_pcm_route_convert1_many(const snd_pcm_channel_area_t *dst_area,
const snd_pcm_route_ttable_dst_t* ttable,
const snd_pcm_route_params_t *params)
{
-#define GETS_LABELS
+#define GET32_LABELS
#define PUT32_LABELS
#include "plugin_ops.h"
-#undef GETS_LABELS
+#undef GET32_LABELS
#undef PUT32_LABELS
- static void *const zero_labels[3] = {
- &&zero_int32, &&zero_int64,
+ static void *const zero_labels[2] = {
+ &&zero_int64,
#if SND_PCM_PLUGIN_ROUTE_FLOAT
&&zero_float
#endif
};
/* sum_type att */
- static void *const add_labels[3 * 2] = {
- &&add_int32_noatt, &&add_int32_att,
+ static void *const add_labels[2 * 2] = {
&&add_int64_noatt, &&add_int64_att,
#if SND_PCM_PLUGIN_ROUTE_FLOAT
&&add_float_noatt, &&add_float_att
#endif
};
- /* sum_type att shift */
- static void *const norm_labels[3 * 2 * 4] = {
- 0,
- &&norm_int32_8_noatt,
- &&norm_int32_16_noatt,
- &&norm_int32_24_noatt,
- 0,
- &&norm_int32_8_att,
- &&norm_int32_16_att,
- &&norm_int32_24_att,
- &&norm_int64_0_noatt,
- &&norm_int64_8_noatt,
- &&norm_int64_16_noatt,
- &&norm_int64_24_noatt,
- &&norm_int64_0_att,
- &&norm_int64_8_att,
- &&norm_int64_16_att,
- &&norm_int64_24_att,
+ /* sum_type att */
+ static void *const norm_labels[2 * 2] = {
+ &&norm_int64_noatt,
+ &&norm_int64_att,
#if SND_PCM_PLUGIN_ROUTE_FLOAT
- &&norm_float_0,
- &&norm_float_8,
- &&norm_float_16,
- &&norm_float_24,
- &&norm_float_0,
- &&norm_float_8,
- &&norm_float_16,
- &&norm_float_24,
+ &&norm_float,
+ &&norm_float,
#endif
};
- void *zero, *get, *add, *norm, *put32;
+ void *zero, *get32, *add, *norm, *put32;
int nsrcs = ttable->nsrcs;
char *dst;
int dst_step;
@@ -323,9 +302,9 @@ static void snd_pcm_route_convert1_many(const snd_pcm_channel_area_t *dst_area,
}
zero = zero_labels[params->sum_idx];
- get = gets_labels[params->get_idx];
+ get32 = get32_labels[params->get_idx];
add = add_labels[params->sum_idx * 2 + ttable->att];
- norm = norm_labels[params->sum_idx * 8 + ttable->att * 4 + 4 - params->src_size];
+ norm = norm_labels[params->sum_idx * 2 + ttable->att];
put32 = put32_labels[params->put_idx];
dst = snd_pcm_channel_area_addr(dst_area, dst_offset);
dst_step = snd_pcm_channel_area_step(dst_area);
@@ -336,9 +315,6 @@ static void snd_pcm_route_convert1_many(const snd_pcm_channel_area_t *dst_area,
/* Zero sum */
goto *zero;
- zero_int32:
- sum.as_sint32 = 0;
- goto zero_end;
zero_int64:
sum.as_sint64 = 0;
goto zero_end;
@@ -352,21 +328,14 @@ static void snd_pcm_route_convert1_many(const snd_pcm_channel_area_t *dst_area,
const char *src = srcs[srcidx];
/* Get sample */
- goto *get;
-#define GETS_END after_get
+ goto *get32;
+#define GET32_END after_get
#include "plugin_ops.h"
-#undef GETS_END
+#undef GET32_END
after_get:
/* Sum */
goto *add;
- add_int32_att:
- sum.as_sint32 += sample * ttp->as_int;
- goto after_sum;
- add_int32_noatt:
- if (ttp->as_int)
- sum.as_sint32 += sample;
- goto after_sum;
add_int64_att:
sum.as_sint64 += (int64_t) sample * ttp->as_int;
goto after_sum;
@@ -390,48 +359,10 @@ static void snd_pcm_route_convert1_many(const snd_pcm_channel_area_t *dst_area,
/* Normalization */
goto *norm;
- norm_int32_8_att:
- sum.as_sint64 = sum.as_sint32;
- norm_int64_8_att:
- sum.as_sint64 <<= 8;
- norm_int64_0_att:
+ norm_int64_att:
div(sum.as_sint64);
- goto norm_int;
-
- norm_int32_16_att:
- sum.as_sint64 = sum.as_sint32;
- norm_int64_16_att:
- sum.as_sint64 <<= 16;
- div(sum.as_sint64);
- goto norm_int;
-
- norm_int32_24_att:
- sum.as_sint64 = sum.as_sint32;
- norm_int64_24_att:
- sum.as_sint64 <<= 24;
- div(sum.as_sint64);
- goto norm_int;
-
- norm_int32_8_noatt:
- sum.as_sint64 = sum.as_sint32;
- norm_int64_8_noatt:
- sum.as_sint64 <<= 8;
- goto norm_int;
-
- norm_int32_16_noatt:
- sum.as_sint64 = sum.as_sint32;
- norm_int64_16_noatt:
- sum.as_sint64 <<= 16;
- goto norm_int;
-
- norm_int32_24_noatt:
- sum.as_sint64 = sum.as_sint32;
- norm_int64_24_noatt:
- sum.as_sint64 <<= 24;
- goto norm_int;
-
- norm_int64_0_noatt:
- norm_int:
+ /* fallthru */
+ norm_int64_noatt:
if (sum.as_sint64 > (int64_t)0x7fffffff)
sample = 0x7fffffff; /* maximum positive value */
else if (sum.as_sint64 < -(int64_t)0x80000000)
@@ -441,16 +372,6 @@ static void snd_pcm_route_convert1_many(const snd_pcm_channel_area_t *dst_area,
goto after_norm;
#if SND_PCM_PLUGIN_ROUTE_FLOAT
- norm_float_8:
- sum.as_float *= 1 << 8;
- goto norm_float;
- norm_float_16:
- sum.as_float *= 1 << 16;
- goto norm_float;
- norm_float_24:
- sum.as_float *= 1 << 24;
- goto norm_float;
- norm_float_0:
norm_float:
sum.as_float = rint(sum.as_float);
if (sum.as_float > (int64_t)0x7fffffff)
@@ -648,7 +569,7 @@ static int snd_pcm_route_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
route->params.use_getput =
(snd_pcm_format_physical_width(src_format) + 7) / 3 == 3 ||
(snd_pcm_format_physical_width(dst_format) + 7) / 3 == 3;
- route->params.get_idx = snd_pcm_linear_get_index(src_format, SND_PCM_FORMAT_S16);
+ route->params.get_idx = snd_pcm_linear_get32_index(src_format, SND_PCM_FORMAT_S32);
route->params.put_idx = snd_pcm_linear_put32_index(SND_PCM_FORMAT_S32, dst_format);
route->params.conv_idx = snd_pcm_linear_convert_index(src_format, dst_format);
route->params.src_size = snd_pcm_format_width(src_format) / 8;
@@ -656,10 +577,7 @@ static int snd_pcm_route_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
#if SND_PCM_PLUGIN_ROUTE_FLOAT
route->params.sum_idx = FLOAT;
#else
- if (snd_pcm_format_width(src_format) == 32)
- route->params.sum_idx = UINT64;
- else
- route->params.sum_idx = UINT32;
+ route->params.sum_idx = UINT64;
#endif
return 0;
}
diff --git a/src/pcm/plugin_ops.h b/src/pcm/plugin_ops.h
index 21535c9ca8d6..eb8c2c4f4dac 100644
--- a/src/pcm/plugin_ops.h
+++ b/src/pcm/plugin_ops.h
@@ -668,87 +668,6 @@ getu_1234_C321: sample = bswap_32(as_u32c(src) ^ 0x80); goto GETU_END;
}
#endif
-#ifdef GETS_LABELS
-/* width endswap sign_toggle */
-static void *const gets_labels[4 * 2 * 2] = {
- &&gets_1_1, /* 8h -> 8h */
- &&gets_1_9, /* 8h ^> 8h */
- &&gets_1_1, /* 8s -> 8h */
- &&gets_1_9, /* 8s ^> 8h */
- &&gets_12_12, /* 16h -> 16h */
- &&gets_12_92, /* 16h ^> 16h */
- &&gets_12_21, /* 16s -> 16h */
- &&gets_12_A1, /* 16s ^> 16h */
- &&gets_0123_0123, /* 24h -> 24h */
- &&gets_0123_0923, /* 24h ^> 24h */
- &&gets_1230_0321, /* 24s -> 24h */
- &&gets_1230_0B21, /* 24s ^> 24h */
- &&gets_1234_1234, /* 32h -> 32h */
- &&gets_1234_9234, /* 32h ^> 32h */
- &&gets_1234_4321, /* 32s -> 32h */
- &&gets_1234_C321, /* 32s ^> 32h */
-};
-#endif
-
-#ifdef GETS_END
-while (0) {
-gets_1_1: sample = as_s8c(src); goto GETS_END;
-gets_1_9: sample = (int8_t)(as_s8c(src) ^ 0x80); goto GETS_END;
-gets_12_12: sample = as_s16c(src); goto GETS_END;
-gets_12_92: sample = (int16_t)(as_s16c(src) ^ 0x8000); goto GETS_END;
-gets_12_21: sample = (int16_t)bswap_16(as_s16c(src)); goto GETS_END;
-gets_12_A1: sample = (int16_t)bswap_16(as_s16c(src) ^ 0x80); goto GETS_END;
-gets_0123_0123: sample = sx24((int32_t)(as_s32c(src) << 8) >> 8); goto GETS_END;
-gets_0123_0923: sample = sx24((int32_t)((as_s32c(src) ^ 0x800000) << 8) >> 8); goto GETS_END;
-gets_1230_0321: sample = sx24((int32_t)(bswap_32(as_s32c(src)) << 8) >> 8); goto GETS_END;
-gets_1230_0B21: sample = sx24((int32_t)(bswap_32(as_s32c(src) ^ 0x8000) << 8) >> 8); goto GETS_END;
-gets_1234_1234: sample = as_s32c(src); goto GETS_END;
-gets_1234_9234: sample = (int32_t)(as_s32c(src) ^ 0x80000000); goto GETS_END;
-gets_1234_4321: sample = (int32_t)bswap_32(as_s32c(src)); goto GETS_END;
-gets_1234_C321: sample = (int32_t)bswap_32(as_s32c(src) ^ 0x80); goto GETS_END;
-}
-#endif
-
-#ifdef PUT_LABELS
-/* width endswap sign_toggle */
-static void *const put_labels[4 * 2 * 2] = {
- &&put_1_1, /* 8h -> 8h */
- &&put_1_9, /* 8h ^> 8h */
- &&put_1_1, /* 8h -> 8s */
- &&put_1_9, /* 8h ^> 8s */
- &&put_12_12, /* 16h -> 16h */
- &&put_12_92, /* 16h ^> 16h */
- &&put_12_21, /* 16h -> 16s */
- &&put_12_29, /* 16h ^> 16s */
- &&put_0123_0123, /* 24h -> 24h */
- &&put_0123_0923, /* 24h ^> 24h */
- &&put_0123_3210, /* 24h -> 24s */
- &&put_0123_3290, /* 24h ^> 24s */
- &&put_1234_1234, /* 32h -> 32h */
- &&put_1234_9234, /* 32h ^> 32h */
- &&put_1234_4321, /* 32h -> 32s */
- &&put_1234_4329, /* 32h ^> 32s */
-};
-#endif
-
-#ifdef PUT_END
-put_1_1: as_s8(dst) = sample; goto PUT_END;
-put_1_9: as_u8(dst) = sample ^ 0x80; goto PUT_END;
-put_12_12: as_s16(dst) = sample; goto PUT_END;
-put_12_92: as_u16(dst) = sample ^ 0x8000; goto PUT_END;
-put_12_21: as_s16(dst) = bswap_16(sample); goto PUT_END;
-put_12_29: as_u16(dst) = bswap_16(sample) ^ 0x80; goto PUT_END;
-/* this always writes the unused byte in 24-bit formats as 0x00 */
-put_0123_0123: as_s32(dst) = sx24(sample & 0x00ffffff); goto PUT_END;
-put_0123_0923: as_u32(dst) = sx24((sample & 0x00ffffff) ^ 0x800000); goto PUT_END;
-put_0123_3210: as_s32(dst) = sx24s(bswap_32(sample) & 0xffffff00); goto PUT_END;
-put_0123_3290: as_u32(dst) = sx24s((bswap_32(sample) & 0xffffff00) ^ 0x8000); goto PUT_END;
-put_1234_1234: as_s32(dst) = sample; goto PUT_END;
-put_1234_9234: as_u32(dst) = sample ^ 0x80000000; goto PUT_END;
-put_1234_4321: as_s32(dst) = bswap_32(sample); goto PUT_END;
-put_1234_4329: as_u32(dst) = bswap_32(sample) ^ 0x80; goto PUT_END;
-#endif
-
#ifdef PUT32F_LABELS
/* type (0 = float, 1 = float64), endswap */
static void *const put32float_labels[2 * 2] = {
--
2.0.1

View File

@ -1,143 +0,0 @@
From 7a5646f58ba2e8154a274a5ae0f8ec963f331f97 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Tue, 22 Jul 2014 12:20:50 +0200
Subject: [PATCH 14/14] pcm: Drop snd_pcm_linear_{get|put}32_index()
These are identical with snd_pcm_linear_{get|put}_index().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_lfloat.c | 4 ++--
src/pcm/pcm_linear.c | 44 ++++----------------------------------------
src/pcm/pcm_plugin.h | 4 ----
src/pcm/pcm_route.c | 4 ++--
4 files changed, 8 insertions(+), 48 deletions(-)
diff --git a/src/pcm/pcm_lfloat.c b/src/pcm/pcm_lfloat.c
index 324282f0b7fc..2f3e578fc503 100644
--- a/src/pcm/pcm_lfloat.c
+++ b/src/pcm/pcm_lfloat.c
@@ -286,11 +286,11 @@ static int snd_pcm_lfloat_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
err = INTERNAL(snd_pcm_hw_params_get_format)(params, &dst_format);
}
if (snd_pcm_format_linear(src_format)) {
- lfloat->int32_idx = snd_pcm_linear_get32_index(src_format, SND_PCM_FORMAT_S32);
+ lfloat->int32_idx = snd_pcm_linear_get_index(src_format, SND_PCM_FORMAT_S32);
lfloat->float32_idx = snd_pcm_lfloat_put_s32_index(dst_format);
lfloat->func = snd_pcm_lfloat_convert_integer_float;
} else {
- lfloat->int32_idx = snd_pcm_linear_put32_index(SND_PCM_FORMAT_S32, dst_format);
+ lfloat->int32_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S32, dst_format);
lfloat->float32_idx = snd_pcm_lfloat_get_s32_index(src_format);
lfloat->func = snd_pcm_lfloat_convert_float_integer;
}
diff --git a/src/pcm/pcm_linear.c b/src/pcm/pcm_linear.c
index 3d5bbb8a3688..9a92abd04fb8 100644
--- a/src/pcm/pcm_linear.c
+++ b/src/pcm/pcm_linear.c
@@ -107,11 +107,6 @@ int snd_pcm_linear_get_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_f
}
}
-int snd_pcm_linear_get32_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format)
-{
- return snd_pcm_linear_get_index(src_format, dst_format);
-}
-
int snd_pcm_linear_put_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format)
{
int sign, width, pwidth, endian;
@@ -143,37 +138,6 @@ int snd_pcm_linear_put_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_f
}
}
-int snd_pcm_linear_put32_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format)
-{
- int sign, width, pwidth, endian;
- sign = (snd_pcm_format_signed(src_format) !=
- snd_pcm_format_signed(dst_format));
-#ifdef SND_LITTLE_ENDIAN
- endian = snd_pcm_format_big_endian(dst_format);
-#else
- endian = snd_pcm_format_little_endian(dst_format);
-#endif
- if (endian < 0)
- endian = 0;
- pwidth = snd_pcm_format_physical_width(dst_format);
- width = snd_pcm_format_width(dst_format);
- if (pwidth == 24) {
- switch (width) {
- case 24:
- width = 0; break;
- case 20:
- width = 1; break;
- case 18:
- default:
- width = 2; break;
- }
- return width * 4 + endian * 2 + sign + 16;
- } else {
- width = width / 8 - 1;
- return width * 4 + endian * 2 + sign;
- }
-}
-
void snd_pcm_linear_convert(const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
const snd_pcm_channel_area_t *src_areas, snd_pcm_uframes_t src_offset,
unsigned int channels, snd_pcm_uframes_t frames,
@@ -342,11 +306,11 @@ static int snd_pcm_linear_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
snd_pcm_format_physical_width(linear->sformat) == 24);
if (linear->use_getput) {
if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
- linear->get_idx = snd_pcm_linear_get32_index(format, SND_PCM_FORMAT_S32);
- linear->put_idx = snd_pcm_linear_put32_index(SND_PCM_FORMAT_S32, linear->sformat);
+ linear->get_idx = snd_pcm_linear_get_index(format, SND_PCM_FORMAT_S32);
+ linear->put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S32, linear->sformat);
} else {
- linear->get_idx = snd_pcm_linear_get32_index(linear->sformat, SND_PCM_FORMAT_S32);
- linear->put_idx = snd_pcm_linear_put32_index(SND_PCM_FORMAT_S32, format);
+ linear->get_idx = snd_pcm_linear_get_index(linear->sformat, SND_PCM_FORMAT_S32);
+ linear->put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S32, format);
}
} else {
if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
diff --git a/src/pcm/pcm_plugin.h b/src/pcm/pcm_plugin.h
index 19e82c3e7321..b0a3e1869ea1 100644
--- a/src/pcm/pcm_plugin.h
+++ b/src/pcm/pcm_plugin.h
@@ -86,8 +86,6 @@ snd_pcm_sframes_t snd_pcm_plugin_undo_write_generic
/* make local functions really local */
#define snd_pcm_linear_get_index snd1_pcm_linear_get_index
#define snd_pcm_linear_put_index snd1_pcm_linear_put_index
-#define snd_pcm_linear_get32_index snd1_pcm_linear_get32_index
-#define snd_pcm_linear_put32_index snd1_pcm_linear_put32_index
#define snd_pcm_linear_convert_index snd1_pcm_linear_convert_index
#define snd_pcm_linear_convert snd1_pcm_linear_convert
#define snd_pcm_linear_getput snd1_pcm_linear_getput
@@ -100,8 +98,6 @@ snd_pcm_sframes_t snd_pcm_plugin_undo_write_generic
int snd_pcm_linear_get_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format);
int snd_pcm_linear_put_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format);
-int snd_pcm_linear_get32_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format);
-int snd_pcm_linear_put32_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format);
int snd_pcm_linear_convert_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format);
void snd_pcm_linear_convert(const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c
index 5dac7ebcb7df..e7de9b51f1fc 100644
--- a/src/pcm/pcm_route.c
+++ b/src/pcm/pcm_route.c
@@ -569,8 +569,8 @@ static int snd_pcm_route_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
route->params.use_getput =
(snd_pcm_format_physical_width(src_format) + 7) / 3 == 3 ||
(snd_pcm_format_physical_width(dst_format) + 7) / 3 == 3;
- route->params.get_idx = snd_pcm_linear_get32_index(src_format, SND_PCM_FORMAT_S32);
- route->params.put_idx = snd_pcm_linear_put32_index(SND_PCM_FORMAT_S32, dst_format);
+ route->params.get_idx = snd_pcm_linear_get_index(src_format, SND_PCM_FORMAT_S32);
+ route->params.put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S32, dst_format);
route->params.conv_idx = snd_pcm_linear_convert_index(src_format, dst_format);
route->params.src_size = snd_pcm_format_width(src_format) / 8;
route->params.dst_sfmt = dst_format;
--
2.0.1

View File

@ -1,29 +0,0 @@
From f6b879e7cc87d83343f5004369146881d1d1e335 Mon Sep 17 00:00:00 2001
From: Shengjiu Wang <shengjiu.wang@freescale.com>
Date: Wed, 23 Jul 2014 15:09:58 +0800
Subject: [PATCH] pcm: pcm_local.h: include <time.h> to enable CLOCK_MONOTONIC
CLOCK_MONITONIC is defined in <bits/time.h>, add <time.h> before
<sys/time.h>.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_local.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/pcm/pcm_local.h b/src/pcm/pcm_local.h
index 2206afe2c4a9..80bbe5973bdb 100644
--- a/src/pcm/pcm_local.h
+++ b/src/pcm/pcm_local.h
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <limits.h>
#include <sys/uio.h>
+#include <time.h>
#include <sys/time.h>
#define _snd_mask sndrv_mask
--
2.0.1

View File

@ -1,67 +0,0 @@
From 87df9f3b7a650418b9aef943ac246549c132672a Mon Sep 17 00:00:00 2001
From: Jurgen Kramer <gtmkramer@xs4all.nl>
Date: Sat, 9 Aug 2014 12:09:21 +0200
Subject: [PATCH] pcm: Fix DSD formats userland usability
Support for DSD sample formats has been added a while ago. This patch makes
those sample formats beter usable from userland (e.g. aplay).
[These implementation details have been forgotten in the previous DSD
support patch -- tiwai]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/sound/asound.h | 4 +++-
src/pcm/pcm_misc.c | 4 ++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/sound/asound.h b/include/sound/asound.h
index c819df421434..519452466317 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -214,7 +214,9 @@ typedef int __bitwise snd_pcm_format_t;
#define SNDRV_PCM_FORMAT_G723_24_1B ((__force snd_pcm_format_t) 45) /* 1 sample in 1 byte */
#define SNDRV_PCM_FORMAT_G723_40 ((__force snd_pcm_format_t) 46) /* 8 Samples in 5 bytes */
#define SNDRV_PCM_FORMAT_G723_40_1B ((__force snd_pcm_format_t) 47) /* 1 sample in 1 byte */
-#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_G723_40_1B
+#define SNDRV_PCM_FORMAT_DSD_U8 ((__force snd_pcm_format_t) 48) /* 8 1-bit samples in 1 byte */
+#define SNDRV_PCM_FORMAT_DSD_U16_LE ((__force snd_pcm_format_t) 49) /* 16 1-bit samples in 2 bytes */
+#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U16_LE
#ifdef SNDRV_LITTLE_ENDIAN
#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
diff --git a/src/pcm/pcm_misc.c b/src/pcm/pcm_misc.c
index d52160cec653..44bb89cb0d44 100644
--- a/src/pcm/pcm_misc.c
+++ b/src/pcm/pcm_misc.c
@@ -195,11 +195,13 @@ int snd_pcm_format_width(snd_pcm_format_t format)
switch (format) {
case SNDRV_PCM_FORMAT_S8:
case SNDRV_PCM_FORMAT_U8:
+ case SNDRV_PCM_FORMAT_DSD_U8:
return 8;
case SNDRV_PCM_FORMAT_S16_LE:
case SNDRV_PCM_FORMAT_S16_BE:
case SNDRV_PCM_FORMAT_U16_LE:
case SNDRV_PCM_FORMAT_U16_BE:
+ case SNDRV_PCM_FORMAT_DSD_U16_LE:
return 16;
case SNDRV_PCM_FORMAT_S18_3LE:
case SNDRV_PCM_FORMAT_S18_3BE:
@@ -253,11 +255,13 @@ int snd_pcm_format_physical_width(snd_pcm_format_t format)
switch (format) {
case SNDRV_PCM_FORMAT_S8:
case SNDRV_PCM_FORMAT_U8:
+ case SNDRV_PCM_FORMAT_DSD_U8:
return 8;
case SNDRV_PCM_FORMAT_S16_LE:
case SNDRV_PCM_FORMAT_S16_BE:
case SNDRV_PCM_FORMAT_U16_LE:
case SNDRV_PCM_FORMAT_U16_BE:
+ case SNDRV_PCM_FORMAT_DSD_U16_LE:
return 16;
case SNDRV_PCM_FORMAT_S18_3LE:
case SNDRV_PCM_FORMAT_S18_3BE:
--
2.0.4

View File

@ -1,60 +0,0 @@
From 717ae3dd90c37f3a5ea9809370bdf56e2590a1c4 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Mon, 11 Aug 2014 11:51:29 +0200
Subject: [PATCH] Sync include/sound/asound.h with 3.17-rc1 kernel
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/sound/asound.h | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 519452466317..32168f7ffce3 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -93,9 +93,12 @@ enum {
SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */
SNDRV_HWDEP_IFACE_HDA, /* HD-audio */
SNDRV_HWDEP_IFACE_USB_STREAM, /* direct access to usb stream */
+ SNDRV_HWDEP_IFACE_FW_DICE, /* TC DICE FireWire device */
+ SNDRV_HWDEP_IFACE_FW_FIREWORKS, /* Echo Audio Fireworks based device */
+ SNDRV_HWDEP_IFACE_FW_BEBOB, /* BridgeCo BeBoB based device */
/* Don't forget to change the following: */
- SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_USB_STREAM
+ SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_FW_BEBOB
};
struct snd_hwdep_info {
@@ -214,8 +217,8 @@ typedef int __bitwise snd_pcm_format_t;
#define SNDRV_PCM_FORMAT_G723_24_1B ((__force snd_pcm_format_t) 45) /* 1 sample in 1 byte */
#define SNDRV_PCM_FORMAT_G723_40 ((__force snd_pcm_format_t) 46) /* 8 Samples in 5 bytes */
#define SNDRV_PCM_FORMAT_G723_40_1B ((__force snd_pcm_format_t) 47) /* 1 sample in 1 byte */
-#define SNDRV_PCM_FORMAT_DSD_U8 ((__force snd_pcm_format_t) 48) /* 8 1-bit samples in 1 byte */
-#define SNDRV_PCM_FORMAT_DSD_U16_LE ((__force snd_pcm_format_t) 49) /* 16 1-bit samples in 2 bytes */
+#define SNDRV_PCM_FORMAT_DSD_U8 ((__force snd_pcm_format_t) 48) /* DSD, 1-byte samples DSD (x8) */
+#define SNDRV_PCM_FORMAT_DSD_U16_LE ((__force snd_pcm_format_t) 49) /* DSD, 2-byte samples DSD (x16), little endian */
#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U16_LE
#ifdef SNDRV_LITTLE_ENDIAN
@@ -461,7 +464,7 @@ struct snd_xfern {
enum {
SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */
SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */
- SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW, /* monotonic_raw (no NTP) */
+ SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW, /* monotonic_raw (no NTP) */
SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW,
};
@@ -820,6 +823,8 @@ typedef int __bitwise snd_ctl_elem_iface_t;
#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */
#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */
+#define SNDRV_CTL_ELEM_ID_NAME_MAXLEN 44
+
struct snd_ctl_elem_id {
unsigned int numid; /* numeric identifier, zero = invalid */
snd_ctl_elem_iface_t iface; /* interface identifier */
--
2.0.4

View File

@ -1,36 +0,0 @@
From e8e54811339b13d6df648bb48b35157d9fba352c Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Mon, 11 Aug 2014 11:55:03 +0200
Subject: [PATCH] pcm: Add missing signed and endianess definitions for DSD
formats
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_misc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/pcm/pcm_misc.c b/src/pcm/pcm_misc.c
index 44bb89cb0d44..24d52f910cb6 100644
--- a/src/pcm/pcm_misc.c
+++ b/src/pcm/pcm_misc.c
@@ -62,6 +62,8 @@ int snd_pcm_format_signed(snd_pcm_format_t format)
case SNDRV_PCM_FORMAT_U20_3BE:
case SNDRV_PCM_FORMAT_U18_3LE:
case SNDRV_PCM_FORMAT_U18_3BE:
+ case SNDRV_PCM_FORMAT_DSD_U8:
+ case SNDRV_PCM_FORMAT_DSD_U16_LE:
return 0;
default:
return -EINVAL;
@@ -150,6 +152,8 @@ int snd_pcm_format_little_endian(snd_pcm_format_t format)
case SNDRV_PCM_FORMAT_U24_3BE:
case SNDRV_PCM_FORMAT_U20_3BE:
case SNDRV_PCM_FORMAT_U18_3BE:
+ case SNDRV_PCM_FORMAT_DSD_U8:
+ case SNDRV_PCM_FORMAT_DSD_U16_LE:
return 0;
default:
return -EINVAL;
--
2.0.4

View File

@ -1,38 +0,0 @@
From dfc3bf97bf45bd78d498d20fcf930541350f836d Mon Sep 17 00:00:00 2001
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Date: Mon, 18 Aug 2014 18:45:17 +0900
Subject: [PATCH] Sync enum snd_hwdep_iface_t with include/asound/asound.h
Some members in this enumerated type has not updated for 9 years, although
kernel-drivers added them during this period. This commit adds them following
to a commit 87df9f3 'sync include/asound/asound.h with 3.17-rc1 kernel'.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/hwdep.h | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/include/hwdep.h b/include/hwdep.h
index ab12822cf799..6496fa2d7d87 100644
--- a/include/hwdep.h
+++ b/include/hwdep.h
@@ -68,8 +68,13 @@ typedef enum _snd_hwdep_iface {
SND_HWDEP_IFACE_USX2Y_PCM, /**< Tascam US122, US224 & US428 raw USB PCM */
SND_HWDEP_IFACE_PCXHR, /**< Digigram PCXHR */
SND_HWDEP_IFACE_SB_RC, /**< SB Extigy/Audigy2NX remote control */
-
- SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_SB_RC /**< last known hwdep interface */
+ SND_HWDEP_IFACE_HDA, /**< HD-audio */
+ SND_HWDEP_IFACE_USB_STREAM, /**< direct access to usb stream */
+ SND_HWDEP_IFACE_FW_DICE, /**< TC DICE FireWire device */
+ SND_HWDEP_IFACE_FW_FIREWORKS, /**< Echo Audio Fireworks based device */
+ SND_HWDEP_IFACE_FW_BEBOB, /**< BridgeCo BeBoB based device */
+
+ SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_FW_BEBOB /**< last known hwdep interface */
} snd_hwdep_iface_t;
/** open for reading */
--
2.1.0

View File

@ -1,48 +0,0 @@
From b9f58dcc6f91fde42e6dd2bb831d6063855512a7 Mon Sep 17 00:00:00 2001
From: Jurgen Kramer <gtmkramer@xs4all.nl>
Date: Fri, 22 Aug 2014 10:15:10 +0200
Subject: [PATCH] pcm: 2nd round of pcm_misc DSD fixes
Functions 'snd_pcm_format_silence_64' and 'snd_pcm_format_size' also need to be
able to handle the DSD smaple format.
Changes from v1:
- Correct silence pattern for DSD
Signed-off-by: Jurgen Kramer <gtmkramer@xs4all.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_misc.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/pcm/pcm_misc.c b/src/pcm/pcm_misc.c
index 24d52f910cb6..46fc7719978e 100644
--- a/src/pcm/pcm_misc.c
+++ b/src/pcm/pcm_misc.c
@@ -317,11 +317,13 @@ ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples)
switch (format) {
case SNDRV_PCM_FORMAT_S8:
case SNDRV_PCM_FORMAT_U8:
+ case SNDRV_PCM_FORMAT_DSD_U8:
return samples;
case SNDRV_PCM_FORMAT_S16_LE:
case SNDRV_PCM_FORMAT_S16_BE:
case SNDRV_PCM_FORMAT_U16_LE:
case SNDRV_PCM_FORMAT_U16_BE:
+ case SNDRV_PCM_FORMAT_DSD_U16_LE:
return samples * 2;
case SNDRV_PCM_FORMAT_S18_3LE:
case SNDRV_PCM_FORMAT_S18_3BE:
@@ -390,6 +392,9 @@ u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format)
return 0;
case SNDRV_PCM_FORMAT_U8:
return 0x8080808080808080ULL;
+ case SNDRV_PCM_FORMAT_DSD_U8:
+ case SNDRV_PCM_FORMAT_DSD_U16_LE:
+ return 0x6969696969696969ULL;
#ifdef SNDRV_LITTLE_ENDIAN
case SNDRV_PCM_FORMAT_U16_LE:
return 0x8000800080008000ULL;
--
2.1.0

View File

@ -1,42 +0,0 @@
From 5f1960e3d8d56aa63afe2c37c6a3f4aa03571627 Mon Sep 17 00:00:00 2001
From: Dmitry Voytik <voytikd@gmail.com>
Date: Fri, 22 Aug 2014 14:17:10 +0400
Subject: [PATCH] doc: fix cross-compiling example
Simplest way to configure cross-compilation with configure
script is to pass '--host' option.
Passing just '--target' doesn't work.
Signed-off-by: Dmitry Voytik <voytikd@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
INSTALL | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/INSTALL b/INSTALL
index 91a8648e1462..47086e3cd7cc 100644
--- a/INSTALL
+++ b/INSTALL
@@ -78,16 +78,13 @@ When you would like to cross-compile ALSA library (e.g. compile on
i686 host but for arm architecture) you will need to call ./configure
script with additional parameters:
-CC=arm-linux-gcc ./configure --target=arm-linux
+CC=arm-linux-gcc ./configure --host=arm-linux
-In this example host where the library is build is guessed (should be
-given with --host=platform) and target for which is the library build is
-Linux on ARM architecture. You should omit setting 'CC' variable and
-cross-compiler will be guessed too.
+You can omit setting 'CC' variable and cross-compiler will be guessed too.
So simplest version would be:
-./configure --target=arm-linux
+./configure --host=arm-linux
For platform names in the form cpu-vendor-os (or aliases for this)
you should look in 'config.guess' script. Target and all paths
--
2.1.0

View File

@ -1,40 +0,0 @@
From 99a2254f5f2a085b81efcc80950033a2b6110ecd Mon Sep 17 00:00:00 2001
From: "Alexander E. Patrakov" <patrakov@gmail.com>
Date: Sun, 31 Aug 2014 22:23:47 +0600
Subject: [PATCH] pcm: fix snd_pcm_mmap_hw_avail() near the boundary
This function returned incorrect results when hw.ptr was near the
boundary and hw.appl_ptr was near zero. Here "incorrect" means "greater
than the boundary".
The result was incorrect, because it was used as a return value of
various *_rewindable() functions and also as the delay for ioplug.
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_local.h | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/src/pcm/pcm_local.h b/src/pcm/pcm_local.h
index 80bbe5973bdb..74ebd609334a 100644
--- a/src/pcm/pcm_local.h
+++ b/src/pcm/pcm_local.h
@@ -461,13 +461,7 @@ static inline snd_pcm_sframes_t snd_pcm_mmap_capture_hw_avail(snd_pcm_t *pcm)
static inline snd_pcm_sframes_t snd_pcm_mmap_hw_avail(snd_pcm_t *pcm)
{
- snd_pcm_sframes_t avail;
- avail = *pcm->hw.ptr - *pcm->appl.ptr;
- if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
- avail += pcm->buffer_size;
- if (avail < 0)
- avail += pcm->boundary;
- return pcm->buffer_size - avail;
+ return pcm->buffer_size - snd_pcm_mmap_avail(pcm);
}
static inline const snd_pcm_channel_area_t *snd_pcm_mmap_areas(snd_pcm_t *pcm)
--
2.1.2

View File

@ -1,31 +0,0 @@
From 622b1b6bdbb34baca885b65643d4796057574eb7 Mon Sep 17 00:00:00 2001
From: "Alexander E. Patrakov" <patrakov@gmail.com>
Date: Tue, 2 Sep 2014 01:29:36 +0600
Subject: [PATCH] pcm: fix return value of snd_pcm_share_slave_avail
The return value was wrong for playback if slave->hw_ptr was near the
boundary and *pcm->appl.ptr was near zero. The wrong result was greater
than the boundary.
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_share.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/pcm/pcm_share.c b/src/pcm/pcm_share.c
index 97705447dd6d..c301c7af799a 100644
--- a/src/pcm/pcm_share.c
+++ b/src/pcm/pcm_share.c
@@ -128,6 +128,8 @@ static snd_pcm_uframes_t snd_pcm_share_slave_avail(snd_pcm_share_slave_t *slave)
avail += pcm->buffer_size;
if (avail < 0)
avail += pcm->boundary;
+ else if ((snd_pcm_uframes_t) avail >= pcm->boundary)
+ avail -= pcm->boundary;
return avail;
}
--
2.1.2

View File

@ -1,123 +0,0 @@
From e59ffbf30ec13f7f1615ba266ec2f3e770801d6f Mon Sep 17 00:00:00 2001
From: Jurgen Kramer <gtmkramer@xs4all.nl>
Date: Wed, 10 Sep 2014 09:00:28 +0200
Subject: [PATCH] pcm: add new 32-bit DSD sample format
Add the new DSD_U32_LE sample format to alsa-lib.
NB include/pcm.h and include/sound/asound.h are updated so a new sync with the
kernel headers is not needed
Signed-off-by: Jurgen Kramer <gtmkramer@xs4all.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/pcm.h | 4 +++-
include/sound/asound.h | 3 ++-
src/pcm/pcm.c | 2 ++
src/pcm/pcm_misc.c | 6 ++++++
4 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/include/pcm.h b/include/pcm.h
index 11e9f0dfba13..db88ad5ee41a 100644
--- a/include/pcm.h
+++ b/include/pcm.h
@@ -211,7 +211,9 @@ typedef enum _snd_pcm_format {
SND_PCM_FORMAT_DSD_U8,
/* Direct Stream Digital (DSD) in 2-byte samples (x16) */
SND_PCM_FORMAT_DSD_U16_LE,
- SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_DSD_U16_LE,
+ /* Direct Stream Digital (DSD) in 4-byte samples (x32) */
+ SND_PCM_FORMAT_DSD_U32_LE,
+ SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_DSD_U32_LE,
#if __BYTE_ORDER == __LITTLE_ENDIAN
/** Signed 16 bit CPU endian */
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 32168f7ffce3..6ee586728df9 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -219,7 +219,8 @@ typedef int __bitwise snd_pcm_format_t;
#define SNDRV_PCM_FORMAT_G723_40_1B ((__force snd_pcm_format_t) 47) /* 1 sample in 1 byte */
#define SNDRV_PCM_FORMAT_DSD_U8 ((__force snd_pcm_format_t) 48) /* DSD, 1-byte samples DSD (x8) */
#define SNDRV_PCM_FORMAT_DSD_U16_LE ((__force snd_pcm_format_t) 49) /* DSD, 2-byte samples DSD (x16), little endian */
-#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U16_LE
+#define SNDRV_PCM_FORMAT_DSD_U32_LE ((__force snd_pcm_format_t) 50) /* DSD, 4-byte samples DSD (x32), little endian */
+#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U32_LE
#ifdef SNDRV_LITTLE_ENDIAN
#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index 1399a5b2e671..2e2433829016 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -1565,6 +1565,7 @@ static const char *const snd_pcm_format_names[] = {
FORMAT(G723_40_1B),
FORMAT(DSD_U8),
FORMAT(DSD_U16_LE),
+ FORMAT(DSD_U32_LE),
};
static const char *const snd_pcm_format_aliases[SND_PCM_FORMAT_LAST+1] = {
@@ -1624,6 +1625,7 @@ static const char *const snd_pcm_format_descriptions[] = {
FORMATD(G723_40_1B, "G.723 (ADPCM) 40 kbit/s, 1 sample in 1 byte"),
FORMATD(DSD_U8, "Direct Stream Digital, 1-byte (x8), oldest bit in MSB"),
FORMATD(DSD_U16_LE, "Direct Stream Digital, 2-byte (x16), little endian, oldest bits in MSB"),
+ FORMATD(DSD_U32_LE, "Direct Stream Digital, 4-byte (x32), little endian, oldest bits in MSB"),
};
static const char *const snd_pcm_type_names[] = {
diff --git a/src/pcm/pcm_misc.c b/src/pcm/pcm_misc.c
index 46fc7719978e..92721796aa1f 100644
--- a/src/pcm/pcm_misc.c
+++ b/src/pcm/pcm_misc.c
@@ -64,6 +64,7 @@ int snd_pcm_format_signed(snd_pcm_format_t format)
case SNDRV_PCM_FORMAT_U18_3BE:
case SNDRV_PCM_FORMAT_DSD_U8:
case SNDRV_PCM_FORMAT_DSD_U16_LE:
+ case SNDRV_PCM_FORMAT_DSD_U32_LE:
return 0;
default:
return -EINVAL;
@@ -154,6 +155,7 @@ int snd_pcm_format_little_endian(snd_pcm_format_t format)
case SNDRV_PCM_FORMAT_U18_3BE:
case SNDRV_PCM_FORMAT_DSD_U8:
case SNDRV_PCM_FORMAT_DSD_U16_LE:
+ case SNDRV_PCM_FORMAT_DSD_U32_LE:
return 0;
default:
return -EINVAL;
@@ -232,6 +234,7 @@ int snd_pcm_format_width(snd_pcm_format_t format)
case SNDRV_PCM_FORMAT_U32_BE:
case SNDRV_PCM_FORMAT_FLOAT_LE:
case SNDRV_PCM_FORMAT_FLOAT_BE:
+ case SNDRV_PCM_FORMAT_DSD_U32_LE:
return 32;
case SNDRV_PCM_FORMAT_FLOAT64_LE:
case SNDRV_PCM_FORMAT_FLOAT64_BE:
@@ -292,6 +295,7 @@ int snd_pcm_format_physical_width(snd_pcm_format_t format)
case SNDRV_PCM_FORMAT_FLOAT_BE:
case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE:
case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE:
+ case SNDRV_PCM_FORMAT_DSD_U32_LE:
return 32;
case SNDRV_PCM_FORMAT_FLOAT64_LE:
case SNDRV_PCM_FORMAT_FLOAT64_BE:
@@ -348,6 +352,7 @@ ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples)
case SNDRV_PCM_FORMAT_U32_BE:
case SNDRV_PCM_FORMAT_FLOAT_LE:
case SNDRV_PCM_FORMAT_FLOAT_BE:
+ case SNDRV_PCM_FORMAT_DSD_U32_LE:
return samples * 4;
case SNDRV_PCM_FORMAT_FLOAT64_LE:
case SNDRV_PCM_FORMAT_FLOAT64_BE:
@@ -394,6 +399,7 @@ u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format)
return 0x8080808080808080ULL;
case SNDRV_PCM_FORMAT_DSD_U8:
case SNDRV_PCM_FORMAT_DSD_U16_LE:
+ case SNDRV_PCM_FORMAT_DSD_U32_LE:
return 0x6969696969696969ULL;
#ifdef SNDRV_LITTLE_ENDIAN
case SNDRV_PCM_FORMAT_U16_LE:
--
2.1.2

View File

@ -1,36 +0,0 @@
From 9a56a673a6cd7343a9345921e2b1cbbb43fb725f Mon Sep 17 00:00:00 2001
From: "Alexander E. Patrakov" <patrakov@gmail.com>
Date: Sun, 14 Sep 2014 00:30:13 +0600
Subject: [PATCH] dmix: actually rewind when running or being drained
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_dmix.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c
index 7c535093ea0f..73cbe3f8d0b2 100644
--- a/src/pcm/pcm_dmix.c
+++ b/src/pcm/pcm_dmix.c
@@ -669,11 +669,15 @@ static snd_pcm_sframes_t snd_pcm_dmix_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t f
snd_pcm_direct_t *dmix = pcm->private_data;
snd_pcm_uframes_t slave_appl_ptr, slave_size;
snd_pcm_uframes_t appl_ptr, size, transfer, result;
+ int err;
const snd_pcm_channel_area_t *src_areas, *dst_areas;
if (dmix->state == SND_PCM_STATE_RUNNING ||
- dmix->state == SND_PCM_STATE_DRAINING)
- return snd_pcm_dmix_hwsync(pcm);
+ dmix->state == SND_PCM_STATE_DRAINING) {
+ err = snd_pcm_dmix_hwsync(pcm);
+ if (err < 0)
+ return err;
+ }
if (dmix->last_appl_ptr < dmix->appl_ptr)
size = dmix->appl_ptr - dmix->last_appl_ptr;
--
2.1.2

View File

@ -1,112 +0,0 @@
From 9a43dc15b2979ed6d8850b033b594fbef829c991 Mon Sep 17 00:00:00 2001
From: "Alexander E. Patrakov" <patrakov@gmail.com>
Date: Sun, 14 Sep 2014 00:30:14 +0600
Subject: [PATCH] pcm: express the rewind size limitation logic better
There are a few places where the argument of the .rewind or .forward
callback is checked against the same value as returned by .rewindable or
.forwardable. Express this "don't rewind more than rewindable" logic
explicitly, so that the future fixes to the rewindable size can go to
one function instead of two.
While at it, take advantage of the fact that snd_pcm_mmap_avail() cannot
return negative values (except due to integer overflow, which is AFAICS
impossible given the current boundary choice).
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_dmix.c | 4 +---
src/pcm/pcm_dshare.c | 6 ++----
src/pcm/pcm_dsnoop.c | 6 ++----
src/pcm/pcm_plugin.c | 4 ++--
4 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c
index 73cbe3f8d0b2..ffde12a1a46c 100644
--- a/src/pcm/pcm_dmix.c
+++ b/src/pcm/pcm_dmix.c
@@ -751,9 +751,7 @@ static snd_pcm_sframes_t snd_pcm_dmix_forward(snd_pcm_t *pcm, snd_pcm_uframes_t
{
snd_pcm_sframes_t avail;
- avail = snd_pcm_mmap_playback_avail(pcm);
- if (avail < 0)
- return 0;
+ avail = snd_pcm_dmix_forwardable(pcm);
if (frames > (snd_pcm_uframes_t)avail)
frames = avail;
snd_pcm_mmap_appl_forward(pcm, frames);
diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c
index b985172825e7..f1a1a1d75229 100644
--- a/src/pcm/pcm_dshare.c
+++ b/src/pcm/pcm_dshare.c
@@ -419,7 +419,7 @@ static snd_pcm_sframes_t snd_pcm_dshare_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
{
snd_pcm_sframes_t avail;
- avail = snd_pcm_mmap_playback_hw_avail(pcm);
+ avail = snd_pcm_dshare_rewindable(pcm);
if (avail < 0)
return 0;
if (frames > (snd_pcm_uframes_t)avail)
@@ -437,9 +437,7 @@ static snd_pcm_sframes_t snd_pcm_dshare_forward(snd_pcm_t *pcm, snd_pcm_uframes_
{
snd_pcm_sframes_t avail;
- avail = snd_pcm_mmap_playback_avail(pcm);
- if (avail < 0)
- return 0;
+ avail = snd_pcm_dshare_forwardable(pcm);
if (frames > (snd_pcm_uframes_t)avail)
frames = avail;
snd_pcm_mmap_appl_forward(pcm, frames);
diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c
index 0f9c9df481bc..e56e4022becf 100644
--- a/src/pcm/pcm_dsnoop.c
+++ b/src/pcm/pcm_dsnoop.c
@@ -342,9 +342,7 @@ static snd_pcm_sframes_t snd_pcm_dsnoop_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
{
snd_pcm_sframes_t avail;
- avail = snd_pcm_mmap_capture_avail(pcm);
- if (avail < 0)
- return 0;
+ avail = snd_pcm_dsnoop_rewindable(pcm);
if (frames > (snd_pcm_uframes_t)avail)
frames = avail;
snd_pcm_mmap_appl_backward(pcm, frames);
@@ -360,7 +358,7 @@ static snd_pcm_sframes_t snd_pcm_dsnoop_forward(snd_pcm_t *pcm, snd_pcm_uframes_
{
snd_pcm_sframes_t avail;
- avail = snd_pcm_mmap_capture_hw_avail(pcm);
+ avail = snd_pcm_dsnoop_forwardable(pcm);
if (avail < 0)
return 0;
if (frames > (snd_pcm_uframes_t)avail)
diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
index 4ddf10c1989e..a607ccfe27de 100644
--- a/src/pcm/pcm_plugin.c
+++ b/src/pcm/pcm_plugin.c
@@ -204,7 +204,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewindable(snd_pcm_t *pcm)
snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
{
snd_pcm_plugin_t *plugin = pcm->private_data;
- snd_pcm_sframes_t n = snd_pcm_mmap_hw_avail(pcm);
+ snd_pcm_sframes_t n = snd_pcm_plugin_rewindable(pcm);
snd_pcm_sframes_t sframes;
if ((snd_pcm_uframes_t)n < frames)
@@ -232,7 +232,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_forwardable(snd_pcm_t *pcm)
snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
{
snd_pcm_plugin_t *plugin = pcm->private_data;
- snd_pcm_sframes_t n = snd_pcm_mmap_avail(pcm);
+ snd_pcm_sframes_t n = snd_pcm_plugin_forwardable(pcm);
snd_pcm_sframes_t sframes;
if ((snd_pcm_uframes_t)n < frames)
--
2.1.2

View File

@ -1,131 +0,0 @@
From 78c804fc9348e4c29f1c77dd4b6ad586393aa628 Mon Sep 17 00:00:00 2001
From: "Alexander E. Patrakov" <patrakov@gmail.com>
Date: Sun, 14 Sep 2014 00:30:15 +0600
Subject: [PATCH] pcm: handle negative values from snd_pcm_mmap_hw_avail
Such negative values can happen when an underrun happens and xrun
detection is disabled. Another situation is if the device updated the
pointer before alsa-lib has a chance to detect the xrun.
The problem is that these negative values could propagate to the
snd_pcm_rewindable return value, where it is specified that negative
returns must be interpreted as error codes and not as negative amount of
samples.
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_dmix.c | 2 +-
src/pcm/pcm_dshare.c | 4 +---
src/pcm/pcm_hw.c | 2 +-
src/pcm/pcm_ioplug.c | 2 +-
src/pcm/pcm_local.h | 18 ++++++++++++++++++
src/pcm/pcm_plugin.c | 2 +-
6 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c
index ffde12a1a46c..babde6a15efe 100644
--- a/src/pcm/pcm_dmix.c
+++ b/src/pcm/pcm_dmix.c
@@ -661,7 +661,7 @@ static int snd_pcm_dmix_pause(snd_pcm_t *pcm ATTRIBUTE_UNUSED, int enable ATTRIB
static snd_pcm_sframes_t snd_pcm_dmix_rewindable(snd_pcm_t *pcm)
{
- return snd_pcm_mmap_hw_avail(pcm);
+ return snd_pcm_mmap_playback_hw_rewindable(pcm);
}
static snd_pcm_sframes_t snd_pcm_dmix_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c
index f1a1a1d75229..020e6f7d9307 100644
--- a/src/pcm/pcm_dshare.c
+++ b/src/pcm/pcm_dshare.c
@@ -412,7 +412,7 @@ static int snd_pcm_dshare_pause(snd_pcm_t *pcm ATTRIBUTE_UNUSED, int enable ATTR
static snd_pcm_sframes_t snd_pcm_dshare_rewindable(snd_pcm_t *pcm)
{
- return snd_pcm_mmap_playback_hw_avail(pcm);
+ return snd_pcm_mmap_playback_hw_rewindable(pcm);
}
static snd_pcm_sframes_t snd_pcm_dshare_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
@@ -420,8 +420,6 @@ static snd_pcm_sframes_t snd_pcm_dshare_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
snd_pcm_sframes_t avail;
avail = snd_pcm_dshare_rewindable(pcm);
- if (avail < 0)
- return 0;
if (frames > (snd_pcm_uframes_t)avail)
frames = avail;
snd_pcm_mmap_appl_backward(pcm, frames);
diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
index 74cff672a0c1..c34b766ee035 100644
--- a/src/pcm/pcm_hw.c
+++ b/src/pcm/pcm_hw.c
@@ -659,7 +659,7 @@ static int snd_pcm_hw_pause(snd_pcm_t *pcm, int enable)
static snd_pcm_sframes_t snd_pcm_hw_rewindable(snd_pcm_t *pcm)
{
- return snd_pcm_mmap_hw_avail(pcm);
+ return snd_pcm_mmap_hw_rewindable(pcm);
}
static snd_pcm_sframes_t snd_pcm_hw_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
diff --git a/src/pcm/pcm_ioplug.c b/src/pcm/pcm_ioplug.c
index 85a88911eafc..fe9347c835d5 100644
--- a/src/pcm/pcm_ioplug.c
+++ b/src/pcm/pcm_ioplug.c
@@ -503,7 +503,7 @@ static int snd_pcm_ioplug_pause(snd_pcm_t *pcm, int enable)
static snd_pcm_sframes_t snd_pcm_ioplug_rewindable(snd_pcm_t *pcm)
{
- return snd_pcm_mmap_hw_avail(pcm);
+ return snd_pcm_mmap_hw_rewindable(pcm);
}
static snd_pcm_sframes_t snd_pcm_ioplug_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
diff --git a/src/pcm/pcm_local.h b/src/pcm/pcm_local.h
index 74ebd609334a..394505f978ac 100644
--- a/src/pcm/pcm_local.h
+++ b/src/pcm/pcm_local.h
@@ -464,6 +464,24 @@ static inline snd_pcm_sframes_t snd_pcm_mmap_hw_avail(snd_pcm_t *pcm)
return pcm->buffer_size - snd_pcm_mmap_avail(pcm);
}
+static inline snd_pcm_sframes_t snd_pcm_mmap_playback_hw_rewindable(snd_pcm_t *pcm)
+{
+ snd_pcm_sframes_t ret = snd_pcm_mmap_playback_hw_avail(pcm);
+ return (ret >= 0) ? ret : 0;
+}
+
+static inline snd_pcm_sframes_t snd_pcm_mmap_capture_hw_rewindable(snd_pcm_t *pcm)
+{
+ snd_pcm_sframes_t ret = snd_pcm_mmap_capture_hw_avail(pcm);
+ return (ret >= 0) ? ret : 0;
+}
+
+static inline snd_pcm_uframes_t snd_pcm_mmap_hw_rewindable(snd_pcm_t *pcm)
+{
+ snd_pcm_sframes_t ret = snd_pcm_mmap_hw_avail(pcm);
+ return (ret >= 0) ? ret : 0;
+}
+
static inline const snd_pcm_channel_area_t *snd_pcm_mmap_areas(snd_pcm_t *pcm)
{
if (pcm->stopped_areas &&
diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
index a607ccfe27de..c19e2f17a730 100644
--- a/src/pcm/pcm_plugin.c
+++ b/src/pcm/pcm_plugin.c
@@ -198,7 +198,7 @@ static int snd_pcm_plugin_reset(snd_pcm_t *pcm)
static snd_pcm_sframes_t snd_pcm_plugin_rewindable(snd_pcm_t *pcm)
{
- return snd_pcm_mmap_hw_avail(pcm);
+ return snd_pcm_mmap_hw_rewindable(pcm);
}
snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
--
2.1.2

View File

@ -1,32 +0,0 @@
From 0889e9470667dd68d5a0ce47a10a8c6d61b7bc79 Mon Sep 17 00:00:00 2001
From: "Alexander E. Patrakov" <patrakov@gmail.com>
Date: Sun, 14 Sep 2014 00:30:16 +0600
Subject: [PATCH] pcm, rate: use the snd_pcm_mmap_hw_avail function
instead of the open-coded equivalent
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_rate.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
index 5e811bb7192a..b436a8ea65ba 100644
--- a/src/pcm/pcm_rate.c
+++ b/src/pcm/pcm_rate.c
@@ -593,10 +593,7 @@ static int snd_pcm_rate_hwsync(snd_pcm_t *pcm)
static int snd_pcm_rate_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
{
snd_pcm_rate_hwsync(pcm);
- if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
- *delayp = snd_pcm_mmap_playback_hw_avail(pcm);
- else
- *delayp = snd_pcm_mmap_capture_hw_avail(pcm);
+ *delayp = snd_pcm_mmap_hw_avail(pcm);
return 0;
}
--
2.1.2

View File

@ -1,32 +0,0 @@
From 4fafa468d4bb4618cfde7183f820d8fdd373dcb1 Mon Sep 17 00:00:00 2001
From: "Alexander E. Patrakov" <patrakov@gmail.com>
Date: Sun, 14 Sep 2014 00:30:17 +0600
Subject: [PATCH] pcm, null: use the snd_pcm_mmap_avail function
instead of the open-coded equivalent
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_null.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/pcm/pcm_null.c b/src/pcm/pcm_null.c
index f11a1020f7e3..05298200ac0a 100644
--- a/src/pcm/pcm_null.c
+++ b/src/pcm/pcm_null.c
@@ -86,10 +86,7 @@ static snd_pcm_sframes_t snd_pcm_null_avail_update(snd_pcm_t *pcm)
if (null->state == SND_PCM_STATE_PREPARED) {
/* it is required to return the correct avail count for */
/* the prepared stream, otherwise the start is not called */
- if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
- return snd_pcm_mmap_playback_avail(pcm);
- else
- return snd_pcm_mmap_capture_avail(pcm);
+ return snd_pcm_mmap_avail(pcm);
}
return pcm->buffer_size;
}
--
2.1.2

View File

@ -1,43 +0,0 @@
From ff9d213ff80f6fe0456565d4f524366443217174 Mon Sep 17 00:00:00 2001
From: "Alexander E. Patrakov" <patrakov@gmail.com>
Date: Sun, 14 Sep 2014 00:30:18 +0600
Subject: [PATCH] rate: handle negative values from
snd_pcm_mmap_playback_hw_avail
Such negative returns are possible during an underrun if xrun detection
is disabled.
So, don't store the result in an unsigned variable (where it will
overflow), and postpone the trigger in such case, too.
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_rate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
index b436a8ea65ba..736d5583cd4c 100644
--- a/src/pcm/pcm_rate.c
+++ b/src/pcm/pcm_rate.c
@@ -1058,7 +1058,7 @@ static snd_pcm_state_t snd_pcm_rate_state(snd_pcm_t *pcm)
static int snd_pcm_rate_start(snd_pcm_t *pcm)
{
snd_pcm_rate_t *rate = pcm->private_data;
- snd_pcm_uframes_t avail;
+ snd_pcm_sframes_t avail;
if (pcm->stream == SND_PCM_STREAM_CAPTURE)
return snd_pcm_start(rate->gen.slave);
@@ -1069,7 +1069,7 @@ static int snd_pcm_rate_start(snd_pcm_t *pcm)
gettimestamp(&rate->trigger_tstamp, pcm->tstamp_type);
avail = snd_pcm_mmap_playback_hw_avail(rate->gen.slave);
- if (avail == 0) {
+ if (avail <= 0) {
/* postpone the trigger since we have no data committed yet */
rate->start_pending = 1;
return 0;
--
2.1.2

View File

@ -1,45 +0,0 @@
From e5e1af83881e4dbe20749a314703db7d0fd091c7 Mon Sep 17 00:00:00 2001
From: "Alexander E. Patrakov" <patrakov@gmail.com>
Date: Sun, 14 Sep 2014 00:30:19 +0600
Subject: [PATCH] dsnoop: rewindable and forwardable logic was swapped
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_dsnoop.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c
index e56e4022becf..8333eefdaf4c 100644
--- a/src/pcm/pcm_dsnoop.c
+++ b/src/pcm/pcm_dsnoop.c
@@ -335,7 +335,7 @@ static int snd_pcm_dsnoop_pause(snd_pcm_t *pcm ATTRIBUTE_UNUSED, int enable ATTR
static snd_pcm_sframes_t snd_pcm_dsnoop_rewindable(snd_pcm_t *pcm)
{
- return snd_pcm_mmap_capture_avail(pcm);
+ return snd_pcm_mmap_capture_hw_avail(pcm);
}
static snd_pcm_sframes_t snd_pcm_dsnoop_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
@@ -351,7 +351,7 @@ static snd_pcm_sframes_t snd_pcm_dsnoop_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
static snd_pcm_sframes_t snd_pcm_dsnoop_forwardable(snd_pcm_t *pcm)
{
- return snd_pcm_mmap_capture_hw_avail(pcm);
+ return snd_pcm_mmap_capture_avail(pcm);
}
static snd_pcm_sframes_t snd_pcm_dsnoop_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
@@ -359,8 +359,6 @@ static snd_pcm_sframes_t snd_pcm_dsnoop_forward(snd_pcm_t *pcm, snd_pcm_uframes_
snd_pcm_sframes_t avail;
avail = snd_pcm_dsnoop_forwardable(pcm);
- if (avail < 0)
- return 0;
if (frames > (snd_pcm_uframes_t)avail)
frames = avail;
snd_pcm_mmap_appl_forward(pcm, frames);
--
2.1.2

View File

@ -1,37 +0,0 @@
From f803a3394a7b7390087be3cc192b2895f9e960ea Mon Sep 17 00:00:00 2001
From: "Alexander E. Patrakov" <patrakov@gmail.com>
Date: Sun, 14 Sep 2014 00:30:21 +0600
Subject: [PATCH] pcm, file: don't recurse in the rewindable and forwardable
callbacks
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_file.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/pcm/pcm_file.c b/src/pcm/pcm_file.c
index a0b8bf41bf5b..5541a9395027 100644
--- a/src/pcm/pcm_file.c
+++ b/src/pcm/pcm_file.c
@@ -454,7 +454,7 @@ static int snd_pcm_file_drain(snd_pcm_t *pcm)
static snd_pcm_sframes_t snd_pcm_file_rewindable(snd_pcm_t *pcm)
{
snd_pcm_file_t *file = pcm->private_data;
- snd_pcm_sframes_t res = snd_pcm_rewindable(pcm);
+ snd_pcm_sframes_t res = snd_pcm_rewindable(file->gen.slave);
snd_pcm_sframes_t n = snd_pcm_bytes_to_frames(pcm, file->wbuf_used_bytes);
if (res > n)
res = n;
@@ -482,7 +482,7 @@ static snd_pcm_sframes_t snd_pcm_file_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t f
static snd_pcm_sframes_t snd_pcm_file_forwardable(snd_pcm_t *pcm)
{
snd_pcm_file_t *file = pcm->private_data;
- snd_pcm_sframes_t res = snd_pcm_forwardable(pcm);
+ snd_pcm_sframes_t res = snd_pcm_forwardable(file->gen.slave);
snd_pcm_sframes_t n = snd_pcm_bytes_to_frames(pcm, file->wbuf_size_bytes - file->wbuf_used_bytes);
if (res > n)
res = n;
--
2.1.2

View File

@ -1,25 +0,0 @@
From 650b8c975cd5c3f7dca6e78e74db587b57bcdfd8 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Tue, 16 Sep 2014 09:00:39 +0200
Subject: [PATCH] pcm route: Fix the bad condition (always false)
---
src/pcm/pcm_route.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c
index e7de9b51f1fc..2a437e88b93c 100644
--- a/src/pcm/pcm_route.c
+++ b/src/pcm/pcm_route.c
@@ -1147,7 +1147,7 @@ static int _snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_ent
snd_config_iterator_t j, jnext;
long cchannel;
const char *id;
- if (!snd_config_get_id(in, &id) < 0)
+ if (snd_config_get_id(in, &id) < 0)
continue;
err = safe_strtol(id, &cchannel);
if (err < 0 ||
--
2.1.2

View File

@ -1,34 +0,0 @@
From 048568bbea700dfd9921b40321f8d5aa7e5ef417 Mon Sep 17 00:00:00 2001
From: "Alexander E. Patrakov" <patrakov@gmail.com>
Date: Mon, 15 Sep 2014 20:17:47 +0600
Subject: [PATCH] pcm, rate: hw_avail must not be negative before starting the
stream
If it is, then it means most likely the driver problem, so we should
return error immediately instead.
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_rate.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
index 736d5583cd4c..c76db25b1183 100644
--- a/src/pcm/pcm_rate.c
+++ b/src/pcm/pcm_rate.c
@@ -1069,7 +1069,10 @@ static int snd_pcm_rate_start(snd_pcm_t *pcm)
gettimestamp(&rate->trigger_tstamp, pcm->tstamp_type);
avail = snd_pcm_mmap_playback_hw_avail(rate->gen.slave);
- if (avail <= 0) {
+ if (avail < 0) /* can't happen on healthy drivers */
+ return -EBADFD;
+
+ if (avail == 0) {
/* postpone the trigger since we have no data committed yet */
rate->start_pending = 1;
return 0;
--
2.1.2

View File

@ -1,33 +0,0 @@
From 9ab3c4a66952c3ae4277624152da675050c7d2ad Mon Sep 17 00:00:00 2001
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Date: Wed, 17 Sep 2014 07:07:03 +0900
Subject: [PATCH] hwdep: add missing declaration for
snd_hwdep_poll_descriptors_count()
The alsa-lib has 'snd_hwdep_poll_descriptors_count()' but hwdep.h has no
declaration for the function. No applications can call the function just
by including the header.
This commit adds a line to the file for this function.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/hwdep.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/hwdep.h b/include/hwdep.h
index 6496fa2d7d87..ad8bb4972818 100644
--- a/include/hwdep.h
+++ b/include/hwdep.h
@@ -102,6 +102,7 @@ typedef struct _snd_hwdep snd_hwdep_t;
int snd_hwdep_open(snd_hwdep_t **hwdep, const char *name, int mode);
int snd_hwdep_close(snd_hwdep_t *hwdep);
int snd_hwdep_poll_descriptors(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int space);
+int snd_hwdep_poll_descriptors_count(snd_hwdep_t *hwdep);
int snd_hwdep_poll_descriptors_revents(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
int snd_hwdep_nonblock(snd_hwdep_t *hwdep, int nonblock);
int snd_hwdep_info(snd_hwdep_t *hwdep, snd_hwdep_info_t * info);
--
2.1.2

View File

@ -1,30 +0,0 @@
From 020bb3018ad6febbb0ae9650c4a4ca2b016f7d52 Mon Sep 17 00:00:00 2001
From: Renu Tyagi <renu.tyagi@samsung.com>
Date: Tue, 23 Sep 2014 09:01:36 +0200
Subject: [PATCH] mixer: fixed double free
Signed-off-by: renu tyagi <renu.tyagi@samsung.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/mixer/mixer.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/mixer/mixer.c b/src/mixer/mixer.c
index 56e023dbe7a9..eee9875b44fb 100644
--- a/src/mixer/mixer.c
+++ b/src/mixer/mixer.c
@@ -204,10 +204,8 @@ int snd_mixer_attach(snd_mixer_t *mixer, const char *name)
if (err < 0)
return err;
err = snd_mixer_attach_hctl(mixer, hctl);
- if (err < 0) {
- snd_hctl_close(hctl);
+ if (err < 0)
return err;
- }
return 0;
}
--
2.1.2

View File

@ -1,34 +0,0 @@
From d37f9187956cc0a58bdd129a807e3fdd1f5286b8 Mon Sep 17 00:00:00 2001
From: Renu Tyagi <renu.tyagi@samsung.com>
Date: Tue, 23 Sep 2014 09:04:19 +0200
Subject: [PATCH] pcm_file: fixed missing free
Signed-off-by: renu tyagi <renu.tyagi@samsung.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_file.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/pcm/pcm_file.c b/src/pcm/pcm_file.c
index 5541a9395027..9ab6964d3520 100644
--- a/src/pcm/pcm_file.c
+++ b/src/pcm/pcm_file.c
@@ -758,6 +758,7 @@ int snd_pcm_file_open(snd_pcm_t **pcmp, const char *name,
ifd = open(ifname, O_RDONLY); /* TODO: mind blocking mode */
if (ifd < 0) {
SYSERR("open %s for reading failed", ifname);
+ free(file->fname);
free(file);
return -errno;
}
@@ -772,6 +773,7 @@ int snd_pcm_file_open(snd_pcm_t **pcmp, const char *name,
err = snd_pcm_new(&pcm, SND_PCM_TYPE_FILE, name, slave->stream, slave->mode);
if (err < 0) {
free(file->fname);
+ free(file->ifname);
free(file);
return err;
}
--
2.1.2

View File

@ -1,26 +0,0 @@
From 0ee46280f3e3e52ed2c0af45c9a446a5a9dc5f83 Mon Sep 17 00:00:00 2001
From: Renu Tyagi <renu.tyagi@samsung.com>
Date: Tue, 23 Sep 2014 09:04:26 +0200
Subject: [PATCH] sbase: fixed missing free
Signed-off-by: renu tyagi <renu.tyagi@samsung.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
modules/mixer/simple/sbase.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules/mixer/simple/sbase.c b/modules/mixer/simple/sbase.c
index 97feee8905a6..bb2f59d8a18a 100644
--- a/modules/mixer/simple/sbase.c
+++ b/modules/mixer/simple/sbase.c
@@ -377,6 +377,7 @@ static int simple_event_add1(snd_mixer_class_t *class,
if (ctype != SND_CTL_ELEM_TYPE_BOOLEAN) {
__invalid_type:
snd_mixer_selem_id_free(id);
+ free(hsimple);
return -EINVAL;
}
break;
--
2.1.2

View File

@ -1,31 +0,0 @@
From 09f5c75e9cd7869353a4f6c8da72df43dc2c8e22 Mon Sep 17 00:00:00 2001
From: Renu Tyagi <renu.tyagi@samsung.com>
Date: Tue, 23 Sep 2014 09:05:27 +0200
Subject: [PATCH] rawmidi: close handle h
Signed-off-by: renu tyagi <renu.tyagi@samsung.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/rawmidi/rawmidi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/rawmidi/rawmidi.c b/src/rawmidi/rawmidi.c
index b835b472b361..ac699b439b11 100644
--- a/src/rawmidi/rawmidi.c
+++ b/src/rawmidi/rawmidi.c
@@ -256,8 +256,11 @@ static int snd_rawmidi_open_conf(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp
snd_config_delete(type_conf);
if (err >= 0)
err = open_func(inputp, outputp, name, rawmidi_root, rawmidi_conf, mode);
- if (err < 0)
+ if (err < 0) {
+ if (h)
+ snd_dlclose(h);
return err;
+ }
if (inputp) {
(*inputp)->dl_handle = h; h = NULL;
snd_rawmidi_params_default(*inputp, &params);
--
2.1.2

View File

@ -1,34 +0,0 @@
From 30f289a8a38006a937ca9189bc666b0bd90cab3c Mon Sep 17 00:00:00 2001
From: Renu Tyagi <renu.tyagi@samsung.com>
Date: Tue, 23 Sep 2014 09:05:39 +0200
Subject: [PATCH] pcm_share: fixing missing mutex unlock
Signed-off-by: renu tyagi <renu.tyagi@samsung.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_share.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/pcm/pcm_share.c b/src/pcm/pcm_share.c
index c301c7af799a..4b68f1f00fe3 100644
--- a/src/pcm/pcm_share.c
+++ b/src/pcm/pcm_share.c
@@ -369,6 +369,7 @@ static void *snd_pcm_share_thread(void *data)
err = pipe(slave->poll);
if (err < 0) {
SYSERR("can't create a pipe");
+ Pthread_mutex_unlock(&slave->mutex);
return NULL;
}
while (slave->open_count > 0) {
@@ -395,6 +396,7 @@ static void *snd_pcm_share_thread(void *data)
err = snd_pcm_sw_params(spcm, &slave->sw_params);
if (err < 0) {
SYSERR("snd_pcm_sw_params error");
+ Pthread_mutex_unlock(&slave->mutex);
return NULL;
}
}
--
2.1.2

View File

@ -1,27 +0,0 @@
From f3f568e3db5fccdf5cfb7053c04fde6272974faa Mon Sep 17 00:00:00 2001
From: Renu Tyagi <renu.tyagi@samsung.com>
Date: Tue, 23 Sep 2014 09:06:28 +0200
Subject: [PATCH] simple_abst: null check for lib
Signed-off-by: renu tyagi <renu.tyagi@samsung.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/mixer/simple_abst.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/mixer/simple_abst.c b/src/mixer/simple_abst.c
index 9e9aaf55c535..5297472a6d26 100644
--- a/src/mixer/simple_abst.c
+++ b/src/mixer/simple_abst.c
@@ -70,6 +70,8 @@ static int try_open(snd_mixer_class_t *class, const char *lib)
void *h;
int err = 0;
+ if (!lib)
+ return -ENXIO;
path = getenv("ALSA_MIXER_SIMPLE_MODULES");
if (!path)
path = SO_PATH;
--
2.1.2

View File

@ -1,47 +0,0 @@
From bd0b008c0d8ff08cd541dc608ce78478de7c9d12 Mon Sep 17 00:00:00 2001
From: Renu Tyagi <renu.tyagi@samsung.com>
Date: Tue, 23 Sep 2014 09:06:36 +0200
Subject: [PATCH] socket: missing socket close
Signed-off-by: renu tyagi <renu.tyagi@samsung.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/socket.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/socket.c b/src/socket.c
index 97c919f74876..16979b520ae6 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -124,12 +124,15 @@ int snd_is_local(struct hostent *hent)
conf.ifc_len = numreqs * sizeof(struct ifreq);
conf.ifc_buf = malloc((unsigned int) conf.ifc_len);
- if (! conf.ifc_buf)
+ if (! conf.ifc_buf) {
+ close(s);
return -ENOMEM;
+ }
while (1) {
err = ioctl(s, SIOCGIFCONF, &conf);
if (err < 0) {
SYSERR("SIOCGIFCONF failed");
+ close(s);
return -errno;
}
if ((size_t)conf.ifc_len < numreqs * sizeof(struct ifreq))
@@ -137,8 +140,10 @@ int snd_is_local(struct hostent *hent)
numreqs *= 2;
conf.ifc_len = numreqs * sizeof(struct ifreq);
conf.ifc_buf = realloc(conf.ifc_buf, (unsigned int) conf.ifc_len);
- if (! conf.ifc_buf)
+ if (! conf.ifc_buf) {
+ close(s);
return -ENOMEM;
+ }
}
numreqs = conf.ifc_len / sizeof(struct ifreq);
for (i = 0; i < numreqs; ++i) {
--
2.1.2

View File

@ -1,28 +0,0 @@
From 69e0aaa569912c2162908f168291490301b72322 Mon Sep 17 00:00:00 2001
From: Renu Tyagi <renu.tyagi@samsung.com>
Date: Tue, 23 Sep 2014 09:07:13 +0200
Subject: [PATCH] pcm_hooks: null check for h
Signed-off-by: renu tyagi <renu.tyagi@samsung.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_hooks.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/pcm/pcm_hooks.c b/src/pcm/pcm_hooks.c
index 0b93c641daaa..ce1cf361e74b 100644
--- a/src/pcm/pcm_hooks.c
+++ b/src/pcm/pcm_hooks.c
@@ -457,7 +457,8 @@ static int snd_pcm_hook_add_conf(snd_pcm_t *pcm, snd_config_t *root, snd_config_
err = hook_add_dlobj(pcm, h);
if (err < 0) {
- snd_dlclose(h);
+ if(h)
+ snd_dlclose(h);
return err;
}
return 0;
--
2.1.2

View File

@ -1,26 +0,0 @@
From b356cd29f975e53ae050a672aff81a71535c412b Mon Sep 17 00:00:00 2001
From: Renu Tyagi <renu.tyagi@samsung.com>
Date: Tue, 23 Sep 2014 09:07:20 +0200
Subject: [PATCH] conf: return negative value in case of error
Signed-off-by: renu tyagi <renu.tyagi@samsung.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/conf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/conf.c b/src/conf.c
index 5ccc8e1a53e5..bb256e7ae443 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -4198,6 +4198,7 @@ static int _snd_config_evaluate(snd_config_t *src,
snd_config_iterator_t i, next;
if (snd_config_get_type(func_conf) != SND_CONFIG_TYPE_COMPOUND) {
SNDERR("Invalid type for func %s definition", str);
+ err = -EINVAL;
goto _err;
}
snd_config_for_each(i, next, func_conf) {
--
2.1.2

View File

@ -1,26 +0,0 @@
From 5a0b992548778e063dbafb6737658be9b5e1e2a9 Mon Sep 17 00:00:00 2001
From: Renu Tyagi <renu.tyagi@samsung.com>
Date: Tue, 23 Sep 2014 09:08:09 +0200
Subject: [PATCH] control: return negative value in case of error
Signed-off-by: renu tyagi <renu.tyagi@samsung.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/control/control.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/control/control.c b/src/control/control.c
index d66ed755356f..dd428a1501b4 100644
--- a/src/control/control.c
+++ b/src/control/control.c
@@ -864,6 +864,7 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name,
if (err >= 0) {
if (snd_config_get_type(type_conf) != SND_CONFIG_TYPE_COMPOUND) {
SNDERR("Invalid type for CTL type %s definition", str);
+ err = -EINVAL;
goto _err;
}
snd_config_for_each(i, next, type_conf) {
--
2.1.2

View File

@ -1,26 +0,0 @@
From f78ba070b38c0711308d14ce642e78bc2a1a8fc6 Mon Sep 17 00:00:00 2001
From: Renu Tyagi <renu.tyagi@samsung.com>
Date: Tue, 23 Sep 2014 09:08:23 +0200
Subject: [PATCH] pcm: return negative value in case of error
Signed-off-by: renu tyagi <renu.tyagi@samsung.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index 2e2433829016..4a7be6c1a55f 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -2145,6 +2145,7 @@ static int snd_pcm_open_conf(snd_pcm_t **pcmp, const char *name,
if (err >= 0) {
if (snd_config_get_type(type_conf) != SND_CONFIG_TYPE_COMPOUND) {
SNDERR("Invalid type for PCM type %s definition", str);
+ err = -EINVAL;
goto _err;
}
snd_config_for_each(i, next, type_conf) {
--
2.1.2

View File

@ -1,44 +0,0 @@
From 7c1f36dbcbe8d60c6f90cbcf7e2e801cacbcd535 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Tue, 23 Sep 2014 09:11:27 +0200
Subject: [PATCH] mixer: Fix missing hctl handle free in
snd_mixer_attach_hctl()
Yet another missing piece.
Also, update the function document to warn about the behavior at
error.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/mixer/mixer.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/mixer/mixer.c b/src/mixer/mixer.c
index eee9875b44fb..3a79c8e91efb 100644
--- a/src/mixer/mixer.c
+++ b/src/mixer/mixer.c
@@ -214,6 +214,8 @@ int snd_mixer_attach(snd_mixer_t *mixer, const char *name)
* \param mixer Mixer handle
* \param hctl the HCTL to be attached
* \return 0 on success otherwise a negative error code
+ *
+ * Upon error, this function closes the given hctl handle automatically.
*/
int snd_mixer_attach_hctl(snd_mixer_t *mixer, snd_hctl_t *hctl)
{
@@ -222,8 +224,10 @@ int snd_mixer_attach_hctl(snd_mixer_t *mixer, snd_hctl_t *hctl)
assert(hctl);
slave = calloc(1, sizeof(*slave));
- if (slave == NULL)
+ if (slave == NULL) {
+ snd_hctl_close(hctl);
return -ENOMEM;
+ }
err = snd_hctl_nonblock(hctl, 1);
if (err < 0) {
snd_hctl_close(hctl);
--
2.1.2

View File

@ -1,225 +0,0 @@
From 24b4e86ddc512acb6b26f97cb958d59586482fb7 Mon Sep 17 00:00:00 2001
From: zombah <zombah@gmail.com>
Date: Tue, 23 Sep 2014 19:53:43 +0400
Subject: [PATCH] conf/ucm: PAZ00: add Toshiba AC100/Dynabook AZ new config
Recent mainline kernels threat Toshiba AC100 audio hardware as hw:PAZ00
vs old hw:tegraalc5632.
This patch adds config files for new hw name and include them to
makefiles.
Signed-off-by: zombah <zombah@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
configure.ac | 1 +
src/conf/ucm/Makefile.am | 2 +-
src/conf/ucm/PAZ00/HiFi.conf | 45 +++++++++++++++++++++++++++++
src/conf/ucm/PAZ00/Makefile.am | 4 +++
src/conf/ucm/PAZ00/PAZ00.conf | 39 +++++++++++++++++++++++++
src/conf/ucm/PAZ00/Record.conf | 65 ++++++++++++++++++++++++++++++++++++++++++
6 files changed, 155 insertions(+), 1 deletion(-)
create mode 100644 src/conf/ucm/PAZ00/HiFi.conf
create mode 100644 src/conf/ucm/PAZ00/Makefile.am
create mode 100644 src/conf/ucm/PAZ00/PAZ00.conf
create mode 100644 src/conf/ucm/PAZ00/Record.conf
diff --git a/configure.ac b/configure.ac
index b8353a09f0d9..734163c8c321 100644
--- a/configure.ac
+++ b/configure.ac
@@ -653,6 +653,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
src/conf/ucm/PandaBoardES/Makefile \
src/conf/ucm/SDP4430/Makefile \
src/conf/ucm/tegraalc5632/Makefile \
+ src/conf/ucm/PAZ00/Makefile \
modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile \
alsalisp/Makefile aserver/Makefile \
test/Makefile test/lsb/Makefile \
diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am
index e089dde73b32..bde89dfea440 100644
--- a/src/conf/ucm/Makefile.am
+++ b/src/conf/ucm/Makefile.am
@@ -1 +1 @@
-SUBDIRS=DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632
+SUBDIRS=DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632 PAZ00
diff --git a/src/conf/ucm/PAZ00/HiFi.conf b/src/conf/ucm/PAZ00/HiFi.conf
new file mode 100644
index 000000000000..275516d6eb70
--- /dev/null
+++ b/src/conf/ucm/PAZ00/HiFi.conf
@@ -0,0 +1,45 @@
+SectionVerb {
+ EnableSequence [
+ cdev "hw:PAZ00"
+
+ cset "name='Speaker Playback Switch' on"
+ cset "name='Int Spk Switch' on"
+ cset "name='Speaker Mix DAC2SPK Playback Switch' on"
+ ]
+ DisableSequence [
+ cset "name='Speaker Playback Switch' off"
+ cset "name='Int Spk Switch' off"
+ cset "name='Speaker Mix DAC2SPK Playback Switch' off"
+ ]
+}
+
+SectionDevice."Headset".0 {
+ Comment "3.5mm Headset"
+
+ Value {
+ JackName "Paz00 Headset Jack"
+ }
+
+ EnableSequence [
+ cdev "hw:PAZ00"
+
+ # Internal speaker
+ cset "name='Int Spk Switch' off"
+
+ # Headphones
+ cset "name='Headphone Playback Switch' on"
+ cset "name='HPL Mix DACL2HP Playback Switch' on"
+ cset "name='HPR Mix DACR2HP Playback Switch' on"
+ ]
+ DisableSequence [
+ cdev "hw:PAZ00"
+
+ # Headphones
+ cset "name='Headphone Playback Switch' off"
+ cset "name='HPL Mix DACL2HP Playback Switch' off"
+ cset "name='HPR Mix DACR2HP Playback Switch' off"
+
+ # Internal speaker
+ cset "name='Int Spk Switch' on"
+ ]
+}
diff --git a/src/conf/ucm/PAZ00/Makefile.am b/src/conf/ucm/PAZ00/Makefile.am
new file mode 100644
index 000000000000..1bf98a67515f
--- /dev/null
+++ b/src/conf/ucm/PAZ00/Makefile.am
@@ -0,0 +1,4 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/PAZ00
+ucm_DATA = PAZ00.conf HiFi.conf Record.conf
+EXTRA_DIST = $(ucm_DATA)
diff --git a/src/conf/ucm/PAZ00/PAZ00.conf b/src/conf/ucm/PAZ00/PAZ00.conf
new file mode 100644
index 000000000000..8b9d90435ba1
--- /dev/null
+++ b/src/conf/ucm/PAZ00/PAZ00.conf
@@ -0,0 +1,39 @@
+Comment "PAZ00 alc5632"
+
+ValueDefaults {
+ PlaybackCTL "hw:0"
+ CaptureCTL "hw:0"
+}
+
+SectionDefaults [
+ cdev "hw:PAZ00"
+
+ cset "name='Master Playback Switch' on"
+ cset "name='Master Playback Volume' 44,44"
+ cset "name='Headphone Playback Volume' 21,21"
+ cset "name='Speaker Playback Volume' 21,21"
+ cset "name='SpeakerOut Mux' 2"
+ cset "name='SpeakerOut N Mux' LN/-R"
+ cset "name='AB-D Amp Mux' 0"
+ cset "name='Left Headphone Mux' 1"
+ cset "name='Right Headphone Mux' 1"
+ cset "name='DMIC Boost Capture Volume' 4"
+ cset "name='Rec Capture Volume' 24"
+
+ # Fix external mic record volumes
+ cset "name='Mic 1 Boost Volume' 0"
+ cset "name='Mic 2 Boost Volume' 0"
+ cset "name='Mic1 Playback Volume' 0"
+ cset "name='Mic2 Playback Volume' 0"
+ cset "name='Rec Capture Volume' 0"
+]
+
+SectionUseCase."HiFi" {
+ File "HiFi.conf"
+ Comment "Music playback"
+}
+
+SectionUseCase."Record" {
+ File "Record.conf"
+ Comment "Playback and capture"
+}
diff --git a/src/conf/ucm/PAZ00/Record.conf b/src/conf/ucm/PAZ00/Record.conf
new file mode 100644
index 000000000000..568e2fbdf051
--- /dev/null
+++ b/src/conf/ucm/PAZ00/Record.conf
@@ -0,0 +1,65 @@
+SectionVerb {
+ EnableSequence [
+ cdev "hw:PAZ00"
+
+ cset "name='Speaker Playback Switch' on"
+ cset "name='Int Spk Switch' on"
+ cset "name='Speaker Mix DAC2SPK Playback Switch' on"
+
+ cset "name='DMICL Mix DMICL2ADC Capture Switch' on"
+ cset "name='DMIC En Capture Switch' on"
+ cset "name='DMIC PreFilter Capture Switch' on"
+ ]
+ DisableSequence [
+ cset "name='Speaker Playback Switch' off"
+ cset "name='Int Spk Switch' off"
+ cset "name='Speaker Mix DAC2SPK Playback Switch' off"
+
+ cset "name='DMICL Mix DMICL2ADC Capture Switch' off"
+ cset "name='DMIC En Capture Switch' off"
+ cset "name='DMIC PreFilter Capture Switch' off"
+ ]
+}
+
+SectionDevice."Headset".0 {
+ Comment "3.5mm Headset"
+
+ Value {
+ JackName "Paz00 Headset Jack"
+ }
+
+ EnableSequence [
+ cdev "hw:PAZ00"
+
+ # Internal speaker
+ cset "name='Int Spk Switch' off"
+
+ # Internal mic
+ cset "name='DMIC En Capture Switch' off"
+
+ # Headphones
+ cset "name='Headphone Playback Switch' on"
+ cset "name='HPL Mix DACL2HP Playback Switch' on"
+ cset "name='HPR Mix DACR2HP Playback Switch' on"
+
+ # External min
+ cset "name='Left Capture Mix MIC12REC_L Capture Switch' on"
+ ]
+ DisableSequence [
+ cdev "hw:PAZ00"
+
+ # Headphones
+ cset "name='Headphone Playback Switch' off"
+ cset "name='HPL Mix DACL2HP Playback Switch' off"
+ cset "name='HPR Mix DACR2HP Playback Switch' off"
+
+ # External mic
+ cset "name='Left Capture Mix MIC12REC_L Capture Switch' on"
+
+ # Internal speaker
+ cset "name='Int Spk Switch' on"
+
+ # Internal mic
+ cset "name='DMIC En Capture Switch' on"
+ ]
+}
--
2.1.2

View File

@ -1,28 +0,0 @@
From ebd6afc9158c0afd7263a0ffa5474cf9e5f20c66 Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@laiskiainen.org>
Date: Mon, 3 Nov 2014 17:42:44 +0200
Subject: [PATCH 50/60] USB-Audio: Add Scarlett 2i4 USB to S/PDIF blacklist
Like Scarlett 2i2, the 2i4 does not have any S/PDIF connections.
Signed-off-by: Panu Matilainen <pmatilai@laiskiainen.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/conf/cards/USB-Audio.conf | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/conf/cards/USB-Audio.conf b/src/conf/cards/USB-Audio.conf
index 77a48b9f5562..a6754d96b1aa 100644
--- a/src/conf/cards/USB-Audio.conf
+++ b/src/conf/cards/USB-Audio.conf
@@ -48,6 +48,7 @@ USB-Audio.pcm.iec958_device {
"Plantronics Wireless Audio" 999
"SB WoW Headset" 999
"Scarlett 2i2 USB" 999
+ "Scarlett 2i4 USB" 999
"Sennheiser USB headset" 999
"USB Device 0x46d:0x992" 999
}
--
2.1.3

View File

@ -1,43 +0,0 @@
From c7bfcbb25548db39299488e285b510a174231076 Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab@suse.de>
Date: Mon, 3 Nov 2014 17:22:28 +0100
Subject: [PATCH 51/60] snd_user_file: fix memory leak
Call wordfree if and only if wordfree returns zero or WRDE_NOSPACE
Signed-off-by: Andreas Schwab <schwab@suse.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/userfile.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/userfile.c b/src/userfile.c
index 3a738366f1ea..72779da4ebaf 100644
--- a/src/userfile.c
+++ b/src/userfile.c
@@ -44,19 +44,20 @@ int snd_user_file(const char *file, char **result)
err = wordexp(file, &we, WRDE_NOCMD);
switch (err) {
case WRDE_NOSPACE:
+ wordfree(&we);
return -ENOMEM;
case 0:
if (we.we_wordc == 1)
break;
+ wordfree(&we);
/* fall thru */
default:
- wordfree(&we);
return -EINVAL;
}
*result = strdup(we.we_wordv[0]);
+ wordfree(&we);
if (*result == NULL)
return -ENOMEM;
- wordfree(&we);
return 0;
}
--
2.1.3

View File

@ -1,30 +0,0 @@
From 5a066cb884815ab48924da8f70514d587400dd6a Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Thu, 6 Nov 2014 12:12:02 +0100
Subject: [PATCH 52/60] pcm: dmix: Don't ignore SND_TIMER_EVENT_MSTOP
When a slave PCM gets an error like XRUN, it stops and notifies with
SND_TIMER_EVENT_MSTOP event. But the current code filters out this
type and eventually hang due to the empty timer queue. The fix is to
just add this event type to the filter bit mask.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_direct.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c
index 8e37bcba5e19..195fddf06cda 100644
--- a/src/pcm/pcm_direct.c
+++ b/src/pcm/pcm_direct.c
@@ -1148,6 +1148,7 @@ int snd_pcm_direct_initialize_poll_fd(snd_pcm_direct_t *dmix)
dmix->timer_events = (1<<SND_TIMER_EVENT_MSUSPEND) |
(1<<SND_TIMER_EVENT_MRESUME) |
+ (1<<SND_TIMER_EVENT_MSTOP) |
(1<<SND_TIMER_EVENT_STOP);
/*
--
2.1.3

View File

@ -1,57 +0,0 @@
From 11fdac949bebbe1cbb7a5faec52c95a416860b50 Mon Sep 17 00:00:00 2001
From: John Spencer <maillist-alsa@barfooze.de>
Date: Sat, 15 Nov 2014 13:41:00 +0100
Subject: [PATCH 53/60] snd_dlsym: only do versioning checks if built
--with-versioning
a combination of some of the following garbage collecting LD/CFLAGS
-Os -g0 -fdata-sections -ffunction-sections -s -Wl,--gc-sections
-fno-unwind-tables -fno-asynchronous-unwind-tables
causes the symbol versioning marker symbols to be removed from BSS
since they're otherwise unreferenced. this causes dlsym failing to
find them which results in runtime breakage:
$ alsamixer
ALSA lib dlmisc.c:142:(snd_dlsym_verify) unable to verify version for symbol snd_config_hook_load
ALSA lib conf.c:3328:(snd_config_hooks_call) symbol snd_config_hook_load is not defined inside (null)
ALSA lib conf.c:3788:(snd_config_update_r) hooks failed, removing configuration
cannot open mixer: No such device or address
correct DSO:
$ objdump -T libasound.so.2.strip | grep _snd_config_hook_load_dlsym_config_hook_001
001196bc g DO .bss 00000001 _snd_config_hook_load_dlsym_config_hook_001
incorrect DSO:
$ objdump -T libs/libasound.so.2 | grep _snd_config_hook_load_dlsym_config_hook_001
00000000 g DO *ABS* 00000001 _snd_config_hook_load_dlsym_config_hook_001
since alsa was built with --without-versioning, doing those versioning
checks at all is unnecessary and harmful and thus now disabled in this case.
Signed-off-by: John Spencer <maillist-alsa@barfooze.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/dlmisc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/dlmisc.c b/src/dlmisc.c
index 4b8a02cd89f6..62f7047149ff 100644
--- a/src/dlmisc.c
+++ b/src/dlmisc.c
@@ -177,11 +177,13 @@ void *snd_dlsym(void *handle, const char *name, const char *version)
}
#endif
#ifdef HAVE_LIBDL
+#ifdef VERSIONED_SYMBOLS
if (version) {
err = snd_dlsym_verify(handle, name, version);
if (err < 0)
return NULL;
}
+#endif
return dlsym(handle, name);
#else
return NULL;
--
2.1.3

View File

@ -1,28 +0,0 @@
From 1eecc3a548839a71dfda5c65c9dc9369d868f665 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Sun, 16 Nov 2014 09:43:39 +0100
Subject: [PATCH 54/60] dlmisc: Remove unused label
Fix a compile warning
dlmisc.c:329:2: warning: label 'unlock' defined but not used [-Wunused-label]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/dlmisc.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/dlmisc.c b/src/dlmisc.c
index 62f7047149ff..b36c48fc8ac5 100644
--- a/src/dlmisc.c
+++ b/src/dlmisc.c
@@ -326,7 +326,6 @@ void snd_dlobj_cache_cleanup(void)
free(c);
}
- unlock:
snd_dlobj_unlock();
}
#endif
--
2.1.3

View File

@ -1,44 +0,0 @@
From 984db83aa1ca60f67550d88ae3d0fd33a0c16109 Mon Sep 17 00:00:00 2001
From: David Henningsson <david.henningsson@canonical.com>
Date: Mon, 17 Nov 2014 11:29:34 +0100
Subject: [PATCH 55/60] USB-audio: Add five more cards to IEC958 blacklist
These devices do not have any IEC958 outputs, so prevent them from
being opened.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/conf/cards/USB-Audio.conf | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/conf/cards/USB-Audio.conf b/src/conf/cards/USB-Audio.conf
index a6754d96b1aa..05e5d09fd2c2 100644
--- a/src/conf/cards/USB-Audio.conf
+++ b/src/conf/cards/USB-Audio.conf
@@ -38,10 +38,14 @@ USB-Audio.pcm.iec958_device {
# "NoiseBlaster 3000" 42
# The below don't have digital in/out, so prevent them from being opened.
+ "Andrea PureAudio USB-SA Headset" 999
"Blue Snowball" 999
"HP Digital Stereo Headset" 999
+ "GN 9330" 999
"Logitech Speaker Lapdesk N700" 999
+ "Logitech G35 Headset" 999
"Logitech USB Headset" 999
+ "Logitech USB Headset H540" 999
"Logitech Wireless Headset" 999
"Plantronics GameCom 780" 999
"Plantronics USB Headset" 999
@@ -50,6 +54,7 @@ USB-Audio.pcm.iec958_device {
"Scarlett 2i2 USB" 999
"Scarlett 2i4 USB" 999
"Sennheiser USB headset" 999
+ "SWTOR Gaming Headset by Razer" 999
"USB Device 0x46d:0x992" 999
}
--
2.1.3

View File

@ -1,166 +0,0 @@
From b14c49ab3d09f0e678209216a5e38934d904da3d Mon Sep 17 00:00:00 2001
From: Jussi Laako <jussi@sonarnerd.net>
Date: Fri, 21 Nov 2014 16:04:47 +0200
Subject: [PATCH 56/60] pcm: Fix DSD sample format endianess and add big-endian
format
This patch adds big-endian DSD sample format and fixes return value of DSD
formats for snd_pcm_format_little_endian().
Signed-off-by: Jussi Laako <jussi@sonarnerd.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/pcm.h | 6 +++++-
include/sound/asound.h | 4 +++-
src/pcm/pcm.c | 4 ++++
src/pcm/pcm_misc.c | 17 ++++++++++++++---
4 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/include/pcm.h b/include/pcm.h
index db88ad5ee41a..0655e7f43ef6 100644
--- a/include/pcm.h
+++ b/include/pcm.h
@@ -213,7 +213,11 @@ typedef enum _snd_pcm_format {
SND_PCM_FORMAT_DSD_U16_LE,
/* Direct Stream Digital (DSD) in 4-byte samples (x32) */
SND_PCM_FORMAT_DSD_U32_LE,
- SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_DSD_U32_LE,
+ /* Direct Stream Digital (DSD) in 2-byte samples (x16) */
+ SND_PCM_FORMAT_DSD_U16_BE,
+ /* Direct Stream Digital (DSD) in 4-byte samples (x32) */
+ SND_PCM_FORMAT_DSD_U32_BE,
+ SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_DSD_U32_BE,
#if __BYTE_ORDER == __LITTLE_ENDIAN
/** Signed 16 bit CPU endian */
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 6ee586728df9..941d32f007dc 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -220,7 +220,9 @@ typedef int __bitwise snd_pcm_format_t;
#define SNDRV_PCM_FORMAT_DSD_U8 ((__force snd_pcm_format_t) 48) /* DSD, 1-byte samples DSD (x8) */
#define SNDRV_PCM_FORMAT_DSD_U16_LE ((__force snd_pcm_format_t) 49) /* DSD, 2-byte samples DSD (x16), little endian */
#define SNDRV_PCM_FORMAT_DSD_U32_LE ((__force snd_pcm_format_t) 50) /* DSD, 4-byte samples DSD (x32), little endian */
-#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U32_LE
+#define SNDRV_PCM_FORMAT_DSD_U16_BE ((__force snd_pcm_format_t) 51) /* DSD, 2-byte samples DSD (x16), big endian */
+#define SNDRV_PCM_FORMAT_DSD_U32_BE ((__force snd_pcm_format_t) 52) /* DSD, 4-byte samples DSD (x32), big endian */
+#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U32_BE
#ifdef SNDRV_LITTLE_ENDIAN
#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index 4a7be6c1a55f..39042566ae32 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -1566,6 +1566,8 @@ static const char *const snd_pcm_format_names[] = {
FORMAT(DSD_U8),
FORMAT(DSD_U16_LE),
FORMAT(DSD_U32_LE),
+ FORMAT(DSD_U16_BE),
+ FORMAT(DSD_U32_BE),
};
static const char *const snd_pcm_format_aliases[SND_PCM_FORMAT_LAST+1] = {
@@ -1626,6 +1628,8 @@ static const char *const snd_pcm_format_descriptions[] = {
FORMATD(DSD_U8, "Direct Stream Digital, 1-byte (x8), oldest bit in MSB"),
FORMATD(DSD_U16_LE, "Direct Stream Digital, 2-byte (x16), little endian, oldest bits in MSB"),
FORMATD(DSD_U32_LE, "Direct Stream Digital, 4-byte (x32), little endian, oldest bits in MSB"),
+ FORMATD(DSD_U16_BE, "Direct Stream Digital, 2-byte (x16), big endian, oldest bits in MSB"),
+ FORMATD(DSD_U32_BE, "Direct Stream Digital, 4-byte (x32), big endian, oldest bits in MSB"),
};
static const char *const snd_pcm_type_names[] = {
diff --git a/src/pcm/pcm_misc.c b/src/pcm/pcm_misc.c
index 92721796aa1f..5870f82c0b4c 100644
--- a/src/pcm/pcm_misc.c
+++ b/src/pcm/pcm_misc.c
@@ -65,6 +65,8 @@ int snd_pcm_format_signed(snd_pcm_format_t format)
case SNDRV_PCM_FORMAT_DSD_U8:
case SNDRV_PCM_FORMAT_DSD_U16_LE:
case SNDRV_PCM_FORMAT_DSD_U32_LE:
+ case SNDRV_PCM_FORMAT_DSD_U16_BE:
+ case SNDRV_PCM_FORMAT_DSD_U32_BE:
return 0;
default:
return -EINVAL;
@@ -137,6 +139,8 @@ int snd_pcm_format_little_endian(snd_pcm_format_t format)
case SNDRV_PCM_FORMAT_U24_3LE:
case SNDRV_PCM_FORMAT_U20_3LE:
case SNDRV_PCM_FORMAT_U18_3LE:
+ case SNDRV_PCM_FORMAT_DSD_U16_LE:
+ case SNDRV_PCM_FORMAT_DSD_U32_LE:
return 1;
case SNDRV_PCM_FORMAT_S16_BE:
case SNDRV_PCM_FORMAT_U16_BE:
@@ -153,9 +157,8 @@ int snd_pcm_format_little_endian(snd_pcm_format_t format)
case SNDRV_PCM_FORMAT_U24_3BE:
case SNDRV_PCM_FORMAT_U20_3BE:
case SNDRV_PCM_FORMAT_U18_3BE:
- case SNDRV_PCM_FORMAT_DSD_U8:
- case SNDRV_PCM_FORMAT_DSD_U16_LE:
- case SNDRV_PCM_FORMAT_DSD_U32_LE:
+ case SNDRV_PCM_FORMAT_DSD_U16_BE:
+ case SNDRV_PCM_FORMAT_DSD_U32_BE:
return 0;
default:
return -EINVAL;
@@ -208,6 +211,7 @@ int snd_pcm_format_width(snd_pcm_format_t format)
case SNDRV_PCM_FORMAT_U16_LE:
case SNDRV_PCM_FORMAT_U16_BE:
case SNDRV_PCM_FORMAT_DSD_U16_LE:
+ case SNDRV_PCM_FORMAT_DSD_U16_BE:
return 16;
case SNDRV_PCM_FORMAT_S18_3LE:
case SNDRV_PCM_FORMAT_S18_3BE:
@@ -235,6 +239,7 @@ int snd_pcm_format_width(snd_pcm_format_t format)
case SNDRV_PCM_FORMAT_FLOAT_LE:
case SNDRV_PCM_FORMAT_FLOAT_BE:
case SNDRV_PCM_FORMAT_DSD_U32_LE:
+ case SNDRV_PCM_FORMAT_DSD_U32_BE:
return 32;
case SNDRV_PCM_FORMAT_FLOAT64_LE:
case SNDRV_PCM_FORMAT_FLOAT64_BE:
@@ -269,6 +274,7 @@ int snd_pcm_format_physical_width(snd_pcm_format_t format)
case SNDRV_PCM_FORMAT_U16_LE:
case SNDRV_PCM_FORMAT_U16_BE:
case SNDRV_PCM_FORMAT_DSD_U16_LE:
+ case SNDRV_PCM_FORMAT_DSD_U16_BE:
return 16;
case SNDRV_PCM_FORMAT_S18_3LE:
case SNDRV_PCM_FORMAT_S18_3BE:
@@ -296,6 +302,7 @@ int snd_pcm_format_physical_width(snd_pcm_format_t format)
case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE:
case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE:
case SNDRV_PCM_FORMAT_DSD_U32_LE:
+ case SNDRV_PCM_FORMAT_DSD_U32_BE:
return 32;
case SNDRV_PCM_FORMAT_FLOAT64_LE:
case SNDRV_PCM_FORMAT_FLOAT64_BE:
@@ -328,6 +335,7 @@ ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples)
case SNDRV_PCM_FORMAT_U16_LE:
case SNDRV_PCM_FORMAT_U16_BE:
case SNDRV_PCM_FORMAT_DSD_U16_LE:
+ case SNDRV_PCM_FORMAT_DSD_U16_BE:
return samples * 2;
case SNDRV_PCM_FORMAT_S18_3LE:
case SNDRV_PCM_FORMAT_S18_3BE:
@@ -353,6 +361,7 @@ ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples)
case SNDRV_PCM_FORMAT_FLOAT_LE:
case SNDRV_PCM_FORMAT_FLOAT_BE:
case SNDRV_PCM_FORMAT_DSD_U32_LE:
+ case SNDRV_PCM_FORMAT_DSD_U32_BE:
return samples * 4;
case SNDRV_PCM_FORMAT_FLOAT64_LE:
case SNDRV_PCM_FORMAT_FLOAT64_BE:
@@ -400,6 +409,8 @@ u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format)
case SNDRV_PCM_FORMAT_DSD_U8:
case SNDRV_PCM_FORMAT_DSD_U16_LE:
case SNDRV_PCM_FORMAT_DSD_U32_LE:
+ case SNDRV_PCM_FORMAT_DSD_U16_BE:
+ case SNDRV_PCM_FORMAT_DSD_U32_BE:
return 0x6969696969696969ULL;
#ifdef SNDRV_LITTLE_ENDIAN
case SNDRV_PCM_FORMAT_U16_LE:
--
2.1.3

View File

@ -1,42 +0,0 @@
From c0a708180fa22133940c4bc50fbc627801f188eb Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Fri, 21 Nov 2014 15:20:48 +0100
Subject: [PATCH 57/60] mixer: Fix inclusion of config.h
config.h wasn't read or read too late in some files in src/mixer.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/mixer/simple.c | 1 +
src/mixer/simple_none.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/mixer/simple.c b/src/mixer/simple.c
index ec22a9c7d237..fd9ba93ee791 100644
--- a/src/mixer/simple.c
+++ b/src/mixer/simple.c
@@ -36,6 +36,7 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <math.h>
+#include "config.h"
#include "mixer_local.h"
#include "mixer_simple.h"
diff --git a/src/mixer/simple_none.c b/src/mixer/simple_none.c
index 1c2774acbc35..4e556604d6c3 100644
--- a/src/mixer/simple_none.c
+++ b/src/mixer/simple_none.c
@@ -39,8 +39,8 @@
#include <math.h>
#include <limits.h>
#include <alsa/asoundlib.h>
-#include "mixer_simple.h"
#include "config.h"
+#include "mixer_simple.h"
#ifndef DOC_HIDDEN
--
2.1.3

View File

@ -1,40 +0,0 @@
From b779f6f43204c43f231b77858ba023a16de54568 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Fri, 21 Nov 2014 15:22:01 +0100
Subject: [PATCH 58/60] mixer: Fix unused parameter warnings
mixer_simple.h:35:64: warning: unused parameter 'mixer' [-Wunused-parameter]
static inline int snd_mixer_simple_basic_register(snd_mixer_t *mixer,
^
mixer_simple.h:36:40: warning: unused parameter 'options' [-Wunused-parameter]
struct snd_mixer_selem_regopt *options,
^
mixer_simple.h:37:29: warning: unused parameter 'classp' [-Wunused-parameter]
snd_mixer_class_t **classp)
^
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/mixer/mixer_simple.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/mixer/mixer_simple.h b/src/mixer/mixer_simple.h
index 116eebd92f65..f6117da85b37 100644
--- a/src/mixer/mixer_simple.h
+++ b/src/mixer/mixer_simple.h
@@ -32,9 +32,9 @@ int snd_mixer_simple_none_register(snd_mixer_t *mixer, struct snd_mixer_selem_re
#ifdef HAVE_LIBDL
int snd_mixer_simple_basic_register(snd_mixer_t *mixer, struct snd_mixer_selem_regopt *options, snd_mixer_class_t **classp);
#else
-static inline int snd_mixer_simple_basic_register(snd_mixer_t *mixer,
- struct snd_mixer_selem_regopt *options,
- snd_mixer_class_t **classp)
+static inline int snd_mixer_simple_basic_register(snd_mixer_t *mixer ATTRIBUTE_UNUSED,
+ struct snd_mixer_selem_regopt *options ATTRIBUTE_UNUSED,
+ snd_mixer_class_t **classp ATTRIBUTE_UNUSED)
{
return -ENXIO;
}
--
2.1.3

View File

@ -1,42 +0,0 @@
From 72c8b07b2a514261c2cb28558307b5fcb017b05e Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Fri, 21 Nov 2014 15:25:30 +0100
Subject: [PATCH 59/60] ucm: Fix uninitialized err in snd_use_case_set()
The compiler warns like:
main.c:1664:9: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized]
and actually there are slight code paths that slip.
This patch adds the proper initializations to 0 to return the success
code in these code paths.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/ucm/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/ucm/main.c b/src/ucm/main.c
index 049472827121..37ae4c84aa64 100644
--- a/src/ucm/main.c
+++ b/src/ucm/main.c
@@ -1443,7 +1443,7 @@ static int set_verb_user(snd_use_case_mgr_t *uc_mgr,
const char *verb_name)
{
struct use_case_verb *verb;
- int err;
+ int err = 0;
if (uc_mgr->active_verb &&
strcmp(uc_mgr->active_verb->name, verb_name) == 0)
@@ -1625,7 +1625,7 @@ int snd_use_case_set(snd_use_case_mgr_t *uc_mgr,
const char *value)
{
char *str, *str1;
- int err;
+ int err = 0;
pthread_mutex_lock(&uc_mgr->mutex);
if (strcmp(identifier, "_verb") == 0)
--
2.1.3

View File

@ -1,49 +0,0 @@
From a649c4b1a0c728d5d27c8530ed729a41834d24d2 Mon Sep 17 00:00:00 2001
From: Tim Cussins <timcussins@eml.cc>
Date: Tue, 25 Nov 2014 14:44:54 +0000
Subject: [PATCH 60/60] pcm: Fix assorted tstamp_type bugs/omissions.
Just a couple of quick fixes related to tstamp_type.
- snd_pcm_sw_params(): copy tstamp_type field
- snd_pcm_tstamp_type_name(): fix argument type
- snd_pcm_dump_sw_setup(): fix dumping of tstamp_type field
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index 39042566ae32..baa47c73fa4d 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -897,6 +897,7 @@ int snd_pcm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
if (err < 0)
return err;
pcm->tstamp_mode = params->tstamp_mode;
+ pcm->tstamp_type = params->tstamp_type;
pcm->period_step = params->period_step;
pcm->avail_min = params->avail_min;
pcm->period_event = sw_get_period_event(params);
@@ -1843,7 +1844,7 @@ const char *snd_pcm_tstamp_mode_name(snd_pcm_tstamp_t mode)
* \param mode PCM tstamp type
* \return ascii name of PCM tstamp type setting
*/
-const char *snd_pcm_tstamp_type_name(snd_pcm_tstamp_t type)
+const char *snd_pcm_tstamp_type_name(snd_pcm_tstamp_type_t type)
{
if (type > SND_PCM_TSTAMP_TYPE_LAST)
return NULL;
@@ -1924,7 +1925,7 @@ int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out)
return -EIO;
}
snd_output_printf(out, " tstamp_mode : %s\n", snd_pcm_tstamp_mode_name(pcm->tstamp_mode));
- snd_output_printf(out, " tstamp_type : %s\n", snd_pcm_tstamp_type_name(pcm->tstamp_mode));
+ snd_output_printf(out, " tstamp_type : %s\n", snd_pcm_tstamp_type_name(pcm->tstamp_type));
snd_output_printf(out, " period_step : %d\n", pcm->period_step);
snd_output_printf(out, " avail_min : %ld\n", pcm->avail_min);
snd_output_printf(out, " period_event : %i\n", pcm->period_event);
--
2.1.3

View File

@ -1,50 +0,0 @@
From 93b0e9ca85762c2b863434b2617147f806c7e3e3 Mon Sep 17 00:00:00 2001
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Date: Sat, 29 Nov 2014 01:03:34 +0900
Subject: [PATCH] hwdep: add OXFW driver support
Linux 3.19 newly support this driver. By hardware dependent interface,
userspace applications can get hardware information, lock/unlock kernel
streaming and receive lock status event.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/hwdep.h | 3 ++-
include/sound/asound.h | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/hwdep.h b/include/hwdep.h
index ad8bb4972818..3d3c31b2f068 100644
--- a/include/hwdep.h
+++ b/include/hwdep.h
@@ -73,8 +73,9 @@ typedef enum _snd_hwdep_iface {
SND_HWDEP_IFACE_FW_DICE, /**< TC DICE FireWire device */
SND_HWDEP_IFACE_FW_FIREWORKS, /**< Echo Audio Fireworks based device */
SND_HWDEP_IFACE_FW_BEBOB, /**< BridgeCo BeBoB based device */
+ SND_HWDEP_IFACE_FW_OXFW, /**< Oxford OXFW970/971 based device */
- SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_FW_BEBOB /**< last known hwdep interface */
+ SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_FW_OXFW /**< last known hwdep interface */
} snd_hwdep_iface_t;
/** open for reading */
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 941d32f007dc..1f23cd635957 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -96,9 +96,10 @@ enum {
SNDRV_HWDEP_IFACE_FW_DICE, /* TC DICE FireWire device */
SNDRV_HWDEP_IFACE_FW_FIREWORKS, /* Echo Audio Fireworks based device */
SNDRV_HWDEP_IFACE_FW_BEBOB, /* BridgeCo BeBoB based device */
+ SNDRV_HWDEP_IFACE_FW_OXFW, /* Oxford OXFW970/971 based device */
/* Don't forget to change the following: */
- SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_FW_BEBOB
+ SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_FW_OXFW
};
struct snd_hwdep_info {
--
2.2.2

View File

@ -1,33 +0,0 @@
From b2ed0aa9f28979f125a9db0548cfd38ac2334775 Mon Sep 17 00:00:00 2001
From: Anssi Hannula <anssi.hannula@iki.fi>
Date: Tue, 30 Dec 2014 20:46:11 +0200
Subject: [PATCH] pcm: fix buffer overflow in snd_pcm_chmap_print()
The size argument is wrong for one of the snprintf() calls in
snd_pcm_chmap_print(), allowing an overflow to happen (the user-provided
buffer may be written data up to 2x its actual size).
Seen in an user report here: http://trac.kodi.tv/ticket/15641
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index baa47c73fa4d..e74e02fc568f 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -7621,7 +7621,7 @@ int snd_pcm_chmap_print(const snd_pcm_chmap_t *map, size_t maxlen, char *buf)
return -ENOMEM;
}
if (map->pos[i] & SND_CHMAP_DRIVER_SPEC)
- len += snprintf(buf + len, maxlen, "%d", p);
+ len += snprintf(buf + len, maxlen - len, "%d", p);
else {
const char *name = chmap_names[p];
if (name)
--
2.2.2

View File

@ -1,39 +0,0 @@
From f47480af37eebe4b89020449077d731ad25abc76 Mon Sep 17 00:00:00 2001
From: "Lu, Han" <han.lu@intel.com>
Date: Wed, 14 Jan 2015 09:08:30 +0800
Subject: [PATCH] control: enable octal and hexadecimal parse
Use zero-base for strtol(), so get_integer() and get_integer64()
can parse decimal, octal and hexadecimal data from input string.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/control/ctlparse.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/control/ctlparse.c b/src/control/ctlparse.c
index 978977dbc3db..8d6c3859bec4 100644
--- a/src/control/ctlparse.c
+++ b/src/control/ctlparse.c
@@ -59,7 +59,7 @@ static long get_integer(const char **ptr, long min, long max)
goto out;
s = p;
- val = strtol(s, &p, 10);
+ val = strtol(s, &p, 0);
if (*p == '.') {
p++;
strtol(p, &p, 10);
@@ -87,7 +87,7 @@ static long long get_integer64(const char **ptr, long long min, long long max)
goto out;
s = p;
- val = strtol(s, &p, 10);
+ val = strtol(s, &p, 0);
if (*p == '.') {
p++;
strtol(p, &p, 10);
--
2.2.2

View File

@ -1,50 +0,0 @@
From 187ba1d8cde0f866d40c1503cb11c3751a8255e2 Mon Sep 17 00:00:00 2001
From: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
Date: Wed, 14 Jan 2015 15:42:45 +0100
Subject: [PATCH] autotools: fix ucm partial build
When --disable-ucm configure option is specified,
don't install related include file.
Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/Makefile.am | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/Makefile.am b/include/Makefile.am
index 0127d5c4b200..4baa03af69e1 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -5,7 +5,7 @@ alsaincludedir = ${includedir}/alsa
alsainclude_HEADERS = asoundlib.h asoundef.h \
version.h global.h input.h output.h error.h \
- conf.h control.h iatomic.h use-case.h
+ conf.h control.h iatomic.h
if BUILD_CTL_PLUGIN_EXT
alsainclude_HEADERS += control_external.h
@@ -17,7 +17,7 @@ if BUILD_PCM_PLUGIN
alsainclude_HEADERS += pcm_plugin.h
endif
if BUILD_PCM_PLUGIN_RATE
-alsainclude_HEADERS += pcm_rate.h
+alsainclude_HEADERS += pcm_rate.h
endif
if BUILD_PCM_PLUGIN_EXTPLUG
alsainclude_HEADERS += pcm_external.h pcm_extplug.h
@@ -46,6 +46,10 @@ if BUILD_SEQ
alsainclude_HEADERS += seq_event.h seq.h seqmid.h seq_midi_event.h
endif
+if BUILD_UCM
+alsainclude_HEADERS += use-case.h
+endif
+
if BUILD_ALISP
alsainclude_HEADERS += alisp.h
endif
--
2.2.2

View File

@ -1,148 +0,0 @@
From 3b5fac6d10c580aee14642df8f94caad15dd53f0 Mon Sep 17 00:00:00 2001
From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Date: Thu, 15 Jan 2015 17:27:29 +0100
Subject: [PATCH] conf/ucm: GoogleNyan: Add configuration
Taken from the ChromeOS sources, this configuration should apply to all
Nyan boards from Google, so far HP Chromebook 14 (nyan-blaze) and Acer
Chromebook 13 (nyan-big).
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
configure.ac | 1 +
src/conf/ucm/GoogleNyan/GoogleNyan.conf | 5 +++
src/conf/ucm/GoogleNyan/HiFi.conf | 77 +++++++++++++++++++++++++++++++++
src/conf/ucm/GoogleNyan/Makefile.am | 4 ++
src/conf/ucm/Makefile.am | 2 +-
5 files changed, 88 insertions(+), 1 deletion(-)
create mode 100644 src/conf/ucm/GoogleNyan/GoogleNyan.conf
create mode 100644 src/conf/ucm/GoogleNyan/HiFi.conf
create mode 100644 src/conf/ucm/GoogleNyan/Makefile.am
diff --git a/configure.ac b/configure.ac
index 734163c8c321..916280b8934a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -654,6 +654,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
src/conf/ucm/SDP4430/Makefile \
src/conf/ucm/tegraalc5632/Makefile \
src/conf/ucm/PAZ00/Makefile \
+ src/conf/ucm/GoogleNyan/Makefile \
modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile \
alsalisp/Makefile aserver/Makefile \
test/Makefile test/lsb/Makefile \
diff --git a/src/conf/ucm/GoogleNyan/GoogleNyan.conf b/src/conf/ucm/GoogleNyan/GoogleNyan.conf
new file mode 100644
index 000000000000..efe6ad8a5c6e
--- /dev/null
+++ b/src/conf/ucm/GoogleNyan/GoogleNyan.conf
@@ -0,0 +1,5 @@
+Comment "Nyan internal card"
+SectionUseCase."HiFi" {
+ File "HiFi.conf"
+ Comment "Default"
+}
diff --git a/src/conf/ucm/GoogleNyan/HiFi.conf b/src/conf/ucm/GoogleNyan/HiFi.conf
new file mode 100644
index 000000000000..b28fe917162d
--- /dev/null
+++ b/src/conf/ucm/GoogleNyan/HiFi.conf
@@ -0,0 +1,77 @@
+SectionVerb {
+ EnableSequence [
+ cdev "hw:GoogleNyan"
+ cset "name='Left Speaker Mixer Left DAC Switch' on"
+ cset "name='Right Speaker Mixer Right DAC Switch' on"
+ cset "name='Headphone Left Switch' on"
+ cset "name='Headphone Right Switch' on"
+ cset "name='Digital EQ 3 Band Switch' off"
+ cset "name='Digital EQ 5 Band Switch' off"
+ cset "name='Digital EQ 7 Band Switch' off"
+ cset "name='Biquad Switch' off"
+ cset "name='Filter Mode' Music"
+ cset "name='ADC Oversampling Rate' 0"
+ cset "name='DMIC Mux' DMIC"
+ cset "name='MIC2 Mux' IN34"
+ cset "name='Right ADC Mixer MIC2 Switch' on"
+ cset "name='Left ADC Mixer MIC2 Switch' on"
+ cset "name='MIC2 Volume' 10"
+ cset "name='MIC2 Boost Volume' 0"
+ cset "name='Mic Jack Switch' off"
+ cset "name='Int Mic Switch' on"
+ cset "name='ADCR Boost Volume' 4"
+ cset "name='ADCL Boost Volume' 4"
+ cset "name='ADCR Volume' 11"
+ cset "name='ADCL Volume' 11"
+ cset "name='Left Speaker Mixer Left DAC Switch' on"
+ cset "name='Right Speaker Mixer Right DAC Switch' on"
+ cset "name='Speaker Left Mixer Volume' 2"
+ cset "name='Speaker Right Mixer Volume' 2"
+ cset "name='Record Path DC Blocking' on"
+ cset "name='Playback Path DC Blocking' on"
+ cset "name='Headphone Left Switch' on"
+ cset "name='Headphone Right Switch' on"
+ cset "name='Headphones Switch' off"
+ cset "name='Speaker Left Switch' on"
+ cset "name='Speaker Right Switch' on"
+ cset "name='Speakers Switch' on"
+ ]
+ DisableSequence [
+ ]
+}
+
+SectionDevice."Headphone".0 {
+ Value {
+ OutputDspName ""
+ }
+ EnableSequence [
+ cdev "hw:GoogleNyan"
+ cset "name='Speakers Switch' off"
+ cset "name='Headphones Switch' on"
+ ]
+ DisableSequence [
+ cdev "hw:GoogleNyan"
+ cset "name='Headphones Switch' off"
+ cset "name='Speakers Switch' on"
+ ]
+}
+
+SectionDevice."Mic".0 {
+ Value {
+ CaptureControl "MIC2"
+ }
+ EnableSequence [
+ cdev "hw:GoogleNyan"
+ cset "name='Int Mic Switch' off"
+ cset "name='DMIC Mux' ADC"
+ cset "name='Mic Jack Switch' on"
+ cset "name='Record Path DC Blocking' on"
+ ]
+ DisableSequence [
+ cdev "hw:GoogleNyan"
+ cset "name='Mic Jack Switch' off"
+ cset "name='DMIC Mux' DMIC"
+ cset "name='Int Mic Switch' on"
+ cset "name='Record Path DC Blocking' off"
+ ]
+}
diff --git a/src/conf/ucm/GoogleNyan/Makefile.am b/src/conf/ucm/GoogleNyan/Makefile.am
new file mode 100644
index 000000000000..47c7fc9d7976
--- /dev/null
+++ b/src/conf/ucm/GoogleNyan/Makefile.am
@@ -0,0 +1,4 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/GoogleNyan
+ucm_DATA = GoogleNyan.conf HiFi.conf
+EXTRA_DIST = $(ucm_DATA)
diff --git a/src/conf/ucm/Makefile.am b/src/conf/ucm/Makefile.am
index bde89dfea440..14fc7aee8e6c 100644
--- a/src/conf/ucm/Makefile.am
+++ b/src/conf/ucm/Makefile.am
@@ -1 +1 @@
-SUBDIRS=DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632 PAZ00
+SUBDIRS=DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632 PAZ00 GoogleNyan
--
2.2.2

View File

@ -1,168 +0,0 @@
From 6ea14c3624c0cbcf90e7d5859b4af629523b8d82 Mon Sep 17 00:00:00 2001
From: "Lu, Han" <han.lu@intel.com>
Date: Thu, 22 Jan 2015 09:32:47 +0800
Subject: [PATCH] ucm: add binary configure file parse
with cset command, UCM set kcontrol parameters directly:
cset "name='<KCONTROL_NAME>' 1<,2,3,...>"
This patch enables UCM to set kcontrol with parameters from
configure file:
cset-bin-file "name='<KCONTROL_NAME>' <path/to/file>"
where "cset-bin-file" is a newly added keyword alongside of "cset",
to indicate cset with binary data in file.
The binary data in file is parameter for audio DSPs, and it's just
passed by UCM/ALSA as raw data. The data type of parameter elements
must be byte, and the count must matches driver definition.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/ucm/main.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++---
src/ucm/parser.c | 10 +++++++++
src/ucm/ucm_local.h | 1 +
3 files changed, 73 insertions(+), 3 deletions(-)
diff --git a/src/ucm/main.c b/src/ucm/main.c
index 37ae4c84aa64..182f17476cbe 100644
--- a/src/ucm/main.c
+++ b/src/ucm/main.c
@@ -34,6 +34,7 @@
#include <ctype.h>
#include <stdarg.h>
#include <pthread.h>
+#include <sys/stat.h>
/*
* misc
@@ -160,11 +161,65 @@ static int open_ctl(snd_use_case_mgr_t *uc_mgr,
return 0;
}
+static int binary_file_parse(snd_ctl_elem_value_t *dst,
+ snd_ctl_elem_info_t *info,
+ const char *filepath)
+{
+ int err = 0;
+ int fd;
+ struct stat st;
+ size_t sz;
+ ssize_t sz_read;
+ char *res;
+ snd_ctl_elem_type_t type;
+ unsigned int idx, count;
+
+ type = snd_ctl_elem_info_get_type(info);
+ if (type != SND_CTL_ELEM_TYPE_BYTES) {
+ uc_error("only support byte type!");
+ err = -EINVAL;
+ return err;
+ }
+ fd = open(filepath, O_RDONLY);
+ if (fd < 0) {
+ err = -errno;
+ return err;
+ }
+ if (stat(filepath, &st) == -1) {
+ err = -errno;
+ goto __fail;
+ }
+ sz = st.st_size;
+ count = snd_ctl_elem_info_get_count(info);
+ if (sz != count || sz > sizeof(dst->value.bytes)) {
+ uc_error("invalid parameter size %d!", sz);
+ err = -EINVAL;
+ goto __fail;
+ }
+ res = malloc(sz);
+ if (res == NULL) {
+ err = -ENOMEM;
+ goto __fail;
+ }
+ sz_read = read(fd, res, sz);
+ if (sz_read < 0 || (size_t)sz_read != sz) {
+ err = -errno;
+ goto __fail_read;
+ }
+ for (idx = 0; idx < sz; idx++)
+ snd_ctl_elem_value_set_byte(dst, idx, *(res + idx));
+ __fail_read:
+ free(res);
+ __fail:
+ close(fd);
+ return err;
+}
+
extern int __snd_ctl_ascii_elem_id_parse(snd_ctl_elem_id_t *dst,
const char *str,
const char **ret_ptr);
-static int execute_cset(snd_ctl_t *ctl, const char *cset)
+static int execute_cset(snd_ctl_t *ctl, const char *cset, unsigned int type)
{
const char *pos;
int err;
@@ -194,7 +249,10 @@ static int execute_cset(snd_ctl_t *ctl, const char *cset)
err = snd_ctl_elem_info(ctl, info);
if (err < 0)
goto __fail;
- err = snd_ctl_ascii_value_parse(ctl, value, info, pos);
+ if (type == SEQUENCE_ELEMENT_TYPE_CSET_BIN_FILE)
+ err = binary_file_parse(value, info, pos);
+ else
+ err = snd_ctl_ascii_value_parse(ctl, value, info, pos);
if (err < 0)
goto __fail;
err = snd_ctl_elem_write(ctl, value);
@@ -239,6 +297,7 @@ static int execute_sequence(snd_use_case_mgr_t *uc_mgr,
goto __fail_nomem;
break;
case SEQUENCE_ELEMENT_TYPE_CSET:
+ case SEQUENCE_ELEMENT_TYPE_CSET_BIN_FILE:
if (cdev == NULL) {
const char *cdev1 = NULL, *cdev2 = NULL;
err = get_value3(&cdev1, "PlaybackCTL",
@@ -274,7 +333,7 @@ static int execute_sequence(snd_use_case_mgr_t *uc_mgr,
goto __fail;
}
}
- err = execute_cset(ctl, s->data.cset);
+ err = execute_cset(ctl, s->data.cset, s->type);
if (err < 0) {
uc_error("unable to execute cset '%s'\n", s->data.cset);
goto __fail;
diff --git a/src/ucm/parser.c b/src/ucm/parser.c
index d7517f69e84b..9e1cb41a2862 100644
--- a/src/ucm/parser.c
+++ b/src/ucm/parser.c
@@ -306,6 +306,16 @@ static int parse_sequence(snd_use_case_mgr_t *uc_mgr ATTRIBUTE_UNUSED,
continue;
}
+ if (strcmp(cmd, "cset-bin-file") == 0) {
+ curr->type = SEQUENCE_ELEMENT_TYPE_CSET_BIN_FILE;
+ err = parse_string(n, &curr->data.cset);
+ if (err < 0) {
+ uc_error("error: cset-bin-file requires a string!");
+ return err;
+ }
+ continue;
+ }
+
if (strcmp(cmd, "usleep") == 0) {
curr->type = SEQUENCE_ELEMENT_TYPE_SLEEP;
err = snd_config_get_integer(n, &curr->data.sleep);
diff --git a/src/ucm/ucm_local.h b/src/ucm/ucm_local.h
index 87f14a299903..c1655c70504f 100644
--- a/src/ucm/ucm_local.h
+++ b/src/ucm/ucm_local.h
@@ -47,6 +47,7 @@
#define SEQUENCE_ELEMENT_TYPE_CSET 2
#define SEQUENCE_ELEMENT_TYPE_SLEEP 3
#define SEQUENCE_ELEMENT_TYPE_EXEC 4
+#define SEQUENCE_ELEMENT_TYPE_CSET_BIN_FILE 5
struct ucm_value {
struct list_head list;
--
2.2.2

View File

@ -1,323 +0,0 @@
From dbb7eca6559e970bd015eaa95a9e0525660fa09e Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Wed, 28 Jan 2015 16:21:14 +0100
Subject: [PATCH] Remove unused hostname resolution in shm plugins and aserver
PCM and control shm plugins and aserver have some codes to resolve the
host address and check whether it's a local host although the given
address is never used. In addition, the code contains gethostbyname()
that is known to be obsoleted. So, let's get rid of all these unused
codes.
The host configuration item is still accepted (but just ignored) for
keeping the compatibility.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
aserver/aserver.c | 24 +-------------------
include/aserver.h | 1
src/control/control_shm.c | 49 +----------------------------------------
src/pcm/pcm_shm.c | 53 +--------------------------------------------
src/socket.c | 54 ----------------------------------------------
5 files changed, 6 insertions(+), 175 deletions(-)
--- a/aserver/aserver.c
+++ b/aserver/aserver.c
@@ -1013,11 +1013,10 @@ int main(int argc, char **argv)
snd_config_t *conf;
snd_config_iterator_t i, next;
const char *sockname = NULL;
- const char *host = NULL;
long port = -1;
int err;
char *srvname;
- struct hostent *h;
+
command = argv[0];
while ((c = getopt_long(argc, argv, "h", long_options, 0)) != -1) {
switch (c) {
@@ -1055,14 +1054,8 @@ int main(int argc, char **argv)
continue;
if (strcmp(id, "comment") == 0)
continue;
- if (strcmp(id, "host") == 0) {
- err = snd_config_get_string(n, &host);
- if (err < 0) {
- ERROR("Invalid type for %s", id);
- return 1;
- }
+ if (strcmp(id, "host") == 0)
continue;
- }
if (strcmp(id, "socket") == 0) {
err = snd_config_get_string(n, &sockname);
if (err < 0) {
@@ -1082,19 +1075,6 @@ int main(int argc, char **argv)
ERROR("Unknown field %s", id);
return 1;
}
- if (!host) {
- ERROR("host is not defined");
- return 1;
- }
- h = gethostbyname(host);
- if (!h) {
- ERROR("Cannot resolve %s", host);
- return 1;
- }
- if (!snd_is_local(h)) {
- ERROR("%s is not the local host", host);
- return 1;
- }
if (!sockname && port < 0) {
ERROR("either socket or port need to be defined");
return 1;
--- a/include/aserver.h
+++ b/include/aserver.h
@@ -23,7 +23,6 @@
#include "../src/control/control_local.h"
int snd_receive_fd(int sock, void *data, size_t len, int *fd);
-int snd_is_local(struct hostent *hent);
typedef enum _snd_dev_type {
SND_DEV_TYPE_PCM,
--- a/src/control/control_shm.c
+++ b/src/control/control_shm.c
@@ -441,29 +441,6 @@ static int make_local_socket(const char
return sock;
}
-#if 0
-static int make_inet_socket(const char *host, int port)
-{
- struct sockaddr_in addr;
- int sock;
- struct hostent *h = gethostbyname(host);
- if (!h)
- return -ENOENT;
-
- sock = socket(PF_INET, SOCK_STREAM, 0);
- if (sock < 0)
- return -errno;
-
- addr.sin_family = AF_INET;
- addr.sin_port = htons(port);
- memcpy(&addr.sin_addr, h->h_addr_list[0], sizeof(struct in_addr));
-
- if (connect(sock, (struct sockaddr *) &addr, sizeof(addr)) < 0)
- return -errno;
- return sock;
-}
-#endif
-
int snd_ctl_shm_open(snd_ctl_t **handlep, const char *name, const char *sockname, const char *sname, int mode)
{
snd_ctl_t *ctl;
@@ -565,12 +542,10 @@ int _snd_ctl_shm_open(snd_ctl_t **handle
const char *server = NULL;
const char *ctl_name = NULL;
snd_config_t *sconfig;
- const char *host = NULL;
const char *sockname = NULL;
long port = -1;
int err;
- int local;
- struct hostent *h;
+
snd_config_for_each(i, next, conf) {
snd_config_t *n = snd_config_iterator_entry(i);
const char *id;
@@ -624,14 +599,8 @@ int _snd_ctl_shm_open(snd_ctl_t **handle
continue;
if (strcmp(id, "comment") == 0)
continue;
- if (strcmp(id, "host") == 0) {
- err = snd_config_get_string(n, &host);
- if (err < 0) {
- SNDERR("Invalid type for %s", id);
- goto _err;
- }
+ if (strcmp(id, "host") == 0)
continue;
- }
if (strcmp(id, "socket") == 0) {
err = snd_config_get_string(n, &sockname);
if (err < 0) {
@@ -653,24 +622,10 @@ int _snd_ctl_shm_open(snd_ctl_t **handle
goto _err;
}
- if (!host) {
- SNDERR("host is not defined");
- goto _err;
- }
if (!sockname) {
SNDERR("socket is not defined");
goto _err;
}
- h = gethostbyname(host);
- if (!h) {
- SNDERR("Cannot resolve %s", host);
- goto _err;
- }
- local = snd_is_local(h);
- if (!local) {
- SNDERR("%s is not the local host", host);
- goto _err;
- }
err = snd_ctl_shm_open(handlep, name, sockname, ctl_name, mode);
_err:
snd_config_delete(sconfig);
--- a/src/pcm/pcm_shm.c
+++ b/src/pcm/pcm_shm.c
@@ -654,33 +654,6 @@ static int make_local_socket(const char
return sock;
}
-#if 0
-static int make_inet_socket(const char *host, int port)
-{
- struct sockaddr_in addr;
- int sock;
- struct hostent *h = gethostbyname(host);
- if (!h)
- return -ENOENT;
-
- sock = socket(PF_INET, SOCK_STREAM, 0);
- if (sock < 0) {
- SYSERR("socket failed");
- return -errno;
- }
-
- addr.sin_family = AF_INET;
- addr.sin_port = htons(port);
- memcpy(&addr.sin_addr, h->h_addr_list[0], sizeof(struct in_addr));
-
- if (connect(sock, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
- SYSERR("connect failed");
- return -errno;
- }
- return sock;
-}
-#endif
-
/**
* \brief Creates a new shared memory PCM
* \param pcmp Returns created PCM handle
@@ -842,12 +815,10 @@ int _snd_pcm_shm_open(snd_pcm_t **pcmp,
const char *server = NULL;
const char *pcm_name = NULL;
snd_config_t *sconfig;
- const char *host = NULL;
const char *sockname = NULL;
long port = -1;
int err;
- int local;
- struct hostent *h;
+
snd_config_for_each(i, next, conf) {
snd_config_t *n = snd_config_iterator_entry(i);
const char *id;
@@ -898,14 +869,8 @@ int _snd_pcm_shm_open(snd_pcm_t **pcmp,
continue;
if (strcmp(id, "comment") == 0)
continue;
- if (strcmp(id, "host") == 0) {
- err = snd_config_get_string(n, &host);
- if (err < 0) {
- SNDERR("Invalid type for %s", id);
- goto _err;
- }
+ if (strcmp(id, "host") == 0)
continue;
- }
if (strcmp(id, "socket") == 0) {
err = snd_config_get_string(n, &sockname);
if (err < 0) {
@@ -928,24 +893,10 @@ int _snd_pcm_shm_open(snd_pcm_t **pcmp,
goto __error;
}
- if (!host) {
- SNDERR("host is not defined");
- goto _err;
- }
if (!sockname) {
SNDERR("socket is not defined");
goto _err;
}
- h = gethostbyname(host);
- if (!h) {
- SNDERR("Cannot resolve %s", host);
- goto _err;
- }
- local = snd_is_local(h);
- if (!local) {
- SNDERR("%s is not the local host", host);
- goto _err;
- }
err = snd_pcm_shm_open(pcmp, name, sockname, pcm_name, stream, mode);
__error:
snd_config_delete(sconfig);
--- a/src/socket.c
+++ b/src/socket.c
@@ -106,58 +106,4 @@ int snd_receive_fd(int sock, void *data,
*fd = *fds;
return ret;
}
-
-int snd_is_local(struct hostent *hent)
-{
- int s;
- int err;
- struct ifconf conf;
- size_t numreqs = 10;
- size_t i;
- struct in_addr *haddr = (struct in_addr*) hent->h_addr_list[0];
-
- s = socket(PF_INET, SOCK_STREAM, 0);
- if (s < 0) {
- SYSERR("socket failed");
- return -errno;
- }
-
- conf.ifc_len = numreqs * sizeof(struct ifreq);
- conf.ifc_buf = malloc((unsigned int) conf.ifc_len);
- if (! conf.ifc_buf) {
- close(s);
- return -ENOMEM;
- }
- while (1) {
- err = ioctl(s, SIOCGIFCONF, &conf);
- if (err < 0) {
- SYSERR("SIOCGIFCONF failed");
- close(s);
- return -errno;
- }
- if ((size_t)conf.ifc_len < numreqs * sizeof(struct ifreq))
- break;
- numreqs *= 2;
- conf.ifc_len = numreqs * sizeof(struct ifreq);
- conf.ifc_buf = realloc(conf.ifc_buf, (unsigned int) conf.ifc_len);
- if (! conf.ifc_buf) {
- close(s);
- return -ENOMEM;
- }
- }
- numreqs = conf.ifc_len / sizeof(struct ifreq);
- for (i = 0; i < numreqs; ++i) {
- struct ifreq *req = &conf.ifc_req[i];
- struct sockaddr_in *s_in = (struct sockaddr_in *)&req->ifr_addr;
- s_in->sin_family = AF_INET;
- err = ioctl(s, SIOCGIFADDR, req);
- if (err < 0)
- continue;
- if (haddr->s_addr == s_in->sin_addr.s_addr)
- break;
- }
- close(s);
- free(conf.ifc_buf);
- return i < numreqs;
-}
#endif

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3c074b85dde1b30e78ef4995579765833e5b693fbbd8f834c335e080cb734a6d
size 903786

3
alsa-lib-1.0.29.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:73043c35eb9636be0f4af6a240235c213f12a25feb1f04aeeac8cb7e30fcbdd0
size 905417

View File

@ -1,3 +1,76 @@
-------------------------------------------------------------------
Thu Feb 26 17:24:22 CET 2015 - tiwai@suse.de
- Updated to alsa-lib 1.0.29:
Just a version bump including previous fixes
- Drop the obsoleted patches:
0001-ucm-Document-PlaybackPCMIsDummy-and-CapturePCMIsDumm.patch
0002-ICE1712-add-surround71-pcm-definition.patch
0003-USB-Audio-Add-second-S-PDIF-device-on-Phiree-U2.patch
0004-pcm-rate-fix-hw_ptr-exceed-the-boundary.patch
0005-pcm-Provide-a-CLOCK_MONOTONIC_RAW-timestamp-type.patch
0006-Add-timestamp-type-to-sw_params-internal-only.patch
0007-pcm-Add-sw_params-API-functions-to-get-set-timestamp.patch
0008-pcm-Implement-timestamp-type-setup-in-hw-plugin.patch
0009-pcm-Implement-timestamp-type-handling-in-all-plugins.patch
0010-test-audio_time-Set-timestamp-type-explicitly.patch
0011-pcm-route-Use-get-put-labels-for-all-3-byte-formats.patch
0012-pcm-Fill-sw_params-proto-field.patch
0013-pcm-route-Use-get32-for-multi-source-route-calculati.patch
0014-pcm-Drop-snd_pcm_linear_-get-put-32_index.patch
0015-pcm-pcm_local.h-include-time.h-to-enable-CLOCK_MONOT.patch
0016-pcm-Fix-DSD-formats-userland-usability.patch
0017-Sync-include-sound-asound.h-with-3.17-rc1-kernel.patch
0018-pcm-Add-missing-signed-and-endianess-definitions-for.patch
0019-Sync-enum-snd_hwdep_iface_t-with-include-asound-asou.patch
0020-pcm-2nd-round-of-pcm_misc-DSD-fixes.patch
0021-doc-fix-cross-compiling-example.patch
0022-pcm-fix-snd_pcm_mmap_hw_avail-near-the-boundary.patch
0023-pcm-fix-return-value-of-snd_pcm_share_slave_avail.patch
0024-pcm-add-new-32-bit-DSD-sample-format.patch
0025-dmix-actually-rewind-when-running-or-being-drained.patch
0026-pcm-express-the-rewind-size-limitation-logic-better.patch
0027-pcm-handle-negative-values-from-snd_pcm_mmap_hw_avai.patch
0028-pcm-rate-use-the-snd_pcm_mmap_hw_avail-function.patch
0029-pcm-null-use-the-snd_pcm_mmap_avail-function.patch
0030-rate-handle-negative-values-from-snd_pcm_mmap_playba.patch
0031-dsnoop-rewindable-and-forwardable-logic-was-swapped.patch
0033-pcm-file-don-t-recurse-in-the-rewindable-and-forward.patch
0034-pcm-route-Fix-the-bad-condition-always-false.patch
0035-pcm-rate-hw_avail-must-not-be-negative-before-starti.patch
0036-hwdep-add-missing-declaration-for-snd_hwdep_poll_des.patch
0037-mixer-fixed-double-free.patch
0038-pcm_file-fixed-missing-free.patch
0039-sbase-fixed-missing-free.patch
0040-rawmidi-close-handle-h.patch
0041-pcm_share-fixing-missing-mutex-unlock.patch
0042-simple_abst-null-check-for-lib.patch
0043-socket-missing-socket-close.patch
0044-pcm_hooks-null-check-for-h.patch
0045-conf-return-negative-value-in-case-of-error.patch
0046-control-return-negative-value-in-case-of-error.patch
0047-pcm-return-negative-value-in-case-of-error.patch
0048-mixer-Fix-missing-hctl-handle-free-in-snd_mixer_atta.patch
0049-conf-ucm-PAZ00-add-Toshiba-AC100-Dynabook-AZ-new-con.patch
0050-USB-Audio-Add-Scarlett-2i4-USB-to-S-PDIF-blacklist.patch
0051-snd_user_file-fix-memory-leak.patch
0052-pcm-dmix-Don-t-ignore-SND_TIMER_EVENT_MSTOP.patch
0053-snd_dlsym-only-do-versioning-checks-if-built-with-ve.patch
0054-dlmisc-Remove-unused-label.patch
0055-USB-audio-Add-five-more-cards-to-IEC958-blacklist.patch
0056-pcm-Fix-DSD-sample-format-endianess-and-add-big-endi.patch
0057-mixer-Fix-inclusion-of-config.h.patch
0058-mixer-Fix-unused-parameter-warnings.patch
0059-ucm-Fix-uninitialized-err-in-snd_use_case_set.patch
0060-pcm-Fix-assorted-tstamp_type-bugs-omissions.patch
0061-hwdep-add-OXFW-driver-support.patch
0062-pcm-fix-buffer-overflow-in-snd_pcm_chmap_print.patch
0063-control-enable-octal-and-hexadecimal-parse.patch
0064-autotools-fix-ucm-partial-build.patch
0065-conf-ucm-GoogleNyan-Add-configuration.patch
0066-ucm-add-binary-configure-file-parse.patch
0067-Remove-unused-hostname-resolution-in-shm-plugins-and.patch
-------------------------------------------------------------------
Wed Jan 28 15:50:35 CET 2015 - tiwai@suse.de

138
alsa.spec
View File

@ -16,14 +16,14 @@
#
%define package_version 1.0.28
%define package_version 1.0.29
%if 0%{?suse_version} > 1200
%define _udevdir %(pkg-config --variable=udevdir udev)
%else
%define _udevdir /lib/udev
%endif
Name: alsa
Version: 1.0.28
Version: 1.0.29
Release: 0
#
Summary: Advanced Linux Sound Architecture
@ -49,72 +49,6 @@ Source40: 50-alsa.conf
Source41: install-snd-module
# Patch: alsa-lib-git-fixes.diff
# upstream fixes
Patch1: 0001-ucm-Document-PlaybackPCMIsDummy-and-CapturePCMIsDumm.patch
Patch2: 0002-ICE1712-add-surround71-pcm-definition.patch
Patch3: 0003-USB-Audio-Add-second-S-PDIF-device-on-Phiree-U2.patch
Patch4: 0004-pcm-rate-fix-hw_ptr-exceed-the-boundary.patch
Patch5: 0005-pcm-Provide-a-CLOCK_MONOTONIC_RAW-timestamp-type.patch
Patch6: 0006-Add-timestamp-type-to-sw_params-internal-only.patch
Patch7: 0007-pcm-Add-sw_params-API-functions-to-get-set-timestamp.patch
Patch8: 0008-pcm-Implement-timestamp-type-setup-in-hw-plugin.patch
Patch9: 0009-pcm-Implement-timestamp-type-handling-in-all-plugins.patch
Patch10: 0010-test-audio_time-Set-timestamp-type-explicitly.patch
Patch11: 0011-pcm-route-Use-get-put-labels-for-all-3-byte-formats.patch
Patch12: 0012-pcm-Fill-sw_params-proto-field.patch
Patch13: 0013-pcm-route-Use-get32-for-multi-source-route-calculati.patch
Patch14: 0014-pcm-Drop-snd_pcm_linear_-get-put-32_index.patch
Patch15: 0015-pcm-pcm_local.h-include-time.h-to-enable-CLOCK_MONOT.patch
Patch16: 0016-pcm-Fix-DSD-formats-userland-usability.patch
Patch17: 0017-Sync-include-sound-asound.h-with-3.17-rc1-kernel.patch
Patch18: 0018-pcm-Add-missing-signed-and-endianess-definitions-for.patch
Patch19: 0019-Sync-enum-snd_hwdep_iface_t-with-include-asound-asou.patch
Patch20: 0020-pcm-2nd-round-of-pcm_misc-DSD-fixes.patch
Patch21: 0021-doc-fix-cross-compiling-example.patch
Patch22: 0022-pcm-fix-snd_pcm_mmap_hw_avail-near-the-boundary.patch
Patch23: 0023-pcm-fix-return-value-of-snd_pcm_share_slave_avail.patch
Patch24: 0024-pcm-add-new-32-bit-DSD-sample-format.patch
Patch25: 0025-dmix-actually-rewind-when-running-or-being-drained.patch
Patch26: 0026-pcm-express-the-rewind-size-limitation-logic-better.patch
Patch27: 0027-pcm-handle-negative-values-from-snd_pcm_mmap_hw_avai.patch
Patch28: 0028-pcm-rate-use-the-snd_pcm_mmap_hw_avail-function.patch
Patch29: 0029-pcm-null-use-the-snd_pcm_mmap_avail-function.patch
Patch30: 0030-rate-handle-negative-values-from-snd_pcm_mmap_playba.patch
Patch31: 0031-dsnoop-rewindable-and-forwardable-logic-was-swapped.patch
Patch33: 0033-pcm-file-don-t-recurse-in-the-rewindable-and-forward.patch
Patch34: 0034-pcm-route-Fix-the-bad-condition-always-false.patch
Patch35: 0035-pcm-rate-hw_avail-must-not-be-negative-before-starti.patch
Patch36: 0036-hwdep-add-missing-declaration-for-snd_hwdep_poll_des.patch
Patch37: 0037-mixer-fixed-double-free.patch
Patch38: 0038-pcm_file-fixed-missing-free.patch
Patch39: 0039-sbase-fixed-missing-free.patch
Patch40: 0040-rawmidi-close-handle-h.patch
Patch41: 0041-pcm_share-fixing-missing-mutex-unlock.patch
Patch42: 0042-simple_abst-null-check-for-lib.patch
Patch43: 0043-socket-missing-socket-close.patch
Patch44: 0044-pcm_hooks-null-check-for-h.patch
Patch45: 0045-conf-return-negative-value-in-case-of-error.patch
Patch46: 0046-control-return-negative-value-in-case-of-error.patch
Patch47: 0047-pcm-return-negative-value-in-case-of-error.patch
Patch48: 0048-mixer-Fix-missing-hctl-handle-free-in-snd_mixer_atta.patch
Patch49: 0049-conf-ucm-PAZ00-add-Toshiba-AC100-Dynabook-AZ-new-con.patch
Patch50: 0050-USB-Audio-Add-Scarlett-2i4-USB-to-S-PDIF-blacklist.patch
Patch51: 0051-snd_user_file-fix-memory-leak.patch
Patch52: 0052-pcm-dmix-Don-t-ignore-SND_TIMER_EVENT_MSTOP.patch
Patch53: 0053-snd_dlsym-only-do-versioning-checks-if-built-with-ve.patch
Patch54: 0054-dlmisc-Remove-unused-label.patch
Patch55: 0055-USB-audio-Add-five-more-cards-to-IEC958-blacklist.patch
Patch56: 0056-pcm-Fix-DSD-sample-format-endianess-and-add-big-endi.patch
Patch57: 0057-mixer-Fix-inclusion-of-config.h.patch
Patch58: 0058-mixer-Fix-unused-parameter-warnings.patch
Patch59: 0059-ucm-Fix-uninitialized-err-in-snd_use_case_set.patch
Patch60: 0060-pcm-Fix-assorted-tstamp_type-bugs-omissions.patch
Patch61: 0061-hwdep-add-OXFW-driver-support.patch
Patch62: 0062-pcm-fix-buffer-overflow-in-snd_pcm_chmap_print.patch
Patch63: 0063-control-enable-octal-and-hexadecimal-parse.patch
Patch64: 0064-autotools-fix-ucm-partial-build.patch
Patch65: 0065-conf-ucm-GoogleNyan-Add-configuration.patch
Patch66: 0066-ucm-add-binary-configure-file-parse.patch
Patch67: 0067-Remove-unused-hostname-resolution-in-shm-plugins-and.patch
# rest suse patches
Patch99: alsa-lib-doxygen-avoid-crash-for-11.3.diff
# suppress timestamp in documents
@ -185,72 +119,6 @@ Architecture.
%prep
%setup -q -n alsa-lib-%{package_version}
# %patch -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch33 -p1
%patch34 -p1
%patch35 -p1
%patch36 -p1
%patch37 -p1
%patch38 -p1
%patch39 -p1
%patch40 -p1
%patch41 -p1
%patch42 -p1
%patch43 -p1
%patch44 -p1
%patch45 -p1
%patch46 -p1
%patch47 -p1
%patch48 -p1
%patch49 -p1
%patch50 -p1
%patch51 -p1
%patch52 -p1
%patch53 -p1
%patch54 -p1
%patch55 -p1
%patch56 -p1
%patch57 -p1
%patch58 -p1
%patch59 -p1
%patch60 -p1
%patch61 -p1
%patch62 -p1
%patch63 -p1
%patch64 -p1
%patch65 -p1
%patch66 -p1
%patch67 -p1
%if 0%{?suse_version} == 1130
%patch99 -p1
%endif
@ -266,7 +134,7 @@ sed -i -e'/recommends.*alsa-oss/d' $RPM_SOURCE_DIR/baselibs.conf
%build
export AUTOMAKE_JOBS="%{?_smp_mflags}"
# build alsa-lib
autoreconf -fi
# autoreconf -fi
%configure \
--disable-static \
--enable-symbolic-functions \