From bdb388d1af0b6fc6b42c4d538315e4bc4473978c Mon Sep 17 00:00:00 2001
From: tiwai <>
Date: Jun 07 2022 09:51:22 +0000
Subject: Update alsa to version 1.2.7 / rev 215 via SR 980994
https://build.opensuse.org/request/show/980994
by user tiwai + dimstar_suse
- Backport upstream fixes for 32bit inode and ELD parsing:
0001-conf-Use-ino64_t-to-save-and-compare-inode-numbers.patch
0002-control-eld-fix-the-decoding-for-older-hw.patch
---
diff --git a/.files b/.files
index cf9a48e..e0e8cce 100644
Binary files a/.files and b/.files differ
diff --git a/.rev b/.rev
index 2d492a4..d4fc82d 100644
--- a/.rev
+++ b/.rev
@@ -1769,4 +1769,14 @@
980233
+
+ 18b82b3b9ac6180bb530ceb01ceba75d
+ 1.2.7
+
+ dimstar_suse
+ - Backport upstream fixes for 32bit inode and ELD parsing:
+ 0001-conf-Use-ino64_t-to-save-and-compare-inode-numbers.patch
+ 0002-control-eld-fix-the-decoding-for-older-hw.patch
+ 980994
+
diff --git a/0001-conf-Use-ino64_t-to-save-and-compare-inode-numbers.patch b/0001-conf-Use-ino64_t-to-save-and-compare-inode-numbers.patch
new file mode 100644
index 0000000..2292ad1
--- /dev/null
+++ b/0001-conf-Use-ino64_t-to-save-and-compare-inode-numbers.patch
@@ -0,0 +1,53 @@
+From 87ff5318e327eb2343f10bd73dce5a32f12db622 Mon Sep 17 00:00:00 2001
+From: Simon McVittie
+Date: Wed, 25 May 2022 12:33:42 +0100
+Subject: [PATCH 1/2] conf: Use ino64_t to save and compare inode numbers
+
+On 32-bit platforms when not using the large-file-support ABI,
+struct stat64 contains ino64_t which is 64-bit, while ino_t is only
+32-bit.
+
+snd_config_update_r() checks whether a file has been replaced by saving
+the ino member of a struct stat64 and comparing it with a previously-saved
+inode number. On 32-bit platforms, assigning the 64-bit member of struct
+stat64 to a 32-bit member of struct finfo will truncate it modulo 1<<32,
+which could conceivably result in libasound not reloading configuration
+when it should (although the inode number space is large enough to make
+this failure mode highly unlikely).
+
+Fixes: https://github.com/alsa-project/alsa-lib/pull/231
+Signed-off-by: Simon McVittie
+Signed-off-by: Jaroslav Kysela
+---
+ include/local.h | 1 +
+ src/conf.c | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/include/local.h b/include/local.h
+index 51fa4063afa7..268a9ff1200e 100644
+--- a/include/local.h
++++ b/include/local.h
+@@ -84,6 +84,7 @@
+ #define scandir64 scandir
+ #define versionsort64 versionsort
+ #define alphasort64 alphasort
++#define ino64_t ino_t
+ #endif
+
+ #define _snd_config_iterator list_head
+diff --git a/src/conf.c b/src/conf.c
+index 3d2b4a5bc184..a996e5f9f9be 100644
+--- a/src/conf.c
++++ b/src/conf.c
+@@ -3921,7 +3921,7 @@ snd_config_t *snd_config = NULL;
+ struct finfo {
+ char *name;
+ dev_t dev;
+- ino_t ino;
++ ino64_t ino;
+ time_t mtime;
+ };
+
+--
+2.35.3
+
diff --git a/0002-control-eld-fix-the-decoding-for-older-hw.patch b/0002-control-eld-fix-the-decoding-for-older-hw.patch
new file mode 100644
index 0000000..bee1f41
--- /dev/null
+++ b/0002-control-eld-fix-the-decoding-for-older-hw.patch
@@ -0,0 +1,58 @@
+From 89ee61914756a6f8bcafbad7fb1eca674b0a012f Mon Sep 17 00:00:00 2001
+From: Jaroslav Kysela
+Date: Mon, 6 Jun 2022 12:11:24 +0200
+Subject: [PATCH 2/2] control: eld - fix the decoding for older hw
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It seems that the monitor name is not always present in the
+ELD structure. Add asterisk suffix to notify user about
+the monitor present for this case.
+
+Thanks goes to Bernhard Rosenkränzer for the report.
+
+Fixes: https://github.com/alsa-project/alsa-lib/pull/233
+Fixes: https://github.com/alsa-project/alsa-lib/pull/234
+Signed-off-by: Jaroslav Kysela
+---
+ src/control/eld.c | 16 +++++++++++++---
+ 1 file changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/src/control/eld.c b/src/control/eld.c
+index 1e161eb1d271..9be9605fd091 100644
+--- a/src/control/eld.c
++++ b/src/control/eld.c
+@@ -74,8 +74,13 @@ int __snd_pcm_info_eld_fixup(snd_pcm_info_t * info)
+ if (cinfo.count < 20 || cinfo.count > 256)
+ return -EIO;
+ l = eld[4] & 0x1f;
+- if (l == 0 || l > 16 || 20 + l > cinfo.count)
+- return -EIO;
++ if (l == 0)
++ /* no monitor name detected */
++ goto __present;
++ if (l > 16 || 20 + l > cinfo.count) {
++ SNDERR("ELD decode failed, using old HDMI output names\n");
++ return 0;
++ }
+ s = alloca(l + 1);
+ s[l] = '\0';
+ /* sanitize */
+@@ -90,7 +95,12 @@ int __snd_pcm_info_eld_fixup(snd_pcm_info_t * info)
+ s[l] = c;
+ }
+ }
+- if (valid > 3)
++ if (valid > 3) {
+ snd_strlcpy((char *)info->name, s, sizeof(info->name));
++ } else {
++__present:
++ strncat((char *)info->name, " *", sizeof(info->name) - 1);
++ ((char *)info->name)[sizeof(info->name)-1] = '\0';
++ }
+ return 0;
+ }
+--
+2.35.3
+
diff --git a/alsa.changes b/alsa.changes
index 05844b2..4071ca6 100644
--- a/alsa.changes
+++ b/alsa.changes
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Mon Jun 6 10:56:29 UTC 2022 - Takashi Iwai
+
+- Backport upstream fixes for 32bit inode and ELD parsing:
+ 0001-conf-Use-ino64_t-to-save-and-compare-inode-numbers.patch
+ 0002-control-eld-fix-the-decoding-for-older-hw.patch
+
+-------------------------------------------------------------------
Wed Jun 1 05:51:17 UTC 2022 - Takashi Iwai
- Update to version 1.2.7:
diff --git a/alsa.spec b/alsa.spec
index c2bcefd..52eeb3b 100644
--- a/alsa.spec
+++ b/alsa.spec
@@ -53,6 +53,8 @@ Source30: all_notes_off
Source31: all_notes_off.bin
Source32: all_notes_off.mid
Source34: alsa-init.sh
+Patch1: 0001-conf-Use-ino64_t-to-save-and-compare-inode-numbers.patch
+Patch2: 0002-control-eld-fix-the-decoding-for-older-hw.patch
# rest suse fixes
Patch101: alsa-lib-ignore-non-accessible-ALSA_CONFIG_PATH.patch
BuildRequires: doxygen
@@ -141,6 +143,8 @@ This package contains the library for ALSA topology support.
%prep
%setup -q -n alsa-lib-%{version}
+%patch1 -p1
+%patch2 -p1
%patch101 -p1
%build