SHA256
1
0
forked from pool/alsa-utils
OBS User unknown 2008-11-03 10:54:31 +00:00 committed by Git OBS Bridge
parent a6fff088c4
commit 90462e7a56
6 changed files with 18 additions and 322 deletions

View File

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

View File

@ -1,13 +0,0 @@
diff --git a/Makefile.am b/Makefile.am
index a9730dc..b2646e4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,7 @@ else
ALSAMIXER_DIR=
endif
SUBDIRS= include alsactl alsaconf $(ALSAMIXER_DIR) amidi amixer aplay iecset seq speaker-test utils m4 po
-EXTRA_DIST= config.rpath TODO gitcompile
+EXTRA_DIST= TODO gitcompile
AUTOMAKE_OPTIONS=foreign
ACLOCAL_AMFLAGS = -I m4

View File

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

View File

@ -1,300 +0,0 @@
diff --git a/Makefile.am b/Makefile.am
index b2646e4..554617d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,7 +4,13 @@ ALSAMIXER_DIR=alsamixer
else
ALSAMIXER_DIR=
endif
-SUBDIRS= include alsactl alsaconf $(ALSAMIXER_DIR) amidi amixer aplay iecset seq speaker-test utils m4 po
+if ALSACONF
+ALSACONF_DIR=alsaconf
+else
+ALSACONF_DIR=
+endif
+SUBDIRS= include alsactl $(ALSACONF_DIR) $(ALSAMIXER_DIR) amidi amixer \
+ aplay iecset seq speaker-test utils m4 po
EXTRA_DIST= TODO gitcompile
AUTOMAKE_OPTIONS=foreign
ACLOCAL_AMFLAGS = -I m4
diff --git a/alsactl/alsactl.1 b/alsactl/alsactl.1
index d7f30f6..b038a82 100644
--- a/alsactl/alsactl.1
+++ b/alsactl/alsactl.1
@@ -51,6 +51,11 @@ Used with restore command. Try to restore the matching control elements
as much as possible. This option is set as default now.
.TP
+\fI\-g, \-\-ignore\fP
+Used with store and restore commands. Do not show 'No soundcards found'
+and do not set an error exit code when soundcards are not installed.
+
+.TP
\fI\-P, \-\-pedantic\fP
Used with restore command. Don't restore mismatching control elements.
This option was the old default behavior.
diff --git a/alsactl/alsactl.c b/alsactl/alsactl.c
index 6728fbc..f846316 100644
--- a/alsactl/alsactl.c
+++ b/alsactl/alsactl.c
@@ -34,6 +34,7 @@
int debugflag = 0;
int force_restore = 1;
+int ignore_nocards = 0;
char *command;
char *statefile = NULL;
@@ -48,7 +49,8 @@ static void help(void)
printf(" -f,--file # configuration file (default " SYS_ASOUNDRC ")\n");
printf(" -F,--force try to restore the matching controls as much as possible\n");
printf(" (default mode)\n");
- printf(" -P,--pedantic don't restore mismatching controls (old default)\n");
+ printf(" -g,--ignore ignore 'No soundcards found' error\n");
+ printf(" -P,--pedantic do not restore mismatching controls (old default)\n");
printf(" -r,--runstate # save restore and init state to this file (only errors)\n");
printf(" default settings is 'no file set'\n");
printf(" -R,--remove remove runstate file at first, otherwise append errors\n");
@@ -75,6 +77,7 @@ int main(int argc, char *argv[])
{"env", 1, NULL, 'E'},
{"initfile", 1, NULL, 'i'},
{"force", 0, NULL, 'F'},
+ {"ignore", 0, NULL, 'g'},
{"pedantic", 0, NULL, 'P'},
{"runstate", 0, NULL, 'r'},
{"remove", 0, NULL, 'R'},
@@ -99,7 +102,7 @@ int main(int argc, char *argv[])
while (1) {
int c;
- if ((c = getopt_long(argc, argv, "hdvf:FE:i:Pr:R", long_option, NULL)) < 0)
+ if ((c = getopt_long(argc, argv, "hdvf:FgE:i:Pr:R", long_option, NULL)) < 0)
break;
switch (c) {
case 'h':
@@ -111,6 +114,9 @@ int main(int argc, char *argv[])
case 'F':
force_restore = 1;
break;
+ case 'g':
+ ignore_nocards = 1;
+ break;
case 'E':
if (putenv(optarg)) {
fprintf(stderr, "environment string '%s' is wrong\n", optarg);
@@ -150,7 +156,7 @@ int main(int argc, char *argv[])
}
cardname = argc - optind > 1 ? argv[optind + 1] : NULL;
- for (tmp = devfiles; cardname != NULL && tmp != NULL; tmp++) {
+ for (tmp = devfiles; cardname != NULL && *tmp != NULL; tmp++) {
int len = strlen(*tmp);
if (!strncmp(cardname, *tmp, len)) {
long l = strtol(cardname + len, NULL, 0);
diff --git a/alsactl/alsactl.h b/alsactl/alsactl.h
index 408b145..44d27f1 100644
--- a/alsactl/alsactl.h
+++ b/alsactl/alsactl.h
@@ -1,5 +1,6 @@
extern int debugflag;
extern int force_restore;
+extern int ignore_nocards;
extern char *command;
extern char *statefile;
diff --git a/alsactl/state.c b/alsactl/state.c
index 554020b..576721a 100644
--- a/alsactl/state.c
+++ b/alsactl/state.c
@@ -1507,8 +1507,12 @@ int save_state(const char *file, const char *cardname)
break;
if (card < 0) {
if (first) {
- error("No soundcards found...");
- return -ENODEV;
+ if (ignore_nocards) {
+ return 0;
+ } else {
+ error("No soundcards found...");
+ return -ENODEV;
+ }
}
break;
}
@@ -1606,8 +1610,12 @@ int load_state(const char *file, const char *initfile, const char *cardname)
break;
if (card < 0) {
if (first) {
- error("No soundcards found...");
- return -ENODEV;
+ if (ignore_nocards) {
+ return 0;
+ } else {
+ error("No soundcards found...");
+ return -ENODEV;
+ }
}
break;
}
diff --git a/aplay/aplay.c b/aplay/aplay.c
index 246faac..c1924e0 100644
--- a/aplay/aplay.c
+++ b/aplay/aplay.c
@@ -106,6 +106,7 @@ static int vumeter = VUMETER_NONE;
static int buffer_pos = 0;
static size_t bits_per_sample, bits_per_frame;
static size_t chunk_bytes;
+static int test_position = 0;
static snd_output_t *log;
static int fd = -1;
@@ -186,7 +187,8 @@ _("Usage: %s [OPTION]... [FILE]...\n"
" --disable-resample disable automatic rate resample\n"
" --disable-channels disable automatic channel conversions\n"
" --disable-format disable automatic format conversions\n"
-" --disable-softvol disable software volume control (softvol)\n")
+" --disable-softvol disable software volume control (softvol)\n"
+" --test-position test ring buffer position\n")
, command);
printf(_("Recognized sample formats are:"));
for (k = 0; k < SND_PCM_FORMAT_LAST; ++k) {
@@ -347,7 +349,8 @@ enum {
OPT_DISABLE_RESAMPLE,
OPT_DISABLE_CHANNELS,
OPT_DISABLE_FORMAT,
- OPT_DISABLE_SOFTVOL
+ OPT_DISABLE_SOFTVOL,
+ OPT_TEST_POSITION
};
int main(int argc, char *argv[])
@@ -385,6 +388,7 @@ int main(int argc, char *argv[])
{"disable-channels", 0, 0, OPT_DISABLE_CHANNELS},
{"disable-format", 0, 0, OPT_DISABLE_FORMAT},
{"disable-softvol", 0, 0, OPT_DISABLE_SOFTVOL},
+ {"test-position", 0, 0, OPT_TEST_POSITION},
{0, 0, 0, 0}
};
char *pcm_name = "default";
@@ -563,6 +567,9 @@ int main(int argc, char *argv[])
case OPT_DISABLE_SOFTVOL:
open_mode |= SND_PCM_NO_SOFTVOL;
break;
+ case OPT_TEST_POSITION:
+ test_position = 1;
+ break;
default:
fprintf(stderr, _("Try `%s --help' for more information.\n"), command);
return 1;
@@ -1089,6 +1096,8 @@ static void set_params(void)
/* not required, but for sure */
snd_pcm_mmap_commit(handle, offset, 0);
}
+
+ buffer_frames = buffer_size; /* for position test */
}
#ifndef timersub
@@ -1385,6 +1394,25 @@ static void compute_max_peak(u_char *data, size_t count)
}
}
+static void do_test_position(void)
+{
+ static int counter = 0;
+ snd_pcm_sframes_t avail, delay;
+ int err;
+
+ err = snd_pcm_avail_delay(handle, &avail, &delay);
+ if (err < 0)
+ return;
+ if (avail > 4 * (snd_pcm_sframes_t)buffer_frames ||
+ avail < -4 * (snd_pcm_sframes_t)buffer_frames ||
+ delay > 4 * (snd_pcm_sframes_t)buffer_frames ||
+ delay < -4 * (snd_pcm_sframes_t)buffer_frames) {
+ fprintf(stderr, "Suspicious buffer position (%i total): avail = %li, delay = %li, buffer = %li\n", ++counter, (long)avail, (long)delay, (long)buffer_frames);
+ } else if (verbose) {
+ fprintf(stderr, "Buffer position: %li/%li (%li)\n", (long)avail, (long)delay, (long)buffer_frames);
+ }
+}
+
/*
* write function
*/
@@ -1399,7 +1427,11 @@ static ssize_t pcm_write(u_char *data, size_t count)
count = chunk_size;
}
while (count > 0) {
+ if (test_position)
+ do_test_position();
r = writei_func(handle, data, count);
+ if (test_position)
+ do_test_position();
if (r == -EAGAIN || (r >= 0 && (size_t)r < count)) {
snd_pcm_wait(handle, 1000);
} else if (r == -EPIPE) {
@@ -1440,7 +1472,11 @@ static ssize_t pcm_writev(u_char **data, unsigned int channels, size_t count)
size_t offset = result;
for (channel = 0; channel < channels; channel++)
bufs[channel] = data[channel] + offset * bits_per_sample / 8;
+ if (test_position)
+ do_test_position();
r = writen_func(handle, bufs, count);
+ if (test_position)
+ do_test_position();
if (r == -EAGAIN || (r >= 0 && (size_t)r < count)) {
snd_pcm_wait(handle, 1000);
} else if (r == -EPIPE) {
@@ -1478,7 +1514,11 @@ static ssize_t pcm_read(u_char *data, size_t rcount)
}
while (count > 0) {
+ if (test_position)
+ do_test_position();
r = readi_func(handle, data, count);
+ if (test_position)
+ do_test_position();
if (r == -EAGAIN || (r >= 0 && (size_t)r < count)) {
snd_pcm_wait(handle, 1000);
} else if (r == -EPIPE) {
@@ -1516,7 +1556,11 @@ static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount)
size_t offset = result;
for (channel = 0; channel < channels; channel++)
bufs[channel] = data[channel] + offset * bits_per_sample / 8;
+ if (test_position)
+ do_test_position();
r = readn_func(handle, bufs, count);
+ if (test_position)
+ do_test_position();
if (r == -EAGAIN || (r >= 0 && (size_t)r < count)) {
snd_pcm_wait(handle, 1000);
} else if (r == -EPIPE) {
diff --git a/configure.in b/configure.in
index 5b77fbb..1c95e10 100644
--- a/configure.in
+++ b/configure.in
@@ -29,6 +29,7 @@ AC_PROG_INSTALL
AC_PROG_LN_S
AM_PATH_ALSA(1.0.16)
+dnl Disable alsamixer
CURSESINC=""
CURSESLIB=""
CURSES_CFLAGS=""
@@ -41,6 +42,16 @@ AC_ARG_ENABLE(alsamixer,
esac],[alsamixer=true])
AM_CONDITIONAL(ALSAMIXER, test x$alsamixer = xtrue)
+dnl Disable alsaconf
+AC_ARG_ENABLE(alsaconf,
+ [ --disable-alsaconf Disable alsaconf packaging],
+ [case "${enableval}" in
+ yes) alsaconf=true ;;
+ no) alsaconf=false ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsaconf) ;;
+ esac],[alsaconf=true])
+AM_CONDITIONAL(ALSACONF, test x$alsaconf = xtrue)
+
dnl Checks for header files.
AC_HEADER_STDC
if test x$alsamixer = xtrue; then

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Oct 29 14:32:47 CET 2008 - tiwai@suse.de
- updated to version 1.0.18-final;
just including all previous fixes
-------------------------------------------------------------------
Thu Oct 23 16:29:12 CEST 2008 - tiwai@suse.de

