diff --git a/.alsa-utils.metadata b/.alsa-utils.metadata index 58c5985..9bf146f 100644 --- a/.alsa-utils.metadata +++ b/.alsa-utils.metadata @@ -1 +1 @@ -98569a82deeb492e728a4d2d77bdba2e1f9f36dd SOURCES/alsa-utils-1.1.3.tar.bz2 +62d07a089cb702ad93deed570d8dd77f6e6a7aae SOURCES/alsa-utils-1.1.6.tar.bz2 diff --git a/.gitignore b/.gitignore index 57b582a..d806072 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/alsa-utils-1.1.3.tar.bz2 +SOURCES/alsa-utils-1.1.6.tar.bz2 diff --git a/SOURCES/alsa-restore.service b/SOURCES/alsa-restore.service index 0411c99..3eb1bbd 100644 --- a/SOURCES/alsa-restore.service +++ b/SOURCES/alsa-restore.service @@ -6,11 +6,11 @@ [Unit] Description=Save/Restore Sound Card State ConditionPathExists=!/etc/alsa/state-daemon.conf -After=alsa-state.service +ConditionPathExistsGlob=/dev/snd/control* +ConditionPathExists=/var/lib/alsa/asound.state [Service] Type=oneshot RemainAfterExit=true ExecStart=-/sbin/alsactl -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --initfile=/lib/alsa/init/00main restore ExecStop=/sbin/alsactl -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf store -StandardOutput=syslog diff --git a/SOURCES/alsa-state.service b/SOURCES/alsa-state.service index f917da8..6dd312b 100644 --- a/SOURCES/alsa-state.service +++ b/SOURCES/alsa-state.service @@ -6,7 +6,6 @@ [Unit] Description=Manage Sound Card State (restore and store) ConditionPathExists=/etc/alsa/state-daemon.conf -After=sysinit.target [Service] Type=simple diff --git a/SOURCES/alsa-store.service b/SOURCES/alsa-store.service deleted file mode 100644 index 87a6cb1..0000000 --- a/SOURCES/alsa-store.service +++ /dev/null @@ -1,15 +0,0 @@ -# -# Note that two different ALSA card state management schemes exist and they -# can be switched using a file exist check - /etc/alsa/state-daemon.conf . -# - -[Unit] -Description=Store Sound Card State -ConditionPathExists=!/etc/alsa/state-daemon.conf -DefaultDependencies=no -Before=shutdown.target - -[Service] -Type=oneshot -ExecStart=/sbin/alsactl -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf store -StandardOutput=syslog diff --git a/SOURCES/alsa-utils-1.1.3-post.patch b/SOURCES/alsa-utils-1.1.3-post.patch deleted file mode 100644 index 89dfbc1..0000000 --- a/SOURCES/alsa-utils-1.1.3-post.patch +++ /dev/null @@ -1,448 +0,0 @@ -From c6bdde171e1532f7b37333a5a746b6e662f12c53 Mon Sep 17 00:00:00 2001 -From: Takashi Iwai -Date: Wed, 28 Dec 2016 15:58:51 +0100 -Subject: [PATCH 1/4] alsaucm: Add alsaucm.rst to EXTRA_DIST - -Otherwise it's missing in the tarball. - -Signed-off-by: Takashi Iwai ---- - alsaucm/Makefile.am | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/alsaucm/Makefile.am b/alsaucm/Makefile.am -index 7047215..ee0391e 100644 ---- a/alsaucm/Makefile.am -+++ b/alsaucm/Makefile.am -@@ -14,3 +14,5 @@ alsaucm_LDADD = -lasound - - %.1: %.rst - rst2man $< > $@ -+ -+EXTRA_DIST = alsaucm.rst --- -2.9.3 - - -From e9a6d425b5f183fe1dc0829782a9ca506aeb6263 Mon Sep 17 00:00:00 2001 -From: Paul Menzel -Date: Tue, 8 Jul 2014 07:23:06 +0000 -Subject: [PATCH 2/4] alsactl: Remove standard output definition in systemd - unit -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -`/lib/systemd/system/alsa-restore.service` specifies -`StandardOutput=syslog`. This overrides the `DefaultStandardOutput` -setting from `/etc/systemd/system.conf`, which the system administrator -can use to specify how output gets logged. In particular, the sysadmin -may want output to go to the journal, or to syslog, or nowhere at all [1]. - -This patch removes the definition entirely, so the units can use the -system default. - -Upstream the patch from the Debian package [2]. - -[1] https://bugs.debian.org/741123 -  "systemd services should not use StandardOutput=syslog; should rely - on DefaultStandardOutput" -[2] https://sources.debian.net/src/alsa-utils/1.1.2-1/debian/patches/systemd_standardoutput.patch/ - -Signed-off-by: Paul Menzel -CC: Jordi Mallach -Signed-off-by: Takashi Iwai ---- - alsactl/alsa-restore.service.in | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/alsactl/alsa-restore.service.in b/alsactl/alsa-restore.service.in -index 2884098..2583d4c 100644 ---- a/alsactl/alsa-restore.service.in -+++ b/alsactl/alsa-restore.service.in -@@ -14,4 +14,3 @@ Type=oneshot - RemainAfterExit=true - ExecStart=-@sbindir@/alsactl restore - ExecStop=-@sbindir@/alsactl store --StandardOutput=syslog --- -2.9.3 - - -From 541c7a6460835d6fa982253caf06bc971e2b9279 Mon Sep 17 00:00:00 2001 -From: Pierre-Louis Bossart -Date: Mon, 9 Jan 2017 18:32:23 -0600 -Subject: [PATCH 3/4] alsa-info: provide more DMI information - -Some manufacturers don't provide useful information for Manufacturer -and Product Name but instead use Board Vendor and Board Name fields, -add them to alsa-info log - -Example on Intel NUC: - -!!DMI Information -!!--------------- - -Manufacturer: -Product Name: -Product Version: -Firmware Version: KYSKLi70.86A.0042.2016.0929.1933 -Board Vendor: Intel Corporation -Board Name: NUC6i7KYB - -Signed-off-by: Pierre-Louis Bossart -Signed-off-by: Takashi Iwai ---- - alsa-info/alsa-info.sh | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/alsa-info/alsa-info.sh b/alsa-info/alsa-info.sh -index 0bc4cd0..9684c6f 100755 ---- a/alsa-info/alsa-info.sh -+++ b/alsa-info/alsa-info.sh -@@ -430,11 +430,15 @@ if [ -d /sys/class/dmi/id ]; then - DMI_SYSTEM_PRODUCT_NAME=$(cat /sys/class/dmi/id/product_name 2>/dev/null) - DMI_SYSTEM_PRODUCT_VERSION=$(cat /sys/class/dmi/id/product_version 2>/dev/null) - DMI_SYSTEM_FIRMWARE_VERSION=$(cat /sys/class/dmi/id/bios_version 2>/dev/null) -+ DMI_BOARD_VENDOR=$(cat /sys/class/dmi/id/board_vendor 2>/dev/null) -+ DMI_BOARD_NAME=$(cat /sys/class/dmi/id/board_name 2>/dev/null) - elif [ -x $DMIDECODE ]; then - DMI_SYSTEM_MANUFACTURER=$($DMIDECODE -s system-manufacturer 2>/dev/null) - DMI_SYSTEM_PRODUCT_NAME=$($DMIDECODE -s system-product-name 2>/dev/null) - DMI_SYSTEM_PRODUCT_VERSION=$($DMIDECODE -s system-version 2>/dev/null) - DMI_SYSTEM_FIRMWARE_VERSION=$($DMIDECODE -s bios-version 2>/dev/null) -+ DMI_BOARD_VENDOR=$($DMIDECODE -s baseboard-manufacturer 2>/dev/null) -+ DMI_BOARD_NAME=$($DMIDECODE -s baseboard-product-name 2>/dev/null) - fi - - cat /proc/asound/modules 2>/dev/null|awk {'print $2'}>$TEMPDIR/alsamodules.tmp -@@ -479,6 +483,8 @@ echo "Manufacturer: $DMI_SYSTEM_MANUFACTURER" >> $FILE - echo "Product Name: $DMI_SYSTEM_PRODUCT_NAME" >> $FILE - echo "Product Version: $DMI_SYSTEM_PRODUCT_VERSION" >> $FILE - echo "Firmware Version: $DMI_SYSTEM_FIRMWARE_VERSION" >> $FILE -+echo "Board Vendor: $DMI_BOARD_VENDOR" >> $FILE -+echo "Board Name: $DMI_BOARD_NAME" >> $FILE - echo "" >> $FILE - echo "" >> $FILE - echo "!!Kernel Information" >> $FILE --- -2.9.3 - - -From 1fefc1440276f3a91649650d1dd9bcbb28bab7bd Mon Sep 17 00:00:00 2001 -From: Pierre-Louis Bossart -Date: Mon, 9 Jan 2017 18:32:24 -0600 -Subject: [PATCH 4/4] alsa-info: add ACPI device status - -BIOS vendors typically reuse the same definitions between different -platforms and expose the relevant hardware by changing the value of -the _STA method. - -For example on the Asus T100HA, there are 3 HID values for audio -codecs in the DSDT table but two have a zero status and will be -ignored by the ACPI subsystem. - -$ more /sys/bus/acpi/devices/10EC*/status -:::::::::::::: -/sys/bus/acpi/devices/10EC3270:00/status -:::::::::::::: -15 -:::::::::::::: -/sys/bus/acpi/devices/10EC5640:00/status -:::::::::::::: -0 -:::::::::::::: -/sys/bus/acpi/devices/10EC5648:00/status -:::::::::::::: -0 - -This information is very useful to figure out which HIDs/quirks need -to be supported. Add log to alsa-info.sh to only expose non-zero -results of the ACPI _STA method, e.g. - -!!ACPI Device Status Information -!!--------------- - -/sys/bus/acpi/devices/10EC3270:00/status 15 - -Signed-off-by: Pierre-Louis Bossart -Signed-off-by: Takashi Iwai ---- - alsa-info/alsa-info.sh | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - -diff --git a/alsa-info/alsa-info.sh b/alsa-info/alsa-info.sh -index 9684c6f..cda4125 100755 ---- a/alsa-info/alsa-info.sh -+++ b/alsa-info/alsa-info.sh -@@ -441,6 +441,16 @@ elif [ -x $DMIDECODE ]; then - DMI_BOARD_NAME=$($DMIDECODE -s baseboard-product-name 2>/dev/null) - fi - -+# Check for ACPI device status -+if [ -d /sys/bus/acpi/devices ]; then -+ for f in /sys/bus/acpi/devices/*/status; do -+ ACPI_STATUS=$(cat $f 2>/dev/null); -+ if [[ "$ACPI_STATUS" -ne 0 ]]; then -+ echo $f $'\t' $ACPI_STATUS >>$TEMPDIR/acpidevicestatus.tmp; -+ fi -+ done -+fi -+ - cat /proc/asound/modules 2>/dev/null|awk {'print $2'}>$TEMPDIR/alsamodules.tmp - cat /proc/asound/cards >$TEMPDIR/alsacards.tmp - if [[ ! -z "$LSPCI" ]]; then -@@ -487,6 +497,12 @@ echo "Board Vendor: $DMI_BOARD_VENDOR" >> $FILE - echo "Board Name: $DMI_BOARD_NAME" >> $FILE - echo "" >> $FILE - echo "" >> $FILE -+echo "!!ACPI Device Status Information" >> $FILE -+echo "!!---------------" >> $FILE -+echo "" >> $FILE -+cat $TEMPDIR/acpidevicestatus.tmp >> $FILE -+echo "" >> $FILE -+echo "" >> $FILE - echo "!!Kernel Information" >> $FILE - echo "!!------------------" >> $FILE - echo "" >> $FILE --- -2.9.3 - ---- alsa-utils-1.1.3/alsaucm/alsaucm.rst 1970-01-01 01:00:00.000000000 +0100 -+++ /home/perex/alsa/alsa-utils/alsaucm/alsaucm.rst 2016-12-20 10:11:00.822592170 +0100 -@@ -0,0 +1,235 @@ -+========= -+ alsaucm -+========= -+ -+--------------------- -+ALSA Use Case Manager -+--------------------- -+ -+:Author: Antonio Ospite -+:Date: 2016-09-22 -+:Copyright: GPLv2+ -+:Manual section: 1 -+:Manual group: General Commands Manual -+ -+SYNOPSIS -+======== -+ -+*alsaucm* [command] -+ -+DESCRIPTION -+=========== -+ -+alsaucm (ALSA Use Case Manager) is a program to use the ALSA `Use Case -+Interface`_ from the command line. -+ -+On complex sound cards, setting up audio routes is not trivial and mixer -+settings can conflict one another preventing the audio card to work at all. -+ -+The ALSA Use Case Manager is a mechanism for controlling complex audio -+hardware establishing a relationship between hardware configurations and -+meaningful use cases that the end-user can relate with. -+ -+The use case manager can also be used to switch between use cases when -+necessary, in a consistent way. -+ -+At a lower level, the use case manager works by configuring the sound card -+ALSA kcontrols to change the hardware digital and analog audio routing to -+match the requested device use case. -+ -+The use case manager kcontrol configurations are stored in easy to modify text -+files. An audio use case can be defined by a **verb** and **device** parameter. -+ -+The verb describes the use case action i.e. a phone call, listening to music, -+recording a conversation etc. The device describes the physical audio capture -+and playback hardware i.e. headphones, phone handset, bluetooth headset, etc. -+ -+ -+OPTIONS -+======= -+ -+Available options: -+ -+ **-h**, **--help** -+ this help -+ -+ **-c**, **--card** `NAME` -+ open card NAME -+ -+ **-i**, **--interactive** -+ interactive mode -+ -+ **-b**, **--batch** `FILE` -+ batch mode (use ``'-'`` for the stdin input) -+ -+ **-n**, **--no-open** -+ do not open first card found -+ -+ -+Available commands: -+ -+ ``open`` `NAME` -+ open card NAME. -+ -+ valid names are sound card names as listed in ``/usr/share/alsa/ucm``. -+ -+ ``reset`` -+ reset sound card to default state. -+ -+ ``reload`` -+ reload configuration. -+ -+ ``listcards`` -+ list available cards. -+ -+ ``list`` `IDENTIFIER` -+ list command, for items returning two entries (value+comment). -+ -+ the value of the `IDENTIFIER` argument can can be: -+ -+ - ``_verbs`` - get verb list (in pair verb+comment) -+ - ``_devices[/{verb}]`` - get list of supported devices (in pair device+comment) -+ - ``_modifiers[/{verb}]`` - get list of supported modifiers (in pair modifier+comment) -+ -+ The forms without the trailing ``/{verb}`` are valid only after a specific -+ verb has been set. -+ -+ ``list1`` `IDENTIFIER` -+ list command, for lists returning one item per entry. -+ -+ the value of the `IDENTIFIER` argument can vary depending on the context, -+ it can be: -+ -+ - ``TQ[/{verb}]`` - get list of Tone Quality identifiers -+ - ``_enadevs`` - get list of enabled devices -+ - ``_enamods`` - get list of enabled modifiers -+ - ``_supporteddevs/{modifier}|{device}[/{verb}]`` - list of supported devices -+ - ``_conflictingdevs/{modifier}|{device}[/{verb}]`` - list of conflicting devices -+ -+ ``get`` `IDENTIFIER` -+ get string value. -+ -+ the value of the `IDENTIFIER` argument can can be: -+ -+ - ``_verb`` - return current verb -+ - ``[=]{NAME}[/[{modifier}|{/device}][/{verb}]]`` (For valid NAMEs look at the -+ ALSA `Use Case Interface`_) -+ -+ -+ ``geti`` `IDENTIFIER` -+ get integer value. -+ -+ the value of the `IDENTIFIER` argument can can be: -+ -+ - ``_devstatus/{device}`` -+ - ``_modtstaus/{device}`` -+ -+ ``set`` `IDENTIFIER` `VALUE` -+ set string value -+ -+ The value of the `IDENTIFIER` argument can can be: -+ -+ - ``_verb`` - set the verb to `VALUE` -+ - ``_enadev`` - enable the device specified by `VALUE` -+ - ``_disdev`` - disable the device specified by `VALUE` -+ - ``_swdev/{old_device}`` - switche device: -+ -+ - disable `old_device` and then enable the device specified by -+ `VALUE` -+ - if no device was enabled just return -+ -+ - ``_enamod`` - enable the modifier specified by `VALUE` -+ - ``_dismod`` - disable the modifier specified by `VALUE` -+ - ``_swmod/{old_modifier}`` - switch modifier: -+ -+ - disable `old_modifier` and then enable the modifier specified by -+ `VALUE` -+ - if no modifier was enabled just return -+ -+ Note that the identifiers referring to devices and modifiers are valid -+ only after setting a verb. -+ -+ ``h``, ``help`` -+ help -+ -+ ``q``, ``quit`` -+ quit -+ -+ -+FILES -+===== -+ -+The master use case files for each supported sound card are in ``/usr/share/alsa/ucm``. -+ -+For example, the master use case file for the `Pandaboard` card is in -+``/usr/share/alsa/ucm/PandaBoard/PandaBoard.conf``, this file lists all the -+supported use cases, e.g. -+ -+:: -+ -+ SectionUseCase."HiFi" { -+ File "hifi" -+ Comment "Play HiFi quality Music." -+ } -+ ... -+ -+ -+Each use case defines a _verb, which is described in the file specified in -+the ``File`` directive, like above. -+ -+The ``HiFi`` verb above is described in -+``/usr/share/alsa/ucm/PandaBoard/hifi``. -+ -+For more details on the syntax of UCM files, see the alsa-lib source code: -+http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/ucm/parser.c -+ -+ -+EXAMPLES OF USE -+=============== -+ -+Some commands, like for instance ``list _devices``, -+can only work after setting a ``_verb`` in the **same execution**, for -+instance this sequence doesn't work: -+ -+:: -+ -+ # alsaucm -c bytcr-rt5640 set _verb HiFi -+ # alsaucm -c bytcr-rt5640 list _devices -+ -+ -+However this command does: -+ -+:: -+ -+ # alsaucm -n -b - < +Date: Tue, 15 May 2018 22:17:01 +0200 +Subject: [PATCH] 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 +Signed-off-by: Takashi Iwai +--- + 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 + diff --git a/SPECS/alsa-utils.spec b/SPECS/alsa-utils.spec index a7e1057..284e543 100644 --- a/SPECS/alsa-utils.spec +++ b/SPECS/alsa-utils.spec @@ -1,10 +1,10 @@ -%define baseversion 1.1.3 -#define fixversion .1 +%define baseversion 1.1.6 +#define fixversion .1 Summary: Advanced Linux Sound Architecture (ALSA) utilities Name: alsa-utils Version: %{baseversion}%{?fixversion} -Release: 2%{?dist} +Release: 1%{?dist} License: GPLv2+ Group: Applications/Multimedia URL: http://www.alsa-project.org/ @@ -16,9 +16,8 @@ Source8: alsa-delay.1 Source10: alsa.rules Source11: alsactl.conf Source20: alsa-restore.service -Source21: alsa-store.service Source22: alsa-state.service -Patch0: alsa-utils-1.1.3-post.patch +Patch0: alsa-utils-1.1.6-post.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: alsa-lib-devel >= %{baseversion} BuildRequires: libsamplerate-devel @@ -55,7 +54,6 @@ mkdir -p $RPM_BUILD_ROOT/%{_prefix}/lib/udev/rules.d install -p -m 644 %{SOURCE10} $RPM_BUILD_ROOT/%{_prefix}/lib/udev/rules.d/90-alsa-restore.rules mkdir -p $RPM_BUILD_ROOT/%{_unitdir} install -p -m 644 %{SOURCE20} $RPM_BUILD_ROOT/%{_unitdir}/alsa-restore.service -install -p -m 644 %{SOURCE21} $RPM_BUILD_ROOT/%{_unitdir}/alsa-store.service install -p -m 644 %{SOURCE22} $RPM_BUILD_ROOT/%{_unitdir}/alsa-state.service # Install support utilities @@ -93,7 +91,7 @@ install -p -m 644 %{SOURCE8} %{buildroot}/%{_mandir}/man1/alsa-delay.1 %config /etc/alsa/* %{_prefix}/lib/udev/rules.d/* %{_unitdir}/* -%{_unitdir}/basic.target.wants/* +%{_unitdir}/sound.target.wants/* %{_prefix}/lib/alsa/init/* %{_bindir}/* %{_sbindir}/* @@ -109,7 +107,7 @@ install -p -m 644 %{SOURCE8} %{buildroot}/%{_mandir}/man1/alsa-delay.1 if [ ! -r /lib/systemd/system/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 @@ -121,6 +119,10 @@ if [ -s /etc/asound.state -a ! -s /var/lib/alsa/asound.state ] ; then fi %changelog +* Tue May 22 2018 Jaroslav Kysela - 1.1.6-1 +- Updated to 1.1.6 +- Resolves: rhbz#1578685 + * Fri Mar 24 2017 Jaroslav Kysela - 1.1.3-2 - Updated to 1.1.3 - Resolves: rhbz#1399509 @@ -267,7 +269,7 @@ fi - updated alsa-info.sh to 0.4.54 * Wed Feb 04 2009 Jaroslav Kysela 1.0.19-2 -- add %dir directive for /lib/alsa and /lib/alsa/init directories (bz#483324) +- add dir directive for /lib/alsa and /lib/alsa/init directories (bz#483324) * Tue Jan 20 2009 Jaroslav Kysela 1.0.19-1 - updated to 1.0.19 final @@ -284,7 +286,7 @@ fi * Thu Sep 18 2008 Jaroslav Kysela 1.0.18-2.rc3 - fixed /lib/alsa/init path for x86_64 (was /lib64/alsa/init) -- added /etc/alsa/asound.state -> /etc/asound.state shift to %post section +- added /etc/alsa/asound.state -> /etc/asound.state shift to post section - fix udev rules (ommited /dev/ prefix for the alsactl utility) - added --ignore option for alsactl (added also to upstream)