Accepting request 237958 from home:tiwai:branches:multimedia:libs

- Updated to alsa-lib 1.0.28:
  All pervious fix patches are obsoleted:
  0001-local.h-use-__kernel_off_t-from-linux-types.h.patch
  0002-conf-cards-add-Audio-Advantage-Micro-II.patch
  0003-pcm-Fix-a-wrong-value-shown-in-the-error-message-in-.patch
  0004-UCM-Document-some-standard-values.patch
  0005-hdspm.h-Update-LTC-ioctl-to-use-struct-hdspm_ltc.patch
  0006-Update-iatomic.h-functions-definitions-for-mips.patch
  0007-Fix-access-of-freed-memory-in-namehints.patch
  0008-HDA-Intel-present-up-to-8-HDMI-DP-outputs-via-hdmi-d.patch
  0009-snd_tlv_convert_from_dB-fix-decreasing-gain-across-e.patch
  0010-remove-unnecessary-obsolete-compat-hsearch_r.c.patch
  0011-local.h-include-sys-types.h-to-fix-issues-with-pcm.h.patch
  0012-test-chmap-Add-missing-usage-text-for-s-option.patch
  0013-include-global.h-don-t-define-timeval-and-timespec-s.patch
  0014-conf.c-use-portable-way-to-initialize-recursive-mute.patch
  0015-pcm_file-fix-SEGFAULT-if-file-option-is-missing-whil.patch
  0016-pcm_file-fixed-memory-leak.patch
  0017-pcm_file-don-t-touch-infile-on-playback-and-output-f.patch
  0018-pcm_file-document-new-argument-to-snd_pcm_file_open.patch
  0019-dmix-Don-t-use-assert-and-abort.patch
  0020-minor-malloc-changes.patch
  0021-alsa-lib-minor-typo-in-pcm-doc.patch
  0022-control_hw-fix-potential-memory-leak.patch
  0023-pcm-initialize-pcm_dmix-monotonic-field.patch
  0024-pcm-initialize-monotonic-field-for-dshare-and-dsnoop.patch
  0025-pcm-use-CLOCK_REALTIME-for-non-monotonic-ts.patch
  0026-alsa-lib-heavy-pcm-atomics-cleanup.patch
  0027-conf-Add-basic-infrastructure-for-2.1-surround-sound.patch
  0028-conf-Add-surround-2.1-support-to-all-cards.patch

OBS-URL: https://build.opensuse.org/request/show/237958
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=160
This commit is contained in:
Takashi Iwai 2014-06-18 12:59:02 +00:00 committed by Git OBS Bridge
parent 0f3ddbbd7b
commit 2ce61e4e86
43 changed files with 50 additions and 6057 deletions

View File

@ -1,41 +0,0 @@
From b3b53a1bec47aaa2baef724cc9e79adadd603caf Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Tue, 23 Jul 2013 14:50:41 +0200
Subject: [PATCH 1/6] local.h: use __kernel_off_t from <linux/types.h>
Also, make the empty definitions __user and __force conditional.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
include/local.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/local.h b/include/local.h
index 53cb647..f0db188 100644
--- a/include/local.h
+++ b/include/local.h
@@ -32,6 +32,7 @@
#include <stdarg.h>
#include <sys/poll.h>
#include <errno.h>
+#include <linux/types.h>
#include <linux/ioctl.h>
#include "config.h"
@@ -114,9 +115,12 @@
#define snd_ctl_tlv sndrv_ctl_tlv
/* kill and replace kernel-specific types */
+#ifndef __user
#define __user
+#endif
+#ifndef __force
#define __force
-#define __kernel_off_t off_t
+#endif
#include <sound/asound.h>
--
1.8.4

View File

@ -1,64 +0,0 @@
From 994ab14b401b2873c5f927215bbb86fe6f6335fc Mon Sep 17 00:00:00 2001
From: Przemek Rudy <prudy1@o2.pl>
Date: Tue, 30 Jul 2013 22:31:44 +0200
Subject: [PATCH 2/6] conf/cards: add Audio Advantage Micro II
With related kernel chnages add extended suport for:
- AES bits controls (via device suffix AESn= or tools like iecset)
- SPDIF switch control, turning on/off the optical transmitter (via alsamixer tool)
Signed-off-by: Przemek Rudy <prudy1@o2.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/conf/cards/USB-Audio.conf | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/src/conf/cards/USB-Audio.conf b/src/conf/cards/USB-Audio.conf
index 0d93175..8a6d9ca 100644
--- a/src/conf/cards/USB-Audio.conf
+++ b/src/conf/cards/USB-Audio.conf
@@ -101,6 +101,41 @@ USB-Audio."Audiophile USB (tm)".pcm.iec958 {
}
}
+# For this card we can (and must to get IEC61937) set AES bits
+USB-Audio."MicroII".pcm.iec958 "cards.USB-Audio.Audio Advantage MicroII.pcm.iec958"
+USB-Audio."Audio Advantage MicroII".pcm.iec958 {
+ @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 }
+
+ type hooks
+ slave.pcm {
+ type hw
+ card $CARD
+ }
+
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {
+ interface PCM
+ name "IEC958 Playback Default"
+ preserve true
+ optional true
+ value [ $AES0 $AES1 $AES2 $AES3 ]
+ }
+ {
+ name "IEC958 Playback Switch"
+ lock true
+ preserve true
+ value 1
+ }
+ ]
+ }
+}
################################################################################
--
1.8.4

View File

@ -1,27 +0,0 @@
From d469ebe2efe514ce10511dfdff852063030d658d Mon Sep 17 00:00:00 2001
From: Laurentiu Nicola <grayshade@gmail.com>
Date: Thu, 8 Aug 2013 12:29:09 +0200
Subject: [PATCH 3/6] pcm: Fix a wrong value shown in the error message in rate
plugin
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 ca4d416..c54fa06 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -7932,7 +7932,7 @@ int snd_pcm_set_params(snd_pcm_t *pcm,
return err;
}
if (rrate != rate) {
- SNDERR("Rate doesn't match (requested %iHz, get %iHz)", rate, err);
+ SNDERR("Rate doesn't match (requested %iHz, get %iHz)", rate, rrate);
return -EINVAL;
}
/* set the buffer time */
--
1.8.4

View File