View File

@ -20,7 +20,7 @@
Name: alsa-utils
BuildRequires: alsa-devel ncurses-devel xmlto
%define package_version 1.0.18rc3
%define package_version 1.0.18
License: GPL v2 or later
Group: Productivity/Multimedia/Sound/Players
Provides: alsa-conf
@ -28,10 +28,10 @@ Requires: dialog pciutils
AutoReqProv: on
Summary: Advanced Linux Sound Architecture Utilities
Version: 1.0.18
Release: 4
Release: 5
Source: ftp://ftp.alsa-project.org/pub/util/alsa-utils-%{package_version}.tar.bz2
Patch: alsa-utils-git-fixes.diff
Patch1: alsa-utils-%{package_version}-package-fix.diff
# Patch: alsa-utils-git-fixes.diff
# Patch1: alsa-utils-%{package_version}-package-fix.diff
Url: http://www.alsa-project.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -48,8 +48,8 @@ Authors:
%prep
%setup -q -n %{name}-%{package_version}
%patch1 -p1
%patch -p1
# %patch1 -p1
# %patch -p1
mv alsamixer/README alsamixer/README-alsamixer
%build
@ -78,6 +78,9 @@ make DESTDIR=$RPM_BUILD_ROOT install
%{_datadir}/alsa
%changelog
* Wed Oct 29 2008 tiwai@suse.de
- updated to version 1.0.18-final;
just including all previous fixes
* Thu Oct 23 2008 tiwai@suse.de
- added --test-position in aplay/arecord for debugging
- can disable the build of alsaconf in configure