apply upstream 1.2.15 fixes #2

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2025-12-10 12:17:42 +01:00
commit 126c874668
2 changed files with 517 additions and 5 deletions

View file

@ -1,7 +1,7 @@
From a068cf08ad67447893b707cddfce31c9cafee643 Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
Date: Mon, 8 Dec 2025 23:46:17 -0500
Subject: [PATCH 1/3] ucm: use closefrom instead of close_range
Subject: [PATCH 1/7] ucm: use closefrom instead of close_range
closefrom is a library function with a fallback mechanism for when the
kernel does not support the close_range syscall.
@ -52,7 +52,7 @@ index b5a22023..713039b4 100644
From 813ffe34ff6c720dcc56e4549338bf9e9184af1f Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Tue, 9 Dec 2025 17:48:34 +0100
Subject: [PATCH 2/3] ucm: exec - fix maxfd used warning
Subject: [PATCH 2/7] ucm: exec - fix maxfd used warning
Fixes: a068cf08 ("ucm: use closefrom instead of close_range")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
@ -103,7 +103,7 @@ index 713039b4..c16a4cfd 100644
From a6238053c4fa518b214f99d91a01b96c5ef6e3ca Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Tue, 9 Dec 2025 18:04:07 +0100
Subject: [PATCH 3/3] conf: merge card specific contents per file (whole) after
Subject: [PATCH 3/7] conf: merge card specific contents per file (whole) after
parsing
Unfortunately, mentioned fix caused a regression for items stored in one file.
@ -148,3 +148,515 @@ index 49499ecd..b1ec9b38 100644
--
2.51.1
From 2f59398c83b8065fb9ff58939df3a9187746068e Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Tue, 9 Dec 2025 18:39:52 +0100
Subject: [PATCH 4/7] conf: fix possible memory leak in config_file_open() -
error path
Fixes: a6238053 ("conf: merge card specific contents per file (whole) after parsing")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/conf.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/conf.c b/src/conf.c
index b1ec9b38..d90f6dc3 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -4130,8 +4130,11 @@ static int config_file_open(snd_config_t *root, const char *filename, int merge)
err = snd_config_top(&top);
if (err >= 0) {
err = snd_config_load(top, in);
- if (err >= 0)
+ if (err >= 0) {
err = snd_config_merge(root, top, 1);
+ if (err < 0)
+ snd_config_delete(top);
+ }
}
}
snd_input_close(in);
--
2.51.1
From 2ef8952b46a46b97a6df2f29bcd182f895ebf9e4 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Wed, 10 Dec 2025 12:03:29 +0100
Subject: [PATCH 5/7] Revert "conf: fix load_for_all_cards() - do not merge the
card specific contents"
This reverts commit eda76146c5653ff1d5bc4b4c53f7a2d5ccc17da2.
Also, revert additional related commits:
Revert "conf: fix possible memory leak in config_file_open() - error path"
This reverts commit 2f59398c83b8065fb9ff58939df3a9187746068e.
Revert "conf: merge card specific contents per file (whole) after parsing"
This reverts commit a6238053c4fa518b214f99d91a01b96c5ef6e3ca.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/conf.c | 42 ++++++++++++------------------------------
1 file changed, 12 insertions(+), 30 deletions(-)
diff --git a/src/conf.c b/src/conf.c
index d90f6dc3..fb9f0658 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -4116,27 +4116,14 @@ static int config_filename_filter(const struct dirent64 *dirent)
return 0;
}
-static int config_file_open(snd_config_t *root, const char *filename, int merge)
+static int config_file_open(snd_config_t *root, const char *filename)
{
snd_input_t *in;
- snd_config_t *top;
int err;
err = snd_input_stdio_open(&in, filename, "r");
if (err >= 0) {
- if (merge) {
- err = snd_config_load(root, in);
- } else {
- err = snd_config_top(&top);
- if (err >= 0) {
- err = snd_config_load(top, in);
- if (err >= 0) {
- err = snd_config_merge(root, top, 1);
- if (err < 0)
- snd_config_delete(top);
- }
- }
- }
+ err = snd_config_load(root, in);
snd_input_close(in);
if (err < 0)
snd_error(CORE, "%s may be old or corrupted: consider to remove or fix it", filename);
@@ -4146,7 +4133,7 @@ static int config_file_open(snd_config_t *root, const char *filename, int merge)
return err;
}
-static int config_file_load(snd_config_t *root, const char *fn, int errors, int merge)
+static int config_file_load(snd_config_t *root, const char *fn, int errors)
{
struct stat64 st;
struct dirent64 **namelist;
@@ -4159,7 +4146,7 @@ static int config_file_load(snd_config_t *root, const char *fn, int errors, int
return 1;
}
if (!S_ISDIR(st.st_mode))
- return config_file_open(root, fn, merge);
+ return config_file_open(root, fn);
#ifndef DOC_HIDDEN
#if defined(_GNU_SOURCE) && \
!defined(__NetBSD__) && \
@@ -4185,7 +4172,7 @@ static int config_file_load(snd_config_t *root, const char *fn, int errors, int
snprintf(filename, sl, "%s/%s", fn, namelist[j]->d_name);
filename[sl-1] = '\0';
- err = config_file_open(root, filename, merge);
+ err = config_file_open(root, filename);
free(filename);
}
free(namelist[j]);
@@ -4197,20 +4184,20 @@ static int config_file_load(snd_config_t *root, const char *fn, int errors, int
return 0;
}
-static int config_file_load_user(snd_config_t *root, const char *fn, int errors, int merge)
+static int config_file_load_user(snd_config_t *root, const char *fn, int errors)
{
char *fn2;
int err;
err = snd_user_file(fn, &fn2);
if (err < 0)
- return config_file_load(root, fn, errors, merge);
- err = config_file_load(root, fn2, errors, merge);
+ return config_file_load(root, fn, errors);
+ err = config_file_load(root, fn2, errors);
free(fn2);
return err;
}
-static int config_file_load_user_all(snd_config_t *_root, snd_config_t *_file, int errors, int merge)
+static int config_file_load_user_all(snd_config_t *_root, snd_config_t *_file, int errors)
{
snd_config_t *file = _file, *root = _root, *n;
char *name, *name2, *remain, *rname = NULL;
@@ -4241,7 +4228,7 @@ static int config_file_load_user_all(snd_config_t *_root, snd_config_t *_file, i
*remain = '\0';
remain += 3;
}
- err = config_file_load_user(root, name2, errors, merge);
+ err = config_file_load_user(root, name2, errors);
if (err < 0)
goto _err;
if (err == 0) /* first hit wins */
@@ -4290,7 +4277,7 @@ int snd_config_hook_load(snd_config_t *root, snd_config_t *config, snd_config_t
{
snd_config_t *n;
snd_config_iterator_t i, next;
- int err, idx = 0, errors = 1, merge = 1, hit;
+ int err, idx = 0, errors = 1, hit;
assert(root && dst);
if ((err = snd_config_search(config, "errors", &n)) >= 0) {
@@ -4300,10 +4287,6 @@ int snd_config_hook_load(snd_config_t *root, snd_config_t *config, snd_config_t
return errors;
}
}
- /* special case, we know the card number (may be multiple times) */
- if (private_data && snd_config_search(private_data, "integer", &n) >= 0) {
- merge = 0;
- }
if ((err = snd_config_search(config, "files", &n)) < 0) {
snd_error(CORE, "Unable to find field files in the pre-load section");
return -EINVAL;
@@ -4316,7 +4299,6 @@ int snd_config_hook_load(snd_config_t *root, snd_config_t *config, snd_config_t
snd_error(CORE, "Invalid type for field filenames");
goto _err;
}
-
do {
hit = 0;
snd_config_for_each(i, next, n) {
@@ -4330,7 +4312,7 @@ int snd_config_hook_load(snd_config_t *root, snd_config_t *config, snd_config_t
goto _err;
}
if (i == idx) {
- err = config_file_load_user_all(root, n, errors, merge);
+ err = config_file_load_user_all(root, n, errors);
if (err < 0)
goto _err;
idx++;
--
2.51.1
From 16ab43db6ed6f71424d5ad78e62f85baaeae5051 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Wed, 10 Dec 2025 12:12:47 +0100
Subject: [PATCH 6/7] conf: USB-Audio: define pcm configuration block only one
time
There may be multiple USB soundcards in the system. Overwrite
the PCM configurations when loaded multiple times.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/conf/cards/USB-Audio.conf | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/conf/cards/USB-Audio.conf b/src/conf/cards/USB-Audio.conf
index 2f6d2ee0..1fc540e2 100644
--- a/src/conf/cards/USB-Audio.conf
+++ b/src/conf/cards/USB-Audio.conf
@@ -99,7 +99,7 @@ USB-Audio.pcm.iec958_2_device {
# device 0: analog output, digital input
# device 1: digital output, analog input
USB-Audio."AudioPhile".pcm.default "cards.USB-Audio.Audiophile USB (tm).pcm.default"
-USB-Audio."Audiophile USB (tm)".pcm.default {
+USB-Audio."Audiophile USB (tm)".pcm.!default {
@args [ CARD ]
@args.CARD { type string }
type asym
@@ -120,7 +120,7 @@ USB-Audio."Audiophile USB (tm)".pcm.default {
}
}
USB-Audio."AudioPhile".pcm.iec958 "cards.USB-Audio.Audiophile USB (tm).pcm.iec958"
-USB-Audio."Audiophile USB (tm)".pcm.iec958 {
+USB-Audio."Audiophile USB (tm)".pcm.!iec958 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
@@ -142,7 +142,7 @@ USB-Audio."Audiophile USB (tm)".pcm.iec958 {
# For this card we can (and must to get IEC61937) set AES bits
USB-Audio."MicroII".pcm.iec958 "cards.USB-Audio.Audio Advantage MicroII.pcm.iec958"
-USB-Audio."Audio Advantage MicroII".pcm.iec958 {
+USB-Audio."Audio Advantage MicroII".pcm.!iec958 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
@@ -180,7 +180,7 @@ USB-Audio."Audio Advantage MicroII".pcm.iec958 {
<confdir:pcm/front.conf>
-USB-Audio.pcm.front.0 {
+USB-Audio.pcm.front.!0 {
@args [ CARD ]
@args.CARD { type string }
@func refer
@@ -201,7 +201,7 @@ USB-Audio.pcm.front.0 {
}
}
-USB-Audio.pcm.default {
+USB-Audio.pcm.!default {
@args [ CARD ]
@args.CARD { type string }
@func refer
@@ -249,14 +249,14 @@ USB-Audio.pcm.default {
}
}
-USB-Audio.pcm.default_playback_dmix_yes {
+USB-Audio.pcm.!default_playback_dmix_yes {
@args [ CARD ]
@args.CARD { type string }
@func concat
strings [ "dmix:" $CARD ]
}
-USB-Audio.pcm.default_playback_dmix_no {
+USB-Audio.pcm.!default_playback_dmix_no {
@args [ CARD ]
@args.CARD { type string }
type hw
@@ -266,7 +266,7 @@ USB-Audio.pcm.default_playback_dmix_no {
<confdir:pcm/surround40.conf>
-USB-Audio.pcm.surround40.0 {
+USB-Audio.pcm.surround40.!0 {
@args [ CARD ]
@args.CARD { type string }
@func refer
@@ -301,7 +301,7 @@ USB-Audio.pcm.surround40.0 {
}
}
-USB-Audio.pcm.surround40_default {
+USB-Audio.pcm.!surround40_default {
@args [ CARD ]
@args.CARD { type string }
type hw
@@ -309,7 +309,7 @@ USB-Audio.pcm.surround40_default {
device 0
}
-USB-Audio.pcm.surround40_six_channels {
+USB-Audio.pcm.!surround40_six_channels {
@args [ CARD ]
@args.CARD { type string }
type route
@@ -327,7 +327,7 @@ USB-Audio.pcm.surround40_six_channels {
}
}
-USB-Audio.pcm.surround40_two_stereo_devices {
+USB-Audio.pcm.!surround40_two_stereo_devices {
@args [ CARD ]
@args.CARD { type string }
type route
@@ -369,7 +369,7 @@ USB-Audio.pcm.surround40_two_stereo_devices {
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
-USB-Audio.pcm.surround51.0 {
+USB-Audio.pcm.surround51.!0 {
@args [ CARD ]
@args.CARD { type string }
@func refer
@@ -402,7 +402,7 @@ USB-Audio.pcm.surround51.0 {
<confdir:pcm/surround71.conf>
-USB-Audio.pcm.surround71.0 {
+USB-Audio.pcm.surround71.!0 {
@args [ CARD ]
@args.CARD { type string }
@func refer
@@ -437,7 +437,7 @@ USB-Audio.pcm.surround71.0 {
<confdir:pcm/iec958.conf>
-USB-Audio.pcm.iec958.0 {
+USB-Audio.pcm.iec958.!0 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
@@ -472,7 +472,7 @@ USB-Audio.pcm.iec958.0 {
}
}
-USB-Audio.pcm.iec958.1 {
+USB-Audio.pcm.iec958.!1 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
--
2.51.1
From 010b699c92a9a6ffdca1874cd2e3c6c054d212e0 Mon Sep 17 00:00:00 2001
From: Jaroslav Kysela <perex@perex.cz>
Date: Wed, 10 Dec 2025 12:12:47 +0100
Subject: [PATCH 7/7] conf: HDA-Intel: define pcm configuration block only one
time
There may be multiple HDA-Intel soundcards in the system. Overwrite
the PCM configurations when loaded multiple times.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/conf/cards/HDA-Intel.conf | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/conf/cards/HDA-Intel.conf b/src/conf/cards/HDA-Intel.conf
index 5451606f..76775b97 100644
--- a/src/conf/cards/HDA-Intel.conf
+++ b/src/conf/cards/HDA-Intel.conf
@@ -4,7 +4,7 @@
<confdir:pcm/front.conf>
-HDA-Intel.pcm.front.0 {
+HDA-Intel.pcm.front.!0 {
@args [ CARD ]
@args.CARD {
type string
@@ -29,7 +29,7 @@ HDA-Intel.pcm.front.0 {
}
# default with dmix+softvol & dsnoop
-HDA-Intel.pcm.default {
+HDA-Intel.pcm.!default {
@args [ CARD ]
@args.CARD {
type string
@@ -84,7 +84,7 @@ HDA-Intel.pcm.surround71.0 cards.HDA-Intel.pcm.front.0
<confdir:pcm/iec958.conf>
-HDA-Intel.pcm.iec958.0 {
+HDA-Intel.pcm.iec958.!0 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD {
type string
@@ -163,7 +163,7 @@ HDA-Intel.pcm.iec958.0 {
hint.device 1
}
-HDA-Intel.pcm.hdmi.common {
+HDA-Intel.pcm.hdmi.!common {
@args [ CARD DEVICE CTLINDEX AES0 AES1 AES2 AES3 ]
@args.CARD {
type string
@@ -212,7 +212,7 @@ HDA-Intel.pcm.hdmi.common {
hint.device $DEVICE
}
-HDA-Intel.pcm.hdmi.0 {
+HDA-Intel.pcm.hdmi.!0 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
@@ -235,7 +235,7 @@ HDA-Intel.pcm.hdmi.0 {
}
}
-HDA-Intel.pcm.hdmi.1 {
+HDA-Intel.pcm.hdmi.!1 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
@@ -258,7 +258,7 @@ HDA-Intel.pcm.hdmi.1 {
}
}
-HDA-Intel.pcm.hdmi.2 {
+HDA-Intel.pcm.hdmi.!2 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
@@ -281,7 +281,7 @@ HDA-Intel.pcm.hdmi.2 {
}
}
-HDA-Intel.pcm.hdmi.3 {
+HDA-Intel.pcm.hdmi.!3 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
@@ -304,7 +304,7 @@ HDA-Intel.pcm.hdmi.3 {
}
}
-HDA-Intel.pcm.hdmi.4 {
+HDA-Intel.pcm.hdmi.!4 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
@@ -327,7 +327,7 @@ HDA-Intel.pcm.hdmi.4 {
}
}
-HDA-Intel.pcm.hdmi.5 {
+HDA-Intel.pcm.hdmi.!5 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
@@ -350,7 +350,7 @@ HDA-Intel.pcm.hdmi.5 {
}
}
-HDA-Intel.pcm.hdmi.6 {
+HDA-Intel.pcm.hdmi.!6 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
@@ -373,7 +373,7 @@ HDA-Intel.pcm.hdmi.6 {
}
}
-HDA-Intel.pcm.hdmi.7 {
+HDA-Intel.pcm.hdmi.!7 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
@@ -396,7 +396,7 @@ HDA-Intel.pcm.hdmi.7 {
}
}
-HDA-Intel.pcm.hdmi.8 {
+HDA-Intel.pcm.hdmi.!8 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
@@ -419,7 +419,7 @@ HDA-Intel.pcm.hdmi.8 {
}
}
-HDA-Intel.pcm.hdmi.9 {
+HDA-Intel.pcm.hdmi.!9 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
@@ -442,7 +442,7 @@ HDA-Intel.pcm.hdmi.9 {
}
}
-HDA-Intel.pcm.hdmi.10 {
+HDA-Intel.pcm.hdmi.!10 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD { type string }
@args.AES0 { type integer }
@@ -467,7 +467,7 @@ HDA-Intel.pcm.hdmi.10 {
<confdir:pcm/modem.conf>
-HDA-Intel.pcm.modem.0 {
+HDA-Intel.pcm.modem.!0 {
@args [ CARD ]
@args.CARD {
type string
--
2.51.1

View file

@ -9,7 +9,7 @@
Summary: The Advanced Linux Sound Architecture (ALSA) library
Name: alsa-lib
Version: %{version_alsa_lib}
Release: 2%{?prever_dot}%{?dist}
Release: 3%{?prever_dot}%{?dist}
License: LGPL-2.1-or-later
URL: http://www.alsa-project.org/
@ -167,7 +167,7 @@ rm %{buildroot}/%{_includedir}/asoundlib.h
%{_datadir}/alsa/topology
%changelog
* Sun Dec 7 2025 Jaroslav Kysela <perex@perex.cz> - 1.2.15-1
* Sun Dec 10 2025 Jaroslav Kysela <perex@perex.cz> - 1.2.15-3
- update to 1.2.15
* Tue Jun 24 2025 Jaroslav Kysela <perex@perex.cz> - 1.2.14-3