@ -1,35 +0,0 @@
From 36bc5770409901b0e3a1b1cb5a027cdb71ff47f5 Mon Sep 17 00:00:00 2001
From: Arun Raghavan <arun.raghavan@collabora.co.uk>
Date: Wed, 7 Aug 2013 23:26:31 +0530
Subject: [PATCH 4/6] UCM: Document some standard values
Playback/CaptureChannels has been around for a bit. Playback/CaptureRate
is new and is intended to be used to specify the sample rate at which
the Playback/CapturePCM should be opened.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/use-case.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/use-case.h b/include/use-case.h
index 93b3456..4e13249 100644
--- a/include/use-case.h
+++ b/include/use-case.h
@@ -259,9 +259,13 @@ int snd_use_case_get_list(snd_use_case_mgr_t *uc_mgr,
* TQ - Tone Quality
* PlaybackPCM - full PCM playback device name
* CapturePCM - full PCM capture device name
+ * PlaybackRate - playback device sample rate
+ * PlaybackChannels - playback device channel count
* PlaybackCTL - playback control device name
* PlaybackVolume - playback control volume ID string
* PlaybackSwitch - playback control switch ID string
+ * CaptureRate - capture device sample rate
+ * CaptureChannels - capture device channel count
* CaptureCTL - capture control device name
* CaptureVolume - capture control volume ID string
* CaptureSwitch - capture control switch ID string
--
1.8.4

View File

@ -1,33 +0,0 @@
From 4b169b05b48f4ea0196879b62b8c3fa5b050e806 Mon Sep 17 00:00:00 2001
From: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Date: Mon, 19 Aug 2013 17:31:37 +0200
Subject: [PATCH 5/6] hdspm.h: Update LTC ioctl to use struct hdspm_ltc
Use struct hdspm_ltc to query the LTC, using a mixer struct was just
plain wrong.
Due to the wrong struct, this ioctl was never working, so we're free to
fix it without breaking userspace compatibility.
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/sound/hdspm.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/sound/hdspm.h b/include/sound/hdspm.h
index 1774ff5..fe9c5f6 100644
--- a/include/sound/hdspm.h
+++ b/include/sound/hdspm.h
@@ -111,7 +111,7 @@ struct hdspm_ltc {
enum hdspm_ltc_input_format input_format;
};
-#define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_mixer_ioctl)
+#define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_ltc)
/**
* The status data reflects the device's current state
--
1.8.4

View File

@ -1,64 +0,0 @@
From f21f48a70f8437a671b58fcab75e54222a9eea16 Mon Sep 17 00:00:00 2001
From: Kai Kang <jiashuo.kang at gmail.com>
Date: Thu, 15 Aug 2013 17:17:19 +0800
Subject: [PATCH 6/6] Update iatomic.h functions definitions for mips
Functions atomic_add(s) and atomic_sub(s) are defined with 'extern
__inline__' that may cause compile fails when cross compile for mips.
The error message looks like:
| pcm/.libs/libpcm.a(pcm_meter.o): In function `snd_pcm_meter_update_scope':
| .../alsa-lib-1.0.27.2/src/pcm/pcm_meter.c:139: undefined reference to `atomic_sub'
Replace the 'extern __inline__' with 'static __inline__' to fix this
issue.
Signed-off-by: Kai Kang <jiashuo.kang at gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/iatomic.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/iatomic.h b/include/iatomic.h
index 5711fe8..2393297 100644
--- a/include/iatomic.h
+++ b/include/iatomic.h
@@ -720,7 +720,7 @@ typedef struct { volatile int counter; } atomic_t;
* Atomically adds @i to @v. Note that the guaranteed useful range
* of an atomic_t is only 24 bits.
*/
-extern __inline__ void atomic_add(int i, atomic_t * v)
+static __inline__ void atomic_add(int i, atomic_t * v)
{
unsigned long temp;
@@ -744,7 +744,7 @@ extern __inline__ void atomic_add(int i, atomic_t * v)
* Atomically subtracts @i from @v. Note that the guaranteed
* useful range of an atomic_t is only 24 bits.
*/
-extern __inline__ void atomic_sub(int i, atomic_t * v)
+static __inline__ void atomic_sub(int i, atomic_t * v)
{
unsigned long temp;
@@ -763,7 +763,7 @@ extern __inline__ void atomic_sub(int i, atomic_t * v)
/*
* Same as above, but return the result value
*/
-extern __inline__ int atomic_add_return(int i, atomic_t * v)
+static __inline__ int atomic_add_return(int i, atomic_t * v)
{
unsigned long temp, result;
@@ -784,7 +784,7 @@ extern __inline__ int atomic_add_return(int i, atomic_t * v)
return result;
}
-extern __inline__ int atomic_sub_return(int i, atomic_t * v)
+static __inline__ int atomic_sub_return(int i, atomic_t * v)
{
unsigned long temp, result;
--
1.8.4

View File

@ -1,116 +0,0 @@
From 23bf1dce9438c0cf74357928289aa8f06957c283 Mon Sep 17 00:00:00 2001
From: David Henningsson <david.henningsson@canonical.com>
Date: Fri, 13 Sep 2013 13:21:44 -0400
Subject: [PATCH] Fix access of freed memory in namehints
Sometimes a hook manipulates the config tree, which makes currently
running iterators point to freed memory. As a workaround, make two
copies, one for the iterators and another for the hooks.
BugLink: https://bugs.launchpad.net/bugs/1008600
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/control/namehint.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/src/control/namehint.c b/src/control/namehint.c
index 8d5e925..28975a4 100644
--- a/src/control/namehint.c
+++ b/src/control/namehint.c
@@ -406,7 +406,7 @@ static const next_devices_t next_devices[] = {
};
#endif
-static int add_card(snd_config_t *config, struct hint_list *list, int card)
+static int add_card(snd_config_t *config, snd_config_t *rw_config, struct hint_list *list, int card)
{
int err, ok;
snd_config_t *conf, *n;
@@ -449,7 +449,7 @@ static int add_card(snd_config_t *config, struct hint_list *list, int card)
ok = 0;
for (device = 0; err >= 0 && device <= max_device; device++) {
list->device = device;
- err = try_config(config, list, list->siface, str);
+ err = try_config(rw_config, list, list->siface, str);
if (err < 0)
break;
ok++;
@@ -464,7 +464,7 @@ static int add_card(snd_config_t *config, struct hint_list *list, int card)
if (err < 0) {
list->card = card;
list->device = -1;
- err = try_config(config, list, list->siface, str);
+ err = try_config(rw_config, list, list->siface, str);
}
if (err == -ENOMEM)
goto __error;
@@ -493,7 +493,8 @@ static int get_card_name(struct hint_list *list, int card)
return 0;
}
-static int add_software_devices(snd_config_t *config, struct hint_list *list)
+static int add_software_devices(snd_config_t *config, snd_config_t *rw_config,
+ struct hint_list *list)
{
int err;
snd_config_t *conf, *n;
@@ -509,7 +510,7 @@ static int add_software_devices(snd_config_t *config, struct hint_list *list)
continue;
list->card = -1;
list->device = -1;
- err = try_config(config, list, list->siface, str);
+ err = try_config(rw_config, list, list->siface, str);
if (err == -ENOMEM)
return -ENOMEM;
}
@@ -547,7 +548,7 @@ int snd_device_name_hint(int card, const char *iface, void ***hints)
struct hint_list list;
char ehints[24];
const char *str;
- snd_config_t *conf, *local_config = NULL;
+ snd_config_t *conf, *local_config = NULL, *local_config_rw = NULL;
snd_config_update_t *local_config_update = NULL;
snd_config_iterator_t i, next;
int err;
@@ -557,6 +558,7 @@ int snd_device_name_hint(int card, const char *iface, void ***hints)
err = snd_config_update_r(&local_config, &local_config_update, NULL);
if (err < 0)
return err;
+ err = snd_config_copy(&local_config_rw, local_config);
list.list = NULL;
list.count = list.allocated = 0;
list.siface = iface;
@@ -586,9 +588,9 @@ int snd_device_name_hint(int card, const char *iface, void ***hints)
if (card >= 0) {
err = get_card_name(&list, card);
if (err >= 0)
- err = add_card(local_config, &list, card);
+ err = add_card(local_config, local_config_rw, &list, card);
} else {
- add_software_devices(local_config, &list);
+ add_software_devices(local_config, local_config_rw, &list);
err = snd_card_next(&card);
if (err < 0)
goto __error;
@@ -596,7 +598,7 @@ int snd_device_name_hint(int card, const char *iface, void ***hints)
err = get_card_name(&list, card);
if (err < 0)
goto __error;
- err = add_card(local_config, &list, card);
+ err = add_card(local_config, local_config_rw, &list, card);
if (err < 0)
goto __error;
err = snd_card_next(&card);
@@ -630,6 +632,8 @@ int snd_device_name_hint(int card, const char *iface, void ***hints)
if (list.cardname)
free(list.cardname);
}
+ if (local_config_rw)
+ snd_config_delete(local_config_rw);
if (local_config)
snd_config_delete(local_config);
if (local_config_update)
--
1.8.4

View File

@ -1,131 +0,0 @@
From 383912ef83cb2d5835239a23f6afc6198697a587 Mon Sep 17 00:00:00 2001
From: Anssi Hannula <anssi.hannula@iki.fi>
Date: Mon, 23 Sep 2013 00:41:50 +0300
Subject: [PATCH] HDA-Intel: present up to 8 HDMI/DP outputs via "hdmi" device
Some new AMD cards have HDA codecs presenting 6 connected HDMI/DP pin
nodes (plus 1 unconnected pin node) according to the ALSA card database.
Example:
http://www.alsa-project.org/db/?f=de3ced7af41de0ed54d218650e5e2f16c511787b
Bump the maximum number of presented HDMI outputs per card via the
"hdmi" PCM from 4 to 8 (so that the last possible device is DEV=7).
Note that HDMI PCM devices DEV=4..7 use shared PCM device numbers, so
HDA cards that have over 4 audio PCM devices or multiple S/PDIF or modem
devices will have their remaining PCM devices misrepresented as HDMI
devices.
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/conf/cards/HDA-Intel.conf | 92 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 92 insertions(+)
diff --git a/src/conf/cards/HDA-Intel.conf b/src/conf/cards/HDA-Intel.conf
index 3957c12..7976b6c 100644
--- a/src/conf/cards/HDA-Intel.conf
+++ b/src/conf/cards/HDA-Intel.conf
@@ -305,6 +305,98 @@ HDA-Intel.pcm.hdmi.3 {
}
}
+HDA-Intel.pcm.hdmi.4 {
+ @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.HDA-Intel.pcm.hdmi.common:"
+ "CARD=" $CARD ","
+ "DEVICE=10,"
+ "CTLINDEX=4,"
+ "AES0=" $AES0 ","
+ "AES1=" $AES1 ","
+ "AES2=" $AES2 ","
+ "AES3=" $AES3
+ ]
+ }
+}
+
+HDA-Intel.pcm.hdmi.5 {
+ @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.HDA-Intel.pcm.hdmi.common:"
+ "CARD=" $CARD ","
+ "DEVICE=11,"
+ "CTLINDEX=5,"
+ "AES0=" $AES0 ","
+ "AES1=" $AES1 ","
+ "AES2=" $AES2 ","
+ "AES3=" $AES3
+ ]
+ }
+}
+
+HDA-Intel.pcm.hdmi.6 {
+ @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.HDA-Intel.pcm.hdmi.common:"
+ "CARD=" $CARD ","
+ "DEVICE=12,"
+ "CTLINDEX=6,"
+ "AES0=" $AES0 ","
+ "AES1=" $AES1 ","
+ "AES2=" $AES2 ","
+ "AES3=" $AES3
+ ]
+ }
+}
+
+HDA-Intel.pcm.hdmi.7 {
+ @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.HDA-Intel.pcm.hdmi.common:"
+ "CARD=" $CARD ","
+ "DEVICE=13,"
+ "CTLINDEX=7,"
+ "AES0=" $AES0 ","
+ "AES1=" $AES1 ","
+ "AES2=" $AES2 ","
+ "AES3=" $AES3
+ ]
+ }
+}
+
<confdir:pcm/modem.conf>
HDA-Intel.pcm.modem.0 {
--
1.8.4

View File

@ -1,44 +0,0 @@
From 529706fc323813cfad7c48d3738ea0bfa5b8305e Mon Sep 17 00:00:00 2001
From: Stephen Warren <swarren@nvidia.com>
Date: Mon, 30 Sep 2013 15:25:49 -0600
Subject: [PATCH] snd_tlv_convert_from_dB: fix decreasing gain across entries
Currently, for a TLV consisting of TLV_DB_SCALE_ITEMs, if e.g. alsamixer
calls snd_mixer_selem_set_playback_dB() with a value that is in-between
two TLV_DB_SCALE_ITEMs, and xdir is negative, the selected raw hardware
value is the minimum in the first range above that value, rather than the
maximum in the last range below that value.
The user-visible symptom is that in alsamixer, pressing the down key to
reduce the value sticks at certain points, and cannot be incrementally
reduced any further, although directly selecting a much lower value (e.g.
by pressing 0..9) works as expected. This is triggered e.g. by
sound/soc/codec/max98090.c's max98090_hp_tlv[].
Fix this by checking whether xdir is positive or not, rather than
checking whether it has a non-zero value. The code to select the previous
range's max value is already present. This matches how xdir is used in
other parts of the code.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/control/tlv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/control/tlv.c b/src/control/tlv.c
index 6b0b9f4..b08d887 100644
--- a/src/control/tlv.c
+++ b/src/control/tlv.c
@@ -312,7 +312,7 @@ int snd_tlv_convert_from_dB(unsigned int *tlv, long rangemin, long rangemax,
submin, submax,
db_gain, value, xdir);
else if (db_gain < dbmin) {
- *value = xdir || pos == 2 ? submin : prev_submax;
+ *value = xdir > 0 || pos == 2 ? submin : prev_submax;
return 0;
}
prev_submax = submax;
--
1.8.4

View File

@ -1,334 +0,0 @@
From c1fbd57c38dd565d3f87219031658f676654484f Mon Sep 17 00:00:00 2001
From: Waldemar Brodkorb <wbx@openadk.org>
Date: Wed, 2 Oct 2013 21:00:51 +0200
Subject: [PATCH] remove unnecessary/obsolete compat/hsearch_r.c
The usage of hsearch functions where removed long time
ago in commit 273d115de05574251bdd661747ecb68449a5cf1d.
This patch highly increases portability for non-glibc systems.
Remove the complete compat directory as requested by
Takashi Iwai.
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
configure.in | 4 +-
src/Makefile.am | 7 +-
src/compat/Makefile.am | 8 --
src/compat/empty.c | 0
src/compat/hsearch_r.c | 236 -------------------------------------------------
5 files changed, 3 insertions(+), 252 deletions(-)
delete mode 100644 src/compat/Makefile.am
delete mode 100644 src/compat/empty.c
delete mode 100644 src/compat/hsearch_r.c
diff --git a/configure.in b/configure.in
index 00fff2b8da97..35fd89fc298a 100644
--- a/configure.in
+++ b/configure.in
@@ -64,8 +64,6 @@ AC_HEADER_TIME
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
-AC_CHECK_FUNC([hsearch_r], [HAVE_HSEARCH_R=yes])
-AM_CONDITIONAL([ALSA_HSEARCH_R], [test "x$HAVE_HSEARCH_R" != xyes])
AC_CHECK_FUNCS([uselocale])
SAVE_LIBRARY_VERSION
@@ -659,7 +657,7 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
src/pcm/Makefile src/pcm/scopes/Makefile \
src/rawmidi/Makefile src/timer/Makefile \
src/hwdep/Makefile src/seq/Makefile src/ucm/Makefile \
- src/compat/Makefile src/alisp/Makefile \
+ src/alisp/Makefile \
src/conf/Makefile src/conf/alsa.conf.d/Makefile \
src/conf/cards/Makefile \
src/conf/pcm/Makefile \
diff --git a/src/Makefile.am b/src/Makefile.am
index 08f482adc0d3..8f789fecc125 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -46,8 +46,8 @@ if BUILD_ALISP
SUBDIRS += alisp
libasound_la_LIBADD += alisp/libalisp.la
endif
-SUBDIRS += compat conf
-libasound_la_LIBADD += compat/libcompat.la @ALSA_DEPLIBS@
+SUBDIRS += conf
+libasound_la_LIBADD += @ALSA_DEPLIBS@
libasound_la_LDFLAGS = -version-info $(COMPATNUM) $(VSYMS) $(SYMFUNCS) $(LDFLAGS_NOUNDEFINED)
@@ -84,9 +84,6 @@ ucm/libucm.la:
instr/libinstr.la:
$(MAKE) -C instr libinstr.la
-compat/libcompat.la:
- $(MAKE) -C compat libcompat.la
-
alisp/libalisp.la:
$(MAKE) -C alisp libalisp.la
diff --git a/src/compat/Makefile.am b/src/compat/Makefile.am
deleted file mode 100644
index 01f54fc14b86..000000000000
--- a/src/compat/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-noinst_LTLIBRARIES = libcompat.la
-EXTRA_libcompat_la_SOURCES = hsearch_r.c
-
-if ALSA_HSEARCH_R
-libcompat_la_SOURCES = empty.c hsearch_r.c
-else
-libcompat_la_SOURCES = empty.c
-endif
diff --git a/src/compat/empty.c b/src/compat/empty.c
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/src/compat/hsearch_r.c b/src/compat/hsearch_r.c
deleted file mode 100644
index 96ceac10c011..000000000000
--- a/src/compat/hsearch_r.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1993.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <errno.h>
-#include <malloc.h>
-#include <string.h>
-
-#define __USE_GNU
-#ifndef __set_errno
-#define __set_errno(e) errno = (e)
-#endif
-#include <search.h>
-
-/* [Aho,Sethi,Ullman] Compilers: Principles, Techniques and Tools, 1986
- [Knuth] The Art of Computer Programming, part 3 (6.4) */
-
-
-/* The reentrant version has no static variables to maintain the state.
- Instead the interface of all functions is extended to take an argument
- which describes the current status. */
-typedef struct _ENTRY
-{
- unsigned int used;
- ENTRY entry;
-}
-_ENTRY;
-
-
-/* For the used double hash method the table size has to be a prime. To
- correct the user given table size we need a prime test. This trivial
- algorithm is adequate because
- a) the code is (most probably) called a few times per program run and
- b) the number is small because the table must fit in the core */
-static int
-isprime (unsigned int number)
-{
- /* no even number will be passed */
- unsigned int div = 3;
-
- while (div * div < number && number % div != 0)
- div += 2;
-
- return number % div != 0;
-}
-
-
-/* Before using the hash table we must allocate memory for it.
- Test for an existing table are done. We allocate one element
- more as the found prime number says. This is done for more effective
- indexing as explained in the comment for the hsearch function.
- The contents of the table is zeroed, especially the field used
- becomes zero. */
-int
-hcreate_r (nel, htab)
- size_t nel;
- struct hsearch_data *htab;
-{
- /* Test for correct arguments. */
- if (htab == NULL)
- {
- __set_errno (EINVAL);
- return 0;
- }
-
- /* There is still another table active. Return with error. */
- if (htab->table != NULL)
- return 0;
-
- /* Change nel to the first prime number not smaller as nel. */
- nel |= 1; /* make odd */
- while (!isprime (nel))
- nel += 2;
-
- htab->size = nel;
- htab->filled = 0;
-
- /* allocate memory and zero out */
- htab->table = (_ENTRY *) calloc (htab->size + 1, sizeof (_ENTRY));
- if (htab->table == NULL)
- return 0;
-
- /* everything went alright */
- return 1;
-}
-
-
-/* After using the hash table it has to be destroyed. The used memory can
- be freed and the local static variable can be marked as not used. */
-void
-hdestroy_r (htab)
- struct hsearch_data *htab;
-{
- /* Test for correct arguments. */
- if (htab == NULL)
- {
- __set_errno (EINVAL);
- return;
- }
-
- if (htab->table != NULL)
- /* free used memory */
- free (htab->table);
-
- /* the sign for an existing table is an value != NULL in htable */
- htab->table = NULL;
-}
-
-
-/* This is the search function. It uses double hashing with open addressing.
- The argument item.key has to be a pointer to an zero terminated, most
- probably strings of chars. The function for generating a number of the
- strings is simple but fast. It can be replaced by a more complex function
- like ajw (see [Aho,Sethi,Ullman]) if the needs are shown.
-
- We use an trick to speed up the lookup. The table is created by hcreate
- with one more element available. This enables us to use the index zero
- special. This index will never be used because we store the first hash
- index in the field used where zero means not used. Every other value
- means used. The used field can be used as a first fast comparison for
- equality of the stored and the parameter value. This helps to prevent
- unnecessary expensive calls of strcmp. */
-int
-hsearch_r (item, action, retval, htab)
- ENTRY item;
- ACTION action;
- ENTRY **retval;
- struct hsearch_data *htab;
-{
- unsigned int hval;
- unsigned int count;
- unsigned int len = strlen (item.key);
- unsigned int idx;
-
- /* Compute an value for the given string. Perhaps use a better method. */
- hval = len;
- count = len;
- while (count-- > 0)
- {
- hval <<= 4;
- hval += item.key[count];
- }
-
- /* First hash function: simply take the modulo but prevent zero. */
- hval %= htab->size;
- if (hval == 0)
- ++hval;
-
- /* The first index tried. */
- idx = hval;
-
- if (htab->table[idx].used)
- {
- /* Further action might be required according to the action value. */
- unsigned hval2;
-
- if (htab->table[idx].used == hval
- && strcmp (item.key, htab->table[idx].entry.key) == 0)
- {
- if (action == ENTER)
- htab->table[idx].entry.data = item.data;
-
- *retval = &htab->table[idx].entry;
- return 1;
- }
-
- /* Second hash function, as suggested in [Knuth] */
- hval2 = 1 + hval % (htab->size - 2);
-
- do
- {
- /* Because SIZE is prime this guarantees to step through all
- available indexes. */
- if (idx <= hval2)
- idx = htab->size + idx - hval2;
- else
- idx -= hval2;
-
- /* If we visited all entries leave the loop unsuccessfully. */
- if (idx == hval)
- break;
-
- /* If entry is found use it. */
- if (htab->table[idx].used == hval
- && strcmp (item.key, htab->table[idx].entry.key) == 0)
- {
- if (action == ENTER)
- htab->table[idx].entry.data = item.data;
-
- *retval = &htab->table[idx].entry;
- return 1;
- }
- }
- while (htab->table[idx].used);
- }
-
- /* An empty bucket has been found. */
- if (action == ENTER)
- {
- /* If table is full and another entry should be entered return
- with error. */
- if (action == ENTER && htab->filled == htab->size)
- {
- __set_errno (ENOMEM);
- *retval = NULL;
- return 0;
- }
-
- htab->table[idx].used = hval;
- htab->table[idx].entry = item;
-
- ++htab->filled;
-
- *retval = &htab->table[idx].entry;
- return 1;
- }
-
- __set_errno (ESRCH);
- *retval = NULL;
- return 0;
-}
--
1.8.4.3

View File

@ -1,30 +0,0 @@
From 10ecf963ca9ee7c491affadd4838ef8e35823d2c Mon Sep 17 00:00:00 2001
From: John Spencer <maillist-alsa@barfooze.de>
Date: Thu, 10 Oct 2013 18:56:22 +0200
Subject: [PATCH] local.h: include sys/types.h to fix issues with pcm.h
sys/types.h is required for the u_int_XX types used by pcm.h.
since a change in pcm.h is not desired, we add the inclusion
to the header that includes pcm.h during build.
Signed-off-by: John Spencer <maillist-alsa@barfooze.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/local.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/local.h b/include/local.h
index f0db188ee580..9464efa49642 100644
--- a/include/local.h
+++ b/include/local.h
@@ -31,6 +31,7 @@
#include <endian.h>
#include <stdarg.h>
#include <sys/poll.h>
+#include <sys/types.h>
#include <errno.h>
#include <linux/types.h>
#include <linux/ioctl.h>
--
1.8.4.3

View File

@ -1,25 +0,0 @@
From 2d6eb4e9ba1503e094d8cdc30a5a081fd22c1c84 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Mon, 4 Nov 2013 14:19:03 +0100
Subject: [PATCH] test/chmap: Add missing usage text for -s option
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
test/chmap.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/chmap.c b/test/chmap.c
index d73ae7361498..ad3b305b501c 100644
--- a/test/chmap.c
+++ b/test/chmap.c
@@ -16,6 +16,7 @@ static void usage(void)
" chmap [options] set CH0 CH1 CH2...\n"
"options:\n"
" -D device Specify PCM device to handle\n"
+ " -s stream Specify PCM stream direction (playback/capture)\n"
" -f format PCM format\n"
" -c channels Channels\n"
" -r rate Sample rate\n");
--
1.8.4.3

