forked from pool/alsa-utils
Accepting request 237959 from home:tiwai:branches:multimedia:libs
- Updated to alsa-utils 1.0.28: All pervious fix patches are obsoleted: 0001-alsactl-alsa-state.service-fix-typo-rkill-kill.patch 0002-alsaloop-fix-wrong-alias-for-signal.h.patch 0003-aplay-fix-two-off-by-one-errors.patch 0004-alsaloop-add-z-syslog-option-to-use-syslog-for-error.patch 0005-amixer-actually-print-all-TLVs-in-a-container-TLV.patch 0006-amixer-fix-indentation-when-printing-container-TLV-c.patch 0007-alsaloop-pcmjob.c-use-portable-way-to-initialize-rec.patch 0008-speaker-test-Fix-chmapped-channel-selection-without-.patch 0009-speaker-test-Always-show-chmap-channel-names-if-avai.patch 0010-speaker-test-Show-out-of-chmap-channels-as-Unknown.patch 0011-alsaconf-support-newer-m-i-t-and-kmod.patch 0012-alsaconf-update-gentoo-to-use-modprobe.d-method-as-e.patch 0013-configure-detect-udevdir-via-pkg-config-fallback-to-.patch 0014-alsactl-Add-monitor-command.patch 0015-alsactl-Fix-REMOVE-event-handling-in-monitor-command.patch 0016-alsactl-monitor-all-cards-as-default.patch 0017-alsactl-Fix-the-va_list-initialization-in-cerror_-an.patch 0018-aplay-fix-pcm_read-return-value.patch 0019-alsa-restore.rules-refer-to-correct-attr.patch 0020-aplay-fix-timespec-to-msec-conversion.patch 0021-speaker-test-add-force-frequency-option-to-allow-hz-.patch 0022-speaker-test-update-man-page-for-new-X-arg-also-cons.patch OBS-URL: https://build.opensuse.org/request/show/237959 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa-utils?expand=0&rev=100
This commit is contained in:
parent
794cdbcb70
commit
5ab04e6e73
@ -1,23 +0,0 @@
|
||||
From dda4392cd5e87270db044e2838b17e2edc034dc3 Mon Sep 17 00:00:00 2001
|
||||
From: Jaroslav Kysela <perex@perex.cz>
|
||||
Date: Fri, 19 Jul 2013 14:36:52 +0200
|
||||
Subject: [PATCH] alsactl: alsa-state.service - fix typo (rkill -> kill)
|
||||
|
||||
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
||||
---
|
||||
alsactl/alsa-state.service.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/alsactl/alsa-state.service.in b/alsactl/alsa-state.service.in
|
||||
index 768c5a8..56c12c1 100644
|
||||
--- a/alsactl/alsa-state.service.in
|
||||
+++ b/alsactl/alsa-state.service.in
|
||||
@@ -14,4 +14,4 @@ Conflicts=shutdown.target
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=-@sbindir@/alsactl -s -n 19 -c rdaemon
|
||||
-ExecStop=-@sbindir@/alsactl -s rkill save_and_quit
|
||||
+ExecStop=-@sbindir@/alsactl -s kill save_and_quit
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -1,34 +0,0 @@
|
||||
From 8f57464190eb683d9517d8cfbd2cefb6223c6f1d Mon Sep 17 00:00:00 2001
|
||||
From: Jaroslav Kysela <perex@perex.cz>
|
||||
Date: Tue, 23 Jul 2013 14:57:05 +0200
|
||||
Subject: [PATCH] alsaloop: fix wrong alias for signal.h
|
||||
|
||||
in POSIX, there is no <sys/signal.h>.
|
||||
|
||||
it's merely a legacy alias used by glibc, and the header does nothing
|
||||
else than including <signal.h>.
|
||||
|
||||
so let's do the right thing and use the right name, which works everywhere.
|
||||
|
||||
Signed-off-by: John Spencer <maillist-alsa@barfooze.de>
|
||||
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
||||
---
|
||||
alsaloop/alsaloop.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/alsaloop/alsaloop.c b/alsaloop/alsaloop.c
|
||||
index e1a36d2..20150dd 100644
|
||||
--- a/alsaloop/alsaloop.c
|
||||
+++ b/alsaloop/alsaloop.c
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <math.h>
|
||||
#include <pthread.h>
|
||||
#include <syslog.h>
|
||||
-#include <sys/signal.h>
|
||||
+#include <signal.h>
|
||||
#include "alsaloop.h"
|
||||
|
||||
struct loopback_thread {
|
||||
--
|
||||
1.8.4
|
||||
|
@ -1,38 +0,0 @@
|
||||
From 719faff80962a5d93c09980673f08048ae58add6 Mon Sep 17 00:00:00 2001
|
||||
From: Jurgen Kramer <gtmkramer@xs4all.nl>
|
||||
Date: Mon, 9 Sep 2013 12:02:29 +0200
|
||||
Subject: [PATCH] aplay: fix two off by one errors
|
||||
|
||||
Attached patch for aplay fixes two off-by-one errors preventing usage
|
||||
of the last available sample format.
|
||||
|
||||
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
---
|
||||
aplay/aplay.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/aplay/aplay.c b/aplay/aplay.c
|
||||
index 89c6b06..e0631c4 100644
|
||||
--- a/aplay/aplay.c
|
||||
+++ b/aplay/aplay.c
|
||||
@@ -242,7 +242,7 @@ _("Usage: %s [OPTION]... [FILE]...\n"
|
||||
)
|
||||
, command);
|
||||
printf(_("Recognized sample formats are:"));
|
||||
- for (k = 0; k < SND_PCM_FORMAT_LAST; ++k) {
|
||||
+ for (k = 0; k <= SND_PCM_FORMAT_LAST; ++k) {
|
||||
const char *s = snd_pcm_format_name(k);
|
||||
if (s)
|
||||
printf(" %s", s);
|
||||
@@ -1114,7 +1114,7 @@ static void show_available_sample_formats(snd_pcm_hw_params_t* params)
|
||||
snd_pcm_format_t format;
|
||||
|
||||
fprintf(stderr, "Available formats:\n");
|
||||
- for (format = 0; format < SND_PCM_FORMAT_LAST; format++) {
|
||||
+ for (format = 0; format <= SND_PCM_FORMAT_LAST; format++) {
|
||||
if (snd_pcm_hw_params_test_format(handle, params, format) == 0)
|
||||
fprintf(stderr, "- %s\n", snd_pcm_format_name(format));
|
||||
}
|
||||
--
|
||||
1.8.4
|
||||
|
@ -1,77 +0,0 @@
|
||||
From 87bcda4b8a12d0fabab0bf4b0c1197089d2f9c4c Mon Sep 17 00:00:00 2001
|
||||
From: Jaroslav Kysela <perex@perex.cz>
|
||||
Date: Fri, 26 Jul 2013 16:16:00 +0200
|
||||
Subject: [PATCH] alsaloop: add -z,--syslog option to use syslog for errors
|
||||
|
||||
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
||||
---
|
||||
alsaloop/alsaloop.c | 18 +++++++++++++++---
|
||||
1 file changed, 15 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/alsaloop/alsaloop.c b/alsaloop/alsaloop.c
|
||||
index 20150dd..3b20682 100644
|
||||
--- a/alsaloop/alsaloop.c
|
||||
+++ b/alsaloop/alsaloop.c
|
||||
@@ -195,6 +195,7 @@ void help(void)
|
||||
"-w,--workaround use workaround (serialopen)\n"
|
||||
"-U,--xrun xrun profiling\n"
|
||||
"-W,--wake process wake timeout in ms\n"
|
||||
+"-z,--syslog use syslog for errors\n"
|
||||
);
|
||||
printf("\nRecognized sample formats are:");
|
||||
for (k = 0; k < SND_PCM_FORMAT_LAST; ++k) {
|
||||
@@ -334,6 +335,14 @@ static int add_oss_mixers(struct loopback *loop,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static void enable_syslog(void)
|
||||
+{
|
||||
+ if (!use_syslog) {
|
||||
+ use_syslog = 1;
|
||||
+ openlog("alsaloop", LOG_NDELAY|LOG_PID, LOG_DAEMON);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static int parse_config_file(const char *file, snd_output_t *output);
|
||||
|
||||
static int parse_config(int argc, char *argv[], snd_output_t *output,
|
||||
@@ -368,6 +377,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
|
||||
{"ossmixer", 1, NULL, 'O'},
|
||||
{"workaround", 1, NULL, 'w'},
|
||||
{"xrun", 0, NULL, 'U'},
|
||||
+ {"syslog", 0, NULL, 'z'},
|
||||
{NULL, 0, NULL, 0},
|
||||
};
|
||||
int err, morehelp;
|
||||
@@ -405,7 +415,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
|
||||
while (1) {
|
||||
int c;
|
||||
if ((c = getopt_long(argc, argv,
|
||||
- "hdg:P:C:X:Y:l:t:F:f:c:r:s:benvA:S:a:m:T:O:w:UW:",
|
||||
+ "hdg:P:C:X:Y:l:t:F:f:c:r:s:benvA:S:a:m:T:O:w:UW:z",
|
||||
long_option, NULL)) < 0)
|
||||
break;
|
||||
switch (c) {
|
||||
@@ -417,8 +427,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
|
||||
break;
|
||||
case 'd':
|
||||
daemonize = 1;
|
||||
- use_syslog = 1;
|
||||
- openlog("alsaloop", LOG_NDELAY|LOG_PID, LOG_DAEMON);
|
||||
+ enable_syslog();
|
||||
break;
|
||||
case 'P':
|
||||
arg_pdevice = strdup(optarg);
|
||||
@@ -561,6 +570,9 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
|
||||
if (cmdline)
|
||||
arg_default_wake = arg_wake;
|
||||
break;
|
||||
+ case 'z':
|
||||
+ enable_syslog();
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
1.8.4
|
||||
|
@ -1,36 +0,0 @@
|
||||
From 180283e2307b07bbd3958d24382aab8271dd4c1d Mon Sep 17 00:00:00 2001
|
||||
From: Anssi Hannula <anssi.hannula@iki.fi>
|
||||
Date: Mon, 30 Sep 2013 23:46:50 +0300
|
||||
Subject: [PATCH] amixer: actually print all TLVs in a container TLV
|
||||
|
||||
Due to a wrong indexing of tlv[] decode_tlv() always skips to the end of
|
||||
the container TLV since the used tlv[1] contains the container TLV size
|
||||
instead of the intended element size.
|
||||
|
||||
This causes, for example, only the first HDMI channel map TLV to be
|
||||
shown.
|
||||
|
||||
Fix the indexing to actually use the element size.
|
||||
|
||||
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
|
||||
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
---
|
||||
amixer/amixer.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/amixer/amixer.c b/amixer/amixer.c
|
||||
index 7727943..b83b0c3 100644
|
||||
--- a/amixer/amixer.c
|
||||
+++ b/amixer/amixer.c
|
||||
@@ -468,7 +468,7 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_
|
||||
return;
|
||||
}
|
||||
decode_tlv(spaces + 2, tlv + idx, tlv[idx+1] + 8);
|
||||
- idx += 2 + (tlv[1] + sizeof(unsigned int) - 1) / sizeof(unsigned int);
|
||||
+ idx += 2 + (tlv[idx+1] + sizeof(unsigned int) - 1) / sizeof(unsigned int);
|
||||
}
|
||||
break;
|
||||
case SND_CTL_TLVT_DB_SCALE:
|
||||
--
|
||||
1.8.4
|
||||
|
@ -1,42 +0,0 @@
|
||||
From f1e991e81350e9388ab6cf04a64ac4b4389a588c Mon Sep 17 00:00:00 2001
|
||||
From: Anssi Hannula <anssi.hannula@iki.fi>
|
||||
Date: Tue, 1 Oct 2013 23:46:53 +0300
|
||||
Subject: [PATCH] amixer: fix indentation when printing container TLV contents
|
||||
|
||||
decode_tlv() adds indentation in the beginning, with the expectation
|
||||
that the TLV will be printed on the line afterwards in a switch-case.
|
||||
|
||||
However, in the case of a container TLV the switch-case simply adds
|
||||
another level of indentation and calls decode_tlv() for the inner TLVs.
|
||||
This causes the first inner TLV to be printed with too much indentation
|
||||
and double '|'.
|
||||
|
||||
Fix that by printing "container" and a newline for container TLVs, so
|
||||
that the result is as follows:
|
||||
: values=0,0,0,0,0,0,0,0
|
||||
| container
|
||||
| chmap-variable=FL,FR
|
||||
| chmap-variable=FL,FR,LFE
|
||||
| chmap-variable=FL,FR,FC
|
||||
|
||||
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
|
||||
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
---
|
||||
amixer/amixer.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/amixer/amixer.c b/amixer/amixer.c
|
||||
index b83b0c356474..cf82892bfa2f 100644
|
||||
--- a/amixer/amixer.c
|
||||
+++ b/amixer/amixer.c
|
||||
@@ -460,6 +460,7 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_
|
||||
}
|
||||
switch (type) {
|
||||
case SND_CTL_TLVT_CONTAINER:
|
||||
+ printf("container\n");
|
||||
size += sizeof(unsigned int) -1;
|
||||
size /= sizeof(unsigned int);
|
||||
while (idx < size) {
|
||||
--
|
||||
1.8.4.3
|
||||
|
@ -1,55 +0,0 @@
|
||||
From 0616d87fbaae1d4a558104051cb5369504eb2068 Mon Sep 17 00:00:00 2001
|
||||
From: John Spencer <maillist-alsa@barfooze.de>
|
||||
Date: Fri, 8 Nov 2013 13:59:41 +0100
|
||||
Subject: [PATCH] alsaloop: pcmjob.c: use portable way to initialize recursive
|
||||
mutex
|
||||
|
||||
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: John Spencer <maillist-alsa@barfooze.de>
|
||||
Tested-by: John Spencer <maillist-alsa@barfooze.de>
|
||||
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
||||
---
|
||||
alsaloop/pcmjob.c | 15 +++++++++++++--
|
||||
1 file changed, 13 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/alsaloop/pcmjob.c b/alsaloop/pcmjob.c
|
||||
index 139b6fdf087e..f32180c8e8cd 100644
|
||||
--- a/alsaloop/pcmjob.c
|
||||
+++ b/alsaloop/pcmjob.c
|
||||
@@ -62,11 +62,22 @@ static const char *src_types[] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
-static pthread_mutex_t pcm_open_mutex =
|
||||
- PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
|
||||
+static pthread_once_t pcm_open_mutex_once = PTHREAD_ONCE_INIT;
|
||||
+static pthread_mutex_t pcm_open_mutex;
|
||||
+
|
||||
+static void pcm_open_init_mutex(void)
|
||||
+{
|
||||
+ pthread_mutexattr_t attr;
|
||||
+
|
||||
+ pthread_mutexattr_init(&attr);
|
||||
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
|
||||
+ pthread_mutex_init(&pcm_open_mutex, &attr);
|
||||
+ pthread_mutexattr_destroy(&attr);
|
||||
+}
|
||||
|
||||
static inline void pcm_open_lock(void)
|
||||
{
|
||||
+ pthread_once(&pcm_open_mutex_once, pcm_open_init_mutex);
|
||||
if (workarounds & WORKAROUND_SERIALOPEN)
|
||||
pthread_mutex_lock(&pcm_open_mutex);
|
||||
}
|
||||
--
|
||||
1.8.4.3
|
||||
|
@ -1,232 +0,0 @@
|
||||
From a1992044d5813371ce71f5252187942f943b198d Mon Sep 17 00:00:00 2001
|
||||
From: Anssi Hannula <anssi.hannula@iki.fi>
|
||||
Date: Tue, 12 Nov 2013 00:04:02 +0200
|
||||
Subject: [PATCH] speaker-test: Fix chmapped channel selection without
|
||||
specified chmap
|
||||
|
||||
The channel selection currently does not work properly when there is a
|
||||
driver-provided non-ALSA-traditional channel map but no manual channel
|
||||
map was explicitely requested with "-m".
|
||||
|
||||
For example, the CEA/HDMI 8ch map is FL,FR,RLC,RRC,FC,LFE,RL,RR. Note
|
||||
that it is otherwise the same as the traditional ALSA channel map,
|
||||
except that the traditional rear speakers are considered
|
||||
rear-center speakers and the traditional side speakers are considered
|
||||
rear speakers.
|
||||
|
||||
Speaker-test tries to play back channels in this following order:
|
||||
0, /* Front Left */
|
||||
4, /* Center */
|
||||
1, /* Front Right */
|
||||
7, /* Side Right */
|
||||
3, /* Rear Right */
|
||||
2, /* Rear Left */
|
||||
6, /* Side Left */
|
||||
5, /* LFE */
|
||||
|
||||
When it is the time to play back Side Left/Right, speaker-test tries to
|
||||
look for SL/SR in the chmap, but doesn't find it, so it just plays back
|
||||
channels 6/7 (which indeed are the side speakers, or RL/RR in this
|
||||
channel map - so the correct channels are selected).
|
||||
|
||||
When it becomes the time to playback Rear Left/Right, speaker-test again
|
||||
tries to find RL/RR in the chmap, and this time it does find them in the
|
||||
chmap positions 6/7.
|
||||
|
||||
So the channels 6/7 are tested twice and 2/3 are never tested.
|
||||
|
||||
To fix this, define a generic playback order channel_order[] to be used
|
||||
when the channel map is present (but not user-defined) and generate a
|
||||
(speaker/playback number => channel number) mapping with the channels
|
||||
ordered in the following order:
|
||||
1. regular channels found in channel_order[] in the defined order,
|
||||
2. channels not found in channel_order[] ordered by channel number.
|
||||
3. UNKNOWN channels ordered by channel number.
|
||||
4. NA channels ordered by channel number.
|
||||
For channels outside the channel map just use their channel numbers (so
|
||||
they will be last after all of the above).
|
||||
|
||||
For example, if the playback device has a fictional default channel map
|
||||
of FR,FL,UNKNOWN1,FOO,BAR,RR,RL,UNKNOWN2, the playback order will be
|
||||
FL,FR,RR,RL,FOO,BAR,UNKNOWN1,UNKNOWN2(,any_extra_channels).
|
||||
|
||||
When the channel mapping is specified manually, the specified order is
|
||||
used for playback as before.
|
||||
|
||||
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
|
||||
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
---
|
||||
speaker-test/speaker-test.c | 113 +++++++++++++++++++++++++++++++++++---------
|
||||
1 file changed, 91 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/speaker-test/speaker-test.c b/speaker-test/speaker-test.c
|
||||
index d35065f73a7a..25b08dcee70b 100644
|
||||
--- a/speaker-test/speaker-test.c
|
||||
+++ b/speaker-test/speaker-test.c
|
||||
@@ -88,6 +88,8 @@ enum {
|
||||
#define BE_INT(v) (v)
|
||||
#endif
|
||||
|
||||
+#define ARRAY_SIZE(x) (int)(sizeof(x)/sizeof(x[0]))
|
||||
+
|
||||
static char *device = "default"; /* playback device */
|
||||
static snd_pcm_format_t format = SND_PCM_FORMAT_S16; /* sample format */
|
||||
static unsigned int rate = 48000; /* stream rate */
|
||||
@@ -110,6 +112,7 @@ static snd_pcm_t *pcm_handle = NULL;
|
||||
#ifdef CONFIG_SUPPORT_CHMAP
|
||||
static snd_pcm_chmap_t *channel_map;
|
||||
static int channel_map_set;
|
||||
+static unsigned int *ordered_channels;
|
||||
#endif
|
||||
|
||||
static const char *const channel_name[MAX_CHANNELS] = {
|
||||
@@ -156,36 +159,94 @@ static const int channels8[] = {
|
||||
5, /* LFE */
|
||||
};
|
||||
|
||||
-static int get_mapped_channel(int chn)
|
||||
-{
|
||||
#ifdef CONFIG_SUPPORT_CHMAP
|
||||
- static const int maps[MAX_CHANNELS] = {
|
||||
- SND_CHMAP_FL,
|
||||
- SND_CHMAP_FR,
|
||||
- SND_CHMAP_RL,
|
||||
- SND_CHMAP_RR,
|
||||
- SND_CHMAP_FC,
|
||||
- SND_CHMAP_LFE,
|
||||
- SND_CHMAP_SL,
|
||||
- SND_CHMAP_SR,
|
||||
- };
|
||||
+/* circular clockwise and bottom-to-top order */
|
||||
+static const int channel_order[] = {
|
||||
+ [SND_CHMAP_FLW] = 10,
|
||||
+ [SND_CHMAP_FL] = 20,
|
||||
+ [SND_CHMAP_TFL] = 30,
|
||||
+ [SND_CHMAP_FLC] = 40,
|
||||
+ [SND_CHMAP_TFLC] = 50,
|
||||
+ [SND_CHMAP_FC] = 60,
|
||||
+ [SND_CHMAP_TFC] = 70,
|
||||
+ [SND_CHMAP_FRC] = 80,
|
||||
+ [SND_CHMAP_TFRC] = 90,
|
||||
+ [SND_CHMAP_FR] = 100,
|
||||
+ [SND_CHMAP_TFR] = 110,
|
||||
+ [SND_CHMAP_FRW] = 120,
|
||||
+ [SND_CHMAP_SR] = 130,
|
||||
+ [SND_CHMAP_TSR] = 140,
|
||||
+ [SND_CHMAP_RR] = 150,
|
||||
+ [SND_CHMAP_TRR] = 160,
|
||||
+ [SND_CHMAP_RRC] = 170,
|
||||
+ [SND_CHMAP_RC] = 180,
|
||||
+ [SND_CHMAP_TRC] = 190,
|
||||
+ [SND_CHMAP_RLC] = 200,
|
||||
+ [SND_CHMAP_RL] = 210,
|
||||
+ [SND_CHMAP_TRL] = 220,
|
||||
+ [SND_CHMAP_SL] = 230,
|
||||
+ [SND_CHMAP_TSL] = 240,
|
||||
+ [SND_CHMAP_BC] = 250,
|
||||
+ [SND_CHMAP_TC] = 260,
|
||||
+ [SND_CHMAP_LLFE] = 270,
|
||||
+ [SND_CHMAP_LFE] = 280,
|
||||
+ [SND_CHMAP_RLFE] = 290,
|
||||
+ /* not in table = 10000 */
|
||||
+ [SND_CHMAP_UNKNOWN] = 20000,
|
||||
+ [SND_CHMAP_NA] = 30000,
|
||||
+};
|
||||
|
||||
- if (channel_map && maps[chn]) {
|
||||
- int i;
|
||||
- for (i = 0; i < channel_map->channels; i++) {
|
||||
- if (channel_map->pos[i] == maps[chn])
|
||||
- return i;
|
||||
- }
|
||||
+static int chpos_cmp(const void *chnum1p, const void *chnum2p)
|
||||
+{
|
||||
+ int chnum1 = *(int *)chnum1p;
|
||||
+ int chnum2 = *(int *)chnum2p;
|
||||
+ int chpos1 = channel_map->pos[chnum1];
|
||||
+ int chpos2 = channel_map->pos[chnum2];
|
||||
+ int weight1 = 10000;
|
||||
+ int weight2 = 10000;
|
||||
+
|
||||
+ if (chpos1 < ARRAY_SIZE(channel_order) && channel_order[chpos1])
|
||||
+ weight1 = channel_order[chpos1];
|
||||
+ if (chpos2 < ARRAY_SIZE(channel_order) && channel_order[chpos2])
|
||||
+ weight2 = channel_order[chpos2];
|
||||
+
|
||||
+ if (weight1 == weight2) {
|
||||
+ /* order by channel number if both have the same position (e.g. UNKNOWN)
|
||||
+ * or if neither is in channel_order[] */
|
||||
+ return chnum1 - chnum2;
|
||||
}
|
||||
-#endif
|
||||
- return chn;
|
||||
+
|
||||
+ /* order according to channel_order[] */
|
||||
+ return weight1 - weight2;
|
||||
+}
|
||||
+
|
||||
+static int *order_channels(void)
|
||||
+{
|
||||
+ /* create a (playback order => channel number) table with channels ordered
|
||||
+ * according to channel_order[] values */
|
||||
+ int i;
|
||||
+ int *ordered_chs;
|
||||
+
|
||||
+ ordered_chs = calloc(channel_map->channels, sizeof(*ordered_chs));
|
||||
+ if (!ordered_chs)
|
||||
+ return NULL;
|
||||
+
|
||||
+ for (i = 0; i < channel_map->channels; i++)
|
||||
+ ordered_chs[i] = i;
|
||||
+
|
||||
+ qsort(ordered_chs, channel_map->channels, sizeof(*ordered_chs), chpos_cmp);
|
||||
+
|
||||
+ return ordered_chs;
|
||||
}
|
||||
+#endif
|
||||
|
||||
static int get_speaker_channel(int chn)
|
||||
{
|
||||
#ifdef CONFIG_SUPPORT_CHMAP
|
||||
- if (channel_map_set)
|
||||
+ if (channel_map_set || (ordered_channels && chn >= channel_map->channels))
|
||||
return chn;
|
||||
+ if (ordered_channels)
|
||||
+ return ordered_channels[chn];
|
||||
#endif
|
||||
|
||||
switch (channels) {
|
||||
@@ -200,7 +261,7 @@ static int get_speaker_channel(int chn)
|
||||
break;
|
||||
}
|
||||
|
||||
- return get_mapped_channel(chn);
|
||||
+ return chn;
|
||||
}
|
||||
|
||||
static const char *get_channel_name(int chn)
|
||||
@@ -611,6 +672,11 @@ static int config_chmap(snd_pcm_t *handle, const char *mapstr)
|
||||
}
|
||||
|
||||
channel_map = snd_pcm_get_chmap(handle);
|
||||
+
|
||||
+ /* create a channel order table for default layouts */
|
||||
+ if (channel_map)
|
||||
+ ordered_channels = order_channels();
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -1230,6 +1296,9 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
|
||||
free(frames);
|
||||
+#ifdef CONFIG_SUPPORT_CHMAP
|
||||
+ free(ordered_channels);
|
||||
+#endif
|
||||
|
||||
return prg_exit(EXIT_SUCCESS);
|
||||
}
|
||||
--
|
||||
1.8.4.3
|
||||
|
@ -1,44 +0,0 @@
|
||||
From 5b0c6da0d8166cd404379740c5f75fda44ca5806 Mon Sep 17 00:00:00 2001
|
||||
From: Anssi Hannula <anssi.hannula@iki.fi>
|
||||
Date: Sun, 10 Nov 2013 20:29:18 +0200
|
||||
Subject: [PATCH] speaker-test: Always show chmap channel names if available
|
||||
|
||||
Currently speaker-test only uses channel names retrieved by
|
||||
snd_pcm_chmap_long_name() when a channel map has been manually set.
|
||||
|
||||
However, the device may provide a default (or fixed) channel map that
|
||||
differs from the traditional ALSA map, in which case wrong channel names
|
||||
are shown.
|
||||
|
||||
Fix that by always using the name from the channel map when a channel
|
||||
map is present.
|
||||
|
||||
Note that the names retrieved by snd_pcm_chmap_long_name() are not
|
||||
currently localized via gettext.
|
||||
|
||||
Also note that Linux kernel HDMI driver reported wrong default channel
|
||||
maps before 56cac413dd6d43af8355f5d1f90a199b540f73fc ("ALSA: hda - hdmi:
|
||||
Fix reported channel map on common default layouts").
|
||||
|
||||
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
|
||||
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
---
|
||||
speaker-test/speaker-test.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/speaker-test/speaker-test.c b/speaker-test/speaker-test.c
|
||||
index 25b08dcee70b..101bb0d390ee 100644
|
||||
--- a/speaker-test/speaker-test.c
|
||||
+++ b/speaker-test/speaker-test.c
|
||||
@@ -267,7 +267,7 @@ static int get_speaker_channel(int chn)
|
||||
static const char *get_channel_name(int chn)
|
||||
{
|
||||
#ifdef CONFIG_SUPPORT_CHMAP
|
||||
- if (channel_map_set && chn < channel_map->channels) {
|
||||
+ if (channel_map && chn < channel_map->channels) {
|
||||
const char *name = snd_pcm_chmap_long_name(channel_map->pos[chn]);
|
||||
return name ? name : "Unknown";
|
||||
}
|
||||
--
|
||||
1.8.4.3
|
||||
|
@ -1,41 +0,0 @@
|
||||
From 58752c3ae32e03d676fa225c99c9a8dde9de39ed Mon Sep 17 00:00:00 2001
|
||||
From: Anssi Hannula <anssi.hannula@iki.fi>
|
||||
Date: Sun, 10 Nov 2013 20:29:19 +0200
|
||||
Subject: [PATCH] speaker-test: Show out-of-chmap channels as Unknown
|
||||
|
||||
Currently speaker-test falls back to ALSA default channel names for
|
||||
channels out-of-chmap.
|
||||
|
||||
This causes e.g. the 4th channel of
|
||||
$ speaker-test -c4 -Dhdmi -m "FR,FL,FC"
|
||||
to be shown as "Rear Right".
|
||||
|
||||
Change the code to show such channels as Unknown instead, similar to
|
||||
when snd_pcm_chmap_long_name() does not know the name.
|
||||
|
||||
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
|
||||
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
---
|
||||
speaker-test/speaker-test.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/speaker-test/speaker-test.c b/speaker-test/speaker-test.c
|
||||
index 101bb0d390ee..261f399067e9 100644
|
||||
--- a/speaker-test/speaker-test.c
|
||||
+++ b/speaker-test/speaker-test.c
|
||||
@@ -267,8 +267,10 @@ static int get_speaker_channel(int chn)
|
||||
static const char *get_channel_name(int chn)
|
||||
{
|
||||
#ifdef CONFIG_SUPPORT_CHMAP
|
||||
- if (channel_map && chn < channel_map->channels) {
|
||||
- const char *name = snd_pcm_chmap_long_name(channel_map->pos[chn]);
|
||||
+ if (channel_map) {
|
||||
+ const char *name = NULL;
|
||||
+ if (chn < channel_map->channels)
|
||||
+ name = snd_pcm_chmap_long_name(channel_map->pos[chn]);
|
||||
return name ? name : "Unknown";
|
||||
}
|
||||
#endif
|
||||
--
|
||||
1.8.4.3
|
||||
|
@ -1,39 +0,0 @@
|
||||
From df875c6e8f1a26ccba8a9d864bcff85b633df244 Mon Sep 17 00:00:00 2001
|
||||
From: Mike Frysinger <vapier@gentoo.org>
|
||||
Date: Wed, 13 Nov 2013 13:23:47 -0500
|
||||
Subject: [PATCH] alsaconf: support newer m-i-t and kmod
|
||||
|
||||
The m-i-t package made it up to 3.10 versions before ending, so update
|
||||
the glob to handle those too.
|
||||
|
||||
Most distros are moving on to kmod, so we also want to handle the version
|
||||
string that package outputs.
|
||||
|
||||
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
||||
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
---
|
||||
alsaconf/alsaconf.in | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/alsaconf/alsaconf.in b/alsaconf/alsaconf.in
|
||||
index 5c23787742f1..59f25d1ee1d9 100644
|
||||
--- a/alsaconf/alsaconf.in
|
||||
+++ b/alsaconf/alsaconf.in
|
||||
@@ -308,9 +308,11 @@ elif [ "$kernel" = "new" ]; then
|
||||
cfgout="/etc/modprobe.d/50-sound.conf"
|
||||
cfgoldout="/etc/modprobe.d/sound"
|
||||
if [ ! -f $cfgout ]; then
|
||||
- modver=$(modprobe -V | sed -e's/^module-init-tools version //')
|
||||
- case "$modver" in
|
||||
- 3.[789]*)
|
||||
+ case "$(modprobe -V)" in
|
||||
+ "module-init-tools version "3.[789]*|\
|
||||
+ "module-init-tools version "3.1[0-9]*)
|
||||
+ ;;
|
||||
+ "kmod version "*)
|
||||
;;
|
||||
*)
|
||||
cfgout="/etc/modprobe.d/sound"
|
||||
--
|
||||
1.8.4.3
|
||||
|
@ -1,32 +0,0 @@
|
||||
From 54a459a884ea7e8fe7f80ed9bf84b0417205c5d4 Mon Sep 17 00:00:00 2001
|
||||
From: Mike Frysinger <vapier@gentoo.org>
|
||||
Date: Wed, 13 Nov 2013 13:23:48 -0500
|
||||
Subject: [PATCH] alsaconf: update gentoo to use modprobe.d method as everyone
|
||||
else
|
||||
|
||||
We migrated off modules.d a long time ago.
|
||||
|
||||
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
||||
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
---
|
||||
alsaconf/alsaconf.in | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/alsaconf/alsaconf.in b/alsaconf/alsaconf.in
|
||||
index 59f25d1ee1d9..3d6adca8b0bd 100644
|
||||
--- a/alsaconf/alsaconf.in
|
||||
+++ b/alsaconf/alsaconf.in
|
||||
@@ -300,9 +300,7 @@ if [ -n "$cfgfile" ]; then
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
-if [ "$distribution" = "gentoo" ]; then
|
||||
- cfgfile="/etc/modules.d/alsa"
|
||||
-elif [ "$kernel" = "new" ]; then
|
||||
+if [ "$kernel" = "new" ]; then
|
||||
cfgfile="/etc/modprobe.conf"
|
||||
if [ -d /etc/modprobe.d ]; then
|
||||
cfgout="/etc/modprobe.d/50-sound.conf"
|
||||
--
|
||||
1.8.4.3
|
||||
|
@ -1,36 +0,0 @@
|
||||
From 7d0c2801b3395d8dd4d46e9a1eb2491dde8a053c Mon Sep 17 00:00:00 2001
|
||||
From: Ivailo Monev <xakepa10@gmail.com>
|
||||
Date: Sat, 16 Nov 2013 14:00:19 +0000
|
||||
Subject: [PATCH] configure: detect udevdir via pkg-config, fallback to
|
||||
/lib/udev/rules.d
|
||||
|
||||
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
|
||||
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
---
|
||||
configure.in | 10 ++++++++--
|
||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/configure.in b/configure.in
|
||||
index 3ae320926a1c..60da1fa680ba 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -120,8 +120,14 @@ AM_CONDITIONAL(USE_XMLTO, test x"$xmlto" = xyes)
|
||||
|
||||
AC_ARG_WITH(
|
||||
[udev-rules-dir],
|
||||
- AS_HELP_STRING([--with-udev-rules-dir],[Directory where to install udev rules to (defaults to /lib/udev/rules.d)]),
|
||||
- [udevrulesdir=$withval], [udevrulesdir="/lib/udev/rules.d"])
|
||||
+ AS_HELP_STRING([--with-udev-rules-dir=DIR],[Directory where to install udev rules to (default=auto)]),
|
||||
+ [udevrulesdir="$withval"],
|
||||
+ [udevdir=$($PKG_CONFIG udev --variable=udevdir)
|
||||
+ if test "x$udevdir" = "x"; then
|
||||
+ udevrulesdir="/lib/udev/rules.d"
|
||||
+ else
|
||||
+ udevrulesdir="$udevdir/rules.d"
|
||||
+ fi])
|
||||
AC_SUBST(udevrulesdir)
|
||||
|
||||
dnl Checks for header files.
|
||||
--
|
||||
1.8.4.3
|
||||
|
@ -1,162 +0,0 @@
|
||||
From d2d9b6fc8d20fca1e06fc261ac20fd6cfd8a8d1b Mon Sep 17 00:00:00 2001
|
||||
From: Takashi Iwai <tiwai@suse.de>
|
||||
Date: Tue, 26 Nov 2013 11:44:40 +0100
|
||||
Subject: [PATCH] alsactl: Add monitor command
|
||||
|
||||
With monitor command, you can monitor the events received from the
|
||||
given control device.
|
||||
|
||||
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
---
|
||||
alsactl/Makefile.am | 2 +-
|
||||
alsactl/alsactl.1 | 8 +++++-
|
||||
alsactl/alsactl.c | 3 +++
|
||||
alsactl/monitor.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
4 files changed, 86 insertions(+), 2 deletions(-)
|
||||
create mode 100644 alsactl/monitor.c
|
||||
|
||||
diff --git a/alsactl/Makefile.am b/alsactl/Makefile.am
|
||||
index bac84eb079dc..b05b09ce287f 100644
|
||||
--- a/alsactl/Makefile.am
|
||||
+++ b/alsactl/Makefile.am
|
||||
@@ -7,7 +7,7 @@ man_MANS += alsactl_init.7
|
||||
endif
|
||||
EXTRA_DIST=alsactl.1 alsactl_init.xml
|
||||
|
||||
-alsactl_SOURCES=alsactl.c state.c lock.c utils.c init_parse.c daemon.c
|
||||
+alsactl_SOURCES=alsactl.c state.c lock.c utils.c init_parse.c daemon.c monitor.c
|
||||
alsactl_CFLAGS=$(AM_CFLAGS) -D__USE_GNU -DSYS_ASOUNDRC=\"$(ASOUND_STATE_DIR)/asound.state\" -DSYS_PIDFILE=\"$(ALSACTL_PIDFILE_DIR)/alsactl.pid\"
|
||||
noinst_HEADERS=alsactl.h list.h init_sysdeps.c init_utils_string.c init_utils_run.c init_sysfs.c
|
||||
|
||||
diff --git a/alsactl/alsactl.1 b/alsactl/alsactl.1
|
||||
index 45ac8a68f4a8..a11c17cb59e1 100644
|
||||
--- a/alsactl/alsactl.1
|
||||
+++ b/alsactl/alsactl.1
|
||||
@@ -6,6 +6,8 @@ alsactl \- advanced controls for ALSA soundcard driver
|
||||
|
||||
\fBalsactl\fP [\fIoptions\fP] [\fIstore\fP|\fIrestore\fP|\fIinit\fP] <card # or id or device>
|
||||
|
||||
+\fBalsactl\fP \fImonitor\fP <card # or id>
|
||||
+
|
||||
.SH DESCRIPTION
|
||||
\fBalsactl\fP is used to control advanced settings for the ALSA
|
||||
soundcard drivers. It supports multiple soundcards. If your card has
|
||||
@@ -34,8 +36,12 @@ is not known, error code 99 is returned.
|
||||
\fIkill\fP notifies the daemon to do the specified operation (quit,
|
||||
rescan, save_and_quit).
|
||||
|
||||
+\fImonitor\fP is for monitoring the events received from the given
|
||||
+control device.
|
||||
+
|
||||
If no soundcards are specified, setup for all cards will be saved or
|
||||
-loaded.
|
||||
+loaded (except for \fImonitor\fP command that can handle only a single
|
||||
+card; it selects the card "default" when unspecified).
|
||||
|
||||
.SH OPTIONS
|
||||
|
||||
diff --git a/alsactl/alsactl.c b/alsactl/alsactl.c
|
||||
index 75baad856b5d..6bc013f467d0 100644
|
||||
--- a/alsactl/alsactl.c
|
||||
+++ b/alsactl/alsactl.c
|
||||
@@ -100,6 +100,7 @@ static struct arg args[] = {
|
||||
{ CARDCMD, "daemon", "store state periodically for one or each soundcards" },
|
||||
{ CARDCMD, "rdaemon", "like daemon but do the state restore at first" },
|
||||
{ KILLCMD, "kill", "notify daemon to quit, rescan or save_and_quit" },
|
||||
+{ CARDCMD, "monitor", "monitor control events" },
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -363,6 +364,8 @@ int main(int argc, char *argv[])
|
||||
res = state_daemon(cfgfile, cardname, period, pidfile);
|
||||
} else if (!strcmp(cmd, "kill")) {
|
||||
res = state_daemon_kill(pidfile, cardname);
|
||||
+ } else if (!strcmp(cmd, "monitor")) {
|
||||
+ res = monitor(cardname);
|
||||
} else {
|
||||
fprintf(stderr, "alsactl: Unknown command '%s'...\n", cmd);
|
||||
res = -ENODEV;
|
||||
diff --git a/alsactl/monitor.c b/alsactl/monitor.c
|
||||
new file mode 100644
|
||||
index 000000000000..12d24504264b
|
||||
--- /dev/null
|
||||
+++ b/alsactl/monitor.c
|
||||
@@ -0,0 +1,75 @@
|
||||
+/*
|
||||
+ * Advanced Linux Sound Architecture Control Program
|
||||
+ * Copyright (c) by Takashi Iwai <tiwai@suse.de>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program 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 General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
+ */
|
||||
+
|
||||
+#include "aconfig.h"
|
||||
+#include "version.h"
|
||||
+#include <stdio.h>
|
||||
+#include <alsa/asoundlib.h>
|
||||
+
|
||||
+int monitor(const char *name)
|
||||
+{
|
||||
+ snd_ctl_t *ctl;
|
||||
+ snd_ctl_event_t *event;
|
||||
+ int err;
|
||||
+
|
||||
+ if (!name)
|
||||
+ name = "default";
|
||||
+
|
||||
+ err = snd_ctl_open(&ctl, name, SND_CTL_READONLY);
|
||||
+ if (err < 0) {
|
||||
+ fprintf(stderr, "Cannot open ctl %s\n", name);
|
||||
+ return err;
|
||||
+ }
|
||||
+ err = snd_ctl_subscribe_events(ctl, 1);
|
||||
+ if (err < 0) {
|
||||
+ fprintf(stderr, "Cannot open subscribe events to ctl %s\n", name);
|
||||
+ snd_ctl_close(ctl);
|
||||
+ return err;
|
||||
+ }
|
||||
+ snd_ctl_event_alloca(&event);
|
||||
+ while (snd_ctl_read(ctl, event) > 0) {
|
||||
+ unsigned int mask;
|
||||
+
|
||||
+ if (snd_ctl_event_get_type(event) != SND_CTL_EVENT_ELEM)
|
||||
+ continue;
|
||||
+
|
||||
+ printf("#%d (%i,%i,%i,%s,%i)",
|
||||
+ snd_ctl_event_elem_get_numid(event),
|
||||
+ snd_ctl_event_elem_get_interface(event),
|
||||
+ snd_ctl_event_elem_get_device(event),
|
||||
+ snd_ctl_event_elem_get_subdevice(event),
|
||||
+ snd_ctl_event_elem_get_name(event),
|
||||
+ snd_ctl_event_elem_get_index(event));
|
||||
+
|
||||
+ mask = snd_ctl_event_elem_get_mask(event);
|
||||
+ if (mask & SND_CTL_EVENT_MASK_VALUE)
|
||||
+ printf(" VALUE");
|
||||
+ if (mask & SND_CTL_EVENT_MASK_INFO)
|
||||
+ printf(" INFO");
|
||||
+ if (mask & SND_CTL_EVENT_MASK_ADD)
|
||||
+ printf(" ADD");
|
||||
+ if (mask & SND_CTL_EVENT_MASK_TLV)
|
||||
+ printf(" TLV");
|
||||
+ if (mask == SND_CTL_EVENT_MASK_REMOVE)
|
||||
+ printf(" REMOVE");
|
||||
+ printf("\n");
|
||||
+ }
|
||||
+ snd_ctl_close(ctl);
|
||||
+ return 0;
|
||||
+}
|
||||
--
|
||||
1.8.4.3
|
||||
|
@ -1,40 +0,0 @@
|
||||
From bb3293c76e6a1a130196ccb86e78aea3322ed735 Mon Sep 17 00:00:00 2001
|
||||
From: Takashi Iwai <tiwai@suse.de>
|
||||
Date: Tue, 26 Nov 2013 13:59:19 +0100
|
||||
Subject: [PATCH] alsactl: Fix REMOVE event handling in monitor command
|
||||
|
||||
SND_CTL_EVENT_MASK_REMOVE has to be checked at first and ignore the
|
||||
rest if it matches. Suggested by Clemens.
|
||||
|
||||
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
---
|
||||
alsactl/monitor.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/alsactl/monitor.c b/alsactl/monitor.c
|
||||
index 12d24504264b..1c0246849c62 100644
|
||||
--- a/alsactl/monitor.c
|
||||
+++ b/alsactl/monitor.c
|
||||
@@ -58,6 +58,10 @@ int monitor(const char *name)
|
||||
snd_ctl_event_elem_get_index(event));
|
||||
|
||||
mask = snd_ctl_event_elem_get_mask(event);
|
||||
+ if (mask == SND_CTL_EVENT_MASK_REMOVE) {
|
||||
+ printf(" REMOVE\n");
|
||||
+ continue;
|
||||
+ }
|
||||
if (mask & SND_CTL_EVENT_MASK_VALUE)
|
||||
printf(" VALUE");
|
||||
if (mask & SND_CTL_EVENT_MASK_INFO)
|
||||
@@ -66,8 +70,6 @@ int monitor(const char *name)
|
||||
printf(" ADD");
|
||||
if (mask & SND_CTL_EVENT_MASK_TLV)
|
||||
printf(" TLV");
|
||||
- if (mask == SND_CTL_EVENT_MASK_REMOVE)
|
||||
- printf(" REMOVE");
|
||||
printf("\n");
|
||||
}
|
||||
snd_ctl_close(ctl);
|
||||
--
|
||||
1.8.4.3
|
||||
|
@ -1,189 +0,0 @@
|
||||
From 5dfc232a9dde5bd6b36ef6782039f4437fc04dd3 Mon Sep 17 00:00:00 2001
|
||||
From: Takashi Iwai <tiwai@suse.de>
|
||||
Date: Tue, 26 Nov 2013 14:27:30 +0100
|
||||
Subject: [PATCH] alsactl: monitor all cards as default
|
||||
|
||||
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
---
|
||||
alsactl/alsactl.1 | 5 +-
|
||||
alsactl/monitor.c | 136 ++++++++++++++++++++++++++++++++++++++++--------------
|
||||
2 files changed, 104 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/alsactl/alsactl.1 b/alsactl/alsactl.1
|
||||
index a11c17cb59e1..b1e17945c2fb 100644
|
||||
--- a/alsactl/alsactl.1
|
||||
+++ b/alsactl/alsactl.1
|
||||
@@ -39,9 +39,8 @@ rescan, save_and_quit).
|
||||
\fImonitor\fP is for monitoring the events received from the given
|
||||
control device.
|
||||
|
||||
-If no soundcards are specified, setup for all cards will be saved or
|
||||
-loaded (except for \fImonitor\fP command that can handle only a single
|
||||
-card; it selects the card "default" when unspecified).
|
||||
+If no soundcards are specified, setup for all cards will be saved,
|
||||
+loaded or monitored.
|
||||
|
||||
.SH OPTIONS
|
||||
|
||||
diff --git a/alsactl/monitor.c b/alsactl/monitor.c
|
||||
index 1c0246849c62..536176d0e7cb 100644
|
||||
--- a/alsactl/monitor.c
|
||||
+++ b/alsactl/monitor.c
|
||||
@@ -22,15 +22,11 @@
|
||||
#include <stdio.h>
|
||||
#include <alsa/asoundlib.h>
|
||||
|
||||
-int monitor(const char *name)
|
||||
+static int open_ctl(const char *name, snd_ctl_t **ctlp)
|
||||
{
|
||||
snd_ctl_t *ctl;
|
||||
- snd_ctl_event_t *event;
|
||||
int err;
|
||||
|
||||
- if (!name)
|
||||
- name = "default";
|
||||
-
|
||||
err = snd_ctl_open(&ctl, name, SND_CTL_READONLY);
|
||||
if (err < 0) {
|
||||
fprintf(stderr, "Cannot open ctl %s\n", name);
|
||||
@@ -42,36 +38,108 @@ int monitor(const char *name)
|
||||
snd_ctl_close(ctl);
|
||||
return err;
|
||||
}
|
||||
+ *ctlp = ctl;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int print_event(int card, snd_ctl_t *ctl)
|
||||
+{
|
||||
+ snd_ctl_event_t *event;
|
||||
+ unsigned int mask;
|
||||
+ int err;
|
||||
+
|
||||
snd_ctl_event_alloca(&event);
|
||||
- while (snd_ctl_read(ctl, event) > 0) {
|
||||
- unsigned int mask;
|
||||
-
|
||||
- if (snd_ctl_event_get_type(event) != SND_CTL_EVENT_ELEM)
|
||||
- continue;
|
||||
-
|
||||
- printf("#%d (%i,%i,%i,%s,%i)",
|
||||
- snd_ctl_event_elem_get_numid(event),
|
||||
- snd_ctl_event_elem_get_interface(event),
|
||||
- snd_ctl_event_elem_get_device(event),
|
||||
- snd_ctl_event_elem_get_subdevice(event),
|
||||
- snd_ctl_event_elem_get_name(event),
|
||||
- snd_ctl_event_elem_get_index(event));
|
||||
-
|
||||
- mask = snd_ctl_event_elem_get_mask(event);
|
||||
- if (mask == SND_CTL_EVENT_MASK_REMOVE) {
|
||||
- printf(" REMOVE\n");
|
||||
- continue;
|
||||
- }
|
||||
- if (mask & SND_CTL_EVENT_MASK_VALUE)
|
||||
- printf(" VALUE");
|
||||
- if (mask & SND_CTL_EVENT_MASK_INFO)
|
||||
- printf(" INFO");
|
||||
- if (mask & SND_CTL_EVENT_MASK_ADD)
|
||||
- printf(" ADD");
|
||||
- if (mask & SND_CTL_EVENT_MASK_TLV)
|
||||
- printf(" TLV");
|
||||
- printf("\n");
|
||||
+ err = snd_ctl_read(ctl, event);
|
||||
+ if (err < 0)
|
||||
+ return err;
|
||||
+
|
||||
+ if (snd_ctl_event_get_type(event) != SND_CTL_EVENT_ELEM)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (card >= 0)
|
||||
+ printf("card %d, ", card);
|
||||
+ printf("#%d (%i,%i,%i,%s,%i)",
|
||||
+ snd_ctl_event_elem_get_numid(event),
|
||||
+ snd_ctl_event_elem_get_interface(event),
|
||||
+ snd_ctl_event_elem_get_device(event),
|
||||
+ snd_ctl_event_elem_get_subdevice(event),
|
||||
+ snd_ctl_event_elem_get_name(event),
|
||||
+ snd_ctl_event_elem_get_index(event));
|
||||
+
|
||||
+ mask = snd_ctl_event_elem_get_mask(event);
|
||||
+ if (mask == SND_CTL_EVENT_MASK_REMOVE) {
|
||||
+ printf(" REMOVE\n");
|
||||
+ return 0;
|
||||
}
|
||||
- snd_ctl_close(ctl);
|
||||
+
|
||||
+ if (mask & SND_CTL_EVENT_MASK_VALUE)
|
||||
+ printf(" VALUE");
|
||||
+ if (mask & SND_CTL_EVENT_MASK_INFO)
|
||||
+ printf(" INFO");
|
||||
+ if (mask & SND_CTL_EVENT_MASK_ADD)
|
||||
+ printf(" ADD");
|
||||
+ if (mask & SND_CTL_EVENT_MASK_TLV)
|
||||
+ printf(" TLV");
|
||||
+ printf("\n");
|
||||
return 0;
|
||||
}
|
||||
+
|
||||
+#define MAX_CARDS 256
|
||||
+
|
||||
+int monitor(const char *name)
|
||||
+{
|
||||
+ snd_ctl_t *ctls[MAX_CARDS];
|
||||
+ int ncards = 0;
|
||||
+ int show_cards;
|
||||
+ int i, err;
|
||||
+
|
||||
+ if (!name) {
|
||||
+ int card = -1;
|
||||
+ while (snd_card_next(&card) >= 0 && card >= 0) {
|
||||
+ char cardname[16];
|
||||
+ if (ncards >= MAX_CARDS) {
|
||||
+ fprintf(stderr, "alsactl: too many cards\n");
|
||||
+ err = -E2BIG;
|
||||
+ goto error;
|
||||
+ }
|
||||
+ sprintf(cardname, "hw:%d", card);
|
||||
+ err = open_ctl(cardname, &ctls[ncards]);
|
||||
+ if (err < 0)
|
||||
+ goto error;
|
||||
+ ncards++;
|
||||
+ }
|
||||
+ show_cards = 1;
|
||||
+ } else {
|
||||
+ err = open_ctl(name, &ctls[0]);
|
||||
+ if (err < 0)
|
||||
+ goto error;
|
||||
+ ncards++;
|
||||
+ show_cards = 0;
|
||||
+ }
|
||||
+
|
||||
+ for (;;) {
|
||||
+ struct pollfd fds[ncards];
|
||||
+
|
||||
+ for (i = 0; i < ncards; i++)
|
||||
+ snd_ctl_poll_descriptors(ctls[i], &fds[i], 1);
|
||||
+
|
||||
+ err = poll(fds, ncards, -1);
|
||||
+ if (err <= 0) {
|
||||
+ err = 0;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < ncards; i++) {
|
||||
+ unsigned short revents;
|
||||
+ snd_ctl_poll_descriptors_revents(ctls[i], &fds[i], 1,
|
||||
+ &revents);
|
||||
+ if (revents & POLLIN)
|
||||
+ print_event(show_cards ? i : -1, ctls[i]);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ error:
|
||||
+ for (i = 0; i < ncards; i++)
|
||||
+ snd_ctl_close(ctls[i]);
|
||||
+ return err;
|
||||
+}
|
||||
--
|
||||
1.8.4.3
|
||||
|
@ -1,45 +0,0 @@
|
||||
From f4be3f88b6e80e3f3ea19ba5784cff49ab6e6277 Mon Sep 17 00:00:00 2001
|
||||
From: Jaroslav Kysela <perex@perex.cz>
|
||||
Date: Sun, 29 Dec 2013 20:03:21 +0100
|
||||
Subject: [PATCH] alsactl: Fix the va_list initialization in cerror_() and
|
||||
dbg_()
|
||||
|
||||
The <ap> argument for syslog_() was uninitialized.
|
||||
|
||||
From: Alan Hamilton <alanh@arizonaroads.com>
|
||||
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
||||
---
|
||||
alsactl/utils.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/alsactl/utils.c b/alsactl/utils.c
|
||||
index 072c23998e45..b5d183cb437c 100644
|
||||
--- a/alsactl/utils.c
|
||||
+++ b/alsactl/utils.c
|
||||
@@ -150,10 +150,10 @@ void cerror_(const char *fcn, long line, int cond, const char *fmt, ...)
|
||||
|
||||
if (!cond && !debugflag)
|
||||
return;
|
||||
+ va_start(ap, fmt);
|
||||
if (use_syslog) {
|
||||
syslog_(LOG_ERR, fcn, line, fmt, ap);
|
||||
} else {
|
||||
- va_start(ap, fmt);
|
||||
fprintf(stderr, "%s: %s:%ld: ", command, fcn, line);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
putc('\n', stderr);
|
||||
@@ -167,10 +167,10 @@ void dbg_(const char *fcn, long line, const char *fmt, ...)
|
||||
|
||||
if (!debugflag)
|
||||
return;
|
||||
+ va_start(ap, fmt);
|
||||
if (use_syslog) {
|
||||
syslog_(LOG_DEBUG, fcn, line, fmt, ap);
|
||||
} else {
|
||||
- va_start(ap, fmt);
|
||||
fprintf(stderr, "%s: %s:%ld: ", command, fcn, line);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
putc('\n', stderr);
|
||||
--
|
||||
1.8.4.5
|
||||
|
@ -1,40 +0,0 @@
|
||||
From 8aa13eec80eac312e4b99423909387660fb99b8f Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Langlois <olivier@trillion01.com>
|
||||
Date: Tue, 7 Jan 2014 23:18:17 -0500
|
||||
Subject: [PATCH] aplay: fix pcm_read() return value
|
||||
|
||||
Because of the way the pcm_read() functions are currently used, returning
|
||||
rcount or result is equivalent but I feel it is more accurate to
|
||||
return 'result'.
|
||||
|
||||
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
|
||||
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
---
|
||||
aplay/aplay.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/aplay/aplay.c b/aplay/aplay.c
|
||||
index e0631c4aa752..69e8bdab63b7 100644
|
||||
--- a/aplay/aplay.c
|
||||
+++ b/aplay/aplay.c
|
||||
@@ -2039,7 +2039,7 @@ static ssize_t pcm_read(u_char *data, size_t rcount)
|
||||
data += r * bits_per_frame / 8;
|
||||
}
|
||||
}
|
||||
- return rcount;
|
||||
+ return result;
|
||||
}
|
||||
|
||||
static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount)
|
||||
@@ -2084,7 +2084,7 @@ static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount)
|
||||
count -= r;
|
||||
}
|
||||
}
|
||||
- return rcount;
|
||||
+ return result;
|
||||
}
|
||||
|
||||
/*
|
||||
--
|
||||
1.8.4.5
|
||||
|
@ -1,35 +0,0 @@
|
||||
From ef0e588c76fbad4112193d311e51a60d18b44282 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Reisner <dreisner@archlinux.org>
|
||||
Date: Sun, 12 Jan 2014 11:15:52 -0500
|
||||
Subject: [PATCH] alsa-restore.rules: refer to correct attr
|
||||
|
||||
$attr{number} in the RUN rule is an empty expansion. This makes sense,
|
||||
because the path doesn't exist -- i.e., it refers to the path:
|
||||
|
||||
/sys/devices/pci0000:00/foo/bar/sound/card0/controlC0/number
|
||||
|
||||
Instead, refer to $attr{device/number}, which does exist.
|
||||
|
||||
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
||||
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
---
|
||||
alsactl/90-alsa-restore.rules.in | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/alsactl/90-alsa-restore.rules.in b/alsactl/90-alsa-restore.rules.in
|
||||
index 88e12e0656d2..c68119d05839 100644
|
||||
--- a/alsactl/90-alsa-restore.rules.in
|
||||
+++ b/alsactl/90-alsa-restore.rules.in
|
||||
@@ -2,7 +2,7 @@ ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS!="card*", GOTO="
|
||||
GOTO="alsa_restore_end"
|
||||
|
||||
LABEL="alsa_restore_go"
|
||||
-TEST!="@daemonswitch@", RUN+="@sbindir@/alsactl restore $attr{number}"
|
||||
-TEST=="@daemonswitch@", RUN+="@sbindir@/alsactl nrestore $attr{number}"
|
||||
+TEST!="@daemonswitch@", RUN+="@sbindir@/alsactl restore $attr{device/number}"
|
||||
+TEST=="@daemonswitch@", RUN+="@sbindir@/alsactl nrestore $attr{device/number}"
|
||||
|
||||
LABEL="alsa_restore_end"
|
||||
--
|
||||
1.8.4.5
|
||||
|
@ -1,29 +0,0 @@
|
||||
From 360878f9c331d0aaedad6469275062540d8a4537 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Langlois <olivier@trillion01.com>
|
||||
Date: Tue, 21 Jan 2014 15:25:12 -0500
|
||||
Subject: [PATCH] aplay: fix timespec to msec conversion
|
||||
|
||||
There is 1M nsec in a msec.
|
||||
|
||||
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
|
||||
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
---
|
||||
aplay/aplay.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/aplay/aplay.c b/aplay/aplay.c
|
||||
index 69e8bdab63b7..33a8ed5598f5 100644
|
||||
--- a/aplay/aplay.c
|
||||
+++ b/aplay/aplay.c
|
||||
@@ -1509,7 +1509,7 @@ static void xrun(void)
|
||||
timermsub(&now, &tstamp, &diff);
|
||||
fprintf(stderr, _("%s!!! (at least %.3f ms long)\n"),
|
||||
stream == SND_PCM_STREAM_PLAYBACK ? _("underrun") : _("overrun"),
|
||||
- diff.tv_sec * 1000 + diff.tv_nsec / 10000000.0);
|
||||
+ diff.tv_sec * 1000 + diff.tv_nsec / 1000000.0);
|
||||
#else
|
||||
fprintf(stderr, "%s !!!\n", _("underrun"));
|
||||
#endif
|
||||
--
|
||||
1.8.5.2
|
||||
|
@ -1,148 +0,0 @@
|
||||
From 3b1ee6b325926336564c73c5c22831b59f404805 Mon Sep 17 00:00:00 2001
|
||||
From: Erik Ackermann <kurterikackermann@gmail.com>
|
||||
Date: Tue, 25 Feb 2014 11:45:24 -0800
|
||||
Subject: [PATCH] speaker-test: add --force-frequency option to allow hz
|
||||
outside range
|
||||
|
||||
Signed-off-by: Erik Ackermann <kurterikackermann@gmail.com>
|
||||
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
---
|
||||
po/de.po | 2 ++
|
||||
po/fr.po | 2 ++
|
||||
po/ja.po | 2 ++
|
||||
speaker-test/speaker-test.c | 17 ++++++++++++++---
|
||||
4 files changed, 20 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/po/de.po b/po/de.po
|
||||
index 0c47c65a9142..586bde2209cd 100644
|
||||
--- a/po/de.po
|
||||
+++ b/po/de.po
|
||||
@@ -1487,6 +1487,7 @@ msgid ""
|
||||
"-s,--speaker\tsingle speaker test. Values 1=Left, 2=right, etc\n"
|
||||
"-w,--wavfile\tUse the given WAV file as a test sound\n"
|
||||
"-W,--wavdir\tSpecify the directory containing WAV files\n"
|
||||
+"-X,--force-frequency\tforce frequencies outside the 30-8000hz range\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
"Verwendung: speaker-test [Option]...\n"
|
||||
@@ -1504,6 +1505,7 @@ msgstr ""
|
||||
"-s,--speaker teste einen einzelnen Lautsprecher; 1=links, 2=rechts, usw.\n"
|
||||
"-w,--wavfile benutze WAV-Datei als Testton\n"
|
||||
"-W,--wavdir benutze Verzeichnis mit darin enthaltenen WAV-Dateien\n"
|
||||
+"-X,--force-frequency\termöglichen Frequenzen außerhalb der 30-8000Hz Bereich\n"
|
||||
"\n"
|
||||
|
||||
#: speaker-test/speaker-test.c:921
|
||||
diff --git a/po/fr.po b/po/fr.po
|
||||
index a6028a4c51ad..876c9a39a21e 100644
|
||||
--- a/po/fr.po
|
||||
+++ b/po/fr.po
|
||||
@@ -1474,6 +1474,7 @@ msgid ""
|
||||
"-s,--speaker\tsingle speaker test. Values 1=Left, 2=right, etc\n"
|
||||
"-w,--wavfile\tUse the given WAV file as a test sound\n"
|
||||
"-W,--wavdir\tSpecify the directory containing WAV files\n"
|
||||
+"-X,--force-frequency\tforce frequencies outside the 30-8000hz range\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
"Utilisation: speaker-test [OPTION]...\n"
|
||||
@@ -1492,6 +1493,7 @@ msgstr ""
|
||||
"\t\tValeurs 1=Gauche, 2=Droite, et c.\n"
|
||||
"-w,--wavfile\tUtiliser le fichier WAV spécifié pour le test\n"
|
||||
"-w,--wavdir\tSpécifier le répertoire contenant les fichiers WAV\n"
|
||||
+"-X,--force-frequency\tpermettre fréquences en dehors de la gamme 30-8000Hz\n"
|
||||
"\n"
|
||||
|
||||
#: ../speaker-test/speaker-test.c:852
|
||||
diff --git a/po/ja.po b/po/ja.po
|
||||
index 2c234f42edfb..d8ef706fd97a 100644
|
||||
--- a/po/ja.po
|
||||
+++ b/po/ja.po
|
||||
@@ -1429,6 +1429,7 @@ msgid ""
|
||||
"-s,--speaker\tsingle speaker test. Values 1=Left, 2=right, etc\n"
|
||||
"-w,--wavfile\tUse the given WAV file as a test sound\n"
|
||||
"-W,--wavdir\tSpecify the directory containing WAV files\n"
|
||||
+"-X,--force-frequency\tforce frequencies outside the 30-8000hz range\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
"使用法: speaker-test [オプション]...\n"
|
||||
@@ -1447,6 +1448,7 @@ msgstr ""
|
||||
"-s,--speaker 単一スピーカーテスト 1=左 または 2=右\n"
|
||||
"-w,--wavfile 指定のWAVファイルをテスト音源として使用\n"
|
||||
"-W,--wavdir WAVファイルのあるディレクトリを指定\n"
|
||||
+"-X,--force-frequency\t30-8000Hz範囲外許可\n"
|
||||
"\n"
|
||||
|
||||
#: speaker-test/speaker-test.c:835
|
||||
diff --git a/speaker-test/speaker-test.c b/speaker-test/speaker-test.c
|
||||
index 261f399067e9..61396f296c65 100644
|
||||
--- a/speaker-test/speaker-test.c
|
||||
+++ b/speaker-test/speaker-test.c
|
||||
@@ -106,6 +106,7 @@ static snd_pcm_uframes_t period_size;
|
||||
static const char *given_test_wav_file = NULL;
|
||||
static char *wav_file_dir = SOUNDSDIR;
|
||||
static int debug = 0;
|
||||
+static int force_frequency = 0;
|
||||
static int in_aborting = 0;
|
||||
static snd_pcm_t *pcm_handle = NULL;
|
||||
|
||||
@@ -1015,6 +1016,7 @@ static void help(void)
|
||||
"-w,--wavfile Use the given WAV file as a test sound\n"
|
||||
"-W,--wavdir Specify the directory containing WAV files\n"
|
||||
"-m,--chmap Specify the channel map to override\n"
|
||||
+ "-X,--force-frequency force frequencies outside the 30-8000hz range\n"
|
||||
"\n"));
|
||||
printf(_("Recognized sample formats are:"));
|
||||
for (fmt = supported_formats; *fmt >= 0; fmt++) {
|
||||
@@ -1057,6 +1059,7 @@ int main(int argc, char *argv[]) {
|
||||
{"wavfile", 1, NULL, 'w'},
|
||||
{"wavdir", 1, NULL, 'W'},
|
||||
{"debug", 0, NULL, 'd'},
|
||||
+ {"force-frequency", 0, NULL, 'X'},
|
||||
#ifdef CONFIG_SUPPORT_CHMAP
|
||||
{"chmap", 1, NULL, 'm'},
|
||||
#endif
|
||||
@@ -1078,7 +1081,7 @@ int main(int argc, char *argv[]) {
|
||||
while (1) {
|
||||
int c;
|
||||
|
||||
- if ((c = getopt_long(argc, argv, "hD:r:c:f:F:b:p:P:t:l:s:w:W:d"
|
||||
+ if ((c = getopt_long(argc, argv, "hD:r:c:f:F:b:p:P:t:l:s:w:W:d:X"
|
||||
#ifdef CONFIG_SUPPORT_CHMAP
|
||||
"m:"
|
||||
#endif
|
||||
@@ -1114,8 +1117,6 @@ int main(int argc, char *argv[]) {
|
||||
break;
|
||||
case 'f':
|
||||
freq = atof(optarg);
|
||||
- freq = freq < 30.0 ? 30.0 : freq;
|
||||
- freq = freq > 5000.0 ? 5000.0 : freq;
|
||||
break;
|
||||
case 'b':
|
||||
buffer_time = atoi(optarg);
|
||||
@@ -1173,6 +1174,9 @@ int main(int argc, char *argv[]) {
|
||||
case 'd':
|
||||
debug = 1;
|
||||
break;
|
||||
+ case 'X':
|
||||
+ force_frequency = 1;
|
||||
+ break;
|
||||
#ifdef CONFIG_SUPPORT_CHMAP
|
||||
case 'm':
|
||||
chmap = optarg;
|
||||
@@ -1190,6 +1194,13 @@ int main(int argc, char *argv[]) {
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
+ if (!force_frequency) {
|
||||
+ freq = freq < 30.0 ? 30.0 : freq;
|
||||
+ freq = freq > 8000.0 ? 8000.0 : freq;
|
||||
+ } else {
|
||||
+ freq = freq < 1.0 ? 1.0 : freq;
|
||||
+ }
|
||||
+
|
||||
if (test_type == TEST_WAV)
|
||||
format = SND_PCM_FORMAT_S16_LE; /* fixed format */
|
||||
|
||||
--
|
||||
1.9.0
|
||||
|
@ -1,92 +0,0 @@
|
||||
From b7ed45a01554d285fc90a4e0bdee7018cdf8b903 Mon Sep 17 00:00:00 2001
|
||||
From: Erik Ackermann <kurterikackermann@gmail.com>
|
||||
Date: Wed, 26 Feb 2014 06:52:29 -0800
|
||||
Subject: [PATCH] speaker-test: update man page for new -X arg, also
|
||||
consistency fixes
|
||||
|
||||
Signed-off-by: Erik Ackermann <kurterikackermann@gmail.com>
|
||||
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
---
|
||||
speaker-test/speaker-test.1 | 20 ++++++++++++--------
|
||||
1 file changed, 12 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/speaker-test/speaker-test.1 b/speaker-test/speaker-test.1
|
||||
index 26d988249533..add6b21728b4 100644
|
||||
--- a/speaker-test/speaker-test.1
|
||||
+++ b/speaker-test/speaker-test.1
|
||||
@@ -13,7 +13,7 @@
|
||||
..
|
||||
.TH SPEAKER\-TEST 1 "April 2nd, 2011" speaker\-test
|
||||
.SH NAME
|
||||
-speaker\-test \- command\-line speaker test tone generator for ALSA
|
||||
+speaker\-test \- command\-line speaker test tone generator for ALSA
|
||||
.SH SYNOPSIS
|
||||
.B speaker\-test [\-options]
|
||||
|
||||
@@ -47,7 +47,7 @@ surround40:CARD=ICH5,DEV=0
|
||||
|
||||
.P Each of the devices is listed in the beginning of the definition so,
|
||||
in the above example, there are four devices listed: null, default, front
|
||||
-and surround40. So, if you want to test the last device you can
|
||||
+and surround40. So, if you want to test the last device you can
|
||||
run \fBspeaker\-test \-Dsurround40:ICH5 \-c 6\fR. The \fB\-c\fR option will
|
||||
indicate that the six audio channels in the device have to be tested.
|
||||
|
||||
@@ -86,7 +86,7 @@ When 0 is given, the periods given by \fB\-P\fP option is used.
|
||||
The default value is 0.
|
||||
|
||||
.TP
|
||||
-\fB\-P\fP | \fB\-\-nperiods\fP \fPPERIODS\fP
|
||||
+\fB\-P\fP | \fB\-\-nperiods\fP \fIPERIODS\fP
|
||||
Use number of periods. The default value is 4.
|
||||
|
||||
.TP
|
||||
@@ -106,7 +106,7 @@ Pink noise is perceptually uniform noise -- that is, it sounds like every freque
|
||||
You can pass the number from 1 to 3 as a backward compatibility.
|
||||
|
||||
.TP
|
||||
-\fB\-l\fP | \fB\-\-nloops\fP \fBCOUNT\fP
|
||||
+\fB\-l\fP | \fB\-\-nloops\fP \fICOUNT\fP
|
||||
|
||||
Specifies the number of loops. Zero means to run infinitely.
|
||||
|
||||
@@ -114,7 +114,7 @@ When \fB\-s\fP option below with a valid channel is given, \fBspeaker\-test\fP w
|
||||
always a single-shot without looping.
|
||||
|
||||
.TP
|
||||
-\fB\-s\fP | \fB\-\-speaker\fP \fBCHANNEL\fP
|
||||
+\fB\-s\fP | \fB\-\-speaker\fP \fICHANNEL\fP
|
||||
Do a single-shot speaker test for the given channel. The channel number starts from 1.
|
||||
The channel number corresponds to left, right, rear-left, rear-right, center, LFE,
|
||||
side-left, side-right, and so on.
|
||||
@@ -123,20 +123,24 @@ For example, when 1 is passed, it tests the left channel only once rather than b
|
||||
with looping.
|
||||
|
||||
.TP
|
||||
-\fB\-w\fP | \fB\-\-wavfile\fP
|
||||
+\fB\-w\fP | \fB\-\-wavfile\fP \fIFILE\fP
|
||||
Use the given WAV file for the playback instead of pre-defined WAV files.
|
||||
|
||||
.TP
|
||||
-\fB\-W\fP | \fB\-\-wavdir\fP
|
||||
+\fB\-W\fP | \fB\-\-wavdir\fP \fIDIRECTORY\fP
|
||||
Specify the directory containing WAV files for playback.
|
||||
The default path is \fI/usr/share/sounds/alsa\fP.
|
||||
|
||||
.TP
|
||||
-\fB\-m\fP | \fB\-\-chmap\fP
|
||||
+\fB\-m\fP | \fB\-\-chmap\fP \fIMAP\fP
|
||||
Pass the channel map to override.
|
||||
If the playback in a specific channel order or channel positions is
|
||||
required, pass the channel position strings to this option.
|
||||
|
||||
+.TP
|
||||
+\fB\-X\fP | \fB\-\-force-frequency\fP
|
||||
+Allow supplied \fIFREQ\fP to be outside the default range of 30-8000Hz. A minimum of 1Hz is still enforced.
|
||||
+
|
||||
.SH USAGE EXAMPLES
|
||||
|
||||
Produce stereo sound from one stereo jack:
|
||||
--
|
||||
1.9.0
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:02bfac39092f3b68d743c23ad3d688d6c5aa8df69f2ccd692c5b8282edb352ea
|
||||
size 1143802
|
3
alsa-utils-1.0.28.tar.bz2
Normal file
3
alsa-utils-1.0.28.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f3ff4c89b0125a7797b1b13cd094cc92276e655458274967386e812d03642acc
|
||||
size 1146887
|
@ -1,3 +1,31 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 18 13:10:03 CEST 2014 - tiwai@suse.de
|
||||
|
||||
- Updated to alsa-utils 1.0.28:
|
||||
All pervious fix patches are obsoleted:
|
||||
0001-alsactl-alsa-state.service-fix-typo-rkill-kill.patch
|
||||
0002-alsaloop-fix-wrong-alias-for-signal.h.patch
|
||||
0003-aplay-fix-two-off-by-one-errors.patch
|
||||
0004-alsaloop-add-z-syslog-option-to-use-syslog-for-error.patch
|
||||
0005-amixer-actually-print-all-TLVs-in-a-container-TLV.patch
|
||||
0006-amixer-fix-indentation-when-printing-container-TLV-c.patch
|
||||
0007-alsaloop-pcmjob.c-use-portable-way-to-initialize-rec.patch
|
||||
0008-speaker-test-Fix-chmapped-channel-selection-without-.patch
|
||||
0009-speaker-test-Always-show-chmap-channel-names-if-avai.patch
|
||||
0010-speaker-test-Show-out-of-chmap-channels-as-Unknown.patch
|
||||
0011-alsaconf-support-newer-m-i-t-and-kmod.patch
|
||||
0012-alsaconf-update-gentoo-to-use-modprobe.d-method-as-e.patch
|
||||
0013-configure-detect-udevdir-via-pkg-config-fallback-to-.patch
|
||||
0014-alsactl-Add-monitor-command.patch
|
||||
0015-alsactl-Fix-REMOVE-event-handling-in-monitor-command.patch
|
||||
0016-alsactl-monitor-all-cards-as-default.patch
|
||||
0017-alsactl-Fix-the-va_list-initialization-in-cerror_-an.patch
|
||||
0018-aplay-fix-pcm_read-return-value.patch
|
||||
0019-alsa-restore.rules-refer-to-correct-attr.patch
|
||||
0020-aplay-fix-timespec-to-msec-conversion.patch
|
||||
0021-speaker-test-add-force-frequency-option-to-allow-hz-.patch
|
||||
0022-speaker-test-update-man-page-for-new-X-arg-also-cons.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 11 10:55:31 CET 2014 - tiwai@suse.de
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#
|
||||
|
||||
|
||||
%define package_version 1.0.27.2
|
||||
%define package_version 1.0.28
|
||||
#
|
||||
%if 0%{?suse_version} > 1130
|
||||
%define use_systemd 1
|
||||
@ -35,7 +35,7 @@ BuildRequires: systemd
|
||||
%define _udevdir /lib/udev
|
||||
%endif
|
||||
Name: alsa-utils
|
||||
Version: 1.0.27.2
|
||||
Version: 1.0.28
|
||||
Release: 0
|
||||
Summary: Advanced Linux Sound Architecture Utilities
|
||||
License: GPL-2.0+
|
||||
@ -48,28 +48,6 @@ Source11: fr.po
|
||||
Source12: ja.po
|
||||
# Patch: alsa-utils-git-fixes.diff
|
||||
# upstream fix patches
|
||||
Patch1: 0001-alsactl-alsa-state.service-fix-typo-rkill-kill.patch
|
||||
Patch2: 0002-alsaloop-fix-wrong-alias-for-signal.h.patch
|
||||
Patch3: 0003-aplay-fix-two-off-by-one-errors.patch
|
||||
Patch4: 0004-alsaloop-add-z-syslog-option-to-use-syslog-for-error.patch
|
||||
Patch5: 0005-amixer-actually-print-all-TLVs-in-a-container-TLV.patch
|
||||
Patch6: 0006-amixer-fix-indentation-when-printing-container-TLV-c.patch
|
||||
Patch7: 0007-alsaloop-pcmjob.c-use-portable-way-to-initialize-rec.patch
|
||||
Patch8: 0008-speaker-test-Fix-chmapped-channel-selection-without-.patch
|
||||
Patch9: 0009-speaker-test-Always-show-chmap-channel-names-if-avai.patch
|
||||
Patch10: 0010-speaker-test-Show-out-of-chmap-channels-as-Unknown.patch
|
||||
Patch11: 0011-alsaconf-support-newer-m-i-t-and-kmod.patch
|
||||
Patch12: 0012-alsaconf-update-gentoo-to-use-modprobe.d-method-as-e.patch
|
||||
Patch13: 0013-configure-detect-udevdir-via-pkg-config-fallback-to-.patch
|
||||
Patch14: 0014-alsactl-Add-monitor-command.patch
|
||||
Patch15: 0015-alsactl-Fix-REMOVE-event-handling-in-monitor-command.patch
|
||||
Patch16: 0016-alsactl-monitor-all-cards-as-default.patch
|
||||
Patch17: 0017-alsactl-Fix-the-va_list-initialization-in-cerror_-an.patch
|
||||
Patch18: 0018-aplay-fix-pcm_read-return-value.patch
|
||||
Patch19: 0019-alsa-restore.rules-refer-to-correct-attr.patch
|
||||
Patch20: 0020-aplay-fix-timespec-to-msec-conversion.patch
|
||||
Patch21: 0021-speaker-test-add-force-frequency-option-to-allow-hz-.patch
|
||||
Patch22: 0022-speaker-test-update-man-page-for-new-X-arg-also-cons.patch
|
||||
#
|
||||
Patch99: alsa-utils-gettext-version-removal.diff
|
||||
BuildRequires: alsa-devel
|
||||
@ -101,28 +79,6 @@ cp %{SOURCE10} po/
|
||||
cp %{SOURCE11} po/
|
||||
cp %{SOURCE12} po/
|
||||
# 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
|
||||
#
|
||||
%if 0%{?suse_version} < 1020
|
||||
%patch99 -p1
|
||||
|
Loading…
Reference in New Issue
Block a user