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

OBS-URL: https://build.opensuse.org/request/show/980993
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=305
This commit is contained in:
Takashi Iwai 2022-06-06 11:01:04 +00:00 committed by Git OBS Bridge
parent e143bd91ed
commit 1174d99af9
4 changed files with 122 additions and 0 deletions

View File

@ -0,0 +1,53 @@
From 87ff5318e327eb2343f10bd73dce5a32f12db622 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
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 <smcv@collabora.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
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

View File

@ -0,0 +1,58 @@
From 89ee61914756a6f8bcafbad7fb1eca674b0a012f Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
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 <bero@lindev.ch> 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 <perex@perex.cz>
---
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

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Jun 6 10:56:29 UTC 2022 - Takashi Iwai <tiwai@suse.com>
- 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 <tiwai@suse.com>

View File

@ -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