View File

@ -1,36 +0,0 @@
From 7d06b3ed9fda0220c2863ee20acd10c32cf313fd Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Fri, 8 Nov 2013 12:30:04 +0100
Subject: [PATCH] include/global.h - don't define timeval and timespec
structures for !glibc
On request from John Spencer <maillist-alsa@barfooze.de> .
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
include/global.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/global.h b/include/global.h
index 3e3680fb698c..16a26dc83518 100644
--- a/include/global.h
+++ b/include/global.h
@@ -133,6 +133,7 @@ int snd_shm_area_destroy(struct snd_shm_area *area);
int snd_user_file(const char *file, char **result);
+#ifdef __GLIBC__
#if !defined(_POSIX_C_SOURCE) && !defined(_POSIX_SOURCE)
struct timeval {
time_t tv_sec; /* seconds */
@@ -144,6 +145,7 @@ struct timespec {
long tv_nsec; /* nanoseconds */
};
#endif
+#endif
/** Timestamp */
typedef struct timeval snd_timestamp_t;
--
1.8.4.3

View File

@ -1,63 +0,0 @@
From ae035b7fe5620fcaf4f5ea33ecabcf93b8e056cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Fri, 8 Nov 2013 13:17:58 +0100
Subject: [PATCH] conf.c: use portable way to initialize recursive mutex
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is not in POSIX, as _NP
(non-portable) suggests.
exposing such a symbol in musl libc would lock in the ABI for all
times and makes it impossible to do future changes to the under-
lying struct without hideous symbol versioning hacks.
use the portable way instead: pthread_once was designed for such
cases.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Tested-by: John Spencer <maillist-alsa@barfooze.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/conf.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/conf.c b/src/conf.c
index bfed1c434cab..5ccc8e1a53e5 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -427,8 +427,8 @@ beginning:</P>
#ifndef DOC_HIDDEN
#ifdef HAVE_LIBPTHREAD
-static pthread_mutex_t snd_config_update_mutex =
- PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+static pthread_mutex_t snd_config_update_mutex;
+static pthread_once_t snd_config_update_mutex_once = PTHREAD_ONCE_INIT;
#endif
struct _snd_config {
@@ -472,8 +472,19 @@ typedef struct {
#ifdef HAVE_LIBPTHREAD
+static void snd_config_init_mutex(void)
+{
+ pthread_mutexattr_t attr;
+
+ pthread_mutexattr_init(&attr);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ pthread_mutex_init(&snd_config_update_mutex, &attr);
+ pthread_mutexattr_destroy(&attr);
+}
+
static inline void snd_config_lock(void)
{
+ pthread_once(&snd_config_update_mutex_once, snd_config_init_mutex);
pthread_mutex_lock(&snd_config_update_mutex);
}
--
1.8.4.3

View File

@ -1,36 +0,0 @@
From 1919ee473d9bc6983f11327aef3ae76e923f41be Mon Sep 17 00:00:00 2001
From: Andrey Mazo <mazo@telum.ru>
Date: Sun, 17 Nov 2013 01:11:54 +0400
Subject: [PATCH] pcm_file: fix SEGFAULT if file option is missing while infile
is not.
Commit 5c5f1358123af69155267463a0b6254ad9cbecc4 requires both file and
infile options to be missing to report a failure.
In fact, only file option is mandatory and should be checked there.
Otherwise, NULL file triggers segfault in
snd_pcm_file_replace_fname() called from
snd_pcm_file_open_output_file().
infile option is optional, so don't report fatal error if it's missing.
Signed-off-by: Andrey Mazo <mazo@telum.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pcm/pcm_file.c b/src/pcm/pcm_file.c
index 59504019d557..3d14090fd2ea 100644
--- a/src/pcm/pcm_file.c
+++ b/src/pcm/pcm_file.c
@@ -948,7 +948,7 @@ int _snd_pcm_file_open(snd_pcm_t **pcmp, const char *name,
err = snd_pcm_slave_conf(root, slave, &sconf, 0);
if (err < 0)
return err;
- if ((!fname || strlen(fname) == 0) && fd < 0 && !ifname) {
+ if ((!fname || strlen(fname) == 0) && fd < 0) {
snd_config_delete(sconf);
SNDERR("file is not defined");
return -EINVAL;
--
1.8.4.3

View File

@ -1,44 +0,0 @@
From e017c5f2df386c7c1f221a2f01c80edeec04b253 Mon Sep 17 00:00:00 2001
From: Andrey Mazo <mazo@telum.ru>
Date: Sun, 17 Nov 2013 01:11:55 +0400
Subject: [PATCH] pcm_file: fixed memory leak.
Valgrind report for this leak was:
Command: aplay -Dfile:'/tmp/qqq',raw qqq.wav
14 bytes in 1 blocks are definitely lost in loss record 1 of 2
at 0x402BF5C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
by 0x40D7557: snd_pcm_file_hw_params (in /usr/lib/libasound.so.2.0.0)
by 0x40BA093: _snd_pcm_hw_params_internal (in /usr/lib/libasound.so.2.0.0)
by 0x40AB831: snd_pcm_hw_params (in /usr/lib/libasound.so.2.0.0)
by 0x804C523: ??? (in /usr/bin/aplay)
by 0x804E5B7: ??? (in /usr/bin/aplay)
by 0x804FC8C: ??? (in /usr/bin/aplay)
by 0x80520FB: ??? (in /usr/bin/aplay)
by 0x4184942: (below main) (libc-start.c:226)
Signed-off-by: Andrey Mazo <mazo@telum.ru>
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 3d14090fd2ea..c3e67b2b2638 100644
--- a/src/pcm/pcm_file.c
+++ b/src/pcm/pcm_file.c
@@ -592,8 +592,10 @@ static int snd_pcm_file_hw_free(snd_pcm_t *pcm)
snd_pcm_file_t *file = pcm->private_data;
free(file->wbuf);
free(file->wbuf_areas);
+ free(file->final_fname);
file->wbuf = NULL;
file->wbuf_areas = NULL;
+ file->final_fname = NULL;
return snd_pcm_hw_free(file->gen.slave);
}
--
1.8.4.3

View File

@ -1,139 +0,0 @@
From 4081be0b87ab9fa53a8906e66bc240f18a7a9a54 Mon Sep 17 00:00:00 2001
From: Andrey Mazo <mazo@telum.ru>
Date: Sun, 17 Nov 2013 01:11:56 +0400
Subject: [PATCH] pcm_file: don't touch infile on playback and output file on
capture.
Commit 1d80c5b901baf7e1b7998dfa518532fbd64e4283 message describes
behaviour in case of specified infile option as
'No file writes will take place in this case'.
But this is clearly not the case as output file gets truncated while
running `arecord -Dtestin >/dev/null`, where "testin" is defined as
pcm.testin {
type file
slave.pcm null
file "/tmp/qqqq.out"
infile "/tmp/qqqq.in"
format "raw"
}
Besides that, the existing behaviour is rather counterintuitive,
requiring both output and input files to exist and making access to them
regardless of playback or capture intention.
Also, it's very confusing to get output file truncated while trying to
just capture from the device.
Current changeset introduces the following behaviour:
- output file ("file" option) is only (p)open()'ed for writing
only on playback to the device
- any data is written to the output file descriptor
(provided with "file" option) only on playback to the device
- input file ("infile" option) is only open()'ed for reading only on
capture from the device
- any data is read from the input file descriptor
(provided with the "infile" option) only on capture from the device
Signed-off-by: Andrey Mazo <mazo@telum.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_file.c | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/src/pcm/pcm_file.c b/src/pcm/pcm_file.c
index c3e67b2b2638..25055d0d24cf 100644
--- a/src/pcm/pcm_file.c
+++ b/src/pcm/pcm_file.c
@@ -406,7 +406,9 @@ static int snd_pcm_file_close(snd_pcm_t *pcm)
if (file->wav_header.fmt)
fixup_wav_header(pcm);
free((void *)file->fname);
- close(file->fd);
+ if (file->fd >= 0) {
+ close(file->fd);
+ }
}
if (file->ifname) {
free((void *)file->ifname);
@@ -533,7 +535,6 @@ static snd_pcm_sframes_t snd_pcm_file_writen(snd_pcm_t *pcm, void **bufs, snd_pc
static snd_pcm_sframes_t snd_pcm_file_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size)
{
snd_pcm_file_t *file = pcm->private_data;
- snd_pcm_channel_area_t areas[pcm->channels];
snd_pcm_sframes_t n;
n = snd_pcm_readi(file->gen.slave, buffer, size);
@@ -545,15 +546,12 @@ static snd_pcm_sframes_t snd_pcm_file_readi(snd_pcm_t *pcm, void *buffer, snd_pc
return n;
return n * 8 / pcm->frame_bits;
}
- snd_pcm_areas_from_buf(pcm, areas, buffer);
- snd_pcm_file_add_frames(pcm, areas, 0, n);
return n;
}
static snd_pcm_sframes_t snd_pcm_file_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size)
{
snd_pcm_file_t *file = pcm->private_data;
- snd_pcm_channel_area_t areas[pcm->channels];
snd_pcm_sframes_t n;
if (file->ifd >= 0) {
@@ -562,10 +560,6 @@ static snd_pcm_sframes_t snd_pcm_file_readn(snd_pcm_t *pcm, void **bufs, snd_pcm
}
n = snd_pcm_readn(file->gen.slave, bufs, size);
- if (n > 0) {
- snd_pcm_areas_from_bufs(pcm, areas, bufs);
- snd_pcm_file_add_frames(pcm, areas, 0, n);
- }
return n;
}
@@ -629,7 +623,7 @@ static int snd_pcm_file_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
a->first = slave->sample_bits * channel;
a->step = slave->frame_bits;
}
- if (file->fd < 0) {
+ if ((file->fd < 0) && (pcm->stream == SND_PCM_STREAM_PLAYBACK)) {
err = snd_pcm_file_open_output_file(file);
if (err < 0) {
SYSERR("failed opening output file %s", file->fname);
@@ -728,7 +722,8 @@ static const snd_pcm_fast_ops_t snd_pcm_file_fast_ops = {
int snd_pcm_file_open(snd_pcm_t **pcmp, const char *name,
const char *fname, int fd, const char *ifname, int ifd,
int trunc,
- const char *fmt, int perm, snd_pcm_t *slave, int close_slave)
+ const char *fmt, int perm, snd_pcm_t *slave, int close_slave,
+ snd_pcm_stream_t stream)
{
snd_pcm_t *pcm;
snd_pcm_file_t *file;
@@ -758,7 +753,7 @@ int snd_pcm_file_open(snd_pcm_t **pcmp, const char *name,
file->trunc = trunc;
file->perm = perm;
- if (ifname) {
+ if (ifname && (stream == SND_PCM_STREAM_CAPTURE)) {
ifd = open(ifname, O_RDONLY); /* TODO: mind blocking mode */
if (ifd < 0) {
SYSERR("open %s for reading failed", ifname);
@@ -790,6 +785,7 @@ int snd_pcm_file_open(snd_pcm_t **pcmp, const char *name,
#else
pcm->monotonic = 0;
#endif
+ pcm->stream = stream;
snd_pcm_link_hw_ptr(pcm, slave);
snd_pcm_link_appl_ptr(pcm, slave);
*pcmp = pcm;
@@ -960,7 +956,7 @@ int _snd_pcm_file_open(snd_pcm_t **pcmp, const char *name,
if (err < 0)
return err;
err = snd_pcm_file_open(pcmp, name, fname, fd, ifname, ifd,
- trunc, format, perm, spcm, 1);
+ trunc, format, perm, spcm, 1, stream);
if (err < 0)
snd_pcm_close(spcm);
return err;
--
1.8.4.3

View File

@ -1,29 +0,0 @@
From 29d89ba0452e29830ca6cd34636aecf160a94a9d Mon Sep 17 00:00:00 2001
From: Andrey Mazo <mazo@telum.ru>
Date: Sun, 17 Nov 2013 19:45:19 +0400
Subject: [PATCH] pcm_file: document new argument to snd_pcm_file_open().
Document function argument, added in commit
4081be0b87ab9fa53a8906e66bc240f18a7a9a54.
Signed-off-by: Andrey Mazo <mazo@telum.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_file.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/pcm/pcm_file.c b/src/pcm/pcm_file.c
index 25055d0d24cf..712302598a9f 100644
--- a/src/pcm/pcm_file.c
+++ b/src/pcm/pcm_file.c
@@ -714,6 +714,7 @@ static const snd_pcm_fast_ops_t snd_pcm_file_fast_ops = {
* \param perm File permission
* \param slave Slave PCM handle
* \param close_slave When set, the slave PCM handle is closed with copy PCM
+ * \param stream the direction of PCM stream
* \retval zero on success otherwise a negative error code
* \warning Using of this function might be dangerous in the sense
* of compatibility reasons. The prototype might be freely
--
1.8.4.3

View File

@ -1,32 +0,0 @@
From 49ad6699e68862ef9888bdf10b5bdaa19933f1ea Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Wed, 27 Nov 2013 09:37:54 +0100
Subject: [PATCH] dmix: Don't use assert() and abort()
We seem to still have some races at closing a dmix stream, but
aborting is the worst option. Let's make not melt down.
Reference: https://bugzilla.novell.com/show_bug.cgi?id=852446
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_direct.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/pcm/pcm_direct.h b/src/pcm/pcm_direct.h
index 70c2c6a0229f..5ae39c0e4237 100644
--- a/src/pcm/pcm_direct.h
+++ b/src/pcm/pcm_direct.h
@@ -274,8 +274,8 @@ static inline int snd_pcm_direct_semaphore_up(snd_pcm_direct_t *dmix, int sem_nu
static inline int snd_pcm_direct_semaphore_final(snd_pcm_direct_t *dmix, int sem_num)
{
if (dmix->locked[sem_num] != 1) {
- assert(dmix->locked[sem_num] != 1);
- abort();
+ SNDMSG("invalid semaphore count to finalize %d: %d", sem_num, dmix->locked[sem_num]);
+ return -EBUSY;
}
return snd_pcm_direct_semaphore_up(dmix, sem_num);
}
--
1.8.4.3

View File

@ -1,52 +0,0 @@
From 670e228c693cbff9714856e5be93a88d137c5c30 Mon Sep 17 00:00:00 2001
From: Olivier Langlois <olivier@trillion01.com>
Date: Thu, 12 Dec 2013 23:47:20 -0500
Subject: [PATCH] minor malloc changes
replace malloc + memset with calloc since calloc may skip the memset if
returned memory comes directly from sbrk()
use malloc instead of malloc if first thing done with allocated memory is
to flip all bits to 1.
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/alisp/alisp.c | 3 +--
src/pcm/pcm_ladspa.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/alisp/alisp.c b/src/alisp/alisp.c
index 1796c33c3faf..3c61bb1754c3 100644
--- a/src/alisp/alisp.c
+++ b/src/alisp/alisp.c
@@ -3202,12 +3202,11 @@ int alsa_lisp(struct alisp_cfg *cfg, struct alisp_instance **_instance)
struct alisp_object *p, *p1;
int i, j, retval = 0;
- instance = (struct alisp_instance *)malloc(sizeof(struct alisp_instance));
+ instance = (struct alisp_instance *)calloc(1, sizeof(struct alisp_instance));
if (instance == NULL) {
nomem();
return -ENOMEM;
}
- memset(instance, 0, sizeof(struct alisp_instance));
instance->verbose = cfg->verbose && cfg->vout;
instance->warning = cfg->warning && cfg->wout;
instance->debug = cfg->debug && cfg->dout;
diff --git a/src/pcm/pcm_ladspa.c b/src/pcm/pcm_ladspa.c
index 0a9c52e975e6..9ce5242e2359 100644
--- a/src/pcm/pcm_ladspa.c
+++ b/src/pcm/pcm_ladspa.c
@@ -1326,7 +1326,7 @@ static int snd_pcm_ladspa_parse_bindings(snd_pcm_ladspa_plugin_t *lplug,
count = (unsigned int)(channel + 1);
}
if (count > 0) {
- array = (unsigned int *)calloc(count, sizeof(unsigned int));
+ array = (unsigned int *)malloc(count * sizeof(unsigned int));
if (! array)
return -ENOMEM;
memset(array, 0xff, count * sizeof(unsigned int));
--
1.9.0

View File

@ -1,29 +0,0 @@
From 3baf1bee843d8f0559f1481f26e9b8235b5e85ee Mon Sep 17 00:00:00 2001
From: Olivier Langlois <olivier@trillion01.com>
Date: Sun, 5 Jan 2014 23:12:44 -0500
Subject: [PATCH] alsa-lib: minor typo in pcm doc
Added a missing 'f' in the word 'diferent'
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
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 c54fa06974fc..7e46014627c2 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -105,7 +105,7 @@ The poll or select functions (see 'man 2 poll' or 'man 2 select' for further
details) allows to receive requests/events from the device while
an application is waiting on events from other sources (like keyboard, screen,
network etc.), too. \ref snd_pcm_poll_descriptors can be used to get file
-descriptors to poll or select on (note that wait direction might be diferent
+descriptors to poll or select on (note that wait direction might be different
than expected - do not use only returned file descriptors, but handle
events member as well - see \ref snd_pcm_poll_descriptors function
description for more details and \ref snd_pcm_poll_descriptors_revents for
--
1.9.0

View File

@ -1,30 +0,0 @@
From 336dc58beba0ca7cf5650dc12ed3eb72d61ac6d3 Mon Sep 17 00:00:00 2001
From: Ivan Sorokin <vanyacpp@gmail.com>
Date: Wed, 22 Jan 2014 00:12:50 +0400
Subject: [PATCH] control_hw: fix potential memory leak
Signed-off-by: Ivan Sorokin <vanyacpp@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/control/control_hw.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/control/control_hw.c b/src/control/control_hw.c
index 148097facd90..dfc9dcd51e20 100644
--- a/src/control/control_hw.c
+++ b/src/control/control_hw.c
@@ -240,8 +240,10 @@ static int snd_ctl_hw_elem_tlv(snd_ctl_t *handle, int op_flag,
return -errno;
}
if (op_flag == 0) {
- if (xtlv->tlv[1] + 2 * sizeof(unsigned int) > tlv_size)
+ if (xtlv->tlv[1] + 2 * sizeof(unsigned int) > tlv_size) {
+ free(xtlv);
return -EFAULT;
+ }
memcpy(tlv, xtlv->tlv, xtlv->tlv[1] + 2 * sizeof(unsigned int));
}
free(xtlv);
--
1.9.0

View File

@ -1,78 +0,0 @@
From e51cd448971c472d75dd700b0000988f6197b4da Mon Sep 17 00:00:00 2001
From: Olivier Langlois <olivier@trillion01.com>
Date: Wed, 22 Jan 2014 19:04:45 -0500
Subject: [PATCH] pcm: initialize pcm_dmix monotonic field
not doing so, leaves the pcm object in an inconsistent state since
'info' field is copied from the slave which is then used when
snd_pcm_hw_params_is_monotonic() is called.
For instance, when using dmix with aplay and an underrun is occuring, the following
info is returned:
underrun!!! (at least 1248687948.256 ms long)
Status:
state : XRUN
trigger_time: 1390347762.628483000
tstamp : 1390347766.184350000
delay : -635
avail : 15687
avail_max : 15675
now is computed from CLOCK_MONOTONIC while pcm status tstamps are from gettimeofday().
After the fix, underruns are still occuring on my setup but at least the displayed info
is correct:
underrun!!! (at least 7630.409 ms long)
Status:
state : XRUN
trigger_time: 7652.739201431
tstamp : 7660.369600636
delay : -624
avail : 15676
avail_max : 15664
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_direct.c | 2 ++
src/pcm/pcm_dmix.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c
index 899c250401df..5416cf71674c 100644
--- a/src/pcm/pcm_direct.c
+++ b/src/pcm/pcm_direct.c
@@ -857,6 +857,7 @@ 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
@@ -1220,6 +1221,7 @@ 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_dmix.c b/src/pcm/pcm_dmix.c
index 2bd5d398d280..4aa6d4eab4a2 100644
--- a/src/pcm/pcm_dmix.c
+++ b/src/pcm/pcm_dmix.c
@@ -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->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);
--
1.9.0

View File

@ -1,43 +0,0 @@
From 507cdc13187f5eeb222eeb43550cf6a67c3b29c9 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Thu, 23 Jan 2014 09:46:37 +0100
Subject: [PATCH] pcm: initialize monotonic field for dshare and dsnoop, too
Just like the previous fix for dmix, we need update for dshare and
dsnoop plugins.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_dshare.c | 2 +-
src/pcm/pcm_dsnoop.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c
index 5b329510481e..f2d1103a6bfb 100644
--- a/src/pcm/pcm_dshare.c
+++ b/src/pcm/pcm_dshare.c
@@ -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->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 055e4f498343..76379140c133 100644
--- a/src/pcm/pcm_dsnoop.c
+++ b/src/pcm/pcm_dsnoop.c
@@ -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->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);
--
1.9.0

View File

@ -1,46 +0,0 @@
From 66f07aa3b77e4013110f7b12640e204d0c15ac8d Mon Sep 17 00:00:00 2001
From: Olivier Langlois <olivier@trillion01.com>
Date: Thu, 23 Jan 2014 19:03:00 -0500
Subject: [PATCH] pcm: use CLOCK_REALTIME for non-monotonic ts
gettimeofday() is the same than clock_gettime(CLOCK_REALTIME)
except for the loss of precision and the double unnecessary
conversion timespec <-> timeval.
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_local.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/pcm/pcm_local.h b/src/pcm/pcm_local.h
index e1c0baa871f6..8a6c7431cc40 100644
--- a/src/pcm/pcm_local.h
+++ b/src/pcm/pcm_local.h
@@ -961,17 +961,21 @@ typedef union snd_tmp_double {
/* get the current timestamp */
static inline void gettimestamp(snd_htimestamp_t *tstamp, int monotonic)
{
-#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
+#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;
gettimeofday(&tv, 0);
tstamp->tv_sec = tv.tv_sec;
tstamp->tv_nsec = tv.tv_usec * 1000L;
-#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
+#endif
+#if defined(HAVE_CLOCK_GETTIME)
}
#endif
}
--
1.9.0

File diff suppressed because it is too large Load Diff

View File

@ -1,119 +0,0 @@
From 57b5076c30b3453ee843912c0aeb3df8dbee3f68 Mon Sep 17 00:00:00 2001
From: David Henningsson <david.henningsson@canonical.com>
Date: Tue, 18 Feb 2014 16:41:48 +0100
Subject: [PATCH] conf: Add basic infrastructure for 2.1 surround sound
For now, we do 2.1 over 5.1, because that's what ALSA allows per default.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/conf/alsa.conf | 3 +++
src/conf/pcm/Makefile.am | 2 +-
src/conf/pcm/surround21.conf | 62 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 66 insertions(+), 1 deletion(-)
create mode 100644 src/conf/pcm/surround21.conf
diff --git a/src/conf/alsa.conf b/src/conf/alsa.conf
index bc91df3b93a5..5c928e8afbcd 100644
--- a/src/conf/alsa.conf
+++ b/src/conf/alsa.conf
@@ -90,6 +90,8 @@ defaults.pcm.center_lfe.card defaults.pcm.card
defaults.pcm.center_lfe.device defaults.pcm.device
defaults.pcm.side.card defaults.pcm.card
defaults.pcm.side.device defaults.pcm.device
+defaults.pcm.surround21.card defaults.pcm.card
+defaults.pcm.surround21.device defaults.pcm.device
defaults.pcm.surround40.card defaults.pcm.card
defaults.pcm.surround40.device defaults.pcm.device
defaults.pcm.surround41.card defaults.pcm.card
@@ -131,6 +133,7 @@ pcm.front cards.pcm.front
pcm.rear cards.pcm.rear
pcm.center_lfe cards.pcm.center_lfe
pcm.side cards.pcm.side
+pcm.surround21 cards.pcm.surround21
pcm.surround40 cards.pcm.surround40
pcm.surround41 cards.pcm.surround41
pcm.surround50 cards.pcm.surround50
diff --git a/src/conf/pcm/Makefile.am b/src/conf/pcm/Makefile.am
index cc3286e6ddf0..c548660d1696 100644
--- a/src/conf/pcm/Makefile.am
+++ b/src/conf/pcm/Makefile.am
@@ -1,5 +1,5 @@
cfg_files = default.conf front.conf rear.conf center_lfe.conf side.conf\
- surround40.conf surround41.conf \
+ surround21.conf surround40.conf surround41.conf \
surround50.conf surround51.conf \
surround71.conf iec958.conf hdmi.conf modem.conf \
dmix.conf dsnoop.conf \
diff --git a/src/conf/pcm/surround21.conf b/src/conf/pcm/surround21.conf
new file mode 100644
index 000000000000..be29020f24c7
--- /dev/null
+++ b/src/conf/pcm/surround21.conf
@@ -0,0 +1,62 @@
+#
+# Hardware output from 2.1 speakers.
+# Samples must be positioned:
+# chn0 - front left
+# chn1 - front right
+# chn2 - LFE
+#
+
+pcm.!surround21 {
+ @args [ CARD DEV ]
+ @args.CARD {
+ type string
+ default {
+ @func getenv
+ vars [
+ ALSA_SURROUND21_CARD
+ ALSA_PCM_CARD
+ ALSA_CARD
+ ]
+ default {
+ @func refer
+ name defaults.pcm.surround21.card
+ }
+ }
+ }
+ @args.DEV {
+ type integer
+ default {
+ @func igetenv
+ vars [
+ ALSA_SURROUND21_DEVICE
+ ]
+ default {
+ @func refer
+ name defaults.pcm.surround21.device
+ }
+ }
+ }
+ type route
+ slave.pcm {
+ @func refer
+ name {
+ @func concat
+ strings [
+ "cards."
+ {
+ @func card_driver
+ card $CARD
+ }
+ ".pcm.surround51." $DEV ":CARD=" $CARD
+ ]
+ }
+ }
+ slave.channels 6
+ ttable.0.0 1
+ ttable.1.1 1
+ ttable.2.5 1
+ hint {
+ description "2.1 Surround output to Front and Subwoofer speakers"
+ device $DEV
+ }
+}
--
1.9.0

View File

@ -1,381 +0,0 @@
From 1af088e39b75a0a0897c7036487b143e983cd423 Mon Sep 17 00:00:00 2001
From: David Henningsson <david.henningsson@canonical.com>
Date: Tue, 18 Feb 2014 16:41:49 +0100
Subject: [PATCH] conf: Add surround 2.1 support to all cards
All cards that support 4.1 surround now also support 2.1 surround,
because they both have surround 5.1 as slave.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/conf/cards/ATIIXP-SPDMA.conf | 1 +
src/conf/cards/ATIIXP.conf | 1 +
src/conf/cards/Audigy.conf | 1 +
src/conf/cards/Audigy2.conf | 1 +
src/conf/cards/Aureon51.conf | 1 +
src/conf/cards/Aureon71.conf | 1 +
src/conf/cards/CA0106.conf | 1 +
src/conf/cards/CMI8738-MC6.conf | 1 +
src/conf/cards/CMI8738-MC8.conf | 1 +
src/conf/cards/CMI8788.conf | 2 +-
src/conf/cards/CS46xx.conf | 1 +
src/conf/cards/EMU10K1.conf | 1 +
src/conf/cards/EMU10K1X.conf | 1 +
src/conf/cards/FM801.conf | 1 +
src/conf/cards/FireWave.conf | 1 +
src/conf/cards/HDA-Intel.conf | 1 +
src/conf/cards/ICE1712.conf | 1 +
src/conf/cards/ICE1724.conf | 1 +
src/conf/cards/ICH.conf | 1 +
src/conf/cards/ICH4.conf | 1 +
src/conf/cards/Loopback.conf | 1 +
src/conf/cards/NFORCE.conf | 1 +
src/conf/cards/SB-XFi.conf | 1 +
src/conf/cards/SI7018.conf | 1 +
src/conf/cards/USB-Audio.conf | 1 +
src/conf/cards/VIA8233.conf | 1 +
src/conf/cards/VIA8233A.conf | 1 +
src/conf/cards/VIA8237.conf | 1 +
28 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/src/conf/cards/ATIIXP-SPDMA.conf b/src/conf/cards/ATIIXP-SPDMA.conf
index 5c80815ddaf6..42540d6817c0 100644
--- a/src/conf/cards/ATIIXP-SPDMA.conf
+++ b/src/conf/cards/ATIIXP-SPDMA.conf
@@ -77,6 +77,7 @@ ATIIXP-SPDMA.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/ATIIXP.conf b/src/conf/cards/ATIIXP.conf
index 38d802345bfb..c4d33ef34a68 100644
--- a/src/conf/cards/ATIIXP.conf
+++ b/src/conf/cards/ATIIXP.conf
@@ -77,6 +77,7 @@ ATIIXP.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/Audigy.conf b/src/conf/cards/Audigy.conf
index 4fe387327633..1c92496653e0 100644
--- a/src/conf/cards/Audigy.conf
+++ b/src/conf/cards/Audigy.conf
@@ -143,6 +143,7 @@ Audigy.pcm.center_lfe.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround40.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
diff --git a/src/conf/cards/Audigy2.conf b/src/conf/cards/Audigy2.conf
index db45776e54c4..cbec78358882 100644
--- a/src/conf/cards/Audigy2.conf
+++ b/src/conf/cards/Audigy2.conf
@@ -195,6 +195,7 @@ Audigy2.pcm.side.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround40.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
diff --git a/src/conf/cards/Aureon51.conf b/src/conf/cards/Aureon51.conf
index 24b4d949174b..07be4a77aa12 100644
--- a/src/conf/cards/Aureon51.conf
+++ b/src/conf/cards/Aureon51.conf
@@ -86,6 +86,7 @@ Aureon51.pcm.surround40.0 {
channels 4
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/Aureon71.conf b/src/conf/cards/Aureon71.conf
index 1479c25cce21..a43ce2cee5fa 100644
--- a/src/conf/cards/Aureon71.conf
+++ b/src/conf/cards/Aureon71.conf
@@ -86,6 +86,7 @@ Aureon71.pcm.surround40.0 {
channels 4
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/CA0106.conf b/src/conf/cards/CA0106.conf
index 9d21770f84ad..2f0eaf0afdc8 100644
--- a/src/conf/cards/CA0106.conf
+++ b/src/conf/cards/CA0106.conf
@@ -108,6 +108,7 @@ CA0106.pcm.surround40.0 {
]
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/CMI8738-MC6.conf b/src/conf/cards/CMI8738-MC6.conf
index 171c772809ab..edc67d44d96a 100644
--- a/src/conf/cards/CMI8738-MC6.conf
+++ b/src/conf/cards/CMI8738-MC6.conf
@@ -77,6 +77,7 @@ CMI8738-MC6.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/CMI8738-MC8.conf b/src/conf/cards/CMI8738-MC8.conf
index a5bf6cb4889a..ddff75304bc3 100644
--- a/src/conf/cards/CMI8738-MC8.conf
+++ b/src/conf/cards/CMI8738-MC8.conf
@@ -105,6 +105,7 @@ CMI8738-MC8.pcm.surround40.0 {
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/CMI8788.conf b/src/conf/cards/CMI8788.conf
index 0ca71e9d28de..edcb0c9ccc36 100644
--- a/src/conf/cards/CMI8788.conf
+++ b/src/conf/cards/CMI8788.conf
@@ -48,7 +48,7 @@ CMI8788.pcm.surround40.0 {
channels 4
}
-
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/CS46xx.conf b/src/conf/cards/CS46xx.conf
index 1983142548fd..b71c30aad514 100644
--- a/src/conf/cards/CS46xx.conf
+++ b/src/conf/cards/CS46xx.conf
@@ -112,6 +112,7 @@ CS46xx.pcm.surround40.0 {
]
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/EMU10K1.conf b/src/conf/cards/EMU10K1.conf
index d51f6dc02fac..ef193fe0c460 100644
--- a/src/conf/cards/EMU10K1.conf
+++ b/src/conf/cards/EMU10K1.conf
@@ -217,6 +217,7 @@ EMU10K1.pcm.surround40.0 {
]
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/EMU10K1X.conf b/src/conf/cards/EMU10K1X.conf
index b5fc708c4cb2..f742863679cb 100644
--- a/src/conf/cards/EMU10K1X.conf
+++ b/src/conf/cards/EMU10K1X.conf
@@ -96,6 +96,7 @@ EMU10K1X.pcm.surround40.0 {
]
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/FM801.conf b/src/conf/cards/FM801.conf
index 997b2184f38c..0ddf799cd029 100644
--- a/src/conf/cards/FM801.conf
+++ b/src/conf/cards/FM801.conf
@@ -40,6 +40,7 @@ FM801.pcm.default {
FM801.pcm.surround40.0 "cards.FM801.pcm.front.0"
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/FireWave.conf b/src/conf/cards/FireWave.conf
index 63fb23d96bc0..fcfc83ccfb19 100644
--- a/src/conf/cards/FireWave.conf
+++ b/src/conf/cards/FireWave.conf
@@ -25,6 +25,7 @@ FireWave.pcm.front.0 {
card $CARD
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/HDA-Intel.conf b/src/conf/cards/HDA-Intel.conf
index 7976b6c52ee9..fa9f6946376f 100644
--- a/src/conf/cards/HDA-Intel.conf
+++ b/src/conf/cards/HDA-Intel.conf
@@ -71,6 +71,7 @@ HDA-Intel.pcm.default {
hint.device 0
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround40.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
diff --git a/src/conf/cards/ICE1712.conf b/src/conf/cards/ICE1712.conf
index f5b8add6322c..398fa7ad5307 100644
--- a/src/conf/cards/ICE1712.conf
+++ b/src/conf/cards/ICE1712.conf
@@ -74,6 +74,7 @@ ICE1712.pcm.surround40.0 {
slave.channels 10
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/ICE1724.conf b/src/conf/cards/ICE1724.conf
index e806b36d92a1..61cac0132f07 100644
--- a/src/conf/cards/ICE1724.conf
+++ b/src/conf/cards/ICE1724.conf
@@ -95,6 +95,7 @@ ICE1724.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/ICH.conf b/src/conf/cards/ICH.conf
index 47ffef96531c..6fc9a5a236c1 100644
--- a/src/conf/cards/ICH.conf
+++ b/src/conf/cards/ICH.conf
@@ -98,6 +98,7 @@ ICH.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/ICH4.conf b/src/conf/cards/ICH4.conf
index 1bf5605bfd7f..64ec883d9c73 100644
--- a/src/conf/cards/ICH4.conf
+++ b/src/conf/cards/ICH4.conf
@@ -98,6 +98,7 @@ ICH4.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/Loopback.conf b/src/conf/cards/Loopback.conf
index 5365fa1bec52..974aa7535340 100644
--- a/src/conf/cards/Loopback.conf
+++ b/src/conf/cards/Loopback.conf
@@ -63,6 +63,7 @@ Loopback.pcm.default {
hint.device 0
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround40.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
diff --git a/src/conf/cards/NFORCE.conf b/src/conf/cards/NFORCE.conf
index 6ebefe3da29e..64d15479291b 100644
--- a/src/conf/cards/NFORCE.conf
+++ b/src/conf/cards/NFORCE.conf
@@ -98,6 +98,7 @@ NFORCE.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/SB-XFi.conf b/src/conf/cards/SB-XFi.conf
index 38d0027fb4f2..eb2218bfdcc7 100644
--- a/src/conf/cards/SB-XFi.conf
+++ b/src/conf/cards/SB-XFi.conf
@@ -53,6 +53,7 @@ SB-XFi.pcm.side.0 {
hint.device 3
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround40.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
diff --git a/src/conf/cards/SI7018.conf b/src/conf/cards/SI7018.conf
index 7417bd5bf2e4..02b8fc877ff3 100644
--- a/src/conf/cards/SI7018.conf
+++ b/src/conf/cards/SI7018.conf
@@ -78,6 +78,7 @@ SI7018.pcm.surround40.0 {
]
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/USB-Audio.conf b/src/conf/cards/USB-Audio.conf
index 8a6d9cac6ead..ce3ae019f7f6 100644
--- a/src/conf/cards/USB-Audio.conf
+++ b/src/conf/cards/USB-Audio.conf
@@ -314,6 +314,7 @@ USB-Audio.pcm.surround40_two_stereo_devices {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/VIA8233.conf b/src/conf/cards/VIA8233.conf
index 668bfd9e421b..9ad321f713a9 100644
--- a/src/conf/cards/VIA8233.conf
+++ b/src/conf/cards/VIA8233.conf
@@ -86,6 +86,7 @@ VIA8233.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/VIA8233A.conf b/src/conf/cards/VIA8233A.conf
index 97d2a7daf335..679fccf3d06f 100644
--- a/src/conf/cards/VIA8233A.conf
+++ b/src/conf/cards/VIA8233A.conf
@@ -84,6 +84,7 @@ VIA8233A.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
diff --git a/src/conf/cards/VIA8237.conf b/src/conf/cards/VIA8237.conf
index 404e19075cbd..29d8e00f6601 100644
--- a/src/conf/cards/VIA8237.conf
+++ b/src/conf/cards/VIA8237.conf
@@ -79,6 +79,7 @@ VIA8237.pcm.surround40.0 {
}
}
+<confdir:pcm/surround21.conf>
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
--
1.9.0

View File

@ -1,150 +0,0 @@
From 7a6e8ca348c4c2640cbc337914d1376333fdbc17 Mon Sep 17 00:00:00 2001
From: Patrick Welche <prlw1@cam.ac.uk>
Date: Sun, 23 Feb 2014 11:12:48 +0000
Subject: [PATCH] Portability fix: look for sys/endian.h as well as endian.h
- define __BYTE_ORDER and friends.
- adjust asoundlib.h accordingly.
Signed-off-by: Patrick Welche <prlw1@cam.ac.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
configure.in | 33 +++++++++++++++++++++++++++++++--
include/asoundlib-head.h | 13 -------------
include/local.h | 18 +++++++++++++++++-
src/pcm/pcm_file.c | 1 -
4 files changed, 48 insertions(+), 17 deletions(-)
diff --git a/configure.in b/configure.in
index bb56eb653ccc..9463b5ad4766 100644
--- a/configure.in
+++ b/configure.in
@@ -309,8 +309,8 @@ fi
AC_SUBST(ALSA_DEPLIBS)
-dnl Check for wordexp.h
-AC_CHECK_HEADERS([wordexp.h])
+dnl Check for headers
+AC_CHECK_HEADERS([wordexp.h endian.h sys/endian.h])
dnl Check for resmgr support...
AC_MSG_CHECKING(for resmgr support)
@@ -660,6 +660,35 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg \
dnl Create asoundlib.h dynamically according to configure options
echo "Creating asoundlib.h..."
cp "$srcdir"/include/asoundlib-head.h include/asoundlib.h
+test "$ac_cv_header_endian_h" = "yes" && echo "#include <endian.h>" >> include/asoundlib.h
+if test "$ac_cv_header_sys_endian_h" = "yes"; then
+cat >> include/asoundlib.h <<EOF
+#include <sys/endian.h>
+#ifndef __BYTE_ORDER
+#define __BYTE_ORDER BYTE_ORDER
+#endif
+#ifndef __LITTLE_ENDIAN
+#define __LITTLE_ENDIAN LITTLE_ENDIAN
+#endif
+#ifndef __BIG_ENDIAN
+#define __BIG_ENDIAN BIG_ENDIAN
+#endif
+EOF
+fi
+cat >> include/asoundlib.h <<EOF
+
+#ifndef __GNUC__
+#define __inline__ inline
+#endif
+
+#include <alsa/asoundef.h>
+#include <alsa/version.h>
+#include <alsa/global.h>
+#include <alsa/input.h>
+#include <alsa/output.h>
+#include <alsa/error.h>
+#include <alsa/conf.h>
+EOF
test "$build_pcm" = "yes" && echo "#include <alsa/pcm.h>" >> include/asoundlib.h
test "$build_rawmidi" = "yes" && echo "#include <alsa/rawmidi.h>" >> include/asoundlib.h
test "$build_pcm" = "yes" && echo "#include <alsa/timer.h>" >> include/asoundlib.h
diff --git a/include/asoundlib-head.h b/include/asoundlib-head.h
index 71b5c29f61c4..1ec611e56b8e 100644
--- a/include/asoundlib-head.h
+++ b/include/asoundlib-head.h
@@ -35,19 +35,6 @@
#include <string.h>
#include <fcntl.h>
#include <assert.h>
-#include <endian.h>
#include <sys/poll.h>
#include <errno.h>
#include <stdarg.h>
-
-#ifndef __GNUC__
-#define __inline__ inline
-#endif
-
-#include <alsa/asoundef.h>
-#include <alsa/version.h>
-#include <alsa/global.h>
-#include <alsa/input.h>
-#include <alsa/output.h>
-#include <alsa/error.h>
-#include <alsa/conf.h>
diff --git a/include/local.h b/include/local.h
index 9464efa49642..2fe9a273f0b0 100644
--- a/include/local.h
+++ b/include/local.h
@@ -22,13 +22,30 @@
#ifndef __LOCAL_H
#define __LOCAL_H
+#include "config.h"
+
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <assert.h>
+#ifdef HAVE_ENDIAN_H
#include <endian.h>
+#elif defined(HAVE_SYS_ENDIAN_H)
+#include <sys/endian.h>
+#ifndef __BYTE_ORDER
+#define __BYTE_ORDER BYTE_ORDER
+#endif
+#ifndef __LITTLE_ENDIAN
+#define __LITTLE_ENDIAN LITTLE_ENDIAN
+#endif
+#ifndef __BIG_ENDIAN
+#define __BIG_ENDIAN BIG_ENDIAN
+#endif
+#else
+#error Header defining endianness not defined
+#endif
#include <stdarg.h>
#include <sys/poll.h>
#include <sys/types.h>
@@ -36,7 +53,6 @@
#include <linux/types.h>
#include <linux/ioctl.h>
-#include "config.h"
#ifdef SUPPORT_RESMGR
#include <resmgr.h>
#endif
diff --git a/src/pcm/pcm_file.c b/src/pcm/pcm_file.c
index 712302598a9f..b1f23304633f 100644
--- a/src/pcm/pcm_file.c
+++ b/src/pcm/pcm_file.c
@@ -26,7 +26,6 @@
*
*/
-#include <endian.h>
#include <byteswap.h>
#include <ctype.h>
#include <string.h>
--
1.9.0

File diff suppressed because it is too large Load Diff

View File

@ -1,45 +0,0 @@
From 2da7b0c2c194a457de9d9a1a9b93c47e2dad1507 Mon Sep 17 00:00:00 2001
From: Maarten Baert <maarten-baert@hotmail.com>
Date: Wed, 26 Feb 2014 14:23:45 +0100
Subject: [PATCH] pcm: Insert linear-to-float conversion when rate or channel
count is incorrect
This fixes a bug where snd_pcm_plug_insert_plugins fails when both
client and slave use format float, but the rate or channel count does
not match. I also removed some redundant code.
Signed-off-by: Maarten Baert <maarten-baert@hotmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_plug.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/pcm/pcm_plug.c b/src/pcm/pcm_plug.c
index fa84eaacaedc..ede9c1525a74 100644
--- a/src/pcm/pcm_plug.c
+++ b/src/pcm/pcm_plug.c
@@ -522,15 +522,13 @@ static int snd_pcm_plug_change_format(snd_pcm_t *pcm, snd_pcm_t **new, snd_pcm_p
}
#ifdef BUILD_PCM_PLUGIN_LFLOAT
} else if (snd_pcm_format_float(slv->format)) {
- /* Conversion is done in another plugin */
- if (clt->format == slv->format &&
- clt->rate == slv->rate &&
- clt->channels == slv->channels)
- return 0;
- cfmt = clt->format;
- if (snd_pcm_format_linear(clt->format))
+ if (snd_pcm_format_linear(clt->format)) {
+ cfmt = clt->format;
f = snd_pcm_lfloat_open;
- else
+ } else if (clt->rate != slv->rate || clt->channels != slv->channels) {
+ cfmt = SND_PCM_FORMAT_S16;
+ f = snd_pcm_lfloat_open;
+ } else
return -EINVAL;
#endif
#ifdef BUILD_PCM_NONLINEAR
--
1.9.0

View File

@ -1,68 +0,0 @@
From 8ad8d22216f818872a764ef5dafcaae1adeee211 Mon Sep 17 00:00:00 2001
From: David Henningsson <david.henningsson@canonical.com>
Date: Fri, 28 Feb 2014 08:57:05 +0100
Subject: [PATCH] pcm: route: Allow chmap syntax for slave channels in ttable
Instead of writing e g "0" and "1", one can now write "FL" and "FR" instead.
E g:
ttable.0.FL 1
ttable.1.FR 1
ttable.2.LFE 1
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_route.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c
index 2beedf68c3e0..56318d47bcbf 100644
--- a/src/pcm/pcm_route.c
+++ b/src/pcm/pcm_route.c
@@ -789,6 +789,24 @@ static void snd_pcm_route_dump(snd_pcm_t *pcm, snd_output_t *out)
snd_pcm_dump(route->plug.gen.slave, out);
}
+static int strtochannel(const char *id, long *channel)
+{
+ int err;
+ int ch;
+ err = safe_strtol(id, channel);
+ if (err >= 0)
+ return err;
+
+ ch = (int) snd_pcm_chmap_from_string(id);
+ if (ch == -1)
+ return -EINVAL;
+
+ /* For now, assume standard channel mapping */
+ *channel = ch - SND_CHMAP_FL;
+ return 0;
+}
+
+
static const snd_pcm_ops_t snd_pcm_route_ops = {
.close = snd_pcm_route_close,
.info = snd_pcm_generic_info,
@@ -983,7 +1001,7 @@ int snd_pcm_route_determine_ttable(snd_config_t *tt,
const char *id;
if (snd_config_get_id(jnode, &id) < 0)
continue;
- err = safe_strtol(id, &schannel);
+ err = strtochannel(id, &schannel);
if (err < 0) {
SNDERR("Invalid slave channel: %s", id);
return -EINVAL;
@@ -1046,7 +1064,7 @@ int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *tt
const char *id;
if (snd_config_get_id(jnode, &id) < 0)
continue;
- err = safe_strtol(id, &schannel);
+ err = strtochannel(id, &schannel);
if (err < 0 ||
schannel < 0 || (unsigned int) schannel > tt_ssize ||
(schannels > 0 && schannel >= schannels)) {
--
1.9.0

View File

@ -1,475 +0,0 @@
From 5c4cd46810cef8850b037fca9e38ffd43b0bff22 Mon Sep 17 00:00:00 2001
From: David Henningsson <david.henningsson@canonical.com>
Date: Fri, 28 Feb 2014 08:57:06 +0100
Subject: [PATCH] pcm: route: Select slave chmap based on ttable information
It means we need to initialize this order:
1) Read the ttable to figure out which channels are present
2) Open slave pcm and find a matching chmap
3) Determine size of ttable (this can now depend on the chmap)
4) Read ttable coefficients
5) At prepare time, select the matching chmap
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_route.c | 319 +++++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 276 insertions(+), 43 deletions(-)
diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c
index 56318d47bcbf..ab17fa78be2c 100644
--- a/src/pcm/pcm_route.c
+++ b/src/pcm/pcm_route.c
@@ -103,6 +103,7 @@ typedef struct {
snd_pcm_format_t sformat;
int schannels;
snd_pcm_route_params_t params;
+ snd_pcm_chmap_t *chmap;
} snd_pcm_route_t;
#endif /* DOC_HIDDEN */
@@ -518,6 +519,7 @@ static int snd_pcm_route_close(snd_pcm_t *pcm)
}
free(params->dsts);
}
+ free(route->chmap);
return snd_pcm_generic_close(pcm);
}
@@ -789,21 +791,187 @@ static void snd_pcm_route_dump(snd_pcm_t *pcm, snd_output_t *out)
snd_pcm_dump(route->plug.gen.slave, out);
}
-static int strtochannel(const char *id, long *channel)
+/*
+ * Converts a string to an array of channel indices:
+ * - Given a number, the result is an array with one element,
+ * containing that number
+ * - Given a channel name (e g "FL") and a chmap,
+ * it will look this up in the chmap and return all matches
+ * - Given a channel name and no chmap, the result is an array with one element,
+ containing alsa standard channel map. Note that this might be a negative
+ number in case of "UNKNOWN", "NA" or "MONO".
+ * Return value is number of matches written.
+ */
+static int strtochannel(const char *id, snd_pcm_chmap_t *chmap,
+ long *channel, int channel_size)
{
- int err;
int ch;
- err = safe_strtol(id, channel);
- if (err >= 0)
- return err;
+ if (safe_strtol(id, channel) >= 0)
+ return 1;
ch = (int) snd_pcm_chmap_from_string(id);
if (ch == -1)
return -EINVAL;
- /* For now, assume standard channel mapping */
- *channel = ch - SND_CHMAP_FL;
+ if (chmap) {
+ int i, r = 0;
+ /* Start with highest channel to simplify implementation of
+ determine ttable size */
+ for (i = chmap->channels - 1; i >= 0; i--) {
+ if ((int) chmap->pos[i] != ch)
+ continue;
+ if (r >= channel_size)
+ continue;
+ channel[r++] = i;
+ }
+ return r;
+ }
+ else {
+ /* Assume ALSA standard channel mapping */
+ *channel = ch - SND_CHMAP_FL;
+ return 1;
+ }
+}
+
+#define MAX_CHMAP_CHANNELS 256
+
+static int determine_chmap(snd_config_t *tt, snd_pcm_chmap_t **tt_chmap)
+{
+ snd_config_iterator_t i, inext;
+ snd_pcm_chmap_t *chmap;
+
+ assert(tt && tt_chmap);
+ chmap = malloc(sizeof(snd_pcm_chmap_t) +
+ MAX_CHMAP_CHANNELS * sizeof(unsigned int));
+
+ chmap->channels = 0;
+ snd_config_for_each(i, inext, tt) {
+ const char *id;
+ snd_config_iterator_t j, jnext;
+ snd_config_t *in = snd_config_iterator_entry(i);
+
+ if (!snd_config_get_id(in, &id) < 0)
+ continue;
+ if (snd_config_get_type(in) != SND_CONFIG_TYPE_COMPOUND)
+ goto err;
+ snd_config_for_each(j, jnext, in) {
+ int ch, k, found;
+ long schannel;
+ snd_config_t *jnode = snd_config_iterator_entry(j);
+ if (snd_config_get_id(jnode, &id) < 0)
+ continue;
+ if (safe_strtol(id, &schannel) >= 0)
+ continue;
+ ch = (int) snd_pcm_chmap_from_string(id);
+ if (ch == -1)
+ goto err;
+
+ found = 0;
+ for (k = 0; k < (int) chmap->channels; k++)
+ if (ch == (int) chmap->pos[k]) {
+ found = 1;
+ break;
+ }
+ if (found)
+ continue;
+
+ if (chmap->channels >= MAX_CHMAP_CHANNELS) {
+ SNDERR("Too many channels in ttable chmap");
+ goto err;
+ }
+ chmap->pos[chmap->channels++] = ch;
+ }
+ }
+
+
+ *tt_chmap = chmap;
return 0;
+
+err:
+ *tt_chmap = NULL;
+ free(chmap);
+ return -EINVAL;
+}
+
+static int find_matching_chmap(snd_pcm_t *spcm, snd_pcm_chmap_t *tt_chmap,
+ snd_pcm_chmap_t **found_chmap, int *schannels)
+{
+ snd_pcm_chmap_query_t** chmaps = snd_pcm_query_chmaps(spcm);
+ int i;
+
+ *found_chmap = NULL;
+
+ if (chmaps == NULL)
+ return 0; /* chmap API not supported for this slave */
+
+ for (i = 0; chmaps[i]; i++) {
+ unsigned int j, k;
+ int match = 1;
+ snd_pcm_chmap_t *c = &chmaps[i]->map;
+ if (*schannels >= 0 && (int) c->channels != *schannels)
+ continue;
+
+ for (j = 0; j < tt_chmap->channels; j++) {
+ int found = 0;
+ unsigned int ch = tt_chmap->pos[j];
+ for (k = 0; k < c->channels; k++)
+ if (c->pos[k] == ch) {
+ found = 1;
+ break;
+ }
+ if (!found) {
+ match = 0;
+ break;
+ }
+ }
+
+ if (match) {
+ int size = sizeof(snd_pcm_chmap_t) + c->channels * sizeof(unsigned int);
+ *found_chmap = malloc(size);
+ if (!*found_chmap) {
+ snd_pcm_free_chmaps(chmaps);
+ return -ENOMEM;
+ }
+ memcpy(*found_chmap, c, size);
+ *schannels = c->channels;
+ break;
+ }
+ }
+
+ snd_pcm_free_chmaps(chmaps);
+
+ if (*found_chmap == NULL) {
+ SNDERR("Found no matching channel map");
+ return -EINVAL;
+ }
+ return 0;
+}
+
+static int route_chmap_init(snd_pcm_t *pcm)
+{
+ int set_map = 0;
+ snd_pcm_chmap_t *current;
+ snd_pcm_route_t *route = pcm->private_data;
+ if (!route->chmap)
+ return 0;
+ if (snd_pcm_state(pcm) != SND_PCM_STATE_PREPARED)
+ return 0;
+
+ /* Check if we really need to set the chmap or not.
+ This is important in case set_chmap is not implemented. */
+ current = snd_pcm_get_chmap(route->plug.gen.slave);
+ if (!current)
+ return -ENOSYS;
+ if (current->channels != route->chmap->channels)
+ set_map = 1;
+ else
+ set_map = memcmp(current->pos, route->chmap->pos,
+ current->channels);
+ free(current);
+ if (!set_map)
+ return 0;
+
+ return snd_pcm_set_chmap(route->plug.gen.slave, route->chmap);
}
@@ -939,6 +1107,7 @@ int snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
route->plug.undo_write = snd_pcm_plugin_undo_write_generic;
route->plug.gen.slave = slave;
route->plug.gen.close_slave = close_slave;
+ route->plug.init = route_chmap_init;
err = snd_pcm_new(&pcm, SND_PCM_TYPE_ROUTE, name, slave->stream, slave->mode);
if (err < 0) {
@@ -963,16 +1132,10 @@ int snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
return 0;
}
-/**
- * \brief Determine route matrix sizes
- * \param tt Configuration root describing route matrix
- * \param tt_csize Returned client size in elements
- * \param tt_ssize Returned slave size in elements
- * \retval zero on success otherwise a negative error code
- */
-int snd_pcm_route_determine_ttable(snd_config_t *tt,
- unsigned int *tt_csize,
- unsigned int *tt_ssize)
+static int _snd_pcm_route_determine_ttable(snd_config_t *tt,
+ unsigned int *tt_csize,
+ unsigned int *tt_ssize,
+ snd_pcm_chmap_t *chmap)
{
snd_config_iterator_t i, inext;
long csize = 0, ssize = 0;
@@ -1001,7 +1164,7 @@ int snd_pcm_route_determine_ttable(snd_config_t *tt,
const char *id;
if (snd_config_get_id(jnode, &id) < 0)
continue;
- err = strtochannel(id, &schannel);
+ err = strtochannel(id, chmap, &schannel, 1);
if (err < 0) {
SNDERR("Invalid slave channel: %s", id);
return -EINVAL;
@@ -1020,6 +1183,20 @@ int snd_pcm_route_determine_ttable(snd_config_t *tt,
}
/**
+ * \brief Determine route matrix sizes
+ * \param tt Configuration root describing route matrix
+ * \param tt_csize Returned client size in elements
+ * \param tt_ssize Returned slave size in elements
+ * \retval zero on success otherwise a negative error code
+ */
+int snd_pcm_route_determine_ttable(snd_config_t *tt,
+ unsigned int *tt_csize,
+ unsigned int *tt_ssize)
+{
+ return _snd_pcm_route_determine_ttable(tt, tt_csize, tt_ssize, NULL);
+}
+
+/**
* \brief Load route matrix
* \param tt Configuration root describing route matrix
* \param ttable Returned route matrix
@@ -1030,10 +1207,10 @@ int snd_pcm_route_determine_ttable(snd_config_t *tt,
* \param schannels Slave channels
* \retval zero on success otherwise a negative error code
*/
-int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *ttable,
- unsigned int tt_csize, unsigned int tt_ssize,
- unsigned int *tt_cused, unsigned int *tt_sused,
- int schannels)
+static int _snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *ttable,
+ unsigned int tt_csize, unsigned int tt_ssize,
+ unsigned int *tt_cused, unsigned int *tt_sused,
+ int schannels, snd_pcm_chmap_t *chmap)
{
int cused = -1;
int sused = -1;
@@ -1060,17 +1237,18 @@ int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *tt
snd_config_for_each(j, jnext, in) {
snd_config_t *jnode = snd_config_iterator_entry(j);
double value;
- long schannel;
+ int ss;
+ long *scha = alloca(tt_ssize * sizeof(long));
const char *id;
if (snd_config_get_id(jnode, &id) < 0)
continue;
- err = strtochannel(id, &schannel);
- if (err < 0 ||
- schannel < 0 || (unsigned int) schannel > tt_ssize ||
- (schannels > 0 && schannel >= schannels)) {
+
+ ss = strtochannel(id, chmap, scha, tt_ssize);
+ if (ss < 0) {
SNDERR("Invalid slave channel: %s", id);
return -EINVAL;
}
+
err = snd_config_get_real(jnode, &value);
if (err < 0) {
long v;
@@ -1081,9 +1259,18 @@ int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *tt
}
value = v;
}
- ttable[cchannel * tt_ssize + schannel] = value;
- if (schannel > sused)
- sused = schannel;
+
+ for (k = 0; (int) k < ss; k++) {
+ long schannel = scha[k];
+ if (schannel < 0 || (unsigned int) schannel > tt_ssize ||
+ (schannels > 0 && schannel >= schannels)) {
+ SNDERR("Invalid slave channel: %s", id);
+ return -EINVAL;
+ }
+ ttable[cchannel * tt_ssize + schannel] = value;
+ if (schannel > sused)
+ sused = schannel;
+ }
}
if (cchannel > cused)
cused = cchannel;
@@ -1093,6 +1280,26 @@ int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *tt
return 0;
}
+/**
+ * \brief Load route matrix
+ * \param tt Configuration root describing route matrix
+ * \param ttable Returned route matrix
+ * \param tt_csize Client size in elements
+ * \param tt_ssize Slave size in elements
+ * \param tt_cused Used client elements
+ * \param tt_sused Used slave elements
+ * \param schannels Slave channels
+ * \retval zero on success otherwise a negative error code
+ */
+int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *ttable,
+ unsigned int tt_csize, unsigned int tt_ssize,
+ unsigned int *tt_cused, unsigned int *tt_sused,
+ int schannels)
+{
+ return _snd_pcm_route_load_ttable(tt, ttable, tt_csize, tt_ssize,
+ tt_cused, tt_sused, schannels, NULL);
+}
+
/*! \page pcm_plugins
\section pcm_plugins_route Plugin: Route & Volume
@@ -1100,6 +1307,9 @@ int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *tt
This plugin converts channels and applies volume during the conversion.
The format and rate must match for both of them.
+SCHANNEL can be a channel name instead of a number (e g FL, LFE).
+If so, a matching channel map will be selected for the slave.
+
\code
pcm.name {
type route # Route & Volume conversion PCM
@@ -1150,6 +1360,7 @@ int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
int err;
snd_pcm_t *spcm;
snd_config_t *slave = NULL, *sconf;
+ snd_pcm_chmap_t *tt_chmap, *chmap;
snd_pcm_format_t sformat = SND_PCM_FORMAT_UNKNOWN;
int schannels = -1;
snd_config_t *tt = NULL;
@@ -1198,37 +1409,59 @@ int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
return -EINVAL;
}
- err = snd_pcm_route_determine_ttable(tt, &csize, &ssize);
+ err = determine_chmap(tt, &tt_chmap);
if (err < 0) {
- snd_config_delete(sconf);
+ free(ttable);
return err;
}
- ttable = malloc(csize * ssize * sizeof(snd_pcm_route_ttable_entry_t));
- if (ttable == NULL) {
- snd_config_delete(sconf);
- return -ENOMEM;
- }
- err = snd_pcm_route_load_ttable(tt, ttable, csize, ssize,
- &cused, &sused, schannels);
+
+ err = snd_pcm_open_slave(&spcm, root, sconf, stream, mode, conf);
+ snd_config_delete(sconf);
if (err < 0) {
+ free(tt_chmap);
free(ttable);
- snd_config_delete(sconf);
return err;
}
- err = snd_pcm_open_slave(&spcm, root, sconf, stream, mode, conf);
- snd_config_delete(sconf);
+ if (tt_chmap) {
+ err = find_matching_chmap(spcm, tt_chmap, &chmap, &schannels);
+ free(tt_chmap);
+ if (err < 0)
+ return err;
+ }
+
+ err = _snd_pcm_route_determine_ttable(tt, &csize, &ssize, chmap);
+ if (err < 0) {
+ free(chmap);
+ snd_pcm_close(spcm);
+ return err;
+ }
+ ttable = malloc(csize * ssize * sizeof(snd_pcm_route_ttable_entry_t));
+ if (ttable == NULL) {
+ free(chmap);
+ snd_pcm_close(spcm);
+ return -ENOMEM;
+ }
+ err = _snd_pcm_route_load_ttable(tt, ttable, csize, ssize,
+ &cused, &sused, schannels, chmap);
if (err < 0) {
+ free(chmap);
free(ttable);
+ snd_pcm_close(spcm);
return err;
}
+
err = snd_pcm_route_open(pcmp, name, sformat, schannels,
ttable, ssize,
cused, sused,
spcm, 1);
free(ttable);
- if (err < 0)
+ if (err < 0) {
+ free(chmap);
snd_pcm_close(spcm);
+ }
+ ((snd_pcm_route_t*) (*pcmp)->private_data)->chmap = chmap;
+
return err;
}
#ifndef DOC_HIDDEN
--
1.9.0

View File

@ -1,42 +0,0 @@
From 48f1b308cc66152eb6db66742dd0d08d888cda8d Mon Sep 17 00:00:00 2001
From: David Henningsson <david.henningsson@canonical.com>
Date: Fri, 28 Feb 2014 08:57:07 +0100
Subject: [PATCH] conf: Allow 2.1 surround to use different number of channels
This way, cards that support LFE on four channels (e g laptop with
internal subwoofer) can do that, and other cards on a six channel setup
can use that as well.
Well, note that there is still a reference to "pcm.surround51" left here.
In practice, for HDA Intel sound cards this does not matter as both
surround51 and surround40 reference the same definition.
(And that's the only card I currently know of that actually does
surround2.1 over four channels.)
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/conf/pcm/surround21.conf | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/conf/pcm/surround21.conf b/src/conf/pcm/surround21.conf
index be29020f24c7..7f4676b3f714 100644
--- a/src/conf/pcm/surround21.conf
+++ b/src/conf/pcm/surround21.conf
@@ -51,10 +51,9 @@ pcm.!surround21 {
]
}
}
- slave.channels 6
- ttable.0.0 1
- ttable.1.1 1
- ttable.2.5 1
+ ttable.0.FL 1
+ ttable.1.FR 1
+ ttable.2.LFE 1
hint {
description "2.1 Surround output to Front and Subwoofer speakers"
device $DEV
--
1.9.0

View File

@ -1,31 +0,0 @@
From 688004a6acf7d1d568a660546816a092b6cc32ed Mon Sep 17 00:00:00 2001
From: "MONTANARO Luciano (MM)" <luciano.montanaro@magnetimarelli.com>
Date: Tue, 4 Mar 2014 12:51:36 +0100
Subject: [PATCH] pcm: Wrap hw_ptr to boundary in pcm_ioplug
The function snd_pcm_ioplug_hw_ptr_update() always increased the hw_ptr
by delta, without wrapping it to the boundary. This would lead to
problems when after many hours, the hw_ptr would overflow.
Signed-off-by: Luciano Montanaro <luciano.montanaro@magnetimarelli.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_ioplug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pcm/pcm_ioplug.c b/src/pcm/pcm_ioplug.c
index a90c844598bd..c1c3a9835d47 100644
--- a/src/pcm/pcm_ioplug.c
+++ b/src/pcm/pcm_ioplug.c
@@ -60,7 +60,7 @@ static void snd_pcm_ioplug_hw_ptr_update(snd_pcm_t *pcm)
delta = hw - io->last_hw;
else
delta = pcm->buffer_size + hw - io->last_hw;
- io->data->hw_ptr += delta;
+ snd_pcm_mmap_hw_forward(io->data->pcm, delta);
io->last_hw = hw;
} else
io->data->state = SNDRV_PCM_STATE_XRUN;
--
1.9.0

View File

@ -1,25 +0,0 @@
From cbcc78031b676413265719113c7109481fa0242d Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Tue, 11 Mar 2014 10:59:21 +0100
Subject: [PATCH] src/conf/cards: Add missing entry for Loopback.conf
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/conf/cards/Makefile.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/conf/cards/Makefile.am b/src/conf/cards/Makefile.am
index ee7991be28e8..008d399fdc34 100644
--- a/src/conf/cards/Makefile.am
+++ b/src/conf/cards/Makefile.am
@@ -35,6 +35,7 @@ cfg_files = aliases.conf \
ICH.conf \
ICH4.conf \
ICH-MODEM.conf \
+ Loopback.conf \
Maestro3.conf \
NFORCE.conf \
PC-Speaker.conf \
--
1.9.0

View File

@ -1,34 +0,0 @@
From d794af65e97822a29945a21c1cd2a21ea3b8e6b8 Mon Sep 17 00:00:00 2001
From: David Henningsson <david.henningsson@canonical.com>
Date: Tue, 18 Mar 2014 23:07:19 +0100
Subject: [PATCH] route: Return NULL in case of zero found channels in
determine_chmap
This should fix the problem where the old route syntax can no longer
be opened.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_route.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c
index ac11bdc8adfd..a9097caa7303 100644
--- a/src/pcm/pcm_route.c
+++ b/src/pcm/pcm_route.c
@@ -883,7 +883,10 @@ static int determine_chmap(snd_config_t *tt, snd_pcm_chmap_t **tt_chmap)
}
}
-
+ if (chmap->channels == 0) {
+ free(chmap);
+ chmap = NULL;
+ }
*tt_chmap = chmap;
return 0;
--
1.9.1

View File

@ -1,41 +0,0 @@
From dbe6d7f86902dbbe2ff276b7a6524c084893772f Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Wed, 19 Mar 2014 10:52:24 +0100
Subject: [PATCH] route: Fix invalid pointer access
An uninitialized chmap pointer value is assigned in
_snd_pcm_route_open(). Add NULL initializations appropriately, and
also avoid the possible invalid access of NULL pcmp pointer.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_route.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c
index a9097caa7303..599fc3eb48e2 100644
--- a/src/pcm/pcm_route.c
+++ b/src/pcm/pcm_route.c
@@ -1361,7 +1361,7 @@ int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
int err;
snd_pcm_t *spcm;
snd_config_t *slave = NULL, *sconf;
- snd_pcm_chmap_t *tt_chmap, *chmap;
+ snd_pcm_chmap_t *tt_chmap = NULL, *chmap = NULL;
snd_pcm_format_t sformat = SND_PCM_FORMAT_UNKNOWN;
int schannels = -1;
snd_config_t *tt = NULL;
@@ -1460,8 +1460,9 @@ int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
if (err < 0) {
free(chmap);
snd_pcm_close(spcm);
+ } else {
+ ((snd_pcm_route_t*) (*pcmp)->private_data)->chmap = chmap;
}
- ((snd_pcm_route_t*) (*pcmp)->private_data)->chmap = chmap;
return err;
}
--
1.9.1

View File

@ -1,40 +0,0 @@
From 8dcce52ee09b12d977ea23ccd281a17bdcc5414e Mon Sep 17 00:00:00 2001
From: Matthias Larisch <mail@matthias-larisch.de>
Date: Thu, 27 Mar 2014 19:05:10 +0100
Subject: [PATCH] pcm: ladspa: Delay LADSPA plugin activate call
Some LADSPA Plugins rely on connected control ports on activate call.
While this is not okay by spec, the spec also encourages the activate
call happening as late as possible.
Signed-off-by: Matthias Larisch <mail@matthias-larisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/pcm/pcm_ladspa.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/pcm/pcm_ladspa.c b/src/pcm/pcm_ladspa.c
index 9ce5242e2359..7d1e3df878b0 100644
--- a/src/pcm/pcm_ladspa.c
+++ b/src/pcm/pcm_ladspa.c
@@ -645,8 +645,6 @@ static int snd_pcm_ladspa_allocate_instances(snd_pcm_t *pcm, snd_pcm_ladspa_t *l
return -EINVAL;
}
list_add_tail(&instance->list, &plugin->instances);
- if (plugin->desc->activate)
- plugin->desc->activate(instance->handle);
if (plugin->policy == SND_PCM_LADSPA_POLICY_DUPLICATE) {
err = snd_pcm_ladspa_connect_plugin_duplicate(plugin, &plugin->input, &plugin->output, instance, idx);
if (err < 0) {
@@ -664,6 +662,8 @@ static int snd_pcm_ladspa_allocate_instances(snd_pcm_t *pcm, snd_pcm_ladspa_t *l
assert(err >= 0);
err = snd_pcm_ladspa_connect_controls(plugin, &plugin->output, instance);
assert(err >= 0);
+ if (plugin->desc->activate)
+ plugin->desc->activate(instance->handle);
}
err = snd_pcm_ladspa_check_connect(plugin, &plugin->input, &instance->input, depth);
if (err < 0)
--
1.9.1

View File

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

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

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

View File

@ -1,3 +1,48 @@
-------------------------------------------------------------------
Wed Jun 18 13:08:38 CEST 2014 - tiwai@suse.de
- Updated to alsa-lib 1.0.28:
All pervious fix patches are obsoleted:
0001-local.h-use-__kernel_off_t-from-linux-types.h.patch
0002-conf-cards-add-Audio-Advantage-Micro-II.patch
0003-pcm-Fix-a-wrong-value-shown-in-the-error-message-in-.patch
0004-UCM-Document-some-standard-values.patch
0005-hdspm.h-Update-LTC-ioctl-to-use-struct-hdspm_ltc.patch
0006-Update-iatomic.h-functions-definitions-for-mips.patch
0007-Fix-access-of-freed-memory-in-namehints.patch
0008-HDA-Intel-present-up-to-8-HDMI-DP-outputs-via-hdmi-d.patch
0009-snd_tlv_convert_from_dB-fix-decreasing-gain-across-e.patch
0010-remove-unnecessary-obsolete-compat-hsearch_r.c.patch
0011-local.h-include-sys-types.h-to-fix-issues-with-pcm.h.patch
0012-test-chmap-Add-missing-usage-text-for-s-option.patch
0013-include-global.h-don-t-define-timeval-and-timespec-s.patch
0014-conf.c-use-portable-way-to-initialize-recursive-mute.patch
0015-pcm_file-fix-SEGFAULT-if-file-option-is-missing-whil.patch
0016-pcm_file-fixed-memory-leak.patch
0017-pcm_file-don-t-touch-infile-on-playback-and-output-f.patch
0018-pcm_file-document-new-argument-to-snd_pcm_file_open.patch
0019-dmix-Don-t-use-assert-and-abort.patch
0020-minor-malloc-changes.patch
0021-alsa-lib-minor-typo-in-pcm-doc.patch
0022-control_hw-fix-potential-memory-leak.patch
0023-pcm-initialize-pcm_dmix-monotonic-field.patch
0024-pcm-initialize-monotonic-field-for-dshare-and-dsnoop.patch
0025-pcm-use-CLOCK_REALTIME-for-non-monotonic-ts.patch
0026-alsa-lib-heavy-pcm-atomics-cleanup.patch
0027-conf-Add-basic-infrastructure-for-2.1-surround-sound.patch
0028-conf-Add-surround-2.1-support-to-all-cards.patch
0029-Portability-fix-look-for-sys-endian.h-as-well-as-end.patch
0030-autotools-update-style.patch
0031-pcm-Insert-linear-to-float-conversion-when-rate-or-c.patch
0032-pcm-route-Allow-chmap-syntax-for-slave-channels-in-t.patch
0033-pcm-route-Select-slave-chmap-based-on-ttable-informa.patch
0034-conf-Allow-2.1-surround-to-use-different-number-of-c.patch
0035-pcm-Wrap-hw_ptr-to-boundary-in-pcm_ioplug.patch
0036-src-conf-cards-Add-missing-entry-for-Loopback.conf.patch
0037-route-Return-NULL-in-case-of-zero-found-channels-in-.patch
0038-route-Fix-invalid-pointer-access.patch
0039-pcm-ladspa-Delay-LADSPA-plugin-activate-call.patch
-------------------------------------------------------------------
Thu Apr 3 17:10:46 CEST 2014 - tiwai@suse.de

View File

@ -16,14 +16,14 @@
#
%define package_version 1.0.27.2
%define package_version 1.0.28
%if 0%{?suse_version} > 1200
%define _udevdir %(pkg-config --variable=udevdir udev)
%else
%define _udevdir /lib/udev
%endif
Name: alsa
Version: 1.0.27.2
Version: 1.0.28
Release: 0
#
Summary: Advanced Linux Sound Architecture
@ -52,45 +52,6 @@ Source41: install-snd-module
Source50: Loopback.conf
# Patch: alsa-lib-git-fixes.diff
# upstream fixes
Patch1: 0001-local.h-use-__kernel_off_t-from-linux-types.h.patch
Patch2: 0002-conf-cards-add-Audio-Advantage-Micro-II.patch
Patch3: 0003-pcm-Fix-a-wrong-value-shown-in-the-error-message-in-.patch
Patch4: 0004-UCM-Document-some-standard-values.patch
Patch5: 0005-hdspm.h-Update-LTC-ioctl-to-use-struct-hdspm_ltc.patch
Patch6: 0006-Update-iatomic.h-functions-definitions-for-mips.patch
Patch7: 0007-Fix-access-of-freed-memory-in-namehints.patch
Patch8: 0008-HDA-Intel-present-up-to-8-HDMI-DP-outputs-via-hdmi-d.patch
Patch9: 0009-snd_tlv_convert_from_dB-fix-decreasing-gain-across-e.patch
Patch10: 0010-remove-unnecessary-obsolete-compat-hsearch_r.c.patch
Patch11: 0011-local.h-include-sys-types.h-to-fix-issues-with-pcm.h.patch
Patch12: 0012-test-chmap-Add-missing-usage-text-for-s-option.patch
Patch13: 0013-include-global.h-don-t-define-timeval-and-timespec-s.patch
Patch14: 0014-conf.c-use-portable-way-to-initialize-recursive-mute.patch
Patch15: 0015-pcm_file-fix-SEGFAULT-if-file-option-is-missing-whil.patch
Patch16: 0016-pcm_file-fixed-memory-leak.patch
Patch17: 0017-pcm_file-don-t-touch-infile-on-playback-and-output-f.patch
Patch18: 0018-pcm_file-document-new-argument-to-snd_pcm_file_open.patch
Patch19: 0019-dmix-Don-t-use-assert-and-abort.patch
Patch20: 0020-minor-malloc-changes.patch
Patch21: 0021-alsa-lib-minor-typo-in-pcm-doc.patch
Patch22: 0022-control_hw-fix-potential-memory-leak.patch
Patch23: 0023-pcm-initialize-pcm_dmix-monotonic-field.patch
Patch24: 0024-pcm-initialize-monotonic-field-for-dshare-and-dsnoop.patch
Patch25: 0025-pcm-use-CLOCK_REALTIME-for-non-monotonic-ts.patch
Patch26: 0026-alsa-lib-heavy-pcm-atomics-cleanup.patch
Patch27: 0027-conf-Add-basic-infrastructure-for-2.1-surround-sound.patch
Patch28: 0028-conf-Add-surround-2.1-support-to-all-cards.patch
Patch29: 0029-Portability-fix-look-for-sys-endian.h-as-well-as-end.patch
Patch30: 0030-autotools-update-style.patch
Patch31: 0031-pcm-Insert-linear-to-float-conversion-when-rate-or-c.patch
Patch32: 0032-pcm-route-Allow-chmap-syntax-for-slave-channels-in-t.patch
Patch33: 0033-pcm-route-Select-slave-chmap-based-on-ttable-informa.patch
Patch34: 0034-conf-Allow-2.1-surround-to-use-different-number-of-c.patch
Patch35: 0035-pcm-Wrap-hw_ptr-to-boundary-in-pcm_ioplug.patch
Patch36: 0036-src-conf-cards-Add-missing-entry-for-Loopback.conf.patch
Patch37: 0037-route-Return-NULL-in-case-of-zero-found-channels-in-.patch
Patch38: 0038-route-Fix-invalid-pointer-access.patch
Patch39: 0039-pcm-ladspa-Delay-LADSPA-plugin-activate-call.patch
# rest suse patches
Patch99: alsa-lib-doxygen-avoid-crash-for-11.3.diff
BuildRequires: doxygen
@ -160,45 +121,6 @@ Architecture.
%setup -q -n alsa-lib-%{package_version}
cp %{SOURCE50} src/conf/cards
# %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
%patch32 -p1
%patch33 -p1
%patch34 -p1
%patch35 -p1
%patch36 -p1
%patch37 -p1
%patch38 -p1
%patch39 -p1
%if 0%{?suse_version} == 1130
%patch99 -p1
%endif