SHA256
1
0
forked from pool/alsa-utils

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

- Upstream backports: Add --force-frequency option to speaker-test
  0021-speaker-test-add-force-frequency-option-to-allow-hz-.patch
  0022-speaker-test-update-man-page-for-new-X-arg-also-cons.patch
- Temporarily add the raw *.po files for properly patching
- Run spec-cleaner

OBS-URL: https://build.opensuse.org/request/show/225573
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa-utils?expand=0&rev=98
This commit is contained in:
Takashi Iwai 2014-03-11 11:08:44 +00:00 committed by Git OBS Bridge
parent fc5e344afa
commit 794cdbcb70
7 changed files with 4959 additions and 37 deletions

View File

@ -0,0 +1,148 @@
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

View File

@ -0,0 +1,92 @@
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

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Tue Mar 11 10:55:31 CET 2014 - tiwai@suse.de
- Upstream backports: Add --force-frequency option to speaker-test
0021-speaker-test-add-force-frequency-option-to-allow-hz-.patch
0022-speaker-test-update-man-page-for-new-X-arg-also-cons.patch
- Temporarily add the raw *.po files for properly patching
- Run spec-cleaner
-------------------------------------------------------------------
Fri Jan 31 12:13:49 CET 2014 - tiwai@suse.de

View File

@ -16,46 +16,36 @@
#
%define package_version 1.0.27.2
#
%if %suse_version > 1130
%if 0%{?suse_version} > 1130
%define use_systemd 1
BuildRequires: systemd
%define use_varlib 1
%if %suse_version == 1140
%if 0%{?suse_version} == 1140
%define _unitdir /lib/systemd/system
%endif
BuildRequires: systemd
%else
%define use_systemd 0
%define use_varlib 0
%endif
%if %suse_version > 1200
%if 0%{?suse_version} > 1200
%define _udevdir %(pkg-config --variable=udevdir udev)
%else
%define _udevdir /lib/udev
%endif
Name: alsa-utils
BuildRequires: alsa-devel
BuildRequires: automake
BuildRequires: libsamplerate-devel
%if %suse_version > 1200
BuildRequires: libudev-devel
%endif
BuildRequires: ncurses-devel
BuildRequires: pkgconfig
BuildRequires: xmlto
%define package_version 1.0.27.2
Provides: alsa-conf
Requires: alsa
Requires: dialog
Requires: pciutils
Version: 1.0.27.2
Release: 0
Summary: Advanced Linux Sound Architecture Utilities
License: GPL-2.0+
Group: Productivity/Multimedia/Sound/Players
Version: 1.0.27.2
Release: 0
Url: http://www.alsa-project.org/
Source: ftp://ftp.alsa-project.org/pub/utils/alsa-utils-%{package_version}.tar.bz2
Source1: 01beep.conf
Source10: de.po
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
@ -78,10 +68,24 @@ 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
Url: http://www.alsa-project.org/
BuildRequires: alsa-devel
BuildRequires: automake
BuildRequires: libsamplerate-devel
BuildRequires: ncurses-devel
BuildRequires: pkgconfig
BuildRequires: xmlto
Requires: alsa
Requires: dialog
Requires: pciutils
Provides: alsa-conf
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1200
BuildRequires: libudev-devel
%endif
%description
This package contains utility programs supporting ALSA, Advanced Linux
@ -92,6 +96,10 @@ Sound Architecture.
# fix stupid automake's automatic action
sed -i -e's/EXTRA_DIST= config.rpath /EXTRA_DIST=/' Makefile.am
# rm -f po/Makefile* po/*.gmo po/*.pot po/*.header po/stamp-*
# temporarily use the original *.po files instead of the ones in tarball
cp %{SOURCE10} po/
cp %{SOURCE11} po/
cp %{SOURCE12} po/
# patch -p1
%patch1 -p1
%patch2 -p1
@ -113,25 +121,27 @@ sed -i -e's/EXTRA_DIST= config.rpath /EXTRA_DIST=/' Makefile.am
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
#
%if %suse_version < 1020
%if 0%{?suse_version} < 1020
%patch99 -p1
%endif
%build
export AUTOMAKE_JOBS="%{?_smp_mflags}"
%if %suse_version < 1020
%if 0%{?suse_version} < 1020
gettextize -f
%endif
autoreconf -fi
opts=""
%if %use_systemd
%if %{use_systemd}
opts="$opts --with-systemdsystemunitdir=%{_unitdir}"
%endif
%if ! %use_varlib
%if ! %{use_varlib}
opts="$opts --with-asound-state-dir=/etc"
%endif
%if %suse_version < 1030
%if 0%{?suse_version} < 1030
opts="$opts --disable-xmlto"
%endif
opts="$opts --with-udev-rules-dir=%{_udevdir}/rules.d"
@ -139,18 +149,18 @@ opts="$opts --with-udev-rules-dir=%{_udevdir}/rules.d"
make %{?_smp_mflags}
%install
%makeinstall
mkdir -p $RPM_BUILD_ROOT%{_datadir}/alsa/init/preinit
mkdir -p $RPM_BUILD_ROOT%{_datadir}/alsa/init/postinit
make DESTDIR=%{buildroot} install %{?_smp_mflags}
mkdir -p %{buildroot}%{_datadir}/alsa/init/preinit
mkdir -p %{buildroot}%{_datadir}/alsa/init/postinit
for i in %{_sourcedir}/[0-9]*.conf; do
install -c -m 0644 $i $RPM_BUILD_ROOT%{_datadir}/alsa/init/postinit
install -c -m 0644 $i %{buildroot}%{_datadir}/alsa/init/postinit
done
%find_lang %{name} --all-name
%if %use_systemd
%if %{use_systemd}
ln -s alsa-restore.service %{buildroot}%{_unitdir}/alsasound.service
%endif
%if %use_varlib
mkdir -p $RPM_BUILD_ROOT/var/lib/alsa
%if %{use_varlib}
mkdir -p %{buildroot}%{_localstatedir}/lib/alsa
%endif
%files -f %{name}.lang
@ -165,14 +175,14 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/alsa
%{_datadir}/sounds/alsa
%{_datadir}/alsa
%{_udevdir}
%if %use_systemd
%if %{use_systemd}
%{_unitdir}/*.service
%{_unitdir}/basic.target.wants/alsa-state.service
%{_unitdir}/basic.target.wants/alsa-restore.service
%{_unitdir}/shutdown.target.wants/alsa-store.service
%endif
%if %use_varlib
/var/lib/alsa
%if %{use_varlib}
%{_localstatedir}/lib/alsa
%endif
%changelog

1577
de.po Normal file

File diff suppressed because it is too large Load Diff

1566
fr.po Normal file

File diff suppressed because it is too large Load Diff

1520
ja.po Normal file

File diff suppressed because it is too large Load Diff