update to 1.2.2

This commit is contained in:
so_zh_yu 2020-04-30 10:51:53 +08:00
parent ec3024e400
commit da54272991
7 changed files with 89 additions and 287 deletions

View File

@ -1,231 +0,0 @@
From da4d5bd53a1a57d1b39318b83d3280fbcd78e9f6 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Tue, 15 May 2018 22:17:01 +0200
Subject: [PATCH 1/6] aplay: Fix invalid file size check for non-regular files
aplay tries to check the file size via fstat() at parsing the format
headers and avoids parsing when the size is shorter than the given
size. This works fine for regular files, but when a special file like
pipe is passed, it fails, eventually leading to the fallback mode
wrongly.
A proper fix is to do this sanity check only for a regular file.
Reported-by: Jay Foster <jay@systech.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
aplay/aplay.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/aplay/aplay.c b/aplay/aplay.c
index bbd7fff..63ec9ef 100644
--- a/aplay/aplay.c
+++ b/aplay/aplay.c
@@ -2821,7 +2821,8 @@ static int read_header(int *loaded, int header_size)
/* don't be adventurous, get out if file size is smaller than
* requested header size */
- if (buf.st_size < header_size)
+ if ((buf.st_mode & S_IFMT) == S_IFREG &&
+ buf.st_size < header_size)
return -1;
if (*loaded < header_size) {
--
2.13.6
From 0e2703cef90a2c53d49a49d5e9233aeb6db8960b Mon Sep 17 00:00:00 2001
From: Julian Scheel <julian@jusst.de>
Date: Wed, 23 May 2018 15:42:20 +0200
Subject: [PATCH 2/6] speaker-test: Support S24_3LE sample format
Implement support signed 24 bit samples, packed in 3 bytes.
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
speaker-test/speaker-test.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/speaker-test/speaker-test.c b/speaker-test/speaker-test.c
index 65ab523..4804bcf 100644
--- a/speaker-test/speaker-test.c
+++ b/speaker-test/speaker-test.c
@@ -283,6 +283,8 @@ static const int supported_formats[] = {
SND_PCM_FORMAT_S16_LE,
SND_PCM_FORMAT_S16_BE,
SND_PCM_FORMAT_FLOAT_LE,
+ SND_PCM_FORMAT_S24_3LE,
+ SND_PCM_FORMAT_S24_3BE,
SND_PCM_FORMAT_S32_LE,
SND_PCM_FORMAT_S32_BE,
-1
@@ -325,6 +327,18 @@ static void do_generate(uint8_t *frames, int channel, int count,
case SND_PCM_FORMAT_FLOAT_LE:
*samp_f++ = res.f;
break;
+ case SND_PCM_FORMAT_S24_3LE:
+ res.i >>= 8;
+ *samp8++ = LE_INT(res.i);
+ *samp8++ = LE_INT(res.i) >> 8;
+ *samp8++ = LE_INT(res.i) >> 16;
+ break;
+ case SND_PCM_FORMAT_S24_3BE:
+ res.i >>= 8;
+ *samp8++ = BE_INT(res.i);
+ *samp8++ = BE_INT(res.i) >> 8;
+ *samp8++ = BE_INT(res.i) >> 16;
+ break;
case SND_PCM_FORMAT_S32_LE:
*samp32++ = LE_INT(res.i);
break;
--
2.13.6
From 98ff61743188101920cbf0b1b2e3cd6d015e3c83 Mon Sep 17 00:00:00 2001
From: Julian Scheel <julian@jusst.de>
Date: Wed, 23 May 2018 15:42:21 +0200
Subject: [PATCH 3/6] speaker-test: Remove unused variable
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
speaker-test/speaker-test.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/speaker-test/speaker-test.c b/speaker-test/speaker-test.c
index 4804bcf..0cdecb3 100644
--- a/speaker-test/speaker-test.c
+++ b/speaker-test/speaker-test.c
@@ -300,7 +300,6 @@ static void do_generate(uint8_t *frames, int channel, int count,
{
value_t res;
int chn;
- int32_t ires;
int8_t *samp8 = (int8_t*) frames;
int16_t *samp16 = (int16_t*) frames;
int32_t *samp32 = (int32_t*) frames;
--
2.13.6
From a3d81b6beab1ad33ea02f7d3c19f894490a661b9 Mon Sep 17 00:00:00 2001
From: Julian Scheel <julian@jusst.de>
Date: Thu, 7 Jun 2018 11:10:55 +0200
Subject: [PATCH 4/6] speaker-test: Allow sampling rates up to 768000
There are audio devices around that support up to 768kHz playback, allow
testing them by increasing the maximum supported sampling rate.
Signed-off-by: Julian Scheel <julian@jusst.de>
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 0cdecb3..773af0a 100644
--- a/speaker-test/speaker-test.c
+++ b/speaker-test/speaker-test.c
@@ -1034,7 +1034,7 @@ int main(int argc, char *argv[]) {
case 'r':
rate = atoi(optarg);
rate = rate < 4000 ? 4000 : rate;
- rate = rate > 384000 ? 384000 : rate;
+ rate = rate > 768000 ? 768000 : rate;
break;
case 'c':
channels = atoi(optarg);
--
2.13.6
From f6b59282f7c3bddc6aa4aca93e8e19163955675b Mon Sep 17 00:00:00 2001
From: Jonathan Liu <net147@gmail.com>
Date: Sun, 5 Aug 2018 13:59:35 +1000
Subject: [PATCH 5/6] alsabat: Allow custom sample format for round trip
latency test
Setting the format to BAT_PCM_FORMAT_S16_LE in the round trip latency
test initialization is redundant as it is already set by default to
BAT_PCM_FORMAT_S16_LE unless a sample format is specified on the command
line.
Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
bat/latencytest.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/bat/latencytest.c b/bat/latencytest.c
index fae191c..ec3abe2 100644
--- a/bat/latencytest.c
+++ b/bat/latencytest.c
@@ -178,7 +178,6 @@ void roundtrip_latency_init(struct bat *bat)
bat->latency.is_playing = false;
bat->latency.error = 0;
bat->latency.xrun_error = false;
- bat->format = BAT_PCM_FORMAT_S16_LE;
bat->frames = LATENCY_TEST_TIME_LIMIT * bat->rate;
bat->periods_played = 0;
}
--
2.13.6
From 25bea6baf7097dc0a701b27587be88b0b54a529c Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Fri, 7 Sep 2018 10:53:19 +0200
Subject: [PATCH 6/6] alsaucm: add alsa-ucm udev rules for PAZ00 (Toshiba
AC100/Dynabook AZ).
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
.gitignore | 1 +
alsaucm/89-alsa-ucm.rules.in | 8 ++++++++
alsaucm/Makefile.am | 15 ++++++++++++++-
3 files changed, 23 insertions(+), 1 deletion(-)
create mode 100644 alsaucm/89-alsa-ucm.rules.in
diff --git a/alsaucm/89-alsa-ucm.rules.in b/alsaucm/89-alsa-ucm.rules.in
new file mode 100644
index 0000000..52a7616
--- /dev/null
+++ b/alsaucm/89-alsa-ucm.rules.in
@@ -0,0 +1,8 @@
+SUBSYSTEM!="sound", GOTO="ucm_end"
+ACTION!="change", GOTO="ucm_end"
+KERNEL!="card*", GOTO="ucm_end"
+
+ATTRS{id}=="PAZ00", RUN+="@bindir@/alsaucm -c PAZ00 set _verb HiFi"
+ATTRS{id}=="PAZ00", RUN+="@bindir@/alsaucm -c PAZ00 set _verb Record"
+
+LABEL="ucm_end"
diff --git a/alsaucm/Makefile.am b/alsaucm/Makefile.am
index ee0391e..651f678 100644
--- a/alsaucm/Makefile.am
+++ b/alsaucm/Makefile.am
@@ -15,4 +15,17 @@ alsaucm_LDADD = -lasound
%.1: %.rst
rst2man $< > $@
-EXTRA_DIST = alsaucm.rst
+udevrules_DATA = \
+ 89-alsa-ucm.rules
+
+edit = \
+ $(SED) -r -e 's,@bindir\@,$(bindir),g' \
+ -e 's,@mydatadir\@,$(mydatadir),g' \
+ < $< > $@ || rm $@
+
+89-alsa-ucm.rules: 89-alsa-ucm.rules.in
+ $(edit)
+
+EXTRA_DIST = alsaucm.rst 89-alsa-ucm.rules.in
+
+CLEANFILES = 89-alsa-ucm.rules
--
2.13.6

Binary file not shown.

BIN
alsa-utils-1.2.2.tar.bz2 Normal file

Binary file not shown.

View File

@ -1,43 +1,44 @@
Name: alsa-utils
Version: 1.1.6
Release: 8
Summary: Advanced linux sound architecture (ALSA) utility to the Linux operating system.
License: GPLv2+
URL: http://www.alsa-project.org/
Source: ftp://ftp.alsa-project.org/pub/utils/alsa-utils-%{version}.tar.bz2
Patch0000: alsa-git.patch
Source1: alsaunmute
Source2: alsa.rules
Source3: alsactl.conf
Source4: alsa-restore.service
Source5: alsa-state.service
BuildRequires: alsa-lib-devel >= 1.1.6 libsamplerate-devel
BuildRequires: ncurses-devel gettext-devel xmlto python3-docutils systemd
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Requires: alsa-lib >= 1.1.6
Name: alsa-utils
Version: 1.2.2
Release: 2
Summary: Advanced linux sound architecture (ALSA) utility to the Linux operating system.
License: GPLv2+
URL: http://www.alsa-project.org/
Source: ftp://ftp.alsa-project.org/pub/utils/alsa-utils-%{version}.tar.bz2
Source1: alsaunmute
Source2: alsaunmute.1
Source3: alsa.rules
Source4: alsactl.conf
Source5: alsa-restore.service
Source6: alsa-state.service
BuildRequires: gcc alsa-lib-devel >= %{version} libsamplerate-devel ncurses-devel
BuildRequires: gettext-devel xmlto python3-docutils systemd
Requires: systemd alsa-lib >= %{version} alsa-ucm >= %{version} alsa-topology >= %{version}
Provides: alsa-ucm-utils = %{version}-%{release}
Obsoletes: alsa-ucm-utils < %{version}-%{release}
Provides: alsa-topology-utils = %{version}-%{release}
Obsoletes: alsa-topology-utils < %{version}-%{release}
%description
This package provides command line utilities for audio and MIDI functionality
to the Linux operating system.
to the Linux operating system. In addition, it also contains Use Case Manager tools
and topology tools for Advanced Linux Sound Architecture (ALSA) framework.
%package devel
Summary: ALSA Basic Audio Tester
BuildRequires: fftw-devel
Provides: %{name}-alsabat = %{version}-%{release}
Obsoletes: %{name}-alsabat < %{version}-%{release}
Summary: ALSA - Basic Audio Tester
BuildRequires: fftw-devel
Provides: %{name}-alsabat = %{version}-%{release}
Obsoletes: %{name}-alsabat < %{version}-%{release}
%description devel
This package contains tool for basic audio testing using ALSA framework
and Fast Fourier Transform library.
%package help
Summary: ALSA help
Summary: ALSA help
%description help
This package contains help documentation for alsa-utils.
This package contains help docs for alsa-utils.
%prep
%autosetup -n %{name}-%{version} -p1
@ -46,38 +47,35 @@ This package contains help documentation for alsa-utils.
%configure CFLAGS="$RPM_OPT_FLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" --disable-alsaconf \
--with-udev-rules-dir=%{_prefix}/lib/udev/rules.d --with-systemdsystemunitdir=%{_unitdir}
%make_build
cp %{SOURCE1} .
%install
%make_install
%find_lang %{name}
install -d %{buildroot}/%{_prefix}/lib/udev/rules.d
install -pm 644 %{SOURCE2} %{buildroot}/%{_prefix}/lib/udev/rules.d/90-alsa-restore.rules
install -p -m 644 %{SOURCE3} %{buildroot}/%{_prefix}/lib/udev/rules.d/90-alsa-restore.rules
sed -e 's,@bindir@,%{_bindir},g' alsaucm/89-alsa-ucm.rules.in > alsaucm/89-alsa-ucm.rules
install -pm 644 alsaucm/89-alsa-ucm.rules %{buildroot}/%{_prefix}/lib/udev/rules.d/89-alsa-ucm.rules
install -p -m 644 alsaucm/89-alsa-ucm.rules %{buildroot}/%{_prefix}/lib/udev/rules.d/89-alsa-ucm.rules
install -d %{buildroot}/%{_unitdir}
install -pm 644 %{SOURCE4} %{buildroot}/%{_unitdir}/alsa-restore.service
install -pm 644 %{SOURCE5} %{buildroot}/%{_unitdir}/alsa-state.service
install -d -m 755 %{buildroot}/%{_bindir}
install -p -m 644 %{SOURCE5} %{buildroot}/%{_unitdir}/alsa-restore.service
install -p -m 644 %{SOURCE6} %{buildroot}/%{_unitdir}/alsa-state.service
install -d -m755 %{buildroot}/%{_bindir}
install -p -m 755 %{SOURCE1} %{buildroot}/%{_bindir}
install -d -m 755 %{buildroot}/%{_mandir}/man1
install -d -m 755 %{buildroot}/%{_prefix}/lib/alsa
mv %{buildroot}%{_datadir}/alsa/init %{buildroot}/%{_prefix}/lib/alsa
install -d -m755 %{buildroot}/%{_mandir}/man1
install -p -m 644 %{SOURCE2} %{buildroot}/%{_mandir}/man1/alsaunmute.1
install -d -m 755 %{buildroot}%{_prefix}/lib/alsa
mv %{buildroot}%{_datadir}/alsa/init %{buildroot}%{_prefix}/lib/alsa
ln -s ../../lib/alsa/init %{buildroot}%{_datadir}/alsa/init
install -d -m 755 %{buildroot}/etc/alsa
install -pm 644 %{SOURCE3} %{buildroot}/etc/alsa
install -d -m 755 %{buildroot}/var/lib/alsa
install -p -m 644 %{SOURCE4} %{buildroot}/etc/alsa
install -d -m 755 %{buildroot}%{_sharedstatedir}/alsa
%pre
if [ ! -r %{_unitdir}/alsa-state.service ]; then
[ -d /etc/alsa ] || mkdir -m 0755 /etc/alsa
echo "# Remove this file to disable the alsactl daemon mode" > \
/etc/alsa/state-daemon.conf
/etc/alsa/state-daemon.conf
fi
%post
@ -91,27 +89,35 @@ fi
%files -f %{name}.lang
%doc COPYING ChangeLog
%config %{_sysconfdir}/alsa/*
%config /etc/alsa/*
%{_prefix}/lib/udev/rules.d/*
%{_prefix}/lib/alsa/init/*
%{_prefix}/lib/udev/rules.d/*alsa-ucm*
%{_unitdir}/*
%{_unitdir}/sound.target.wants/*
%{_prefix}/lib/alsa/init/*
%{_bindir}/*
%exclude %{_bindir}/alsabat
%{_sbindir}/*
%{_datadir}/alsa/
%{_datadir}/sounds/*
%dir %{_sysconfdir}/alsa/
%dir /etc/alsa/
%dir %{_prefix}/lib/alsa/
%dir %{_prefix}/lib/alsa/init/
%dir %{_sharedstatedir}/alsa/
%{_bindir}/*
%exclude %{_bindir}/alsabat
%exclude %{_sbindir}/alsabat-test.sh
%exclude %{_prefix}/lib/udev/rules.d/*alsa-ucm*
%files devel
%{_bindir}/alsabat
%{_sbindir}/alsabat-test.sh
%files help
%{_mandir}/*/*
%doc README TODO
%doc README.md TODO
%changelog
* Tue Apr 28 2020 Guoshuai Sun <sunguoshuai@huawei.com> - 1.2.2-2
- package init
* Fri Feb 14 2020 gulining<gulining1@huawei.com> - 1.1.6-8
- Package init

View File

@ -2,11 +2,7 @@ ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS!="card*", GOTO="
GOTO="alsa_restore_end"
LABEL="alsa_restore_go"
TEST!="/etc/alsa/state-daemon.conf", RUN+="/sbin/alsactl -E \
ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf \
--initfile=/lib/alsa/init/00main restore /dev/$name"
TEST=="/etc/alsa/state-daemon.conf", RUN+="/sbin/alsactl -E \
ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf \
--initfile=/lib/alsa/init/00main nrestore /dev/$name"
TEST!="/etc/alsa/state-daemon.conf", RUN+="/sbin/alsactl -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --initfile=/lib/alsa/init/00main restore /dev/$name"
TEST=="/etc/alsa/state-daemon.conf", RUN+="/sbin/alsactl -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --initfile=/lib/alsa/init/00main nrestore /dev/$name"
LABEL="alsa_restore_end"

View File

@ -1,3 +1,6 @@
#!/bin/sh
exec /sbin/alsactl -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --initfile=/lib/alsa/init/00main init
exec /sbin/alsactl \
-E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf \
--initfile=/lib/alsa/init/00main \
init

28
alsaunmute.1 Normal file
View File

@ -0,0 +1,28 @@
.TH ALSAUNMUTE 1 "21 April 2010"
.SH NAME
alsaunmute \- a simple script to initialize ALSA sound devices
.SH DESCRIPTION
\fBalsaunmute\fP is a shell script which runs the \fBalsactl(1)\fP
utility with \fIinit\fP argument (see the script for details).
.SH OPTIONS
None
.SS
Example:
\fBalsaunmute\fR
.SH SEE ALSO
\fB
alsactl(1),
alsamixer(1),
amixer(1)
\fP
.SH BUGS
None known.
.SH AUTHOR
\fBalsaunmute\fP is by Jaroslav Kysela <perex@perex.cz>