From 3a13c60e87854cf00a763ff4b6858e838946cd04 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 28 May 2021 13:39:51 +0200 Subject: [PATCH 01/68] update to 1.2.5 --- alsa-lib.spec | 11 +++++++---- sources | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 6519280..4f6e636 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,14 +2,14 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.4 -%define version_alsa_ucm 1.2.4 -%define version_alsa_tplg 1.2.4 +%define version_alsa_lib 1.2.5 +%define version_alsa_ucm 1.2.5 +%define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 5%{?prever_dot}%{?dist} +Release: 1%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Fri May 28 2021 Jaroslav Kysela - 1.2.5-1 +- update to 1.2.5 + * Tue Jan 26 2021 Fedora Release Engineering - 1.2.4-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild diff --git a/sources b/sources index 904929f..b10f9d4 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.4.tar.bz2) = 12086952dc8f16f1cb6946517858e17b1c3276aeda9ff5703a84bb38aa78eb4c4e9cb4485c5b3f21f174fdbd976b3bcbbc481e85cb2460652858490df51ae844 -SHA512 (alsa-ucm-conf-1.2.4.tar.bz2) = 9043460e92b2ed44757b08b9faca888e8bfae40d84e4ad7e7df44df2bb3b0617e86ef23783973accd62fb6681788262e67212e2bf67178d75781e57a0fa346d2 -SHA512 (alsa-topology-conf-1.2.4.tar.bz2) = e5b367a23f42ed2c2a83f3dd9df264b4e054f5ba7c4be98520418598f0b06a11627498a8a6ef943522b209951645f83bbbbfb32db7c9c8260aa5db08358970cb +SHA512 (alsa-lib-1.2.5.tar.bz2) = d9b53484737a3684aac7e08b4b18400aac10fec1a78a8bf9101944bea2c50710bc7355e9bb0012541b067e2d5ee7b1b818bf1bdbffbb2b2d7ad0eb15efe49725 +SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 +SHA512 (alsa-ucm-conf-1.2.5.tar.bz2) = f16e8f04018c65de5e24f2a3eb0b3edff26cbce78cc1820c42c46907c903913c571797b59e803ae36b8ec3136487d0a5aacd034e2a8df3e15ed998b7a70152b7 From 65e2f01b65d1ebb6d5254a244087251792cef35f Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 31 May 2021 12:25:18 +0200 Subject: [PATCH 02/68] update to 1.2.5 --- alsa-lib.spec | 11 +++++++---- sources | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 6519280..2267c37 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,14 +2,14 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.4 -%define version_alsa_ucm 1.2.4 -%define version_alsa_tplg 1.2.4 +%define version_alsa_lib 1.2.5 +%define version_alsa_ucm 1.2.5 +%define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 5%{?prever_dot}%{?dist} +Release: 1%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Mon May 31 2021 Jaroslav Kysela - 1.2.5-1 +- update to 1.2.5 + * Tue Jan 26 2021 Fedora Release Engineering - 1.2.4-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild diff --git a/sources b/sources index 904929f..b10f9d4 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.4.tar.bz2) = 12086952dc8f16f1cb6946517858e17b1c3276aeda9ff5703a84bb38aa78eb4c4e9cb4485c5b3f21f174fdbd976b3bcbbc481e85cb2460652858490df51ae844 -SHA512 (alsa-ucm-conf-1.2.4.tar.bz2) = 9043460e92b2ed44757b08b9faca888e8bfae40d84e4ad7e7df44df2bb3b0617e86ef23783973accd62fb6681788262e67212e2bf67178d75781e57a0fa346d2 -SHA512 (alsa-topology-conf-1.2.4.tar.bz2) = e5b367a23f42ed2c2a83f3dd9df264b4e054f5ba7c4be98520418598f0b06a11627498a8a6ef943522b209951645f83bbbbfb32db7c9c8260aa5db08358970cb +SHA512 (alsa-lib-1.2.5.tar.bz2) = d9b53484737a3684aac7e08b4b18400aac10fec1a78a8bf9101944bea2c50710bc7355e9bb0012541b067e2d5ee7b1b818bf1bdbffbb2b2d7ad0eb15efe49725 +SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 +SHA512 (alsa-ucm-conf-1.2.5.tar.bz2) = f16e8f04018c65de5e24f2a3eb0b3edff26cbce78cc1820c42c46907c903913c571797b59e803ae36b8ec3136487d0a5aacd034e2a8df3e15ed998b7a70152b7 From 9e061ed2ff01958709fd483da5e64427acce84e2 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 2 Jun 2021 19:21:12 +0200 Subject: [PATCH 03/68] 1.2.5 fixes --- alsa-git.patch | 201 +++++++++++++++++++++++++++++++++++++++++++ alsa-lib.spec | 5 +- alsa-ucm-conf.patch | 204 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 409 insertions(+), 1 deletion(-) diff --git a/alsa-git.patch b/alsa-git.patch index e69de29..eb34f13 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -0,0 +1,201 @@ +From ddfc32abf5697de1618b9e7ffdf57a0f97013090 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 08:49:32 +0200 +Subject: [PATCH 1/3] conf: fix load_for_all_cards() + +The 63f7745b commit is loading the driver specific configuration +multiple times which ends with the array merges (see the bug). + +Introduce the loaded compound which traces the already loaded +driver configurations and skip the multiple load requests. + +Fixes: https://github.com/alsa-project/alsa-lib/issues/143 +Fixes: 63f7745b ("conf: extend load_for_all_cards hook (id/value table)") +Signed-off-by: Jaroslav Kysela +--- + src/conf.c | 33 ++++++++++++++++++++++++++++----- + 1 file changed, 28 insertions(+), 5 deletions(-) + +diff --git a/src/conf.c b/src/conf.c +index f6c80031..d863dec6 100644 +--- a/src/conf.c ++++ b/src/conf.c +@@ -4325,18 +4325,23 @@ static int _snd_config_hook_table(snd_config_t *root, snd_config_t *config, snd_ + int snd_config_hook_load_for_all_cards(snd_config_t *root, snd_config_t *config, snd_config_t **dst, snd_config_t *private_data ATTRIBUTE_UNUSED) + { + int card = -1, err; ++ snd_config_t *loaded; // trace loaded cards + ++ err = snd_config_top(&loaded); ++ if (err < 0) ++ return err; + do { + err = snd_card_next(&card); + if (err < 0) +- return err; ++ goto __fin_err; + if (card >= 0) { +- snd_config_t *n, *private_data = NULL; ++ snd_config_t *n, *m, *private_data = NULL; + const char *driver; + char *fdriver = NULL; ++ bool load; + err = snd_determine_driver(card, &fdriver); + if (err < 0) +- return err; ++ goto __fin_err; + if (snd_config_search(root, fdriver, &n) >= 0) { + if (snd_config_get_string(n, &driver) < 0) { + if (snd_config_get_type(n) == SND_CONFIG_TYPE_COMPOUND) { +@@ -4357,6 +4362,19 @@ int snd_config_hook_load_for_all_cards(snd_config_t *root, snd_config_t *config, + driver = fdriver; + } + __std: ++ load = true; ++ err = snd_config_imake_integer(&m, driver, 1); ++ if (err < 0) ++ goto __err; ++ err = snd_config_add(loaded, m); ++ if (err < 0) { ++ if (err == -EEXIST) { ++ snd_config_delete(m); ++ load = false; ++ } else { ++ goto __err; ++ } ++ } + private_data = _snd_config_hook_private_data(card, driver); + if (!private_data) { + err = -ENOMEM; +@@ -4365,17 +4383,22 @@ int snd_config_hook_load_for_all_cards(snd_config_t *root, snd_config_t *config, + err = _snd_config_hook_table(root, config, private_data); + if (err < 0) + goto __err; +- err = snd_config_hook_load(root, config, &n, private_data); ++ if (load) ++ err = snd_config_hook_load(root, config, &n, private_data); + __err: + if (private_data) + snd_config_delete(private_data); + free(fdriver); + if (err < 0) +- return err; ++ goto __fin_err; + } + } while (card >= 0); ++ snd_config_delete(loaded); + *dst = NULL; + return 0; ++__fin_err: ++ snd_config_delete(loaded); ++ return err; + } + #ifndef DOC_HIDDEN + SND_DLSYM_BUILD_VERSION(snd_config_hook_load_for_all_cards, SND_CONFIG_DLSYM_VERSION_HOOK); +-- +2.30.2 + + +From 0e4ba2ea8c0402f12a645032a14693eb9b1278e6 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 11:09:43 +0200 +Subject: [PATCH 2/3] ucm: add _alibpref to get the private device prefix + +It may be useful to get the device prefix for the local configuration. + +Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1251 +Signed-off-by: Jaroslav Kysela +--- + include/use-case.h | 1 + + src/ucm/main.c | 21 +++++++++++++++++++++ + 2 files changed, 22 insertions(+) + +diff --git a/include/use-case.h b/include/use-case.h +index ec1a97b0..7890358b 100644 +--- a/include/use-case.h ++++ b/include/use-case.h +@@ -258,6 +258,7 @@ int snd_use_case_get_list(snd_use_case_mgr_t *uc_mgr, + * - _verb - return current verb + * - _file - return configuration file loaded for current card + * - _alibcfg - return private alsa-lib's configuration for current card ++ * - _alibpref - return private alsa-lib's configuration device prefix for current card + * + * - [=]{NAME}[/[{modifier}|{/device}][/{verb}]] + * - value identifier {NAME} +diff --git a/src/ucm/main.c b/src/ucm/main.c +index 361952f6..3c9ea15d 100644 +--- a/src/ucm/main.c ++++ b/src/ucm/main.c +@@ -2138,6 +2138,25 @@ static int get_alibcfg(snd_use_case_mgr_t *uc_mgr, char **str) + return 0; + } + ++/** ++ * \brief Get device prefix for private alsa-lib configuration ++ * \param uc_mgr Use case manager ++ * \param str Returned value string ++ * \return Zero on success (value is filled), otherwise a negative error code ++ */ ++static int get_alibpref(snd_use_case_mgr_t *uc_mgr, char **str) ++{ ++ const size_t l = 9; ++ char *s; ++ ++ s = malloc(l); ++ if (s == NULL) ++ return -ENOMEM; ++ snprintf(s, l, "_ucm%04X", uc_mgr->ucm_card_number); ++ *str = s; ++ return 0; ++} ++ + /** + * \brief Get current - string + * \param uc_mgr Use case manager +@@ -2193,6 +2212,8 @@ int snd_use_case_get(snd_use_case_mgr_t *uc_mgr, + + } else if (strcmp(identifier, "_alibcfg") == 0) { + err = get_alibcfg(uc_mgr, (char **)value); ++ } else if (strcmp(identifier, "_alibpref") == 0) { ++ err = get_alibpref(uc_mgr, (char **)value); + } else if (identifier[0] == '_') { + err = -ENOENT; + } else { +-- +2.30.2 + + +From 9621d0bff2e60b43e329ffa5059ab19f2914ec14 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 11:21:54 +0200 +Subject: [PATCH 3/3] ucm: fix _alibpref string (add '.' delimiter to the end) + +Fixes: 0e4ba2ea ("ucm: add _alibpref to get the private device prefix") +Signed-off-by: Jaroslav Kysela +--- + src/ucm/main.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/ucm/main.c b/src/ucm/main.c +index 3c9ea15d..c9b37b68 100644 +--- a/src/ucm/main.c ++++ b/src/ucm/main.c +@@ -2146,13 +2146,13 @@ static int get_alibcfg(snd_use_case_mgr_t *uc_mgr, char **str) + */ + static int get_alibpref(snd_use_case_mgr_t *uc_mgr, char **str) + { +- const size_t l = 9; ++ const size_t l = 10; + char *s; + + s = malloc(l); + if (s == NULL) + return -ENOMEM; +- snprintf(s, l, "_ucm%04X", uc_mgr->ucm_card_number); ++ snprintf(s, l, "_ucm%04X.", uc_mgr->ucm_card_number); + *str = s; + return 0; + } +-- +2.30.2 + diff --git a/alsa-lib.spec b/alsa-lib.spec index 4f6e636..619a415 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Wed Jun 2 2021 Jaroslav Kysela - 1.2.5-2 +- add upstream fixes (conf + ucm) + * Fri May 28 2021 Jaroslav Kysela - 1.2.5-1 - update to 1.2.5 diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index e69de29..089c3ee 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -0,0 +1,204 @@ +From 3bfe5eeb03c3e9fabb9cd8f5b83818c4cfcb74a7 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 31 May 2021 13:26:14 +0200 +Subject: [PATCH 1/4] tegra: shuffle Acer Iconia Tab A500 files + +BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/94 +Signed-off-by: Jaroslav Kysela +--- + ...r Iconia Tab A500 WM8903.conf => Acer-A500-HiFi.conf} | 0 + ucm2/Tegra/wm8903/Acer-A500.conf | 8 ++++++++ + ucm2/conf.d/tegra/Acer Iconia Tab A500 WM8903.conf | 9 +-------- + 3 files changed, 9 insertions(+), 8 deletions(-) + rename ucm2/Tegra/wm8903/{Acer Iconia Tab A500 WM8903.conf => Acer-A500-HiFi.conf} (100%) + create mode 100644 ucm2/Tegra/wm8903/Acer-A500.conf + mode change 100644 => 120000 ucm2/conf.d/tegra/Acer Iconia Tab A500 WM8903.conf + +diff --git a/ucm2/Tegra/wm8903/Acer Iconia Tab A500 WM8903.conf b/ucm2/Tegra/wm8903/Acer-A500-HiFi.conf +similarity index 100% +rename from ucm2/Tegra/wm8903/Acer Iconia Tab A500 WM8903.conf +rename to ucm2/Tegra/wm8903/Acer-A500-HiFi.conf +diff --git a/ucm2/Tegra/wm8903/Acer-A500.conf b/ucm2/Tegra/wm8903/Acer-A500.conf +new file mode 100644 +index 0000000..e9bd6c4 +--- /dev/null ++++ b/ucm2/Tegra/wm8903/Acer-A500.conf +@@ -0,0 +1,8 @@ ++# Use case Configuration for Acer Iconia Tab A500 ++ ++Syntax 4 ++ ++SectionUseCase."HiFi" { ++ File "/Tegra/wm8903/Acer-A500-HiFi.conf" ++ Comment "Play HiFi quality Music" ++} +diff --git a/ucm2/conf.d/tegra/Acer Iconia Tab A500 WM8903.conf b/ucm2/conf.d/tegra/Acer Iconia Tab A500 WM8903.conf +deleted file mode 100644 +index 1489344..0000000 +--- a/ucm2/conf.d/tegra/Acer Iconia Tab A500 WM8903.conf ++++ /dev/null +@@ -1,8 +0,0 @@ +-# Use case Configuration for Acer Iconia Tab A500 +- +-Syntax 4 +- +-SectionUseCase."HiFi" { +- File "/Tegra/wm8903/Acer Iconia Tab A500 WM8903.conf" +- Comment "Play HiFi quality Music" +-} +diff --git a/ucm2/conf.d/tegra/Acer Iconia Tab A500 WM8903.conf b/ucm2/conf.d/tegra/Acer Iconia Tab A500 WM8903.conf +new file mode 120000 +index 0000000..d000c29 +--- /dev/null ++++ b/ucm2/conf.d/tegra/Acer Iconia Tab A500 WM8903.conf +@@ -0,0 +1 @@ ++../../Tegra/wm8903/Acer-A500.conf +\ No newline at end of file +-- +2.30.2 + + +From 4136b2276e5663a60374d0e2adca54f6861dbafe Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 31 May 2021 13:31:54 +0200 +Subject: [PATCH 2/4] tegra: shuffle ASUS Google Nexus 7 files + +BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/94 +Signed-off-by: Jaroslav Kysela +--- + ...gle Nexus 7 ALC5642.conf => Google-Nexus-7-HiFi.conf} | 0 + ucm2/Tegra/rt5640/Google-Nexus-7.conf | 8 ++++++++ + ucm2/conf.d/tegra/ASUS Google Nexus 7 ALC5642.conf | 9 +-------- + 3 files changed, 9 insertions(+), 8 deletions(-) + rename ucm2/Tegra/rt5640/{ASUS Google Nexus 7 ALC5642.conf => Google-Nexus-7-HiFi.conf} (100%) + create mode 100644 ucm2/Tegra/rt5640/Google-Nexus-7.conf + mode change 100644 => 120000 ucm2/conf.d/tegra/ASUS Google Nexus 7 ALC5642.conf + +diff --git a/ucm2/Tegra/rt5640/ASUS Google Nexus 7 ALC5642.conf b/ucm2/Tegra/rt5640/Google-Nexus-7-HiFi.conf +similarity index 100% +rename from ucm2/Tegra/rt5640/ASUS Google Nexus 7 ALC5642.conf +rename to ucm2/Tegra/rt5640/Google-Nexus-7-HiFi.conf +diff --git a/ucm2/Tegra/rt5640/Google-Nexus-7.conf b/ucm2/Tegra/rt5640/Google-Nexus-7.conf +new file mode 100644 +index 0000000..1ec7b92 +--- /dev/null ++++ b/ucm2/Tegra/rt5640/Google-Nexus-7.conf +@@ -0,0 +1,8 @@ ++# Use case Configuration for ASUS Google Nexus 7 (2012) ++ ++Syntax 4 ++ ++SectionUseCase."HiFi" { ++ File "/Tegra/rt5640/Google-Nexus-7-HiFi.conf" ++ Comment "Play HiFi quality Music" ++} +diff --git a/ucm2/conf.d/tegra/ASUS Google Nexus 7 ALC5642.conf b/ucm2/conf.d/tegra/ASUS Google Nexus 7 ALC5642.conf +deleted file mode 100644 +index 1a0978c..0000000 +--- a/ucm2/conf.d/tegra/ASUS Google Nexus 7 ALC5642.conf ++++ /dev/null +@@ -1,8 +0,0 @@ +-# Use case Configuration for ASUS Google Nexus 7 (2012) +- +-Syntax 4 +- +-SectionUseCase."HiFi" { +- File "/Tegra/rt5640/ASUS Google Nexus 7 ALC5642.conf" +- Comment "Play HiFi quality Music" +-} +diff --git a/ucm2/conf.d/tegra/ASUS Google Nexus 7 ALC5642.conf b/ucm2/conf.d/tegra/ASUS Google Nexus 7 ALC5642.conf +new file mode 120000 +index 0000000..e598c9c +--- /dev/null ++++ b/ucm2/conf.d/tegra/ASUS Google Nexus 7 ALC5642.conf +@@ -0,0 +1 @@ ++../../Tegra/rt5640/Google-Nexus-7.conf +\ No newline at end of file +-- +2.30.2 + + +From 3f34021beffba4e39f064a14c5faceeaa224b766 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 1 Jun 2021 21:08:53 +0200 +Subject: [PATCH 3/4] HDA-Intel: the lookups are supported from syntax 4 + +Signed-off-by: Jaroslav Kysela +--- + ucm2/HDA-Intel/HDA-Intel.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ucm2/HDA-Intel/HDA-Intel.conf b/ucm2/HDA-Intel/HDA-Intel.conf +index 5794e72..8a8e0e7 100644 +--- a/ucm2/HDA-Intel/HDA-Intel.conf ++++ b/ucm2/HDA-Intel/HDA-Intel.conf +@@ -1,4 +1,4 @@ +-Syntax 3 ++Syntax 4 + + Define.Use "" # a non-empty string to use UCM configuration for HDA devices + +-- +2.30.2 + + +From a4cd64da90d01dc801b1887a7f835420512d0f17 Mon Sep 17 00:00:00 2001 +From: Svyatoslav Ryhel +Date: Mon, 31 May 2021 11:27:36 +0300 +Subject: [PATCH 4/4] tegra: Add UCM for Nvidia Tegra HDMI Audio + +Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/94 +Signed-off-by: Svyatoslav Ryhel +Signed-off-by: Jaroslav Kysela +--- + ucm2/Tegra/tegra-hda/tegra-hda-HiFi.conf | 12 ++++++++++++ + ucm2/Tegra/tegra-hda/tegra-hda.conf | 8 ++++++++ + ucm2/conf.d/tegra-hda/tegra-hda.conf | 1 + + 3 files changed, 21 insertions(+) + create mode 100644 ucm2/Tegra/tegra-hda/tegra-hda-HiFi.conf + create mode 100644 ucm2/Tegra/tegra-hda/tegra-hda.conf + create mode 120000 ucm2/conf.d/tegra-hda/tegra-hda.conf + +diff --git a/ucm2/Tegra/tegra-hda/tegra-hda-HiFi.conf b/ucm2/Tegra/tegra-hda/tegra-hda-HiFi.conf +new file mode 100644 +index 0000000..859c34f +--- /dev/null ++++ b/ucm2/Tegra/tegra-hda/tegra-hda-HiFi.conf +@@ -0,0 +1,12 @@ ++If.hdmi { ++ Condition { Type String Empty "" } ++ True { ++ Define { ++ HdmiNum 1 ++ HdmiPCM 3 ++ HdmiCtlIndex 0 ++ HdmiPrio 1100 ++ } ++ Include.hdmi.File "/codecs/hda/hdmi.conf" ++ } ++} +diff --git a/ucm2/Tegra/tegra-hda/tegra-hda.conf b/ucm2/Tegra/tegra-hda/tegra-hda.conf +new file mode 100644 +index 0000000..410d973 +--- /dev/null ++++ b/ucm2/Tegra/tegra-hda/tegra-hda.conf +@@ -0,0 +1,8 @@ ++# UCM for Nvidia Tegra30 HDMI Audio ++ ++Syntax 4 ++ ++SectionUseCase."HiFi" { ++ File "/Tegra/tegra-hda/tegra-hda-HiFi.conf" ++ Comment "Play HiFi quality Music" ++} +diff --git a/ucm2/conf.d/tegra-hda/tegra-hda.conf b/ucm2/conf.d/tegra-hda/tegra-hda.conf +new file mode 120000 +index 0000000..0b4867c +--- /dev/null ++++ b/ucm2/conf.d/tegra-hda/tegra-hda.conf +@@ -0,0 +1 @@ ++../../Tegra/tegra-hda/tegra-hda.conf +\ No newline at end of file +-- +2.30.2 + From c9814e5a0fe6669ee6c17f126b5ae839e0e06076 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 2 Jun 2021 19:45:34 +0200 Subject: [PATCH 04/68] remove tegra configs from ucm patch --- alsa-ucm-conf.patch | 190 -------------------------------------------- 1 file changed, 190 deletions(-) diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index 089c3ee..dedf95f 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -1,133 +1,3 @@ -From 3bfe5eeb03c3e9fabb9cd8f5b83818c4cfcb74a7 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 31 May 2021 13:26:14 +0200 -Subject: [PATCH 1/4] tegra: shuffle Acer Iconia Tab A500 files - -BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/94 -Signed-off-by: Jaroslav Kysela ---- - ...r Iconia Tab A500 WM8903.conf => Acer-A500-HiFi.conf} | 0 - ucm2/Tegra/wm8903/Acer-A500.conf | 8 ++++++++ - ucm2/conf.d/tegra/Acer Iconia Tab A500 WM8903.conf | 9 +-------- - 3 files changed, 9 insertions(+), 8 deletions(-) - rename ucm2/Tegra/wm8903/{Acer Iconia Tab A500 WM8903.conf => Acer-A500-HiFi.conf} (100%) - create mode 100644 ucm2/Tegra/wm8903/Acer-A500.conf - mode change 100644 => 120000 ucm2/conf.d/tegra/Acer Iconia Tab A500 WM8903.conf - -diff --git a/ucm2/Tegra/wm8903/Acer Iconia Tab A500 WM8903.conf b/ucm2/Tegra/wm8903/Acer-A500-HiFi.conf -similarity index 100% -rename from ucm2/Tegra/wm8903/Acer Iconia Tab A500 WM8903.conf -rename to ucm2/Tegra/wm8903/Acer-A500-HiFi.conf -diff --git a/ucm2/Tegra/wm8903/Acer-A500.conf b/ucm2/Tegra/wm8903/Acer-A500.conf -new file mode 100644 -index 0000000..e9bd6c4 ---- /dev/null -+++ b/ucm2/Tegra/wm8903/Acer-A500.conf -@@ -0,0 +1,8 @@ -+# Use case Configuration for Acer Iconia Tab A500 -+ -+Syntax 4 -+ -+SectionUseCase."HiFi" { -+ File "/Tegra/wm8903/Acer-A500-HiFi.conf" -+ Comment "Play HiFi quality Music" -+} -diff --git a/ucm2/conf.d/tegra/Acer Iconia Tab A500 WM8903.conf b/ucm2/conf.d/tegra/Acer Iconia Tab A500 WM8903.conf -deleted file mode 100644 -index 1489344..0000000 ---- a/ucm2/conf.d/tegra/Acer Iconia Tab A500 WM8903.conf -+++ /dev/null -@@ -1,8 +0,0 @@ --# Use case Configuration for Acer Iconia Tab A500 -- --Syntax 4 -- --SectionUseCase."HiFi" { -- File "/Tegra/wm8903/Acer Iconia Tab A500 WM8903.conf" -- Comment "Play HiFi quality Music" --} -diff --git a/ucm2/conf.d/tegra/Acer Iconia Tab A500 WM8903.conf b/ucm2/conf.d/tegra/Acer Iconia Tab A500 WM8903.conf -new file mode 120000 -index 0000000..d000c29 ---- /dev/null -+++ b/ucm2/conf.d/tegra/Acer Iconia Tab A500 WM8903.conf -@@ -0,0 +1 @@ -+../../Tegra/wm8903/Acer-A500.conf -\ No newline at end of file --- -2.30.2 - - -From 4136b2276e5663a60374d0e2adca54f6861dbafe Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 31 May 2021 13:31:54 +0200 -Subject: [PATCH 2/4] tegra: shuffle ASUS Google Nexus 7 files - -BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/94 -Signed-off-by: Jaroslav Kysela ---- - ...gle Nexus 7 ALC5642.conf => Google-Nexus-7-HiFi.conf} | 0 - ucm2/Tegra/rt5640/Google-Nexus-7.conf | 8 ++++++++ - ucm2/conf.d/tegra/ASUS Google Nexus 7 ALC5642.conf | 9 +-------- - 3 files changed, 9 insertions(+), 8 deletions(-) - rename ucm2/Tegra/rt5640/{ASUS Google Nexus 7 ALC5642.conf => Google-Nexus-7-HiFi.conf} (100%) - create mode 100644 ucm2/Tegra/rt5640/Google-Nexus-7.conf - mode change 100644 => 120000 ucm2/conf.d/tegra/ASUS Google Nexus 7 ALC5642.conf - -diff --git a/ucm2/Tegra/rt5640/ASUS Google Nexus 7 ALC5642.conf b/ucm2/Tegra/rt5640/Google-Nexus-7-HiFi.conf -similarity index 100% -rename from ucm2/Tegra/rt5640/ASUS Google Nexus 7 ALC5642.conf -rename to ucm2/Tegra/rt5640/Google-Nexus-7-HiFi.conf -diff --git a/ucm2/Tegra/rt5640/Google-Nexus-7.conf b/ucm2/Tegra/rt5640/Google-Nexus-7.conf -new file mode 100644 -index 0000000..1ec7b92 ---- /dev/null -+++ b/ucm2/Tegra/rt5640/Google-Nexus-7.conf -@@ -0,0 +1,8 @@ -+# Use case Configuration for ASUS Google Nexus 7 (2012) -+ -+Syntax 4 -+ -+SectionUseCase."HiFi" { -+ File "/Tegra/rt5640/Google-Nexus-7-HiFi.conf" -+ Comment "Play HiFi quality Music" -+} -diff --git a/ucm2/conf.d/tegra/ASUS Google Nexus 7 ALC5642.conf b/ucm2/conf.d/tegra/ASUS Google Nexus 7 ALC5642.conf -deleted file mode 100644 -index 1a0978c..0000000 ---- a/ucm2/conf.d/tegra/ASUS Google Nexus 7 ALC5642.conf -+++ /dev/null -@@ -1,8 +0,0 @@ --# Use case Configuration for ASUS Google Nexus 7 (2012) -- --Syntax 4 -- --SectionUseCase."HiFi" { -- File "/Tegra/rt5640/ASUS Google Nexus 7 ALC5642.conf" -- Comment "Play HiFi quality Music" --} -diff --git a/ucm2/conf.d/tegra/ASUS Google Nexus 7 ALC5642.conf b/ucm2/conf.d/tegra/ASUS Google Nexus 7 ALC5642.conf -new file mode 120000 -index 0000000..e598c9c ---- /dev/null -+++ b/ucm2/conf.d/tegra/ASUS Google Nexus 7 ALC5642.conf -@@ -0,0 +1 @@ -+../../Tegra/rt5640/Google-Nexus-7.conf -\ No newline at end of file --- -2.30.2 - - -From 3f34021beffba4e39f064a14c5faceeaa224b766 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 1 Jun 2021 21:08:53 +0200 -Subject: [PATCH 3/4] HDA-Intel: the lookups are supported from syntax 4 - -Signed-off-by: Jaroslav Kysela ---- - ucm2/HDA-Intel/HDA-Intel.conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - diff --git a/ucm2/HDA-Intel/HDA-Intel.conf b/ucm2/HDA-Intel/HDA-Intel.conf index 5794e72..8a8e0e7 100644 --- a/ucm2/HDA-Intel/HDA-Intel.conf @@ -142,63 +12,3 @@ index 5794e72..8a8e0e7 100644 2.30.2 -From a4cd64da90d01dc801b1887a7f835420512d0f17 Mon Sep 17 00:00:00 2001 -From: Svyatoslav Ryhel -Date: Mon, 31 May 2021 11:27:36 +0300 -Subject: [PATCH 4/4] tegra: Add UCM for Nvidia Tegra HDMI Audio - -Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/94 -Signed-off-by: Svyatoslav Ryhel -Signed-off-by: Jaroslav Kysela ---- - ucm2/Tegra/tegra-hda/tegra-hda-HiFi.conf | 12 ++++++++++++ - ucm2/Tegra/tegra-hda/tegra-hda.conf | 8 ++++++++ - ucm2/conf.d/tegra-hda/tegra-hda.conf | 1 + - 3 files changed, 21 insertions(+) - create mode 100644 ucm2/Tegra/tegra-hda/tegra-hda-HiFi.conf - create mode 100644 ucm2/Tegra/tegra-hda/tegra-hda.conf - create mode 120000 ucm2/conf.d/tegra-hda/tegra-hda.conf - -diff --git a/ucm2/Tegra/tegra-hda/tegra-hda-HiFi.conf b/ucm2/Tegra/tegra-hda/tegra-hda-HiFi.conf -new file mode 100644 -index 0000000..859c34f ---- /dev/null -+++ b/ucm2/Tegra/tegra-hda/tegra-hda-HiFi.conf -@@ -0,0 +1,12 @@ -+If.hdmi { -+ Condition { Type String Empty "" } -+ True { -+ Define { -+ HdmiNum 1 -+ HdmiPCM 3 -+ HdmiCtlIndex 0 -+ HdmiPrio 1100 -+ } -+ Include.hdmi.File "/codecs/hda/hdmi.conf" -+ } -+} -diff --git a/ucm2/Tegra/tegra-hda/tegra-hda.conf b/ucm2/Tegra/tegra-hda/tegra-hda.conf -new file mode 100644 -index 0000000..410d973 ---- /dev/null -+++ b/ucm2/Tegra/tegra-hda/tegra-hda.conf -@@ -0,0 +1,8 @@ -+# UCM for Nvidia Tegra30 HDMI Audio -+ -+Syntax 4 -+ -+SectionUseCase."HiFi" { -+ File "/Tegra/tegra-hda/tegra-hda-HiFi.conf" -+ Comment "Play HiFi quality Music" -+} -diff --git a/ucm2/conf.d/tegra-hda/tegra-hda.conf b/ucm2/conf.d/tegra-hda/tegra-hda.conf -new file mode 120000 -index 0000000..0b4867c ---- /dev/null -+++ b/ucm2/conf.d/tegra-hda/tegra-hda.conf -@@ -0,0 +1 @@ -+../../Tegra/tegra-hda/tegra-hda.conf -\ No newline at end of file --- -2.30.2 - From 7eb4b5980766740378580461abef17cba5a6f5f3 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 2 Jun 2021 20:02:15 +0200 Subject: [PATCH 05/68] add coverity fixes --- alsa-git.patch | 533 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 530 insertions(+), 3 deletions(-) diff --git a/alsa-git.patch b/alsa-git.patch index eb34f13..b42c2d2 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -1,7 +1,7 @@ From ddfc32abf5697de1618b9e7ffdf57a0f97013090 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 2 Jun 2021 08:49:32 +0200 -Subject: [PATCH 1/3] conf: fix load_for_all_cards() +Subject: [PATCH 01/18] conf: fix load_for_all_cards() The 63f7745b commit is loading the driver specific configuration multiple times which ends with the array merges (see the bug). @@ -99,7 +99,7 @@ index f6c80031..d863dec6 100644 From 0e4ba2ea8c0402f12a645032a14693eb9b1278e6 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 2 Jun 2021 11:09:43 +0200 -Subject: [PATCH 2/3] ucm: add _alibpref to get the private device prefix +Subject: [PATCH 02/18] ucm: add _alibpref to get the private device prefix It may be useful to get the device prefix for the local configuration. @@ -168,7 +168,8 @@ index 361952f6..3c9ea15d 100644 From 9621d0bff2e60b43e329ffa5059ab19f2914ec14 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 2 Jun 2021 11:21:54 +0200 -Subject: [PATCH 3/3] ucm: fix _alibpref string (add '.' delimiter to the end) +Subject: [PATCH 03/18] ucm: fix _alibpref string (add '.' delimiter to the + end) Fixes: 0e4ba2ea ("ucm: add _alibpref to get the private device prefix") Signed-off-by: Jaroslav Kysela @@ -199,3 +200,529 @@ index 3c9ea15d..c9b37b68 100644 -- 2.30.2 + +From 2a1dafdbe5932260aeb4db359ce5d630b8106889 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:26:47 +0200 +Subject: [PATCH 04/18] conf: remove dead code in snd_config_get_card() + +Signed-off-by: Jaroslav Kysela +--- + src/confmisc.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/confmisc.c b/src/confmisc.c +index 3663d164..a561040c 100644 +--- a/src/confmisc.c ++++ b/src/confmisc.c +@@ -154,10 +154,10 @@ int snd_config_get_card(const snd_config_t *conf) + long v; + int err; + +- if ((err = snd_config_get_integer(conf, &v)) < 0) { ++ if (snd_config_get_integer(conf, &v) < 0) { + if ((err = snd_config_get_string(conf, &str)) < 0) { +- snd_config_get_id(conf, &id); +- SNDERR("Invalid field %s", id); ++ if (snd_config_get_id(conf, &id) >= 0) ++ SNDERR("Invalid field %s", id); + return -EINVAL; + } + err = snd_card_get_index(str); +-- +2.30.2 + + +From 013ec607db9de11b682f2b85d843be062ca0d046 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:28:32 +0200 +Subject: [PATCH 05/18] control: remap - fix uninitialized value in + parse_map_vindex() + +Signed-off-by: Jaroslav Kysela +--- + src/control/control_remap.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/control/control_remap.c b/src/control/control_remap.c +index f3d65010..17c6558a 100644 +--- a/src/control/control_remap.c ++++ b/src/control/control_remap.c +@@ -1040,7 +1040,7 @@ static int parse_map_vindex(struct snd_ctl_map_ctl *mctl, snd_config_t *conf) + + snd_config_for_each(i, next, conf) { + snd_config_t *n = snd_config_iterator_entry(i); +- long idx, chn; ++ long idx = -1, chn = -1; + const char *id; + if (snd_config_get_id(n, &id) < 0) + continue; +-- +2.30.2 + + +From 2fee6af9b6e157475159d284af8de1e879bb7a36 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:35:44 +0200 +Subject: [PATCH 06/18] pcm: direct - fix pcmp error path in + _snd_pcm_direct_new() + +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_direct.c | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c +index 0e5e0421..361805bd 100644 +--- a/src/pcm/pcm_direct.c ++++ b/src/pcm/pcm_direct.c +@@ -2126,24 +2126,20 @@ int _snd_pcm_direct_new(snd_pcm_t **pcmp, snd_pcm_direct_t **_dmix, int type, + dmix->type = type; + + ret = snd_pcm_new(pcmp, type, name, stream, mode); +- if (ret < 0) { +-_err_nosem: +- free(dmix->bindings); +- free(dmix); +- return ret; +- } ++ if (ret < 0) ++ goto _err_nosem; + + while (1) { + ret = snd_pcm_direct_semaphore_create_or_connect(dmix); + if (ret < 0) { + SNDERR("unable to create IPC semaphore"); +- goto _err_nosem; ++ goto _err_nosem_free; + } + ret = snd_pcm_direct_semaphore_down(dmix, DIRECT_IPC_SEM_CLIENT); + if (ret < 0) { + snd_pcm_direct_semaphore_discard(dmix); + if (--fail_sem_loop <= 0) +- goto _err_nosem; ++ goto _err_nosem_free; + continue; + } + break; +@@ -2153,10 +2149,17 @@ _err_nosem: + if (ret < 0) { + SNDERR("unable to create IPC shm instance"); + snd_pcm_direct_semaphore_up(dmix, DIRECT_IPC_SEM_CLIENT); +- goto _err_nosem; ++ goto _err_nosem_free; + } else { + *_dmix = dmix; + } + ++ return ret; ++_err_nosem_free: ++ snd_pcm_free(*pcmp); ++ *pcmp = NULL; ++_err_nosem: ++ free(dmix->bindings); ++ free(dmix); + return ret; + } +-- +2.30.2 + + +From eb95cad4e22a0bf2577f1fa4a3f6fd18caed3362 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:37:53 +0200 +Subject: [PATCH 07/18] pcm: remove extra NULL checks in snd_pcm_dmix_open() + +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_dmix.c | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c +index 8747450f..608593f1 100644 +--- a/src/pcm/pcm_dmix.c ++++ b/src/pcm/pcm_dmix.c +@@ -998,7 +998,7 @@ int snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root, snd_config_t *sconf, + snd_pcm_stream_t stream, int mode) + { +- snd_pcm_t *pcm = NULL, *spcm = NULL; ++ snd_pcm_t *pcm, *spcm = NULL; + snd_pcm_direct_t *dmix; + int ret, first_instance; + +@@ -1154,12 +1154,9 @@ int snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name, + } else + snd_pcm_direct_semaphore_up(dmix, DIRECT_IPC_SEM_CLIENT); + _err_nosem: +- if (dmix) { +- free(dmix->bindings); +- free(dmix); +- } +- if (pcm) +- snd_pcm_free(pcm); ++ free(dmix->bindings); ++ free(dmix); ++ snd_pcm_free(pcm); + return ret; + } + +-- +2.30.2 + + +From 01a45aec6fcd5a5378a5b5e0ae0f9dacde2068e4 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:39:32 +0200 +Subject: [PATCH 08/18] pcm: remove extra NULL checks in snd_pcm_dsnoop_open() + +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_dsnoop.c | 13 +++++-------- + 1 file changed, 5 insertions(+), 8 deletions(-) + +diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c +index fb1b02c2..2c3b9f43 100644 +--- a/src/pcm/pcm_dsnoop.c ++++ b/src/pcm/pcm_dsnoop.c +@@ -564,8 +564,8 @@ int snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root, snd_config_t *sconf, + snd_pcm_stream_t stream, int mode) + { +- snd_pcm_t *pcm = NULL, *spcm = NULL; +- snd_pcm_direct_t *dsnoop = NULL; ++ snd_pcm_t *pcm, *spcm = NULL; ++ snd_pcm_direct_t *dsnoop; + int ret, first_instance; + + assert(pcmp); +@@ -708,12 +708,9 @@ int snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name, + snd_pcm_direct_semaphore_up(dsnoop, DIRECT_IPC_SEM_CLIENT); + + _err_nosem: +- if (dsnoop) { +- free(dsnoop->bindings); +- free(dsnoop); +- } +- if (pcm) +- snd_pcm_free(pcm); ++ free(dsnoop->bindings); ++ free(dsnoop); ++ snd_pcm_free(pcm); + return ret; + } + +-- +2.30.2 + + +From 74c6382df6cf18b801659d8c5c53407a7ea1f02b Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:46:46 +0200 +Subject: [PATCH 09/18] pcm: remove extra NULL checks in snd_pcm_dshare_open() + +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_dshare.c | 13 +++++-------- + 1 file changed, 5 insertions(+), 8 deletions(-) + +diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c +index 0f5238a6..a918512b 100644 +--- a/src/pcm/pcm_dshare.c ++++ b/src/pcm/pcm_dshare.c +@@ -690,8 +690,8 @@ int snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root, snd_config_t *sconf, + snd_pcm_stream_t stream, int mode) + { +- snd_pcm_t *pcm = NULL, *spcm = NULL; +- snd_pcm_direct_t *dshare = NULL; ++ snd_pcm_t *pcm, *spcm = NULL; ++ snd_pcm_direct_t *dshare; + int ret, first_instance; + unsigned int chn; + +@@ -851,12 +851,9 @@ int snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name, + } else + snd_pcm_direct_semaphore_up(dshare, DIRECT_IPC_SEM_CLIENT); + _err_nosem: +- if (dshare) { +- free(dshare->bindings); +- free(dshare); +- } +- if (pcm) +- snd_pcm_free(pcm); ++ free(dshare->bindings); ++ free(dshare); ++ snd_pcm_free(pcm); + return ret; + } + +-- +2.30.2 + + +From eabadf545c51d4c88c5f359db73726ec3ac653ba Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:49:29 +0200 +Subject: [PATCH 10/18] pcm: softvol - fix early exit in add_tlv_info() + +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_softvol.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/pcm/pcm_softvol.c b/src/pcm/pcm_softvol.c +index e2bdd31a..eea322ca 100644 +--- a/src/pcm/pcm_softvol.c ++++ b/src/pcm/pcm_softvol.c +@@ -711,13 +711,13 @@ static int add_tlv_info(snd_pcm_softvol_t *svol, snd_ctl_elem_info_t *cinfo, + unsigned int *old_tlv, size_t old_tlv_size) + { + unsigned int tlv[4]; +- if (sizeof(tlv) <= old_tlv_size && memcmp(tlv, old_tlv, sizeof(tlv)) == 0) +- return 0; + tlv[SNDRV_CTL_TLVO_TYPE] = SND_CTL_TLVT_DB_SCALE; + tlv[SNDRV_CTL_TLVO_LEN] = 2 * sizeof(int); + tlv[SNDRV_CTL_TLVO_DB_SCALE_MIN] = (int)(svol->min_dB * 100); + tlv[SNDRV_CTL_TLVO_DB_SCALE_MUTE_AND_STEP] = + (int)((svol->max_dB - svol->min_dB) * 100 / svol->max_val); ++ if (sizeof(tlv) <= old_tlv_size && memcmp(tlv, old_tlv, sizeof(tlv)) == 0) ++ return 0; + return snd_ctl_elem_tlv_write(svol->ctl, &cinfo->id, tlv); + } + +-- +2.30.2 + + +From cf3846d46053b23006e6a9042b586fc78e81af55 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:50:17 +0200 +Subject: [PATCH 11/18] timer: remove dead code in _snd_timer_hw_open() + +--- + src/timer/timer_hw.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/timer/timer_hw.c b/src/timer/timer_hw.c +index cfb77463..fe4e40bb 100644 +--- a/src/timer/timer_hw.c ++++ b/src/timer/timer_hw.c +@@ -330,8 +330,6 @@ int _snd_timer_hw_open(snd_timer_t **timer, char *name, + SNDERR("Unexpected field %s", id); + return -EINVAL; + } +- if (card < 0) +- return -EINVAL; + return snd_timer_hw_open(timer, name, dev_class, dev_sclass, card, device, subdevice, mode); + } + SND_DLSYM_BUILD_VERSION(_snd_timer_hw_open, SND_TIMER_DLSYM_VERSION); +-- +2.30.2 + + +From 200d18cda7a700607c21ad5dc9faaea2a1e27dbd Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:51:13 +0200 +Subject: [PATCH 12/18] ucm: fix error path in execute_cfgsave() + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/main.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/ucm/main.c b/src/ucm/main.c +index c9b37b68..42fdaa1d 100644 +--- a/src/ucm/main.c ++++ b/src/ucm/main.c +@@ -605,8 +605,10 @@ static int execute_cfgsave(snd_use_case_mgr_t *uc_mgr, const char *filename) + uc_error("unable to open file '%s': %s", file, snd_strerror(err)); + goto _err; + } +- if (!config || snd_config_is_empty(config)) ++ if (!config || snd_config_is_empty(config)) { ++ snd_output_close(out); + goto _err; ++ } + if (with_root) { + snd_output_printf(out, "%s ", root); + err = _snd_config_save_node_value(config, out, 0); +-- +2.30.2 + + +From 9b71d53bde21c8bb0d900c17863664e12753d844 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:52:12 +0200 +Subject: [PATCH 13/18] ucm: fix use after free in if_eval_regex_match() + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/ucm_cond.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/ucm/ucm_cond.c b/src/ucm/ucm_cond.c +index 59d1a155..adb0ecd9 100644 +--- a/src/ucm/ucm_cond.c ++++ b/src/ucm/ucm_cond.c +@@ -160,11 +160,12 @@ static int if_eval_regex_match(snd_use_case_mgr_t *uc_mgr, snd_config_t *eval) + if (err < 0) + return err; + err = regcomp(&re, s, options); +- free(s); + if (err) { + uc_error("Regex '%s' compilation failed (code %d)", s, err); ++ free(s); + return -EINVAL; + } ++ free(s); + + err = uc_mgr_get_substituted_value(uc_mgr, &s, string); + if (err < 0) { +-- +2.30.2 + + +From 7764e3e621a4c8a52327833d44e32c8b6fe3a131 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:53:24 +0200 +Subject: [PATCH 14/18] ucm: fix if_eval_path() - access NULL pointer + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/ucm_cond.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ucm/ucm_cond.c b/src/ucm/ucm_cond.c +index adb0ecd9..0ed0b690 100644 +--- a/src/ucm/ucm_cond.c ++++ b/src/ucm/ucm_cond.c +@@ -272,7 +272,7 @@ static int if_eval_control_exists(snd_use_case_mgr_t *uc_mgr, snd_config_t *eval + + static int if_eval_path(snd_use_case_mgr_t *uc_mgr, snd_config_t *eval) + { +- const char *path, *mode = NULL; ++ const char *path, *mode = ""; + int err, amode = F_OK; + + if (uc_mgr->conf_format < 4) { +-- +2.30.2 + + +From 7fcb1aadd56e94f03e51c4747e72d77279151c22 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:56:01 +0200 +Subject: [PATCH 15/18] ucm: find_exec() - fix memory leak (dir) + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/ucm_exec.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/ucm/ucm_exec.c b/src/ucm/ucm_exec.c +index a22df8fe..1cdb2633 100644 +--- a/src/ucm/ucm_exec.c ++++ b/src/ucm/ucm_exec.c +@@ -73,6 +73,7 @@ static int find_exec(const char *name, char *out, size_t len) + || !(st.st_mode & S_IEXEC)) + continue; + snd_strlcpy(out, bin, len); ++ closedir(dir); + return 1; + } + closedir(dir); +-- +2.30.2 + + +From 26ab7fc3e4cba416cf51aa0fb48fdddaa0d861ee Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:58:04 +0200 +Subject: [PATCH 16/18] ucm: fix possible NULL pointer dereference in + uc_mgr_exec() + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/ucm_exec.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/ucm/ucm_exec.c b/src/ucm/ucm_exec.c +index 1cdb2633..d83206d0 100644 +--- a/src/ucm/ucm_exec.c ++++ b/src/ucm/ucm_exec.c +@@ -185,7 +185,11 @@ int uc_mgr_exec(const char *prog) + return -EINVAL; + + prog = argv[0]; +- if (argv[0][0] != '/' && argv[0][0] != '.') { ++ if (prog == NULL) { ++ err = -EINVAL; ++ goto __error; ++ } ++ if (prog[0] != '/' && prog[0] != '.') { + if (!find_exec(argv[0], bin, sizeof(bin))) { + err = -ENOEXEC; + goto __error; +-- +2.30.2 + + +From 64a6d4d1e827732bef7c68e1e6d2cb6863b4597c Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:59:10 +0200 +Subject: [PATCH 17/18] ucm: check error value in parse_lookup_query() + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/ucm_subs.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/ucm/ucm_subs.c b/src/ucm/ucm_subs.c +index c56730c5..0bc4e63f 100644 +--- a/src/ucm/ucm_subs.c ++++ b/src/ucm/ucm_subs.c +@@ -224,7 +224,11 @@ static snd_config_t *parse_lookup_query(const char *query) + uc_error("unable to create memory input buffer"); + return NULL; + } +- snd_config_top(&config); ++ err = snd_config_top(&config); ++ if (err < 0) { ++ snd_input_close(input); ++ return NULL; ++ } + err = snd_config_load(config, input); + snd_input_close(input); + if (err < 0) { +-- +2.30.2 + + +From 30d1d256e792fbabf14c57efb98c489541b19f37 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 20:01:08 +0200 +Subject: [PATCH 18/18] ucm: fix out-of-array access in + rval_device_lookup_init() + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/ucm_subs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ucm/ucm_subs.c b/src/ucm/ucm_subs.c +index 0bc4e63f..20905c3f 100644 +--- a/src/ucm/ucm_subs.c ++++ b/src/ucm/ucm_subs.c +@@ -489,7 +489,7 @@ static int rval_device_lookup_init(snd_use_case_mgr_t *uc_mgr, + uc_error("Missing device type!"); + return -EINVAL; + } +- for (t = types; t; t++) ++ for (t = types; t->name; t++) + if (strcasecmp(t->name, s) == 0) + return t->init(iter, config); + uc_error("Device type '%s' is invalid", s); +-- +2.30.2 + From 7071ae2637fbabd3476a45fbc7da626074fedcc8 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 2 Jun 2021 19:21:12 +0200 Subject: [PATCH 06/68] 1.2.5 fixes --- alsa-git.patch | 728 ++++++++++++++++++++++++++++++++++++++++++++ alsa-lib.spec | 5 +- alsa-ucm-conf.patch | 14 + 3 files changed, 746 insertions(+), 1 deletion(-) diff --git a/alsa-git.patch b/alsa-git.patch index e69de29..b42c2d2 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -0,0 +1,728 @@ +From ddfc32abf5697de1618b9e7ffdf57a0f97013090 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 08:49:32 +0200 +Subject: [PATCH 01/18] conf: fix load_for_all_cards() + +The 63f7745b commit is loading the driver specific configuration +multiple times which ends with the array merges (see the bug). + +Introduce the loaded compound which traces the already loaded +driver configurations and skip the multiple load requests. + +Fixes: https://github.com/alsa-project/alsa-lib/issues/143 +Fixes: 63f7745b ("conf: extend load_for_all_cards hook (id/value table)") +Signed-off-by: Jaroslav Kysela +--- + src/conf.c | 33 ++++++++++++++++++++++++++++----- + 1 file changed, 28 insertions(+), 5 deletions(-) + +diff --git a/src/conf.c b/src/conf.c +index f6c80031..d863dec6 100644 +--- a/src/conf.c ++++ b/src/conf.c +@@ -4325,18 +4325,23 @@ static int _snd_config_hook_table(snd_config_t *root, snd_config_t *config, snd_ + int snd_config_hook_load_for_all_cards(snd_config_t *root, snd_config_t *config, snd_config_t **dst, snd_config_t *private_data ATTRIBUTE_UNUSED) + { + int card = -1, err; ++ snd_config_t *loaded; // trace loaded cards + ++ err = snd_config_top(&loaded); ++ if (err < 0) ++ return err; + do { + err = snd_card_next(&card); + if (err < 0) +- return err; ++ goto __fin_err; + if (card >= 0) { +- snd_config_t *n, *private_data = NULL; ++ snd_config_t *n, *m, *private_data = NULL; + const char *driver; + char *fdriver = NULL; ++ bool load; + err = snd_determine_driver(card, &fdriver); + if (err < 0) +- return err; ++ goto __fin_err; + if (snd_config_search(root, fdriver, &n) >= 0) { + if (snd_config_get_string(n, &driver) < 0) { + if (snd_config_get_type(n) == SND_CONFIG_TYPE_COMPOUND) { +@@ -4357,6 +4362,19 @@ int snd_config_hook_load_for_all_cards(snd_config_t *root, snd_config_t *config, + driver = fdriver; + } + __std: ++ load = true; ++ err = snd_config_imake_integer(&m, driver, 1); ++ if (err < 0) ++ goto __err; ++ err = snd_config_add(loaded, m); ++ if (err < 0) { ++ if (err == -EEXIST) { ++ snd_config_delete(m); ++ load = false; ++ } else { ++ goto __err; ++ } ++ } + private_data = _snd_config_hook_private_data(card, driver); + if (!private_data) { + err = -ENOMEM; +@@ -4365,17 +4383,22 @@ int snd_config_hook_load_for_all_cards(snd_config_t *root, snd_config_t *config, + err = _snd_config_hook_table(root, config, private_data); + if (err < 0) + goto __err; +- err = snd_config_hook_load(root, config, &n, private_data); ++ if (load) ++ err = snd_config_hook_load(root, config, &n, private_data); + __err: + if (private_data) + snd_config_delete(private_data); + free(fdriver); + if (err < 0) +- return err; ++ goto __fin_err; + } + } while (card >= 0); ++ snd_config_delete(loaded); + *dst = NULL; + return 0; ++__fin_err: ++ snd_config_delete(loaded); ++ return err; + } + #ifndef DOC_HIDDEN + SND_DLSYM_BUILD_VERSION(snd_config_hook_load_for_all_cards, SND_CONFIG_DLSYM_VERSION_HOOK); +-- +2.30.2 + + +From 0e4ba2ea8c0402f12a645032a14693eb9b1278e6 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 11:09:43 +0200 +Subject: [PATCH 02/18] ucm: add _alibpref to get the private device prefix + +It may be useful to get the device prefix for the local configuration. + +Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1251 +Signed-off-by: Jaroslav Kysela +--- + include/use-case.h | 1 + + src/ucm/main.c | 21 +++++++++++++++++++++ + 2 files changed, 22 insertions(+) + +diff --git a/include/use-case.h b/include/use-case.h +index ec1a97b0..7890358b 100644 +--- a/include/use-case.h ++++ b/include/use-case.h +@@ -258,6 +258,7 @@ int snd_use_case_get_list(snd_use_case_mgr_t *uc_mgr, + * - _verb - return current verb + * - _file - return configuration file loaded for current card + * - _alibcfg - return private alsa-lib's configuration for current card ++ * - _alibpref - return private alsa-lib's configuration device prefix for current card + * + * - [=]{NAME}[/[{modifier}|{/device}][/{verb}]] + * - value identifier {NAME} +diff --git a/src/ucm/main.c b/src/ucm/main.c +index 361952f6..3c9ea15d 100644 +--- a/src/ucm/main.c ++++ b/src/ucm/main.c +@@ -2138,6 +2138,25 @@ static int get_alibcfg(snd_use_case_mgr_t *uc_mgr, char **str) + return 0; + } + ++/** ++ * \brief Get device prefix for private alsa-lib configuration ++ * \param uc_mgr Use case manager ++ * \param str Returned value string ++ * \return Zero on success (value is filled), otherwise a negative error code ++ */ ++static int get_alibpref(snd_use_case_mgr_t *uc_mgr, char **str) ++{ ++ const size_t l = 9; ++ char *s; ++ ++ s = malloc(l); ++ if (s == NULL) ++ return -ENOMEM; ++ snprintf(s, l, "_ucm%04X", uc_mgr->ucm_card_number); ++ *str = s; ++ return 0; ++} ++ + /** + * \brief Get current - string + * \param uc_mgr Use case manager +@@ -2193,6 +2212,8 @@ int snd_use_case_get(snd_use_case_mgr_t *uc_mgr, + + } else if (strcmp(identifier, "_alibcfg") == 0) { + err = get_alibcfg(uc_mgr, (char **)value); ++ } else if (strcmp(identifier, "_alibpref") == 0) { ++ err = get_alibpref(uc_mgr, (char **)value); + } else if (identifier[0] == '_') { + err = -ENOENT; + } else { +-- +2.30.2 + + +From 9621d0bff2e60b43e329ffa5059ab19f2914ec14 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 11:21:54 +0200 +Subject: [PATCH 03/18] ucm: fix _alibpref string (add '.' delimiter to the + end) + +Fixes: 0e4ba2ea ("ucm: add _alibpref to get the private device prefix") +Signed-off-by: Jaroslav Kysela +--- + src/ucm/main.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/ucm/main.c b/src/ucm/main.c +index 3c9ea15d..c9b37b68 100644 +--- a/src/ucm/main.c ++++ b/src/ucm/main.c +@@ -2146,13 +2146,13 @@ static int get_alibcfg(snd_use_case_mgr_t *uc_mgr, char **str) + */ + static int get_alibpref(snd_use_case_mgr_t *uc_mgr, char **str) + { +- const size_t l = 9; ++ const size_t l = 10; + char *s; + + s = malloc(l); + if (s == NULL) + return -ENOMEM; +- snprintf(s, l, "_ucm%04X", uc_mgr->ucm_card_number); ++ snprintf(s, l, "_ucm%04X.", uc_mgr->ucm_card_number); + *str = s; + return 0; + } +-- +2.30.2 + + +From 2a1dafdbe5932260aeb4db359ce5d630b8106889 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:26:47 +0200 +Subject: [PATCH 04/18] conf: remove dead code in snd_config_get_card() + +Signed-off-by: Jaroslav Kysela +--- + src/confmisc.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/confmisc.c b/src/confmisc.c +index 3663d164..a561040c 100644 +--- a/src/confmisc.c ++++ b/src/confmisc.c +@@ -154,10 +154,10 @@ int snd_config_get_card(const snd_config_t *conf) + long v; + int err; + +- if ((err = snd_config_get_integer(conf, &v)) < 0) { ++ if (snd_config_get_integer(conf, &v) < 0) { + if ((err = snd_config_get_string(conf, &str)) < 0) { +- snd_config_get_id(conf, &id); +- SNDERR("Invalid field %s", id); ++ if (snd_config_get_id(conf, &id) >= 0) ++ SNDERR("Invalid field %s", id); + return -EINVAL; + } + err = snd_card_get_index(str); +-- +2.30.2 + + +From 013ec607db9de11b682f2b85d843be062ca0d046 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:28:32 +0200 +Subject: [PATCH 05/18] control: remap - fix uninitialized value in + parse_map_vindex() + +Signed-off-by: Jaroslav Kysela +--- + src/control/control_remap.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/control/control_remap.c b/src/control/control_remap.c +index f3d65010..17c6558a 100644 +--- a/src/control/control_remap.c ++++ b/src/control/control_remap.c +@@ -1040,7 +1040,7 @@ static int parse_map_vindex(struct snd_ctl_map_ctl *mctl, snd_config_t *conf) + + snd_config_for_each(i, next, conf) { + snd_config_t *n = snd_config_iterator_entry(i); +- long idx, chn; ++ long idx = -1, chn = -1; + const char *id; + if (snd_config_get_id(n, &id) < 0) + continue; +-- +2.30.2 + + +From 2fee6af9b6e157475159d284af8de1e879bb7a36 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:35:44 +0200 +Subject: [PATCH 06/18] pcm: direct - fix pcmp error path in + _snd_pcm_direct_new() + +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_direct.c | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c +index 0e5e0421..361805bd 100644 +--- a/src/pcm/pcm_direct.c ++++ b/src/pcm/pcm_direct.c +@@ -2126,24 +2126,20 @@ int _snd_pcm_direct_new(snd_pcm_t **pcmp, snd_pcm_direct_t **_dmix, int type, + dmix->type = type; + + ret = snd_pcm_new(pcmp, type, name, stream, mode); +- if (ret < 0) { +-_err_nosem: +- free(dmix->bindings); +- free(dmix); +- return ret; +- } ++ if (ret < 0) ++ goto _err_nosem; + + while (1) { + ret = snd_pcm_direct_semaphore_create_or_connect(dmix); + if (ret < 0) { + SNDERR("unable to create IPC semaphore"); +- goto _err_nosem; ++ goto _err_nosem_free; + } + ret = snd_pcm_direct_semaphore_down(dmix, DIRECT_IPC_SEM_CLIENT); + if (ret < 0) { + snd_pcm_direct_semaphore_discard(dmix); + if (--fail_sem_loop <= 0) +- goto _err_nosem; ++ goto _err_nosem_free; + continue; + } + break; +@@ -2153,10 +2149,17 @@ _err_nosem: + if (ret < 0) { + SNDERR("unable to create IPC shm instance"); + snd_pcm_direct_semaphore_up(dmix, DIRECT_IPC_SEM_CLIENT); +- goto _err_nosem; ++ goto _err_nosem_free; + } else { + *_dmix = dmix; + } + ++ return ret; ++_err_nosem_free: ++ snd_pcm_free(*pcmp); ++ *pcmp = NULL; ++_err_nosem: ++ free(dmix->bindings); ++ free(dmix); + return ret; + } +-- +2.30.2 + + +From eb95cad4e22a0bf2577f1fa4a3f6fd18caed3362 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:37:53 +0200 +Subject: [PATCH 07/18] pcm: remove extra NULL checks in snd_pcm_dmix_open() + +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_dmix.c | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c +index 8747450f..608593f1 100644 +--- a/src/pcm/pcm_dmix.c ++++ b/src/pcm/pcm_dmix.c +@@ -998,7 +998,7 @@ int snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root, snd_config_t *sconf, + snd_pcm_stream_t stream, int mode) + { +- snd_pcm_t *pcm = NULL, *spcm = NULL; ++ snd_pcm_t *pcm, *spcm = NULL; + snd_pcm_direct_t *dmix; + int ret, first_instance; + +@@ -1154,12 +1154,9 @@ int snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name, + } else + snd_pcm_direct_semaphore_up(dmix, DIRECT_IPC_SEM_CLIENT); + _err_nosem: +- if (dmix) { +- free(dmix->bindings); +- free(dmix); +- } +- if (pcm) +- snd_pcm_free(pcm); ++ free(dmix->bindings); ++ free(dmix); ++ snd_pcm_free(pcm); + return ret; + } + +-- +2.30.2 + + +From 01a45aec6fcd5a5378a5b5e0ae0f9dacde2068e4 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:39:32 +0200 +Subject: [PATCH 08/18] pcm: remove extra NULL checks in snd_pcm_dsnoop_open() + +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_dsnoop.c | 13 +++++-------- + 1 file changed, 5 insertions(+), 8 deletions(-) + +diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c +index fb1b02c2..2c3b9f43 100644 +--- a/src/pcm/pcm_dsnoop.c ++++ b/src/pcm/pcm_dsnoop.c +@@ -564,8 +564,8 @@ int snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root, snd_config_t *sconf, + snd_pcm_stream_t stream, int mode) + { +- snd_pcm_t *pcm = NULL, *spcm = NULL; +- snd_pcm_direct_t *dsnoop = NULL; ++ snd_pcm_t *pcm, *spcm = NULL; ++ snd_pcm_direct_t *dsnoop; + int ret, first_instance; + + assert(pcmp); +@@ -708,12 +708,9 @@ int snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name, + snd_pcm_direct_semaphore_up(dsnoop, DIRECT_IPC_SEM_CLIENT); + + _err_nosem: +- if (dsnoop) { +- free(dsnoop->bindings); +- free(dsnoop); +- } +- if (pcm) +- snd_pcm_free(pcm); ++ free(dsnoop->bindings); ++ free(dsnoop); ++ snd_pcm_free(pcm); + return ret; + } + +-- +2.30.2 + + +From 74c6382df6cf18b801659d8c5c53407a7ea1f02b Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:46:46 +0200 +Subject: [PATCH 09/18] pcm: remove extra NULL checks in snd_pcm_dshare_open() + +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_dshare.c | 13 +++++-------- + 1 file changed, 5 insertions(+), 8 deletions(-) + +diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c +index 0f5238a6..a918512b 100644 +--- a/src/pcm/pcm_dshare.c ++++ b/src/pcm/pcm_dshare.c +@@ -690,8 +690,8 @@ int snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root, snd_config_t *sconf, + snd_pcm_stream_t stream, int mode) + { +- snd_pcm_t *pcm = NULL, *spcm = NULL; +- snd_pcm_direct_t *dshare = NULL; ++ snd_pcm_t *pcm, *spcm = NULL; ++ snd_pcm_direct_t *dshare; + int ret, first_instance; + unsigned int chn; + +@@ -851,12 +851,9 @@ int snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name, + } else + snd_pcm_direct_semaphore_up(dshare, DIRECT_IPC_SEM_CLIENT); + _err_nosem: +- if (dshare) { +- free(dshare->bindings); +- free(dshare); +- } +- if (pcm) +- snd_pcm_free(pcm); ++ free(dshare->bindings); ++ free(dshare); ++ snd_pcm_free(pcm); + return ret; + } + +-- +2.30.2 + + +From eabadf545c51d4c88c5f359db73726ec3ac653ba Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:49:29 +0200 +Subject: [PATCH 10/18] pcm: softvol - fix early exit in add_tlv_info() + +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_softvol.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/pcm/pcm_softvol.c b/src/pcm/pcm_softvol.c +index e2bdd31a..eea322ca 100644 +--- a/src/pcm/pcm_softvol.c ++++ b/src/pcm/pcm_softvol.c +@@ -711,13 +711,13 @@ static int add_tlv_info(snd_pcm_softvol_t *svol, snd_ctl_elem_info_t *cinfo, + unsigned int *old_tlv, size_t old_tlv_size) + { + unsigned int tlv[4]; +- if (sizeof(tlv) <= old_tlv_size && memcmp(tlv, old_tlv, sizeof(tlv)) == 0) +- return 0; + tlv[SNDRV_CTL_TLVO_TYPE] = SND_CTL_TLVT_DB_SCALE; + tlv[SNDRV_CTL_TLVO_LEN] = 2 * sizeof(int); + tlv[SNDRV_CTL_TLVO_DB_SCALE_MIN] = (int)(svol->min_dB * 100); + tlv[SNDRV_CTL_TLVO_DB_SCALE_MUTE_AND_STEP] = + (int)((svol->max_dB - svol->min_dB) * 100 / svol->max_val); ++ if (sizeof(tlv) <= old_tlv_size && memcmp(tlv, old_tlv, sizeof(tlv)) == 0) ++ return 0; + return snd_ctl_elem_tlv_write(svol->ctl, &cinfo->id, tlv); + } + +-- +2.30.2 + + +From cf3846d46053b23006e6a9042b586fc78e81af55 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:50:17 +0200 +Subject: [PATCH 11/18] timer: remove dead code in _snd_timer_hw_open() + +--- + src/timer/timer_hw.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/timer/timer_hw.c b/src/timer/timer_hw.c +index cfb77463..fe4e40bb 100644 +--- a/src/timer/timer_hw.c ++++ b/src/timer/timer_hw.c +@@ -330,8 +330,6 @@ int _snd_timer_hw_open(snd_timer_t **timer, char *name, + SNDERR("Unexpected field %s", id); + return -EINVAL; + } +- if (card < 0) +- return -EINVAL; + return snd_timer_hw_open(timer, name, dev_class, dev_sclass, card, device, subdevice, mode); + } + SND_DLSYM_BUILD_VERSION(_snd_timer_hw_open, SND_TIMER_DLSYM_VERSION); +-- +2.30.2 + + +From 200d18cda7a700607c21ad5dc9faaea2a1e27dbd Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:51:13 +0200 +Subject: [PATCH 12/18] ucm: fix error path in execute_cfgsave() + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/main.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/ucm/main.c b/src/ucm/main.c +index c9b37b68..42fdaa1d 100644 +--- a/src/ucm/main.c ++++ b/src/ucm/main.c +@@ -605,8 +605,10 @@ static int execute_cfgsave(snd_use_case_mgr_t *uc_mgr, const char *filename) + uc_error("unable to open file '%s': %s", file, snd_strerror(err)); + goto _err; + } +- if (!config || snd_config_is_empty(config)) ++ if (!config || snd_config_is_empty(config)) { ++ snd_output_close(out); + goto _err; ++ } + if (with_root) { + snd_output_printf(out, "%s ", root); + err = _snd_config_save_node_value(config, out, 0); +-- +2.30.2 + + +From 9b71d53bde21c8bb0d900c17863664e12753d844 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:52:12 +0200 +Subject: [PATCH 13/18] ucm: fix use after free in if_eval_regex_match() + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/ucm_cond.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/ucm/ucm_cond.c b/src/ucm/ucm_cond.c +index 59d1a155..adb0ecd9 100644 +--- a/src/ucm/ucm_cond.c ++++ b/src/ucm/ucm_cond.c +@@ -160,11 +160,12 @@ static int if_eval_regex_match(snd_use_case_mgr_t *uc_mgr, snd_config_t *eval) + if (err < 0) + return err; + err = regcomp(&re, s, options); +- free(s); + if (err) { + uc_error("Regex '%s' compilation failed (code %d)", s, err); ++ free(s); + return -EINVAL; + } ++ free(s); + + err = uc_mgr_get_substituted_value(uc_mgr, &s, string); + if (err < 0) { +-- +2.30.2 + + +From 7764e3e621a4c8a52327833d44e32c8b6fe3a131 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:53:24 +0200 +Subject: [PATCH 14/18] ucm: fix if_eval_path() - access NULL pointer + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/ucm_cond.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ucm/ucm_cond.c b/src/ucm/ucm_cond.c +index adb0ecd9..0ed0b690 100644 +--- a/src/ucm/ucm_cond.c ++++ b/src/ucm/ucm_cond.c +@@ -272,7 +272,7 @@ static int if_eval_control_exists(snd_use_case_mgr_t *uc_mgr, snd_config_t *eval + + static int if_eval_path(snd_use_case_mgr_t *uc_mgr, snd_config_t *eval) + { +- const char *path, *mode = NULL; ++ const char *path, *mode = ""; + int err, amode = F_OK; + + if (uc_mgr->conf_format < 4) { +-- +2.30.2 + + +From 7fcb1aadd56e94f03e51c4747e72d77279151c22 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:56:01 +0200 +Subject: [PATCH 15/18] ucm: find_exec() - fix memory leak (dir) + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/ucm_exec.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/ucm/ucm_exec.c b/src/ucm/ucm_exec.c +index a22df8fe..1cdb2633 100644 +--- a/src/ucm/ucm_exec.c ++++ b/src/ucm/ucm_exec.c +@@ -73,6 +73,7 @@ static int find_exec(const char *name, char *out, size_t len) + || !(st.st_mode & S_IEXEC)) + continue; + snd_strlcpy(out, bin, len); ++ closedir(dir); + return 1; + } + closedir(dir); +-- +2.30.2 + + +From 26ab7fc3e4cba416cf51aa0fb48fdddaa0d861ee Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:58:04 +0200 +Subject: [PATCH 16/18] ucm: fix possible NULL pointer dereference in + uc_mgr_exec() + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/ucm_exec.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/ucm/ucm_exec.c b/src/ucm/ucm_exec.c +index 1cdb2633..d83206d0 100644 +--- a/src/ucm/ucm_exec.c ++++ b/src/ucm/ucm_exec.c +@@ -185,7 +185,11 @@ int uc_mgr_exec(const char *prog) + return -EINVAL; + + prog = argv[0]; +- if (argv[0][0] != '/' && argv[0][0] != '.') { ++ if (prog == NULL) { ++ err = -EINVAL; ++ goto __error; ++ } ++ if (prog[0] != '/' && prog[0] != '.') { + if (!find_exec(argv[0], bin, sizeof(bin))) { + err = -ENOEXEC; + goto __error; +-- +2.30.2 + + +From 64a6d4d1e827732bef7c68e1e6d2cb6863b4597c Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 19:59:10 +0200 +Subject: [PATCH 17/18] ucm: check error value in parse_lookup_query() + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/ucm_subs.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/ucm/ucm_subs.c b/src/ucm/ucm_subs.c +index c56730c5..0bc4e63f 100644 +--- a/src/ucm/ucm_subs.c ++++ b/src/ucm/ucm_subs.c +@@ -224,7 +224,11 @@ static snd_config_t *parse_lookup_query(const char *query) + uc_error("unable to create memory input buffer"); + return NULL; + } +- snd_config_top(&config); ++ err = snd_config_top(&config); ++ if (err < 0) { ++ snd_input_close(input); ++ return NULL; ++ } + err = snd_config_load(config, input); + snd_input_close(input); + if (err < 0) { +-- +2.30.2 + + +From 30d1d256e792fbabf14c57efb98c489541b19f37 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Jun 2021 20:01:08 +0200 +Subject: [PATCH 18/18] ucm: fix out-of-array access in + rval_device_lookup_init() + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/ucm_subs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ucm/ucm_subs.c b/src/ucm/ucm_subs.c +index 0bc4e63f..20905c3f 100644 +--- a/src/ucm/ucm_subs.c ++++ b/src/ucm/ucm_subs.c +@@ -489,7 +489,7 @@ static int rval_device_lookup_init(snd_use_case_mgr_t *uc_mgr, + uc_error("Missing device type!"); + return -EINVAL; + } +- for (t = types; t; t++) ++ for (t = types; t->name; t++) + if (strcasecmp(t->name, s) == 0) + return t->init(iter, config); + uc_error("Device type '%s' is invalid", s); +-- +2.30.2 + diff --git a/alsa-lib.spec b/alsa-lib.spec index 2267c37..f25538e 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Wed Jun 2 2021 Jaroslav Kysela - 1.2.5-2 +- add upstream fixes (conf + ucm) + * Mon May 31 2021 Jaroslav Kysela - 1.2.5-1 - update to 1.2.5 diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index e69de29..dedf95f 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -0,0 +1,14 @@ +diff --git a/ucm2/HDA-Intel/HDA-Intel.conf b/ucm2/HDA-Intel/HDA-Intel.conf +index 5794e72..8a8e0e7 100644 +--- a/ucm2/HDA-Intel/HDA-Intel.conf ++++ b/ucm2/HDA-Intel/HDA-Intel.conf +@@ -1,4 +1,4 @@ +-Syntax 3 ++Syntax 4 + + Define.Use "" # a non-empty string to use UCM configuration for HDA devices + +-- +2.30.2 + + From e62f8551303b32bca0e77f932e606a2a81709c8a Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 14 Jun 2021 13:51:54 +0200 Subject: [PATCH 07/68] update to 1.2.5.1 --- alsa-git.patch | 728 -------------------------------------------- alsa-lib.spec | 9 +- alsa-ucm-conf.patch | 14 - sources | 4 +- 4 files changed, 8 insertions(+), 747 deletions(-) diff --git a/alsa-git.patch b/alsa-git.patch index b42c2d2..e69de29 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -1,728 +0,0 @@ -From ddfc32abf5697de1618b9e7ffdf57a0f97013090 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 08:49:32 +0200 -Subject: [PATCH 01/18] conf: fix load_for_all_cards() - -The 63f7745b commit is loading the driver specific configuration -multiple times which ends with the array merges (see the bug). - -Introduce the loaded compound which traces the already loaded -driver configurations and skip the multiple load requests. - -Fixes: https://github.com/alsa-project/alsa-lib/issues/143 -Fixes: 63f7745b ("conf: extend load_for_all_cards hook (id/value table)") -Signed-off-by: Jaroslav Kysela ---- - src/conf.c | 33 ++++++++++++++++++++++++++++----- - 1 file changed, 28 insertions(+), 5 deletions(-) - -diff --git a/src/conf.c b/src/conf.c -index f6c80031..d863dec6 100644 ---- a/src/conf.c -+++ b/src/conf.c -@@ -4325,18 +4325,23 @@ static int _snd_config_hook_table(snd_config_t *root, snd_config_t *config, snd_ - int snd_config_hook_load_for_all_cards(snd_config_t *root, snd_config_t *config, snd_config_t **dst, snd_config_t *private_data ATTRIBUTE_UNUSED) - { - int card = -1, err; -+ snd_config_t *loaded; // trace loaded cards - -+ err = snd_config_top(&loaded); -+ if (err < 0) -+ return err; - do { - err = snd_card_next(&card); - if (err < 0) -- return err; -+ goto __fin_err; - if (card >= 0) { -- snd_config_t *n, *private_data = NULL; -+ snd_config_t *n, *m, *private_data = NULL; - const char *driver; - char *fdriver = NULL; -+ bool load; - err = snd_determine_driver(card, &fdriver); - if (err < 0) -- return err; -+ goto __fin_err; - if (snd_config_search(root, fdriver, &n) >= 0) { - if (snd_config_get_string(n, &driver) < 0) { - if (snd_config_get_type(n) == SND_CONFIG_TYPE_COMPOUND) { -@@ -4357,6 +4362,19 @@ int snd_config_hook_load_for_all_cards(snd_config_t *root, snd_config_t *config, - driver = fdriver; - } - __std: -+ load = true; -+ err = snd_config_imake_integer(&m, driver, 1); -+ if (err < 0) -+ goto __err; -+ err = snd_config_add(loaded, m); -+ if (err < 0) { -+ if (err == -EEXIST) { -+ snd_config_delete(m); -+ load = false; -+ } else { -+ goto __err; -+ } -+ } - private_data = _snd_config_hook_private_data(card, driver); - if (!private_data) { - err = -ENOMEM; -@@ -4365,17 +4383,22 @@ int snd_config_hook_load_for_all_cards(snd_config_t *root, snd_config_t *config, - err = _snd_config_hook_table(root, config, private_data); - if (err < 0) - goto __err; -- err = snd_config_hook_load(root, config, &n, private_data); -+ if (load) -+ err = snd_config_hook_load(root, config, &n, private_data); - __err: - if (private_data) - snd_config_delete(private_data); - free(fdriver); - if (err < 0) -- return err; -+ goto __fin_err; - } - } while (card >= 0); -+ snd_config_delete(loaded); - *dst = NULL; - return 0; -+__fin_err: -+ snd_config_delete(loaded); -+ return err; - } - #ifndef DOC_HIDDEN - SND_DLSYM_BUILD_VERSION(snd_config_hook_load_for_all_cards, SND_CONFIG_DLSYM_VERSION_HOOK); --- -2.30.2 - - -From 0e4ba2ea8c0402f12a645032a14693eb9b1278e6 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 11:09:43 +0200 -Subject: [PATCH 02/18] ucm: add _alibpref to get the private device prefix - -It may be useful to get the device prefix for the local configuration. - -Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1251 -Signed-off-by: Jaroslav Kysela ---- - include/use-case.h | 1 + - src/ucm/main.c | 21 +++++++++++++++++++++ - 2 files changed, 22 insertions(+) - -diff --git a/include/use-case.h b/include/use-case.h -index ec1a97b0..7890358b 100644 ---- a/include/use-case.h -+++ b/include/use-case.h -@@ -258,6 +258,7 @@ int snd_use_case_get_list(snd_use_case_mgr_t *uc_mgr, - * - _verb - return current verb - * - _file - return configuration file loaded for current card - * - _alibcfg - return private alsa-lib's configuration for current card -+ * - _alibpref - return private alsa-lib's configuration device prefix for current card - * - * - [=]{NAME}[/[{modifier}|{/device}][/{verb}]] - * - value identifier {NAME} -diff --git a/src/ucm/main.c b/src/ucm/main.c -index 361952f6..3c9ea15d 100644 ---- a/src/ucm/main.c -+++ b/src/ucm/main.c -@@ -2138,6 +2138,25 @@ static int get_alibcfg(snd_use_case_mgr_t *uc_mgr, char **str) - return 0; - } - -+/** -+ * \brief Get device prefix for private alsa-lib configuration -+ * \param uc_mgr Use case manager -+ * \param str Returned value string -+ * \return Zero on success (value is filled), otherwise a negative error code -+ */ -+static int get_alibpref(snd_use_case_mgr_t *uc_mgr, char **str) -+{ -+ const size_t l = 9; -+ char *s; -+ -+ s = malloc(l); -+ if (s == NULL) -+ return -ENOMEM; -+ snprintf(s, l, "_ucm%04X", uc_mgr->ucm_card_number); -+ *str = s; -+ return 0; -+} -+ - /** - * \brief Get current - string - * \param uc_mgr Use case manager -@@ -2193,6 +2212,8 @@ int snd_use_case_get(snd_use_case_mgr_t *uc_mgr, - - } else if (strcmp(identifier, "_alibcfg") == 0) { - err = get_alibcfg(uc_mgr, (char **)value); -+ } else if (strcmp(identifier, "_alibpref") == 0) { -+ err = get_alibpref(uc_mgr, (char **)value); - } else if (identifier[0] == '_') { - err = -ENOENT; - } else { --- -2.30.2 - - -From 9621d0bff2e60b43e329ffa5059ab19f2914ec14 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 11:21:54 +0200 -Subject: [PATCH 03/18] ucm: fix _alibpref string (add '.' delimiter to the - end) - -Fixes: 0e4ba2ea ("ucm: add _alibpref to get the private device prefix") -Signed-off-by: Jaroslav Kysela ---- - src/ucm/main.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/ucm/main.c b/src/ucm/main.c -index 3c9ea15d..c9b37b68 100644 ---- a/src/ucm/main.c -+++ b/src/ucm/main.c -@@ -2146,13 +2146,13 @@ static int get_alibcfg(snd_use_case_mgr_t *uc_mgr, char **str) - */ - static int get_alibpref(snd_use_case_mgr_t *uc_mgr, char **str) - { -- const size_t l = 9; -+ const size_t l = 10; - char *s; - - s = malloc(l); - if (s == NULL) - return -ENOMEM; -- snprintf(s, l, "_ucm%04X", uc_mgr->ucm_card_number); -+ snprintf(s, l, "_ucm%04X.", uc_mgr->ucm_card_number); - *str = s; - return 0; - } --- -2.30.2 - - -From 2a1dafdbe5932260aeb4db359ce5d630b8106889 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:26:47 +0200 -Subject: [PATCH 04/18] conf: remove dead code in snd_config_get_card() - -Signed-off-by: Jaroslav Kysela ---- - src/confmisc.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/confmisc.c b/src/confmisc.c -index 3663d164..a561040c 100644 ---- a/src/confmisc.c -+++ b/src/confmisc.c -@@ -154,10 +154,10 @@ int snd_config_get_card(const snd_config_t *conf) - long v; - int err; - -- if ((err = snd_config_get_integer(conf, &v)) < 0) { -+ if (snd_config_get_integer(conf, &v) < 0) { - if ((err = snd_config_get_string(conf, &str)) < 0) { -- snd_config_get_id(conf, &id); -- SNDERR("Invalid field %s", id); -+ if (snd_config_get_id(conf, &id) >= 0) -+ SNDERR("Invalid field %s", id); - return -EINVAL; - } - err = snd_card_get_index(str); --- -2.30.2 - - -From 013ec607db9de11b682f2b85d843be062ca0d046 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:28:32 +0200 -Subject: [PATCH 05/18] control: remap - fix uninitialized value in - parse_map_vindex() - -Signed-off-by: Jaroslav Kysela ---- - src/control/control_remap.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/control/control_remap.c b/src/control/control_remap.c -index f3d65010..17c6558a 100644 ---- a/src/control/control_remap.c -+++ b/src/control/control_remap.c -@@ -1040,7 +1040,7 @@ static int parse_map_vindex(struct snd_ctl_map_ctl *mctl, snd_config_t *conf) - - snd_config_for_each(i, next, conf) { - snd_config_t *n = snd_config_iterator_entry(i); -- long idx, chn; -+ long idx = -1, chn = -1; - const char *id; - if (snd_config_get_id(n, &id) < 0) - continue; --- -2.30.2 - - -From 2fee6af9b6e157475159d284af8de1e879bb7a36 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:35:44 +0200 -Subject: [PATCH 06/18] pcm: direct - fix pcmp error path in - _snd_pcm_direct_new() - -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_direct.c | 21 ++++++++++++--------- - 1 file changed, 12 insertions(+), 9 deletions(-) - -diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c -index 0e5e0421..361805bd 100644 ---- a/src/pcm/pcm_direct.c -+++ b/src/pcm/pcm_direct.c -@@ -2126,24 +2126,20 @@ int _snd_pcm_direct_new(snd_pcm_t **pcmp, snd_pcm_direct_t **_dmix, int type, - dmix->type = type; - - ret = snd_pcm_new(pcmp, type, name, stream, mode); -- if (ret < 0) { --_err_nosem: -- free(dmix->bindings); -- free(dmix); -- return ret; -- } -+ if (ret < 0) -+ goto _err_nosem; - - while (1) { - ret = snd_pcm_direct_semaphore_create_or_connect(dmix); - if (ret < 0) { - SNDERR("unable to create IPC semaphore"); -- goto _err_nosem; -+ goto _err_nosem_free; - } - ret = snd_pcm_direct_semaphore_down(dmix, DIRECT_IPC_SEM_CLIENT); - if (ret < 0) { - snd_pcm_direct_semaphore_discard(dmix); - if (--fail_sem_loop <= 0) -- goto _err_nosem; -+ goto _err_nosem_free; - continue; - } - break; -@@ -2153,10 +2149,17 @@ _err_nosem: - if (ret < 0) { - SNDERR("unable to create IPC shm instance"); - snd_pcm_direct_semaphore_up(dmix, DIRECT_IPC_SEM_CLIENT); -- goto _err_nosem; -+ goto _err_nosem_free; - } else { - *_dmix = dmix; - } - -+ return ret; -+_err_nosem_free: -+ snd_pcm_free(*pcmp); -+ *pcmp = NULL; -+_err_nosem: -+ free(dmix->bindings); -+ free(dmix); - return ret; - } --- -2.30.2 - - -From eb95cad4e22a0bf2577f1fa4a3f6fd18caed3362 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:37:53 +0200 -Subject: [PATCH 07/18] pcm: remove extra NULL checks in snd_pcm_dmix_open() - -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_dmix.c | 11 ++++------- - 1 file changed, 4 insertions(+), 7 deletions(-) - -diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c -index 8747450f..608593f1 100644 ---- a/src/pcm/pcm_dmix.c -+++ b/src/pcm/pcm_dmix.c -@@ -998,7 +998,7 @@ int snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name, - snd_config_t *root, snd_config_t *sconf, - snd_pcm_stream_t stream, int mode) - { -- snd_pcm_t *pcm = NULL, *spcm = NULL; -+ snd_pcm_t *pcm, *spcm = NULL; - snd_pcm_direct_t *dmix; - int ret, first_instance; - -@@ -1154,12 +1154,9 @@ int snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name, - } else - snd_pcm_direct_semaphore_up(dmix, DIRECT_IPC_SEM_CLIENT); - _err_nosem: -- if (dmix) { -- free(dmix->bindings); -- free(dmix); -- } -- if (pcm) -- snd_pcm_free(pcm); -+ free(dmix->bindings); -+ free(dmix); -+ snd_pcm_free(pcm); - return ret; - } - --- -2.30.2 - - -From 01a45aec6fcd5a5378a5b5e0ae0f9dacde2068e4 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:39:32 +0200 -Subject: [PATCH 08/18] pcm: remove extra NULL checks in snd_pcm_dsnoop_open() - -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_dsnoop.c | 13 +++++-------- - 1 file changed, 5 insertions(+), 8 deletions(-) - -diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c -index fb1b02c2..2c3b9f43 100644 ---- a/src/pcm/pcm_dsnoop.c -+++ b/src/pcm/pcm_dsnoop.c -@@ -564,8 +564,8 @@ int snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name, - snd_config_t *root, snd_config_t *sconf, - snd_pcm_stream_t stream, int mode) - { -- snd_pcm_t *pcm = NULL, *spcm = NULL; -- snd_pcm_direct_t *dsnoop = NULL; -+ snd_pcm_t *pcm, *spcm = NULL; -+ snd_pcm_direct_t *dsnoop; - int ret, first_instance; - - assert(pcmp); -@@ -708,12 +708,9 @@ int snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name, - snd_pcm_direct_semaphore_up(dsnoop, DIRECT_IPC_SEM_CLIENT); - - _err_nosem: -- if (dsnoop) { -- free(dsnoop->bindings); -- free(dsnoop); -- } -- if (pcm) -- snd_pcm_free(pcm); -+ free(dsnoop->bindings); -+ free(dsnoop); -+ snd_pcm_free(pcm); - return ret; - } - --- -2.30.2 - - -From 74c6382df6cf18b801659d8c5c53407a7ea1f02b Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:46:46 +0200 -Subject: [PATCH 09/18] pcm: remove extra NULL checks in snd_pcm_dshare_open() - -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_dshare.c | 13 +++++-------- - 1 file changed, 5 insertions(+), 8 deletions(-) - -diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c -index 0f5238a6..a918512b 100644 ---- a/src/pcm/pcm_dshare.c -+++ b/src/pcm/pcm_dshare.c -@@ -690,8 +690,8 @@ int snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name, - snd_config_t *root, snd_config_t *sconf, - snd_pcm_stream_t stream, int mode) - { -- snd_pcm_t *pcm = NULL, *spcm = NULL; -- snd_pcm_direct_t *dshare = NULL; -+ snd_pcm_t *pcm, *spcm = NULL; -+ snd_pcm_direct_t *dshare; - int ret, first_instance; - unsigned int chn; - -@@ -851,12 +851,9 @@ int snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name, - } else - snd_pcm_direct_semaphore_up(dshare, DIRECT_IPC_SEM_CLIENT); - _err_nosem: -- if (dshare) { -- free(dshare->bindings); -- free(dshare); -- } -- if (pcm) -- snd_pcm_free(pcm); -+ free(dshare->bindings); -+ free(dshare); -+ snd_pcm_free(pcm); - return ret; - } - --- -2.30.2 - - -From eabadf545c51d4c88c5f359db73726ec3ac653ba Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:49:29 +0200 -Subject: [PATCH 10/18] pcm: softvol - fix early exit in add_tlv_info() - -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_softvol.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/pcm/pcm_softvol.c b/src/pcm/pcm_softvol.c -index e2bdd31a..eea322ca 100644 ---- a/src/pcm/pcm_softvol.c -+++ b/src/pcm/pcm_softvol.c -@@ -711,13 +711,13 @@ static int add_tlv_info(snd_pcm_softvol_t *svol, snd_ctl_elem_info_t *cinfo, - unsigned int *old_tlv, size_t old_tlv_size) - { - unsigned int tlv[4]; -- if (sizeof(tlv) <= old_tlv_size && memcmp(tlv, old_tlv, sizeof(tlv)) == 0) -- return 0; - tlv[SNDRV_CTL_TLVO_TYPE] = SND_CTL_TLVT_DB_SCALE; - tlv[SNDRV_CTL_TLVO_LEN] = 2 * sizeof(int); - tlv[SNDRV_CTL_TLVO_DB_SCALE_MIN] = (int)(svol->min_dB * 100); - tlv[SNDRV_CTL_TLVO_DB_SCALE_MUTE_AND_STEP] = - (int)((svol->max_dB - svol->min_dB) * 100 / svol->max_val); -+ if (sizeof(tlv) <= old_tlv_size && memcmp(tlv, old_tlv, sizeof(tlv)) == 0) -+ return 0; - return snd_ctl_elem_tlv_write(svol->ctl, &cinfo->id, tlv); - } - --- -2.30.2 - - -From cf3846d46053b23006e6a9042b586fc78e81af55 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:50:17 +0200 -Subject: [PATCH 11/18] timer: remove dead code in _snd_timer_hw_open() - ---- - src/timer/timer_hw.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/src/timer/timer_hw.c b/src/timer/timer_hw.c -index cfb77463..fe4e40bb 100644 ---- a/src/timer/timer_hw.c -+++ b/src/timer/timer_hw.c -@@ -330,8 +330,6 @@ int _snd_timer_hw_open(snd_timer_t **timer, char *name, - SNDERR("Unexpected field %s", id); - return -EINVAL; - } -- if (card < 0) -- return -EINVAL; - return snd_timer_hw_open(timer, name, dev_class, dev_sclass, card, device, subdevice, mode); - } - SND_DLSYM_BUILD_VERSION(_snd_timer_hw_open, SND_TIMER_DLSYM_VERSION); --- -2.30.2 - - -From 200d18cda7a700607c21ad5dc9faaea2a1e27dbd Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:51:13 +0200 -Subject: [PATCH 12/18] ucm: fix error path in execute_cfgsave() - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/main.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/ucm/main.c b/src/ucm/main.c -index c9b37b68..42fdaa1d 100644 ---- a/src/ucm/main.c -+++ b/src/ucm/main.c -@@ -605,8 +605,10 @@ static int execute_cfgsave(snd_use_case_mgr_t *uc_mgr, const char *filename) - uc_error("unable to open file '%s': %s", file, snd_strerror(err)); - goto _err; - } -- if (!config || snd_config_is_empty(config)) -+ if (!config || snd_config_is_empty(config)) { -+ snd_output_close(out); - goto _err; -+ } - if (with_root) { - snd_output_printf(out, "%s ", root); - err = _snd_config_save_node_value(config, out, 0); --- -2.30.2 - - -From 9b71d53bde21c8bb0d900c17863664e12753d844 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:52:12 +0200 -Subject: [PATCH 13/18] ucm: fix use after free in if_eval_regex_match() - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/ucm_cond.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/ucm/ucm_cond.c b/src/ucm/ucm_cond.c -index 59d1a155..adb0ecd9 100644 ---- a/src/ucm/ucm_cond.c -+++ b/src/ucm/ucm_cond.c -@@ -160,11 +160,12 @@ static int if_eval_regex_match(snd_use_case_mgr_t *uc_mgr, snd_config_t *eval) - if (err < 0) - return err; - err = regcomp(&re, s, options); -- free(s); - if (err) { - uc_error("Regex '%s' compilation failed (code %d)", s, err); -+ free(s); - return -EINVAL; - } -+ free(s); - - err = uc_mgr_get_substituted_value(uc_mgr, &s, string); - if (err < 0) { --- -2.30.2 - - -From 7764e3e621a4c8a52327833d44e32c8b6fe3a131 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:53:24 +0200 -Subject: [PATCH 14/18] ucm: fix if_eval_path() - access NULL pointer - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/ucm_cond.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/ucm/ucm_cond.c b/src/ucm/ucm_cond.c -index adb0ecd9..0ed0b690 100644 ---- a/src/ucm/ucm_cond.c -+++ b/src/ucm/ucm_cond.c -@@ -272,7 +272,7 @@ static int if_eval_control_exists(snd_use_case_mgr_t *uc_mgr, snd_config_t *eval - - static int if_eval_path(snd_use_case_mgr_t *uc_mgr, snd_config_t *eval) - { -- const char *path, *mode = NULL; -+ const char *path, *mode = ""; - int err, amode = F_OK; - - if (uc_mgr->conf_format < 4) { --- -2.30.2 - - -From 7fcb1aadd56e94f03e51c4747e72d77279151c22 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:56:01 +0200 -Subject: [PATCH 15/18] ucm: find_exec() - fix memory leak (dir) - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/ucm_exec.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/ucm/ucm_exec.c b/src/ucm/ucm_exec.c -index a22df8fe..1cdb2633 100644 ---- a/src/ucm/ucm_exec.c -+++ b/src/ucm/ucm_exec.c -@@ -73,6 +73,7 @@ static int find_exec(const char *name, char *out, size_t len) - || !(st.st_mode & S_IEXEC)) - continue; - snd_strlcpy(out, bin, len); -+ closedir(dir); - return 1; - } - closedir(dir); --- -2.30.2 - - -From 26ab7fc3e4cba416cf51aa0fb48fdddaa0d861ee Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:58:04 +0200 -Subject: [PATCH 16/18] ucm: fix possible NULL pointer dereference in - uc_mgr_exec() - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/ucm_exec.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/ucm/ucm_exec.c b/src/ucm/ucm_exec.c -index 1cdb2633..d83206d0 100644 ---- a/src/ucm/ucm_exec.c -+++ b/src/ucm/ucm_exec.c -@@ -185,7 +185,11 @@ int uc_mgr_exec(const char *prog) - return -EINVAL; - - prog = argv[0]; -- if (argv[0][0] != '/' && argv[0][0] != '.') { -+ if (prog == NULL) { -+ err = -EINVAL; -+ goto __error; -+ } -+ if (prog[0] != '/' && prog[0] != '.') { - if (!find_exec(argv[0], bin, sizeof(bin))) { - err = -ENOEXEC; - goto __error; --- -2.30.2 - - -From 64a6d4d1e827732bef7c68e1e6d2cb6863b4597c Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:59:10 +0200 -Subject: [PATCH 17/18] ucm: check error value in parse_lookup_query() - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/ucm_subs.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/ucm/ucm_subs.c b/src/ucm/ucm_subs.c -index c56730c5..0bc4e63f 100644 ---- a/src/ucm/ucm_subs.c -+++ b/src/ucm/ucm_subs.c -@@ -224,7 +224,11 @@ static snd_config_t *parse_lookup_query(const char *query) - uc_error("unable to create memory input buffer"); - return NULL; - } -- snd_config_top(&config); -+ err = snd_config_top(&config); -+ if (err < 0) { -+ snd_input_close(input); -+ return NULL; -+ } - err = snd_config_load(config, input); - snd_input_close(input); - if (err < 0) { --- -2.30.2 - - -From 30d1d256e792fbabf14c57efb98c489541b19f37 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 20:01:08 +0200 -Subject: [PATCH 18/18] ucm: fix out-of-array access in - rval_device_lookup_init() - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/ucm_subs.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/ucm/ucm_subs.c b/src/ucm/ucm_subs.c -index 0bc4e63f..20905c3f 100644 ---- a/src/ucm/ucm_subs.c -+++ b/src/ucm/ucm_subs.c -@@ -489,7 +489,7 @@ static int rval_device_lookup_init(snd_use_case_mgr_t *uc_mgr, - uc_error("Missing device type!"); - return -EINVAL; - } -- for (t = types; t; t++) -+ for (t = types; t->name; t++) - if (strcasecmp(t->name, s) == 0) - return t->init(iter, config); - uc_error("Device type '%s' is invalid", s); --- -2.30.2 - diff --git a/alsa-lib.spec b/alsa-lib.spec index 619a415..b9cf697 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,14 +2,14 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.5 -%define version_alsa_ucm 1.2.5 +%define version_alsa_lib 1.2.5.1 +%define version_alsa_ucm 1.2.5.1 %define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 2%{?prever_dot}%{?dist} +Release: 1%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Mon Jun 14 2021 Jaroslav Kysela - 1.2.5.1-1 +- update to 1.2.5.1 + * Wed Jun 2 2021 Jaroslav Kysela - 1.2.5-2 - add upstream fixes (conf + ucm) diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index dedf95f..e69de29 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -1,14 +0,0 @@ -diff --git a/ucm2/HDA-Intel/HDA-Intel.conf b/ucm2/HDA-Intel/HDA-Intel.conf -index 5794e72..8a8e0e7 100644 ---- a/ucm2/HDA-Intel/HDA-Intel.conf -+++ b/ucm2/HDA-Intel/HDA-Intel.conf -@@ -1,4 +1,4 @@ --Syntax 3 -+Syntax 4 - - Define.Use "" # a non-empty string to use UCM configuration for HDA devices - --- -2.30.2 - - diff --git a/sources b/sources index b10f9d4..ddf88ed 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.5.tar.bz2) = d9b53484737a3684aac7e08b4b18400aac10fec1a78a8bf9101944bea2c50710bc7355e9bb0012541b067e2d5ee7b1b818bf1bdbffbb2b2d7ad0eb15efe49725 +SHA512 (alsa-lib-1.2.5.1.tar.bz2) = 01998ffa449e925ff552c13aea47f9540903afdc533086067c78dcaba4d239c347180d3d28bb0000e6d19b7779c7249fcc77a30057930ca22d18ba55e163fa1c SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 -SHA512 (alsa-ucm-conf-1.2.5.tar.bz2) = f16e8f04018c65de5e24f2a3eb0b3edff26cbce78cc1820c42c46907c903913c571797b59e803ae36b8ec3136487d0a5aacd034e2a8df3e15ed998b7a70152b7 +SHA512 (alsa-ucm-conf-1.2.5.1.tar.bz2) = 774d6da1a0ee6fb1fcd764c1d4b3eb5812a35508cf27db71f6c82784f125eca207992da9081d25783fecb31e548d8b34124d4b3b3d506e33215b76ea48f71012 From 2e32cc95a0deb6bc06d02c2ff272663fe8e20b27 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 14 Jun 2021 13:51:54 +0200 Subject: [PATCH 08/68] update to 1.2.5.1 --- alsa-git.patch | 728 -------------------------------------------- alsa-lib.spec | 9 +- alsa-ucm-conf.patch | 14 - sources | 4 +- 4 files changed, 8 insertions(+), 747 deletions(-) diff --git a/alsa-git.patch b/alsa-git.patch index b42c2d2..e69de29 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -1,728 +0,0 @@ -From ddfc32abf5697de1618b9e7ffdf57a0f97013090 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 08:49:32 +0200 -Subject: [PATCH 01/18] conf: fix load_for_all_cards() - -The 63f7745b commit is loading the driver specific configuration -multiple times which ends with the array merges (see the bug). - -Introduce the loaded compound which traces the already loaded -driver configurations and skip the multiple load requests. - -Fixes: https://github.com/alsa-project/alsa-lib/issues/143 -Fixes: 63f7745b ("conf: extend load_for_all_cards hook (id/value table)") -Signed-off-by: Jaroslav Kysela ---- - src/conf.c | 33 ++++++++++++++++++++++++++++----- - 1 file changed, 28 insertions(+), 5 deletions(-) - -diff --git a/src/conf.c b/src/conf.c -index f6c80031..d863dec6 100644 ---- a/src/conf.c -+++ b/src/conf.c -@@ -4325,18 +4325,23 @@ static int _snd_config_hook_table(snd_config_t *root, snd_config_t *config, snd_ - int snd_config_hook_load_for_all_cards(snd_config_t *root, snd_config_t *config, snd_config_t **dst, snd_config_t *private_data ATTRIBUTE_UNUSED) - { - int card = -1, err; -+ snd_config_t *loaded; // trace loaded cards - -+ err = snd_config_top(&loaded); -+ if (err < 0) -+ return err; - do { - err = snd_card_next(&card); - if (err < 0) -- return err; -+ goto __fin_err; - if (card >= 0) { -- snd_config_t *n, *private_data = NULL; -+ snd_config_t *n, *m, *private_data = NULL; - const char *driver; - char *fdriver = NULL; -+ bool load; - err = snd_determine_driver(card, &fdriver); - if (err < 0) -- return err; -+ goto __fin_err; - if (snd_config_search(root, fdriver, &n) >= 0) { - if (snd_config_get_string(n, &driver) < 0) { - if (snd_config_get_type(n) == SND_CONFIG_TYPE_COMPOUND) { -@@ -4357,6 +4362,19 @@ int snd_config_hook_load_for_all_cards(snd_config_t *root, snd_config_t *config, - driver = fdriver; - } - __std: -+ load = true; -+ err = snd_config_imake_integer(&m, driver, 1); -+ if (err < 0) -+ goto __err; -+ err = snd_config_add(loaded, m); -+ if (err < 0) { -+ if (err == -EEXIST) { -+ snd_config_delete(m); -+ load = false; -+ } else { -+ goto __err; -+ } -+ } - private_data = _snd_config_hook_private_data(card, driver); - if (!private_data) { - err = -ENOMEM; -@@ -4365,17 +4383,22 @@ int snd_config_hook_load_for_all_cards(snd_config_t *root, snd_config_t *config, - err = _snd_config_hook_table(root, config, private_data); - if (err < 0) - goto __err; -- err = snd_config_hook_load(root, config, &n, private_data); -+ if (load) -+ err = snd_config_hook_load(root, config, &n, private_data); - __err: - if (private_data) - snd_config_delete(private_data); - free(fdriver); - if (err < 0) -- return err; -+ goto __fin_err; - } - } while (card >= 0); -+ snd_config_delete(loaded); - *dst = NULL; - return 0; -+__fin_err: -+ snd_config_delete(loaded); -+ return err; - } - #ifndef DOC_HIDDEN - SND_DLSYM_BUILD_VERSION(snd_config_hook_load_for_all_cards, SND_CONFIG_DLSYM_VERSION_HOOK); --- -2.30.2 - - -From 0e4ba2ea8c0402f12a645032a14693eb9b1278e6 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 11:09:43 +0200 -Subject: [PATCH 02/18] ucm: add _alibpref to get the private device prefix - -It may be useful to get the device prefix for the local configuration. - -Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1251 -Signed-off-by: Jaroslav Kysela ---- - include/use-case.h | 1 + - src/ucm/main.c | 21 +++++++++++++++++++++ - 2 files changed, 22 insertions(+) - -diff --git a/include/use-case.h b/include/use-case.h -index ec1a97b0..7890358b 100644 ---- a/include/use-case.h -+++ b/include/use-case.h -@@ -258,6 +258,7 @@ int snd_use_case_get_list(snd_use_case_mgr_t *uc_mgr, - * - _verb - return current verb - * - _file - return configuration file loaded for current card - * - _alibcfg - return private alsa-lib's configuration for current card -+ * - _alibpref - return private alsa-lib's configuration device prefix for current card - * - * - [=]{NAME}[/[{modifier}|{/device}][/{verb}]] - * - value identifier {NAME} -diff --git a/src/ucm/main.c b/src/ucm/main.c -index 361952f6..3c9ea15d 100644 ---- a/src/ucm/main.c -+++ b/src/ucm/main.c -@@ -2138,6 +2138,25 @@ static int get_alibcfg(snd_use_case_mgr_t *uc_mgr, char **str) - return 0; - } - -+/** -+ * \brief Get device prefix for private alsa-lib configuration -+ * \param uc_mgr Use case manager -+ * \param str Returned value string -+ * \return Zero on success (value is filled), otherwise a negative error code -+ */ -+static int get_alibpref(snd_use_case_mgr_t *uc_mgr, char **str) -+{ -+ const size_t l = 9; -+ char *s; -+ -+ s = malloc(l); -+ if (s == NULL) -+ return -ENOMEM; -+ snprintf(s, l, "_ucm%04X", uc_mgr->ucm_card_number); -+ *str = s; -+ return 0; -+} -+ - /** - * \brief Get current - string - * \param uc_mgr Use case manager -@@ -2193,6 +2212,8 @@ int snd_use_case_get(snd_use_case_mgr_t *uc_mgr, - - } else if (strcmp(identifier, "_alibcfg") == 0) { - err = get_alibcfg(uc_mgr, (char **)value); -+ } else if (strcmp(identifier, "_alibpref") == 0) { -+ err = get_alibpref(uc_mgr, (char **)value); - } else if (identifier[0] == '_') { - err = -ENOENT; - } else { --- -2.30.2 - - -From 9621d0bff2e60b43e329ffa5059ab19f2914ec14 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 11:21:54 +0200 -Subject: [PATCH 03/18] ucm: fix _alibpref string (add '.' delimiter to the - end) - -Fixes: 0e4ba2ea ("ucm: add _alibpref to get the private device prefix") -Signed-off-by: Jaroslav Kysela ---- - src/ucm/main.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/ucm/main.c b/src/ucm/main.c -index 3c9ea15d..c9b37b68 100644 ---- a/src/ucm/main.c -+++ b/src/ucm/main.c -@@ -2146,13 +2146,13 @@ static int get_alibcfg(snd_use_case_mgr_t *uc_mgr, char **str) - */ - static int get_alibpref(snd_use_case_mgr_t *uc_mgr, char **str) - { -- const size_t l = 9; -+ const size_t l = 10; - char *s; - - s = malloc(l); - if (s == NULL) - return -ENOMEM; -- snprintf(s, l, "_ucm%04X", uc_mgr->ucm_card_number); -+ snprintf(s, l, "_ucm%04X.", uc_mgr->ucm_card_number); - *str = s; - return 0; - } --- -2.30.2 - - -From 2a1dafdbe5932260aeb4db359ce5d630b8106889 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:26:47 +0200 -Subject: [PATCH 04/18] conf: remove dead code in snd_config_get_card() - -Signed-off-by: Jaroslav Kysela ---- - src/confmisc.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/confmisc.c b/src/confmisc.c -index 3663d164..a561040c 100644 ---- a/src/confmisc.c -+++ b/src/confmisc.c -@@ -154,10 +154,10 @@ int snd_config_get_card(const snd_config_t *conf) - long v; - int err; - -- if ((err = snd_config_get_integer(conf, &v)) < 0) { -+ if (snd_config_get_integer(conf, &v) < 0) { - if ((err = snd_config_get_string(conf, &str)) < 0) { -- snd_config_get_id(conf, &id); -- SNDERR("Invalid field %s", id); -+ if (snd_config_get_id(conf, &id) >= 0) -+ SNDERR("Invalid field %s", id); - return -EINVAL; - } - err = snd_card_get_index(str); --- -2.30.2 - - -From 013ec607db9de11b682f2b85d843be062ca0d046 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:28:32 +0200 -Subject: [PATCH 05/18] control: remap - fix uninitialized value in - parse_map_vindex() - -Signed-off-by: Jaroslav Kysela ---- - src/control/control_remap.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/control/control_remap.c b/src/control/control_remap.c -index f3d65010..17c6558a 100644 ---- a/src/control/control_remap.c -+++ b/src/control/control_remap.c -@@ -1040,7 +1040,7 @@ static int parse_map_vindex(struct snd_ctl_map_ctl *mctl, snd_config_t *conf) - - snd_config_for_each(i, next, conf) { - snd_config_t *n = snd_config_iterator_entry(i); -- long idx, chn; -+ long idx = -1, chn = -1; - const char *id; - if (snd_config_get_id(n, &id) < 0) - continue; --- -2.30.2 - - -From 2fee6af9b6e157475159d284af8de1e879bb7a36 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:35:44 +0200 -Subject: [PATCH 06/18] pcm: direct - fix pcmp error path in - _snd_pcm_direct_new() - -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_direct.c | 21 ++++++++++++--------- - 1 file changed, 12 insertions(+), 9 deletions(-) - -diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c -index 0e5e0421..361805bd 100644 ---- a/src/pcm/pcm_direct.c -+++ b/src/pcm/pcm_direct.c -@@ -2126,24 +2126,20 @@ int _snd_pcm_direct_new(snd_pcm_t **pcmp, snd_pcm_direct_t **_dmix, int type, - dmix->type = type; - - ret = snd_pcm_new(pcmp, type, name, stream, mode); -- if (ret < 0) { --_err_nosem: -- free(dmix->bindings); -- free(dmix); -- return ret; -- } -+ if (ret < 0) -+ goto _err_nosem; - - while (1) { - ret = snd_pcm_direct_semaphore_create_or_connect(dmix); - if (ret < 0) { - SNDERR("unable to create IPC semaphore"); -- goto _err_nosem; -+ goto _err_nosem_free; - } - ret = snd_pcm_direct_semaphore_down(dmix, DIRECT_IPC_SEM_CLIENT); - if (ret < 0) { - snd_pcm_direct_semaphore_discard(dmix); - if (--fail_sem_loop <= 0) -- goto _err_nosem; -+ goto _err_nosem_free; - continue; - } - break; -@@ -2153,10 +2149,17 @@ _err_nosem: - if (ret < 0) { - SNDERR("unable to create IPC shm instance"); - snd_pcm_direct_semaphore_up(dmix, DIRECT_IPC_SEM_CLIENT); -- goto _err_nosem; -+ goto _err_nosem_free; - } else { - *_dmix = dmix; - } - -+ return ret; -+_err_nosem_free: -+ snd_pcm_free(*pcmp); -+ *pcmp = NULL; -+_err_nosem: -+ free(dmix->bindings); -+ free(dmix); - return ret; - } --- -2.30.2 - - -From eb95cad4e22a0bf2577f1fa4a3f6fd18caed3362 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:37:53 +0200 -Subject: [PATCH 07/18] pcm: remove extra NULL checks in snd_pcm_dmix_open() - -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_dmix.c | 11 ++++------- - 1 file changed, 4 insertions(+), 7 deletions(-) - -diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c -index 8747450f..608593f1 100644 ---- a/src/pcm/pcm_dmix.c -+++ b/src/pcm/pcm_dmix.c -@@ -998,7 +998,7 @@ int snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name, - snd_config_t *root, snd_config_t *sconf, - snd_pcm_stream_t stream, int mode) - { -- snd_pcm_t *pcm = NULL, *spcm = NULL; -+ snd_pcm_t *pcm, *spcm = NULL; - snd_pcm_direct_t *dmix; - int ret, first_instance; - -@@ -1154,12 +1154,9 @@ int snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name, - } else - snd_pcm_direct_semaphore_up(dmix, DIRECT_IPC_SEM_CLIENT); - _err_nosem: -- if (dmix) { -- free(dmix->bindings); -- free(dmix); -- } -- if (pcm) -- snd_pcm_free(pcm); -+ free(dmix->bindings); -+ free(dmix); -+ snd_pcm_free(pcm); - return ret; - } - --- -2.30.2 - - -From 01a45aec6fcd5a5378a5b5e0ae0f9dacde2068e4 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:39:32 +0200 -Subject: [PATCH 08/18] pcm: remove extra NULL checks in snd_pcm_dsnoop_open() - -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_dsnoop.c | 13 +++++-------- - 1 file changed, 5 insertions(+), 8 deletions(-) - -diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c -index fb1b02c2..2c3b9f43 100644 ---- a/src/pcm/pcm_dsnoop.c -+++ b/src/pcm/pcm_dsnoop.c -@@ -564,8 +564,8 @@ int snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name, - snd_config_t *root, snd_config_t *sconf, - snd_pcm_stream_t stream, int mode) - { -- snd_pcm_t *pcm = NULL, *spcm = NULL; -- snd_pcm_direct_t *dsnoop = NULL; -+ snd_pcm_t *pcm, *spcm = NULL; -+ snd_pcm_direct_t *dsnoop; - int ret, first_instance; - - assert(pcmp); -@@ -708,12 +708,9 @@ int snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name, - snd_pcm_direct_semaphore_up(dsnoop, DIRECT_IPC_SEM_CLIENT); - - _err_nosem: -- if (dsnoop) { -- free(dsnoop->bindings); -- free(dsnoop); -- } -- if (pcm) -- snd_pcm_free(pcm); -+ free(dsnoop->bindings); -+ free(dsnoop); -+ snd_pcm_free(pcm); - return ret; - } - --- -2.30.2 - - -From 74c6382df6cf18b801659d8c5c53407a7ea1f02b Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:46:46 +0200 -Subject: [PATCH 09/18] pcm: remove extra NULL checks in snd_pcm_dshare_open() - -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_dshare.c | 13 +++++-------- - 1 file changed, 5 insertions(+), 8 deletions(-) - -diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c -index 0f5238a6..a918512b 100644 ---- a/src/pcm/pcm_dshare.c -+++ b/src/pcm/pcm_dshare.c -@@ -690,8 +690,8 @@ int snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name, - snd_config_t *root, snd_config_t *sconf, - snd_pcm_stream_t stream, int mode) - { -- snd_pcm_t *pcm = NULL, *spcm = NULL; -- snd_pcm_direct_t *dshare = NULL; -+ snd_pcm_t *pcm, *spcm = NULL; -+ snd_pcm_direct_t *dshare; - int ret, first_instance; - unsigned int chn; - -@@ -851,12 +851,9 @@ int snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name, - } else - snd_pcm_direct_semaphore_up(dshare, DIRECT_IPC_SEM_CLIENT); - _err_nosem: -- if (dshare) { -- free(dshare->bindings); -- free(dshare); -- } -- if (pcm) -- snd_pcm_free(pcm); -+ free(dshare->bindings); -+ free(dshare); -+ snd_pcm_free(pcm); - return ret; - } - --- -2.30.2 - - -From eabadf545c51d4c88c5f359db73726ec3ac653ba Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:49:29 +0200 -Subject: [PATCH 10/18] pcm: softvol - fix early exit in add_tlv_info() - -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_softvol.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/pcm/pcm_softvol.c b/src/pcm/pcm_softvol.c -index e2bdd31a..eea322ca 100644 ---- a/src/pcm/pcm_softvol.c -+++ b/src/pcm/pcm_softvol.c -@@ -711,13 +711,13 @@ static int add_tlv_info(snd_pcm_softvol_t *svol, snd_ctl_elem_info_t *cinfo, - unsigned int *old_tlv, size_t old_tlv_size) - { - unsigned int tlv[4]; -- if (sizeof(tlv) <= old_tlv_size && memcmp(tlv, old_tlv, sizeof(tlv)) == 0) -- return 0; - tlv[SNDRV_CTL_TLVO_TYPE] = SND_CTL_TLVT_DB_SCALE; - tlv[SNDRV_CTL_TLVO_LEN] = 2 * sizeof(int); - tlv[SNDRV_CTL_TLVO_DB_SCALE_MIN] = (int)(svol->min_dB * 100); - tlv[SNDRV_CTL_TLVO_DB_SCALE_MUTE_AND_STEP] = - (int)((svol->max_dB - svol->min_dB) * 100 / svol->max_val); -+ if (sizeof(tlv) <= old_tlv_size && memcmp(tlv, old_tlv, sizeof(tlv)) == 0) -+ return 0; - return snd_ctl_elem_tlv_write(svol->ctl, &cinfo->id, tlv); - } - --- -2.30.2 - - -From cf3846d46053b23006e6a9042b586fc78e81af55 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:50:17 +0200 -Subject: [PATCH 11/18] timer: remove dead code in _snd_timer_hw_open() - ---- - src/timer/timer_hw.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/src/timer/timer_hw.c b/src/timer/timer_hw.c -index cfb77463..fe4e40bb 100644 ---- a/src/timer/timer_hw.c -+++ b/src/timer/timer_hw.c -@@ -330,8 +330,6 @@ int _snd_timer_hw_open(snd_timer_t **timer, char *name, - SNDERR("Unexpected field %s", id); - return -EINVAL; - } -- if (card < 0) -- return -EINVAL; - return snd_timer_hw_open(timer, name, dev_class, dev_sclass, card, device, subdevice, mode); - } - SND_DLSYM_BUILD_VERSION(_snd_timer_hw_open, SND_TIMER_DLSYM_VERSION); --- -2.30.2 - - -From 200d18cda7a700607c21ad5dc9faaea2a1e27dbd Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:51:13 +0200 -Subject: [PATCH 12/18] ucm: fix error path in execute_cfgsave() - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/main.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/ucm/main.c b/src/ucm/main.c -index c9b37b68..42fdaa1d 100644 ---- a/src/ucm/main.c -+++ b/src/ucm/main.c -@@ -605,8 +605,10 @@ static int execute_cfgsave(snd_use_case_mgr_t *uc_mgr, const char *filename) - uc_error("unable to open file '%s': %s", file, snd_strerror(err)); - goto _err; - } -- if (!config || snd_config_is_empty(config)) -+ if (!config || snd_config_is_empty(config)) { -+ snd_output_close(out); - goto _err; -+ } - if (with_root) { - snd_output_printf(out, "%s ", root); - err = _snd_config_save_node_value(config, out, 0); --- -2.30.2 - - -From 9b71d53bde21c8bb0d900c17863664e12753d844 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:52:12 +0200 -Subject: [PATCH 13/18] ucm: fix use after free in if_eval_regex_match() - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/ucm_cond.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/ucm/ucm_cond.c b/src/ucm/ucm_cond.c -index 59d1a155..adb0ecd9 100644 ---- a/src/ucm/ucm_cond.c -+++ b/src/ucm/ucm_cond.c -@@ -160,11 +160,12 @@ static int if_eval_regex_match(snd_use_case_mgr_t *uc_mgr, snd_config_t *eval) - if (err < 0) - return err; - err = regcomp(&re, s, options); -- free(s); - if (err) { - uc_error("Regex '%s' compilation failed (code %d)", s, err); -+ free(s); - return -EINVAL; - } -+ free(s); - - err = uc_mgr_get_substituted_value(uc_mgr, &s, string); - if (err < 0) { --- -2.30.2 - - -From 7764e3e621a4c8a52327833d44e32c8b6fe3a131 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:53:24 +0200 -Subject: [PATCH 14/18] ucm: fix if_eval_path() - access NULL pointer - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/ucm_cond.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/ucm/ucm_cond.c b/src/ucm/ucm_cond.c -index adb0ecd9..0ed0b690 100644 ---- a/src/ucm/ucm_cond.c -+++ b/src/ucm/ucm_cond.c -@@ -272,7 +272,7 @@ static int if_eval_control_exists(snd_use_case_mgr_t *uc_mgr, snd_config_t *eval - - static int if_eval_path(snd_use_case_mgr_t *uc_mgr, snd_config_t *eval) - { -- const char *path, *mode = NULL; -+ const char *path, *mode = ""; - int err, amode = F_OK; - - if (uc_mgr->conf_format < 4) { --- -2.30.2 - - -From 7fcb1aadd56e94f03e51c4747e72d77279151c22 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:56:01 +0200 -Subject: [PATCH 15/18] ucm: find_exec() - fix memory leak (dir) - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/ucm_exec.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/ucm/ucm_exec.c b/src/ucm/ucm_exec.c -index a22df8fe..1cdb2633 100644 ---- a/src/ucm/ucm_exec.c -+++ b/src/ucm/ucm_exec.c -@@ -73,6 +73,7 @@ static int find_exec(const char *name, char *out, size_t len) - || !(st.st_mode & S_IEXEC)) - continue; - snd_strlcpy(out, bin, len); -+ closedir(dir); - return 1; - } - closedir(dir); --- -2.30.2 - - -From 26ab7fc3e4cba416cf51aa0fb48fdddaa0d861ee Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:58:04 +0200 -Subject: [PATCH 16/18] ucm: fix possible NULL pointer dereference in - uc_mgr_exec() - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/ucm_exec.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/ucm/ucm_exec.c b/src/ucm/ucm_exec.c -index 1cdb2633..d83206d0 100644 ---- a/src/ucm/ucm_exec.c -+++ b/src/ucm/ucm_exec.c -@@ -185,7 +185,11 @@ int uc_mgr_exec(const char *prog) - return -EINVAL; - - prog = argv[0]; -- if (argv[0][0] != '/' && argv[0][0] != '.') { -+ if (prog == NULL) { -+ err = -EINVAL; -+ goto __error; -+ } -+ if (prog[0] != '/' && prog[0] != '.') { - if (!find_exec(argv[0], bin, sizeof(bin))) { - err = -ENOEXEC; - goto __error; --- -2.30.2 - - -From 64a6d4d1e827732bef7c68e1e6d2cb6863b4597c Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 19:59:10 +0200 -Subject: [PATCH 17/18] ucm: check error value in parse_lookup_query() - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/ucm_subs.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/ucm/ucm_subs.c b/src/ucm/ucm_subs.c -index c56730c5..0bc4e63f 100644 ---- a/src/ucm/ucm_subs.c -+++ b/src/ucm/ucm_subs.c -@@ -224,7 +224,11 @@ static snd_config_t *parse_lookup_query(const char *query) - uc_error("unable to create memory input buffer"); - return NULL; - } -- snd_config_top(&config); -+ err = snd_config_top(&config); -+ if (err < 0) { -+ snd_input_close(input); -+ return NULL; -+ } - err = snd_config_load(config, input); - snd_input_close(input); - if (err < 0) { --- -2.30.2 - - -From 30d1d256e792fbabf14c57efb98c489541b19f37 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Jun 2021 20:01:08 +0200 -Subject: [PATCH 18/18] ucm: fix out-of-array access in - rval_device_lookup_init() - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/ucm_subs.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/ucm/ucm_subs.c b/src/ucm/ucm_subs.c -index 0bc4e63f..20905c3f 100644 ---- a/src/ucm/ucm_subs.c -+++ b/src/ucm/ucm_subs.c -@@ -489,7 +489,7 @@ static int rval_device_lookup_init(snd_use_case_mgr_t *uc_mgr, - uc_error("Missing device type!"); - return -EINVAL; - } -- for (t = types; t; t++) -+ for (t = types; t->name; t++) - if (strcasecmp(t->name, s) == 0) - return t->init(iter, config); - uc_error("Device type '%s' is invalid", s); --- -2.30.2 - diff --git a/alsa-lib.spec b/alsa-lib.spec index f25538e..d923688 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,14 +2,14 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.5 -%define version_alsa_ucm 1.2.5 +%define version_alsa_lib 1.2.5.1 +%define version_alsa_ucm 1.2.5.1 %define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 2%{?prever_dot}%{?dist} +Release: 1%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Mon Jun 14 2021 Jaroslav Kysela - 1.2.5.1-1 +- update to 1.2.5.1 + * Wed Jun 2 2021 Jaroslav Kysela - 1.2.5-2 - add upstream fixes (conf + ucm) diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index dedf95f..e69de29 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -1,14 +0,0 @@ -diff --git a/ucm2/HDA-Intel/HDA-Intel.conf b/ucm2/HDA-Intel/HDA-Intel.conf -index 5794e72..8a8e0e7 100644 ---- a/ucm2/HDA-Intel/HDA-Intel.conf -+++ b/ucm2/HDA-Intel/HDA-Intel.conf -@@ -1,4 +1,4 @@ --Syntax 3 -+Syntax 4 - - Define.Use "" # a non-empty string to use UCM configuration for HDA devices - --- -2.30.2 - - diff --git a/sources b/sources index b10f9d4..ddf88ed 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.5.tar.bz2) = d9b53484737a3684aac7e08b4b18400aac10fec1a78a8bf9101944bea2c50710bc7355e9bb0012541b067e2d5ee7b1b818bf1bdbffbb2b2d7ad0eb15efe49725 +SHA512 (alsa-lib-1.2.5.1.tar.bz2) = 01998ffa449e925ff552c13aea47f9540903afdc533086067c78dcaba4d239c347180d3d28bb0000e6d19b7779c7249fcc77a30057930ca22d18ba55e163fa1c SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 -SHA512 (alsa-ucm-conf-1.2.5.tar.bz2) = f16e8f04018c65de5e24f2a3eb0b3edff26cbce78cc1820c42c46907c903913c571797b59e803ae36b8ec3136487d0a5aacd034e2a8df3e15ed998b7a70152b7 +SHA512 (alsa-ucm-conf-1.2.5.1.tar.bz2) = 774d6da1a0ee6fb1fcd764c1d4b3eb5812a35508cf27db71f6c82784f125eca207992da9081d25783fecb31e548d8b34124d4b3b3d506e33215b76ea48f71012 From 4dbf7080feacb807144b89d44fdefc2f1abb6299 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 21 Jul 2021 12:32:47 +0000 Subject: [PATCH 09/68] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering From 3f83c1ca47d8d2d55bb472b9b98572a115972b5b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 21 Jul 2021 17:28:11 +0000 Subject: [PATCH 10/68] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- alsa-lib.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index b9cf697..eff5b83 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Wed Jul 21 2021 Fedora Release Engineering - 1.2.5.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Mon Jun 14 2021 Jaroslav Kysela - 1.2.5.1-1 - update to 1.2.5.1 From e42bd8613d169034a53f5277d0bcfc9179c08e94 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 31 Aug 2021 09:55:42 +0200 Subject: [PATCH 11/68] ucm fixes for 1.2.5.1 --- alsa-git.patch | 1916 ++++++++++++++++++++++++++++++++++++++++++++++++ alsa-lib.spec | 5 +- 2 files changed, 1920 insertions(+), 1 deletion(-) diff --git a/alsa-git.patch b/alsa-git.patch index e69de29..f88de1b 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -0,0 +1,1916 @@ +From 81e7923fbfad45b2f353a4d6e3053af51f5f7d0b Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 15 Jun 2021 23:21:42 +0200 +Subject: [PATCH 01/20] control: empty - fix the static build + +Reported-by: Jan Palus +Fixes: https://github.com/alsa-project/alsa-lib/issues/157 +Signed-off-by: Jaroslav Kysela +--- + src/control/control_empty.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/control/control_empty.c b/src/control/control_empty.c +index 49d1026c..c9b048c1 100644 +--- a/src/control/control_empty.c ++++ b/src/control/control_empty.c +@@ -30,7 +30,7 @@ + + #ifndef PIC + /* entry for static linking */ +-const char *_snd_module_ctl_empty = ""; ++const char *_snd_module_control_empty = ""; + #endif + + /*! \page control_plugins +-- +2.31.1 + + +From 5089358aa99d698bd846b05c1890a09613d740b3 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 17 Jun 2021 10:20:25 +0200 +Subject: [PATCH 02/20] pcm: rate: Refactoring temporary buffer allocations + +Introduce common helpers to allocate and release the temporary buffers +and the associated snd_pcm_channel. Now two allocated objects are +used instead of one malloc to be split. + +Also, change the snd_pcm_channel set up to be in interleaved mode. +This will be necessary in the following change in the rate plugin. + +Signed-off-by: Takashi Iwai +--- + src/pcm/pcm_rate.c | 80 ++++++++++++++++++++++++++++------------------ + 1 file changed, 49 insertions(+), 31 deletions(-) + +diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c +index 770aafea..1e996134 100644 +--- a/src/pcm/pcm_rate.c ++++ b/src/pcm/pcm_rate.c +@@ -76,6 +76,45 @@ struct _snd_pcm_rate { + + #endif /* DOC_HIDDEN */ + ++/* allocate a channel area and a temporary buffer for the given size */ ++static snd_pcm_channel_area_t * ++rate_alloc_tmp_buf(snd_pcm_rate_t *rate, snd_pcm_format_t format, ++ unsigned int channels, unsigned int frames) ++{ ++ snd_pcm_channel_area_t *ap; ++ int width = snd_pcm_format_physical_width(format); ++ int i; ++ ++ ap = malloc(sizeof(*ap) * channels); ++ if (!ap) ++ return NULL; ++ ap->addr = malloc(frames * channels * width / 8); ++ if (!ap->addr) { ++ free(ap); ++ return NULL; ++ } ++ ++ /* set up in interleaved format */ ++ for (i = 0; i < channels; i++) { ++ ap[i].addr = ap[0].addr + (i * width) / 8; ++ ap[i].first = 0; ++ ap[i].step = width * channels; ++ } ++ ++ return ap; ++} ++ ++static void rate_free_tmp_buf(snd_pcm_channel_area_t **ptr) ++{ ++ snd_pcm_channel_area_t *c = *ptr; ++ ++ if (c) { ++ free(c->addr); ++ free(c); ++ *ptr = NULL; ++ } ++} ++ + static int snd_pcm_rate_hw_refine_cprepare(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_hw_params_t *params) + { + snd_pcm_rate_t *rate = pcm->private_data; +@@ -286,28 +325,13 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + if (err < 0) + return err; + +- rate->pareas = malloc(2 * channels * sizeof(*rate->pareas)); +- if (rate->pareas == NULL) ++ rate->pareas = rate_alloc_tmp_buf(rate, cinfo->format, channels, ++ cinfo->period_size); ++ rate->sareas = rate_alloc_tmp_buf(rate, sinfo->format, channels, ++ sinfo->period_size); ++ if (!rate->pareas || !rate->sareas) + goto error; + +- cwidth = snd_pcm_format_physical_width(cinfo->format); +- swidth = snd_pcm_format_physical_width(sinfo->format); +- rate->pareas[0].addr = malloc(((cwidth * channels * cinfo->period_size) / 8) + +- ((swidth * channels * sinfo->period_size) / 8)); +- if (rate->pareas[0].addr == NULL) +- goto error; +- +- rate->sareas = rate->pareas + channels; +- rate->sareas[0].addr = (char *)rate->pareas[0].addr + ((cwidth * channels * cinfo->period_size) / 8); +- for (chn = 0; chn < channels; chn++) { +- rate->pareas[chn].addr = (char *)rate->pareas[0].addr + (cwidth * chn * cinfo->period_size) / 8; +- rate->pareas[chn].first = 0; +- rate->pareas[chn].step = cwidth; +- rate->sareas[chn].addr = (char *)rate->sareas[0].addr + (swidth * chn * sinfo->period_size) / 8; +- rate->sareas[chn].first = 0; +- rate->sareas[chn].step = swidth; +- } +- + if (rate->ops.convert_s16) { + rate->get_idx = snd_pcm_linear_get_index(rate->info.in.format, SND_PCM_FORMAT_S16); + rate->put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S16, rate->info.out.format); +@@ -322,11 +346,8 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + return 0; + + error: +- if (rate->pareas) { +- free(rate->pareas[0].addr); +- free(rate->pareas); +- rate->pareas = NULL; +- } ++ rate_free_tmp_buf(&rate->pareas); ++ rate_free_tmp_buf(&rate->sareas); + if (rate->ops.free) + rate->ops.free(rate->obj); + return -ENOMEM; +@@ -335,12 +356,9 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + static int snd_pcm_rate_hw_free(snd_pcm_t *pcm) + { + snd_pcm_rate_t *rate = pcm->private_data; +- if (rate->pareas) { +- free(rate->pareas[0].addr); +- free(rate->pareas); +- rate->pareas = NULL; +- rate->sareas = NULL; +- } ++ ++ rate_free_tmp_buf(&rate->pareas); ++ rate_free_tmp_buf(&rate->sareas); + if (rate->ops.free) + rate->ops.free(rate->obj); + free(rate->src_buf); +-- +2.31.1 + + +From 119d9c1678b1193f8b969a6483cae1f7bf95e609 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 17 Jun 2021 10:03:17 +0200 +Subject: [PATCH 03/20] pcm: rate: Improve the support multiple formats + +This patch extends the PCM rate plugin for allowing its converter +plugin to deal with multiple formats. Currently, the converter plugin +is allowed to take different formats only when convert callback is +defined. And for this way (so far only the standard linear rate +plugin does), all linear formats have to be handled, and it's +cumbersome. + +OTOH, most other rate plugins are implemented with convert_s16 +callback, which accepts only S16 format. This is often not ideal +because many converter engines can handle 32bit formats. Also, the +target format is often 32bit format, hence this would require +additional conversion even if the converter engine can output 32bit +natively. + +In this patch, for addressing the problems above, the rate plugin API +is extended in the following way: + +- The new get_supported_formats callback is added; this stores the bit + masks of the supported input and output formats, as well as the + behavior flags. Currently only linear formats are allowed. +- When the plugin accepts only the interleaved stream, set + SND_PCM_RATE_FLAG_INTERLEAVED flag bit. Otherwise the code has to + handle snd_pcm_channel_area at each call. +- When both input and output formats have to be identical, pass + SND_PCM_RATE_FLAG_SYNC_FORMATS flag bit. +- When the converter wants to process different formats, use convert + callback instead of convert_s16. You can put both in the ops for + compatibility, too. + The input and output formats are found in the info argument of init + callback. +- Now the PCM rate plugin core will skip the temporary buffer + allocation and conversions for pre- and post-process if not needed + (i.e. matching with the requested input or output format). + +The rate plugin API version is bumped to 0x010003. + +Signed-off-by: Takashi Iwai +--- + include/pcm_rate.h | 36 ++++- + src/pcm/pcm_rate.c | 358 +++++++++++++++++++++++++++------------------ + 2 files changed, 251 insertions(+), 143 deletions(-) + +diff --git a/include/pcm_rate.h b/include/pcm_rate.h +index 4171fb9d..48473ed4 100644 +--- a/include/pcm_rate.h ++++ b/include/pcm_rate.h +@@ -38,7 +38,7 @@ extern "C" { + /** + * Protocol version + */ +-#define SND_PCM_RATE_PLUGIN_VERSION 0x010002 ++#define SND_PCM_RATE_PLUGIN_VERSION 0x010003 + + /** hw_params information for a single side */ + typedef struct snd_pcm_rate_side_info { +@@ -55,6 +55,11 @@ typedef struct snd_pcm_rate_info { + unsigned int channels; + } snd_pcm_rate_info_t; + ++enum { ++ SND_PCM_RATE_FLAG_INTERLEAVED = (1U << 0), /** only interleaved format */ ++ SND_PCM_RATE_FLAG_SYNC_FORMATS = (1U << 1), /** both input and output formats have to be identical */ ++}; ++ + /** Callback table of rate-converter */ + typedef struct snd_pcm_rate_ops { + /** +@@ -114,6 +119,13 @@ typedef struct snd_pcm_rate_ops { + * new ops since version 0x010002 + */ + void (*dump)(void *obj, snd_output_t *out); ++ /** ++ * get the supported input and output formats (optional); ++ * new ops since version 0x010003 ++ */ ++ int (*get_supported_formats)(void *obj, uint64_t *in_formats, ++ uint64_t *out_formats, ++ unsigned int *flags); + } snd_pcm_rate_ops_t; + + /** open function type */ +@@ -147,6 +159,28 @@ typedef struct snd_pcm_rate_old_ops { + snd_pcm_uframes_t (*input_frames)(void *obj, snd_pcm_uframes_t frames); + snd_pcm_uframes_t (*output_frames)(void *obj, snd_pcm_uframes_t frames); + } snd_pcm_rate_old_ops_t; ++ ++/* old rate_ops for protocol version 0x010002 */ ++typedef struct snd_pcm_rate_v2_ops { ++ void (*close)(void *obj); ++ int (*init)(void *obj, snd_pcm_rate_info_t *info); ++ void (*free)(void *obj); ++ void (*reset)(void *obj); ++ int (*adjust_pitch)(void *obj, snd_pcm_rate_info_t *info); ++ void (*convert)(void *obj, ++ const snd_pcm_channel_area_t *dst_areas, ++ snd_pcm_uframes_t dst_offset, unsigned int dst_frames, ++ const snd_pcm_channel_area_t *src_areas, ++ snd_pcm_uframes_t src_offset, unsigned int src_frames); ++ void (*convert_s16)(void *obj, int16_t *dst, unsigned int dst_frames, ++ const int16_t *src, unsigned int src_frames); ++ snd_pcm_uframes_t (*input_frames)(void *obj, snd_pcm_uframes_t frames); ++ snd_pcm_uframes_t (*output_frames)(void *obj, snd_pcm_uframes_t frames); ++ unsigned int version; ++ int (*get_supported_rates)(void *obj, unsigned int *rate_min, ++ unsigned int *rate_max); ++ void (*dump)(void *obj, snd_output_t *out); ++} snd_pcm_rate_v2_ops_t; + #endif + + #ifdef __cplusplus +diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c +index 1e996134..13111d29 100644 +--- a/src/pcm/pcm_rate.c ++++ b/src/pcm/pcm_rate.c +@@ -62,18 +62,22 @@ struct _snd_pcm_rate { + void *open_func; + void *obj; + snd_pcm_rate_ops_t ops; +- unsigned int get_idx; +- unsigned int put_idx; +- int16_t *src_buf; +- int16_t *dst_buf; ++ unsigned int src_conv_idx; ++ unsigned int dst_conv_idx; ++ snd_pcm_channel_area_t *src_buf; ++ snd_pcm_channel_area_t *dst_buf; + int start_pending; /* start is triggered but not commited to slave */ + snd_htimestamp_t trigger_tstamp; + unsigned int plugin_version; + unsigned int rate_min, rate_max; ++ snd_pcm_format_t orig_in_format; ++ snd_pcm_format_t orig_out_format; ++ uint64_t in_formats; ++ uint64_t out_formats; ++ unsigned int format_flags; + }; + + #define SND_PCM_RATE_PLUGIN_VERSION_OLD 0x010001 /* old rate plugin */ +- + #endif /* DOC_HIDDEN */ + + /* allocate a channel area and a temporary buffer for the given size */ +@@ -274,12 +278,84 @@ static int snd_pcm_rate_hw_refine(snd_pcm_t *pcm, + snd_pcm_generic_hw_refine); + } + ++/* evaluate the best matching available format to the given format */ ++static int get_best_format(uint64_t mask, snd_pcm_format_t orig) ++{ ++ int pwidth = snd_pcm_format_physical_width(orig); ++ int width = snd_pcm_format_width(orig); ++ int signd = snd_pcm_format_signed(orig); ++ int best_score = -1; ++ int match = -1; ++ int f, score; ++ ++ for (f = 0; f <= SND_PCM_FORMAT_LAST; f++) { ++ if (!(mask & (1ULL << f))) ++ continue; ++ score = 0; ++ if (snd_pcm_format_linear(f)) { ++ if (snd_pcm_format_physical_width(f) == pwidth) ++ score++; ++ if (snd_pcm_format_physical_width(f) >= pwidth) ++ score++; ++ if (snd_pcm_format_width(f) == width) ++ score++; ++ if (snd_pcm_format_signed(f) == signd) ++ score++; ++ } ++ if (score > best_score) { ++ match = f; ++ best_score = score; ++ } ++ } ++ ++ return match; ++} ++ ++/* set up the input and output formats from the available lists */ ++static int choose_preferred_format(snd_pcm_rate_t *rate) ++{ ++ uint64_t in_mask = rate->in_formats; ++ uint64_t out_mask = rate->out_formats; ++ int in, out; ++ ++ if (!in_mask || !out_mask) ++ return 0; ++ ++ if (rate->orig_in_format == rate->orig_out_format) ++ if (in_mask & out_mask & (1ULL << rate->orig_in_format)) ++ return 0; /* nothing changed */ ++ ++ repeat: ++ in = get_best_format(in_mask, rate->orig_in_format); ++ out = get_best_format(out_mask, rate->orig_out_format); ++ if (in < 0 || out < 0) ++ return -ENOENT; ++ ++ if ((rate->format_flags & SND_PCM_RATE_FLAG_SYNC_FORMATS) && ++ in != out) { ++ if (out_mask & (1ULL << in)) ++ out = in; ++ else if (in_mask & (1ULL << out)) ++ in = out; ++ else { ++ in_mask &= ~(1ULL << in); ++ out_mask &= ~(1ULL << out); ++ goto repeat; ++ } ++ } ++ ++ rate->info.in.format = in; ++ rate->info.out.format = out; ++ return 0; ++} ++ + static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + { + snd_pcm_rate_t *rate = pcm->private_data; + snd_pcm_t *slave = rate->gen.slave; + snd_pcm_rate_side_info_t *sinfo, *cinfo; +- unsigned int channels, cwidth, swidth, chn; ++ unsigned int channels, cwidth, swidth, chn, acc; ++ int need_src_buf, need_dst_buf; + int err = snd_pcm_hw_params_slave(pcm, params, + snd_pcm_rate_hw_refine_cchange, + snd_pcm_rate_hw_refine_sprepare, +@@ -308,6 +384,9 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + if (err < 0) + return err; + err = INTERNAL(snd_pcm_hw_params_get_channels)(params, &channels); ++ if (err < 0) ++ return err; ++ err = INTERNAL(snd_pcm_hw_params_get_access)(params, &acc); + if (err < 0) + return err; + +@@ -321,36 +400,80 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + SNDMSG("rate plugin already in use"); + return -EBUSY; + } +- err = rate->ops.init(rate->obj, &rate->info); +- if (err < 0) +- return err; + + rate->pareas = rate_alloc_tmp_buf(rate, cinfo->format, channels, + cinfo->period_size); + rate->sareas = rate_alloc_tmp_buf(rate, sinfo->format, channels, + sinfo->period_size); +- if (!rate->pareas || !rate->sareas) +- goto error; +- +- if (rate->ops.convert_s16) { +- rate->get_idx = snd_pcm_linear_get_index(rate->info.in.format, SND_PCM_FORMAT_S16); +- rate->put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S16, rate->info.out.format); +- free(rate->src_buf); +- rate->src_buf = malloc(channels * rate->info.in.period_size * 2); +- free(rate->dst_buf); +- rate->dst_buf = malloc(channels * rate->info.out.period_size * 2); +- if (! rate->src_buf || ! rate->dst_buf) ++ if (!rate->pareas || !rate->sareas) { ++ err = -ENOMEM; ++ goto error_pareas; ++ } ++ ++ rate->orig_in_format = rate->info.in.format; ++ rate->orig_out_format = rate->info.out.format; ++ if (choose_preferred_format(rate) < 0) { ++ SNDERR("No matching format in rate plugin"); ++ err = -EINVAL; ++ goto error_pareas; ++ } ++ ++ err = rate->ops.init(rate->obj, &rate->info); ++ if (err < 0) ++ goto error_init; ++ ++ rate_free_tmp_buf(&rate->src_buf); ++ rate_free_tmp_buf(&rate->dst_buf); ++ ++ need_src_buf = need_dst_buf = 0; ++ ++ if ((rate->format_flags & SND_PCM_RATE_FLAG_INTERLEAVED) && ++ !(acc == SND_PCM_ACCESS_MMAP_INTERLEAVED || ++ acc == SND_PCM_ACCESS_RW_INTERLEAVED)) { ++ need_src_buf = need_dst_buf = 1; ++ } else { ++ if (rate->orig_in_format != rate->info.in.format) ++ need_src_buf = 1; ++ if (rate->orig_out_format != rate->info.out.format) ++ need_dst_buf = 1; ++ } ++ ++ if (need_src_buf) { ++ rate->src_conv_idx = ++ snd_pcm_linear_convert_index(rate->orig_in_format, ++ rate->info.in.format); ++ rate->src_buf = rate_alloc_tmp_buf(rate, rate->info.in.format, ++ channels, rate->info.in.period_size); ++ if (!rate->src_buf) { ++ err = -ENOMEM; + goto error; ++ } ++ } ++ ++ if (need_dst_buf) { ++ rate->dst_conv_idx = ++ snd_pcm_linear_convert_index(rate->info.out.format, ++ rate->orig_out_format); ++ rate->dst_buf = rate_alloc_tmp_buf(rate, rate->info.out.format, ++ channels, rate->info.out.period_size); ++ if (!rate->dst_buf) { ++ err = -ENOMEM; ++ goto error; ++ } + } + + return 0; + + error: +- rate_free_tmp_buf(&rate->pareas); +- rate_free_tmp_buf(&rate->sareas); ++ rate_free_tmp_buf(&rate->src_buf); ++ rate_free_tmp_buf(&rate->dst_buf); ++ error_init: + if (rate->ops.free) + rate->ops.free(rate->obj); +- return -ENOMEM; ++ error_pareas: ++ rate_free_tmp_buf(&rate->pareas); ++ rate_free_tmp_buf(&rate->sareas); ++ return err; + } + + static int snd_pcm_rate_hw_free(snd_pcm_t *pcm) +@@ -361,9 +484,8 @@ static int snd_pcm_rate_hw_free(snd_pcm_t *pcm) + rate_free_tmp_buf(&rate->sareas); + if (rate->ops.free) + rate->ops.free(rate->obj); +- free(rate->src_buf); +- free(rate->dst_buf); +- rate->src_buf = rate->dst_buf = NULL; ++ rate_free_tmp_buf(&rate->src_buf); ++ rate_free_tmp_buf(&rate->dst_buf); + return snd_pcm_hw_free(rate->gen.slave); + } + +@@ -444,82 +566,6 @@ static int snd_pcm_rate_init(snd_pcm_t *pcm) + return 0; + } + +-static void convert_to_s16(snd_pcm_rate_t *rate, int16_t *buf, +- const snd_pcm_channel_area_t *areas, +- snd_pcm_uframes_t offset, unsigned int frames, +- unsigned int channels) +-{ +-#ifndef DOC_HIDDEN +-#define GET16_LABELS +-#include "plugin_ops.h" +-#undef GET16_LABELS +-#endif /* DOC_HIDDEN */ +- void *get = get16_labels[rate->get_idx]; +- const char *src; +- int16_t sample; +- const char *srcs[channels]; +- int src_step[channels]; +- unsigned int c; +- +- for (c = 0; c < channels; c++) { +- srcs[c] = snd_pcm_channel_area_addr(areas + c, offset); +- src_step[c] = snd_pcm_channel_area_step(areas + c); +- } +- +- while (frames--) { +- for (c = 0; c < channels; c++) { +- src = srcs[c]; +- goto *get; +-#ifndef DOC_HIDDEN +-#define GET16_END after_get +-#include "plugin_ops.h" +-#undef GET16_END +-#endif /* DOC_HIDDEN */ +- after_get: +- *buf++ = sample; +- srcs[c] += src_step[c]; +- } +- } +-} +- +-static void convert_from_s16(snd_pcm_rate_t *rate, const int16_t *buf, +- const snd_pcm_channel_area_t *areas, +- snd_pcm_uframes_t offset, unsigned int frames, +- unsigned int channels) +-{ +-#ifndef DOC_HIDDEN +-#define PUT16_LABELS +-#include "plugin_ops.h" +-#undef PUT16_LABELS +-#endif /* DOC_HIDDEN */ +- void *put = put16_labels[rate->put_idx]; +- char *dst; +- int16_t sample; +- char *dsts[channels]; +- int dst_step[channels]; +- unsigned int c; +- +- for (c = 0; c < channels; c++) { +- dsts[c] = snd_pcm_channel_area_addr(areas + c, offset); +- dst_step[c] = snd_pcm_channel_area_step(areas + c); +- } +- +- while (frames--) { +- for (c = 0; c < channels; c++) { +- dst = dsts[c]; +- sample = *buf++; +- goto *put; +-#ifndef DOC_HIDDEN +-#define PUT16_END after_put +-#include "plugin_ops.h" +-#undef PUT16_END +-#endif /* DOC_HIDDEN */ +- after_put: +- dsts[c] += dst_step[c]; +- } +- } +-} +- + static void do_convert(const snd_pcm_channel_area_t *dst_areas, + snd_pcm_uframes_t dst_offset, unsigned int dst_frames, + const snd_pcm_channel_area_t *src_areas, +@@ -527,28 +573,40 @@ static void do_convert(const snd_pcm_channel_area_t *dst_areas, + unsigned int channels, + snd_pcm_rate_t *rate) + { +- if (rate->ops.convert_s16) { +- const int16_t *src; +- int16_t *dst; +- if (! rate->src_buf) +- src = (int16_t *)src_areas->addr + src_offset * channels; +- else { +- convert_to_s16(rate, rate->src_buf, src_areas, src_offset, +- src_frames, channels); +- src = rate->src_buf; +- } +- if (! rate->dst_buf) +- dst = (int16_t *)dst_areas->addr + dst_offset * channels; +- else +- dst = rate->dst_buf; +- rate->ops.convert_s16(rate->obj, dst, dst_frames, src, src_frames); +- if (dst == rate->dst_buf) +- convert_from_s16(rate, rate->dst_buf, dst_areas, dst_offset, +- dst_frames, channels); ++ const snd_pcm_channel_area_t *out_areas; ++ snd_pcm_uframes_t out_offset; ++ ++ if (rate->dst_buf) { ++ out_areas = rate->dst_buf; ++ out_offset = 0; + } else { +- rate->ops.convert(rate->obj, dst_areas, dst_offset, dst_frames, +- src_areas, src_offset, src_frames); ++ out_areas = dst_areas; ++ out_offset = dst_offset; ++ } ++ ++ if (rate->src_buf) { ++ snd_pcm_linear_convert(rate->src_buf, 0, ++ src_areas, src_offset, ++ channels, src_frames, ++ rate->src_conv_idx); ++ src_areas = rate->src_buf; ++ src_offset = 0; + } ++ ++ if (rate->ops.convert) ++ rate->ops.convert(rate->obj, out_areas, out_offset, dst_frames, ++ src_areas, src_offset, src_frames); ++ else ++ rate->ops.convert_s16(rate->obj, ++ snd_pcm_channel_area_addr(out_areas, out_offset), ++ dst_frames, ++ snd_pcm_channel_area_addr(src_areas, src_offset), ++ src_frames); ++ if (rate->dst_buf) ++ snd_pcm_linear_convert(dst_areas, dst_offset, ++ rate->dst_buf, 0, ++ channels, dst_frames, ++ rate->dst_conv_idx); + } + + static inline void +@@ -1276,6 +1334,30 @@ const snd_config_t *snd_pcm_rate_get_default_converter(snd_config_t *root) + return NULL; + } + ++static void rate_initial_setup(snd_pcm_rate_t *rate) ++{ ++ if (rate->plugin_version == SND_PCM_RATE_PLUGIN_VERSION) ++ rate->plugin_version = rate->ops.version; ++ ++ if (rate->plugin_version >= 0x010002 && ++ rate->ops.get_supported_rates) ++ rate->ops.get_supported_rates(rate->obj, ++ &rate->rate_min, ++ &rate->rate_max); ++ ++ if (rate->plugin_version >= 0x010003 && ++ rate->ops.get_supported_formats) { ++ rate->ops.get_supported_formats(rate->obj, ++ &rate->in_formats, ++ &rate->out_formats, ++ &rate->format_flags); ++ } else if (!rate->ops.convert && rate->ops.convert_s16) { ++ rate->in_formats = rate->out_formats = ++ 1ULL << SND_PCM_FORMAT_S16; ++ rate->format_flags = SND_PCM_RATE_FLAG_INTERLEAVED; ++ } ++} ++ + #ifdef PIC + static int is_builtin_plugin(const char *type) + { +@@ -1301,20 +1383,11 @@ static int rate_open_func(snd_pcm_rate_t *rate, const char *type, const snd_conf + lib = lib_name; + } + +- rate->rate_min = SND_PCM_PLUGIN_RATE_MIN; +- rate->rate_max = SND_PCM_PLUGIN_RATE_MAX; +- rate->plugin_version = SND_PCM_RATE_PLUGIN_VERSION; +- + open_conf_func = snd_dlobj_cache_get(lib, open_conf_name, NULL, verbose && converter_conf != NULL); + if (open_conf_func) { + err = open_conf_func(SND_PCM_RATE_PLUGIN_VERSION, + &rate->obj, &rate->ops, converter_conf); + if (!err) { +- rate->plugin_version = rate->ops.version; +- if (rate->ops.get_supported_rates) +- rate->ops.get_supported_rates(rate->obj, +- &rate->rate_min, +- &rate->rate_max); + rate->open_func = open_conf_func; + return 0; + } else { +@@ -1330,23 +1403,18 @@ static int rate_open_func(snd_pcm_rate_t *rate, const char *type, const snd_conf + rate->open_func = open_func; + + err = open_func(SND_PCM_RATE_PLUGIN_VERSION, &rate->obj, &rate->ops); +- if (!err) { +- rate->plugin_version = rate->ops.version; +- if (rate->ops.get_supported_rates) +- rate->ops.get_supported_rates(rate->obj, +- &rate->rate_min, +- &rate->rate_max); ++ if (!err) + return 0; +- } + + /* try to open with the old protocol version */ + rate->plugin_version = SND_PCM_RATE_PLUGIN_VERSION_OLD; + err = open_func(SND_PCM_RATE_PLUGIN_VERSION_OLD, + &rate->obj, &rate->ops); +- if (err) { +- snd_dlobj_cache_put(open_func); +- rate->open_func = NULL; +- } ++ if (!err) ++ return 0; ++ ++ snd_dlobj_cache_put(open_func); ++ rate->open_func = NULL; + return err; + } + #endif +@@ -1417,6 +1485,10 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, + rate->srate = srate; + rate->sformat = sformat; + ++ rate->rate_min = SND_PCM_PLUGIN_RATE_MIN; ++ rate->rate_max = SND_PCM_PLUGIN_RATE_MAX; ++ rate->plugin_version = SND_PCM_RATE_PLUGIN_VERSION; ++ + err = snd_pcm_new(&pcm, SND_PCM_TYPE_RATE, name, slave->stream, slave->mode); + if (err < 0) { + free(rate); +@@ -1496,6 +1568,8 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, + return err; + } + ++ rate_initial_setup(rate); ++ + pcm->ops = &snd_pcm_rate_ops; + pcm->fast_ops = &snd_pcm_rate_fast_ops; + pcm->private_data = rate; +-- +2.31.1 + + +From 3f737a2a2c8d20e78dea3ea836997f9d74f602a0 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Fri, 18 Jun 2021 11:35:30 +0200 +Subject: [PATCH 04/20] pcm: improve docs for snd_pcm_sw_params_get_avail_min() + and snd_pcm_status_get_avail_max() + +Fixes: https://github.com/alsa-project/alsa-lib/issues/44 +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c +index 09df0f12..892abf98 100644 +--- a/src/pcm/pcm.c ++++ b/src/pcm/pcm.c +@@ -6500,6 +6500,9 @@ int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, + * \param params Software configuration container + * \param val returned minimum available frames to consider PCM ready + * \return 0 otherwise a negative error code ++ * ++ * This is a threshold value when the PCM stream is considered as ready for ++ * another read/write operation or poll event. + */ + #ifndef DOXYGEN + EXPORT_SYMBOL int INTERNAL(snd_pcm_sw_params_get_avail_min)(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) +@@ -6960,6 +6963,8 @@ snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t *obj) + /** + * \brief Get maximum number of frames available from a PCM status container after last #snd_pcm_status call + * \return Maximum number of frames ready to be read/written ++ * ++ * This value returns the peak for the available frames between #snd_pcm_status calls. + */ + snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t *obj) + { +-- +2.31.1 + + +From 212c6c18c4317af48c007a0866efc029b9c3a593 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 21 Jun 2021 09:23:02 +0200 +Subject: [PATCH 05/20] pcm: dmix - use pcm_frame_diff() in + snd_pcm_dmix_sync_ptr0() + +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_dmix.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c +index 608593f1..0d0d0bff 100644 +--- a/src/pcm/pcm_dmix.c ++++ b/src/pcm/pcm_dmix.c +@@ -393,17 +393,13 @@ static int snd_pcm_dmix_sync_ptr0(snd_pcm_t *pcm, snd_pcm_uframes_t slave_hw_ptr + + old_slave_hw_ptr = dmix->slave_hw_ptr; + dmix->slave_hw_ptr = slave_hw_ptr; +- diff = slave_hw_ptr - old_slave_hw_ptr; ++ diff = pcm_frame_diff(slave_hw_ptr, old_slave_hw_ptr, dmix->slave_boundary); + if (diff == 0) /* fast path */ + return 0; + if (dmix->state != SND_PCM_STATE_RUNNING && + dmix->state != SND_PCM_STATE_DRAINING) + /* not really started yet - don't update hw_ptr */ + return 0; +- if (diff < 0) { +- slave_hw_ptr += dmix->slave_boundary; +- diff = slave_hw_ptr - old_slave_hw_ptr; +- } + dmix->hw_ptr += diff; + dmix->hw_ptr %= pcm->boundary; + if (pcm->stop_threshold >= pcm->boundary) /* don't care */ +-- +2.31.1 + + +From dd609ef9684987d3ca61d5c5cc3c77589ff9c29f Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 21 Jun 2021 09:28:41 +0200 +Subject: [PATCH 06/20] pcm: direct plugins - fix hw_ptr in the status callback + +The parent hw_ptr may be in another range (boundary limit). +Set the correct value for the caller. + +BugLink: https://github.com/alsa-project/alsa-lib/issues/155 +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_dmix.c | 1 + + src/pcm/pcm_dshare.c | 1 + + src/pcm/pcm_dsnoop.c | 1 + + 3 files changed, 3 insertions(+) + +diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c +index 0d0d0bff..94dbb1e0 100644 +--- a/src/pcm/pcm_dmix.c ++++ b/src/pcm/pcm_dmix.c +@@ -491,6 +491,7 @@ static int snd_pcm_dmix_status(snd_pcm_t *pcm, snd_pcm_status_t * status) + } + + status->state = snd_pcm_dmix_state(pcm); ++ status->hw_ptr = *pcm->hw.ptr; /* boundary may be different */ + status->appl_ptr = *pcm->appl.ptr; /* slave PCM doesn't set appl_ptr */ + status->trigger_tstamp = dmix->trigger_tstamp; + status->avail = snd_pcm_mmap_playback_avail(pcm); +diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c +index a918512b..01814dc8 100644 +--- a/src/pcm/pcm_dshare.c ++++ b/src/pcm/pcm_dshare.c +@@ -243,6 +243,7 @@ static int snd_pcm_dshare_status(snd_pcm_t *pcm, snd_pcm_status_t * status) + break; + } + status->state = snd_pcm_dshare_state(pcm); ++ status->hw_ptr = *pcm->hw.ptr; /* boundary may be different */ + status->appl_ptr = *pcm->appl.ptr; /* slave PCM doesn't set appl_ptr */ + status->trigger_tstamp = dshare->trigger_tstamp; + status->avail = snd_pcm_mmap_playback_avail(pcm); +diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c +index 2c3b9f43..3f28df99 100644 +--- a/src/pcm/pcm_dsnoop.c ++++ b/src/pcm/pcm_dsnoop.c +@@ -193,6 +193,7 @@ static int snd_pcm_dsnoop_status(snd_pcm_t *pcm, snd_pcm_status_t * status) + snd_pcm_status(dsnoop->spcm, status); + state = snd_pcm_state(dsnoop->spcm); + status->state = state == SND_PCM_STATE_RUNNING ? dsnoop->state : state; ++ status->hw_ptr = *pcm->hw.ptr; /* boundary may be different */ + status->appl_ptr = *pcm->appl.ptr; /* slave PCM doesn't set appl_ptr */ + status->trigger_tstamp = dsnoop->trigger_tstamp; + status->avail = snd_pcm_mmap_capture_avail(pcm); +-- +2.31.1 + + +From a5e11f9a810391777ea7750f04ba66f9c9e624de Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 21 Jun 2021 14:21:26 +0200 +Subject: [PATCH 07/20] pcm: Move snd_pcm_channel_area_addr() and _step() to + public header + +Used in the rate plugins commonly. + +Signed-off-by: Takashi Iwai +--- + include/pcm.h | 23 +++++++++++++++++++++++ + src/pcm/pcm_local.h | 13 ------------- + 2 files changed, 23 insertions(+), 13 deletions(-) + +diff --git a/include/pcm.h b/include/pcm.h +index e300b951..b5a514fa 100644 +--- a/include/pcm.h ++++ b/include/pcm.h +@@ -1173,6 +1173,29 @@ int snd_pcm_areas_copy_wrap(const snd_pcm_channel_area_t *dst_channels, + snd_pcm_uframes_t frames, + const snd_pcm_format_t format); + ++/** ++ * \brief get the address of the given PCM channel area ++ * \param area PCM channel area ++ * \param offset Offset in frames ++ * ++ * Returns the pointer corresponding to the given offset on the channel area. ++ */ ++static inline void *snd_pcm_channel_area_addr(const snd_pcm_channel_area_t *area, snd_pcm_uframes_t offset) ++{ ++ return (char *)area->addr + (area->first + area->step * offset) / 8; ++} ++ ++/** ++ * \brief get the step size of the given PCM channel area in bytes ++ * \param area PCM channel area ++ * ++ * Returns the step size in bytes from the given channel area. ++ */ ++static inline unsigned int snd_pcm_channel_area_step(const snd_pcm_channel_area_t *area) ++{ ++ return area->step / 8; ++} ++ + /** \} */ + + /** +diff --git a/src/pcm/pcm_local.h b/src/pcm/pcm_local.h +index a63f4be0..6f03365c 100644 +--- a/src/pcm/pcm_local.h ++++ b/src/pcm/pcm_local.h +@@ -632,19 +632,6 @@ static inline snd_pcm_sframes_t snd_pcm_mmap_delay(snd_pcm_t *pcm) + return snd_pcm_mmap_capture_delay(pcm); + } + +-static inline void *snd_pcm_channel_area_addr(const snd_pcm_channel_area_t *area, snd_pcm_uframes_t offset) +-{ +- unsigned int bitofs = area->first + area->step * offset; +- assert(bitofs % 8 == 0); +- return (char *) area->addr + bitofs / 8; +-} +- +-static inline unsigned int snd_pcm_channel_area_step(const snd_pcm_channel_area_t *area) +-{ +- assert(area->step % 8 == 0); +- return area->step / 8; +-} +- + static inline snd_pcm_sframes_t _snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size) + { + /* lock handled in the callback */ +-- +2.31.1 + + +From e0e084659083c2ab75d5c894f24227ea2f67010f Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 21 Jun 2021 15:14:18 +0200 +Subject: [PATCH 08/20] pcm: direct plugins - fix bad memory access when + channel bindings do not match hw + +Fix and cleanup snd_pcm_direct_check_interleave() function. +Add requested / hardware channel check and use goto when the interleaved + +Fixes: https://github.com/alsa-project/alsa-lib/issues/117 +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_direct.c | 40 +++++++++++++++++----------------------- + 1 file changed, 17 insertions(+), 23 deletions(-) + +diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c +index d50503e3..90417b2f 100644 +--- a/src/pcm/pcm_direct.c ++++ b/src/pcm/pcm_direct.c +@@ -1627,43 +1627,37 @@ int snd_pcm_direct_set_timer_params(snd_pcm_direct_t *dmix) + int snd_pcm_direct_check_interleave(snd_pcm_direct_t *dmix, snd_pcm_t *pcm) + { + unsigned int chn, channels; +- int bits, interleaved = 1; ++ int bits; + const snd_pcm_channel_area_t *dst_areas; + const snd_pcm_channel_area_t *src_areas; + + bits = snd_pcm_format_physical_width(pcm->format); + if ((bits % 8) != 0) +- interleaved = 0; ++ goto __nointerleaved; + channels = dmix->channels; ++ if (channels != dmix->spcm->channels) ++ goto __nointerleaved; + dst_areas = snd_pcm_mmap_areas(dmix->spcm); + src_areas = snd_pcm_mmap_areas(pcm); + for (chn = 1; chn < channels; chn++) { +- if (dst_areas[chn-1].addr != dst_areas[chn].addr) { +- interleaved = 0; +- break; +- } +- if (src_areas[chn-1].addr != src_areas[chn].addr) { +- interleaved = 0; +- break; +- } ++ if (dst_areas[chn-1].addr != dst_areas[chn].addr) ++ goto __nointerleaved; ++ if (src_areas[chn-1].addr != src_areas[chn].addr) ++ goto __nointerleaved; + } + for (chn = 0; chn < channels; chn++) { +- if (dmix->bindings && dmix->bindings[chn] != chn) { +- interleaved = 0; +- break; +- } ++ if (dmix->bindings && dmix->bindings[chn] != chn) ++ goto __nointerleaved; + if (dst_areas[chn].first != chn * bits || +- dst_areas[chn].step != channels * bits) { +- interleaved = 0; +- break; +- } ++ dst_areas[chn].step != channels * bits) ++ goto __nointerleaved; + if (src_areas[chn].first != chn * bits || +- src_areas[chn].step != channels * bits) { +- interleaved = 0; +- break; +- } ++ src_areas[chn].step != channels * bits) ++ goto __nointerleaved; + } +- return dmix->interleaved = interleaved; ++ return dmix->interleaved = 1; ++__nointerleaved: ++ return dmix->interleaved = 0; + } + + /* +-- +2.31.1 + + +From ccc14ae897d170156f1c2905ea5d18a3295e7b36 Mon Sep 17 00:00:00 2001 +From: "Tanjeff-N. Moos" +Date: Thu, 17 Jun 2021 10:36:38 +0200 +Subject: [PATCH 09/20] control: Add documentation for snd_ctl_card_* and + friends. + +In this patch series, I added a description about control interface +handling and how control interfaces are identified. + +In addition, I added/improved Doxygen documentation for the +snd_ctl_card_info_t type and related corresponding functions, +e.g. snd_ctl_card_info(). I also documented other card-related like +snd_card_next(). + +Along the way I did minor documentation improvements. + +Signed-off-by: Tanjeff-N. Moos +Signed-off-by: Takashi Iwai +--- + include/control.h | 40 +++++++++- + src/control/cards.c | 56 +++++++++----- + src/control/control.c | 175 +++++++++++++++++++++++++++++++----------- + 3 files changed, 202 insertions(+), 69 deletions(-) + +diff --git a/include/control.h b/include/control.h +index ccf906e2..9ebb4905 100644 +--- a/include/control.h ++++ b/include/control.h +@@ -50,7 +50,32 @@ typedef struct snd_aes_iec958 { + unsigned char dig_subframe[4]; /**< AES/IEC958 subframe bits */ + } snd_aes_iec958_t; + +-/** CTL card info container */ ++/** \brief CTL card info container. ++ * ++ * This type contains meta information about a sound card, such as the index, ++ * name, longname, etc. ++ * ++ * \par Memory management ++ * ++ * Before using a snd_ctl_card_info_t object, it must be allocated using ++ * snd_ctl_card_info_alloca() or snd_ctl_card_info_malloc(). When using the ++ * latter, it must be freed again using snd_ctl_card_info_free(). ++ * ++ * A card info object can be zeroed out using snd_ctl_card_info_clear(). ++ * ++ * A card info object can be copied to another one using ++ * snd_ctl_card_info_copy(). ++ * ++ * \par Obtaining the Information ++ * ++ * To obtain the card information, it must first be opened using ++ * snd_ctl_open(), and a snd_ctl_card_info_t container must be ++ * allocated. Then, the information can be read using ++ * snd_ctl_card_info_get_card(). ++ * ++ * Thereafter, the card properties can be read using the ++ * snd_ctl_card_info_get_*() functions. ++ */ + typedef struct _snd_ctl_card_info snd_ctl_card_info_t; + + /** CTL element identifier container */ +@@ -442,11 +467,20 @@ void snd_ctl_elem_id_set_name(snd_ctl_elem_id_t *obj, const char *val); + void snd_ctl_elem_id_set_index(snd_ctl_elem_id_t *obj, unsigned int val); + + size_t snd_ctl_card_info_sizeof(void); ++ + /** \hideinitializer +- * \brief allocate an invalid #snd_ctl_card_info_t using standard alloca +- * \param ptr returned pointer ++ * \brief Allocate an invalid #snd_ctl_card_info_t on the stack. ++ * ++ * Allocate space for a card info object on the stack. The allocated ++ * memory need not be freed, because it is on the stack. ++ * ++ * See snd_ctl_card_info_t for details. ++ * ++ * \param ptr Pointer to a snd_ctl_elem_value_t pointer. The address ++ * of the allocated space will returned here. + */ + #define snd_ctl_card_info_alloca(ptr) __snd_alloca(ptr, snd_ctl_card_info) ++ + int snd_ctl_card_info_malloc(snd_ctl_card_info_t **ptr); + void snd_ctl_card_info_free(snd_ctl_card_info_t *obj); + void snd_ctl_card_info_clear(snd_ctl_card_info_t *obj); +diff --git a/src/control/cards.c b/src/control/cards.c +index e57457c2..8226c42d 100644 +--- a/src/control/cards.c ++++ b/src/control/cards.c +@@ -77,8 +77,8 @@ static int snd_card_load1(int card) + + /** + * \brief Try to load the driver for a card. +- * \param card Card number. +- * \return 1 if driver is present, zero if driver is not present ++ * \param card Card index. ++ * \return 1 if driver is present, zero if driver is not present. + */ + int snd_card_load(int card) + { +@@ -86,14 +86,24 @@ int snd_card_load(int card) + } + + /** +- * \brief Try to determine the next card. +- * \param rcard pointer to card number +- * \result zero if success, otherwise a negative error code ++ * \brief Iterate over physical sound cards. ++ * ++ * This function takes the index of a physical sound card and sets it to the ++ * index of the next card. If index is -1, it is set to the index of the first ++ * card. After the last card, the index is set to -1. ++ * ++ * For example, if you have 2 sound cards (with index 0 and 1), the index will ++ * be modified as follows: ++ * ++ * - -1 --> 0 ++ * - 0 --> 1 ++ * - 1 --> -1 ++ * ++ * This does not work for virtual sound cards. + * +- * Tries to determine the next card from given card number. +- * If card number is -1, then the first available card is +- * returned. If the result card number is -1, no more cards +- * are available. ++ * \param rcard Index of current card. The index of the next card is stored ++ * here. ++ * \result zero if success, otherwise a negative error code. + */ + int snd_card_next(int *rcard) + { +@@ -114,13 +124,18 @@ int snd_card_next(int *rcard) + } + + /** +- * \brief Convert card string to an integer value. +- * \param string String containing card identifier +- * \return zero if success, otherwise a negative error code ++ * \brief Convert a card string to the card index. + * +- * The accepted format is an integer value in ASCII representation +- * or the card identifier (the id parameter for sound-card drivers). +- * The control device name like /dev/snd/controlC0 is accepted, too. ++ * This works only for physical sound cards, not for virtual cards. ++ * ++ * \param string A string identifying the card. ++ * \return The index of the card. On error, a a negative error code ++ * is returned. ++ * ++ * The accepted formats for "string" are: ++ * - The index of the card (as listed in /proc/asound/cards), given as string ++ * - The ID of the card (as listed in /proc/asound/cards) ++ * - The control device name (like /dev/snd/controlC0) + */ + int snd_card_get_index(const char *string) + { +@@ -163,8 +178,9 @@ int snd_card_get_index(const char *string) + + /** + * \brief Obtain the card name. +- * \param card Card number +- * \param name Result - card name corresponding to card number ++ * ++ * \param card The index of the card. ++ * \param name Result - card name corresponding to card index. + * \result zero if success, otherwise a negative error code + * + * The value returned in name is allocated with strdup and should be +@@ -193,9 +209,9 @@ int snd_card_get_name(int card, char **name) + + /** + * \brief Obtain the card long name. +- * \param card Card number +- * \param name Result - card long name corresponding to card number +- * \result zero if success, otherwise a negative error code ++ * \param card Index of the card. ++ * \param name Result - card long name corresponding to card index. ++ * \result Zero if success, otherwise a negative error code. + * + * The value returned in name is allocated with strdup and should be + * freed when no longer used. +diff --git a/src/control/control.c b/src/control/control.c +index ed986e54..7cf4decb 100644 +--- a/src/control/control.c ++++ b/src/control/control.c +@@ -33,8 +33,50 @@ +

Control interface is designed to access primitive controls. There is + also an interface for notifying about control and structure changes. + ++ + \section control_general_overview General overview + ++In Alsa, there are physical sound cards, such as USB headsets, and ++virtual sound cards, such as "pulse", which represents the PulseAudio ++Sound system. Each sound card offers a control interface, making its ++settings (e.g. volume knobs) available. The complete list of available ++control interfaces can be obtained using snd_device_name_hint(), ++giving -1 as card index and "ctl" as interface type. Each returned ++NAME hint identifies a control interface. ++ ++Sound cards have an ID (a string), an index (an int, sometimes called ++the "card number"), a name, a longname, a mixername and a "components" ++property. The file /proc/asound/cards lists most of these properties ++for physical sound cards. Virtual sound cards are not listed in that ++file. The format is: ++ ++\verbatim ++index [ID ] Driver - name ++ longname ++\endverbatim ++ ++Note that the mixername and components are not listed. ++ ++ ++\subsection control_cards_id Identifying and Opening Control Interfaces ++ ++To work with a control interface, is must be opened first, using ++snd_ctl_open(). This function takes the interface name. ++ ++For physical sound cards, the control interface can be identified ++using the string "hw:" (e.g. `hw:2`). The NAME hint - which is ++"hw:CARD=" - can also be used. Further, its device file (something ++like `/dev/snd/controlC0`) is also acceptable. Either of them can be ++given to snd_ctl_open(). ++ ++For virtual sound cards, the NAME hint is given to snd_ctl_open(). ++ ++The functions snd_card_get_index(), snd_card_get_name() and ++snd_card_get_longname() can be used to find an identifying property ++when another one is already known. ++ ++\section control_elements Elements ++ + In ALSA control feature, each sound card can have control elements. The elements + are managed according to below model. + +@@ -65,7 +107,7 @@ are managed according to below model. + of userspace applications and drivers in kernel. + + +-\section identifying_elements Identifying Elements ++\subsection identifying_elements Identifying Elements + + Each element has the following identifying properties: + +@@ -84,7 +126,7 @@ but in practice this is rare). The numid can change on each boot. + In case of an USB sound card, the numid can also change when it + is reconnected. The short numid is used to reduce the lookup time. + +-\section element_lists Element Lists ++\subsection element_lists Element Lists + + An element list can be used to obtain a list of all elements of the + sound card. The list contains generic information (e.g. how many +@@ -93,7 +135,7 @@ elements the card has), and the identifying properties of the elements + element lists. + + +-\section working_with_elements Working with Elements ++\subsection working_with_elements Working with Elements + + It is possible to obtain information about an element using the + snd_ctl_elem_info_*() functions. For enums, the allowed values can be +@@ -108,7 +150,7 @@ actual values or settings. It is also possible to get and set the ID + values (such as the numid or the name). + + +-\section element_sets Element Sets ++\subsection element_sets Element Sets + + The type of element set is one of integer, integer64, boolean, enumerators, + bytes and IEC958 structure. This indicates the type of value for each member in +@@ -329,10 +371,15 @@ int snd_ctl_subscribe_events(snd_ctl_t *ctl, int subscribe) + + + /** +- * \brief Get card related information +- * \param ctl CTL handle +- * \param info Card info pointer +- * \return 0 on success otherwise a negative error code ++ * \brief Get information about the sound card. ++ * ++ * Obtain information about the sound card previously opened using ++ * snd_ctl_open(). The object "info" must be allocated prior to calling this ++ * function. See snd_ctl_card_info_t for details. ++ * ++ * \param ctl The CTL handle. ++ * \param info The card information is stored here. ++ * \return 0 on success, otherwise a negative error code. + */ + int snd_ctl_card_info(snd_ctl_t *ctl, snd_ctl_card_info_t *info) + { +@@ -1508,11 +1555,13 @@ int _snd_ctl_open_named_child(snd_ctl_t **pctl, const char *name, + #endif + + /** +- * \brief Opens a CTL +- * \param ctlp Returned CTL handle +- * \param name ASCII identifier of the CTL handle +- * \param mode Open mode (see #SND_CTL_NONBLOCK, #SND_CTL_ASYNC) +- * \return 0 on success otherwise a negative error code ++ * \brief Opens a sound card. ++ * ++ * \param ctlp Returned CTL handle. ++ * \param name A string identifying the card (See \ref control_cards_id). ++ * \param mode Open mode (see #SND_CTL_NONBLOCK, #SND_CTL_ASYNC). ++ * ++ * \return 0 on success otherwise a negative error code. + */ + int snd_ctl_open(snd_ctl_t **ctlp, const char *name, int mode) + { +@@ -2027,8 +2076,8 @@ void snd_ctl_elem_id_set_index(snd_ctl_elem_id_t *obj, unsigned int val) + } + + /** +- * \brief get size of #snd_ctl_card_info_t +- * \return size in bytes ++ * \brief get size of #snd_ctl_card_info_t. ++ * \return Size in bytes. + */ + size_t snd_ctl_card_info_sizeof() + { +@@ -2036,9 +2085,16 @@ size_t snd_ctl_card_info_sizeof() + } + + /** +- * \brief allocate an invalid #snd_ctl_card_info_t using standard malloc +- * \param ptr returned pointer +- * \return 0 on success otherwise negative error code ++ * \brief Allocate an invalid #snd_ctl_card_info_t on the heap. ++ * ++ * Allocate space for a card info object on the heap. The allocated memory ++ * must be freed using snd_ctl_card_info_free(). ++ * ++ * See snd_ctl_card_info_t for details. ++ * ++ * \param ptr Pointer to a snd_ctl_card_info_t pointer. The address ++ * of the allocated space will be returned here. ++ * \return 0 on success, otherwise a negative error code. + */ + int snd_ctl_card_info_malloc(snd_ctl_card_info_t **ptr) + { +@@ -2050,8 +2106,10 @@ int snd_ctl_card_info_malloc(snd_ctl_card_info_t **ptr) + } + + /** +- * \brief frees a previously allocated #snd_ctl_card_info_t +- * \param obj pointer to object to free ++ * \brief Free an #snd_ctl_card_info_t previously allocated using ++ * snd_ctl_card_info_malloc(). ++ * ++ * \param obj Pointer to the snd_ctl_card_info_t. + */ + void snd_ctl_card_info_free(snd_ctl_card_info_t *obj) + { +@@ -2059,8 +2117,11 @@ void snd_ctl_card_info_free(snd_ctl_card_info_t *obj) + } + + /** +- * \brief clear given #snd_ctl_card_info_t object +- * \param obj pointer to object to clear ++ * \brief Clear given card info object. ++ * ++ * See snd_ctl_elem_value_t for details. ++ * ++ * \param obj Card info object. + */ + void snd_ctl_card_info_clear(snd_ctl_card_info_t *obj) + { +@@ -2068,9 +2129,10 @@ void snd_ctl_card_info_clear(snd_ctl_card_info_t *obj) + } + + /** +- * \brief copy one #snd_ctl_card_info_t to another +- * \param dst pointer to destination +- * \param src pointer to source ++ * \brief Bitwise copy of a #snd_ctl_card_info_t object. ++ * ++ * \param dst Pointer to destination. ++ * \param src Pointer to source. + */ + void snd_ctl_card_info_copy(snd_ctl_card_info_t *dst, const snd_ctl_card_info_t *src) + { +@@ -2079,9 +2141,12 @@ void snd_ctl_card_info_copy(snd_ctl_card_info_t *dst, const snd_ctl_card_info_t + } + + /** +- * \brief Get card number from a CTL card info +- * \param obj CTL card info +- * \return card number ++ * \brief Get the sound card index from the given info object. ++ * ++ * See snd_ctl_card_info_t for more details. ++ * ++ * \param obj The card info object. ++ * \return Sound card index. + */ + int snd_ctl_card_info_get_card(const snd_ctl_card_info_t *obj) + { +@@ -2090,9 +2155,12 @@ int snd_ctl_card_info_get_card(const snd_ctl_card_info_t *obj) + } + + /** +- * \brief Get card identifier from a CTL card info +- * \param obj CTL card info +- * \return card identifier ++ * \brief Get the sound card ID from the given info object. ++ * ++ * See snd_ctl_card_info_t for more details. ++ * ++ * \param obj The card info object. ++ * \return Sound card ID. + */ + const char *snd_ctl_card_info_get_id(const snd_ctl_card_info_t *obj) + { +@@ -2101,9 +2169,12 @@ const char *snd_ctl_card_info_get_id(const snd_ctl_card_info_t *obj) + } + + /** +- * \brief Get card driver name from a CTL card info +- * \param obj CTL card info +- * \return card driver name ++ * \brief Get the sound card driver from the given info object. ++ * ++ * See snd_ctl_card_info_t for more details. ++ * ++ * \param obj The card info object. ++ * \return The sound card driver. + */ + const char *snd_ctl_card_info_get_driver(const snd_ctl_card_info_t *obj) + { +@@ -2112,9 +2183,12 @@ const char *snd_ctl_card_info_get_driver(const snd_ctl_card_info_t *obj) + } + + /** +- * \brief Get card name from a CTL card info +- * \param obj CTL card info +- * \return card name ++ * \brief Get the sound card name from the given info object. ++ * ++ * See snd_ctl_card_info_t for more details. ++ * ++ * \param obj The card info object. ++ * \return Sound card name. + */ + const char *snd_ctl_card_info_get_name(const snd_ctl_card_info_t *obj) + { +@@ -2123,9 +2197,12 @@ const char *snd_ctl_card_info_get_name(const snd_ctl_card_info_t *obj) + } + + /** +- * \brief Get card long name from a CTL card info +- * \param obj CTL card info +- * \return card long name ++ * \brief Get the sound cards long name from the given info object. ++ * ++ * See snd_ctl_card_info_t for more details. ++ * ++ * \param obj The card info object. ++ * \return Sound cards long name. + */ + const char *snd_ctl_card_info_get_longname(const snd_ctl_card_info_t *obj) + { +@@ -2134,9 +2211,12 @@ const char *snd_ctl_card_info_get_longname(const snd_ctl_card_info_t *obj) + } + + /** +- * \brief Get card mixer name from a CTL card info +- * \param obj CTL card info +- * \return card mixer name ++ * \brief Get the sound card mixer name from the given info object. ++ * ++ * See snd_ctl_card_info_t for more details. ++ * ++ * \param obj The card info object. ++ * \return Sound card mixer name. + */ + const char *snd_ctl_card_info_get_mixername(const snd_ctl_card_info_t *obj) + { +@@ -2145,9 +2225,12 @@ const char *snd_ctl_card_info_get_mixername(const snd_ctl_card_info_t *obj) + } + + /** +- * \brief Get card component list from a CTL card info +- * \param obj CTL card info +- * \return card mixer identifier ++ * \brief Get the sound cards "components" property from the given info object. ++ * ++ * See snd_ctl_card_info_t for more details. ++ * ++ * \param obj The card info object. ++ * \return Sound cards "components" property. + */ + const char *snd_ctl_card_info_get_components(const snd_ctl_card_info_t *obj) + { +-- +2.31.1 + + +From 7ba3f888d07cafbad04391b915db23408c663dad Mon Sep 17 00:00:00 2001 +From: "Tanjeff-N. Moos" +Date: Thu, 17 Jun 2021 10:36:39 +0200 +Subject: [PATCH 10/20] control: Minor documentation fixes. + +Signed-off-by: Tanjeff-N. Moos +Signed-off-by: Takashi Iwai +--- + include/control.h | 9 +++++++-- + src/control/cards.c | 5 ++++- + src/control/control.c | 2 +- + 3 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/include/control.h b/include/control.h +index 9ebb4905..e386ecec 100644 +--- a/include/control.h ++++ b/include/control.h +@@ -155,7 +155,7 @@ typedef struct _snd_ctl_elem_list snd_ctl_elem_list_t; + /** CTL element info container */ + typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t; + +-/** CTL element value container ++/** CTL element value container. + * + * Contains the value(s) (i.e. members) of a single element. All + * values of a given element are of the same type. +@@ -167,6 +167,11 @@ typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t; + * using the latter, it must be freed again using + * snd_ctl_elem_value_free(). + * ++ * A value object can be zeroed out using snd_ctl_elem_value_clear(). ++ * ++ * A value object can be copied to another one using ++ * snd_ctl_elem_value_copy(). ++ * + * \par Identifier + * + * Then, the ID must be filled. It is sufficient to fill only the +@@ -621,7 +626,7 @@ size_t snd_ctl_elem_value_sizeof(void); + * \brief Allocate an invalid #snd_ctl_elem_value_t on the stack. + * + * Allocate space for a value object on the stack. The allocated +- * memory need not be freed, because is on the stack. ++ * memory need not be freed, because it is on the stack. + * + * See snd_ctl_elem_value_t for details. + * +diff --git a/src/control/cards.c b/src/control/cards.c +index 8226c42d..6145ebcd 100644 +--- a/src/control/cards.c ++++ b/src/control/cards.c +@@ -147,6 +147,7 @@ int snd_card_get_index(const char *string) + return -EINVAL; + if ((isdigit(*string) && *(string + 1) == 0) || + (isdigit(*string) && isdigit(*(string + 1)) && *(string + 2) == 0)) { ++ /* We got an index */ + if (sscanf(string, "%i", &card) != 1) + return -EINVAL; + if (card < 0 || card >= SND_MAX_CARDS) +@@ -156,8 +157,10 @@ int snd_card_get_index(const char *string) + return card; + return err; + } +- if (string[0] == '/') /* device name */ ++ if (string[0] == '/') ++ /* We got a device name */ + return snd_card_load2(string); ++ /* We got in ID */ + for (card = 0; card < SND_MAX_CARDS; card++) { + #ifdef SUPPORT_ALOAD + if (! snd_card_load(card)) +diff --git a/src/control/control.c b/src/control/control.c +index 7cf4decb..91415b51 100644 +--- a/src/control/control.c ++++ b/src/control/control.c +@@ -3127,7 +3127,7 @@ size_t snd_ctl_elem_value_sizeof() + /** + * \brief Allocate an invalid #snd_ctl_elem_value_t on the heap. + * +- * Allocate space for a value object on the head. The allocated memory ++ * Allocate space for a value object on the heap. The allocated memory + * must be freed using snd_ctl_elem_value_free(). + * + * See snd_ctl_elem_value_t for details. +-- +2.31.1 + + +From f4f29d42be8b8ad60ea4c5697374adad4bfe6868 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 28 Jun 2021 12:08:53 +0200 +Subject: [PATCH 11/20] fix build with --disable-ucm + +Link: https://mailman.alsa-project.org/pipermail/alsa-devel/2021-June/186729.html +Reported-by: Michael Forney +Signed-off-by: Jaroslav Kysela +--- + include/local.h | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/include/local.h b/include/local.h +index 4e7d88a0..7cfcec53 100644 +--- a/include/local.h ++++ b/include/local.h +@@ -374,6 +374,8 @@ int _snd_config_load_with_include(snd_config_t *config, snd_input_t *in, + void *INTERNAL(snd_dlopen)(const char *name, int mode, char *errbuf, size_t errbuflen); + #endif + ++#ifdef BUILD_UCM ++ + const char *uc_mgr_alibcfg_by_device(snd_config_t **config, const char *name); + + static inline int _snd_is_ucm_device(const char *name) +@@ -381,4 +383,12 @@ static inline int _snd_is_ucm_device(const char *name) + return name && name[0] == '_' && name[1] == 'u' && name[2] == 'c' && name[3] == 'm'; + } + ++#else ++ ++static inline const char *uc_mgr_alibcfg_by_device(snd_config_t **config, const char *name) { return NULL; } ++static inline int _snd_is_ucm_device(const char *name) { return 0; } ++ ++ ++#endif ++ + #endif +-- +2.31.1 + + +From 1a1f0fb244c477c430e156da878475ef57d198f9 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 28 Jun 2021 12:11:54 +0200 +Subject: [PATCH 12/20] pcm: rate - fix some gcc warnings + +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_rate.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c +index 13111d29..c45895a9 100644 +--- a/src/pcm/pcm_rate.c ++++ b/src/pcm/pcm_rate.c +@@ -82,12 +82,12 @@ struct _snd_pcm_rate { + + /* allocate a channel area and a temporary buffer for the given size */ + static snd_pcm_channel_area_t * +-rate_alloc_tmp_buf(snd_pcm_rate_t *rate, snd_pcm_format_t format, ++rate_alloc_tmp_buf(snd_pcm_format_t format, + unsigned int channels, unsigned int frames) + { + snd_pcm_channel_area_t *ap; + int width = snd_pcm_format_physical_width(format); +- int i; ++ unsigned int i; + + ap = malloc(sizeof(*ap) * channels); + if (!ap) +@@ -354,7 +354,7 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + snd_pcm_rate_t *rate = pcm->private_data; + snd_pcm_t *slave = rate->gen.slave; + snd_pcm_rate_side_info_t *sinfo, *cinfo; +- unsigned int channels, cwidth, swidth, chn, acc; ++ unsigned int channels, acc; + int need_src_buf, need_dst_buf; + int err = snd_pcm_hw_params_slave(pcm, params, + snd_pcm_rate_hw_refine_cchange, +@@ -401,9 +401,9 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + return -EBUSY; + } + +- rate->pareas = rate_alloc_tmp_buf(rate, cinfo->format, channels, ++ rate->pareas = rate_alloc_tmp_buf(cinfo->format, channels, + cinfo->period_size); +- rate->sareas = rate_alloc_tmp_buf(rate, sinfo->format, channels, ++ rate->sareas = rate_alloc_tmp_buf(sinfo->format, channels, + sinfo->period_size); + if (!rate->pareas || !rate->sareas) { + err = -ENOMEM; +@@ -442,7 +442,7 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + rate->src_conv_idx = + snd_pcm_linear_convert_index(rate->orig_in_format, + rate->info.in.format); +- rate->src_buf = rate_alloc_tmp_buf(rate, rate->info.in.format, ++ rate->src_buf = rate_alloc_tmp_buf(rate->info.in.format, + channels, rate->info.in.period_size); + if (!rate->src_buf) { + err = -ENOMEM; +@@ -454,7 +454,7 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + rate->dst_conv_idx = + snd_pcm_linear_convert_index(rate->info.out.format, + rate->orig_out_format); +- rate->dst_buf = rate_alloc_tmp_buf(rate, rate->info.out.format, ++ rate->dst_buf = rate_alloc_tmp_buf(rate->info.out.format, + channels, rate->info.out.period_size); + if (!rate->dst_buf) { + err = -ENOMEM; +-- +2.31.1 + + +From e47c11822d6b459a9b3704b3ee6a4a5c9a1b85be Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 29 Jun 2021 18:02:27 +0200 +Subject: [PATCH 13/20] control: remap - assign right name to the child handle + for no-op + +Fixes: https://github.com/alsa-project/alsa-utils/issues/100 +Signed-off-by: Jaroslav Kysela +--- + src/control/control_remap.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/control/control_remap.c b/src/control/control_remap.c +index a85c1725..81524014 100644 +--- a/src/control/control_remap.c ++++ b/src/control/control_remap.c +@@ -1173,6 +1173,10 @@ int snd_ctl_remap_open(snd_ctl_t **handlep, const char *name, snd_config_t *rema + /* no-op check, remove the plugin */ + if (priv->map_items == 0 && priv->remap_items == 0) { + remap_free(priv); ++ free(child->name); ++ child->name = name ? strdup(name) : NULL; ++ if (name && !child->name) ++ return -ENOMEM; + *handlep = child; + return 0; + } +-- +2.31.1 + + +From 23a191a82c693456e61431ab699cddc1e5782a26 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 29 Jun 2021 19:31:28 +0200 +Subject: [PATCH 14/20] control: remap - assign right name to the child handle + for no-op (2nd case) + +Fixes: https://github.com/alsa-project/alsa-utils/issues/100 +Signed-off-by: Jaroslav Kysela +--- + src/control/control_remap.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/control/control_remap.c b/src/control/control_remap.c +index 81524014..4914f960 100644 +--- a/src/control/control_remap.c ++++ b/src/control/control_remap.c +@@ -1154,6 +1154,10 @@ int snd_ctl_remap_open(snd_ctl_t **handlep, const char *name, snd_config_t *rema + snd_ctl_t *ctl; + int result, err; + ++ /* no-op, remove the plugin */ ++ if (!remap && !map) ++ goto _noop; ++ + priv = calloc(1, sizeof(*priv)); + if (priv == NULL) + return -ENOMEM; +@@ -1173,6 +1177,7 @@ int snd_ctl_remap_open(snd_ctl_t **handlep, const char *name, snd_config_t *rema + /* no-op check, remove the plugin */ + if (priv->map_items == 0 && priv->remap_items == 0) { + remap_free(priv); ++ _noop: + free(child->name); + child->name = name ? strdup(name) : NULL; + if (name && !child->name) +@@ -1316,11 +1321,6 @@ int _snd_ctl_remap_open(snd_ctl_t **handlep, char *name, snd_config_t *root, snd + err = _snd_ctl_open_child(&cctl, root, child, mode, conf); + if (err < 0) + return err; +- /* no-op, remove the plugin */ +- if (!remap && !map) { +- *handlep = cctl; +- return 0; +- } + err = snd_ctl_remap_open(handlep, name, remap, map, cctl, mode); + if (err < 0) + snd_ctl_close(cctl); +-- +2.31.1 + + +From 7d40a76ef5494e08af00fa4e7bfefbd43aba4827 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 31 Aug 2021 09:25:12 +0200 +Subject: [PATCH 19/20] ucm: avoid zero card instance number + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/utils.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/ucm/utils.c b/src/ucm/utils.c +index f3a8c9ba..10b21c34 100644 +--- a/src/ucm/utils.c ++++ b/src/ucm/utils.c +@@ -780,6 +780,9 @@ int uc_mgr_card_open(snd_use_case_mgr_t *uc_mgr) + while (uc_mgr_card_find(ucm_card_assign)) { + ucm_card_assign++; + ucm_card_assign &= 0xffff; ++ /* avoid zero card instance number */ ++ if (ucm_card_assign == 0) ++ ucm_card_assign++; + if (ucm_card_assign == prev) { + pthread_mutex_unlock(&ucm_cards_mutex); + return -ENOMEM; +-- +2.31.1 + + +From 4a52ae4c329ae17117375a4b85b80f37994a4044 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 31 Aug 2021 09:40:42 +0200 +Subject: [PATCH 20/20] ucm: fix the parsing of the hexadecimal prefix + +The safe_strtol() function use strtol() which expects +to have the '0x' prefix for the hexadecimal number (when +base argument is zero). + +BugLink: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1553 +Signed-off-by: Jaroslav Kysela +--- + src/ucm/utils.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/ucm/utils.c b/src/ucm/utils.c +index 10b21c34..2fbc4c8c 100644 +--- a/src/ucm/utils.c ++++ b/src/ucm/utils.c +@@ -811,7 +811,7 @@ void uc_mgr_card_close(snd_use_case_mgr_t *uc_mgr) + */ + const char *uc_mgr_alibcfg_by_device(snd_config_t **top, const char *name) + { +- char buf[5]; ++ char buf[7]; + long card_num; + snd_config_t *config; + snd_use_case_mgr_t *uc_mgr; +@@ -819,8 +819,10 @@ const char *uc_mgr_alibcfg_by_device(snd_config_t **top, const char *name) + + if (strncmp(name, "_ucm", 4) || strlen(name) < 12 || name[8] != '.') + return NULL; +- strncpy(buf, name + 4, 4); +- buf[4] = '\0'; ++ buf[0] = '0'; ++ buf[1] = 'x'; ++ strncpy(buf + 2, name + 4, 4); ++ buf[6] = '\0'; + err = safe_strtol(buf, &card_num); + if (err < 0 || card_num < 0 || card_num > 0xffff) + return NULL; +-- +2.31.1 + diff --git a/alsa-lib.spec b/alsa-lib.spec index eff5b83..fe19b44 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -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: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Tue Aug 31 2021 Jaroslav Kysela - 1.2.5.1-3 +- add UCM related fixes + * Wed Jul 21 2021 Fedora Release Engineering - 1.2.5.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From 2e98a65eac75dedaf59369b196ce48eb2a2b6f4d Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 31 Aug 2021 12:00:40 +0200 Subject: [PATCH 12/68] ucm fixes for 1.2.5.1 --- alsa-git.patch | 1916 ++++++++++++++++++++++++++++++++++++++++++++++++ alsa-lib.spec | 5 +- 2 files changed, 1920 insertions(+), 1 deletion(-) diff --git a/alsa-git.patch b/alsa-git.patch index e69de29..f88de1b 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -0,0 +1,1916 @@ +From 81e7923fbfad45b2f353a4d6e3053af51f5f7d0b Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 15 Jun 2021 23:21:42 +0200 +Subject: [PATCH 01/20] control: empty - fix the static build + +Reported-by: Jan Palus +Fixes: https://github.com/alsa-project/alsa-lib/issues/157 +Signed-off-by: Jaroslav Kysela +--- + src/control/control_empty.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/control/control_empty.c b/src/control/control_empty.c +index 49d1026c..c9b048c1 100644 +--- a/src/control/control_empty.c ++++ b/src/control/control_empty.c +@@ -30,7 +30,7 @@ + + #ifndef PIC + /* entry for static linking */ +-const char *_snd_module_ctl_empty = ""; ++const char *_snd_module_control_empty = ""; + #endif + + /*! \page control_plugins +-- +2.31.1 + + +From 5089358aa99d698bd846b05c1890a09613d740b3 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 17 Jun 2021 10:20:25 +0200 +Subject: [PATCH 02/20] pcm: rate: Refactoring temporary buffer allocations + +Introduce common helpers to allocate and release the temporary buffers +and the associated snd_pcm_channel. Now two allocated objects are +used instead of one malloc to be split. + +Also, change the snd_pcm_channel set up to be in interleaved mode. +This will be necessary in the following change in the rate plugin. + +Signed-off-by: Takashi Iwai +--- + src/pcm/pcm_rate.c | 80 ++++++++++++++++++++++++++++------------------ + 1 file changed, 49 insertions(+), 31 deletions(-) + +diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c +index 770aafea..1e996134 100644 +--- a/src/pcm/pcm_rate.c ++++ b/src/pcm/pcm_rate.c +@@ -76,6 +76,45 @@ struct _snd_pcm_rate { + + #endif /* DOC_HIDDEN */ + ++/* allocate a channel area and a temporary buffer for the given size */ ++static snd_pcm_channel_area_t * ++rate_alloc_tmp_buf(snd_pcm_rate_t *rate, snd_pcm_format_t format, ++ unsigned int channels, unsigned int frames) ++{ ++ snd_pcm_channel_area_t *ap; ++ int width = snd_pcm_format_physical_width(format); ++ int i; ++ ++ ap = malloc(sizeof(*ap) * channels); ++ if (!ap) ++ return NULL; ++ ap->addr = malloc(frames * channels * width / 8); ++ if (!ap->addr) { ++ free(ap); ++ return NULL; ++ } ++ ++ /* set up in interleaved format */ ++ for (i = 0; i < channels; i++) { ++ ap[i].addr = ap[0].addr + (i * width) / 8; ++ ap[i].first = 0; ++ ap[i].step = width * channels; ++ } ++ ++ return ap; ++} ++ ++static void rate_free_tmp_buf(snd_pcm_channel_area_t **ptr) ++{ ++ snd_pcm_channel_area_t *c = *ptr; ++ ++ if (c) { ++ free(c->addr); ++ free(c); ++ *ptr = NULL; ++ } ++} ++ + static int snd_pcm_rate_hw_refine_cprepare(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_hw_params_t *params) + { + snd_pcm_rate_t *rate = pcm->private_data; +@@ -286,28 +325,13 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + if (err < 0) + return err; + +- rate->pareas = malloc(2 * channels * sizeof(*rate->pareas)); +- if (rate->pareas == NULL) ++ rate->pareas = rate_alloc_tmp_buf(rate, cinfo->format, channels, ++ cinfo->period_size); ++ rate->sareas = rate_alloc_tmp_buf(rate, sinfo->format, channels, ++ sinfo->period_size); ++ if (!rate->pareas || !rate->sareas) + goto error; + +- cwidth = snd_pcm_format_physical_width(cinfo->format); +- swidth = snd_pcm_format_physical_width(sinfo->format); +- rate->pareas[0].addr = malloc(((cwidth * channels * cinfo->period_size) / 8) + +- ((swidth * channels * sinfo->period_size) / 8)); +- if (rate->pareas[0].addr == NULL) +- goto error; +- +- rate->sareas = rate->pareas + channels; +- rate->sareas[0].addr = (char *)rate->pareas[0].addr + ((cwidth * channels * cinfo->period_size) / 8); +- for (chn = 0; chn < channels; chn++) { +- rate->pareas[chn].addr = (char *)rate->pareas[0].addr + (cwidth * chn * cinfo->period_size) / 8; +- rate->pareas[chn].first = 0; +- rate->pareas[chn].step = cwidth; +- rate->sareas[chn].addr = (char *)rate->sareas[0].addr + (swidth * chn * sinfo->period_size) / 8; +- rate->sareas[chn].first = 0; +- rate->sareas[chn].step = swidth; +- } +- + if (rate->ops.convert_s16) { + rate->get_idx = snd_pcm_linear_get_index(rate->info.in.format, SND_PCM_FORMAT_S16); + rate->put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S16, rate->info.out.format); +@@ -322,11 +346,8 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + return 0; + + error: +- if (rate->pareas) { +- free(rate->pareas[0].addr); +- free(rate->pareas); +- rate->pareas = NULL; +- } ++ rate_free_tmp_buf(&rate->pareas); ++ rate_free_tmp_buf(&rate->sareas); + if (rate->ops.free) + rate->ops.free(rate->obj); + return -ENOMEM; +@@ -335,12 +356,9 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + static int snd_pcm_rate_hw_free(snd_pcm_t *pcm) + { + snd_pcm_rate_t *rate = pcm->private_data; +- if (rate->pareas) { +- free(rate->pareas[0].addr); +- free(rate->pareas); +- rate->pareas = NULL; +- rate->sareas = NULL; +- } ++ ++ rate_free_tmp_buf(&rate->pareas); ++ rate_free_tmp_buf(&rate->sareas); + if (rate->ops.free) + rate->ops.free(rate->obj); + free(rate->src_buf); +-- +2.31.1 + + +From 119d9c1678b1193f8b969a6483cae1f7bf95e609 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 17 Jun 2021 10:03:17 +0200 +Subject: [PATCH 03/20] pcm: rate: Improve the support multiple formats + +This patch extends the PCM rate plugin for allowing its converter +plugin to deal with multiple formats. Currently, the converter plugin +is allowed to take different formats only when convert callback is +defined. And for this way (so far only the standard linear rate +plugin does), all linear formats have to be handled, and it's +cumbersome. + +OTOH, most other rate plugins are implemented with convert_s16 +callback, which accepts only S16 format. This is often not ideal +because many converter engines can handle 32bit formats. Also, the +target format is often 32bit format, hence this would require +additional conversion even if the converter engine can output 32bit +natively. + +In this patch, for addressing the problems above, the rate plugin API +is extended in the following way: + +- The new get_supported_formats callback is added; this stores the bit + masks of the supported input and output formats, as well as the + behavior flags. Currently only linear formats are allowed. +- When the plugin accepts only the interleaved stream, set + SND_PCM_RATE_FLAG_INTERLEAVED flag bit. Otherwise the code has to + handle snd_pcm_channel_area at each call. +- When both input and output formats have to be identical, pass + SND_PCM_RATE_FLAG_SYNC_FORMATS flag bit. +- When the converter wants to process different formats, use convert + callback instead of convert_s16. You can put both in the ops for + compatibility, too. + The input and output formats are found in the info argument of init + callback. +- Now the PCM rate plugin core will skip the temporary buffer + allocation and conversions for pre- and post-process if not needed + (i.e. matching with the requested input or output format). + +The rate plugin API version is bumped to 0x010003. + +Signed-off-by: Takashi Iwai +--- + include/pcm_rate.h | 36 ++++- + src/pcm/pcm_rate.c | 358 +++++++++++++++++++++++++++------------------ + 2 files changed, 251 insertions(+), 143 deletions(-) + +diff --git a/include/pcm_rate.h b/include/pcm_rate.h +index 4171fb9d..48473ed4 100644 +--- a/include/pcm_rate.h ++++ b/include/pcm_rate.h +@@ -38,7 +38,7 @@ extern "C" { + /** + * Protocol version + */ +-#define SND_PCM_RATE_PLUGIN_VERSION 0x010002 ++#define SND_PCM_RATE_PLUGIN_VERSION 0x010003 + + /** hw_params information for a single side */ + typedef struct snd_pcm_rate_side_info { +@@ -55,6 +55,11 @@ typedef struct snd_pcm_rate_info { + unsigned int channels; + } snd_pcm_rate_info_t; + ++enum { ++ SND_PCM_RATE_FLAG_INTERLEAVED = (1U << 0), /** only interleaved format */ ++ SND_PCM_RATE_FLAG_SYNC_FORMATS = (1U << 1), /** both input and output formats have to be identical */ ++}; ++ + /** Callback table of rate-converter */ + typedef struct snd_pcm_rate_ops { + /** +@@ -114,6 +119,13 @@ typedef struct snd_pcm_rate_ops { + * new ops since version 0x010002 + */ + void (*dump)(void *obj, snd_output_t *out); ++ /** ++ * get the supported input and output formats (optional); ++ * new ops since version 0x010003 ++ */ ++ int (*get_supported_formats)(void *obj, uint64_t *in_formats, ++ uint64_t *out_formats, ++ unsigned int *flags); + } snd_pcm_rate_ops_t; + + /** open function type */ +@@ -147,6 +159,28 @@ typedef struct snd_pcm_rate_old_ops { + snd_pcm_uframes_t (*input_frames)(void *obj, snd_pcm_uframes_t frames); + snd_pcm_uframes_t (*output_frames)(void *obj, snd_pcm_uframes_t frames); + } snd_pcm_rate_old_ops_t; ++ ++/* old rate_ops for protocol version 0x010002 */ ++typedef struct snd_pcm_rate_v2_ops { ++ void (*close)(void *obj); ++ int (*init)(void *obj, snd_pcm_rate_info_t *info); ++ void (*free)(void *obj); ++ void (*reset)(void *obj); ++ int (*adjust_pitch)(void *obj, snd_pcm_rate_info_t *info); ++ void (*convert)(void *obj, ++ const snd_pcm_channel_area_t *dst_areas, ++ snd_pcm_uframes_t dst_offset, unsigned int dst_frames, ++ const snd_pcm_channel_area_t *src_areas, ++ snd_pcm_uframes_t src_offset, unsigned int src_frames); ++ void (*convert_s16)(void *obj, int16_t *dst, unsigned int dst_frames, ++ const int16_t *src, unsigned int src_frames); ++ snd_pcm_uframes_t (*input_frames)(void *obj, snd_pcm_uframes_t frames); ++ snd_pcm_uframes_t (*output_frames)(void *obj, snd_pcm_uframes_t frames); ++ unsigned int version; ++ int (*get_supported_rates)(void *obj, unsigned int *rate_min, ++ unsigned int *rate_max); ++ void (*dump)(void *obj, snd_output_t *out); ++} snd_pcm_rate_v2_ops_t; + #endif + + #ifdef __cplusplus +diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c +index 1e996134..13111d29 100644 +--- a/src/pcm/pcm_rate.c ++++ b/src/pcm/pcm_rate.c +@@ -62,18 +62,22 @@ struct _snd_pcm_rate { + void *open_func; + void *obj; + snd_pcm_rate_ops_t ops; +- unsigned int get_idx; +- unsigned int put_idx; +- int16_t *src_buf; +- int16_t *dst_buf; ++ unsigned int src_conv_idx; ++ unsigned int dst_conv_idx; ++ snd_pcm_channel_area_t *src_buf; ++ snd_pcm_channel_area_t *dst_buf; + int start_pending; /* start is triggered but not commited to slave */ + snd_htimestamp_t trigger_tstamp; + unsigned int plugin_version; + unsigned int rate_min, rate_max; ++ snd_pcm_format_t orig_in_format; ++ snd_pcm_format_t orig_out_format; ++ uint64_t in_formats; ++ uint64_t out_formats; ++ unsigned int format_flags; + }; + + #define SND_PCM_RATE_PLUGIN_VERSION_OLD 0x010001 /* old rate plugin */ +- + #endif /* DOC_HIDDEN */ + + /* allocate a channel area and a temporary buffer for the given size */ +@@ -274,12 +278,84 @@ static int snd_pcm_rate_hw_refine(snd_pcm_t *pcm, + snd_pcm_generic_hw_refine); + } + ++/* evaluate the best matching available format to the given format */ ++static int get_best_format(uint64_t mask, snd_pcm_format_t orig) ++{ ++ int pwidth = snd_pcm_format_physical_width(orig); ++ int width = snd_pcm_format_width(orig); ++ int signd = snd_pcm_format_signed(orig); ++ int best_score = -1; ++ int match = -1; ++ int f, score; ++ ++ for (f = 0; f <= SND_PCM_FORMAT_LAST; f++) { ++ if (!(mask & (1ULL << f))) ++ continue; ++ score = 0; ++ if (snd_pcm_format_linear(f)) { ++ if (snd_pcm_format_physical_width(f) == pwidth) ++ score++; ++ if (snd_pcm_format_physical_width(f) >= pwidth) ++ score++; ++ if (snd_pcm_format_width(f) == width) ++ score++; ++ if (snd_pcm_format_signed(f) == signd) ++ score++; ++ } ++ if (score > best_score) { ++ match = f; ++ best_score = score; ++ } ++ } ++ ++ return match; ++} ++ ++/* set up the input and output formats from the available lists */ ++static int choose_preferred_format(snd_pcm_rate_t *rate) ++{ ++ uint64_t in_mask = rate->in_formats; ++ uint64_t out_mask = rate->out_formats; ++ int in, out; ++ ++ if (!in_mask || !out_mask) ++ return 0; ++ ++ if (rate->orig_in_format == rate->orig_out_format) ++ if (in_mask & out_mask & (1ULL << rate->orig_in_format)) ++ return 0; /* nothing changed */ ++ ++ repeat: ++ in = get_best_format(in_mask, rate->orig_in_format); ++ out = get_best_format(out_mask, rate->orig_out_format); ++ if (in < 0 || out < 0) ++ return -ENOENT; ++ ++ if ((rate->format_flags & SND_PCM_RATE_FLAG_SYNC_FORMATS) && ++ in != out) { ++ if (out_mask & (1ULL << in)) ++ out = in; ++ else if (in_mask & (1ULL << out)) ++ in = out; ++ else { ++ in_mask &= ~(1ULL << in); ++ out_mask &= ~(1ULL << out); ++ goto repeat; ++ } ++ } ++ ++ rate->info.in.format = in; ++ rate->info.out.format = out; ++ return 0; ++} ++ + static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + { + snd_pcm_rate_t *rate = pcm->private_data; + snd_pcm_t *slave = rate->gen.slave; + snd_pcm_rate_side_info_t *sinfo, *cinfo; +- unsigned int channels, cwidth, swidth, chn; ++ unsigned int channels, cwidth, swidth, chn, acc; ++ int need_src_buf, need_dst_buf; + int err = snd_pcm_hw_params_slave(pcm, params, + snd_pcm_rate_hw_refine_cchange, + snd_pcm_rate_hw_refine_sprepare, +@@ -308,6 +384,9 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + if (err < 0) + return err; + err = INTERNAL(snd_pcm_hw_params_get_channels)(params, &channels); ++ if (err < 0) ++ return err; ++ err = INTERNAL(snd_pcm_hw_params_get_access)(params, &acc); + if (err < 0) + return err; + +@@ -321,36 +400,80 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + SNDMSG("rate plugin already in use"); + return -EBUSY; + } +- err = rate->ops.init(rate->obj, &rate->info); +- if (err < 0) +- return err; + + rate->pareas = rate_alloc_tmp_buf(rate, cinfo->format, channels, + cinfo->period_size); + rate->sareas = rate_alloc_tmp_buf(rate, sinfo->format, channels, + sinfo->period_size); +- if (!rate->pareas || !rate->sareas) +- goto error; +- +- if (rate->ops.convert_s16) { +- rate->get_idx = snd_pcm_linear_get_index(rate->info.in.format, SND_PCM_FORMAT_S16); +- rate->put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S16, rate->info.out.format); +- free(rate->src_buf); +- rate->src_buf = malloc(channels * rate->info.in.period_size * 2); +- free(rate->dst_buf); +- rate->dst_buf = malloc(channels * rate->info.out.period_size * 2); +- if (! rate->src_buf || ! rate->dst_buf) ++ if (!rate->pareas || !rate->sareas) { ++ err = -ENOMEM; ++ goto error_pareas; ++ } ++ ++ rate->orig_in_format = rate->info.in.format; ++ rate->orig_out_format = rate->info.out.format; ++ if (choose_preferred_format(rate) < 0) { ++ SNDERR("No matching format in rate plugin"); ++ err = -EINVAL; ++ goto error_pareas; ++ } ++ ++ err = rate->ops.init(rate->obj, &rate->info); ++ if (err < 0) ++ goto error_init; ++ ++ rate_free_tmp_buf(&rate->src_buf); ++ rate_free_tmp_buf(&rate->dst_buf); ++ ++ need_src_buf = need_dst_buf = 0; ++ ++ if ((rate->format_flags & SND_PCM_RATE_FLAG_INTERLEAVED) && ++ !(acc == SND_PCM_ACCESS_MMAP_INTERLEAVED || ++ acc == SND_PCM_ACCESS_RW_INTERLEAVED)) { ++ need_src_buf = need_dst_buf = 1; ++ } else { ++ if (rate->orig_in_format != rate->info.in.format) ++ need_src_buf = 1; ++ if (rate->orig_out_format != rate->info.out.format) ++ need_dst_buf = 1; ++ } ++ ++ if (need_src_buf) { ++ rate->src_conv_idx = ++ snd_pcm_linear_convert_index(rate->orig_in_format, ++ rate->info.in.format); ++ rate->src_buf = rate_alloc_tmp_buf(rate, rate->info.in.format, ++ channels, rate->info.in.period_size); ++ if (!rate->src_buf) { ++ err = -ENOMEM; + goto error; ++ } ++ } ++ ++ if (need_dst_buf) { ++ rate->dst_conv_idx = ++ snd_pcm_linear_convert_index(rate->info.out.format, ++ rate->orig_out_format); ++ rate->dst_buf = rate_alloc_tmp_buf(rate, rate->info.out.format, ++ channels, rate->info.out.period_size); ++ if (!rate->dst_buf) { ++ err = -ENOMEM; ++ goto error; ++ } + } + + return 0; + + error: +- rate_free_tmp_buf(&rate->pareas); +- rate_free_tmp_buf(&rate->sareas); ++ rate_free_tmp_buf(&rate->src_buf); ++ rate_free_tmp_buf(&rate->dst_buf); ++ error_init: + if (rate->ops.free) + rate->ops.free(rate->obj); +- return -ENOMEM; ++ error_pareas: ++ rate_free_tmp_buf(&rate->pareas); ++ rate_free_tmp_buf(&rate->sareas); ++ return err; + } + + static int snd_pcm_rate_hw_free(snd_pcm_t *pcm) +@@ -361,9 +484,8 @@ static int snd_pcm_rate_hw_free(snd_pcm_t *pcm) + rate_free_tmp_buf(&rate->sareas); + if (rate->ops.free) + rate->ops.free(rate->obj); +- free(rate->src_buf); +- free(rate->dst_buf); +- rate->src_buf = rate->dst_buf = NULL; ++ rate_free_tmp_buf(&rate->src_buf); ++ rate_free_tmp_buf(&rate->dst_buf); + return snd_pcm_hw_free(rate->gen.slave); + } + +@@ -444,82 +566,6 @@ static int snd_pcm_rate_init(snd_pcm_t *pcm) + return 0; + } + +-static void convert_to_s16(snd_pcm_rate_t *rate, int16_t *buf, +- const snd_pcm_channel_area_t *areas, +- snd_pcm_uframes_t offset, unsigned int frames, +- unsigned int channels) +-{ +-#ifndef DOC_HIDDEN +-#define GET16_LABELS +-#include "plugin_ops.h" +-#undef GET16_LABELS +-#endif /* DOC_HIDDEN */ +- void *get = get16_labels[rate->get_idx]; +- const char *src; +- int16_t sample; +- const char *srcs[channels]; +- int src_step[channels]; +- unsigned int c; +- +- for (c = 0; c < channels; c++) { +- srcs[c] = snd_pcm_channel_area_addr(areas + c, offset); +- src_step[c] = snd_pcm_channel_area_step(areas + c); +- } +- +- while (frames--) { +- for (c = 0; c < channels; c++) { +- src = srcs[c]; +- goto *get; +-#ifndef DOC_HIDDEN +-#define GET16_END after_get +-#include "plugin_ops.h" +-#undef GET16_END +-#endif /* DOC_HIDDEN */ +- after_get: +- *buf++ = sample; +- srcs[c] += src_step[c]; +- } +- } +-} +- +-static void convert_from_s16(snd_pcm_rate_t *rate, const int16_t *buf, +- const snd_pcm_channel_area_t *areas, +- snd_pcm_uframes_t offset, unsigned int frames, +- unsigned int channels) +-{ +-#ifndef DOC_HIDDEN +-#define PUT16_LABELS +-#include "plugin_ops.h" +-#undef PUT16_LABELS +-#endif /* DOC_HIDDEN */ +- void *put = put16_labels[rate->put_idx]; +- char *dst; +- int16_t sample; +- char *dsts[channels]; +- int dst_step[channels]; +- unsigned int c; +- +- for (c = 0; c < channels; c++) { +- dsts[c] = snd_pcm_channel_area_addr(areas + c, offset); +- dst_step[c] = snd_pcm_channel_area_step(areas + c); +- } +- +- while (frames--) { +- for (c = 0; c < channels; c++) { +- dst = dsts[c]; +- sample = *buf++; +- goto *put; +-#ifndef DOC_HIDDEN +-#define PUT16_END after_put +-#include "plugin_ops.h" +-#undef PUT16_END +-#endif /* DOC_HIDDEN */ +- after_put: +- dsts[c] += dst_step[c]; +- } +- } +-} +- + static void do_convert(const snd_pcm_channel_area_t *dst_areas, + snd_pcm_uframes_t dst_offset, unsigned int dst_frames, + const snd_pcm_channel_area_t *src_areas, +@@ -527,28 +573,40 @@ static void do_convert(const snd_pcm_channel_area_t *dst_areas, + unsigned int channels, + snd_pcm_rate_t *rate) + { +- if (rate->ops.convert_s16) { +- const int16_t *src; +- int16_t *dst; +- if (! rate->src_buf) +- src = (int16_t *)src_areas->addr + src_offset * channels; +- else { +- convert_to_s16(rate, rate->src_buf, src_areas, src_offset, +- src_frames, channels); +- src = rate->src_buf; +- } +- if (! rate->dst_buf) +- dst = (int16_t *)dst_areas->addr + dst_offset * channels; +- else +- dst = rate->dst_buf; +- rate->ops.convert_s16(rate->obj, dst, dst_frames, src, src_frames); +- if (dst == rate->dst_buf) +- convert_from_s16(rate, rate->dst_buf, dst_areas, dst_offset, +- dst_frames, channels); ++ const snd_pcm_channel_area_t *out_areas; ++ snd_pcm_uframes_t out_offset; ++ ++ if (rate->dst_buf) { ++ out_areas = rate->dst_buf; ++ out_offset = 0; + } else { +- rate->ops.convert(rate->obj, dst_areas, dst_offset, dst_frames, +- src_areas, src_offset, src_frames); ++ out_areas = dst_areas; ++ out_offset = dst_offset; ++ } ++ ++ if (rate->src_buf) { ++ snd_pcm_linear_convert(rate->src_buf, 0, ++ src_areas, src_offset, ++ channels, src_frames, ++ rate->src_conv_idx); ++ src_areas = rate->src_buf; ++ src_offset = 0; + } ++ ++ if (rate->ops.convert) ++ rate->ops.convert(rate->obj, out_areas, out_offset, dst_frames, ++ src_areas, src_offset, src_frames); ++ else ++ rate->ops.convert_s16(rate->obj, ++ snd_pcm_channel_area_addr(out_areas, out_offset), ++ dst_frames, ++ snd_pcm_channel_area_addr(src_areas, src_offset), ++ src_frames); ++ if (rate->dst_buf) ++ snd_pcm_linear_convert(dst_areas, dst_offset, ++ rate->dst_buf, 0, ++ channels, dst_frames, ++ rate->dst_conv_idx); + } + + static inline void +@@ -1276,6 +1334,30 @@ const snd_config_t *snd_pcm_rate_get_default_converter(snd_config_t *root) + return NULL; + } + ++static void rate_initial_setup(snd_pcm_rate_t *rate) ++{ ++ if (rate->plugin_version == SND_PCM_RATE_PLUGIN_VERSION) ++ rate->plugin_version = rate->ops.version; ++ ++ if (rate->plugin_version >= 0x010002 && ++ rate->ops.get_supported_rates) ++ rate->ops.get_supported_rates(rate->obj, ++ &rate->rate_min, ++ &rate->rate_max); ++ ++ if (rate->plugin_version >= 0x010003 && ++ rate->ops.get_supported_formats) { ++ rate->ops.get_supported_formats(rate->obj, ++ &rate->in_formats, ++ &rate->out_formats, ++ &rate->format_flags); ++ } else if (!rate->ops.convert && rate->ops.convert_s16) { ++ rate->in_formats = rate->out_formats = ++ 1ULL << SND_PCM_FORMAT_S16; ++ rate->format_flags = SND_PCM_RATE_FLAG_INTERLEAVED; ++ } ++} ++ + #ifdef PIC + static int is_builtin_plugin(const char *type) + { +@@ -1301,20 +1383,11 @@ static int rate_open_func(snd_pcm_rate_t *rate, const char *type, const snd_conf + lib = lib_name; + } + +- rate->rate_min = SND_PCM_PLUGIN_RATE_MIN; +- rate->rate_max = SND_PCM_PLUGIN_RATE_MAX; +- rate->plugin_version = SND_PCM_RATE_PLUGIN_VERSION; +- + open_conf_func = snd_dlobj_cache_get(lib, open_conf_name, NULL, verbose && converter_conf != NULL); + if (open_conf_func) { + err = open_conf_func(SND_PCM_RATE_PLUGIN_VERSION, + &rate->obj, &rate->ops, converter_conf); + if (!err) { +- rate->plugin_version = rate->ops.version; +- if (rate->ops.get_supported_rates) +- rate->ops.get_supported_rates(rate->obj, +- &rate->rate_min, +- &rate->rate_max); + rate->open_func = open_conf_func; + return 0; + } else { +@@ -1330,23 +1403,18 @@ static int rate_open_func(snd_pcm_rate_t *rate, const char *type, const snd_conf + rate->open_func = open_func; + + err = open_func(SND_PCM_RATE_PLUGIN_VERSION, &rate->obj, &rate->ops); +- if (!err) { +- rate->plugin_version = rate->ops.version; +- if (rate->ops.get_supported_rates) +- rate->ops.get_supported_rates(rate->obj, +- &rate->rate_min, +- &rate->rate_max); ++ if (!err) + return 0; +- } + + /* try to open with the old protocol version */ + rate->plugin_version = SND_PCM_RATE_PLUGIN_VERSION_OLD; + err = open_func(SND_PCM_RATE_PLUGIN_VERSION_OLD, + &rate->obj, &rate->ops); +- if (err) { +- snd_dlobj_cache_put(open_func); +- rate->open_func = NULL; +- } ++ if (!err) ++ return 0; ++ ++ snd_dlobj_cache_put(open_func); ++ rate->open_func = NULL; + return err; + } + #endif +@@ -1417,6 +1485,10 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, + rate->srate = srate; + rate->sformat = sformat; + ++ rate->rate_min = SND_PCM_PLUGIN_RATE_MIN; ++ rate->rate_max = SND_PCM_PLUGIN_RATE_MAX; ++ rate->plugin_version = SND_PCM_RATE_PLUGIN_VERSION; ++ + err = snd_pcm_new(&pcm, SND_PCM_TYPE_RATE, name, slave->stream, slave->mode); + if (err < 0) { + free(rate); +@@ -1496,6 +1568,8 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, + return err; + } + ++ rate_initial_setup(rate); ++ + pcm->ops = &snd_pcm_rate_ops; + pcm->fast_ops = &snd_pcm_rate_fast_ops; + pcm->private_data = rate; +-- +2.31.1 + + +From 3f737a2a2c8d20e78dea3ea836997f9d74f602a0 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Fri, 18 Jun 2021 11:35:30 +0200 +Subject: [PATCH 04/20] pcm: improve docs for snd_pcm_sw_params_get_avail_min() + and snd_pcm_status_get_avail_max() + +Fixes: https://github.com/alsa-project/alsa-lib/issues/44 +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c +index 09df0f12..892abf98 100644 +--- a/src/pcm/pcm.c ++++ b/src/pcm/pcm.c +@@ -6500,6 +6500,9 @@ int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, + * \param params Software configuration container + * \param val returned minimum available frames to consider PCM ready + * \return 0 otherwise a negative error code ++ * ++ * This is a threshold value when the PCM stream is considered as ready for ++ * another read/write operation or poll event. + */ + #ifndef DOXYGEN + EXPORT_SYMBOL int INTERNAL(snd_pcm_sw_params_get_avail_min)(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) +@@ -6960,6 +6963,8 @@ snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t *obj) + /** + * \brief Get maximum number of frames available from a PCM status container after last #snd_pcm_status call + * \return Maximum number of frames ready to be read/written ++ * ++ * This value returns the peak for the available frames between #snd_pcm_status calls. + */ + snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t *obj) + { +-- +2.31.1 + + +From 212c6c18c4317af48c007a0866efc029b9c3a593 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 21 Jun 2021 09:23:02 +0200 +Subject: [PATCH 05/20] pcm: dmix - use pcm_frame_diff() in + snd_pcm_dmix_sync_ptr0() + +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_dmix.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c +index 608593f1..0d0d0bff 100644 +--- a/src/pcm/pcm_dmix.c ++++ b/src/pcm/pcm_dmix.c +@@ -393,17 +393,13 @@ static int snd_pcm_dmix_sync_ptr0(snd_pcm_t *pcm, snd_pcm_uframes_t slave_hw_ptr + + old_slave_hw_ptr = dmix->slave_hw_ptr; + dmix->slave_hw_ptr = slave_hw_ptr; +- diff = slave_hw_ptr - old_slave_hw_ptr; ++ diff = pcm_frame_diff(slave_hw_ptr, old_slave_hw_ptr, dmix->slave_boundary); + if (diff == 0) /* fast path */ + return 0; + if (dmix->state != SND_PCM_STATE_RUNNING && + dmix->state != SND_PCM_STATE_DRAINING) + /* not really started yet - don't update hw_ptr */ + return 0; +- if (diff < 0) { +- slave_hw_ptr += dmix->slave_boundary; +- diff = slave_hw_ptr - old_slave_hw_ptr; +- } + dmix->hw_ptr += diff; + dmix->hw_ptr %= pcm->boundary; + if (pcm->stop_threshold >= pcm->boundary) /* don't care */ +-- +2.31.1 + + +From dd609ef9684987d3ca61d5c5cc3c77589ff9c29f Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 21 Jun 2021 09:28:41 +0200 +Subject: [PATCH 06/20] pcm: direct plugins - fix hw_ptr in the status callback + +The parent hw_ptr may be in another range (boundary limit). +Set the correct value for the caller. + +BugLink: https://github.com/alsa-project/alsa-lib/issues/155 +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_dmix.c | 1 + + src/pcm/pcm_dshare.c | 1 + + src/pcm/pcm_dsnoop.c | 1 + + 3 files changed, 3 insertions(+) + +diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c +index 0d0d0bff..94dbb1e0 100644 +--- a/src/pcm/pcm_dmix.c ++++ b/src/pcm/pcm_dmix.c +@@ -491,6 +491,7 @@ static int snd_pcm_dmix_status(snd_pcm_t *pcm, snd_pcm_status_t * status) + } + + status->state = snd_pcm_dmix_state(pcm); ++ status->hw_ptr = *pcm->hw.ptr; /* boundary may be different */ + status->appl_ptr = *pcm->appl.ptr; /* slave PCM doesn't set appl_ptr */ + status->trigger_tstamp = dmix->trigger_tstamp; + status->avail = snd_pcm_mmap_playback_avail(pcm); +diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c +index a918512b..01814dc8 100644 +--- a/src/pcm/pcm_dshare.c ++++ b/src/pcm/pcm_dshare.c +@@ -243,6 +243,7 @@ static int snd_pcm_dshare_status(snd_pcm_t *pcm, snd_pcm_status_t * status) + break; + } + status->state = snd_pcm_dshare_state(pcm); ++ status->hw_ptr = *pcm->hw.ptr; /* boundary may be different */ + status->appl_ptr = *pcm->appl.ptr; /* slave PCM doesn't set appl_ptr */ + status->trigger_tstamp = dshare->trigger_tstamp; + status->avail = snd_pcm_mmap_playback_avail(pcm); +diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c +index 2c3b9f43..3f28df99 100644 +--- a/src/pcm/pcm_dsnoop.c ++++ b/src/pcm/pcm_dsnoop.c +@@ -193,6 +193,7 @@ static int snd_pcm_dsnoop_status(snd_pcm_t *pcm, snd_pcm_status_t * status) + snd_pcm_status(dsnoop->spcm, status); + state = snd_pcm_state(dsnoop->spcm); + status->state = state == SND_PCM_STATE_RUNNING ? dsnoop->state : state; ++ status->hw_ptr = *pcm->hw.ptr; /* boundary may be different */ + status->appl_ptr = *pcm->appl.ptr; /* slave PCM doesn't set appl_ptr */ + status->trigger_tstamp = dsnoop->trigger_tstamp; + status->avail = snd_pcm_mmap_capture_avail(pcm); +-- +2.31.1 + + +From a5e11f9a810391777ea7750f04ba66f9c9e624de Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 21 Jun 2021 14:21:26 +0200 +Subject: [PATCH 07/20] pcm: Move snd_pcm_channel_area_addr() and _step() to + public header + +Used in the rate plugins commonly. + +Signed-off-by: Takashi Iwai +--- + include/pcm.h | 23 +++++++++++++++++++++++ + src/pcm/pcm_local.h | 13 ------------- + 2 files changed, 23 insertions(+), 13 deletions(-) + +diff --git a/include/pcm.h b/include/pcm.h +index e300b951..b5a514fa 100644 +--- a/include/pcm.h ++++ b/include/pcm.h +@@ -1173,6 +1173,29 @@ int snd_pcm_areas_copy_wrap(const snd_pcm_channel_area_t *dst_channels, + snd_pcm_uframes_t frames, + const snd_pcm_format_t format); + ++/** ++ * \brief get the address of the given PCM channel area ++ * \param area PCM channel area ++ * \param offset Offset in frames ++ * ++ * Returns the pointer corresponding to the given offset on the channel area. ++ */ ++static inline void *snd_pcm_channel_area_addr(const snd_pcm_channel_area_t *area, snd_pcm_uframes_t offset) ++{ ++ return (char *)area->addr + (area->first + area->step * offset) / 8; ++} ++ ++/** ++ * \brief get the step size of the given PCM channel area in bytes ++ * \param area PCM channel area ++ * ++ * Returns the step size in bytes from the given channel area. ++ */ ++static inline unsigned int snd_pcm_channel_area_step(const snd_pcm_channel_area_t *area) ++{ ++ return area->step / 8; ++} ++ + /** \} */ + + /** +diff --git a/src/pcm/pcm_local.h b/src/pcm/pcm_local.h +index a63f4be0..6f03365c 100644 +--- a/src/pcm/pcm_local.h ++++ b/src/pcm/pcm_local.h +@@ -632,19 +632,6 @@ static inline snd_pcm_sframes_t snd_pcm_mmap_delay(snd_pcm_t *pcm) + return snd_pcm_mmap_capture_delay(pcm); + } + +-static inline void *snd_pcm_channel_area_addr(const snd_pcm_channel_area_t *area, snd_pcm_uframes_t offset) +-{ +- unsigned int bitofs = area->first + area->step * offset; +- assert(bitofs % 8 == 0); +- return (char *) area->addr + bitofs / 8; +-} +- +-static inline unsigned int snd_pcm_channel_area_step(const snd_pcm_channel_area_t *area) +-{ +- assert(area->step % 8 == 0); +- return area->step / 8; +-} +- + static inline snd_pcm_sframes_t _snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size) + { + /* lock handled in the callback */ +-- +2.31.1 + + +From e0e084659083c2ab75d5c894f24227ea2f67010f Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 21 Jun 2021 15:14:18 +0200 +Subject: [PATCH 08/20] pcm: direct plugins - fix bad memory access when + channel bindings do not match hw + +Fix and cleanup snd_pcm_direct_check_interleave() function. +Add requested / hardware channel check and use goto when the interleaved + +Fixes: https://github.com/alsa-project/alsa-lib/issues/117 +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_direct.c | 40 +++++++++++++++++----------------------- + 1 file changed, 17 insertions(+), 23 deletions(-) + +diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c +index d50503e3..90417b2f 100644 +--- a/src/pcm/pcm_direct.c ++++ b/src/pcm/pcm_direct.c +@@ -1627,43 +1627,37 @@ int snd_pcm_direct_set_timer_params(snd_pcm_direct_t *dmix) + int snd_pcm_direct_check_interleave(snd_pcm_direct_t *dmix, snd_pcm_t *pcm) + { + unsigned int chn, channels; +- int bits, interleaved = 1; ++ int bits; + const snd_pcm_channel_area_t *dst_areas; + const snd_pcm_channel_area_t *src_areas; + + bits = snd_pcm_format_physical_width(pcm->format); + if ((bits % 8) != 0) +- interleaved = 0; ++ goto __nointerleaved; + channels = dmix->channels; ++ if (channels != dmix->spcm->channels) ++ goto __nointerleaved; + dst_areas = snd_pcm_mmap_areas(dmix->spcm); + src_areas = snd_pcm_mmap_areas(pcm); + for (chn = 1; chn < channels; chn++) { +- if (dst_areas[chn-1].addr != dst_areas[chn].addr) { +- interleaved = 0; +- break; +- } +- if (src_areas[chn-1].addr != src_areas[chn].addr) { +- interleaved = 0; +- break; +- } ++ if (dst_areas[chn-1].addr != dst_areas[chn].addr) ++ goto __nointerleaved; ++ if (src_areas[chn-1].addr != src_areas[chn].addr) ++ goto __nointerleaved; + } + for (chn = 0; chn < channels; chn++) { +- if (dmix->bindings && dmix->bindings[chn] != chn) { +- interleaved = 0; +- break; +- } ++ if (dmix->bindings && dmix->bindings[chn] != chn) ++ goto __nointerleaved; + if (dst_areas[chn].first != chn * bits || +- dst_areas[chn].step != channels * bits) { +- interleaved = 0; +- break; +- } ++ dst_areas[chn].step != channels * bits) ++ goto __nointerleaved; + if (src_areas[chn].first != chn * bits || +- src_areas[chn].step != channels * bits) { +- interleaved = 0; +- break; +- } ++ src_areas[chn].step != channels * bits) ++ goto __nointerleaved; + } +- return dmix->interleaved = interleaved; ++ return dmix->interleaved = 1; ++__nointerleaved: ++ return dmix->interleaved = 0; + } + + /* +-- +2.31.1 + + +From ccc14ae897d170156f1c2905ea5d18a3295e7b36 Mon Sep 17 00:00:00 2001 +From: "Tanjeff-N. Moos" +Date: Thu, 17 Jun 2021 10:36:38 +0200 +Subject: [PATCH 09/20] control: Add documentation for snd_ctl_card_* and + friends. + +In this patch series, I added a description about control interface +handling and how control interfaces are identified. + +In addition, I added/improved Doxygen documentation for the +snd_ctl_card_info_t type and related corresponding functions, +e.g. snd_ctl_card_info(). I also documented other card-related like +snd_card_next(). + +Along the way I did minor documentation improvements. + +Signed-off-by: Tanjeff-N. Moos +Signed-off-by: Takashi Iwai +--- + include/control.h | 40 +++++++++- + src/control/cards.c | 56 +++++++++----- + src/control/control.c | 175 +++++++++++++++++++++++++++++++----------- + 3 files changed, 202 insertions(+), 69 deletions(-) + +diff --git a/include/control.h b/include/control.h +index ccf906e2..9ebb4905 100644 +--- a/include/control.h ++++ b/include/control.h +@@ -50,7 +50,32 @@ typedef struct snd_aes_iec958 { + unsigned char dig_subframe[4]; /**< AES/IEC958 subframe bits */ + } snd_aes_iec958_t; + +-/** CTL card info container */ ++/** \brief CTL card info container. ++ * ++ * This type contains meta information about a sound card, such as the index, ++ * name, longname, etc. ++ * ++ * \par Memory management ++ * ++ * Before using a snd_ctl_card_info_t object, it must be allocated using ++ * snd_ctl_card_info_alloca() or snd_ctl_card_info_malloc(). When using the ++ * latter, it must be freed again using snd_ctl_card_info_free(). ++ * ++ * A card info object can be zeroed out using snd_ctl_card_info_clear(). ++ * ++ * A card info object can be copied to another one using ++ * snd_ctl_card_info_copy(). ++ * ++ * \par Obtaining the Information ++ * ++ * To obtain the card information, it must first be opened using ++ * snd_ctl_open(), and a snd_ctl_card_info_t container must be ++ * allocated. Then, the information can be read using ++ * snd_ctl_card_info_get_card(). ++ * ++ * Thereafter, the card properties can be read using the ++ * snd_ctl_card_info_get_*() functions. ++ */ + typedef struct _snd_ctl_card_info snd_ctl_card_info_t; + + /** CTL element identifier container */ +@@ -442,11 +467,20 @@ void snd_ctl_elem_id_set_name(snd_ctl_elem_id_t *obj, const char *val); + void snd_ctl_elem_id_set_index(snd_ctl_elem_id_t *obj, unsigned int val); + + size_t snd_ctl_card_info_sizeof(void); ++ + /** \hideinitializer +- * \brief allocate an invalid #snd_ctl_card_info_t using standard alloca +- * \param ptr returned pointer ++ * \brief Allocate an invalid #snd_ctl_card_info_t on the stack. ++ * ++ * Allocate space for a card info object on the stack. The allocated ++ * memory need not be freed, because it is on the stack. ++ * ++ * See snd_ctl_card_info_t for details. ++ * ++ * \param ptr Pointer to a snd_ctl_elem_value_t pointer. The address ++ * of the allocated space will returned here. + */ + #define snd_ctl_card_info_alloca(ptr) __snd_alloca(ptr, snd_ctl_card_info) ++ + int snd_ctl_card_info_malloc(snd_ctl_card_info_t **ptr); + void snd_ctl_card_info_free(snd_ctl_card_info_t *obj); + void snd_ctl_card_info_clear(snd_ctl_card_info_t *obj); +diff --git a/src/control/cards.c b/src/control/cards.c +index e57457c2..8226c42d 100644 +--- a/src/control/cards.c ++++ b/src/control/cards.c +@@ -77,8 +77,8 @@ static int snd_card_load1(int card) + + /** + * \brief Try to load the driver for a card. +- * \param card Card number. +- * \return 1 if driver is present, zero if driver is not present ++ * \param card Card index. ++ * \return 1 if driver is present, zero if driver is not present. + */ + int snd_card_load(int card) + { +@@ -86,14 +86,24 @@ int snd_card_load(int card) + } + + /** +- * \brief Try to determine the next card. +- * \param rcard pointer to card number +- * \result zero if success, otherwise a negative error code ++ * \brief Iterate over physical sound cards. ++ * ++ * This function takes the index of a physical sound card and sets it to the ++ * index of the next card. If index is -1, it is set to the index of the first ++ * card. After the last card, the index is set to -1. ++ * ++ * For example, if you have 2 sound cards (with index 0 and 1), the index will ++ * be modified as follows: ++ * ++ * - -1 --> 0 ++ * - 0 --> 1 ++ * - 1 --> -1 ++ * ++ * This does not work for virtual sound cards. + * +- * Tries to determine the next card from given card number. +- * If card number is -1, then the first available card is +- * returned. If the result card number is -1, no more cards +- * are available. ++ * \param rcard Index of current card. The index of the next card is stored ++ * here. ++ * \result zero if success, otherwise a negative error code. + */ + int snd_card_next(int *rcard) + { +@@ -114,13 +124,18 @@ int snd_card_next(int *rcard) + } + + /** +- * \brief Convert card string to an integer value. +- * \param string String containing card identifier +- * \return zero if success, otherwise a negative error code ++ * \brief Convert a card string to the card index. + * +- * The accepted format is an integer value in ASCII representation +- * or the card identifier (the id parameter for sound-card drivers). +- * The control device name like /dev/snd/controlC0 is accepted, too. ++ * This works only for physical sound cards, not for virtual cards. ++ * ++ * \param string A string identifying the card. ++ * \return The index of the card. On error, a a negative error code ++ * is returned. ++ * ++ * The accepted formats for "string" are: ++ * - The index of the card (as listed in /proc/asound/cards), given as string ++ * - The ID of the card (as listed in /proc/asound/cards) ++ * - The control device name (like /dev/snd/controlC0) + */ + int snd_card_get_index(const char *string) + { +@@ -163,8 +178,9 @@ int snd_card_get_index(const char *string) + + /** + * \brief Obtain the card name. +- * \param card Card number +- * \param name Result - card name corresponding to card number ++ * ++ * \param card The index of the card. ++ * \param name Result - card name corresponding to card index. + * \result zero if success, otherwise a negative error code + * + * The value returned in name is allocated with strdup and should be +@@ -193,9 +209,9 @@ int snd_card_get_name(int card, char **name) + + /** + * \brief Obtain the card long name. +- * \param card Card number +- * \param name Result - card long name corresponding to card number +- * \result zero if success, otherwise a negative error code ++ * \param card Index of the card. ++ * \param name Result - card long name corresponding to card index. ++ * \result Zero if success, otherwise a negative error code. + * + * The value returned in name is allocated with strdup and should be + * freed when no longer used. +diff --git a/src/control/control.c b/src/control/control.c +index ed986e54..7cf4decb 100644 +--- a/src/control/control.c ++++ b/src/control/control.c +@@ -33,8 +33,50 @@ +

Control interface is designed to access primitive controls. There is + also an interface for notifying about control and structure changes. + ++ + \section control_general_overview General overview + ++In Alsa, there are physical sound cards, such as USB headsets, and ++virtual sound cards, such as "pulse", which represents the PulseAudio ++Sound system. Each sound card offers a control interface, making its ++settings (e.g. volume knobs) available. The complete list of available ++control interfaces can be obtained using snd_device_name_hint(), ++giving -1 as card index and "ctl" as interface type. Each returned ++NAME hint identifies a control interface. ++ ++Sound cards have an ID (a string), an index (an int, sometimes called ++the "card number"), a name, a longname, a mixername and a "components" ++property. The file /proc/asound/cards lists most of these properties ++for physical sound cards. Virtual sound cards are not listed in that ++file. The format is: ++ ++\verbatim ++index [ID ] Driver - name ++ longname ++\endverbatim ++ ++Note that the mixername and components are not listed. ++ ++ ++\subsection control_cards_id Identifying and Opening Control Interfaces ++ ++To work with a control interface, is must be opened first, using ++snd_ctl_open(). This function takes the interface name. ++ ++For physical sound cards, the control interface can be identified ++using the string "hw:" (e.g. `hw:2`). The NAME hint - which is ++"hw:CARD=" - can also be used. Further, its device file (something ++like `/dev/snd/controlC0`) is also acceptable. Either of them can be ++given to snd_ctl_open(). ++ ++For virtual sound cards, the NAME hint is given to snd_ctl_open(). ++ ++The functions snd_card_get_index(), snd_card_get_name() and ++snd_card_get_longname() can be used to find an identifying property ++when another one is already known. ++ ++\section control_elements Elements ++ + In ALSA control feature, each sound card can have control elements. The elements + are managed according to below model. + +@@ -65,7 +107,7 @@ are managed according to below model. + of userspace applications and drivers in kernel. + + +-\section identifying_elements Identifying Elements ++\subsection identifying_elements Identifying Elements + + Each element has the following identifying properties: + +@@ -84,7 +126,7 @@ but in practice this is rare). The numid can change on each boot. + In case of an USB sound card, the numid can also change when it + is reconnected. The short numid is used to reduce the lookup time. + +-\section element_lists Element Lists ++\subsection element_lists Element Lists + + An element list can be used to obtain a list of all elements of the + sound card. The list contains generic information (e.g. how many +@@ -93,7 +135,7 @@ elements the card has), and the identifying properties of the elements + element lists. + + +-\section working_with_elements Working with Elements ++\subsection working_with_elements Working with Elements + + It is possible to obtain information about an element using the + snd_ctl_elem_info_*() functions. For enums, the allowed values can be +@@ -108,7 +150,7 @@ actual values or settings. It is also possible to get and set the ID + values (such as the numid or the name). + + +-\section element_sets Element Sets ++\subsection element_sets Element Sets + + The type of element set is one of integer, integer64, boolean, enumerators, + bytes and IEC958 structure. This indicates the type of value for each member in +@@ -329,10 +371,15 @@ int snd_ctl_subscribe_events(snd_ctl_t *ctl, int subscribe) + + + /** +- * \brief Get card related information +- * \param ctl CTL handle +- * \param info Card info pointer +- * \return 0 on success otherwise a negative error code ++ * \brief Get information about the sound card. ++ * ++ * Obtain information about the sound card previously opened using ++ * snd_ctl_open(). The object "info" must be allocated prior to calling this ++ * function. See snd_ctl_card_info_t for details. ++ * ++ * \param ctl The CTL handle. ++ * \param info The card information is stored here. ++ * \return 0 on success, otherwise a negative error code. + */ + int snd_ctl_card_info(snd_ctl_t *ctl, snd_ctl_card_info_t *info) + { +@@ -1508,11 +1555,13 @@ int _snd_ctl_open_named_child(snd_ctl_t **pctl, const char *name, + #endif + + /** +- * \brief Opens a CTL +- * \param ctlp Returned CTL handle +- * \param name ASCII identifier of the CTL handle +- * \param mode Open mode (see #SND_CTL_NONBLOCK, #SND_CTL_ASYNC) +- * \return 0 on success otherwise a negative error code ++ * \brief Opens a sound card. ++ * ++ * \param ctlp Returned CTL handle. ++ * \param name A string identifying the card (See \ref control_cards_id). ++ * \param mode Open mode (see #SND_CTL_NONBLOCK, #SND_CTL_ASYNC). ++ * ++ * \return 0 on success otherwise a negative error code. + */ + int snd_ctl_open(snd_ctl_t **ctlp, const char *name, int mode) + { +@@ -2027,8 +2076,8 @@ void snd_ctl_elem_id_set_index(snd_ctl_elem_id_t *obj, unsigned int val) + } + + /** +- * \brief get size of #snd_ctl_card_info_t +- * \return size in bytes ++ * \brief get size of #snd_ctl_card_info_t. ++ * \return Size in bytes. + */ + size_t snd_ctl_card_info_sizeof() + { +@@ -2036,9 +2085,16 @@ size_t snd_ctl_card_info_sizeof() + } + + /** +- * \brief allocate an invalid #snd_ctl_card_info_t using standard malloc +- * \param ptr returned pointer +- * \return 0 on success otherwise negative error code ++ * \brief Allocate an invalid #snd_ctl_card_info_t on the heap. ++ * ++ * Allocate space for a card info object on the heap. The allocated memory ++ * must be freed using snd_ctl_card_info_free(). ++ * ++ * See snd_ctl_card_info_t for details. ++ * ++ * \param ptr Pointer to a snd_ctl_card_info_t pointer. The address ++ * of the allocated space will be returned here. ++ * \return 0 on success, otherwise a negative error code. + */ + int snd_ctl_card_info_malloc(snd_ctl_card_info_t **ptr) + { +@@ -2050,8 +2106,10 @@ int snd_ctl_card_info_malloc(snd_ctl_card_info_t **ptr) + } + + /** +- * \brief frees a previously allocated #snd_ctl_card_info_t +- * \param obj pointer to object to free ++ * \brief Free an #snd_ctl_card_info_t previously allocated using ++ * snd_ctl_card_info_malloc(). ++ * ++ * \param obj Pointer to the snd_ctl_card_info_t. + */ + void snd_ctl_card_info_free(snd_ctl_card_info_t *obj) + { +@@ -2059,8 +2117,11 @@ void snd_ctl_card_info_free(snd_ctl_card_info_t *obj) + } + + /** +- * \brief clear given #snd_ctl_card_info_t object +- * \param obj pointer to object to clear ++ * \brief Clear given card info object. ++ * ++ * See snd_ctl_elem_value_t for details. ++ * ++ * \param obj Card info object. + */ + void snd_ctl_card_info_clear(snd_ctl_card_info_t *obj) + { +@@ -2068,9 +2129,10 @@ void snd_ctl_card_info_clear(snd_ctl_card_info_t *obj) + } + + /** +- * \brief copy one #snd_ctl_card_info_t to another +- * \param dst pointer to destination +- * \param src pointer to source ++ * \brief Bitwise copy of a #snd_ctl_card_info_t object. ++ * ++ * \param dst Pointer to destination. ++ * \param src Pointer to source. + */ + void snd_ctl_card_info_copy(snd_ctl_card_info_t *dst, const snd_ctl_card_info_t *src) + { +@@ -2079,9 +2141,12 @@ void snd_ctl_card_info_copy(snd_ctl_card_info_t *dst, const snd_ctl_card_info_t + } + + /** +- * \brief Get card number from a CTL card info +- * \param obj CTL card info +- * \return card number ++ * \brief Get the sound card index from the given info object. ++ * ++ * See snd_ctl_card_info_t for more details. ++ * ++ * \param obj The card info object. ++ * \return Sound card index. + */ + int snd_ctl_card_info_get_card(const snd_ctl_card_info_t *obj) + { +@@ -2090,9 +2155,12 @@ int snd_ctl_card_info_get_card(const snd_ctl_card_info_t *obj) + } + + /** +- * \brief Get card identifier from a CTL card info +- * \param obj CTL card info +- * \return card identifier ++ * \brief Get the sound card ID from the given info object. ++ * ++ * See snd_ctl_card_info_t for more details. ++ * ++ * \param obj The card info object. ++ * \return Sound card ID. + */ + const char *snd_ctl_card_info_get_id(const snd_ctl_card_info_t *obj) + { +@@ -2101,9 +2169,12 @@ const char *snd_ctl_card_info_get_id(const snd_ctl_card_info_t *obj) + } + + /** +- * \brief Get card driver name from a CTL card info +- * \param obj CTL card info +- * \return card driver name ++ * \brief Get the sound card driver from the given info object. ++ * ++ * See snd_ctl_card_info_t for more details. ++ * ++ * \param obj The card info object. ++ * \return The sound card driver. + */ + const char *snd_ctl_card_info_get_driver(const snd_ctl_card_info_t *obj) + { +@@ -2112,9 +2183,12 @@ const char *snd_ctl_card_info_get_driver(const snd_ctl_card_info_t *obj) + } + + /** +- * \brief Get card name from a CTL card info +- * \param obj CTL card info +- * \return card name ++ * \brief Get the sound card name from the given info object. ++ * ++ * See snd_ctl_card_info_t for more details. ++ * ++ * \param obj The card info object. ++ * \return Sound card name. + */ + const char *snd_ctl_card_info_get_name(const snd_ctl_card_info_t *obj) + { +@@ -2123,9 +2197,12 @@ const char *snd_ctl_card_info_get_name(const snd_ctl_card_info_t *obj) + } + + /** +- * \brief Get card long name from a CTL card info +- * \param obj CTL card info +- * \return card long name ++ * \brief Get the sound cards long name from the given info object. ++ * ++ * See snd_ctl_card_info_t for more details. ++ * ++ * \param obj The card info object. ++ * \return Sound cards long name. + */ + const char *snd_ctl_card_info_get_longname(const snd_ctl_card_info_t *obj) + { +@@ -2134,9 +2211,12 @@ const char *snd_ctl_card_info_get_longname(const snd_ctl_card_info_t *obj) + } + + /** +- * \brief Get card mixer name from a CTL card info +- * \param obj CTL card info +- * \return card mixer name ++ * \brief Get the sound card mixer name from the given info object. ++ * ++ * See snd_ctl_card_info_t for more details. ++ * ++ * \param obj The card info object. ++ * \return Sound card mixer name. + */ + const char *snd_ctl_card_info_get_mixername(const snd_ctl_card_info_t *obj) + { +@@ -2145,9 +2225,12 @@ const char *snd_ctl_card_info_get_mixername(const snd_ctl_card_info_t *obj) + } + + /** +- * \brief Get card component list from a CTL card info +- * \param obj CTL card info +- * \return card mixer identifier ++ * \brief Get the sound cards "components" property from the given info object. ++ * ++ * See snd_ctl_card_info_t for more details. ++ * ++ * \param obj The card info object. ++ * \return Sound cards "components" property. + */ + const char *snd_ctl_card_info_get_components(const snd_ctl_card_info_t *obj) + { +-- +2.31.1 + + +From 7ba3f888d07cafbad04391b915db23408c663dad Mon Sep 17 00:00:00 2001 +From: "Tanjeff-N. Moos" +Date: Thu, 17 Jun 2021 10:36:39 +0200 +Subject: [PATCH 10/20] control: Minor documentation fixes. + +Signed-off-by: Tanjeff-N. Moos +Signed-off-by: Takashi Iwai +--- + include/control.h | 9 +++++++-- + src/control/cards.c | 5 ++++- + src/control/control.c | 2 +- + 3 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/include/control.h b/include/control.h +index 9ebb4905..e386ecec 100644 +--- a/include/control.h ++++ b/include/control.h +@@ -155,7 +155,7 @@ typedef struct _snd_ctl_elem_list snd_ctl_elem_list_t; + /** CTL element info container */ + typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t; + +-/** CTL element value container ++/** CTL element value container. + * + * Contains the value(s) (i.e. members) of a single element. All + * values of a given element are of the same type. +@@ -167,6 +167,11 @@ typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t; + * using the latter, it must be freed again using + * snd_ctl_elem_value_free(). + * ++ * A value object can be zeroed out using snd_ctl_elem_value_clear(). ++ * ++ * A value object can be copied to another one using ++ * snd_ctl_elem_value_copy(). ++ * + * \par Identifier + * + * Then, the ID must be filled. It is sufficient to fill only the +@@ -621,7 +626,7 @@ size_t snd_ctl_elem_value_sizeof(void); + * \brief Allocate an invalid #snd_ctl_elem_value_t on the stack. + * + * Allocate space for a value object on the stack. The allocated +- * memory need not be freed, because is on the stack. ++ * memory need not be freed, because it is on the stack. + * + * See snd_ctl_elem_value_t for details. + * +diff --git a/src/control/cards.c b/src/control/cards.c +index 8226c42d..6145ebcd 100644 +--- a/src/control/cards.c ++++ b/src/control/cards.c +@@ -147,6 +147,7 @@ int snd_card_get_index(const char *string) + return -EINVAL; + if ((isdigit(*string) && *(string + 1) == 0) || + (isdigit(*string) && isdigit(*(string + 1)) && *(string + 2) == 0)) { ++ /* We got an index */ + if (sscanf(string, "%i", &card) != 1) + return -EINVAL; + if (card < 0 || card >= SND_MAX_CARDS) +@@ -156,8 +157,10 @@ int snd_card_get_index(const char *string) + return card; + return err; + } +- if (string[0] == '/') /* device name */ ++ if (string[0] == '/') ++ /* We got a device name */ + return snd_card_load2(string); ++ /* We got in ID */ + for (card = 0; card < SND_MAX_CARDS; card++) { + #ifdef SUPPORT_ALOAD + if (! snd_card_load(card)) +diff --git a/src/control/control.c b/src/control/control.c +index 7cf4decb..91415b51 100644 +--- a/src/control/control.c ++++ b/src/control/control.c +@@ -3127,7 +3127,7 @@ size_t snd_ctl_elem_value_sizeof() + /** + * \brief Allocate an invalid #snd_ctl_elem_value_t on the heap. + * +- * Allocate space for a value object on the head. The allocated memory ++ * Allocate space for a value object on the heap. The allocated memory + * must be freed using snd_ctl_elem_value_free(). + * + * See snd_ctl_elem_value_t for details. +-- +2.31.1 + + +From f4f29d42be8b8ad60ea4c5697374adad4bfe6868 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 28 Jun 2021 12:08:53 +0200 +Subject: [PATCH 11/20] fix build with --disable-ucm + +Link: https://mailman.alsa-project.org/pipermail/alsa-devel/2021-June/186729.html +Reported-by: Michael Forney +Signed-off-by: Jaroslav Kysela +--- + include/local.h | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/include/local.h b/include/local.h +index 4e7d88a0..7cfcec53 100644 +--- a/include/local.h ++++ b/include/local.h +@@ -374,6 +374,8 @@ int _snd_config_load_with_include(snd_config_t *config, snd_input_t *in, + void *INTERNAL(snd_dlopen)(const char *name, int mode, char *errbuf, size_t errbuflen); + #endif + ++#ifdef BUILD_UCM ++ + const char *uc_mgr_alibcfg_by_device(snd_config_t **config, const char *name); + + static inline int _snd_is_ucm_device(const char *name) +@@ -381,4 +383,12 @@ static inline int _snd_is_ucm_device(const char *name) + return name && name[0] == '_' && name[1] == 'u' && name[2] == 'c' && name[3] == 'm'; + } + ++#else ++ ++static inline const char *uc_mgr_alibcfg_by_device(snd_config_t **config, const char *name) { return NULL; } ++static inline int _snd_is_ucm_device(const char *name) { return 0; } ++ ++ ++#endif ++ + #endif +-- +2.31.1 + + +From 1a1f0fb244c477c430e156da878475ef57d198f9 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 28 Jun 2021 12:11:54 +0200 +Subject: [PATCH 12/20] pcm: rate - fix some gcc warnings + +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_rate.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c +index 13111d29..c45895a9 100644 +--- a/src/pcm/pcm_rate.c ++++ b/src/pcm/pcm_rate.c +@@ -82,12 +82,12 @@ struct _snd_pcm_rate { + + /* allocate a channel area and a temporary buffer for the given size */ + static snd_pcm_channel_area_t * +-rate_alloc_tmp_buf(snd_pcm_rate_t *rate, snd_pcm_format_t format, ++rate_alloc_tmp_buf(snd_pcm_format_t format, + unsigned int channels, unsigned int frames) + { + snd_pcm_channel_area_t *ap; + int width = snd_pcm_format_physical_width(format); +- int i; ++ unsigned int i; + + ap = malloc(sizeof(*ap) * channels); + if (!ap) +@@ -354,7 +354,7 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + snd_pcm_rate_t *rate = pcm->private_data; + snd_pcm_t *slave = rate->gen.slave; + snd_pcm_rate_side_info_t *sinfo, *cinfo; +- unsigned int channels, cwidth, swidth, chn, acc; ++ unsigned int channels, acc; + int need_src_buf, need_dst_buf; + int err = snd_pcm_hw_params_slave(pcm, params, + snd_pcm_rate_hw_refine_cchange, +@@ -401,9 +401,9 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + return -EBUSY; + } + +- rate->pareas = rate_alloc_tmp_buf(rate, cinfo->format, channels, ++ rate->pareas = rate_alloc_tmp_buf(cinfo->format, channels, + cinfo->period_size); +- rate->sareas = rate_alloc_tmp_buf(rate, sinfo->format, channels, ++ rate->sareas = rate_alloc_tmp_buf(sinfo->format, channels, + sinfo->period_size); + if (!rate->pareas || !rate->sareas) { + err = -ENOMEM; +@@ -442,7 +442,7 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + rate->src_conv_idx = + snd_pcm_linear_convert_index(rate->orig_in_format, + rate->info.in.format); +- rate->src_buf = rate_alloc_tmp_buf(rate, rate->info.in.format, ++ rate->src_buf = rate_alloc_tmp_buf(rate->info.in.format, + channels, rate->info.in.period_size); + if (!rate->src_buf) { + err = -ENOMEM; +@@ -454,7 +454,7 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) + rate->dst_conv_idx = + snd_pcm_linear_convert_index(rate->info.out.format, + rate->orig_out_format); +- rate->dst_buf = rate_alloc_tmp_buf(rate, rate->info.out.format, ++ rate->dst_buf = rate_alloc_tmp_buf(rate->info.out.format, + channels, rate->info.out.period_size); + if (!rate->dst_buf) { + err = -ENOMEM; +-- +2.31.1 + + +From e47c11822d6b459a9b3704b3ee6a4a5c9a1b85be Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 29 Jun 2021 18:02:27 +0200 +Subject: [PATCH 13/20] control: remap - assign right name to the child handle + for no-op + +Fixes: https://github.com/alsa-project/alsa-utils/issues/100 +Signed-off-by: Jaroslav Kysela +--- + src/control/control_remap.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/control/control_remap.c b/src/control/control_remap.c +index a85c1725..81524014 100644 +--- a/src/control/control_remap.c ++++ b/src/control/control_remap.c +@@ -1173,6 +1173,10 @@ int snd_ctl_remap_open(snd_ctl_t **handlep, const char *name, snd_config_t *rema + /* no-op check, remove the plugin */ + if (priv->map_items == 0 && priv->remap_items == 0) { + remap_free(priv); ++ free(child->name); ++ child->name = name ? strdup(name) : NULL; ++ if (name && !child->name) ++ return -ENOMEM; + *handlep = child; + return 0; + } +-- +2.31.1 + + +From 23a191a82c693456e61431ab699cddc1e5782a26 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 29 Jun 2021 19:31:28 +0200 +Subject: [PATCH 14/20] control: remap - assign right name to the child handle + for no-op (2nd case) + +Fixes: https://github.com/alsa-project/alsa-utils/issues/100 +Signed-off-by: Jaroslav Kysela +--- + src/control/control_remap.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/control/control_remap.c b/src/control/control_remap.c +index 81524014..4914f960 100644 +--- a/src/control/control_remap.c ++++ b/src/control/control_remap.c +@@ -1154,6 +1154,10 @@ int snd_ctl_remap_open(snd_ctl_t **handlep, const char *name, snd_config_t *rema + snd_ctl_t *ctl; + int result, err; + ++ /* no-op, remove the plugin */ ++ if (!remap && !map) ++ goto _noop; ++ + priv = calloc(1, sizeof(*priv)); + if (priv == NULL) + return -ENOMEM; +@@ -1173,6 +1177,7 @@ int snd_ctl_remap_open(snd_ctl_t **handlep, const char *name, snd_config_t *rema + /* no-op check, remove the plugin */ + if (priv->map_items == 0 && priv->remap_items == 0) { + remap_free(priv); ++ _noop: + free(child->name); + child->name = name ? strdup(name) : NULL; + if (name && !child->name) +@@ -1316,11 +1321,6 @@ int _snd_ctl_remap_open(snd_ctl_t **handlep, char *name, snd_config_t *root, snd + err = _snd_ctl_open_child(&cctl, root, child, mode, conf); + if (err < 0) + return err; +- /* no-op, remove the plugin */ +- if (!remap && !map) { +- *handlep = cctl; +- return 0; +- } + err = snd_ctl_remap_open(handlep, name, remap, map, cctl, mode); + if (err < 0) + snd_ctl_close(cctl); +-- +2.31.1 + + +From 7d40a76ef5494e08af00fa4e7bfefbd43aba4827 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 31 Aug 2021 09:25:12 +0200 +Subject: [PATCH 19/20] ucm: avoid zero card instance number + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/utils.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/ucm/utils.c b/src/ucm/utils.c +index f3a8c9ba..10b21c34 100644 +--- a/src/ucm/utils.c ++++ b/src/ucm/utils.c +@@ -780,6 +780,9 @@ int uc_mgr_card_open(snd_use_case_mgr_t *uc_mgr) + while (uc_mgr_card_find(ucm_card_assign)) { + ucm_card_assign++; + ucm_card_assign &= 0xffff; ++ /* avoid zero card instance number */ ++ if (ucm_card_assign == 0) ++ ucm_card_assign++; + if (ucm_card_assign == prev) { + pthread_mutex_unlock(&ucm_cards_mutex); + return -ENOMEM; +-- +2.31.1 + + +From 4a52ae4c329ae17117375a4b85b80f37994a4044 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 31 Aug 2021 09:40:42 +0200 +Subject: [PATCH 20/20] ucm: fix the parsing of the hexadecimal prefix + +The safe_strtol() function use strtol() which expects +to have the '0x' prefix for the hexadecimal number (when +base argument is zero). + +BugLink: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1553 +Signed-off-by: Jaroslav Kysela +--- + src/ucm/utils.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/ucm/utils.c b/src/ucm/utils.c +index 10b21c34..2fbc4c8c 100644 +--- a/src/ucm/utils.c ++++ b/src/ucm/utils.c +@@ -811,7 +811,7 @@ void uc_mgr_card_close(snd_use_case_mgr_t *uc_mgr) + */ + const char *uc_mgr_alibcfg_by_device(snd_config_t **top, const char *name) + { +- char buf[5]; ++ char buf[7]; + long card_num; + snd_config_t *config; + snd_use_case_mgr_t *uc_mgr; +@@ -819,8 +819,10 @@ const char *uc_mgr_alibcfg_by_device(snd_config_t **top, const char *name) + + if (strncmp(name, "_ucm", 4) || strlen(name) < 12 || name[8] != '.') + return NULL; +- strncpy(buf, name + 4, 4); +- buf[4] = '\0'; ++ buf[0] = '0'; ++ buf[1] = 'x'; ++ strncpy(buf + 2, name + 4, 4); ++ buf[6] = '\0'; + err = safe_strtol(buf, &card_num); + if (err < 0 || card_num < 0 || card_num > 0xffff) + return NULL; +-- +2.31.1 + diff --git a/alsa-lib.spec b/alsa-lib.spec index d923688..8ff5b53 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Tue Aug 31 2021 Jaroslav Kysela - 1.2.5.1-2 +- add UCM related fixes + * Mon Jun 14 2021 Jaroslav Kysela - 1.2.5.1-1 - update to 1.2.5.1 From 4f7869e8258c9827aeaa0bf064eda0b08c2e3ebe Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sat, 13 Nov 2021 12:20:58 +0000 Subject: [PATCH 13/68] Add Rockchip ES8316 support (from upstreama) --- alsa-lib.spec | 5 +- alsa-ucm-conf.patch | 147 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 151 insertions(+), 1 deletion(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index fe19b44..5493e3c 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 3%{?prever_dot}%{?dist} +Release: 4%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Sat Nov 13 2021 Peter Robinson - 1.2.5.1-4 +- Add Rockchip ES8316 support + * Tue Aug 31 2021 Jaroslav Kysela - 1.2.5.1-3 - add UCM related fixes diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index e69de29..0ceffd8 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -0,0 +1,147 @@ +From 85eea19783cfccaccd859e303fda62adb63c219d Mon Sep 17 00:00:00 2001 +From: Jian-Hong Pan +Date: Tue, 7 Sep 2021 11:38:14 +0800 +Subject: [PATCH] ucm2: Add UCM support for rockchip_es8316 on Pinebook Pro + +Add UCM config files for Pinebook Pro's audio. The config files are +transformed and tuned from Manjaro ARM's packages: +* pinebookpro-post-install's asound.state [1] +* pinebookpro-audio's audio_jack_plugged_in.sh [2] + +By the way, with these config files, the Speaker and Headphones will be +switched according to the (un)plugged state automatically. + +[1] https://gitlab.manjaro.org/manjaro-arm/packages/community/pinebookpro-post-install/-/blob/4b4206c57b21044bf9c00848bd1f8b6f710d19eb/asound.state +[2] https://gitlab.manjaro.org/manjaro-arm/packages/community/pinebookpro-audio/-/blob/1f567db09495acc3beb5405c9ef85c3c07b86785/audio_jack_plugged_in.sh + +Fixes: https://github.com/alsa-project/alsa-ucm-conf/issues/110 +Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/112 +Signed-off-by: Jian-Hong Pan +Signed-off-by: Jaroslav Kysela +--- + ucm2/Rockchip/es8316/HiFi.conf | 66 +++++++++++++++++++ + ucm2/Rockchip/es8316/es8316.conf | 29 ++++++++ + .../rockchip_es8316/rockchip_es8316.conf | 1 + + 3 files changed, 96 insertions(+) + create mode 100644 ucm2/Rockchip/es8316/HiFi.conf + create mode 100644 ucm2/Rockchip/es8316/es8316.conf + create mode 120000 ucm2/conf.d/rockchip_es8316/rockchip_es8316.conf + +diff --git a/ucm2/Rockchip/es8316/HiFi.conf b/ucm2/Rockchip/es8316/HiFi.conf +new file mode 100644 +index 0000000..2124ded +--- /dev/null ++++ b/ucm2/Rockchip/es8316/HiFi.conf +@@ -0,0 +1,66 @@ ++# Reference: ++# https://gitlab.manjaro.org/manjaro-arm/packages/community/pinebookpro-post-install/-/blob/4b4206c57b21044bf9c00848bd1f8b6f710d19eb/asound.state ++# https://gitlab.manjaro.org/manjaro-arm/packages/community/pinebookpro-audio/-/blob/1f567db09495acc3beb5405c9ef85c3c07b86785/audio_jack_plugged_in.sh ++ ++SectionDevice."Speaker" { ++ Comment "Speaker" ++ ++ ConflictingDevice [ ++ "Headphones" ++ ] ++ ++ EnableSequence [ ++ cset "name='Playback Polarity' 'R Invert'" ++ cset "name='Speaker Switch' on" ++ ] ++ ++ DisableSequence [ ++ cset "name='Speaker Switch' off" ++ ] ++ ++ Value { ++ PlaybackPriority 100 ++ PlaybackPCM "hw:${CardId}" ++ PlaybackMixerElem "Headphone Mixer" ++ PlaybackMasterElem "DAC" ++ } ++} ++ ++SectionDevice."Mic" { ++ Comment "Internal Microphone" ++ ++ EnableSequence [ ++ cset "name='Differential Mux' lin1-rin1" ++ ] ++ ++ Value { ++ CapturePriority 100 ++ CapturePCM "hw:${CardId}" ++ CaptureMixerElem "ADC PGA Gain" ++ CaptureMasterElem "ADC" ++ } ++} ++ ++SectionDevice."Headphones" { ++ Comment "Headphones" ++ ++ ConflictingDevice [ ++ "Speaker" ++ ] ++ ++ EnableSequence [ ++ cset "name='Playback Polarity' 'Normal'" ++ ] ++ DisableSequence [ ++ cset "name='Playback Polarity' 'R Invert'" ++ ] ++ ++ Value { ++ PlaybackPriority 200 ++ PlaybackPCM "hw:${CardId}" ++ PlaybackMixerElem "Headphone Mixer" ++ PlaybackMasterElem "DAC" ++ JackControl "Headphones Jack" ++ JackHWMute "Speaker" ++ } ++} +diff --git a/ucm2/Rockchip/es8316/es8316.conf b/ucm2/Rockchip/es8316/es8316.conf +new file mode 100644 +index 0000000..62044e6 +--- /dev/null ++++ b/ucm2/Rockchip/es8316/es8316.conf +@@ -0,0 +1,29 @@ ++Syntax 3 ++ ++SectionUseCase."HiFi" { ++ File "/Rockchip/es8316/HiFi.conf" ++ Comment "Play HiFi quality Music" ++} ++ ++BootSequence [ ++ # Disable all outputs ++ cset "name='Speaker Switch' off" ++ ++ # Set HP vol to 0 dB (3/3) ++ cset "name='Headphone Playback Volume' 3" ++ # Set HP mixer vol to 0 dB ++ cset "name='Headphone Mixer Volume' 11" ++ # Set DAC vol to 0 dB (192/192) ++ cset "name='DAC Playback Volume' 192" ++ ++ # Disable Auto Level Control ++ cset "name='ALC Capture Switch' off" ++ # Set ADC vol to 0 dB (192/192) ++ cset "name='ADC Capture Volume' 192" ++ # Set Mic amplifier to +16 dB ++ cset "name='ADC PGA Gain Volume' 7" ++ ++ # Setup muxes / switches ++ cset "name='Left Headphone Mixer Left DAC Switch' on" ++ cset "name='Right Headphone Mixer Right DAC Switch' on" ++] +diff --git a/ucm2/conf.d/rockchip_es8316/rockchip_es8316.conf b/ucm2/conf.d/rockchip_es8316/rockchip_es8316.conf +new file mode 120000 +index 0000000..6d1864f +--- /dev/null ++++ b/ucm2/conf.d/rockchip_es8316/rockchip_es8316.conf +@@ -0,0 +1 @@ ++../../Rockchip/es8316/es8316.conf +\ No newline at end of file +-- +2.33.1 + From f42322213844fd97c4daf83ab60145a3709a586d Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 6 Dec 2021 13:17:48 +0100 Subject: [PATCH 14/68] update to 1.2.6 --- alsa-git.patch | 1916 ------------------------------------------- alsa-lib.spec | 9 +- alsa-ucm-conf.patch | 147 ---- sources | 4 +- 4 files changed, 8 insertions(+), 2068 deletions(-) diff --git a/alsa-git.patch b/alsa-git.patch index f88de1b..e69de29 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -1,1916 +0,0 @@ -From 81e7923fbfad45b2f353a4d6e3053af51f5f7d0b Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 15 Jun 2021 23:21:42 +0200 -Subject: [PATCH 01/20] control: empty - fix the static build - -Reported-by: Jan Palus -Fixes: https://github.com/alsa-project/alsa-lib/issues/157 -Signed-off-by: Jaroslav Kysela ---- - src/control/control_empty.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/control/control_empty.c b/src/control/control_empty.c -index 49d1026c..c9b048c1 100644 ---- a/src/control/control_empty.c -+++ b/src/control/control_empty.c -@@ -30,7 +30,7 @@ - - #ifndef PIC - /* entry for static linking */ --const char *_snd_module_ctl_empty = ""; -+const char *_snd_module_control_empty = ""; - #endif - - /*! \page control_plugins --- -2.31.1 - - -From 5089358aa99d698bd846b05c1890a09613d740b3 Mon Sep 17 00:00:00 2001 -From: Takashi Iwai -Date: Thu, 17 Jun 2021 10:20:25 +0200 -Subject: [PATCH 02/20] pcm: rate: Refactoring temporary buffer allocations - -Introduce common helpers to allocate and release the temporary buffers -and the associated snd_pcm_channel. Now two allocated objects are -used instead of one malloc to be split. - -Also, change the snd_pcm_channel set up to be in interleaved mode. -This will be necessary in the following change in the rate plugin. - -Signed-off-by: Takashi Iwai ---- - src/pcm/pcm_rate.c | 80 ++++++++++++++++++++++++++++------------------ - 1 file changed, 49 insertions(+), 31 deletions(-) - -diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c -index 770aafea..1e996134 100644 ---- a/src/pcm/pcm_rate.c -+++ b/src/pcm/pcm_rate.c -@@ -76,6 +76,45 @@ struct _snd_pcm_rate { - - #endif /* DOC_HIDDEN */ - -+/* allocate a channel area and a temporary buffer for the given size */ -+static snd_pcm_channel_area_t * -+rate_alloc_tmp_buf(snd_pcm_rate_t *rate, snd_pcm_format_t format, -+ unsigned int channels, unsigned int frames) -+{ -+ snd_pcm_channel_area_t *ap; -+ int width = snd_pcm_format_physical_width(format); -+ int i; -+ -+ ap = malloc(sizeof(*ap) * channels); -+ if (!ap) -+ return NULL; -+ ap->addr = malloc(frames * channels * width / 8); -+ if (!ap->addr) { -+ free(ap); -+ return NULL; -+ } -+ -+ /* set up in interleaved format */ -+ for (i = 0; i < channels; i++) { -+ ap[i].addr = ap[0].addr + (i * width) / 8; -+ ap[i].first = 0; -+ ap[i].step = width * channels; -+ } -+ -+ return ap; -+} -+ -+static void rate_free_tmp_buf(snd_pcm_channel_area_t **ptr) -+{ -+ snd_pcm_channel_area_t *c = *ptr; -+ -+ if (c) { -+ free(c->addr); -+ free(c); -+ *ptr = NULL; -+ } -+} -+ - static int snd_pcm_rate_hw_refine_cprepare(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_hw_params_t *params) - { - snd_pcm_rate_t *rate = pcm->private_data; -@@ -286,28 +325,13 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - if (err < 0) - return err; - -- rate->pareas = malloc(2 * channels * sizeof(*rate->pareas)); -- if (rate->pareas == NULL) -+ rate->pareas = rate_alloc_tmp_buf(rate, cinfo->format, channels, -+ cinfo->period_size); -+ rate->sareas = rate_alloc_tmp_buf(rate, sinfo->format, channels, -+ sinfo->period_size); -+ if (!rate->pareas || !rate->sareas) - goto error; - -- cwidth = snd_pcm_format_physical_width(cinfo->format); -- swidth = snd_pcm_format_physical_width(sinfo->format); -- rate->pareas[0].addr = malloc(((cwidth * channels * cinfo->period_size) / 8) + -- ((swidth * channels * sinfo->period_size) / 8)); -- if (rate->pareas[0].addr == NULL) -- goto error; -- -- rate->sareas = rate->pareas + channels; -- rate->sareas[0].addr = (char *)rate->pareas[0].addr + ((cwidth * channels * cinfo->period_size) / 8); -- for (chn = 0; chn < channels; chn++) { -- rate->pareas[chn].addr = (char *)rate->pareas[0].addr + (cwidth * chn * cinfo->period_size) / 8; -- rate->pareas[chn].first = 0; -- rate->pareas[chn].step = cwidth; -- rate->sareas[chn].addr = (char *)rate->sareas[0].addr + (swidth * chn * sinfo->period_size) / 8; -- rate->sareas[chn].first = 0; -- rate->sareas[chn].step = swidth; -- } -- - if (rate->ops.convert_s16) { - rate->get_idx = snd_pcm_linear_get_index(rate->info.in.format, SND_PCM_FORMAT_S16); - rate->put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S16, rate->info.out.format); -@@ -322,11 +346,8 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - return 0; - - error: -- if (rate->pareas) { -- free(rate->pareas[0].addr); -- free(rate->pareas); -- rate->pareas = NULL; -- } -+ rate_free_tmp_buf(&rate->pareas); -+ rate_free_tmp_buf(&rate->sareas); - if (rate->ops.free) - rate->ops.free(rate->obj); - return -ENOMEM; -@@ -335,12 +356,9 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - static int snd_pcm_rate_hw_free(snd_pcm_t *pcm) - { - snd_pcm_rate_t *rate = pcm->private_data; -- if (rate->pareas) { -- free(rate->pareas[0].addr); -- free(rate->pareas); -- rate->pareas = NULL; -- rate->sareas = NULL; -- } -+ -+ rate_free_tmp_buf(&rate->pareas); -+ rate_free_tmp_buf(&rate->sareas); - if (rate->ops.free) - rate->ops.free(rate->obj); - free(rate->src_buf); --- -2.31.1 - - -From 119d9c1678b1193f8b969a6483cae1f7bf95e609 Mon Sep 17 00:00:00 2001 -From: Takashi Iwai -Date: Thu, 17 Jun 2021 10:03:17 +0200 -Subject: [PATCH 03/20] pcm: rate: Improve the support multiple formats - -This patch extends the PCM rate plugin for allowing its converter -plugin to deal with multiple formats. Currently, the converter plugin -is allowed to take different formats only when convert callback is -defined. And for this way (so far only the standard linear rate -plugin does), all linear formats have to be handled, and it's -cumbersome. - -OTOH, most other rate plugins are implemented with convert_s16 -callback, which accepts only S16 format. This is often not ideal -because many converter engines can handle 32bit formats. Also, the -target format is often 32bit format, hence this would require -additional conversion even if the converter engine can output 32bit -natively. - -In this patch, for addressing the problems above, the rate plugin API -is extended in the following way: - -- The new get_supported_formats callback is added; this stores the bit - masks of the supported input and output formats, as well as the - behavior flags. Currently only linear formats are allowed. -- When the plugin accepts only the interleaved stream, set - SND_PCM_RATE_FLAG_INTERLEAVED flag bit. Otherwise the code has to - handle snd_pcm_channel_area at each call. -- When both input and output formats have to be identical, pass - SND_PCM_RATE_FLAG_SYNC_FORMATS flag bit. -- When the converter wants to process different formats, use convert - callback instead of convert_s16. You can put both in the ops for - compatibility, too. - The input and output formats are found in the info argument of init - callback. -- Now the PCM rate plugin core will skip the temporary buffer - allocation and conversions for pre- and post-process if not needed - (i.e. matching with the requested input or output format). - -The rate plugin API version is bumped to 0x010003. - -Signed-off-by: Takashi Iwai ---- - include/pcm_rate.h | 36 ++++- - src/pcm/pcm_rate.c | 358 +++++++++++++++++++++++++++------------------ - 2 files changed, 251 insertions(+), 143 deletions(-) - -diff --git a/include/pcm_rate.h b/include/pcm_rate.h -index 4171fb9d..48473ed4 100644 ---- a/include/pcm_rate.h -+++ b/include/pcm_rate.h -@@ -38,7 +38,7 @@ extern "C" { - /** - * Protocol version - */ --#define SND_PCM_RATE_PLUGIN_VERSION 0x010002 -+#define SND_PCM_RATE_PLUGIN_VERSION 0x010003 - - /** hw_params information for a single side */ - typedef struct snd_pcm_rate_side_info { -@@ -55,6 +55,11 @@ typedef struct snd_pcm_rate_info { - unsigned int channels; - } snd_pcm_rate_info_t; - -+enum { -+ SND_PCM_RATE_FLAG_INTERLEAVED = (1U << 0), /** only interleaved format */ -+ SND_PCM_RATE_FLAG_SYNC_FORMATS = (1U << 1), /** both input and output formats have to be identical */ -+}; -+ - /** Callback table of rate-converter */ - typedef struct snd_pcm_rate_ops { - /** -@@ -114,6 +119,13 @@ typedef struct snd_pcm_rate_ops { - * new ops since version 0x010002 - */ - void (*dump)(void *obj, snd_output_t *out); -+ /** -+ * get the supported input and output formats (optional); -+ * new ops since version 0x010003 -+ */ -+ int (*get_supported_formats)(void *obj, uint64_t *in_formats, -+ uint64_t *out_formats, -+ unsigned int *flags); - } snd_pcm_rate_ops_t; - - /** open function type */ -@@ -147,6 +159,28 @@ typedef struct snd_pcm_rate_old_ops { - snd_pcm_uframes_t (*input_frames)(void *obj, snd_pcm_uframes_t frames); - snd_pcm_uframes_t (*output_frames)(void *obj, snd_pcm_uframes_t frames); - } snd_pcm_rate_old_ops_t; -+ -+/* old rate_ops for protocol version 0x010002 */ -+typedef struct snd_pcm_rate_v2_ops { -+ void (*close)(void *obj); -+ int (*init)(void *obj, snd_pcm_rate_info_t *info); -+ void (*free)(void *obj); -+ void (*reset)(void *obj); -+ int (*adjust_pitch)(void *obj, snd_pcm_rate_info_t *info); -+ void (*convert)(void *obj, -+ const snd_pcm_channel_area_t *dst_areas, -+ snd_pcm_uframes_t dst_offset, unsigned int dst_frames, -+ const snd_pcm_channel_area_t *src_areas, -+ snd_pcm_uframes_t src_offset, unsigned int src_frames); -+ void (*convert_s16)(void *obj, int16_t *dst, unsigned int dst_frames, -+ const int16_t *src, unsigned int src_frames); -+ snd_pcm_uframes_t (*input_frames)(void *obj, snd_pcm_uframes_t frames); -+ snd_pcm_uframes_t (*output_frames)(void *obj, snd_pcm_uframes_t frames); -+ unsigned int version; -+ int (*get_supported_rates)(void *obj, unsigned int *rate_min, -+ unsigned int *rate_max); -+ void (*dump)(void *obj, snd_output_t *out); -+} snd_pcm_rate_v2_ops_t; - #endif - - #ifdef __cplusplus -diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c -index 1e996134..13111d29 100644 ---- a/src/pcm/pcm_rate.c -+++ b/src/pcm/pcm_rate.c -@@ -62,18 +62,22 @@ struct _snd_pcm_rate { - void *open_func; - void *obj; - snd_pcm_rate_ops_t ops; -- unsigned int get_idx; -- unsigned int put_idx; -- int16_t *src_buf; -- int16_t *dst_buf; -+ unsigned int src_conv_idx; -+ unsigned int dst_conv_idx; -+ snd_pcm_channel_area_t *src_buf; -+ snd_pcm_channel_area_t *dst_buf; - int start_pending; /* start is triggered but not commited to slave */ - snd_htimestamp_t trigger_tstamp; - unsigned int plugin_version; - unsigned int rate_min, rate_max; -+ snd_pcm_format_t orig_in_format; -+ snd_pcm_format_t orig_out_format; -+ uint64_t in_formats; -+ uint64_t out_formats; -+ unsigned int format_flags; - }; - - #define SND_PCM_RATE_PLUGIN_VERSION_OLD 0x010001 /* old rate plugin */ -- - #endif /* DOC_HIDDEN */ - - /* allocate a channel area and a temporary buffer for the given size */ -@@ -274,12 +278,84 @@ static int snd_pcm_rate_hw_refine(snd_pcm_t *pcm, - snd_pcm_generic_hw_refine); - } - -+/* evaluate the best matching available format to the given format */ -+static int get_best_format(uint64_t mask, snd_pcm_format_t orig) -+{ -+ int pwidth = snd_pcm_format_physical_width(orig); -+ int width = snd_pcm_format_width(orig); -+ int signd = snd_pcm_format_signed(orig); -+ int best_score = -1; -+ int match = -1; -+ int f, score; -+ -+ for (f = 0; f <= SND_PCM_FORMAT_LAST; f++) { -+ if (!(mask & (1ULL << f))) -+ continue; -+ score = 0; -+ if (snd_pcm_format_linear(f)) { -+ if (snd_pcm_format_physical_width(f) == pwidth) -+ score++; -+ if (snd_pcm_format_physical_width(f) >= pwidth) -+ score++; -+ if (snd_pcm_format_width(f) == width) -+ score++; -+ if (snd_pcm_format_signed(f) == signd) -+ score++; -+ } -+ if (score > best_score) { -+ match = f; -+ best_score = score; -+ } -+ } -+ -+ return match; -+} -+ -+/* set up the input and output formats from the available lists */ -+static int choose_preferred_format(snd_pcm_rate_t *rate) -+{ -+ uint64_t in_mask = rate->in_formats; -+ uint64_t out_mask = rate->out_formats; -+ int in, out; -+ -+ if (!in_mask || !out_mask) -+ return 0; -+ -+ if (rate->orig_in_format == rate->orig_out_format) -+ if (in_mask & out_mask & (1ULL << rate->orig_in_format)) -+ return 0; /* nothing changed */ -+ -+ repeat: -+ in = get_best_format(in_mask, rate->orig_in_format); -+ out = get_best_format(out_mask, rate->orig_out_format); -+ if (in < 0 || out < 0) -+ return -ENOENT; -+ -+ if ((rate->format_flags & SND_PCM_RATE_FLAG_SYNC_FORMATS) && -+ in != out) { -+ if (out_mask & (1ULL << in)) -+ out = in; -+ else if (in_mask & (1ULL << out)) -+ in = out; -+ else { -+ in_mask &= ~(1ULL << in); -+ out_mask &= ~(1ULL << out); -+ goto repeat; -+ } -+ } -+ -+ rate->info.in.format = in; -+ rate->info.out.format = out; -+ return 0; -+} -+ - static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - { - snd_pcm_rate_t *rate = pcm->private_data; - snd_pcm_t *slave = rate->gen.slave; - snd_pcm_rate_side_info_t *sinfo, *cinfo; -- unsigned int channels, cwidth, swidth, chn; -+ unsigned int channels, cwidth, swidth, chn, acc; -+ int need_src_buf, need_dst_buf; - int err = snd_pcm_hw_params_slave(pcm, params, - snd_pcm_rate_hw_refine_cchange, - snd_pcm_rate_hw_refine_sprepare, -@@ -308,6 +384,9 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - if (err < 0) - return err; - err = INTERNAL(snd_pcm_hw_params_get_channels)(params, &channels); -+ if (err < 0) -+ return err; -+ err = INTERNAL(snd_pcm_hw_params_get_access)(params, &acc); - if (err < 0) - return err; - -@@ -321,36 +400,80 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - SNDMSG("rate plugin already in use"); - return -EBUSY; - } -- err = rate->ops.init(rate->obj, &rate->info); -- if (err < 0) -- return err; - - rate->pareas = rate_alloc_tmp_buf(rate, cinfo->format, channels, - cinfo->period_size); - rate->sareas = rate_alloc_tmp_buf(rate, sinfo->format, channels, - sinfo->period_size); -- if (!rate->pareas || !rate->sareas) -- goto error; -- -- if (rate->ops.convert_s16) { -- rate->get_idx = snd_pcm_linear_get_index(rate->info.in.format, SND_PCM_FORMAT_S16); -- rate->put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S16, rate->info.out.format); -- free(rate->src_buf); -- rate->src_buf = malloc(channels * rate->info.in.period_size * 2); -- free(rate->dst_buf); -- rate->dst_buf = malloc(channels * rate->info.out.period_size * 2); -- if (! rate->src_buf || ! rate->dst_buf) -+ if (!rate->pareas || !rate->sareas) { -+ err = -ENOMEM; -+ goto error_pareas; -+ } -+ -+ rate->orig_in_format = rate->info.in.format; -+ rate->orig_out_format = rate->info.out.format; -+ if (choose_preferred_format(rate) < 0) { -+ SNDERR("No matching format in rate plugin"); -+ err = -EINVAL; -+ goto error_pareas; -+ } -+ -+ err = rate->ops.init(rate->obj, &rate->info); -+ if (err < 0) -+ goto error_init; -+ -+ rate_free_tmp_buf(&rate->src_buf); -+ rate_free_tmp_buf(&rate->dst_buf); -+ -+ need_src_buf = need_dst_buf = 0; -+ -+ if ((rate->format_flags & SND_PCM_RATE_FLAG_INTERLEAVED) && -+ !(acc == SND_PCM_ACCESS_MMAP_INTERLEAVED || -+ acc == SND_PCM_ACCESS_RW_INTERLEAVED)) { -+ need_src_buf = need_dst_buf = 1; -+ } else { -+ if (rate->orig_in_format != rate->info.in.format) -+ need_src_buf = 1; -+ if (rate->orig_out_format != rate->info.out.format) -+ need_dst_buf = 1; -+ } -+ -+ if (need_src_buf) { -+ rate->src_conv_idx = -+ snd_pcm_linear_convert_index(rate->orig_in_format, -+ rate->info.in.format); -+ rate->src_buf = rate_alloc_tmp_buf(rate, rate->info.in.format, -+ channels, rate->info.in.period_size); -+ if (!rate->src_buf) { -+ err = -ENOMEM; - goto error; -+ } -+ } -+ -+ if (need_dst_buf) { -+ rate->dst_conv_idx = -+ snd_pcm_linear_convert_index(rate->info.out.format, -+ rate->orig_out_format); -+ rate->dst_buf = rate_alloc_tmp_buf(rate, rate->info.out.format, -+ channels, rate->info.out.period_size); -+ if (!rate->dst_buf) { -+ err = -ENOMEM; -+ goto error; -+ } - } - - return 0; - - error: -- rate_free_tmp_buf(&rate->pareas); -- rate_free_tmp_buf(&rate->sareas); -+ rate_free_tmp_buf(&rate->src_buf); -+ rate_free_tmp_buf(&rate->dst_buf); -+ error_init: - if (rate->ops.free) - rate->ops.free(rate->obj); -- return -ENOMEM; -+ error_pareas: -+ rate_free_tmp_buf(&rate->pareas); -+ rate_free_tmp_buf(&rate->sareas); -+ return err; - } - - static int snd_pcm_rate_hw_free(snd_pcm_t *pcm) -@@ -361,9 +484,8 @@ static int snd_pcm_rate_hw_free(snd_pcm_t *pcm) - rate_free_tmp_buf(&rate->sareas); - if (rate->ops.free) - rate->ops.free(rate->obj); -- free(rate->src_buf); -- free(rate->dst_buf); -- rate->src_buf = rate->dst_buf = NULL; -+ rate_free_tmp_buf(&rate->src_buf); -+ rate_free_tmp_buf(&rate->dst_buf); - return snd_pcm_hw_free(rate->gen.slave); - } - -@@ -444,82 +566,6 @@ static int snd_pcm_rate_init(snd_pcm_t *pcm) - return 0; - } - --static void convert_to_s16(snd_pcm_rate_t *rate, int16_t *buf, -- const snd_pcm_channel_area_t *areas, -- snd_pcm_uframes_t offset, unsigned int frames, -- unsigned int channels) --{ --#ifndef DOC_HIDDEN --#define GET16_LABELS --#include "plugin_ops.h" --#undef GET16_LABELS --#endif /* DOC_HIDDEN */ -- void *get = get16_labels[rate->get_idx]; -- const char *src; -- int16_t sample; -- const char *srcs[channels]; -- int src_step[channels]; -- unsigned int c; -- -- for (c = 0; c < channels; c++) { -- srcs[c] = snd_pcm_channel_area_addr(areas + c, offset); -- src_step[c] = snd_pcm_channel_area_step(areas + c); -- } -- -- while (frames--) { -- for (c = 0; c < channels; c++) { -- src = srcs[c]; -- goto *get; --#ifndef DOC_HIDDEN --#define GET16_END after_get --#include "plugin_ops.h" --#undef GET16_END --#endif /* DOC_HIDDEN */ -- after_get: -- *buf++ = sample; -- srcs[c] += src_step[c]; -- } -- } --} -- --static void convert_from_s16(snd_pcm_rate_t *rate, const int16_t *buf, -- const snd_pcm_channel_area_t *areas, -- snd_pcm_uframes_t offset, unsigned int frames, -- unsigned int channels) --{ --#ifndef DOC_HIDDEN --#define PUT16_LABELS --#include "plugin_ops.h" --#undef PUT16_LABELS --#endif /* DOC_HIDDEN */ -- void *put = put16_labels[rate->put_idx]; -- char *dst; -- int16_t sample; -- char *dsts[channels]; -- int dst_step[channels]; -- unsigned int c; -- -- for (c = 0; c < channels; c++) { -- dsts[c] = snd_pcm_channel_area_addr(areas + c, offset); -- dst_step[c] = snd_pcm_channel_area_step(areas + c); -- } -- -- while (frames--) { -- for (c = 0; c < channels; c++) { -- dst = dsts[c]; -- sample = *buf++; -- goto *put; --#ifndef DOC_HIDDEN --#define PUT16_END after_put --#include "plugin_ops.h" --#undef PUT16_END --#endif /* DOC_HIDDEN */ -- after_put: -- dsts[c] += dst_step[c]; -- } -- } --} -- - static void do_convert(const snd_pcm_channel_area_t *dst_areas, - snd_pcm_uframes_t dst_offset, unsigned int dst_frames, - const snd_pcm_channel_area_t *src_areas, -@@ -527,28 +573,40 @@ static void do_convert(const snd_pcm_channel_area_t *dst_areas, - unsigned int channels, - snd_pcm_rate_t *rate) - { -- if (rate->ops.convert_s16) { -- const int16_t *src; -- int16_t *dst; -- if (! rate->src_buf) -- src = (int16_t *)src_areas->addr + src_offset * channels; -- else { -- convert_to_s16(rate, rate->src_buf, src_areas, src_offset, -- src_frames, channels); -- src = rate->src_buf; -- } -- if (! rate->dst_buf) -- dst = (int16_t *)dst_areas->addr + dst_offset * channels; -- else -- dst = rate->dst_buf; -- rate->ops.convert_s16(rate->obj, dst, dst_frames, src, src_frames); -- if (dst == rate->dst_buf) -- convert_from_s16(rate, rate->dst_buf, dst_areas, dst_offset, -- dst_frames, channels); -+ const snd_pcm_channel_area_t *out_areas; -+ snd_pcm_uframes_t out_offset; -+ -+ if (rate->dst_buf) { -+ out_areas = rate->dst_buf; -+ out_offset = 0; - } else { -- rate->ops.convert(rate->obj, dst_areas, dst_offset, dst_frames, -- src_areas, src_offset, src_frames); -+ out_areas = dst_areas; -+ out_offset = dst_offset; -+ } -+ -+ if (rate->src_buf) { -+ snd_pcm_linear_convert(rate->src_buf, 0, -+ src_areas, src_offset, -+ channels, src_frames, -+ rate->src_conv_idx); -+ src_areas = rate->src_buf; -+ src_offset = 0; - } -+ -+ if (rate->ops.convert) -+ rate->ops.convert(rate->obj, out_areas, out_offset, dst_frames, -+ src_areas, src_offset, src_frames); -+ else -+ rate->ops.convert_s16(rate->obj, -+ snd_pcm_channel_area_addr(out_areas, out_offset), -+ dst_frames, -+ snd_pcm_channel_area_addr(src_areas, src_offset), -+ src_frames); -+ if (rate->dst_buf) -+ snd_pcm_linear_convert(dst_areas, dst_offset, -+ rate->dst_buf, 0, -+ channels, dst_frames, -+ rate->dst_conv_idx); - } - - static inline void -@@ -1276,6 +1334,30 @@ const snd_config_t *snd_pcm_rate_get_default_converter(snd_config_t *root) - return NULL; - } - -+static void rate_initial_setup(snd_pcm_rate_t *rate) -+{ -+ if (rate->plugin_version == SND_PCM_RATE_PLUGIN_VERSION) -+ rate->plugin_version = rate->ops.version; -+ -+ if (rate->plugin_version >= 0x010002 && -+ rate->ops.get_supported_rates) -+ rate->ops.get_supported_rates(rate->obj, -+ &rate->rate_min, -+ &rate->rate_max); -+ -+ if (rate->plugin_version >= 0x010003 && -+ rate->ops.get_supported_formats) { -+ rate->ops.get_supported_formats(rate->obj, -+ &rate->in_formats, -+ &rate->out_formats, -+ &rate->format_flags); -+ } else if (!rate->ops.convert && rate->ops.convert_s16) { -+ rate->in_formats = rate->out_formats = -+ 1ULL << SND_PCM_FORMAT_S16; -+ rate->format_flags = SND_PCM_RATE_FLAG_INTERLEAVED; -+ } -+} -+ - #ifdef PIC - static int is_builtin_plugin(const char *type) - { -@@ -1301,20 +1383,11 @@ static int rate_open_func(snd_pcm_rate_t *rate, const char *type, const snd_conf - lib = lib_name; - } - -- rate->rate_min = SND_PCM_PLUGIN_RATE_MIN; -- rate->rate_max = SND_PCM_PLUGIN_RATE_MAX; -- rate->plugin_version = SND_PCM_RATE_PLUGIN_VERSION; -- - open_conf_func = snd_dlobj_cache_get(lib, open_conf_name, NULL, verbose && converter_conf != NULL); - if (open_conf_func) { - err = open_conf_func(SND_PCM_RATE_PLUGIN_VERSION, - &rate->obj, &rate->ops, converter_conf); - if (!err) { -- rate->plugin_version = rate->ops.version; -- if (rate->ops.get_supported_rates) -- rate->ops.get_supported_rates(rate->obj, -- &rate->rate_min, -- &rate->rate_max); - rate->open_func = open_conf_func; - return 0; - } else { -@@ -1330,23 +1403,18 @@ static int rate_open_func(snd_pcm_rate_t *rate, const char *type, const snd_conf - rate->open_func = open_func; - - err = open_func(SND_PCM_RATE_PLUGIN_VERSION, &rate->obj, &rate->ops); -- if (!err) { -- rate->plugin_version = rate->ops.version; -- if (rate->ops.get_supported_rates) -- rate->ops.get_supported_rates(rate->obj, -- &rate->rate_min, -- &rate->rate_max); -+ if (!err) - return 0; -- } - - /* try to open with the old protocol version */ - rate->plugin_version = SND_PCM_RATE_PLUGIN_VERSION_OLD; - err = open_func(SND_PCM_RATE_PLUGIN_VERSION_OLD, - &rate->obj, &rate->ops); -- if (err) { -- snd_dlobj_cache_put(open_func); -- rate->open_func = NULL; -- } -+ if (!err) -+ return 0; -+ -+ snd_dlobj_cache_put(open_func); -+ rate->open_func = NULL; - return err; - } - #endif -@@ -1417,6 +1485,10 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, - rate->srate = srate; - rate->sformat = sformat; - -+ rate->rate_min = SND_PCM_PLUGIN_RATE_MIN; -+ rate->rate_max = SND_PCM_PLUGIN_RATE_MAX; -+ rate->plugin_version = SND_PCM_RATE_PLUGIN_VERSION; -+ - err = snd_pcm_new(&pcm, SND_PCM_TYPE_RATE, name, slave->stream, slave->mode); - if (err < 0) { - free(rate); -@@ -1496,6 +1568,8 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, - return err; - } - -+ rate_initial_setup(rate); -+ - pcm->ops = &snd_pcm_rate_ops; - pcm->fast_ops = &snd_pcm_rate_fast_ops; - pcm->private_data = rate; --- -2.31.1 - - -From 3f737a2a2c8d20e78dea3ea836997f9d74f602a0 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Fri, 18 Jun 2021 11:35:30 +0200 -Subject: [PATCH 04/20] pcm: improve docs for snd_pcm_sw_params_get_avail_min() - and snd_pcm_status_get_avail_max() - -Fixes: https://github.com/alsa-project/alsa-lib/issues/44 -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c -index 09df0f12..892abf98 100644 ---- a/src/pcm/pcm.c -+++ b/src/pcm/pcm.c -@@ -6500,6 +6500,9 @@ int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, - * \param params Software configuration container - * \param val returned minimum available frames to consider PCM ready - * \return 0 otherwise a negative error code -+ * -+ * This is a threshold value when the PCM stream is considered as ready for -+ * another read/write operation or poll event. - */ - #ifndef DOXYGEN - EXPORT_SYMBOL int INTERNAL(snd_pcm_sw_params_get_avail_min)(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) -@@ -6960,6 +6963,8 @@ snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t *obj) - /** - * \brief Get maximum number of frames available from a PCM status container after last #snd_pcm_status call - * \return Maximum number of frames ready to be read/written -+ * -+ * This value returns the peak for the available frames between #snd_pcm_status calls. - */ - snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t *obj) - { --- -2.31.1 - - -From 212c6c18c4317af48c007a0866efc029b9c3a593 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 21 Jun 2021 09:23:02 +0200 -Subject: [PATCH 05/20] pcm: dmix - use pcm_frame_diff() in - snd_pcm_dmix_sync_ptr0() - -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_dmix.c | 6 +----- - 1 file changed, 1 insertion(+), 5 deletions(-) - -diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c -index 608593f1..0d0d0bff 100644 ---- a/src/pcm/pcm_dmix.c -+++ b/src/pcm/pcm_dmix.c -@@ -393,17 +393,13 @@ static int snd_pcm_dmix_sync_ptr0(snd_pcm_t *pcm, snd_pcm_uframes_t slave_hw_ptr - - old_slave_hw_ptr = dmix->slave_hw_ptr; - dmix->slave_hw_ptr = slave_hw_ptr; -- diff = slave_hw_ptr - old_slave_hw_ptr; -+ diff = pcm_frame_diff(slave_hw_ptr, old_slave_hw_ptr, dmix->slave_boundary); - if (diff == 0) /* fast path */ - return 0; - if (dmix->state != SND_PCM_STATE_RUNNING && - dmix->state != SND_PCM_STATE_DRAINING) - /* not really started yet - don't update hw_ptr */ - return 0; -- if (diff < 0) { -- slave_hw_ptr += dmix->slave_boundary; -- diff = slave_hw_ptr - old_slave_hw_ptr; -- } - dmix->hw_ptr += diff; - dmix->hw_ptr %= pcm->boundary; - if (pcm->stop_threshold >= pcm->boundary) /* don't care */ --- -2.31.1 - - -From dd609ef9684987d3ca61d5c5cc3c77589ff9c29f Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 21 Jun 2021 09:28:41 +0200 -Subject: [PATCH 06/20] pcm: direct plugins - fix hw_ptr in the status callback - -The parent hw_ptr may be in another range (boundary limit). -Set the correct value for the caller. - -BugLink: https://github.com/alsa-project/alsa-lib/issues/155 -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_dmix.c | 1 + - src/pcm/pcm_dshare.c | 1 + - src/pcm/pcm_dsnoop.c | 1 + - 3 files changed, 3 insertions(+) - -diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c -index 0d0d0bff..94dbb1e0 100644 ---- a/src/pcm/pcm_dmix.c -+++ b/src/pcm/pcm_dmix.c -@@ -491,6 +491,7 @@ static int snd_pcm_dmix_status(snd_pcm_t *pcm, snd_pcm_status_t * status) - } - - status->state = snd_pcm_dmix_state(pcm); -+ status->hw_ptr = *pcm->hw.ptr; /* boundary may be different */ - status->appl_ptr = *pcm->appl.ptr; /* slave PCM doesn't set appl_ptr */ - status->trigger_tstamp = dmix->trigger_tstamp; - status->avail = snd_pcm_mmap_playback_avail(pcm); -diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c -index a918512b..01814dc8 100644 ---- a/src/pcm/pcm_dshare.c -+++ b/src/pcm/pcm_dshare.c -@@ -243,6 +243,7 @@ static int snd_pcm_dshare_status(snd_pcm_t *pcm, snd_pcm_status_t * status) - break; - } - status->state = snd_pcm_dshare_state(pcm); -+ status->hw_ptr = *pcm->hw.ptr; /* boundary may be different */ - status->appl_ptr = *pcm->appl.ptr; /* slave PCM doesn't set appl_ptr */ - status->trigger_tstamp = dshare->trigger_tstamp; - status->avail = snd_pcm_mmap_playback_avail(pcm); -diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c -index 2c3b9f43..3f28df99 100644 ---- a/src/pcm/pcm_dsnoop.c -+++ b/src/pcm/pcm_dsnoop.c -@@ -193,6 +193,7 @@ static int snd_pcm_dsnoop_status(snd_pcm_t *pcm, snd_pcm_status_t * status) - snd_pcm_status(dsnoop->spcm, status); - state = snd_pcm_state(dsnoop->spcm); - status->state = state == SND_PCM_STATE_RUNNING ? dsnoop->state : state; -+ status->hw_ptr = *pcm->hw.ptr; /* boundary may be different */ - status->appl_ptr = *pcm->appl.ptr; /* slave PCM doesn't set appl_ptr */ - status->trigger_tstamp = dsnoop->trigger_tstamp; - status->avail = snd_pcm_mmap_capture_avail(pcm); --- -2.31.1 - - -From a5e11f9a810391777ea7750f04ba66f9c9e624de Mon Sep 17 00:00:00 2001 -From: Takashi Iwai -Date: Mon, 21 Jun 2021 14:21:26 +0200 -Subject: [PATCH 07/20] pcm: Move snd_pcm_channel_area_addr() and _step() to - public header - -Used in the rate plugins commonly. - -Signed-off-by: Takashi Iwai ---- - include/pcm.h | 23 +++++++++++++++++++++++ - src/pcm/pcm_local.h | 13 ------------- - 2 files changed, 23 insertions(+), 13 deletions(-) - -diff --git a/include/pcm.h b/include/pcm.h -index e300b951..b5a514fa 100644 ---- a/include/pcm.h -+++ b/include/pcm.h -@@ -1173,6 +1173,29 @@ int snd_pcm_areas_copy_wrap(const snd_pcm_channel_area_t *dst_channels, - snd_pcm_uframes_t frames, - const snd_pcm_format_t format); - -+/** -+ * \brief get the address of the given PCM channel area -+ * \param area PCM channel area -+ * \param offset Offset in frames -+ * -+ * Returns the pointer corresponding to the given offset on the channel area. -+ */ -+static inline void *snd_pcm_channel_area_addr(const snd_pcm_channel_area_t *area, snd_pcm_uframes_t offset) -+{ -+ return (char *)area->addr + (area->first + area->step * offset) / 8; -+} -+ -+/** -+ * \brief get the step size of the given PCM channel area in bytes -+ * \param area PCM channel area -+ * -+ * Returns the step size in bytes from the given channel area. -+ */ -+static inline unsigned int snd_pcm_channel_area_step(const snd_pcm_channel_area_t *area) -+{ -+ return area->step / 8; -+} -+ - /** \} */ - - /** -diff --git a/src/pcm/pcm_local.h b/src/pcm/pcm_local.h -index a63f4be0..6f03365c 100644 ---- a/src/pcm/pcm_local.h -+++ b/src/pcm/pcm_local.h -@@ -632,19 +632,6 @@ static inline snd_pcm_sframes_t snd_pcm_mmap_delay(snd_pcm_t *pcm) - return snd_pcm_mmap_capture_delay(pcm); - } - --static inline void *snd_pcm_channel_area_addr(const snd_pcm_channel_area_t *area, snd_pcm_uframes_t offset) --{ -- unsigned int bitofs = area->first + area->step * offset; -- assert(bitofs % 8 == 0); -- return (char *) area->addr + bitofs / 8; --} -- --static inline unsigned int snd_pcm_channel_area_step(const snd_pcm_channel_area_t *area) --{ -- assert(area->step % 8 == 0); -- return area->step / 8; --} -- - static inline snd_pcm_sframes_t _snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size) - { - /* lock handled in the callback */ --- -2.31.1 - - -From e0e084659083c2ab75d5c894f24227ea2f67010f Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 21 Jun 2021 15:14:18 +0200 -Subject: [PATCH 08/20] pcm: direct plugins - fix bad memory access when - channel bindings do not match hw - -Fix and cleanup snd_pcm_direct_check_interleave() function. -Add requested / hardware channel check and use goto when the interleaved - -Fixes: https://github.com/alsa-project/alsa-lib/issues/117 -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_direct.c | 40 +++++++++++++++++----------------------- - 1 file changed, 17 insertions(+), 23 deletions(-) - -diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c -index d50503e3..90417b2f 100644 ---- a/src/pcm/pcm_direct.c -+++ b/src/pcm/pcm_direct.c -@@ -1627,43 +1627,37 @@ int snd_pcm_direct_set_timer_params(snd_pcm_direct_t *dmix) - int snd_pcm_direct_check_interleave(snd_pcm_direct_t *dmix, snd_pcm_t *pcm) - { - unsigned int chn, channels; -- int bits, interleaved = 1; -+ int bits; - const snd_pcm_channel_area_t *dst_areas; - const snd_pcm_channel_area_t *src_areas; - - bits = snd_pcm_format_physical_width(pcm->format); - if ((bits % 8) != 0) -- interleaved = 0; -+ goto __nointerleaved; - channels = dmix->channels; -+ if (channels != dmix->spcm->channels) -+ goto __nointerleaved; - dst_areas = snd_pcm_mmap_areas(dmix->spcm); - src_areas = snd_pcm_mmap_areas(pcm); - for (chn = 1; chn < channels; chn++) { -- if (dst_areas[chn-1].addr != dst_areas[chn].addr) { -- interleaved = 0; -- break; -- } -- if (src_areas[chn-1].addr != src_areas[chn].addr) { -- interleaved = 0; -- break; -- } -+ if (dst_areas[chn-1].addr != dst_areas[chn].addr) -+ goto __nointerleaved; -+ if (src_areas[chn-1].addr != src_areas[chn].addr) -+ goto __nointerleaved; - } - for (chn = 0; chn < channels; chn++) { -- if (dmix->bindings && dmix->bindings[chn] != chn) { -- interleaved = 0; -- break; -- } -+ if (dmix->bindings && dmix->bindings[chn] != chn) -+ goto __nointerleaved; - if (dst_areas[chn].first != chn * bits || -- dst_areas[chn].step != channels * bits) { -- interleaved = 0; -- break; -- } -+ dst_areas[chn].step != channels * bits) -+ goto __nointerleaved; - if (src_areas[chn].first != chn * bits || -- src_areas[chn].step != channels * bits) { -- interleaved = 0; -- break; -- } -+ src_areas[chn].step != channels * bits) -+ goto __nointerleaved; - } -- return dmix->interleaved = interleaved; -+ return dmix->interleaved = 1; -+__nointerleaved: -+ return dmix->interleaved = 0; - } - - /* --- -2.31.1 - - -From ccc14ae897d170156f1c2905ea5d18a3295e7b36 Mon Sep 17 00:00:00 2001 -From: "Tanjeff-N. Moos" -Date: Thu, 17 Jun 2021 10:36:38 +0200 -Subject: [PATCH 09/20] control: Add documentation for snd_ctl_card_* and - friends. - -In this patch series, I added a description about control interface -handling and how control interfaces are identified. - -In addition, I added/improved Doxygen documentation for the -snd_ctl_card_info_t type and related corresponding functions, -e.g. snd_ctl_card_info(). I also documented other card-related like -snd_card_next(). - -Along the way I did minor documentation improvements. - -Signed-off-by: Tanjeff-N. Moos -Signed-off-by: Takashi Iwai ---- - include/control.h | 40 +++++++++- - src/control/cards.c | 56 +++++++++----- - src/control/control.c | 175 +++++++++++++++++++++++++++++++----------- - 3 files changed, 202 insertions(+), 69 deletions(-) - -diff --git a/include/control.h b/include/control.h -index ccf906e2..9ebb4905 100644 ---- a/include/control.h -+++ b/include/control.h -@@ -50,7 +50,32 @@ typedef struct snd_aes_iec958 { - unsigned char dig_subframe[4]; /**< AES/IEC958 subframe bits */ - } snd_aes_iec958_t; - --/** CTL card info container */ -+/** \brief CTL card info container. -+ * -+ * This type contains meta information about a sound card, such as the index, -+ * name, longname, etc. -+ * -+ * \par Memory management -+ * -+ * Before using a snd_ctl_card_info_t object, it must be allocated using -+ * snd_ctl_card_info_alloca() or snd_ctl_card_info_malloc(). When using the -+ * latter, it must be freed again using snd_ctl_card_info_free(). -+ * -+ * A card info object can be zeroed out using snd_ctl_card_info_clear(). -+ * -+ * A card info object can be copied to another one using -+ * snd_ctl_card_info_copy(). -+ * -+ * \par Obtaining the Information -+ * -+ * To obtain the card information, it must first be opened using -+ * snd_ctl_open(), and a snd_ctl_card_info_t container must be -+ * allocated. Then, the information can be read using -+ * snd_ctl_card_info_get_card(). -+ * -+ * Thereafter, the card properties can be read using the -+ * snd_ctl_card_info_get_*() functions. -+ */ - typedef struct _snd_ctl_card_info snd_ctl_card_info_t; - - /** CTL element identifier container */ -@@ -442,11 +467,20 @@ void snd_ctl_elem_id_set_name(snd_ctl_elem_id_t *obj, const char *val); - void snd_ctl_elem_id_set_index(snd_ctl_elem_id_t *obj, unsigned int val); - - size_t snd_ctl_card_info_sizeof(void); -+ - /** \hideinitializer -- * \brief allocate an invalid #snd_ctl_card_info_t using standard alloca -- * \param ptr returned pointer -+ * \brief Allocate an invalid #snd_ctl_card_info_t on the stack. -+ * -+ * Allocate space for a card info object on the stack. The allocated -+ * memory need not be freed, because it is on the stack. -+ * -+ * See snd_ctl_card_info_t for details. -+ * -+ * \param ptr Pointer to a snd_ctl_elem_value_t pointer. The address -+ * of the allocated space will returned here. - */ - #define snd_ctl_card_info_alloca(ptr) __snd_alloca(ptr, snd_ctl_card_info) -+ - int snd_ctl_card_info_malloc(snd_ctl_card_info_t **ptr); - void snd_ctl_card_info_free(snd_ctl_card_info_t *obj); - void snd_ctl_card_info_clear(snd_ctl_card_info_t *obj); -diff --git a/src/control/cards.c b/src/control/cards.c -index e57457c2..8226c42d 100644 ---- a/src/control/cards.c -+++ b/src/control/cards.c -@@ -77,8 +77,8 @@ static int snd_card_load1(int card) - - /** - * \brief Try to load the driver for a card. -- * \param card Card number. -- * \return 1 if driver is present, zero if driver is not present -+ * \param card Card index. -+ * \return 1 if driver is present, zero if driver is not present. - */ - int snd_card_load(int card) - { -@@ -86,14 +86,24 @@ int snd_card_load(int card) - } - - /** -- * \brief Try to determine the next card. -- * \param rcard pointer to card number -- * \result zero if success, otherwise a negative error code -+ * \brief Iterate over physical sound cards. -+ * -+ * This function takes the index of a physical sound card and sets it to the -+ * index of the next card. If index is -1, it is set to the index of the first -+ * card. After the last card, the index is set to -1. -+ * -+ * For example, if you have 2 sound cards (with index 0 and 1), the index will -+ * be modified as follows: -+ * -+ * - -1 --> 0 -+ * - 0 --> 1 -+ * - 1 --> -1 -+ * -+ * This does not work for virtual sound cards. - * -- * Tries to determine the next card from given card number. -- * If card number is -1, then the first available card is -- * returned. If the result card number is -1, no more cards -- * are available. -+ * \param rcard Index of current card. The index of the next card is stored -+ * here. -+ * \result zero if success, otherwise a negative error code. - */ - int snd_card_next(int *rcard) - { -@@ -114,13 +124,18 @@ int snd_card_next(int *rcard) - } - - /** -- * \brief Convert card string to an integer value. -- * \param string String containing card identifier -- * \return zero if success, otherwise a negative error code -+ * \brief Convert a card string to the card index. - * -- * The accepted format is an integer value in ASCII representation -- * or the card identifier (the id parameter for sound-card drivers). -- * The control device name like /dev/snd/controlC0 is accepted, too. -+ * This works only for physical sound cards, not for virtual cards. -+ * -+ * \param string A string identifying the card. -+ * \return The index of the card. On error, a a negative error code -+ * is returned. -+ * -+ * The accepted formats for "string" are: -+ * - The index of the card (as listed in /proc/asound/cards), given as string -+ * - The ID of the card (as listed in /proc/asound/cards) -+ * - The control device name (like /dev/snd/controlC0) - */ - int snd_card_get_index(const char *string) - { -@@ -163,8 +178,9 @@ int snd_card_get_index(const char *string) - - /** - * \brief Obtain the card name. -- * \param card Card number -- * \param name Result - card name corresponding to card number -+ * -+ * \param card The index of the card. -+ * \param name Result - card name corresponding to card index. - * \result zero if success, otherwise a negative error code - * - * The value returned in name is allocated with strdup and should be -@@ -193,9 +209,9 @@ int snd_card_get_name(int card, char **name) - - /** - * \brief Obtain the card long name. -- * \param card Card number -- * \param name Result - card long name corresponding to card number -- * \result zero if success, otherwise a negative error code -+ * \param card Index of the card. -+ * \param name Result - card long name corresponding to card index. -+ * \result Zero if success, otherwise a negative error code. - * - * The value returned in name is allocated with strdup and should be - * freed when no longer used. -diff --git a/src/control/control.c b/src/control/control.c -index ed986e54..7cf4decb 100644 ---- a/src/control/control.c -+++ b/src/control/control.c -@@ -33,8 +33,50 @@ -

Control interface is designed to access primitive controls. There is - also an interface for notifying about control and structure changes. - -+ - \section control_general_overview General overview - -+In Alsa, there are physical sound cards, such as USB headsets, and -+virtual sound cards, such as "pulse", which represents the PulseAudio -+Sound system. Each sound card offers a control interface, making its -+settings (e.g. volume knobs) available. The complete list of available -+control interfaces can be obtained using snd_device_name_hint(), -+giving -1 as card index and "ctl" as interface type. Each returned -+NAME hint identifies a control interface. -+ -+Sound cards have an ID (a string), an index (an int, sometimes called -+the "card number"), a name, a longname, a mixername and a "components" -+property. The file /proc/asound/cards lists most of these properties -+for physical sound cards. Virtual sound cards are not listed in that -+file. The format is: -+ -+\verbatim -+index [ID ] Driver - name -+ longname -+\endverbatim -+ -+Note that the mixername and components are not listed. -+ -+ -+\subsection control_cards_id Identifying and Opening Control Interfaces -+ -+To work with a control interface, is must be opened first, using -+snd_ctl_open(). This function takes the interface name. -+ -+For physical sound cards, the control interface can be identified -+using the string "hw:" (e.g. `hw:2`). The NAME hint - which is -+"hw:CARD=" - can also be used. Further, its device file (something -+like `/dev/snd/controlC0`) is also acceptable. Either of them can be -+given to snd_ctl_open(). -+ -+For virtual sound cards, the NAME hint is given to snd_ctl_open(). -+ -+The functions snd_card_get_index(), snd_card_get_name() and -+snd_card_get_longname() can be used to find an identifying property -+when another one is already known. -+ -+\section control_elements Elements -+ - In ALSA control feature, each sound card can have control elements. The elements - are managed according to below model. - -@@ -65,7 +107,7 @@ are managed according to below model. - of userspace applications and drivers in kernel. - - --\section identifying_elements Identifying Elements -+\subsection identifying_elements Identifying Elements - - Each element has the following identifying properties: - -@@ -84,7 +126,7 @@ but in practice this is rare). The numid can change on each boot. - In case of an USB sound card, the numid can also change when it - is reconnected. The short numid is used to reduce the lookup time. - --\section element_lists Element Lists -+\subsection element_lists Element Lists - - An element list can be used to obtain a list of all elements of the - sound card. The list contains generic information (e.g. how many -@@ -93,7 +135,7 @@ elements the card has), and the identifying properties of the elements - element lists. - - --\section working_with_elements Working with Elements -+\subsection working_with_elements Working with Elements - - It is possible to obtain information about an element using the - snd_ctl_elem_info_*() functions. For enums, the allowed values can be -@@ -108,7 +150,7 @@ actual values or settings. It is also possible to get and set the ID - values (such as the numid or the name). - - --\section element_sets Element Sets -+\subsection element_sets Element Sets - - The type of element set is one of integer, integer64, boolean, enumerators, - bytes and IEC958 structure. This indicates the type of value for each member in -@@ -329,10 +371,15 @@ int snd_ctl_subscribe_events(snd_ctl_t *ctl, int subscribe) - - - /** -- * \brief Get card related information -- * \param ctl CTL handle -- * \param info Card info pointer -- * \return 0 on success otherwise a negative error code -+ * \brief Get information about the sound card. -+ * -+ * Obtain information about the sound card previously opened using -+ * snd_ctl_open(). The object "info" must be allocated prior to calling this -+ * function. See snd_ctl_card_info_t for details. -+ * -+ * \param ctl The CTL handle. -+ * \param info The card information is stored here. -+ * \return 0 on success, otherwise a negative error code. - */ - int snd_ctl_card_info(snd_ctl_t *ctl, snd_ctl_card_info_t *info) - { -@@ -1508,11 +1555,13 @@ int _snd_ctl_open_named_child(snd_ctl_t **pctl, const char *name, - #endif - - /** -- * \brief Opens a CTL -- * \param ctlp Returned CTL handle -- * \param name ASCII identifier of the CTL handle -- * \param mode Open mode (see #SND_CTL_NONBLOCK, #SND_CTL_ASYNC) -- * \return 0 on success otherwise a negative error code -+ * \brief Opens a sound card. -+ * -+ * \param ctlp Returned CTL handle. -+ * \param name A string identifying the card (See \ref control_cards_id). -+ * \param mode Open mode (see #SND_CTL_NONBLOCK, #SND_CTL_ASYNC). -+ * -+ * \return 0 on success otherwise a negative error code. - */ - int snd_ctl_open(snd_ctl_t **ctlp, const char *name, int mode) - { -@@ -2027,8 +2076,8 @@ void snd_ctl_elem_id_set_index(snd_ctl_elem_id_t *obj, unsigned int val) - } - - /** -- * \brief get size of #snd_ctl_card_info_t -- * \return size in bytes -+ * \brief get size of #snd_ctl_card_info_t. -+ * \return Size in bytes. - */ - size_t snd_ctl_card_info_sizeof() - { -@@ -2036,9 +2085,16 @@ size_t snd_ctl_card_info_sizeof() - } - - /** -- * \brief allocate an invalid #snd_ctl_card_info_t using standard malloc -- * \param ptr returned pointer -- * \return 0 on success otherwise negative error code -+ * \brief Allocate an invalid #snd_ctl_card_info_t on the heap. -+ * -+ * Allocate space for a card info object on the heap. The allocated memory -+ * must be freed using snd_ctl_card_info_free(). -+ * -+ * See snd_ctl_card_info_t for details. -+ * -+ * \param ptr Pointer to a snd_ctl_card_info_t pointer. The address -+ * of the allocated space will be returned here. -+ * \return 0 on success, otherwise a negative error code. - */ - int snd_ctl_card_info_malloc(snd_ctl_card_info_t **ptr) - { -@@ -2050,8 +2106,10 @@ int snd_ctl_card_info_malloc(snd_ctl_card_info_t **ptr) - } - - /** -- * \brief frees a previously allocated #snd_ctl_card_info_t -- * \param obj pointer to object to free -+ * \brief Free an #snd_ctl_card_info_t previously allocated using -+ * snd_ctl_card_info_malloc(). -+ * -+ * \param obj Pointer to the snd_ctl_card_info_t. - */ - void snd_ctl_card_info_free(snd_ctl_card_info_t *obj) - { -@@ -2059,8 +2117,11 @@ void snd_ctl_card_info_free(snd_ctl_card_info_t *obj) - } - - /** -- * \brief clear given #snd_ctl_card_info_t object -- * \param obj pointer to object to clear -+ * \brief Clear given card info object. -+ * -+ * See snd_ctl_elem_value_t for details. -+ * -+ * \param obj Card info object. - */ - void snd_ctl_card_info_clear(snd_ctl_card_info_t *obj) - { -@@ -2068,9 +2129,10 @@ void snd_ctl_card_info_clear(snd_ctl_card_info_t *obj) - } - - /** -- * \brief copy one #snd_ctl_card_info_t to another -- * \param dst pointer to destination -- * \param src pointer to source -+ * \brief Bitwise copy of a #snd_ctl_card_info_t object. -+ * -+ * \param dst Pointer to destination. -+ * \param src Pointer to source. - */ - void snd_ctl_card_info_copy(snd_ctl_card_info_t *dst, const snd_ctl_card_info_t *src) - { -@@ -2079,9 +2141,12 @@ void snd_ctl_card_info_copy(snd_ctl_card_info_t *dst, const snd_ctl_card_info_t - } - - /** -- * \brief Get card number from a CTL card info -- * \param obj CTL card info -- * \return card number -+ * \brief Get the sound card index from the given info object. -+ * -+ * See snd_ctl_card_info_t for more details. -+ * -+ * \param obj The card info object. -+ * \return Sound card index. - */ - int snd_ctl_card_info_get_card(const snd_ctl_card_info_t *obj) - { -@@ -2090,9 +2155,12 @@ int snd_ctl_card_info_get_card(const snd_ctl_card_info_t *obj) - } - - /** -- * \brief Get card identifier from a CTL card info -- * \param obj CTL card info -- * \return card identifier -+ * \brief Get the sound card ID from the given info object. -+ * -+ * See snd_ctl_card_info_t for more details. -+ * -+ * \param obj The card info object. -+ * \return Sound card ID. - */ - const char *snd_ctl_card_info_get_id(const snd_ctl_card_info_t *obj) - { -@@ -2101,9 +2169,12 @@ const char *snd_ctl_card_info_get_id(const snd_ctl_card_info_t *obj) - } - - /** -- * \brief Get card driver name from a CTL card info -- * \param obj CTL card info -- * \return card driver name -+ * \brief Get the sound card driver from the given info object. -+ * -+ * See snd_ctl_card_info_t for more details. -+ * -+ * \param obj The card info object. -+ * \return The sound card driver. - */ - const char *snd_ctl_card_info_get_driver(const snd_ctl_card_info_t *obj) - { -@@ -2112,9 +2183,12 @@ const char *snd_ctl_card_info_get_driver(const snd_ctl_card_info_t *obj) - } - - /** -- * \brief Get card name from a CTL card info -- * \param obj CTL card info -- * \return card name -+ * \brief Get the sound card name from the given info object. -+ * -+ * See snd_ctl_card_info_t for more details. -+ * -+ * \param obj The card info object. -+ * \return Sound card name. - */ - const char *snd_ctl_card_info_get_name(const snd_ctl_card_info_t *obj) - { -@@ -2123,9 +2197,12 @@ const char *snd_ctl_card_info_get_name(const snd_ctl_card_info_t *obj) - } - - /** -- * \brief Get card long name from a CTL card info -- * \param obj CTL card info -- * \return card long name -+ * \brief Get the sound cards long name from the given info object. -+ * -+ * See snd_ctl_card_info_t for more details. -+ * -+ * \param obj The card info object. -+ * \return Sound cards long name. - */ - const char *snd_ctl_card_info_get_longname(const snd_ctl_card_info_t *obj) - { -@@ -2134,9 +2211,12 @@ const char *snd_ctl_card_info_get_longname(const snd_ctl_card_info_t *obj) - } - - /** -- * \brief Get card mixer name from a CTL card info -- * \param obj CTL card info -- * \return card mixer name -+ * \brief Get the sound card mixer name from the given info object. -+ * -+ * See snd_ctl_card_info_t for more details. -+ * -+ * \param obj The card info object. -+ * \return Sound card mixer name. - */ - const char *snd_ctl_card_info_get_mixername(const snd_ctl_card_info_t *obj) - { -@@ -2145,9 +2225,12 @@ const char *snd_ctl_card_info_get_mixername(const snd_ctl_card_info_t *obj) - } - - /** -- * \brief Get card component list from a CTL card info -- * \param obj CTL card info -- * \return card mixer identifier -+ * \brief Get the sound cards "components" property from the given info object. -+ * -+ * See snd_ctl_card_info_t for more details. -+ * -+ * \param obj The card info object. -+ * \return Sound cards "components" property. - */ - const char *snd_ctl_card_info_get_components(const snd_ctl_card_info_t *obj) - { --- -2.31.1 - - -From 7ba3f888d07cafbad04391b915db23408c663dad Mon Sep 17 00:00:00 2001 -From: "Tanjeff-N. Moos" -Date: Thu, 17 Jun 2021 10:36:39 +0200 -Subject: [PATCH 10/20] control: Minor documentation fixes. - -Signed-off-by: Tanjeff-N. Moos -Signed-off-by: Takashi Iwai ---- - include/control.h | 9 +++++++-- - src/control/cards.c | 5 ++++- - src/control/control.c | 2 +- - 3 files changed, 12 insertions(+), 4 deletions(-) - -diff --git a/include/control.h b/include/control.h -index 9ebb4905..e386ecec 100644 ---- a/include/control.h -+++ b/include/control.h -@@ -155,7 +155,7 @@ typedef struct _snd_ctl_elem_list snd_ctl_elem_list_t; - /** CTL element info container */ - typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t; - --/** CTL element value container -+/** CTL element value container. - * - * Contains the value(s) (i.e. members) of a single element. All - * values of a given element are of the same type. -@@ -167,6 +167,11 @@ typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t; - * using the latter, it must be freed again using - * snd_ctl_elem_value_free(). - * -+ * A value object can be zeroed out using snd_ctl_elem_value_clear(). -+ * -+ * A value object can be copied to another one using -+ * snd_ctl_elem_value_copy(). -+ * - * \par Identifier - * - * Then, the ID must be filled. It is sufficient to fill only the -@@ -621,7 +626,7 @@ size_t snd_ctl_elem_value_sizeof(void); - * \brief Allocate an invalid #snd_ctl_elem_value_t on the stack. - * - * Allocate space for a value object on the stack. The allocated -- * memory need not be freed, because is on the stack. -+ * memory need not be freed, because it is on the stack. - * - * See snd_ctl_elem_value_t for details. - * -diff --git a/src/control/cards.c b/src/control/cards.c -index 8226c42d..6145ebcd 100644 ---- a/src/control/cards.c -+++ b/src/control/cards.c -@@ -147,6 +147,7 @@ int snd_card_get_index(const char *string) - return -EINVAL; - if ((isdigit(*string) && *(string + 1) == 0) || - (isdigit(*string) && isdigit(*(string + 1)) && *(string + 2) == 0)) { -+ /* We got an index */ - if (sscanf(string, "%i", &card) != 1) - return -EINVAL; - if (card < 0 || card >= SND_MAX_CARDS) -@@ -156,8 +157,10 @@ int snd_card_get_index(const char *string) - return card; - return err; - } -- if (string[0] == '/') /* device name */ -+ if (string[0] == '/') -+ /* We got a device name */ - return snd_card_load2(string); -+ /* We got in ID */ - for (card = 0; card < SND_MAX_CARDS; card++) { - #ifdef SUPPORT_ALOAD - if (! snd_card_load(card)) -diff --git a/src/control/control.c b/src/control/control.c -index 7cf4decb..91415b51 100644 ---- a/src/control/control.c -+++ b/src/control/control.c -@@ -3127,7 +3127,7 @@ size_t snd_ctl_elem_value_sizeof() - /** - * \brief Allocate an invalid #snd_ctl_elem_value_t on the heap. - * -- * Allocate space for a value object on the head. The allocated memory -+ * Allocate space for a value object on the heap. The allocated memory - * must be freed using snd_ctl_elem_value_free(). - * - * See snd_ctl_elem_value_t for details. --- -2.31.1 - - -From f4f29d42be8b8ad60ea4c5697374adad4bfe6868 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 28 Jun 2021 12:08:53 +0200 -Subject: [PATCH 11/20] fix build with --disable-ucm - -Link: https://mailman.alsa-project.org/pipermail/alsa-devel/2021-June/186729.html -Reported-by: Michael Forney -Signed-off-by: Jaroslav Kysela ---- - include/local.h | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/include/local.h b/include/local.h -index 4e7d88a0..7cfcec53 100644 ---- a/include/local.h -+++ b/include/local.h -@@ -374,6 +374,8 @@ int _snd_config_load_with_include(snd_config_t *config, snd_input_t *in, - void *INTERNAL(snd_dlopen)(const char *name, int mode, char *errbuf, size_t errbuflen); - #endif - -+#ifdef BUILD_UCM -+ - const char *uc_mgr_alibcfg_by_device(snd_config_t **config, const char *name); - - static inline int _snd_is_ucm_device(const char *name) -@@ -381,4 +383,12 @@ static inline int _snd_is_ucm_device(const char *name) - return name && name[0] == '_' && name[1] == 'u' && name[2] == 'c' && name[3] == 'm'; - } - -+#else -+ -+static inline const char *uc_mgr_alibcfg_by_device(snd_config_t **config, const char *name) { return NULL; } -+static inline int _snd_is_ucm_device(const char *name) { return 0; } -+ -+ -+#endif -+ - #endif --- -2.31.1 - - -From 1a1f0fb244c477c430e156da878475ef57d198f9 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 28 Jun 2021 12:11:54 +0200 -Subject: [PATCH 12/20] pcm: rate - fix some gcc warnings - -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_rate.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c -index 13111d29..c45895a9 100644 ---- a/src/pcm/pcm_rate.c -+++ b/src/pcm/pcm_rate.c -@@ -82,12 +82,12 @@ struct _snd_pcm_rate { - - /* allocate a channel area and a temporary buffer for the given size */ - static snd_pcm_channel_area_t * --rate_alloc_tmp_buf(snd_pcm_rate_t *rate, snd_pcm_format_t format, -+rate_alloc_tmp_buf(snd_pcm_format_t format, - unsigned int channels, unsigned int frames) - { - snd_pcm_channel_area_t *ap; - int width = snd_pcm_format_physical_width(format); -- int i; -+ unsigned int i; - - ap = malloc(sizeof(*ap) * channels); - if (!ap) -@@ -354,7 +354,7 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - snd_pcm_rate_t *rate = pcm->private_data; - snd_pcm_t *slave = rate->gen.slave; - snd_pcm_rate_side_info_t *sinfo, *cinfo; -- unsigned int channels, cwidth, swidth, chn, acc; -+ unsigned int channels, acc; - int need_src_buf, need_dst_buf; - int err = snd_pcm_hw_params_slave(pcm, params, - snd_pcm_rate_hw_refine_cchange, -@@ -401,9 +401,9 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - return -EBUSY; - } - -- rate->pareas = rate_alloc_tmp_buf(rate, cinfo->format, channels, -+ rate->pareas = rate_alloc_tmp_buf(cinfo->format, channels, - cinfo->period_size); -- rate->sareas = rate_alloc_tmp_buf(rate, sinfo->format, channels, -+ rate->sareas = rate_alloc_tmp_buf(sinfo->format, channels, - sinfo->period_size); - if (!rate->pareas || !rate->sareas) { - err = -ENOMEM; -@@ -442,7 +442,7 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - rate->src_conv_idx = - snd_pcm_linear_convert_index(rate->orig_in_format, - rate->info.in.format); -- rate->src_buf = rate_alloc_tmp_buf(rate, rate->info.in.format, -+ rate->src_buf = rate_alloc_tmp_buf(rate->info.in.format, - channels, rate->info.in.period_size); - if (!rate->src_buf) { - err = -ENOMEM; -@@ -454,7 +454,7 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - rate->dst_conv_idx = - snd_pcm_linear_convert_index(rate->info.out.format, - rate->orig_out_format); -- rate->dst_buf = rate_alloc_tmp_buf(rate, rate->info.out.format, -+ rate->dst_buf = rate_alloc_tmp_buf(rate->info.out.format, - channels, rate->info.out.period_size); - if (!rate->dst_buf) { - err = -ENOMEM; --- -2.31.1 - - -From e47c11822d6b459a9b3704b3ee6a4a5c9a1b85be Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 29 Jun 2021 18:02:27 +0200 -Subject: [PATCH 13/20] control: remap - assign right name to the child handle - for no-op - -Fixes: https://github.com/alsa-project/alsa-utils/issues/100 -Signed-off-by: Jaroslav Kysela ---- - src/control/control_remap.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/control/control_remap.c b/src/control/control_remap.c -index a85c1725..81524014 100644 ---- a/src/control/control_remap.c -+++ b/src/control/control_remap.c -@@ -1173,6 +1173,10 @@ int snd_ctl_remap_open(snd_ctl_t **handlep, const char *name, snd_config_t *rema - /* no-op check, remove the plugin */ - if (priv->map_items == 0 && priv->remap_items == 0) { - remap_free(priv); -+ free(child->name); -+ child->name = name ? strdup(name) : NULL; -+ if (name && !child->name) -+ return -ENOMEM; - *handlep = child; - return 0; - } --- -2.31.1 - - -From 23a191a82c693456e61431ab699cddc1e5782a26 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 29 Jun 2021 19:31:28 +0200 -Subject: [PATCH 14/20] control: remap - assign right name to the child handle - for no-op (2nd case) - -Fixes: https://github.com/alsa-project/alsa-utils/issues/100 -Signed-off-by: Jaroslav Kysela ---- - src/control/control_remap.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/control/control_remap.c b/src/control/control_remap.c -index 81524014..4914f960 100644 ---- a/src/control/control_remap.c -+++ b/src/control/control_remap.c -@@ -1154,6 +1154,10 @@ int snd_ctl_remap_open(snd_ctl_t **handlep, const char *name, snd_config_t *rema - snd_ctl_t *ctl; - int result, err; - -+ /* no-op, remove the plugin */ -+ if (!remap && !map) -+ goto _noop; -+ - priv = calloc(1, sizeof(*priv)); - if (priv == NULL) - return -ENOMEM; -@@ -1173,6 +1177,7 @@ int snd_ctl_remap_open(snd_ctl_t **handlep, const char *name, snd_config_t *rema - /* no-op check, remove the plugin */ - if (priv->map_items == 0 && priv->remap_items == 0) { - remap_free(priv); -+ _noop: - free(child->name); - child->name = name ? strdup(name) : NULL; - if (name && !child->name) -@@ -1316,11 +1321,6 @@ int _snd_ctl_remap_open(snd_ctl_t **handlep, char *name, snd_config_t *root, snd - err = _snd_ctl_open_child(&cctl, root, child, mode, conf); - if (err < 0) - return err; -- /* no-op, remove the plugin */ -- if (!remap && !map) { -- *handlep = cctl; -- return 0; -- } - err = snd_ctl_remap_open(handlep, name, remap, map, cctl, mode); - if (err < 0) - snd_ctl_close(cctl); --- -2.31.1 - - -From 7d40a76ef5494e08af00fa4e7bfefbd43aba4827 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 31 Aug 2021 09:25:12 +0200 -Subject: [PATCH 19/20] ucm: avoid zero card instance number - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/utils.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/ucm/utils.c b/src/ucm/utils.c -index f3a8c9ba..10b21c34 100644 ---- a/src/ucm/utils.c -+++ b/src/ucm/utils.c -@@ -780,6 +780,9 @@ int uc_mgr_card_open(snd_use_case_mgr_t *uc_mgr) - while (uc_mgr_card_find(ucm_card_assign)) { - ucm_card_assign++; - ucm_card_assign &= 0xffff; -+ /* avoid zero card instance number */ -+ if (ucm_card_assign == 0) -+ ucm_card_assign++; - if (ucm_card_assign == prev) { - pthread_mutex_unlock(&ucm_cards_mutex); - return -ENOMEM; --- -2.31.1 - - -From 4a52ae4c329ae17117375a4b85b80f37994a4044 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 31 Aug 2021 09:40:42 +0200 -Subject: [PATCH 20/20] ucm: fix the parsing of the hexadecimal prefix - -The safe_strtol() function use strtol() which expects -to have the '0x' prefix for the hexadecimal number (when -base argument is zero). - -BugLink: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1553 -Signed-off-by: Jaroslav Kysela ---- - src/ucm/utils.c | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/src/ucm/utils.c b/src/ucm/utils.c -index 10b21c34..2fbc4c8c 100644 ---- a/src/ucm/utils.c -+++ b/src/ucm/utils.c -@@ -811,7 +811,7 @@ void uc_mgr_card_close(snd_use_case_mgr_t *uc_mgr) - */ - const char *uc_mgr_alibcfg_by_device(snd_config_t **top, const char *name) - { -- char buf[5]; -+ char buf[7]; - long card_num; - snd_config_t *config; - snd_use_case_mgr_t *uc_mgr; -@@ -819,8 +819,10 @@ const char *uc_mgr_alibcfg_by_device(snd_config_t **top, const char *name) - - if (strncmp(name, "_ucm", 4) || strlen(name) < 12 || name[8] != '.') - return NULL; -- strncpy(buf, name + 4, 4); -- buf[4] = '\0'; -+ buf[0] = '0'; -+ buf[1] = 'x'; -+ strncpy(buf + 2, name + 4, 4); -+ buf[6] = '\0'; - err = safe_strtol(buf, &card_num); - if (err < 0 || card_num < 0 || card_num > 0xffff) - return NULL; --- -2.31.1 - diff --git a/alsa-lib.spec b/alsa-lib.spec index 5493e3c..e5448f5 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,14 +2,14 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.5.1 -%define version_alsa_ucm 1.2.5.1 +%define version_alsa_lib 1.2.6 +%define version_alsa_ucm 1.2.6 %define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 4%{?prever_dot}%{?dist} +Release: 1%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Mon Dec 6 2021 Jaroslav Kysela - 1.2.6-1 +- update to 1.2.6 + * Sat Nov 13 2021 Peter Robinson - 1.2.5.1-4 - Add Rockchip ES8316 support diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index 0ceffd8..e69de29 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -1,147 +0,0 @@ -From 85eea19783cfccaccd859e303fda62adb63c219d Mon Sep 17 00:00:00 2001 -From: Jian-Hong Pan -Date: Tue, 7 Sep 2021 11:38:14 +0800 -Subject: [PATCH] ucm2: Add UCM support for rockchip_es8316 on Pinebook Pro - -Add UCM config files for Pinebook Pro's audio. The config files are -transformed and tuned from Manjaro ARM's packages: -* pinebookpro-post-install's asound.state [1] -* pinebookpro-audio's audio_jack_plugged_in.sh [2] - -By the way, with these config files, the Speaker and Headphones will be -switched according to the (un)plugged state automatically. - -[1] https://gitlab.manjaro.org/manjaro-arm/packages/community/pinebookpro-post-install/-/blob/4b4206c57b21044bf9c00848bd1f8b6f710d19eb/asound.state -[2] https://gitlab.manjaro.org/manjaro-arm/packages/community/pinebookpro-audio/-/blob/1f567db09495acc3beb5405c9ef85c3c07b86785/audio_jack_plugged_in.sh - -Fixes: https://github.com/alsa-project/alsa-ucm-conf/issues/110 -Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/112 -Signed-off-by: Jian-Hong Pan -Signed-off-by: Jaroslav Kysela ---- - ucm2/Rockchip/es8316/HiFi.conf | 66 +++++++++++++++++++ - ucm2/Rockchip/es8316/es8316.conf | 29 ++++++++ - .../rockchip_es8316/rockchip_es8316.conf | 1 + - 3 files changed, 96 insertions(+) - create mode 100644 ucm2/Rockchip/es8316/HiFi.conf - create mode 100644 ucm2/Rockchip/es8316/es8316.conf - create mode 120000 ucm2/conf.d/rockchip_es8316/rockchip_es8316.conf - -diff --git a/ucm2/Rockchip/es8316/HiFi.conf b/ucm2/Rockchip/es8316/HiFi.conf -new file mode 100644 -index 0000000..2124ded ---- /dev/null -+++ b/ucm2/Rockchip/es8316/HiFi.conf -@@ -0,0 +1,66 @@ -+# Reference: -+# https://gitlab.manjaro.org/manjaro-arm/packages/community/pinebookpro-post-install/-/blob/4b4206c57b21044bf9c00848bd1f8b6f710d19eb/asound.state -+# https://gitlab.manjaro.org/manjaro-arm/packages/community/pinebookpro-audio/-/blob/1f567db09495acc3beb5405c9ef85c3c07b86785/audio_jack_plugged_in.sh -+ -+SectionDevice."Speaker" { -+ Comment "Speaker" -+ -+ ConflictingDevice [ -+ "Headphones" -+ ] -+ -+ EnableSequence [ -+ cset "name='Playback Polarity' 'R Invert'" -+ cset "name='Speaker Switch' on" -+ ] -+ -+ DisableSequence [ -+ cset "name='Speaker Switch' off" -+ ] -+ -+ Value { -+ PlaybackPriority 100 -+ PlaybackPCM "hw:${CardId}" -+ PlaybackMixerElem "Headphone Mixer" -+ PlaybackMasterElem "DAC" -+ } -+} -+ -+SectionDevice."Mic" { -+ Comment "Internal Microphone" -+ -+ EnableSequence [ -+ cset "name='Differential Mux' lin1-rin1" -+ ] -+ -+ Value { -+ CapturePriority 100 -+ CapturePCM "hw:${CardId}" -+ CaptureMixerElem "ADC PGA Gain" -+ CaptureMasterElem "ADC" -+ } -+} -+ -+SectionDevice."Headphones" { -+ Comment "Headphones" -+ -+ ConflictingDevice [ -+ "Speaker" -+ ] -+ -+ EnableSequence [ -+ cset "name='Playback Polarity' 'Normal'" -+ ] -+ DisableSequence [ -+ cset "name='Playback Polarity' 'R Invert'" -+ ] -+ -+ Value { -+ PlaybackPriority 200 -+ PlaybackPCM "hw:${CardId}" -+ PlaybackMixerElem "Headphone Mixer" -+ PlaybackMasterElem "DAC" -+ JackControl "Headphones Jack" -+ JackHWMute "Speaker" -+ } -+} -diff --git a/ucm2/Rockchip/es8316/es8316.conf b/ucm2/Rockchip/es8316/es8316.conf -new file mode 100644 -index 0000000..62044e6 ---- /dev/null -+++ b/ucm2/Rockchip/es8316/es8316.conf -@@ -0,0 +1,29 @@ -+Syntax 3 -+ -+SectionUseCase."HiFi" { -+ File "/Rockchip/es8316/HiFi.conf" -+ Comment "Play HiFi quality Music" -+} -+ -+BootSequence [ -+ # Disable all outputs -+ cset "name='Speaker Switch' off" -+ -+ # Set HP vol to 0 dB (3/3) -+ cset "name='Headphone Playback Volume' 3" -+ # Set HP mixer vol to 0 dB -+ cset "name='Headphone Mixer Volume' 11" -+ # Set DAC vol to 0 dB (192/192) -+ cset "name='DAC Playback Volume' 192" -+ -+ # Disable Auto Level Control -+ cset "name='ALC Capture Switch' off" -+ # Set ADC vol to 0 dB (192/192) -+ cset "name='ADC Capture Volume' 192" -+ # Set Mic amplifier to +16 dB -+ cset "name='ADC PGA Gain Volume' 7" -+ -+ # Setup muxes / switches -+ cset "name='Left Headphone Mixer Left DAC Switch' on" -+ cset "name='Right Headphone Mixer Right DAC Switch' on" -+] -diff --git a/ucm2/conf.d/rockchip_es8316/rockchip_es8316.conf b/ucm2/conf.d/rockchip_es8316/rockchip_es8316.conf -new file mode 120000 -index 0000000..6d1864f ---- /dev/null -+++ b/ucm2/conf.d/rockchip_es8316/rockchip_es8316.conf -@@ -0,0 +1 @@ -+../../Rockchip/es8316/es8316.conf -\ No newline at end of file --- -2.33.1 - diff --git a/sources b/sources index ddf88ed..07eab63 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.5.1.tar.bz2) = 01998ffa449e925ff552c13aea47f9540903afdc533086067c78dcaba4d239c347180d3d28bb0000e6d19b7779c7249fcc77a30057930ca22d18ba55e163fa1c +SHA512 (alsa-lib-1.2.6.tar.bz2) = ae95718813abf62811fe44c6df2a8de5a1227da4b022c4dd97dd8e7c1001f48307ba36bf04208bdbe24e8a8eebf4ed5a59f40ee6750dcbe976678071c3f2f5b7 +SHA512 (alsa-ucm-conf-1.2.6.tar.bz2) = 5fe85643b60c8defeafcdfcf97e61b5d05e6db28cef2466a70f63b8fffba22bdd50b83a5ca88806a6350de6e9d802dd3c2240b293190b9d05daea515c03d4397 SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 -SHA512 (alsa-ucm-conf-1.2.5.1.tar.bz2) = 774d6da1a0ee6fb1fcd764c1d4b3eb5812a35508cf27db71f6c82784f125eca207992da9081d25783fecb31e548d8b34124d4b3b3d506e33215b76ea48f71012 From 3aa0c13e226bab7eef802e24c0a2b49eee340620 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 6 Dec 2021 13:17:48 +0100 Subject: [PATCH 15/68] update to 1.2.6 --- alsa-git.patch | 1916 ------------------------------------------------ alsa-lib.spec | 9 +- sources | 4 +- 3 files changed, 8 insertions(+), 1921 deletions(-) diff --git a/alsa-git.patch b/alsa-git.patch index f88de1b..e69de29 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -1,1916 +0,0 @@ -From 81e7923fbfad45b2f353a4d6e3053af51f5f7d0b Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 15 Jun 2021 23:21:42 +0200 -Subject: [PATCH 01/20] control: empty - fix the static build - -Reported-by: Jan Palus -Fixes: https://github.com/alsa-project/alsa-lib/issues/157 -Signed-off-by: Jaroslav Kysela ---- - src/control/control_empty.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/control/control_empty.c b/src/control/control_empty.c -index 49d1026c..c9b048c1 100644 ---- a/src/control/control_empty.c -+++ b/src/control/control_empty.c -@@ -30,7 +30,7 @@ - - #ifndef PIC - /* entry for static linking */ --const char *_snd_module_ctl_empty = ""; -+const char *_snd_module_control_empty = ""; - #endif - - /*! \page control_plugins --- -2.31.1 - - -From 5089358aa99d698bd846b05c1890a09613d740b3 Mon Sep 17 00:00:00 2001 -From: Takashi Iwai -Date: Thu, 17 Jun 2021 10:20:25 +0200 -Subject: [PATCH 02/20] pcm: rate: Refactoring temporary buffer allocations - -Introduce common helpers to allocate and release the temporary buffers -and the associated snd_pcm_channel. Now two allocated objects are -used instead of one malloc to be split. - -Also, change the snd_pcm_channel set up to be in interleaved mode. -This will be necessary in the following change in the rate plugin. - -Signed-off-by: Takashi Iwai ---- - src/pcm/pcm_rate.c | 80 ++++++++++++++++++++++++++++------------------ - 1 file changed, 49 insertions(+), 31 deletions(-) - -diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c -index 770aafea..1e996134 100644 ---- a/src/pcm/pcm_rate.c -+++ b/src/pcm/pcm_rate.c -@@ -76,6 +76,45 @@ struct _snd_pcm_rate { - - #endif /* DOC_HIDDEN */ - -+/* allocate a channel area and a temporary buffer for the given size */ -+static snd_pcm_channel_area_t * -+rate_alloc_tmp_buf(snd_pcm_rate_t *rate, snd_pcm_format_t format, -+ unsigned int channels, unsigned int frames) -+{ -+ snd_pcm_channel_area_t *ap; -+ int width = snd_pcm_format_physical_width(format); -+ int i; -+ -+ ap = malloc(sizeof(*ap) * channels); -+ if (!ap) -+ return NULL; -+ ap->addr = malloc(frames * channels * width / 8); -+ if (!ap->addr) { -+ free(ap); -+ return NULL; -+ } -+ -+ /* set up in interleaved format */ -+ for (i = 0; i < channels; i++) { -+ ap[i].addr = ap[0].addr + (i * width) / 8; -+ ap[i].first = 0; -+ ap[i].step = width * channels; -+ } -+ -+ return ap; -+} -+ -+static void rate_free_tmp_buf(snd_pcm_channel_area_t **ptr) -+{ -+ snd_pcm_channel_area_t *c = *ptr; -+ -+ if (c) { -+ free(c->addr); -+ free(c); -+ *ptr = NULL; -+ } -+} -+ - static int snd_pcm_rate_hw_refine_cprepare(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_hw_params_t *params) - { - snd_pcm_rate_t *rate = pcm->private_data; -@@ -286,28 +325,13 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - if (err < 0) - return err; - -- rate->pareas = malloc(2 * channels * sizeof(*rate->pareas)); -- if (rate->pareas == NULL) -+ rate->pareas = rate_alloc_tmp_buf(rate, cinfo->format, channels, -+ cinfo->period_size); -+ rate->sareas = rate_alloc_tmp_buf(rate, sinfo->format, channels, -+ sinfo->period_size); -+ if (!rate->pareas || !rate->sareas) - goto error; - -- cwidth = snd_pcm_format_physical_width(cinfo->format); -- swidth = snd_pcm_format_physical_width(sinfo->format); -- rate->pareas[0].addr = malloc(((cwidth * channels * cinfo->period_size) / 8) + -- ((swidth * channels * sinfo->period_size) / 8)); -- if (rate->pareas[0].addr == NULL) -- goto error; -- -- rate->sareas = rate->pareas + channels; -- rate->sareas[0].addr = (char *)rate->pareas[0].addr + ((cwidth * channels * cinfo->period_size) / 8); -- for (chn = 0; chn < channels; chn++) { -- rate->pareas[chn].addr = (char *)rate->pareas[0].addr + (cwidth * chn * cinfo->period_size) / 8; -- rate->pareas[chn].first = 0; -- rate->pareas[chn].step = cwidth; -- rate->sareas[chn].addr = (char *)rate->sareas[0].addr + (swidth * chn * sinfo->period_size) / 8; -- rate->sareas[chn].first = 0; -- rate->sareas[chn].step = swidth; -- } -- - if (rate->ops.convert_s16) { - rate->get_idx = snd_pcm_linear_get_index(rate->info.in.format, SND_PCM_FORMAT_S16); - rate->put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S16, rate->info.out.format); -@@ -322,11 +346,8 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - return 0; - - error: -- if (rate->pareas) { -- free(rate->pareas[0].addr); -- free(rate->pareas); -- rate->pareas = NULL; -- } -+ rate_free_tmp_buf(&rate->pareas); -+ rate_free_tmp_buf(&rate->sareas); - if (rate->ops.free) - rate->ops.free(rate->obj); - return -ENOMEM; -@@ -335,12 +356,9 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - static int snd_pcm_rate_hw_free(snd_pcm_t *pcm) - { - snd_pcm_rate_t *rate = pcm->private_data; -- if (rate->pareas) { -- free(rate->pareas[0].addr); -- free(rate->pareas); -- rate->pareas = NULL; -- rate->sareas = NULL; -- } -+ -+ rate_free_tmp_buf(&rate->pareas); -+ rate_free_tmp_buf(&rate->sareas); - if (rate->ops.free) - rate->ops.free(rate->obj); - free(rate->src_buf); --- -2.31.1 - - -From 119d9c1678b1193f8b969a6483cae1f7bf95e609 Mon Sep 17 00:00:00 2001 -From: Takashi Iwai -Date: Thu, 17 Jun 2021 10:03:17 +0200 -Subject: [PATCH 03/20] pcm: rate: Improve the support multiple formats - -This patch extends the PCM rate plugin for allowing its converter -plugin to deal with multiple formats. Currently, the converter plugin -is allowed to take different formats only when convert callback is -defined. And for this way (so far only the standard linear rate -plugin does), all linear formats have to be handled, and it's -cumbersome. - -OTOH, most other rate plugins are implemented with convert_s16 -callback, which accepts only S16 format. This is often not ideal -because many converter engines can handle 32bit formats. Also, the -target format is often 32bit format, hence this would require -additional conversion even if the converter engine can output 32bit -natively. - -In this patch, for addressing the problems above, the rate plugin API -is extended in the following way: - -- The new get_supported_formats callback is added; this stores the bit - masks of the supported input and output formats, as well as the - behavior flags. Currently only linear formats are allowed. -- When the plugin accepts only the interleaved stream, set - SND_PCM_RATE_FLAG_INTERLEAVED flag bit. Otherwise the code has to - handle snd_pcm_channel_area at each call. -- When both input and output formats have to be identical, pass - SND_PCM_RATE_FLAG_SYNC_FORMATS flag bit. -- When the converter wants to process different formats, use convert - callback instead of convert_s16. You can put both in the ops for - compatibility, too. - The input and output formats are found in the info argument of init - callback. -- Now the PCM rate plugin core will skip the temporary buffer - allocation and conversions for pre- and post-process if not needed - (i.e. matching with the requested input or output format). - -The rate plugin API version is bumped to 0x010003. - -Signed-off-by: Takashi Iwai ---- - include/pcm_rate.h | 36 ++++- - src/pcm/pcm_rate.c | 358 +++++++++++++++++++++++++++------------------ - 2 files changed, 251 insertions(+), 143 deletions(-) - -diff --git a/include/pcm_rate.h b/include/pcm_rate.h -index 4171fb9d..48473ed4 100644 ---- a/include/pcm_rate.h -+++ b/include/pcm_rate.h -@@ -38,7 +38,7 @@ extern "C" { - /** - * Protocol version - */ --#define SND_PCM_RATE_PLUGIN_VERSION 0x010002 -+#define SND_PCM_RATE_PLUGIN_VERSION 0x010003 - - /** hw_params information for a single side */ - typedef struct snd_pcm_rate_side_info { -@@ -55,6 +55,11 @@ typedef struct snd_pcm_rate_info { - unsigned int channels; - } snd_pcm_rate_info_t; - -+enum { -+ SND_PCM_RATE_FLAG_INTERLEAVED = (1U << 0), /** only interleaved format */ -+ SND_PCM_RATE_FLAG_SYNC_FORMATS = (1U << 1), /** both input and output formats have to be identical */ -+}; -+ - /** Callback table of rate-converter */ - typedef struct snd_pcm_rate_ops { - /** -@@ -114,6 +119,13 @@ typedef struct snd_pcm_rate_ops { - * new ops since version 0x010002 - */ - void (*dump)(void *obj, snd_output_t *out); -+ /** -+ * get the supported input and output formats (optional); -+ * new ops since version 0x010003 -+ */ -+ int (*get_supported_formats)(void *obj, uint64_t *in_formats, -+ uint64_t *out_formats, -+ unsigned int *flags); - } snd_pcm_rate_ops_t; - - /** open function type */ -@@ -147,6 +159,28 @@ typedef struct snd_pcm_rate_old_ops { - snd_pcm_uframes_t (*input_frames)(void *obj, snd_pcm_uframes_t frames); - snd_pcm_uframes_t (*output_frames)(void *obj, snd_pcm_uframes_t frames); - } snd_pcm_rate_old_ops_t; -+ -+/* old rate_ops for protocol version 0x010002 */ -+typedef struct snd_pcm_rate_v2_ops { -+ void (*close)(void *obj); -+ int (*init)(void *obj, snd_pcm_rate_info_t *info); -+ void (*free)(void *obj); -+ void (*reset)(void *obj); -+ int (*adjust_pitch)(void *obj, snd_pcm_rate_info_t *info); -+ void (*convert)(void *obj, -+ const snd_pcm_channel_area_t *dst_areas, -+ snd_pcm_uframes_t dst_offset, unsigned int dst_frames, -+ const snd_pcm_channel_area_t *src_areas, -+ snd_pcm_uframes_t src_offset, unsigned int src_frames); -+ void (*convert_s16)(void *obj, int16_t *dst, unsigned int dst_frames, -+ const int16_t *src, unsigned int src_frames); -+ snd_pcm_uframes_t (*input_frames)(void *obj, snd_pcm_uframes_t frames); -+ snd_pcm_uframes_t (*output_frames)(void *obj, snd_pcm_uframes_t frames); -+ unsigned int version; -+ int (*get_supported_rates)(void *obj, unsigned int *rate_min, -+ unsigned int *rate_max); -+ void (*dump)(void *obj, snd_output_t *out); -+} snd_pcm_rate_v2_ops_t; - #endif - - #ifdef __cplusplus -diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c -index 1e996134..13111d29 100644 ---- a/src/pcm/pcm_rate.c -+++ b/src/pcm/pcm_rate.c -@@ -62,18 +62,22 @@ struct _snd_pcm_rate { - void *open_func; - void *obj; - snd_pcm_rate_ops_t ops; -- unsigned int get_idx; -- unsigned int put_idx; -- int16_t *src_buf; -- int16_t *dst_buf; -+ unsigned int src_conv_idx; -+ unsigned int dst_conv_idx; -+ snd_pcm_channel_area_t *src_buf; -+ snd_pcm_channel_area_t *dst_buf; - int start_pending; /* start is triggered but not commited to slave */ - snd_htimestamp_t trigger_tstamp; - unsigned int plugin_version; - unsigned int rate_min, rate_max; -+ snd_pcm_format_t orig_in_format; -+ snd_pcm_format_t orig_out_format; -+ uint64_t in_formats; -+ uint64_t out_formats; -+ unsigned int format_flags; - }; - - #define SND_PCM_RATE_PLUGIN_VERSION_OLD 0x010001 /* old rate plugin */ -- - #endif /* DOC_HIDDEN */ - - /* allocate a channel area and a temporary buffer for the given size */ -@@ -274,12 +278,84 @@ static int snd_pcm_rate_hw_refine(snd_pcm_t *pcm, - snd_pcm_generic_hw_refine); - } - -+/* evaluate the best matching available format to the given format */ -+static int get_best_format(uint64_t mask, snd_pcm_format_t orig) -+{ -+ int pwidth = snd_pcm_format_physical_width(orig); -+ int width = snd_pcm_format_width(orig); -+ int signd = snd_pcm_format_signed(orig); -+ int best_score = -1; -+ int match = -1; -+ int f, score; -+ -+ for (f = 0; f <= SND_PCM_FORMAT_LAST; f++) { -+ if (!(mask & (1ULL << f))) -+ continue; -+ score = 0; -+ if (snd_pcm_format_linear(f)) { -+ if (snd_pcm_format_physical_width(f) == pwidth) -+ score++; -+ if (snd_pcm_format_physical_width(f) >= pwidth) -+ score++; -+ if (snd_pcm_format_width(f) == width) -+ score++; -+ if (snd_pcm_format_signed(f) == signd) -+ score++; -+ } -+ if (score > best_score) { -+ match = f; -+ best_score = score; -+ } -+ } -+ -+ return match; -+} -+ -+/* set up the input and output formats from the available lists */ -+static int choose_preferred_format(snd_pcm_rate_t *rate) -+{ -+ uint64_t in_mask = rate->in_formats; -+ uint64_t out_mask = rate->out_formats; -+ int in, out; -+ -+ if (!in_mask || !out_mask) -+ return 0; -+ -+ if (rate->orig_in_format == rate->orig_out_format) -+ if (in_mask & out_mask & (1ULL << rate->orig_in_format)) -+ return 0; /* nothing changed */ -+ -+ repeat: -+ in = get_best_format(in_mask, rate->orig_in_format); -+ out = get_best_format(out_mask, rate->orig_out_format); -+ if (in < 0 || out < 0) -+ return -ENOENT; -+ -+ if ((rate->format_flags & SND_PCM_RATE_FLAG_SYNC_FORMATS) && -+ in != out) { -+ if (out_mask & (1ULL << in)) -+ out = in; -+ else if (in_mask & (1ULL << out)) -+ in = out; -+ else { -+ in_mask &= ~(1ULL << in); -+ out_mask &= ~(1ULL << out); -+ goto repeat; -+ } -+ } -+ -+ rate->info.in.format = in; -+ rate->info.out.format = out; -+ return 0; -+} -+ - static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - { - snd_pcm_rate_t *rate = pcm->private_data; - snd_pcm_t *slave = rate->gen.slave; - snd_pcm_rate_side_info_t *sinfo, *cinfo; -- unsigned int channels, cwidth, swidth, chn; -+ unsigned int channels, cwidth, swidth, chn, acc; -+ int need_src_buf, need_dst_buf; - int err = snd_pcm_hw_params_slave(pcm, params, - snd_pcm_rate_hw_refine_cchange, - snd_pcm_rate_hw_refine_sprepare, -@@ -308,6 +384,9 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - if (err < 0) - return err; - err = INTERNAL(snd_pcm_hw_params_get_channels)(params, &channels); -+ if (err < 0) -+ return err; -+ err = INTERNAL(snd_pcm_hw_params_get_access)(params, &acc); - if (err < 0) - return err; - -@@ -321,36 +400,80 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - SNDMSG("rate plugin already in use"); - return -EBUSY; - } -- err = rate->ops.init(rate->obj, &rate->info); -- if (err < 0) -- return err; - - rate->pareas = rate_alloc_tmp_buf(rate, cinfo->format, channels, - cinfo->period_size); - rate->sareas = rate_alloc_tmp_buf(rate, sinfo->format, channels, - sinfo->period_size); -- if (!rate->pareas || !rate->sareas) -- goto error; -- -- if (rate->ops.convert_s16) { -- rate->get_idx = snd_pcm_linear_get_index(rate->info.in.format, SND_PCM_FORMAT_S16); -- rate->put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S16, rate->info.out.format); -- free(rate->src_buf); -- rate->src_buf = malloc(channels * rate->info.in.period_size * 2); -- free(rate->dst_buf); -- rate->dst_buf = malloc(channels * rate->info.out.period_size * 2); -- if (! rate->src_buf || ! rate->dst_buf) -+ if (!rate->pareas || !rate->sareas) { -+ err = -ENOMEM; -+ goto error_pareas; -+ } -+ -+ rate->orig_in_format = rate->info.in.format; -+ rate->orig_out_format = rate->info.out.format; -+ if (choose_preferred_format(rate) < 0) { -+ SNDERR("No matching format in rate plugin"); -+ err = -EINVAL; -+ goto error_pareas; -+ } -+ -+ err = rate->ops.init(rate->obj, &rate->info); -+ if (err < 0) -+ goto error_init; -+ -+ rate_free_tmp_buf(&rate->src_buf); -+ rate_free_tmp_buf(&rate->dst_buf); -+ -+ need_src_buf = need_dst_buf = 0; -+ -+ if ((rate->format_flags & SND_PCM_RATE_FLAG_INTERLEAVED) && -+ !(acc == SND_PCM_ACCESS_MMAP_INTERLEAVED || -+ acc == SND_PCM_ACCESS_RW_INTERLEAVED)) { -+ need_src_buf = need_dst_buf = 1; -+ } else { -+ if (rate->orig_in_format != rate->info.in.format) -+ need_src_buf = 1; -+ if (rate->orig_out_format != rate->info.out.format) -+ need_dst_buf = 1; -+ } -+ -+ if (need_src_buf) { -+ rate->src_conv_idx = -+ snd_pcm_linear_convert_index(rate->orig_in_format, -+ rate->info.in.format); -+ rate->src_buf = rate_alloc_tmp_buf(rate, rate->info.in.format, -+ channels, rate->info.in.period_size); -+ if (!rate->src_buf) { -+ err = -ENOMEM; - goto error; -+ } -+ } -+ -+ if (need_dst_buf) { -+ rate->dst_conv_idx = -+ snd_pcm_linear_convert_index(rate->info.out.format, -+ rate->orig_out_format); -+ rate->dst_buf = rate_alloc_tmp_buf(rate, rate->info.out.format, -+ channels, rate->info.out.period_size); -+ if (!rate->dst_buf) { -+ err = -ENOMEM; -+ goto error; -+ } - } - - return 0; - - error: -- rate_free_tmp_buf(&rate->pareas); -- rate_free_tmp_buf(&rate->sareas); -+ rate_free_tmp_buf(&rate->src_buf); -+ rate_free_tmp_buf(&rate->dst_buf); -+ error_init: - if (rate->ops.free) - rate->ops.free(rate->obj); -- return -ENOMEM; -+ error_pareas: -+ rate_free_tmp_buf(&rate->pareas); -+ rate_free_tmp_buf(&rate->sareas); -+ return err; - } - - static int snd_pcm_rate_hw_free(snd_pcm_t *pcm) -@@ -361,9 +484,8 @@ static int snd_pcm_rate_hw_free(snd_pcm_t *pcm) - rate_free_tmp_buf(&rate->sareas); - if (rate->ops.free) - rate->ops.free(rate->obj); -- free(rate->src_buf); -- free(rate->dst_buf); -- rate->src_buf = rate->dst_buf = NULL; -+ rate_free_tmp_buf(&rate->src_buf); -+ rate_free_tmp_buf(&rate->dst_buf); - return snd_pcm_hw_free(rate->gen.slave); - } - -@@ -444,82 +566,6 @@ static int snd_pcm_rate_init(snd_pcm_t *pcm) - return 0; - } - --static void convert_to_s16(snd_pcm_rate_t *rate, int16_t *buf, -- const snd_pcm_channel_area_t *areas, -- snd_pcm_uframes_t offset, unsigned int frames, -- unsigned int channels) --{ --#ifndef DOC_HIDDEN --#define GET16_LABELS --#include "plugin_ops.h" --#undef GET16_LABELS --#endif /* DOC_HIDDEN */ -- void *get = get16_labels[rate->get_idx]; -- const char *src; -- int16_t sample; -- const char *srcs[channels]; -- int src_step[channels]; -- unsigned int c; -- -- for (c = 0; c < channels; c++) { -- srcs[c] = snd_pcm_channel_area_addr(areas + c, offset); -- src_step[c] = snd_pcm_channel_area_step(areas + c); -- } -- -- while (frames--) { -- for (c = 0; c < channels; c++) { -- src = srcs[c]; -- goto *get; --#ifndef DOC_HIDDEN --#define GET16_END after_get --#include "plugin_ops.h" --#undef GET16_END --#endif /* DOC_HIDDEN */ -- after_get: -- *buf++ = sample; -- srcs[c] += src_step[c]; -- } -- } --} -- --static void convert_from_s16(snd_pcm_rate_t *rate, const int16_t *buf, -- const snd_pcm_channel_area_t *areas, -- snd_pcm_uframes_t offset, unsigned int frames, -- unsigned int channels) --{ --#ifndef DOC_HIDDEN --#define PUT16_LABELS --#include "plugin_ops.h" --#undef PUT16_LABELS --#endif /* DOC_HIDDEN */ -- void *put = put16_labels[rate->put_idx]; -- char *dst; -- int16_t sample; -- char *dsts[channels]; -- int dst_step[channels]; -- unsigned int c; -- -- for (c = 0; c < channels; c++) { -- dsts[c] = snd_pcm_channel_area_addr(areas + c, offset); -- dst_step[c] = snd_pcm_channel_area_step(areas + c); -- } -- -- while (frames--) { -- for (c = 0; c < channels; c++) { -- dst = dsts[c]; -- sample = *buf++; -- goto *put; --#ifndef DOC_HIDDEN --#define PUT16_END after_put --#include "plugin_ops.h" --#undef PUT16_END --#endif /* DOC_HIDDEN */ -- after_put: -- dsts[c] += dst_step[c]; -- } -- } --} -- - static void do_convert(const snd_pcm_channel_area_t *dst_areas, - snd_pcm_uframes_t dst_offset, unsigned int dst_frames, - const snd_pcm_channel_area_t *src_areas, -@@ -527,28 +573,40 @@ static void do_convert(const snd_pcm_channel_area_t *dst_areas, - unsigned int channels, - snd_pcm_rate_t *rate) - { -- if (rate->ops.convert_s16) { -- const int16_t *src; -- int16_t *dst; -- if (! rate->src_buf) -- src = (int16_t *)src_areas->addr + src_offset * channels; -- else { -- convert_to_s16(rate, rate->src_buf, src_areas, src_offset, -- src_frames, channels); -- src = rate->src_buf; -- } -- if (! rate->dst_buf) -- dst = (int16_t *)dst_areas->addr + dst_offset * channels; -- else -- dst = rate->dst_buf; -- rate->ops.convert_s16(rate->obj, dst, dst_frames, src, src_frames); -- if (dst == rate->dst_buf) -- convert_from_s16(rate, rate->dst_buf, dst_areas, dst_offset, -- dst_frames, channels); -+ const snd_pcm_channel_area_t *out_areas; -+ snd_pcm_uframes_t out_offset; -+ -+ if (rate->dst_buf) { -+ out_areas = rate->dst_buf; -+ out_offset = 0; - } else { -- rate->ops.convert(rate->obj, dst_areas, dst_offset, dst_frames, -- src_areas, src_offset, src_frames); -+ out_areas = dst_areas; -+ out_offset = dst_offset; -+ } -+ -+ if (rate->src_buf) { -+ snd_pcm_linear_convert(rate->src_buf, 0, -+ src_areas, src_offset, -+ channels, src_frames, -+ rate->src_conv_idx); -+ src_areas = rate->src_buf; -+ src_offset = 0; - } -+ -+ if (rate->ops.convert) -+ rate->ops.convert(rate->obj, out_areas, out_offset, dst_frames, -+ src_areas, src_offset, src_frames); -+ else -+ rate->ops.convert_s16(rate->obj, -+ snd_pcm_channel_area_addr(out_areas, out_offset), -+ dst_frames, -+ snd_pcm_channel_area_addr(src_areas, src_offset), -+ src_frames); -+ if (rate->dst_buf) -+ snd_pcm_linear_convert(dst_areas, dst_offset, -+ rate->dst_buf, 0, -+ channels, dst_frames, -+ rate->dst_conv_idx); - } - - static inline void -@@ -1276,6 +1334,30 @@ const snd_config_t *snd_pcm_rate_get_default_converter(snd_config_t *root) - return NULL; - } - -+static void rate_initial_setup(snd_pcm_rate_t *rate) -+{ -+ if (rate->plugin_version == SND_PCM_RATE_PLUGIN_VERSION) -+ rate->plugin_version = rate->ops.version; -+ -+ if (rate->plugin_version >= 0x010002 && -+ rate->ops.get_supported_rates) -+ rate->ops.get_supported_rates(rate->obj, -+ &rate->rate_min, -+ &rate->rate_max); -+ -+ if (rate->plugin_version >= 0x010003 && -+ rate->ops.get_supported_formats) { -+ rate->ops.get_supported_formats(rate->obj, -+ &rate->in_formats, -+ &rate->out_formats, -+ &rate->format_flags); -+ } else if (!rate->ops.convert && rate->ops.convert_s16) { -+ rate->in_formats = rate->out_formats = -+ 1ULL << SND_PCM_FORMAT_S16; -+ rate->format_flags = SND_PCM_RATE_FLAG_INTERLEAVED; -+ } -+} -+ - #ifdef PIC - static int is_builtin_plugin(const char *type) - { -@@ -1301,20 +1383,11 @@ static int rate_open_func(snd_pcm_rate_t *rate, const char *type, const snd_conf - lib = lib_name; - } - -- rate->rate_min = SND_PCM_PLUGIN_RATE_MIN; -- rate->rate_max = SND_PCM_PLUGIN_RATE_MAX; -- rate->plugin_version = SND_PCM_RATE_PLUGIN_VERSION; -- - open_conf_func = snd_dlobj_cache_get(lib, open_conf_name, NULL, verbose && converter_conf != NULL); - if (open_conf_func) { - err = open_conf_func(SND_PCM_RATE_PLUGIN_VERSION, - &rate->obj, &rate->ops, converter_conf); - if (!err) { -- rate->plugin_version = rate->ops.version; -- if (rate->ops.get_supported_rates) -- rate->ops.get_supported_rates(rate->obj, -- &rate->rate_min, -- &rate->rate_max); - rate->open_func = open_conf_func; - return 0; - } else { -@@ -1330,23 +1403,18 @@ static int rate_open_func(snd_pcm_rate_t *rate, const char *type, const snd_conf - rate->open_func = open_func; - - err = open_func(SND_PCM_RATE_PLUGIN_VERSION, &rate->obj, &rate->ops); -- if (!err) { -- rate->plugin_version = rate->ops.version; -- if (rate->ops.get_supported_rates) -- rate->ops.get_supported_rates(rate->obj, -- &rate->rate_min, -- &rate->rate_max); -+ if (!err) - return 0; -- } - - /* try to open with the old protocol version */ - rate->plugin_version = SND_PCM_RATE_PLUGIN_VERSION_OLD; - err = open_func(SND_PCM_RATE_PLUGIN_VERSION_OLD, - &rate->obj, &rate->ops); -- if (err) { -- snd_dlobj_cache_put(open_func); -- rate->open_func = NULL; -- } -+ if (!err) -+ return 0; -+ -+ snd_dlobj_cache_put(open_func); -+ rate->open_func = NULL; - return err; - } - #endif -@@ -1417,6 +1485,10 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, - rate->srate = srate; - rate->sformat = sformat; - -+ rate->rate_min = SND_PCM_PLUGIN_RATE_MIN; -+ rate->rate_max = SND_PCM_PLUGIN_RATE_MAX; -+ rate->plugin_version = SND_PCM_RATE_PLUGIN_VERSION; -+ - err = snd_pcm_new(&pcm, SND_PCM_TYPE_RATE, name, slave->stream, slave->mode); - if (err < 0) { - free(rate); -@@ -1496,6 +1568,8 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, - return err; - } - -+ rate_initial_setup(rate); -+ - pcm->ops = &snd_pcm_rate_ops; - pcm->fast_ops = &snd_pcm_rate_fast_ops; - pcm->private_data = rate; --- -2.31.1 - - -From 3f737a2a2c8d20e78dea3ea836997f9d74f602a0 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Fri, 18 Jun 2021 11:35:30 +0200 -Subject: [PATCH 04/20] pcm: improve docs for snd_pcm_sw_params_get_avail_min() - and snd_pcm_status_get_avail_max() - -Fixes: https://github.com/alsa-project/alsa-lib/issues/44 -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c -index 09df0f12..892abf98 100644 ---- a/src/pcm/pcm.c -+++ b/src/pcm/pcm.c -@@ -6500,6 +6500,9 @@ int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, - * \param params Software configuration container - * \param val returned minimum available frames to consider PCM ready - * \return 0 otherwise a negative error code -+ * -+ * This is a threshold value when the PCM stream is considered as ready for -+ * another read/write operation or poll event. - */ - #ifndef DOXYGEN - EXPORT_SYMBOL int INTERNAL(snd_pcm_sw_params_get_avail_min)(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val) -@@ -6960,6 +6963,8 @@ snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t *obj) - /** - * \brief Get maximum number of frames available from a PCM status container after last #snd_pcm_status call - * \return Maximum number of frames ready to be read/written -+ * -+ * This value returns the peak for the available frames between #snd_pcm_status calls. - */ - snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t *obj) - { --- -2.31.1 - - -From 212c6c18c4317af48c007a0866efc029b9c3a593 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 21 Jun 2021 09:23:02 +0200 -Subject: [PATCH 05/20] pcm: dmix - use pcm_frame_diff() in - snd_pcm_dmix_sync_ptr0() - -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_dmix.c | 6 +----- - 1 file changed, 1 insertion(+), 5 deletions(-) - -diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c -index 608593f1..0d0d0bff 100644 ---- a/src/pcm/pcm_dmix.c -+++ b/src/pcm/pcm_dmix.c -@@ -393,17 +393,13 @@ static int snd_pcm_dmix_sync_ptr0(snd_pcm_t *pcm, snd_pcm_uframes_t slave_hw_ptr - - old_slave_hw_ptr = dmix->slave_hw_ptr; - dmix->slave_hw_ptr = slave_hw_ptr; -- diff = slave_hw_ptr - old_slave_hw_ptr; -+ diff = pcm_frame_diff(slave_hw_ptr, old_slave_hw_ptr, dmix->slave_boundary); - if (diff == 0) /* fast path */ - return 0; - if (dmix->state != SND_PCM_STATE_RUNNING && - dmix->state != SND_PCM_STATE_DRAINING) - /* not really started yet - don't update hw_ptr */ - return 0; -- if (diff < 0) { -- slave_hw_ptr += dmix->slave_boundary; -- diff = slave_hw_ptr - old_slave_hw_ptr; -- } - dmix->hw_ptr += diff; - dmix->hw_ptr %= pcm->boundary; - if (pcm->stop_threshold >= pcm->boundary) /* don't care */ --- -2.31.1 - - -From dd609ef9684987d3ca61d5c5cc3c77589ff9c29f Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 21 Jun 2021 09:28:41 +0200 -Subject: [PATCH 06/20] pcm: direct plugins - fix hw_ptr in the status callback - -The parent hw_ptr may be in another range (boundary limit). -Set the correct value for the caller. - -BugLink: https://github.com/alsa-project/alsa-lib/issues/155 -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_dmix.c | 1 + - src/pcm/pcm_dshare.c | 1 + - src/pcm/pcm_dsnoop.c | 1 + - 3 files changed, 3 insertions(+) - -diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c -index 0d0d0bff..94dbb1e0 100644 ---- a/src/pcm/pcm_dmix.c -+++ b/src/pcm/pcm_dmix.c -@@ -491,6 +491,7 @@ static int snd_pcm_dmix_status(snd_pcm_t *pcm, snd_pcm_status_t * status) - } - - status->state = snd_pcm_dmix_state(pcm); -+ status->hw_ptr = *pcm->hw.ptr; /* boundary may be different */ - status->appl_ptr = *pcm->appl.ptr; /* slave PCM doesn't set appl_ptr */ - status->trigger_tstamp = dmix->trigger_tstamp; - status->avail = snd_pcm_mmap_playback_avail(pcm); -diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c -index a918512b..01814dc8 100644 ---- a/src/pcm/pcm_dshare.c -+++ b/src/pcm/pcm_dshare.c -@@ -243,6 +243,7 @@ static int snd_pcm_dshare_status(snd_pcm_t *pcm, snd_pcm_status_t * status) - break; - } - status->state = snd_pcm_dshare_state(pcm); -+ status->hw_ptr = *pcm->hw.ptr; /* boundary may be different */ - status->appl_ptr = *pcm->appl.ptr; /* slave PCM doesn't set appl_ptr */ - status->trigger_tstamp = dshare->trigger_tstamp; - status->avail = snd_pcm_mmap_playback_avail(pcm); -diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c -index 2c3b9f43..3f28df99 100644 ---- a/src/pcm/pcm_dsnoop.c -+++ b/src/pcm/pcm_dsnoop.c -@@ -193,6 +193,7 @@ static int snd_pcm_dsnoop_status(snd_pcm_t *pcm, snd_pcm_status_t * status) - snd_pcm_status(dsnoop->spcm, status); - state = snd_pcm_state(dsnoop->spcm); - status->state = state == SND_PCM_STATE_RUNNING ? dsnoop->state : state; -+ status->hw_ptr = *pcm->hw.ptr; /* boundary may be different */ - status->appl_ptr = *pcm->appl.ptr; /* slave PCM doesn't set appl_ptr */ - status->trigger_tstamp = dsnoop->trigger_tstamp; - status->avail = snd_pcm_mmap_capture_avail(pcm); --- -2.31.1 - - -From a5e11f9a810391777ea7750f04ba66f9c9e624de Mon Sep 17 00:00:00 2001 -From: Takashi Iwai -Date: Mon, 21 Jun 2021 14:21:26 +0200 -Subject: [PATCH 07/20] pcm: Move snd_pcm_channel_area_addr() and _step() to - public header - -Used in the rate plugins commonly. - -Signed-off-by: Takashi Iwai ---- - include/pcm.h | 23 +++++++++++++++++++++++ - src/pcm/pcm_local.h | 13 ------------- - 2 files changed, 23 insertions(+), 13 deletions(-) - -diff --git a/include/pcm.h b/include/pcm.h -index e300b951..b5a514fa 100644 ---- a/include/pcm.h -+++ b/include/pcm.h -@@ -1173,6 +1173,29 @@ int snd_pcm_areas_copy_wrap(const snd_pcm_channel_area_t *dst_channels, - snd_pcm_uframes_t frames, - const snd_pcm_format_t format); - -+/** -+ * \brief get the address of the given PCM channel area -+ * \param area PCM channel area -+ * \param offset Offset in frames -+ * -+ * Returns the pointer corresponding to the given offset on the channel area. -+ */ -+static inline void *snd_pcm_channel_area_addr(const snd_pcm_channel_area_t *area, snd_pcm_uframes_t offset) -+{ -+ return (char *)area->addr + (area->first + area->step * offset) / 8; -+} -+ -+/** -+ * \brief get the step size of the given PCM channel area in bytes -+ * \param area PCM channel area -+ * -+ * Returns the step size in bytes from the given channel area. -+ */ -+static inline unsigned int snd_pcm_channel_area_step(const snd_pcm_channel_area_t *area) -+{ -+ return area->step / 8; -+} -+ - /** \} */ - - /** -diff --git a/src/pcm/pcm_local.h b/src/pcm/pcm_local.h -index a63f4be0..6f03365c 100644 ---- a/src/pcm/pcm_local.h -+++ b/src/pcm/pcm_local.h -@@ -632,19 +632,6 @@ static inline snd_pcm_sframes_t snd_pcm_mmap_delay(snd_pcm_t *pcm) - return snd_pcm_mmap_capture_delay(pcm); - } - --static inline void *snd_pcm_channel_area_addr(const snd_pcm_channel_area_t *area, snd_pcm_uframes_t offset) --{ -- unsigned int bitofs = area->first + area->step * offset; -- assert(bitofs % 8 == 0); -- return (char *) area->addr + bitofs / 8; --} -- --static inline unsigned int snd_pcm_channel_area_step(const snd_pcm_channel_area_t *area) --{ -- assert(area->step % 8 == 0); -- return area->step / 8; --} -- - static inline snd_pcm_sframes_t _snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size) - { - /* lock handled in the callback */ --- -2.31.1 - - -From e0e084659083c2ab75d5c894f24227ea2f67010f Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 21 Jun 2021 15:14:18 +0200 -Subject: [PATCH 08/20] pcm: direct plugins - fix bad memory access when - channel bindings do not match hw - -Fix and cleanup snd_pcm_direct_check_interleave() function. -Add requested / hardware channel check and use goto when the interleaved - -Fixes: https://github.com/alsa-project/alsa-lib/issues/117 -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_direct.c | 40 +++++++++++++++++----------------------- - 1 file changed, 17 insertions(+), 23 deletions(-) - -diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c -index d50503e3..90417b2f 100644 ---- a/src/pcm/pcm_direct.c -+++ b/src/pcm/pcm_direct.c -@@ -1627,43 +1627,37 @@ int snd_pcm_direct_set_timer_params(snd_pcm_direct_t *dmix) - int snd_pcm_direct_check_interleave(snd_pcm_direct_t *dmix, snd_pcm_t *pcm) - { - unsigned int chn, channels; -- int bits, interleaved = 1; -+ int bits; - const snd_pcm_channel_area_t *dst_areas; - const snd_pcm_channel_area_t *src_areas; - - bits = snd_pcm_format_physical_width(pcm->format); - if ((bits % 8) != 0) -- interleaved = 0; -+ goto __nointerleaved; - channels = dmix->channels; -+ if (channels != dmix->spcm->channels) -+ goto __nointerleaved; - dst_areas = snd_pcm_mmap_areas(dmix->spcm); - src_areas = snd_pcm_mmap_areas(pcm); - for (chn = 1; chn < channels; chn++) { -- if (dst_areas[chn-1].addr != dst_areas[chn].addr) { -- interleaved = 0; -- break; -- } -- if (src_areas[chn-1].addr != src_areas[chn].addr) { -- interleaved = 0; -- break; -- } -+ if (dst_areas[chn-1].addr != dst_areas[chn].addr) -+ goto __nointerleaved; -+ if (src_areas[chn-1].addr != src_areas[chn].addr) -+ goto __nointerleaved; - } - for (chn = 0; chn < channels; chn++) { -- if (dmix->bindings && dmix->bindings[chn] != chn) { -- interleaved = 0; -- break; -- } -+ if (dmix->bindings && dmix->bindings[chn] != chn) -+ goto __nointerleaved; - if (dst_areas[chn].first != chn * bits || -- dst_areas[chn].step != channels * bits) { -- interleaved = 0; -- break; -- } -+ dst_areas[chn].step != channels * bits) -+ goto __nointerleaved; - if (src_areas[chn].first != chn * bits || -- src_areas[chn].step != channels * bits) { -- interleaved = 0; -- break; -- } -+ src_areas[chn].step != channels * bits) -+ goto __nointerleaved; - } -- return dmix->interleaved = interleaved; -+ return dmix->interleaved = 1; -+__nointerleaved: -+ return dmix->interleaved = 0; - } - - /* --- -2.31.1 - - -From ccc14ae897d170156f1c2905ea5d18a3295e7b36 Mon Sep 17 00:00:00 2001 -From: "Tanjeff-N. Moos" -Date: Thu, 17 Jun 2021 10:36:38 +0200 -Subject: [PATCH 09/20] control: Add documentation for snd_ctl_card_* and - friends. - -In this patch series, I added a description about control interface -handling and how control interfaces are identified. - -In addition, I added/improved Doxygen documentation for the -snd_ctl_card_info_t type and related corresponding functions, -e.g. snd_ctl_card_info(). I also documented other card-related like -snd_card_next(). - -Along the way I did minor documentation improvements. - -Signed-off-by: Tanjeff-N. Moos -Signed-off-by: Takashi Iwai ---- - include/control.h | 40 +++++++++- - src/control/cards.c | 56 +++++++++----- - src/control/control.c | 175 +++++++++++++++++++++++++++++++----------- - 3 files changed, 202 insertions(+), 69 deletions(-) - -diff --git a/include/control.h b/include/control.h -index ccf906e2..9ebb4905 100644 ---- a/include/control.h -+++ b/include/control.h -@@ -50,7 +50,32 @@ typedef struct snd_aes_iec958 { - unsigned char dig_subframe[4]; /**< AES/IEC958 subframe bits */ - } snd_aes_iec958_t; - --/** CTL card info container */ -+/** \brief CTL card info container. -+ * -+ * This type contains meta information about a sound card, such as the index, -+ * name, longname, etc. -+ * -+ * \par Memory management -+ * -+ * Before using a snd_ctl_card_info_t object, it must be allocated using -+ * snd_ctl_card_info_alloca() or snd_ctl_card_info_malloc(). When using the -+ * latter, it must be freed again using snd_ctl_card_info_free(). -+ * -+ * A card info object can be zeroed out using snd_ctl_card_info_clear(). -+ * -+ * A card info object can be copied to another one using -+ * snd_ctl_card_info_copy(). -+ * -+ * \par Obtaining the Information -+ * -+ * To obtain the card information, it must first be opened using -+ * snd_ctl_open(), and a snd_ctl_card_info_t container must be -+ * allocated. Then, the information can be read using -+ * snd_ctl_card_info_get_card(). -+ * -+ * Thereafter, the card properties can be read using the -+ * snd_ctl_card_info_get_*() functions. -+ */ - typedef struct _snd_ctl_card_info snd_ctl_card_info_t; - - /** CTL element identifier container */ -@@ -442,11 +467,20 @@ void snd_ctl_elem_id_set_name(snd_ctl_elem_id_t *obj, const char *val); - void snd_ctl_elem_id_set_index(snd_ctl_elem_id_t *obj, unsigned int val); - - size_t snd_ctl_card_info_sizeof(void); -+ - /** \hideinitializer -- * \brief allocate an invalid #snd_ctl_card_info_t using standard alloca -- * \param ptr returned pointer -+ * \brief Allocate an invalid #snd_ctl_card_info_t on the stack. -+ * -+ * Allocate space for a card info object on the stack. The allocated -+ * memory need not be freed, because it is on the stack. -+ * -+ * See snd_ctl_card_info_t for details. -+ * -+ * \param ptr Pointer to a snd_ctl_elem_value_t pointer. The address -+ * of the allocated space will returned here. - */ - #define snd_ctl_card_info_alloca(ptr) __snd_alloca(ptr, snd_ctl_card_info) -+ - int snd_ctl_card_info_malloc(snd_ctl_card_info_t **ptr); - void snd_ctl_card_info_free(snd_ctl_card_info_t *obj); - void snd_ctl_card_info_clear(snd_ctl_card_info_t *obj); -diff --git a/src/control/cards.c b/src/control/cards.c -index e57457c2..8226c42d 100644 ---- a/src/control/cards.c -+++ b/src/control/cards.c -@@ -77,8 +77,8 @@ static int snd_card_load1(int card) - - /** - * \brief Try to load the driver for a card. -- * \param card Card number. -- * \return 1 if driver is present, zero if driver is not present -+ * \param card Card index. -+ * \return 1 if driver is present, zero if driver is not present. - */ - int snd_card_load(int card) - { -@@ -86,14 +86,24 @@ int snd_card_load(int card) - } - - /** -- * \brief Try to determine the next card. -- * \param rcard pointer to card number -- * \result zero if success, otherwise a negative error code -+ * \brief Iterate over physical sound cards. -+ * -+ * This function takes the index of a physical sound card and sets it to the -+ * index of the next card. If index is -1, it is set to the index of the first -+ * card. After the last card, the index is set to -1. -+ * -+ * For example, if you have 2 sound cards (with index 0 and 1), the index will -+ * be modified as follows: -+ * -+ * - -1 --> 0 -+ * - 0 --> 1 -+ * - 1 --> -1 -+ * -+ * This does not work for virtual sound cards. - * -- * Tries to determine the next card from given card number. -- * If card number is -1, then the first available card is -- * returned. If the result card number is -1, no more cards -- * are available. -+ * \param rcard Index of current card. The index of the next card is stored -+ * here. -+ * \result zero if success, otherwise a negative error code. - */ - int snd_card_next(int *rcard) - { -@@ -114,13 +124,18 @@ int snd_card_next(int *rcard) - } - - /** -- * \brief Convert card string to an integer value. -- * \param string String containing card identifier -- * \return zero if success, otherwise a negative error code -+ * \brief Convert a card string to the card index. - * -- * The accepted format is an integer value in ASCII representation -- * or the card identifier (the id parameter for sound-card drivers). -- * The control device name like /dev/snd/controlC0 is accepted, too. -+ * This works only for physical sound cards, not for virtual cards. -+ * -+ * \param string A string identifying the card. -+ * \return The index of the card. On error, a a negative error code -+ * is returned. -+ * -+ * The accepted formats for "string" are: -+ * - The index of the card (as listed in /proc/asound/cards), given as string -+ * - The ID of the card (as listed in /proc/asound/cards) -+ * - The control device name (like /dev/snd/controlC0) - */ - int snd_card_get_index(const char *string) - { -@@ -163,8 +178,9 @@ int snd_card_get_index(const char *string) - - /** - * \brief Obtain the card name. -- * \param card Card number -- * \param name Result - card name corresponding to card number -+ * -+ * \param card The index of the card. -+ * \param name Result - card name corresponding to card index. - * \result zero if success, otherwise a negative error code - * - * The value returned in name is allocated with strdup and should be -@@ -193,9 +209,9 @@ int snd_card_get_name(int card, char **name) - - /** - * \brief Obtain the card long name. -- * \param card Card number -- * \param name Result - card long name corresponding to card number -- * \result zero if success, otherwise a negative error code -+ * \param card Index of the card. -+ * \param name Result - card long name corresponding to card index. -+ * \result Zero if success, otherwise a negative error code. - * - * The value returned in name is allocated with strdup and should be - * freed when no longer used. -diff --git a/src/control/control.c b/src/control/control.c -index ed986e54..7cf4decb 100644 ---- a/src/control/control.c -+++ b/src/control/control.c -@@ -33,8 +33,50 @@ -

Control interface is designed to access primitive controls. There is - also an interface for notifying about control and structure changes. - -+ - \section control_general_overview General overview - -+In Alsa, there are physical sound cards, such as USB headsets, and -+virtual sound cards, such as "pulse", which represents the PulseAudio -+Sound system. Each sound card offers a control interface, making its -+settings (e.g. volume knobs) available. The complete list of available -+control interfaces can be obtained using snd_device_name_hint(), -+giving -1 as card index and "ctl" as interface type. Each returned -+NAME hint identifies a control interface. -+ -+Sound cards have an ID (a string), an index (an int, sometimes called -+the "card number"), a name, a longname, a mixername and a "components" -+property. The file /proc/asound/cards lists most of these properties -+for physical sound cards. Virtual sound cards are not listed in that -+file. The format is: -+ -+\verbatim -+index [ID ] Driver - name -+ longname -+\endverbatim -+ -+Note that the mixername and components are not listed. -+ -+ -+\subsection control_cards_id Identifying and Opening Control Interfaces -+ -+To work with a control interface, is must be opened first, using -+snd_ctl_open(). This function takes the interface name. -+ -+For physical sound cards, the control interface can be identified -+using the string "hw:" (e.g. `hw:2`). The NAME hint - which is -+"hw:CARD=" - can also be used. Further, its device file (something -+like `/dev/snd/controlC0`) is also acceptable. Either of them can be -+given to snd_ctl_open(). -+ -+For virtual sound cards, the NAME hint is given to snd_ctl_open(). -+ -+The functions snd_card_get_index(), snd_card_get_name() and -+snd_card_get_longname() can be used to find an identifying property -+when another one is already known. -+ -+\section control_elements Elements -+ - In ALSA control feature, each sound card can have control elements. The elements - are managed according to below model. - -@@ -65,7 +107,7 @@ are managed according to below model. - of userspace applications and drivers in kernel. - - --\section identifying_elements Identifying Elements -+\subsection identifying_elements Identifying Elements - - Each element has the following identifying properties: - -@@ -84,7 +126,7 @@ but in practice this is rare). The numid can change on each boot. - In case of an USB sound card, the numid can also change when it - is reconnected. The short numid is used to reduce the lookup time. - --\section element_lists Element Lists -+\subsection element_lists Element Lists - - An element list can be used to obtain a list of all elements of the - sound card. The list contains generic information (e.g. how many -@@ -93,7 +135,7 @@ elements the card has), and the identifying properties of the elements - element lists. - - --\section working_with_elements Working with Elements -+\subsection working_with_elements Working with Elements - - It is possible to obtain information about an element using the - snd_ctl_elem_info_*() functions. For enums, the allowed values can be -@@ -108,7 +150,7 @@ actual values or settings. It is also possible to get and set the ID - values (such as the numid or the name). - - --\section element_sets Element Sets -+\subsection element_sets Element Sets - - The type of element set is one of integer, integer64, boolean, enumerators, - bytes and IEC958 structure. This indicates the type of value for each member in -@@ -329,10 +371,15 @@ int snd_ctl_subscribe_events(snd_ctl_t *ctl, int subscribe) - - - /** -- * \brief Get card related information -- * \param ctl CTL handle -- * \param info Card info pointer -- * \return 0 on success otherwise a negative error code -+ * \brief Get information about the sound card. -+ * -+ * Obtain information about the sound card previously opened using -+ * snd_ctl_open(). The object "info" must be allocated prior to calling this -+ * function. See snd_ctl_card_info_t for details. -+ * -+ * \param ctl The CTL handle. -+ * \param info The card information is stored here. -+ * \return 0 on success, otherwise a negative error code. - */ - int snd_ctl_card_info(snd_ctl_t *ctl, snd_ctl_card_info_t *info) - { -@@ -1508,11 +1555,13 @@ int _snd_ctl_open_named_child(snd_ctl_t **pctl, const char *name, - #endif - - /** -- * \brief Opens a CTL -- * \param ctlp Returned CTL handle -- * \param name ASCII identifier of the CTL handle -- * \param mode Open mode (see #SND_CTL_NONBLOCK, #SND_CTL_ASYNC) -- * \return 0 on success otherwise a negative error code -+ * \brief Opens a sound card. -+ * -+ * \param ctlp Returned CTL handle. -+ * \param name A string identifying the card (See \ref control_cards_id). -+ * \param mode Open mode (see #SND_CTL_NONBLOCK, #SND_CTL_ASYNC). -+ * -+ * \return 0 on success otherwise a negative error code. - */ - int snd_ctl_open(snd_ctl_t **ctlp, const char *name, int mode) - { -@@ -2027,8 +2076,8 @@ void snd_ctl_elem_id_set_index(snd_ctl_elem_id_t *obj, unsigned int val) - } - - /** -- * \brief get size of #snd_ctl_card_info_t -- * \return size in bytes -+ * \brief get size of #snd_ctl_card_info_t. -+ * \return Size in bytes. - */ - size_t snd_ctl_card_info_sizeof() - { -@@ -2036,9 +2085,16 @@ size_t snd_ctl_card_info_sizeof() - } - - /** -- * \brief allocate an invalid #snd_ctl_card_info_t using standard malloc -- * \param ptr returned pointer -- * \return 0 on success otherwise negative error code -+ * \brief Allocate an invalid #snd_ctl_card_info_t on the heap. -+ * -+ * Allocate space for a card info object on the heap. The allocated memory -+ * must be freed using snd_ctl_card_info_free(). -+ * -+ * See snd_ctl_card_info_t for details. -+ * -+ * \param ptr Pointer to a snd_ctl_card_info_t pointer. The address -+ * of the allocated space will be returned here. -+ * \return 0 on success, otherwise a negative error code. - */ - int snd_ctl_card_info_malloc(snd_ctl_card_info_t **ptr) - { -@@ -2050,8 +2106,10 @@ int snd_ctl_card_info_malloc(snd_ctl_card_info_t **ptr) - } - - /** -- * \brief frees a previously allocated #snd_ctl_card_info_t -- * \param obj pointer to object to free -+ * \brief Free an #snd_ctl_card_info_t previously allocated using -+ * snd_ctl_card_info_malloc(). -+ * -+ * \param obj Pointer to the snd_ctl_card_info_t. - */ - void snd_ctl_card_info_free(snd_ctl_card_info_t *obj) - { -@@ -2059,8 +2117,11 @@ void snd_ctl_card_info_free(snd_ctl_card_info_t *obj) - } - - /** -- * \brief clear given #snd_ctl_card_info_t object -- * \param obj pointer to object to clear -+ * \brief Clear given card info object. -+ * -+ * See snd_ctl_elem_value_t for details. -+ * -+ * \param obj Card info object. - */ - void snd_ctl_card_info_clear(snd_ctl_card_info_t *obj) - { -@@ -2068,9 +2129,10 @@ void snd_ctl_card_info_clear(snd_ctl_card_info_t *obj) - } - - /** -- * \brief copy one #snd_ctl_card_info_t to another -- * \param dst pointer to destination -- * \param src pointer to source -+ * \brief Bitwise copy of a #snd_ctl_card_info_t object. -+ * -+ * \param dst Pointer to destination. -+ * \param src Pointer to source. - */ - void snd_ctl_card_info_copy(snd_ctl_card_info_t *dst, const snd_ctl_card_info_t *src) - { -@@ -2079,9 +2141,12 @@ void snd_ctl_card_info_copy(snd_ctl_card_info_t *dst, const snd_ctl_card_info_t - } - - /** -- * \brief Get card number from a CTL card info -- * \param obj CTL card info -- * \return card number -+ * \brief Get the sound card index from the given info object. -+ * -+ * See snd_ctl_card_info_t for more details. -+ * -+ * \param obj The card info object. -+ * \return Sound card index. - */ - int snd_ctl_card_info_get_card(const snd_ctl_card_info_t *obj) - { -@@ -2090,9 +2155,12 @@ int snd_ctl_card_info_get_card(const snd_ctl_card_info_t *obj) - } - - /** -- * \brief Get card identifier from a CTL card info -- * \param obj CTL card info -- * \return card identifier -+ * \brief Get the sound card ID from the given info object. -+ * -+ * See snd_ctl_card_info_t for more details. -+ * -+ * \param obj The card info object. -+ * \return Sound card ID. - */ - const char *snd_ctl_card_info_get_id(const snd_ctl_card_info_t *obj) - { -@@ -2101,9 +2169,12 @@ const char *snd_ctl_card_info_get_id(const snd_ctl_card_info_t *obj) - } - - /** -- * \brief Get card driver name from a CTL card info -- * \param obj CTL card info -- * \return card driver name -+ * \brief Get the sound card driver from the given info object. -+ * -+ * See snd_ctl_card_info_t for more details. -+ * -+ * \param obj The card info object. -+ * \return The sound card driver. - */ - const char *snd_ctl_card_info_get_driver(const snd_ctl_card_info_t *obj) - { -@@ -2112,9 +2183,12 @@ const char *snd_ctl_card_info_get_driver(const snd_ctl_card_info_t *obj) - } - - /** -- * \brief Get card name from a CTL card info -- * \param obj CTL card info -- * \return card name -+ * \brief Get the sound card name from the given info object. -+ * -+ * See snd_ctl_card_info_t for more details. -+ * -+ * \param obj The card info object. -+ * \return Sound card name. - */ - const char *snd_ctl_card_info_get_name(const snd_ctl_card_info_t *obj) - { -@@ -2123,9 +2197,12 @@ const char *snd_ctl_card_info_get_name(const snd_ctl_card_info_t *obj) - } - - /** -- * \brief Get card long name from a CTL card info -- * \param obj CTL card info -- * \return card long name -+ * \brief Get the sound cards long name from the given info object. -+ * -+ * See snd_ctl_card_info_t for more details. -+ * -+ * \param obj The card info object. -+ * \return Sound cards long name. - */ - const char *snd_ctl_card_info_get_longname(const snd_ctl_card_info_t *obj) - { -@@ -2134,9 +2211,12 @@ const char *snd_ctl_card_info_get_longname(const snd_ctl_card_info_t *obj) - } - - /** -- * \brief Get card mixer name from a CTL card info -- * \param obj CTL card info -- * \return card mixer name -+ * \brief Get the sound card mixer name from the given info object. -+ * -+ * See snd_ctl_card_info_t for more details. -+ * -+ * \param obj The card info object. -+ * \return Sound card mixer name. - */ - const char *snd_ctl_card_info_get_mixername(const snd_ctl_card_info_t *obj) - { -@@ -2145,9 +2225,12 @@ const char *snd_ctl_card_info_get_mixername(const snd_ctl_card_info_t *obj) - } - - /** -- * \brief Get card component list from a CTL card info -- * \param obj CTL card info -- * \return card mixer identifier -+ * \brief Get the sound cards "components" property from the given info object. -+ * -+ * See snd_ctl_card_info_t for more details. -+ * -+ * \param obj The card info object. -+ * \return Sound cards "components" property. - */ - const char *snd_ctl_card_info_get_components(const snd_ctl_card_info_t *obj) - { --- -2.31.1 - - -From 7ba3f888d07cafbad04391b915db23408c663dad Mon Sep 17 00:00:00 2001 -From: "Tanjeff-N. Moos" -Date: Thu, 17 Jun 2021 10:36:39 +0200 -Subject: [PATCH 10/20] control: Minor documentation fixes. - -Signed-off-by: Tanjeff-N. Moos -Signed-off-by: Takashi Iwai ---- - include/control.h | 9 +++++++-- - src/control/cards.c | 5 ++++- - src/control/control.c | 2 +- - 3 files changed, 12 insertions(+), 4 deletions(-) - -diff --git a/include/control.h b/include/control.h -index 9ebb4905..e386ecec 100644 ---- a/include/control.h -+++ b/include/control.h -@@ -155,7 +155,7 @@ typedef struct _snd_ctl_elem_list snd_ctl_elem_list_t; - /** CTL element info container */ - typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t; - --/** CTL element value container -+/** CTL element value container. - * - * Contains the value(s) (i.e. members) of a single element. All - * values of a given element are of the same type. -@@ -167,6 +167,11 @@ typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t; - * using the latter, it must be freed again using - * snd_ctl_elem_value_free(). - * -+ * A value object can be zeroed out using snd_ctl_elem_value_clear(). -+ * -+ * A value object can be copied to another one using -+ * snd_ctl_elem_value_copy(). -+ * - * \par Identifier - * - * Then, the ID must be filled. It is sufficient to fill only the -@@ -621,7 +626,7 @@ size_t snd_ctl_elem_value_sizeof(void); - * \brief Allocate an invalid #snd_ctl_elem_value_t on the stack. - * - * Allocate space for a value object on the stack. The allocated -- * memory need not be freed, because is on the stack. -+ * memory need not be freed, because it is on the stack. - * - * See snd_ctl_elem_value_t for details. - * -diff --git a/src/control/cards.c b/src/control/cards.c -index 8226c42d..6145ebcd 100644 ---- a/src/control/cards.c -+++ b/src/control/cards.c -@@ -147,6 +147,7 @@ int snd_card_get_index(const char *string) - return -EINVAL; - if ((isdigit(*string) && *(string + 1) == 0) || - (isdigit(*string) && isdigit(*(string + 1)) && *(string + 2) == 0)) { -+ /* We got an index */ - if (sscanf(string, "%i", &card) != 1) - return -EINVAL; - if (card < 0 || card >= SND_MAX_CARDS) -@@ -156,8 +157,10 @@ int snd_card_get_index(const char *string) - return card; - return err; - } -- if (string[0] == '/') /* device name */ -+ if (string[0] == '/') -+ /* We got a device name */ - return snd_card_load2(string); -+ /* We got in ID */ - for (card = 0; card < SND_MAX_CARDS; card++) { - #ifdef SUPPORT_ALOAD - if (! snd_card_load(card)) -diff --git a/src/control/control.c b/src/control/control.c -index 7cf4decb..91415b51 100644 ---- a/src/control/control.c -+++ b/src/control/control.c -@@ -3127,7 +3127,7 @@ size_t snd_ctl_elem_value_sizeof() - /** - * \brief Allocate an invalid #snd_ctl_elem_value_t on the heap. - * -- * Allocate space for a value object on the head. The allocated memory -+ * Allocate space for a value object on the heap. The allocated memory - * must be freed using snd_ctl_elem_value_free(). - * - * See snd_ctl_elem_value_t for details. --- -2.31.1 - - -From f4f29d42be8b8ad60ea4c5697374adad4bfe6868 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 28 Jun 2021 12:08:53 +0200 -Subject: [PATCH 11/20] fix build with --disable-ucm - -Link: https://mailman.alsa-project.org/pipermail/alsa-devel/2021-June/186729.html -Reported-by: Michael Forney -Signed-off-by: Jaroslav Kysela ---- - include/local.h | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/include/local.h b/include/local.h -index 4e7d88a0..7cfcec53 100644 ---- a/include/local.h -+++ b/include/local.h -@@ -374,6 +374,8 @@ int _snd_config_load_with_include(snd_config_t *config, snd_input_t *in, - void *INTERNAL(snd_dlopen)(const char *name, int mode, char *errbuf, size_t errbuflen); - #endif - -+#ifdef BUILD_UCM -+ - const char *uc_mgr_alibcfg_by_device(snd_config_t **config, const char *name); - - static inline int _snd_is_ucm_device(const char *name) -@@ -381,4 +383,12 @@ static inline int _snd_is_ucm_device(const char *name) - return name && name[0] == '_' && name[1] == 'u' && name[2] == 'c' && name[3] == 'm'; - } - -+#else -+ -+static inline const char *uc_mgr_alibcfg_by_device(snd_config_t **config, const char *name) { return NULL; } -+static inline int _snd_is_ucm_device(const char *name) { return 0; } -+ -+ -+#endif -+ - #endif --- -2.31.1 - - -From 1a1f0fb244c477c430e156da878475ef57d198f9 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 28 Jun 2021 12:11:54 +0200 -Subject: [PATCH 12/20] pcm: rate - fix some gcc warnings - -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_rate.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c -index 13111d29..c45895a9 100644 ---- a/src/pcm/pcm_rate.c -+++ b/src/pcm/pcm_rate.c -@@ -82,12 +82,12 @@ struct _snd_pcm_rate { - - /* allocate a channel area and a temporary buffer for the given size */ - static snd_pcm_channel_area_t * --rate_alloc_tmp_buf(snd_pcm_rate_t *rate, snd_pcm_format_t format, -+rate_alloc_tmp_buf(snd_pcm_format_t format, - unsigned int channels, unsigned int frames) - { - snd_pcm_channel_area_t *ap; - int width = snd_pcm_format_physical_width(format); -- int i; -+ unsigned int i; - - ap = malloc(sizeof(*ap) * channels); - if (!ap) -@@ -354,7 +354,7 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - snd_pcm_rate_t *rate = pcm->private_data; - snd_pcm_t *slave = rate->gen.slave; - snd_pcm_rate_side_info_t *sinfo, *cinfo; -- unsigned int channels, cwidth, swidth, chn, acc; -+ unsigned int channels, acc; - int need_src_buf, need_dst_buf; - int err = snd_pcm_hw_params_slave(pcm, params, - snd_pcm_rate_hw_refine_cchange, -@@ -401,9 +401,9 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - return -EBUSY; - } - -- rate->pareas = rate_alloc_tmp_buf(rate, cinfo->format, channels, -+ rate->pareas = rate_alloc_tmp_buf(cinfo->format, channels, - cinfo->period_size); -- rate->sareas = rate_alloc_tmp_buf(rate, sinfo->format, channels, -+ rate->sareas = rate_alloc_tmp_buf(sinfo->format, channels, - sinfo->period_size); - if (!rate->pareas || !rate->sareas) { - err = -ENOMEM; -@@ -442,7 +442,7 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - rate->src_conv_idx = - snd_pcm_linear_convert_index(rate->orig_in_format, - rate->info.in.format); -- rate->src_buf = rate_alloc_tmp_buf(rate, rate->info.in.format, -+ rate->src_buf = rate_alloc_tmp_buf(rate->info.in.format, - channels, rate->info.in.period_size); - if (!rate->src_buf) { - err = -ENOMEM; -@@ -454,7 +454,7 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) - rate->dst_conv_idx = - snd_pcm_linear_convert_index(rate->info.out.format, - rate->orig_out_format); -- rate->dst_buf = rate_alloc_tmp_buf(rate, rate->info.out.format, -+ rate->dst_buf = rate_alloc_tmp_buf(rate->info.out.format, - channels, rate->info.out.period_size); - if (!rate->dst_buf) { - err = -ENOMEM; --- -2.31.1 - - -From e47c11822d6b459a9b3704b3ee6a4a5c9a1b85be Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 29 Jun 2021 18:02:27 +0200 -Subject: [PATCH 13/20] control: remap - assign right name to the child handle - for no-op - -Fixes: https://github.com/alsa-project/alsa-utils/issues/100 -Signed-off-by: Jaroslav Kysela ---- - src/control/control_remap.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/control/control_remap.c b/src/control/control_remap.c -index a85c1725..81524014 100644 ---- a/src/control/control_remap.c -+++ b/src/control/control_remap.c -@@ -1173,6 +1173,10 @@ int snd_ctl_remap_open(snd_ctl_t **handlep, const char *name, snd_config_t *rema - /* no-op check, remove the plugin */ - if (priv->map_items == 0 && priv->remap_items == 0) { - remap_free(priv); -+ free(child->name); -+ child->name = name ? strdup(name) : NULL; -+ if (name && !child->name) -+ return -ENOMEM; - *handlep = child; - return 0; - } --- -2.31.1 - - -From 23a191a82c693456e61431ab699cddc1e5782a26 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 29 Jun 2021 19:31:28 +0200 -Subject: [PATCH 14/20] control: remap - assign right name to the child handle - for no-op (2nd case) - -Fixes: https://github.com/alsa-project/alsa-utils/issues/100 -Signed-off-by: Jaroslav Kysela ---- - src/control/control_remap.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/control/control_remap.c b/src/control/control_remap.c -index 81524014..4914f960 100644 ---- a/src/control/control_remap.c -+++ b/src/control/control_remap.c -@@ -1154,6 +1154,10 @@ int snd_ctl_remap_open(snd_ctl_t **handlep, const char *name, snd_config_t *rema - snd_ctl_t *ctl; - int result, err; - -+ /* no-op, remove the plugin */ -+ if (!remap && !map) -+ goto _noop; -+ - priv = calloc(1, sizeof(*priv)); - if (priv == NULL) - return -ENOMEM; -@@ -1173,6 +1177,7 @@ int snd_ctl_remap_open(snd_ctl_t **handlep, const char *name, snd_config_t *rema - /* no-op check, remove the plugin */ - if (priv->map_items == 0 && priv->remap_items == 0) { - remap_free(priv); -+ _noop: - free(child->name); - child->name = name ? strdup(name) : NULL; - if (name && !child->name) -@@ -1316,11 +1321,6 @@ int _snd_ctl_remap_open(snd_ctl_t **handlep, char *name, snd_config_t *root, snd - err = _snd_ctl_open_child(&cctl, root, child, mode, conf); - if (err < 0) - return err; -- /* no-op, remove the plugin */ -- if (!remap && !map) { -- *handlep = cctl; -- return 0; -- } - err = snd_ctl_remap_open(handlep, name, remap, map, cctl, mode); - if (err < 0) - snd_ctl_close(cctl); --- -2.31.1 - - -From 7d40a76ef5494e08af00fa4e7bfefbd43aba4827 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 31 Aug 2021 09:25:12 +0200 -Subject: [PATCH 19/20] ucm: avoid zero card instance number - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/utils.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/ucm/utils.c b/src/ucm/utils.c -index f3a8c9ba..10b21c34 100644 ---- a/src/ucm/utils.c -+++ b/src/ucm/utils.c -@@ -780,6 +780,9 @@ int uc_mgr_card_open(snd_use_case_mgr_t *uc_mgr) - while (uc_mgr_card_find(ucm_card_assign)) { - ucm_card_assign++; - ucm_card_assign &= 0xffff; -+ /* avoid zero card instance number */ -+ if (ucm_card_assign == 0) -+ ucm_card_assign++; - if (ucm_card_assign == prev) { - pthread_mutex_unlock(&ucm_cards_mutex); - return -ENOMEM; --- -2.31.1 - - -From 4a52ae4c329ae17117375a4b85b80f37994a4044 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 31 Aug 2021 09:40:42 +0200 -Subject: [PATCH 20/20] ucm: fix the parsing of the hexadecimal prefix - -The safe_strtol() function use strtol() which expects -to have the '0x' prefix for the hexadecimal number (when -base argument is zero). - -BugLink: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1553 -Signed-off-by: Jaroslav Kysela ---- - src/ucm/utils.c | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/src/ucm/utils.c b/src/ucm/utils.c -index 10b21c34..2fbc4c8c 100644 ---- a/src/ucm/utils.c -+++ b/src/ucm/utils.c -@@ -811,7 +811,7 @@ void uc_mgr_card_close(snd_use_case_mgr_t *uc_mgr) - */ - const char *uc_mgr_alibcfg_by_device(snd_config_t **top, const char *name) - { -- char buf[5]; -+ char buf[7]; - long card_num; - snd_config_t *config; - snd_use_case_mgr_t *uc_mgr; -@@ -819,8 +819,10 @@ const char *uc_mgr_alibcfg_by_device(snd_config_t **top, const char *name) - - if (strncmp(name, "_ucm", 4) || strlen(name) < 12 || name[8] != '.') - return NULL; -- strncpy(buf, name + 4, 4); -- buf[4] = '\0'; -+ buf[0] = '0'; -+ buf[1] = 'x'; -+ strncpy(buf + 2, name + 4, 4); -+ buf[6] = '\0'; - err = safe_strtol(buf, &card_num); - if (err < 0 || card_num < 0 || card_num > 0xffff) - return NULL; --- -2.31.1 - diff --git a/alsa-lib.spec b/alsa-lib.spec index 8ff5b53..50c4eff 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,14 +2,14 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.5.1 -%define version_alsa_ucm 1.2.5.1 +%define version_alsa_lib 1.2.6 +%define version_alsa_ucm 1.2.6 %define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 2%{?prever_dot}%{?dist} +Release: 1%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Mon Dec 6 2021 Jaroslav Kysela - 1.2.6-1 +- update to 1.2.6 + * Tue Aug 31 2021 Jaroslav Kysela - 1.2.5.1-2 - add UCM related fixes diff --git a/sources b/sources index ddf88ed..07eab63 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.5.1.tar.bz2) = 01998ffa449e925ff552c13aea47f9540903afdc533086067c78dcaba4d239c347180d3d28bb0000e6d19b7779c7249fcc77a30057930ca22d18ba55e163fa1c +SHA512 (alsa-lib-1.2.6.tar.bz2) = ae95718813abf62811fe44c6df2a8de5a1227da4b022c4dd97dd8e7c1001f48307ba36bf04208bdbe24e8a8eebf4ed5a59f40ee6750dcbe976678071c3f2f5b7 +SHA512 (alsa-ucm-conf-1.2.6.tar.bz2) = 5fe85643b60c8defeafcdfcf97e61b5d05e6db28cef2466a70f63b8fffba22bdd50b83a5ca88806a6350de6e9d802dd3c2240b293190b9d05daea515c03d4397 SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 -SHA512 (alsa-ucm-conf-1.2.5.1.tar.bz2) = 774d6da1a0ee6fb1fcd764c1d4b3eb5812a35508cf27db71f6c82784f125eca207992da9081d25783fecb31e548d8b34124d4b3b3d506e33215b76ea48f71012 From e0c620c59083c594c919e08209af26f096bcf718 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 9 Dec 2021 10:26:39 +0100 Subject: [PATCH 16/68] device open fixes from upstream --- alsa-git.patch | 97 +++++++++++++++++++++++++++++++++++++++++++++ alsa-lib.spec | 5 ++- alsa-ucm-conf.patch | 28 +++++++++++++ 3 files changed, 129 insertions(+), 1 deletion(-) diff --git a/alsa-git.patch b/alsa-git.patch index e69de29..4082c0c 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -0,0 +1,97 @@ +From f44c94f24c2422c5ee1c4c58253ec17412b248a9 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 7 Dec 2021 09:21:24 +0100 +Subject: [PATCH 1/2] conf: accept '_' character in the variable name + +Fixes: https://github.com/alsa-project/alsa-lib/issues/197 +Signed-off-by: Jaroslav Kysela +--- + src/confeval.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/confeval.c b/src/confeval.c +index a971bf38..be9ac874 100644 +--- a/src/confeval.c ++++ b/src/confeval.c +@@ -190,7 +190,7 @@ int _snd_eval_string(snd_config_t **dst, const char *s, + } else { + e = s + 1; + while (*e) { +- if (!isalnum(*e)) ++ if (!isalnum(*e) && *e != '_') + break; + e++; + } +-- +2.31.1 + + +From 4b22871ee5a3bbc8eef7039bfc8db5e65ff3895f Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Thu, 9 Dec 2021 10:15:29 +0100 +Subject: [PATCH 2/2] conf: fix the device parsing when arguments has no + defaults + +The commit bf528b90 sets the value to an empty string which causes +these errors: + + pcm_hw.c: Invalid type for device + pcm_hw.c: Invalid type for subdevice + +When device arguments (@args) have no default values set, +the field must be skipped to keep the compatibility. + +BugLink: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1246 +Fixes: https://github.com/alsa-project/alsa-lib/issues/199 +Fixes: bf528b90 ("conf: add possibility to evaluate simple integer math expressions") +Signed-off-by: Jaroslav Kysela +--- + src/conf.c | 8 ++++++-- + src/confeval.c | 5 +++++ + 2 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/src/conf.c b/src/conf.c +index 0f6d2ba8..d3597cbc 100644 +--- a/src/conf.c ++++ b/src/conf.c +@@ -4994,8 +4994,10 @@ int snd_config_copy(snd_config_t **dst, + static int _snd_config_expand_vars(snd_config_t **dst, const char *s, void *private_data) + { + snd_config_t *val, *vars = private_data; +- if (snd_config_search(vars, s, &val) < 0) +- return snd_config_make_string(dst, ""); ++ if (snd_config_search(vars, s, &val) < 0) { ++ *dst = NULL; ++ return 0; ++ } + return snd_config_copy(dst, val); + } + +@@ -5060,6 +5062,8 @@ static int _snd_config_expand(snd_config_t *src, + err = snd_config_evaluate_string(dst, s, fcn, vars); + if (err < 0) + return err; ++ if (*dst == NULL) ++ return 0; + err = snd_config_set_id(*dst, id); + if (err < 0) { + snd_config_delete(*dst); +diff --git a/src/confeval.c b/src/confeval.c +index be9ac874..4a6f8c2e 100644 +--- a/src/confeval.c ++++ b/src/confeval.c +@@ -203,6 +203,11 @@ int _snd_eval_string(snd_config_t **dst, const char *s, + free(m); + if (err < 0) + return err; ++ if (tmp == NULL) { ++ err = snd_config_imake_integer(&tmp, NULL, 0); ++ if (err < 0) ++ return err; ++ } + s = e; + } + err = _to_integer(op == LEFT ? &left : &right, tmp); +-- +2.31.1 + diff --git a/alsa-lib.spec b/alsa-lib.spec index e5448f5..28c4a33 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Thu Dec 9 2021 Jaroslav Kysela - 1.2.6-2 +- device open fixes from upstream + * Mon Dec 6 2021 Jaroslav Kysela - 1.2.6-1 - update to 1.2.6 diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index e69de29..b04faba 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -0,0 +1,28 @@ +From 244fc744e90c85f2816c5baba9fee08a85fec58e Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Thu, 9 Dec 2021 09:00:12 +0100 +Subject: [PATCH] USB-Audio: fix the wrong condition type for + If.realtek-alc1220-vb + +BugLink: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1246 +Signed-off-by: Jaroslav Kysela +--- + ucm2/USB-Audio/USB-Audio.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf +index 878d16d..d9d740e 100644 +--- a/ucm2/USB-Audio/USB-Audio.conf ++++ b/ucm2/USB-Audio/USB-Audio.conf +@@ -15,7 +15,7 @@ If.linked { + If.realtek-alc1220-vb { + + Condition { +- Type Regex ++ Type RegexMatch + String "${CardComponents}" + # 0414:a002 Gigabyte TRX40 Aorus Pro WiFi + # 0b05:1917 ASUS ROG Strix +-- +2.31.1 + From 6792944e7f82d082d031f08af67e96c748d6bf2c Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 9 Dec 2021 10:26:39 +0100 Subject: [PATCH 17/68] device open fixes from upstream --- alsa-git.patch | 97 +++++++++++++++++++++++++++++++++++++++++++++ alsa-lib.spec | 5 ++- alsa-ucm-conf.patch | 28 +++++++++++++ 3 files changed, 129 insertions(+), 1 deletion(-) diff --git a/alsa-git.patch b/alsa-git.patch index e69de29..4082c0c 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -0,0 +1,97 @@ +From f44c94f24c2422c5ee1c4c58253ec17412b248a9 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 7 Dec 2021 09:21:24 +0100 +Subject: [PATCH 1/2] conf: accept '_' character in the variable name + +Fixes: https://github.com/alsa-project/alsa-lib/issues/197 +Signed-off-by: Jaroslav Kysela +--- + src/confeval.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/confeval.c b/src/confeval.c +index a971bf38..be9ac874 100644 +--- a/src/confeval.c ++++ b/src/confeval.c +@@ -190,7 +190,7 @@ int _snd_eval_string(snd_config_t **dst, const char *s, + } else { + e = s + 1; + while (*e) { +- if (!isalnum(*e)) ++ if (!isalnum(*e) && *e != '_') + break; + e++; + } +-- +2.31.1 + + +From 4b22871ee5a3bbc8eef7039bfc8db5e65ff3895f Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Thu, 9 Dec 2021 10:15:29 +0100 +Subject: [PATCH 2/2] conf: fix the device parsing when arguments has no + defaults + +The commit bf528b90 sets the value to an empty string which causes +these errors: + + pcm_hw.c: Invalid type for device + pcm_hw.c: Invalid type for subdevice + +When device arguments (@args) have no default values set, +the field must be skipped to keep the compatibility. + +BugLink: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1246 +Fixes: https://github.com/alsa-project/alsa-lib/issues/199 +Fixes: bf528b90 ("conf: add possibility to evaluate simple integer math expressions") +Signed-off-by: Jaroslav Kysela +--- + src/conf.c | 8 ++++++-- + src/confeval.c | 5 +++++ + 2 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/src/conf.c b/src/conf.c +index 0f6d2ba8..d3597cbc 100644 +--- a/src/conf.c ++++ b/src/conf.c +@@ -4994,8 +4994,10 @@ int snd_config_copy(snd_config_t **dst, + static int _snd_config_expand_vars(snd_config_t **dst, const char *s, void *private_data) + { + snd_config_t *val, *vars = private_data; +- if (snd_config_search(vars, s, &val) < 0) +- return snd_config_make_string(dst, ""); ++ if (snd_config_search(vars, s, &val) < 0) { ++ *dst = NULL; ++ return 0; ++ } + return snd_config_copy(dst, val); + } + +@@ -5060,6 +5062,8 @@ static int _snd_config_expand(snd_config_t *src, + err = snd_config_evaluate_string(dst, s, fcn, vars); + if (err < 0) + return err; ++ if (*dst == NULL) ++ return 0; + err = snd_config_set_id(*dst, id); + if (err < 0) { + snd_config_delete(*dst); +diff --git a/src/confeval.c b/src/confeval.c +index be9ac874..4a6f8c2e 100644 +--- a/src/confeval.c ++++ b/src/confeval.c +@@ -203,6 +203,11 @@ int _snd_eval_string(snd_config_t **dst, const char *s, + free(m); + if (err < 0) + return err; ++ if (tmp == NULL) { ++ err = snd_config_imake_integer(&tmp, NULL, 0); ++ if (err < 0) ++ return err; ++ } + s = e; + } + err = _to_integer(op == LEFT ? &left : &right, tmp); +-- +2.31.1 + diff --git a/alsa-lib.spec b/alsa-lib.spec index 50c4eff..41bce0c 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Thu Dec 9 2021 Jaroslav Kysela - 1.2.6-2 +- device open fixes from upstream + * Mon Dec 6 2021 Jaroslav Kysela - 1.2.6-1 - update to 1.2.6 diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index e69de29..b04faba 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -0,0 +1,28 @@ +From 244fc744e90c85f2816c5baba9fee08a85fec58e Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Thu, 9 Dec 2021 09:00:12 +0100 +Subject: [PATCH] USB-Audio: fix the wrong condition type for + If.realtek-alc1220-vb + +BugLink: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1246 +Signed-off-by: Jaroslav Kysela +--- + ucm2/USB-Audio/USB-Audio.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf +index 878d16d..d9d740e 100644 +--- a/ucm2/USB-Audio/USB-Audio.conf ++++ b/ucm2/USB-Audio/USB-Audio.conf +@@ -15,7 +15,7 @@ If.linked { + If.realtek-alc1220-vb { + + Condition { +- Type Regex ++ Type RegexMatch + String "${CardComponents}" + # 0414:a002 Gigabyte TRX40 Aorus Pro WiFi + # 0b05:1917 ASUS ROG Strix +-- +2.31.1 + From e25e8171473f844cf64788b27af0df6558fa90ba Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 9 Dec 2021 12:24:17 +0100 Subject: [PATCH 18/68] AMD acp UCM fix --- alsa-lib.spec | 4 +- alsa-ucm-conf.patch | 228 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 229 insertions(+), 3 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 28c4a33..450ce1d 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -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: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,7 +167,7 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog -* Thu Dec 9 2021 Jaroslav Kysela - 1.2.6-2 +* Thu Dec 9 2021 Jaroslav Kysela - 1.2.6-3 - device open fixes from upstream * Mon Dec 6 2021 Jaroslav Kysela - 1.2.6-1 diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index b04faba..f7e2ff1 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -1,7 +1,7 @@ From 244fc744e90c85f2816c5baba9fee08a85fec58e Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 9 Dec 2021 09:00:12 +0100 -Subject: [PATCH] USB-Audio: fix the wrong condition type for +Subject: [PATCH 1/3] USB-Audio: fix the wrong condition type for If.realtek-alc1220-vb BugLink: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1246 @@ -26,3 +26,229 @@ index 878d16d..d9d740e 100644 -- 2.31.1 + +From cefbdeb9f763ab4cbba1c338716d40acb6a4e43a Mon Sep 17 00:00:00 2001 +From: AngeloGioacchino Del Regno +Date: Wed, 10 Nov 2021 14:12:39 +0100 +Subject: [PATCH 2/3] ucm2: Add support for SC7180 Trogdor Lazor Chromebooks + +Almost all Trogdor Chromebooks are using RT5682 for headphones/headset +on 3.5mm jack, internal microphone and headset microphone, and MAX98357A +for the internal speakers (Lazor and Limozeen). + +This adds support for the sc7180-rt5682-max98357a-1mic sound card found +on the aforementioned Chromebooks. + +Signed-off-by: AngeloGioacchino Del Regno +Signed-off-by: Jaroslav Kysela +--- + .../sc7180/rt5682-max98357a/HiFi.conf | 101 ++++++++++++++++++ + .../sc7180/rt5682-max98357a/init.conf | 24 +++++ + .../sc7180-rt5682-max98357a-1mic.conf | 11 ++ + .../SC7180/sc7180-rt5682-max98357a-1mic.conf | 1 + + 4 files changed, 137 insertions(+) + create mode 100644 ucm2/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf + create mode 100644 ucm2/Qualcomm/sc7180/rt5682-max98357a/init.conf + create mode 100644 ucm2/Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf + create mode 120000 ucm2/conf.d/SC7180/sc7180-rt5682-max98357a-1mic.conf + +diff --git a/ucm2/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf b/ucm2/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf +new file mode 100644 +index 0000000..c93b4f7 +--- /dev/null ++++ b/ucm2/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf +@@ -0,0 +1,101 @@ ++# Use case configuration for ALC5682+MAX98357A on SC7180 ++ ++SectionVerb { ++ Value { ++ TQ "HiFi" ++ } ++} ++ ++SectionDevice."Speaker" { ++ Comment "Speaker" ++ ++ Value { ++ PlaybackChannels 2 ++ PlaybackPCM "hw:${CardId},1" ++ PlaybackPriority 100 ++ PlaybackMixerElem "Speaker" ++ PlaybackVolume "Speaker Playback Volume" ++ } ++} ++ ++SectionDevice."Headphones" { ++ Comment "Headphones" ++ ++ EnableSequence [ ++ cset "name='HPOL Playback Switch' 1" ++ cset "name='HPOR Playback Switch' 1" ++ cset "name='Stereo1 DAC MIXL DAC L1 Switch' 1" ++ cset "name='Stereo1 DAC MIXR DAC R1 Switch' 1" ++ ] ++ ++ DisableSequence [ ++ cset "name='HPOL Playback Switch' 0" ++ cset "name='HPOR Playback Switch' 0" ++ cset "name='Stereo1 DAC MIXL DAC L1 Switch' 0" ++ cset "name='Stereo1 DAC MIXR DAC R1 Switch' 0" ++ ] ++ ++ Value { ++ PlaybackPCM "hw:${CardId},0" ++ PlaybackPriority 200 ++ PlaybackMasterElem "DAC1" ++ PlaybackMixerElem "Headphone" ++ PlaybackVolume "Headphone Playback Volume" ++ } ++} ++ ++SectionDevice."Mic" { ++ Comment "Internal Microphone" ++ ++ ConflictingDevice [ ++ "Headset" ++ ] ++ ++ EnableSequence [ ++ cset "name='IF1 01 ADC Swap Mux' 1" ++ cset "name='Stereo1 ADC L2 Mux' 1" ++ cset "name='Stereo1 ADC R2 Mux' 1" ++ cset "name='Stereo1 ADC MIXL ADC2 Switch' 1" ++ cset "name='Stereo1 ADC MIXR ADC2 Switch' 1" ++ ] ++ ++ DisableSequence [ ++ cset "name='Stereo1 ADC L2 Mux' 0" ++ cset "name='Stereo1 ADC R2 Mux' 0" ++ cset "name='Stereo1 ADC MIXL ADC2 Switch' 0" ++ cset "name='Stereo1 ADC MIXR ADC2 Switch' 0" ++ ] ++ ++ Value { ++ CapturePCM "hw:${CardId},0" ++ CapturePriority 100 ++ CaptureMixerElem "STO1 ADC" ++ CaptureVolume "STO1 ADC Capture Volume" ++ } ++} ++ ++SectionDevice."Headset" { ++ Comment "Headset Microphone" ++ ++ EnableSequence [ ++ cset "name='IF1 01 ADC Swap Mux' 2" ++ cset "name='Stereo1 ADC L1 Mux' 1" ++ cset "name='Stereo1 ADC R1 Mux' 1" ++ cset "name='Stereo1 ADC MIXL ADC1 Switch' 1" ++ cset "name='Stereo1 ADC MIXR ADC1 Switch' 1" ++ ] ++ ++ DisableSequence [ ++ cset "name='Stereo1 ADC L1 Mux' 0" ++ cset "name='Stereo1 ADC R1 Mux' 0" ++ cset "name='Stereo1 ADC MIXL ADC1 Switch' 0" ++ cset "name='Stereo1 ADC MIXR ADC1 Switch' 0" ++ ] ++ ++ Value { ++ CapturePCM "hw:${CardId},0" ++ CapturePriority 200 ++ CaptureMixerElem "STO1 ADC" ++ CaptureVolume "STO1 ADC Capture Volume" ++ } ++} +diff --git a/ucm2/Qualcomm/sc7180/rt5682-max98357a/init.conf b/ucm2/Qualcomm/sc7180/rt5682-max98357a/init.conf +new file mode 100644 +index 0000000..5dee38a +--- /dev/null ++++ b/ucm2/Qualcomm/sc7180/rt5682-max98357a/init.conf +@@ -0,0 +1,24 @@ ++BootSequence [ ++ # Headphone ++ cset "name='HPOL Playback Switch' 0" ++ cset "name='HPOR Playback Switch' 0" ++ cset "name='Stereo1 DAC MIXL DAC L1 Switch' 0" ++ cset "name='Stereo1 DAC MIXR DAC R1 Switch' 0" ++ ++ # Headset mic ++ cset "name='Stereo1 ADC L Mux' 0" ++ cset "name='STO1 ADC Capture Switch' on" ++ cset "name='RECMIX1L CBJ Switch' 1" ++ cset "name='CBJ Boost Volume' 3" ++ cset "name='Stereo1 ADC L1 Mux' 0" ++ cset "name='Stereo1 ADC R1 Mux' 0" ++ cset "name='Stereo1 ADC MIXL ADC1 Switch' 0" ++ cset "name='Stereo1 ADC MIXR ADC1 Switch' 0" ++ ++ # Internal mic on ALC5682 ++ cset "name='IF1 01 ADC Swap Mux' 1" ++ cset "name='Stereo1 ADC L2 Mux' 0" ++ cset "name='Stereo1 ADC R2 Mux' 0" ++ cset "name='Stereo1 ADC MIXL ADC2 Switch' 0" ++ cset "name='Stereo1 ADC MIXR ADC2 Switch' 0" ++] +diff --git a/ucm2/Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf b/ucm2/Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf +new file mode 100644 +index 0000000..6a2be7e +--- /dev/null ++++ b/ucm2/Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf +@@ -0,0 +1,11 @@ ++Comment "SC7180 RT5682 MAX98357A single microphone sound card" ++Syntax 4 ++ ++SectionUseCase."HiFi" { ++ File "/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf" ++ Comment "Default" ++} ++ ++Include.card-init.File "/lib/card-init.conf" ++Include.ctl-remap.File "/lib/ctl-remap.conf" ++Include.init.File "/Qualcomm/sc7180/rt5682-max98357a/init.conf" +diff --git a/ucm2/conf.d/SC7180/sc7180-rt5682-max98357a-1mic.conf b/ucm2/conf.d/SC7180/sc7180-rt5682-max98357a-1mic.conf +new file mode 120000 +index 0000000..00f3e9e +--- /dev/null ++++ b/ucm2/conf.d/SC7180/sc7180-rt5682-max98357a-1mic.conf +@@ -0,0 +1 @@ ++../../Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf +\ No newline at end of file +-- +2.31.1 + + +From 60ea26507390bad3742af2272ba08b21f009d0ef Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Thu, 9 Dec 2021 11:24:14 +0100 +Subject: [PATCH 3/3] acp: fix linked configuration + +Fixes: https://github.com/alsa-project/alsa-lib/issues/199 +Signed-off-by: Jaroslav Kysela +--- + ucm2/common/linked-card.conf | 3 +++ + ucm2/conf.d/acp/acp.conf | 2 +- + 2 files changed, 4 insertions(+), 1 deletion(-) + create mode 100644 ucm2/common/linked-card.conf + +diff --git a/ucm2/common/linked-card.conf b/ucm2/common/linked-card.conf +new file mode 100644 +index 0000000..a90f20e +--- /dev/null ++++ b/ucm2/common/linked-card.conf +@@ -0,0 +1,3 @@ ++Syntax 3 ++ ++Include.linked.File "/common/linked.conf" +diff --git a/ucm2/conf.d/acp/acp.conf b/ucm2/conf.d/acp/acp.conf +index 5f056c7..7298c24 120000 +--- a/ucm2/conf.d/acp/acp.conf ++++ b/ucm2/conf.d/acp/acp.conf +@@ -1 +1 @@ +-../../common/linked.conf +\ No newline at end of file ++../../common/linked-card.conf +\ No newline at end of file +-- +2.31.1 + From c24c1753bcb7d09e5b6c7b892706a5de3954429a Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 9 Dec 2021 12:24:17 +0100 Subject: [PATCH 19/68] AMD acp UCM fix --- alsa-lib.spec | 4 +- alsa-ucm-conf.patch | 228 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 229 insertions(+), 3 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 41bce0c..cef2f8f 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -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: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,7 +167,7 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog -* Thu Dec 9 2021 Jaroslav Kysela - 1.2.6-2 +* Thu Dec 9 2021 Jaroslav Kysela - 1.2.6-3 - device open fixes from upstream * Mon Dec 6 2021 Jaroslav Kysela - 1.2.6-1 diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index b04faba..f7e2ff1 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -1,7 +1,7 @@ From 244fc744e90c85f2816c5baba9fee08a85fec58e Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 9 Dec 2021 09:00:12 +0100 -Subject: [PATCH] USB-Audio: fix the wrong condition type for +Subject: [PATCH 1/3] USB-Audio: fix the wrong condition type for If.realtek-alc1220-vb BugLink: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1246 @@ -26,3 +26,229 @@ index 878d16d..d9d740e 100644 -- 2.31.1 + +From cefbdeb9f763ab4cbba1c338716d40acb6a4e43a Mon Sep 17 00:00:00 2001 +From: AngeloGioacchino Del Regno +Date: Wed, 10 Nov 2021 14:12:39 +0100 +Subject: [PATCH 2/3] ucm2: Add support for SC7180 Trogdor Lazor Chromebooks + +Almost all Trogdor Chromebooks are using RT5682 for headphones/headset +on 3.5mm jack, internal microphone and headset microphone, and MAX98357A +for the internal speakers (Lazor and Limozeen). + +This adds support for the sc7180-rt5682-max98357a-1mic sound card found +on the aforementioned Chromebooks. + +Signed-off-by: AngeloGioacchino Del Regno +Signed-off-by: Jaroslav Kysela +--- + .../sc7180/rt5682-max98357a/HiFi.conf | 101 ++++++++++++++++++ + .../sc7180/rt5682-max98357a/init.conf | 24 +++++ + .../sc7180-rt5682-max98357a-1mic.conf | 11 ++ + .../SC7180/sc7180-rt5682-max98357a-1mic.conf | 1 + + 4 files changed, 137 insertions(+) + create mode 100644 ucm2/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf + create mode 100644 ucm2/Qualcomm/sc7180/rt5682-max98357a/init.conf + create mode 100644 ucm2/Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf + create mode 120000 ucm2/conf.d/SC7180/sc7180-rt5682-max98357a-1mic.conf + +diff --git a/ucm2/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf b/ucm2/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf +new file mode 100644 +index 0000000..c93b4f7 +--- /dev/null ++++ b/ucm2/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf +@@ -0,0 +1,101 @@ ++# Use case configuration for ALC5682+MAX98357A on SC7180 ++ ++SectionVerb { ++ Value { ++ TQ "HiFi" ++ } ++} ++ ++SectionDevice."Speaker" { ++ Comment "Speaker" ++ ++ Value { ++ PlaybackChannels 2 ++ PlaybackPCM "hw:${CardId},1" ++ PlaybackPriority 100 ++ PlaybackMixerElem "Speaker" ++ PlaybackVolume "Speaker Playback Volume" ++ } ++} ++ ++SectionDevice."Headphones" { ++ Comment "Headphones" ++ ++ EnableSequence [ ++ cset "name='HPOL Playback Switch' 1" ++ cset "name='HPOR Playback Switch' 1" ++ cset "name='Stereo1 DAC MIXL DAC L1 Switch' 1" ++ cset "name='Stereo1 DAC MIXR DAC R1 Switch' 1" ++ ] ++ ++ DisableSequence [ ++ cset "name='HPOL Playback Switch' 0" ++ cset "name='HPOR Playback Switch' 0" ++ cset "name='Stereo1 DAC MIXL DAC L1 Switch' 0" ++ cset "name='Stereo1 DAC MIXR DAC R1 Switch' 0" ++ ] ++ ++ Value { ++ PlaybackPCM "hw:${CardId},0" ++ PlaybackPriority 200 ++ PlaybackMasterElem "DAC1" ++ PlaybackMixerElem "Headphone" ++ PlaybackVolume "Headphone Playback Volume" ++ } ++} ++ ++SectionDevice."Mic" { ++ Comment "Internal Microphone" ++ ++ ConflictingDevice [ ++ "Headset" ++ ] ++ ++ EnableSequence [ ++ cset "name='IF1 01 ADC Swap Mux' 1" ++ cset "name='Stereo1 ADC L2 Mux' 1" ++ cset "name='Stereo1 ADC R2 Mux' 1" ++ cset "name='Stereo1 ADC MIXL ADC2 Switch' 1" ++ cset "name='Stereo1 ADC MIXR ADC2 Switch' 1" ++ ] ++ ++ DisableSequence [ ++ cset "name='Stereo1 ADC L2 Mux' 0" ++ cset "name='Stereo1 ADC R2 Mux' 0" ++ cset "name='Stereo1 ADC MIXL ADC2 Switch' 0" ++ cset "name='Stereo1 ADC MIXR ADC2 Switch' 0" ++ ] ++ ++ Value { ++ CapturePCM "hw:${CardId},0" ++ CapturePriority 100 ++ CaptureMixerElem "STO1 ADC" ++ CaptureVolume "STO1 ADC Capture Volume" ++ } ++} ++ ++SectionDevice."Headset" { ++ Comment "Headset Microphone" ++ ++ EnableSequence [ ++ cset "name='IF1 01 ADC Swap Mux' 2" ++ cset "name='Stereo1 ADC L1 Mux' 1" ++ cset "name='Stereo1 ADC R1 Mux' 1" ++ cset "name='Stereo1 ADC MIXL ADC1 Switch' 1" ++ cset "name='Stereo1 ADC MIXR ADC1 Switch' 1" ++ ] ++ ++ DisableSequence [ ++ cset "name='Stereo1 ADC L1 Mux' 0" ++ cset "name='Stereo1 ADC R1 Mux' 0" ++ cset "name='Stereo1 ADC MIXL ADC1 Switch' 0" ++ cset "name='Stereo1 ADC MIXR ADC1 Switch' 0" ++ ] ++ ++ Value { ++ CapturePCM "hw:${CardId},0" ++ CapturePriority 200 ++ CaptureMixerElem "STO1 ADC" ++ CaptureVolume "STO1 ADC Capture Volume" ++ } ++} +diff --git a/ucm2/Qualcomm/sc7180/rt5682-max98357a/init.conf b/ucm2/Qualcomm/sc7180/rt5682-max98357a/init.conf +new file mode 100644 +index 0000000..5dee38a +--- /dev/null ++++ b/ucm2/Qualcomm/sc7180/rt5682-max98357a/init.conf +@@ -0,0 +1,24 @@ ++BootSequence [ ++ # Headphone ++ cset "name='HPOL Playback Switch' 0" ++ cset "name='HPOR Playback Switch' 0" ++ cset "name='Stereo1 DAC MIXL DAC L1 Switch' 0" ++ cset "name='Stereo1 DAC MIXR DAC R1 Switch' 0" ++ ++ # Headset mic ++ cset "name='Stereo1 ADC L Mux' 0" ++ cset "name='STO1 ADC Capture Switch' on" ++ cset "name='RECMIX1L CBJ Switch' 1" ++ cset "name='CBJ Boost Volume' 3" ++ cset "name='Stereo1 ADC L1 Mux' 0" ++ cset "name='Stereo1 ADC R1 Mux' 0" ++ cset "name='Stereo1 ADC MIXL ADC1 Switch' 0" ++ cset "name='Stereo1 ADC MIXR ADC1 Switch' 0" ++ ++ # Internal mic on ALC5682 ++ cset "name='IF1 01 ADC Swap Mux' 1" ++ cset "name='Stereo1 ADC L2 Mux' 0" ++ cset "name='Stereo1 ADC R2 Mux' 0" ++ cset "name='Stereo1 ADC MIXL ADC2 Switch' 0" ++ cset "name='Stereo1 ADC MIXR ADC2 Switch' 0" ++] +diff --git a/ucm2/Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf b/ucm2/Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf +new file mode 100644 +index 0000000..6a2be7e +--- /dev/null ++++ b/ucm2/Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf +@@ -0,0 +1,11 @@ ++Comment "SC7180 RT5682 MAX98357A single microphone sound card" ++Syntax 4 ++ ++SectionUseCase."HiFi" { ++ File "/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf" ++ Comment "Default" ++} ++ ++Include.card-init.File "/lib/card-init.conf" ++Include.ctl-remap.File "/lib/ctl-remap.conf" ++Include.init.File "/Qualcomm/sc7180/rt5682-max98357a/init.conf" +diff --git a/ucm2/conf.d/SC7180/sc7180-rt5682-max98357a-1mic.conf b/ucm2/conf.d/SC7180/sc7180-rt5682-max98357a-1mic.conf +new file mode 120000 +index 0000000..00f3e9e +--- /dev/null ++++ b/ucm2/conf.d/SC7180/sc7180-rt5682-max98357a-1mic.conf +@@ -0,0 +1 @@ ++../../Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf +\ No newline at end of file +-- +2.31.1 + + +From 60ea26507390bad3742af2272ba08b21f009d0ef Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Thu, 9 Dec 2021 11:24:14 +0100 +Subject: [PATCH 3/3] acp: fix linked configuration + +Fixes: https://github.com/alsa-project/alsa-lib/issues/199 +Signed-off-by: Jaroslav Kysela +--- + ucm2/common/linked-card.conf | 3 +++ + ucm2/conf.d/acp/acp.conf | 2 +- + 2 files changed, 4 insertions(+), 1 deletion(-) + create mode 100644 ucm2/common/linked-card.conf + +diff --git a/ucm2/common/linked-card.conf b/ucm2/common/linked-card.conf +new file mode 100644 +index 0000000..a90f20e +--- /dev/null ++++ b/ucm2/common/linked-card.conf +@@ -0,0 +1,3 @@ ++Syntax 3 ++ ++Include.linked.File "/common/linked.conf" +diff --git a/ucm2/conf.d/acp/acp.conf b/ucm2/conf.d/acp/acp.conf +index 5f056c7..7298c24 120000 +--- a/ucm2/conf.d/acp/acp.conf ++++ b/ucm2/conf.d/acp/acp.conf +@@ -1 +1 @@ +-../../common/linked.conf +\ No newline at end of file ++../../common/linked-card.conf +\ No newline at end of file +-- +2.31.1 + From 90dfeee30761fea770a3241789bc8dffb2fa2cde Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 10 Dec 2021 10:11:53 +0100 Subject: [PATCH 20/68] updated alsa-lib to 1.2.6.1 and alsa-ucm-conf to 1.2.6.2 --- alsa-git.patch | 97 ----------------- alsa-lib.spec | 9 +- alsa-ucm-conf.patch | 254 -------------------------------------------- sources | 5 +- 4 files changed, 9 insertions(+), 356 deletions(-) diff --git a/alsa-git.patch b/alsa-git.patch index 4082c0c..e69de29 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -1,97 +0,0 @@ -From f44c94f24c2422c5ee1c4c58253ec17412b248a9 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 7 Dec 2021 09:21:24 +0100 -Subject: [PATCH 1/2] conf: accept '_' character in the variable name - -Fixes: https://github.com/alsa-project/alsa-lib/issues/197 -Signed-off-by: Jaroslav Kysela ---- - src/confeval.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/confeval.c b/src/confeval.c -index a971bf38..be9ac874 100644 ---- a/src/confeval.c -+++ b/src/confeval.c -@@ -190,7 +190,7 @@ int _snd_eval_string(snd_config_t **dst, const char *s, - } else { - e = s + 1; - while (*e) { -- if (!isalnum(*e)) -+ if (!isalnum(*e) && *e != '_') - break; - e++; - } --- -2.31.1 - - -From 4b22871ee5a3bbc8eef7039bfc8db5e65ff3895f Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Thu, 9 Dec 2021 10:15:29 +0100 -Subject: [PATCH 2/2] conf: fix the device parsing when arguments has no - defaults - -The commit bf528b90 sets the value to an empty string which causes -these errors: - - pcm_hw.c: Invalid type for device - pcm_hw.c: Invalid type for subdevice - -When device arguments (@args) have no default values set, -the field must be skipped to keep the compatibility. - -BugLink: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1246 -Fixes: https://github.com/alsa-project/alsa-lib/issues/199 -Fixes: bf528b90 ("conf: add possibility to evaluate simple integer math expressions") -Signed-off-by: Jaroslav Kysela ---- - src/conf.c | 8 ++++++-- - src/confeval.c | 5 +++++ - 2 files changed, 11 insertions(+), 2 deletions(-) - -diff --git a/src/conf.c b/src/conf.c -index 0f6d2ba8..d3597cbc 100644 ---- a/src/conf.c -+++ b/src/conf.c -@@ -4994,8 +4994,10 @@ int snd_config_copy(snd_config_t **dst, - static int _snd_config_expand_vars(snd_config_t **dst, const char *s, void *private_data) - { - snd_config_t *val, *vars = private_data; -- if (snd_config_search(vars, s, &val) < 0) -- return snd_config_make_string(dst, ""); -+ if (snd_config_search(vars, s, &val) < 0) { -+ *dst = NULL; -+ return 0; -+ } - return snd_config_copy(dst, val); - } - -@@ -5060,6 +5062,8 @@ static int _snd_config_expand(snd_config_t *src, - err = snd_config_evaluate_string(dst, s, fcn, vars); - if (err < 0) - return err; -+ if (*dst == NULL) -+ return 0; - err = snd_config_set_id(*dst, id); - if (err < 0) { - snd_config_delete(*dst); -diff --git a/src/confeval.c b/src/confeval.c -index be9ac874..4a6f8c2e 100644 ---- a/src/confeval.c -+++ b/src/confeval.c -@@ -203,6 +203,11 @@ int _snd_eval_string(snd_config_t **dst, const char *s, - free(m); - if (err < 0) - return err; -+ if (tmp == NULL) { -+ err = snd_config_imake_integer(&tmp, NULL, 0); -+ if (err < 0) -+ return err; -+ } - s = e; - } - err = _to_integer(op == LEFT ? &left : &right, tmp); --- -2.31.1 - diff --git a/alsa-lib.spec b/alsa-lib.spec index 450ce1d..ca20bee 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,14 +2,14 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.6 -%define version_alsa_ucm 1.2.6 +%define version_alsa_lib 1.2.6.1 +%define version_alsa_ucm 1.2.6.2 %define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 3%{?prever_dot}%{?dist} +Release: 1%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Fri Dec 10 2021 Jaroslav Kysela - 1.2.6.1-1 +- updated alsa-lib to 1.2.6.1 and alsa-ucm-conf to 1.2.6.2 + * Thu Dec 9 2021 Jaroslav Kysela - 1.2.6-3 - device open fixes from upstream diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index f7e2ff1..e69de29 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -1,254 +0,0 @@ -From 244fc744e90c85f2816c5baba9fee08a85fec58e Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Thu, 9 Dec 2021 09:00:12 +0100 -Subject: [PATCH 1/3] USB-Audio: fix the wrong condition type for - If.realtek-alc1220-vb - -BugLink: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1246 -Signed-off-by: Jaroslav Kysela ---- - ucm2/USB-Audio/USB-Audio.conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf -index 878d16d..d9d740e 100644 ---- a/ucm2/USB-Audio/USB-Audio.conf -+++ b/ucm2/USB-Audio/USB-Audio.conf -@@ -15,7 +15,7 @@ If.linked { - If.realtek-alc1220-vb { - - Condition { -- Type Regex -+ Type RegexMatch - String "${CardComponents}" - # 0414:a002 Gigabyte TRX40 Aorus Pro WiFi - # 0b05:1917 ASUS ROG Strix --- -2.31.1 - - -From cefbdeb9f763ab4cbba1c338716d40acb6a4e43a Mon Sep 17 00:00:00 2001 -From: AngeloGioacchino Del Regno -Date: Wed, 10 Nov 2021 14:12:39 +0100 -Subject: [PATCH 2/3] ucm2: Add support for SC7180 Trogdor Lazor Chromebooks - -Almost all Trogdor Chromebooks are using RT5682 for headphones/headset -on 3.5mm jack, internal microphone and headset microphone, and MAX98357A -for the internal speakers (Lazor and Limozeen). - -This adds support for the sc7180-rt5682-max98357a-1mic sound card found -on the aforementioned Chromebooks. - -Signed-off-by: AngeloGioacchino Del Regno -Signed-off-by: Jaroslav Kysela ---- - .../sc7180/rt5682-max98357a/HiFi.conf | 101 ++++++++++++++++++ - .../sc7180/rt5682-max98357a/init.conf | 24 +++++ - .../sc7180-rt5682-max98357a-1mic.conf | 11 ++ - .../SC7180/sc7180-rt5682-max98357a-1mic.conf | 1 + - 4 files changed, 137 insertions(+) - create mode 100644 ucm2/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf - create mode 100644 ucm2/Qualcomm/sc7180/rt5682-max98357a/init.conf - create mode 100644 ucm2/Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf - create mode 120000 ucm2/conf.d/SC7180/sc7180-rt5682-max98357a-1mic.conf - -diff --git a/ucm2/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf b/ucm2/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf -new file mode 100644 -index 0000000..c93b4f7 ---- /dev/null -+++ b/ucm2/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf -@@ -0,0 +1,101 @@ -+# Use case configuration for ALC5682+MAX98357A on SC7180 -+ -+SectionVerb { -+ Value { -+ TQ "HiFi" -+ } -+} -+ -+SectionDevice."Speaker" { -+ Comment "Speaker" -+ -+ Value { -+ PlaybackChannels 2 -+ PlaybackPCM "hw:${CardId},1" -+ PlaybackPriority 100 -+ PlaybackMixerElem "Speaker" -+ PlaybackVolume "Speaker Playback Volume" -+ } -+} -+ -+SectionDevice."Headphones" { -+ Comment "Headphones" -+ -+ EnableSequence [ -+ cset "name='HPOL Playback Switch' 1" -+ cset "name='HPOR Playback Switch' 1" -+ cset "name='Stereo1 DAC MIXL DAC L1 Switch' 1" -+ cset "name='Stereo1 DAC MIXR DAC R1 Switch' 1" -+ ] -+ -+ DisableSequence [ -+ cset "name='HPOL Playback Switch' 0" -+ cset "name='HPOR Playback Switch' 0" -+ cset "name='Stereo1 DAC MIXL DAC L1 Switch' 0" -+ cset "name='Stereo1 DAC MIXR DAC R1 Switch' 0" -+ ] -+ -+ Value { -+ PlaybackPCM "hw:${CardId},0" -+ PlaybackPriority 200 -+ PlaybackMasterElem "DAC1" -+ PlaybackMixerElem "Headphone" -+ PlaybackVolume "Headphone Playback Volume" -+ } -+} -+ -+SectionDevice."Mic" { -+ Comment "Internal Microphone" -+ -+ ConflictingDevice [ -+ "Headset" -+ ] -+ -+ EnableSequence [ -+ cset "name='IF1 01 ADC Swap Mux' 1" -+ cset "name='Stereo1 ADC L2 Mux' 1" -+ cset "name='Stereo1 ADC R2 Mux' 1" -+ cset "name='Stereo1 ADC MIXL ADC2 Switch' 1" -+ cset "name='Stereo1 ADC MIXR ADC2 Switch' 1" -+ ] -+ -+ DisableSequence [ -+ cset "name='Stereo1 ADC L2 Mux' 0" -+ cset "name='Stereo1 ADC R2 Mux' 0" -+ cset "name='Stereo1 ADC MIXL ADC2 Switch' 0" -+ cset "name='Stereo1 ADC MIXR ADC2 Switch' 0" -+ ] -+ -+ Value { -+ CapturePCM "hw:${CardId},0" -+ CapturePriority 100 -+ CaptureMixerElem "STO1 ADC" -+ CaptureVolume "STO1 ADC Capture Volume" -+ } -+} -+ -+SectionDevice."Headset" { -+ Comment "Headset Microphone" -+ -+ EnableSequence [ -+ cset "name='IF1 01 ADC Swap Mux' 2" -+ cset "name='Stereo1 ADC L1 Mux' 1" -+ cset "name='Stereo1 ADC R1 Mux' 1" -+ cset "name='Stereo1 ADC MIXL ADC1 Switch' 1" -+ cset "name='Stereo1 ADC MIXR ADC1 Switch' 1" -+ ] -+ -+ DisableSequence [ -+ cset "name='Stereo1 ADC L1 Mux' 0" -+ cset "name='Stereo1 ADC R1 Mux' 0" -+ cset "name='Stereo1 ADC MIXL ADC1 Switch' 0" -+ cset "name='Stereo1 ADC MIXR ADC1 Switch' 0" -+ ] -+ -+ Value { -+ CapturePCM "hw:${CardId},0" -+ CapturePriority 200 -+ CaptureMixerElem "STO1 ADC" -+ CaptureVolume "STO1 ADC Capture Volume" -+ } -+} -diff --git a/ucm2/Qualcomm/sc7180/rt5682-max98357a/init.conf b/ucm2/Qualcomm/sc7180/rt5682-max98357a/init.conf -new file mode 100644 -index 0000000..5dee38a ---- /dev/null -+++ b/ucm2/Qualcomm/sc7180/rt5682-max98357a/init.conf -@@ -0,0 +1,24 @@ -+BootSequence [ -+ # Headphone -+ cset "name='HPOL Playback Switch' 0" -+ cset "name='HPOR Playback Switch' 0" -+ cset "name='Stereo1 DAC MIXL DAC L1 Switch' 0" -+ cset "name='Stereo1 DAC MIXR DAC R1 Switch' 0" -+ -+ # Headset mic -+ cset "name='Stereo1 ADC L Mux' 0" -+ cset "name='STO1 ADC Capture Switch' on" -+ cset "name='RECMIX1L CBJ Switch' 1" -+ cset "name='CBJ Boost Volume' 3" -+ cset "name='Stereo1 ADC L1 Mux' 0" -+ cset "name='Stereo1 ADC R1 Mux' 0" -+ cset "name='Stereo1 ADC MIXL ADC1 Switch' 0" -+ cset "name='Stereo1 ADC MIXR ADC1 Switch' 0" -+ -+ # Internal mic on ALC5682 -+ cset "name='IF1 01 ADC Swap Mux' 1" -+ cset "name='Stereo1 ADC L2 Mux' 0" -+ cset "name='Stereo1 ADC R2 Mux' 0" -+ cset "name='Stereo1 ADC MIXL ADC2 Switch' 0" -+ cset "name='Stereo1 ADC MIXR ADC2 Switch' 0" -+] -diff --git a/ucm2/Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf b/ucm2/Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf -new file mode 100644 -index 0000000..6a2be7e ---- /dev/null -+++ b/ucm2/Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf -@@ -0,0 +1,11 @@ -+Comment "SC7180 RT5682 MAX98357A single microphone sound card" -+Syntax 4 -+ -+SectionUseCase."HiFi" { -+ File "/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf" -+ Comment "Default" -+} -+ -+Include.card-init.File "/lib/card-init.conf" -+Include.ctl-remap.File "/lib/ctl-remap.conf" -+Include.init.File "/Qualcomm/sc7180/rt5682-max98357a/init.conf" -diff --git a/ucm2/conf.d/SC7180/sc7180-rt5682-max98357a-1mic.conf b/ucm2/conf.d/SC7180/sc7180-rt5682-max98357a-1mic.conf -new file mode 120000 -index 0000000..00f3e9e ---- /dev/null -+++ b/ucm2/conf.d/SC7180/sc7180-rt5682-max98357a-1mic.conf -@@ -0,0 +1 @@ -+../../Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf -\ No newline at end of file --- -2.31.1 - - -From 60ea26507390bad3742af2272ba08b21f009d0ef Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Thu, 9 Dec 2021 11:24:14 +0100 -Subject: [PATCH 3/3] acp: fix linked configuration - -Fixes: https://github.com/alsa-project/alsa-lib/issues/199 -Signed-off-by: Jaroslav Kysela ---- - ucm2/common/linked-card.conf | 3 +++ - ucm2/conf.d/acp/acp.conf | 2 +- - 2 files changed, 4 insertions(+), 1 deletion(-) - create mode 100644 ucm2/common/linked-card.conf - -diff --git a/ucm2/common/linked-card.conf b/ucm2/common/linked-card.conf -new file mode 100644 -index 0000000..a90f20e ---- /dev/null -+++ b/ucm2/common/linked-card.conf -@@ -0,0 +1,3 @@ -+Syntax 3 -+ -+Include.linked.File "/common/linked.conf" -diff --git a/ucm2/conf.d/acp/acp.conf b/ucm2/conf.d/acp/acp.conf -index 5f056c7..7298c24 120000 ---- a/ucm2/conf.d/acp/acp.conf -+++ b/ucm2/conf.d/acp/acp.conf -@@ -1 +1 @@ --../../common/linked.conf -\ No newline at end of file -+../../common/linked-card.conf -\ No newline at end of file --- -2.31.1 - diff --git a/sources b/sources index 07eab63..1544afe 100644 --- a/sources +++ b/sources @@ -1,3 +1,4 @@ -SHA512 (alsa-lib-1.2.6.tar.bz2) = ae95718813abf62811fe44c6df2a8de5a1227da4b022c4dd97dd8e7c1001f48307ba36bf04208bdbe24e8a8eebf4ed5a59f40ee6750dcbe976678071c3f2f5b7 -SHA512 (alsa-ucm-conf-1.2.6.tar.bz2) = 5fe85643b60c8defeafcdfcf97e61b5d05e6db28cef2466a70f63b8fffba22bdd50b83a5ca88806a6350de6e9d802dd3c2240b293190b9d05daea515c03d4397 +SHA512 (alsa-lib-1.2.6.1.tar.bz2) = 70e539cf092b5d43e00e4134d8a3e184f0dc34312823e4b58a574320cbf06cb7369bc3251ecb1858033756a7a8c35d36faa8da48d49f6efe0cec905784adbd45 +SHA512 (alsa-ucm-conf-1.2.6.2.tar.bz2) = d7122279bc36ab16dfe1a5f2e24b9dda57e1b59b7c7aeac3c8755af62b464053ed038aa56ebb52d7707ecae01674cac920ea784bb7493d978276a98cbf78d873 SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 + From 1157897630780be354080c623cc1287a21a1560d Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 10 Dec 2021 10:11:53 +0100 Subject: [PATCH 21/68] updated alsa-lib to 1.2.6.1 and alsa-ucm-conf to 1.2.6.2 --- alsa-git.patch | 97 ----------------- alsa-lib.spec | 9 +- alsa-ucm-conf.patch | 254 -------------------------------------------- sources | 5 +- 4 files changed, 9 insertions(+), 356 deletions(-) diff --git a/alsa-git.patch b/alsa-git.patch index 4082c0c..e69de29 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -1,97 +0,0 @@ -From f44c94f24c2422c5ee1c4c58253ec17412b248a9 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 7 Dec 2021 09:21:24 +0100 -Subject: [PATCH 1/2] conf: accept '_' character in the variable name - -Fixes: https://github.com/alsa-project/alsa-lib/issues/197 -Signed-off-by: Jaroslav Kysela ---- - src/confeval.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/confeval.c b/src/confeval.c -index a971bf38..be9ac874 100644 ---- a/src/confeval.c -+++ b/src/confeval.c -@@ -190,7 +190,7 @@ int _snd_eval_string(snd_config_t **dst, const char *s, - } else { - e = s + 1; - while (*e) { -- if (!isalnum(*e)) -+ if (!isalnum(*e) && *e != '_') - break; - e++; - } --- -2.31.1 - - -From 4b22871ee5a3bbc8eef7039bfc8db5e65ff3895f Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Thu, 9 Dec 2021 10:15:29 +0100 -Subject: [PATCH 2/2] conf: fix the device parsing when arguments has no - defaults - -The commit bf528b90 sets the value to an empty string which causes -these errors: - - pcm_hw.c: Invalid type for device - pcm_hw.c: Invalid type for subdevice - -When device arguments (@args) have no default values set, -the field must be skipped to keep the compatibility. - -BugLink: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1246 -Fixes: https://github.com/alsa-project/alsa-lib/issues/199 -Fixes: bf528b90 ("conf: add possibility to evaluate simple integer math expressions") -Signed-off-by: Jaroslav Kysela ---- - src/conf.c | 8 ++++++-- - src/confeval.c | 5 +++++ - 2 files changed, 11 insertions(+), 2 deletions(-) - -diff --git a/src/conf.c b/src/conf.c -index 0f6d2ba8..d3597cbc 100644 ---- a/src/conf.c -+++ b/src/conf.c -@@ -4994,8 +4994,10 @@ int snd_config_copy(snd_config_t **dst, - static int _snd_config_expand_vars(snd_config_t **dst, const char *s, void *private_data) - { - snd_config_t *val, *vars = private_data; -- if (snd_config_search(vars, s, &val) < 0) -- return snd_config_make_string(dst, ""); -+ if (snd_config_search(vars, s, &val) < 0) { -+ *dst = NULL; -+ return 0; -+ } - return snd_config_copy(dst, val); - } - -@@ -5060,6 +5062,8 @@ static int _snd_config_expand(snd_config_t *src, - err = snd_config_evaluate_string(dst, s, fcn, vars); - if (err < 0) - return err; -+ if (*dst == NULL) -+ return 0; - err = snd_config_set_id(*dst, id); - if (err < 0) { - snd_config_delete(*dst); -diff --git a/src/confeval.c b/src/confeval.c -index be9ac874..4a6f8c2e 100644 ---- a/src/confeval.c -+++ b/src/confeval.c -@@ -203,6 +203,11 @@ int _snd_eval_string(snd_config_t **dst, const char *s, - free(m); - if (err < 0) - return err; -+ if (tmp == NULL) { -+ err = snd_config_imake_integer(&tmp, NULL, 0); -+ if (err < 0) -+ return err; -+ } - s = e; - } - err = _to_integer(op == LEFT ? &left : &right, tmp); --- -2.31.1 - diff --git a/alsa-lib.spec b/alsa-lib.spec index cef2f8f..9f3dcbf 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,14 +2,14 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.6 -%define version_alsa_ucm 1.2.6 +%define version_alsa_lib 1.2.6.1 +%define version_alsa_ucm 1.2.6.2 %define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 3%{?prever_dot}%{?dist} +Release: 1%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Fri Dec 10 2021 Jaroslav Kysela - 1.2.6.1-1 +- updated alsa-lib to 1.2.6.1 and alsa-ucm-conf to 1.2.6.2 + * Thu Dec 9 2021 Jaroslav Kysela - 1.2.6-3 - device open fixes from upstream diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index f7e2ff1..e69de29 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -1,254 +0,0 @@ -From 244fc744e90c85f2816c5baba9fee08a85fec58e Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Thu, 9 Dec 2021 09:00:12 +0100 -Subject: [PATCH 1/3] USB-Audio: fix the wrong condition type for - If.realtek-alc1220-vb - -BugLink: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1246 -Signed-off-by: Jaroslav Kysela ---- - ucm2/USB-Audio/USB-Audio.conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf -index 878d16d..d9d740e 100644 ---- a/ucm2/USB-Audio/USB-Audio.conf -+++ b/ucm2/USB-Audio/USB-Audio.conf -@@ -15,7 +15,7 @@ If.linked { - If.realtek-alc1220-vb { - - Condition { -- Type Regex -+ Type RegexMatch - String "${CardComponents}" - # 0414:a002 Gigabyte TRX40 Aorus Pro WiFi - # 0b05:1917 ASUS ROG Strix --- -2.31.1 - - -From cefbdeb9f763ab4cbba1c338716d40acb6a4e43a Mon Sep 17 00:00:00 2001 -From: AngeloGioacchino Del Regno -Date: Wed, 10 Nov 2021 14:12:39 +0100 -Subject: [PATCH 2/3] ucm2: Add support for SC7180 Trogdor Lazor Chromebooks - -Almost all Trogdor Chromebooks are using RT5682 for headphones/headset -on 3.5mm jack, internal microphone and headset microphone, and MAX98357A -for the internal speakers (Lazor and Limozeen). - -This adds support for the sc7180-rt5682-max98357a-1mic sound card found -on the aforementioned Chromebooks. - -Signed-off-by: AngeloGioacchino Del Regno -Signed-off-by: Jaroslav Kysela ---- - .../sc7180/rt5682-max98357a/HiFi.conf | 101 ++++++++++++++++++ - .../sc7180/rt5682-max98357a/init.conf | 24 +++++ - .../sc7180-rt5682-max98357a-1mic.conf | 11 ++ - .../SC7180/sc7180-rt5682-max98357a-1mic.conf | 1 + - 4 files changed, 137 insertions(+) - create mode 100644 ucm2/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf - create mode 100644 ucm2/Qualcomm/sc7180/rt5682-max98357a/init.conf - create mode 100644 ucm2/Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf - create mode 120000 ucm2/conf.d/SC7180/sc7180-rt5682-max98357a-1mic.conf - -diff --git a/ucm2/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf b/ucm2/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf -new file mode 100644 -index 0000000..c93b4f7 ---- /dev/null -+++ b/ucm2/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf -@@ -0,0 +1,101 @@ -+# Use case configuration for ALC5682+MAX98357A on SC7180 -+ -+SectionVerb { -+ Value { -+ TQ "HiFi" -+ } -+} -+ -+SectionDevice."Speaker" { -+ Comment "Speaker" -+ -+ Value { -+ PlaybackChannels 2 -+ PlaybackPCM "hw:${CardId},1" -+ PlaybackPriority 100 -+ PlaybackMixerElem "Speaker" -+ PlaybackVolume "Speaker Playback Volume" -+ } -+} -+ -+SectionDevice."Headphones" { -+ Comment "Headphones" -+ -+ EnableSequence [ -+ cset "name='HPOL Playback Switch' 1" -+ cset "name='HPOR Playback Switch' 1" -+ cset "name='Stereo1 DAC MIXL DAC L1 Switch' 1" -+ cset "name='Stereo1 DAC MIXR DAC R1 Switch' 1" -+ ] -+ -+ DisableSequence [ -+ cset "name='HPOL Playback Switch' 0" -+ cset "name='HPOR Playback Switch' 0" -+ cset "name='Stereo1 DAC MIXL DAC L1 Switch' 0" -+ cset "name='Stereo1 DAC MIXR DAC R1 Switch' 0" -+ ] -+ -+ Value { -+ PlaybackPCM "hw:${CardId},0" -+ PlaybackPriority 200 -+ PlaybackMasterElem "DAC1" -+ PlaybackMixerElem "Headphone" -+ PlaybackVolume "Headphone Playback Volume" -+ } -+} -+ -+SectionDevice."Mic" { -+ Comment "Internal Microphone" -+ -+ ConflictingDevice [ -+ "Headset" -+ ] -+ -+ EnableSequence [ -+ cset "name='IF1 01 ADC Swap Mux' 1" -+ cset "name='Stereo1 ADC L2 Mux' 1" -+ cset "name='Stereo1 ADC R2 Mux' 1" -+ cset "name='Stereo1 ADC MIXL ADC2 Switch' 1" -+ cset "name='Stereo1 ADC MIXR ADC2 Switch' 1" -+ ] -+ -+ DisableSequence [ -+ cset "name='Stereo1 ADC L2 Mux' 0" -+ cset "name='Stereo1 ADC R2 Mux' 0" -+ cset "name='Stereo1 ADC MIXL ADC2 Switch' 0" -+ cset "name='Stereo1 ADC MIXR ADC2 Switch' 0" -+ ] -+ -+ Value { -+ CapturePCM "hw:${CardId},0" -+ CapturePriority 100 -+ CaptureMixerElem "STO1 ADC" -+ CaptureVolume "STO1 ADC Capture Volume" -+ } -+} -+ -+SectionDevice."Headset" { -+ Comment "Headset Microphone" -+ -+ EnableSequence [ -+ cset "name='IF1 01 ADC Swap Mux' 2" -+ cset "name='Stereo1 ADC L1 Mux' 1" -+ cset "name='Stereo1 ADC R1 Mux' 1" -+ cset "name='Stereo1 ADC MIXL ADC1 Switch' 1" -+ cset "name='Stereo1 ADC MIXR ADC1 Switch' 1" -+ ] -+ -+ DisableSequence [ -+ cset "name='Stereo1 ADC L1 Mux' 0" -+ cset "name='Stereo1 ADC R1 Mux' 0" -+ cset "name='Stereo1 ADC MIXL ADC1 Switch' 0" -+ cset "name='Stereo1 ADC MIXR ADC1 Switch' 0" -+ ] -+ -+ Value { -+ CapturePCM "hw:${CardId},0" -+ CapturePriority 200 -+ CaptureMixerElem "STO1 ADC" -+ CaptureVolume "STO1 ADC Capture Volume" -+ } -+} -diff --git a/ucm2/Qualcomm/sc7180/rt5682-max98357a/init.conf b/ucm2/Qualcomm/sc7180/rt5682-max98357a/init.conf -new file mode 100644 -index 0000000..5dee38a ---- /dev/null -+++ b/ucm2/Qualcomm/sc7180/rt5682-max98357a/init.conf -@@ -0,0 +1,24 @@ -+BootSequence [ -+ # Headphone -+ cset "name='HPOL Playback Switch' 0" -+ cset "name='HPOR Playback Switch' 0" -+ cset "name='Stereo1 DAC MIXL DAC L1 Switch' 0" -+ cset "name='Stereo1 DAC MIXR DAC R1 Switch' 0" -+ -+ # Headset mic -+ cset "name='Stereo1 ADC L Mux' 0" -+ cset "name='STO1 ADC Capture Switch' on" -+ cset "name='RECMIX1L CBJ Switch' 1" -+ cset "name='CBJ Boost Volume' 3" -+ cset "name='Stereo1 ADC L1 Mux' 0" -+ cset "name='Stereo1 ADC R1 Mux' 0" -+ cset "name='Stereo1 ADC MIXL ADC1 Switch' 0" -+ cset "name='Stereo1 ADC MIXR ADC1 Switch' 0" -+ -+ # Internal mic on ALC5682 -+ cset "name='IF1 01 ADC Swap Mux' 1" -+ cset "name='Stereo1 ADC L2 Mux' 0" -+ cset "name='Stereo1 ADC R2 Mux' 0" -+ cset "name='Stereo1 ADC MIXL ADC2 Switch' 0" -+ cset "name='Stereo1 ADC MIXR ADC2 Switch' 0" -+] -diff --git a/ucm2/Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf b/ucm2/Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf -new file mode 100644 -index 0000000..6a2be7e ---- /dev/null -+++ b/ucm2/Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf -@@ -0,0 +1,11 @@ -+Comment "SC7180 RT5682 MAX98357A single microphone sound card" -+Syntax 4 -+ -+SectionUseCase."HiFi" { -+ File "/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf" -+ Comment "Default" -+} -+ -+Include.card-init.File "/lib/card-init.conf" -+Include.ctl-remap.File "/lib/ctl-remap.conf" -+Include.init.File "/Qualcomm/sc7180/rt5682-max98357a/init.conf" -diff --git a/ucm2/conf.d/SC7180/sc7180-rt5682-max98357a-1mic.conf b/ucm2/conf.d/SC7180/sc7180-rt5682-max98357a-1mic.conf -new file mode 120000 -index 0000000..00f3e9e ---- /dev/null -+++ b/ucm2/conf.d/SC7180/sc7180-rt5682-max98357a-1mic.conf -@@ -0,0 +1 @@ -+../../Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf -\ No newline at end of file --- -2.31.1 - - -From 60ea26507390bad3742af2272ba08b21f009d0ef Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Thu, 9 Dec 2021 11:24:14 +0100 -Subject: [PATCH 3/3] acp: fix linked configuration - -Fixes: https://github.com/alsa-project/alsa-lib/issues/199 -Signed-off-by: Jaroslav Kysela ---- - ucm2/common/linked-card.conf | 3 +++ - ucm2/conf.d/acp/acp.conf | 2 +- - 2 files changed, 4 insertions(+), 1 deletion(-) - create mode 100644 ucm2/common/linked-card.conf - -diff --git a/ucm2/common/linked-card.conf b/ucm2/common/linked-card.conf -new file mode 100644 -index 0000000..a90f20e ---- /dev/null -+++ b/ucm2/common/linked-card.conf -@@ -0,0 +1,3 @@ -+Syntax 3 -+ -+Include.linked.File "/common/linked.conf" -diff --git a/ucm2/conf.d/acp/acp.conf b/ucm2/conf.d/acp/acp.conf -index 5f056c7..7298c24 120000 ---- a/ucm2/conf.d/acp/acp.conf -+++ b/ucm2/conf.d/acp/acp.conf -@@ -1 +1 @@ --../../common/linked.conf -\ No newline at end of file -+../../common/linked-card.conf -\ No newline at end of file --- -2.31.1 - diff --git a/sources b/sources index 07eab63..1544afe 100644 --- a/sources +++ b/sources @@ -1,3 +1,4 @@ -SHA512 (alsa-lib-1.2.6.tar.bz2) = ae95718813abf62811fe44c6df2a8de5a1227da4b022c4dd97dd8e7c1001f48307ba36bf04208bdbe24e8a8eebf4ed5a59f40ee6750dcbe976678071c3f2f5b7 -SHA512 (alsa-ucm-conf-1.2.6.tar.bz2) = 5fe85643b60c8defeafcdfcf97e61b5d05e6db28cef2466a70f63b8fffba22bdd50b83a5ca88806a6350de6e9d802dd3c2240b293190b9d05daea515c03d4397 +SHA512 (alsa-lib-1.2.6.1.tar.bz2) = 70e539cf092b5d43e00e4134d8a3e184f0dc34312823e4b58a574320cbf06cb7369bc3251ecb1858033756a7a8c35d36faa8da48d49f6efe0cec905784adbd45 +SHA512 (alsa-ucm-conf-1.2.6.2.tar.bz2) = d7122279bc36ab16dfe1a5f2e24b9dda57e1b59b7c7aeac3c8755af62b464053ed038aa56ebb52d7707ecae01674cac920ea784bb7493d978276a98cbf78d873 SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 + From 82be0e2f26737e92a0fe75da4bc30e45c76e1953 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 10 Dec 2021 11:38:41 +0100 Subject: [PATCH 22/68] correct Requires --- alsa-lib.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index ca20bee..54e6b2b 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -52,7 +52,7 @@ against the ALSA libraries and interfaces. Summary: ALSA Use Case Manager configuration BuildArch: noarch License: BSD -Requires: %{name} >= %{version_alsa_ucm} +Requires: %{name} >= %{version_alsa_lib} %description -n alsa-ucm The Advanced Linux Sound Architecture (ALSA) Use Case Manager configuration @@ -62,7 +62,7 @@ contains alsa-lib configuration of Audio input/output names and routing Summary: ALSA Topology configuration BuildArch: noarch License: BSD -Requires: %{name} >= %{version_alsa_tplg} +Requires: %{name} >= %{version_alsa_lib} %description -n alsa-topology The Advanced Linux Sound Architecture (ALSA) topology configuration @@ -167,7 +167,7 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog -* Fri Dec 10 2021 Jaroslav Kysela - 1.2.6.1-1 +* Fri Dec 10 2021 Jaroslav Kysela - 1.2.6.1-2 - updated alsa-lib to 1.2.6.1 and alsa-ucm-conf to 1.2.6.2 * Thu Dec 9 2021 Jaroslav Kysela - 1.2.6-3 From 9d835416330d9bff9b81f2ae5d8b4a3f366bda12 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 10 Dec 2021 11:38:41 +0100 Subject: [PATCH 23/68] correct Requires --- alsa-lib.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 9f3dcbf..06eaef3 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -52,7 +52,7 @@ against the ALSA libraries and interfaces. Summary: ALSA Use Case Manager configuration BuildArch: noarch License: BSD -Requires: %{name} >= %{version_alsa_ucm} +Requires: %{name} >= %{version_alsa_lib} %description -n alsa-ucm The Advanced Linux Sound Architecture (ALSA) Use Case Manager configuration @@ -62,7 +62,7 @@ contains alsa-lib configuration of Audio input/output names and routing Summary: ALSA Topology configuration BuildArch: noarch License: BSD -Requires: %{name} >= %{version_alsa_tplg} +Requires: %{name} >= %{version_alsa_lib} %description -n alsa-topology The Advanced Linux Sound Architecture (ALSA) topology configuration @@ -167,7 +167,7 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog -* Fri Dec 10 2021 Jaroslav Kysela - 1.2.6.1-1 +* Fri Dec 10 2021 Jaroslav Kysela - 1.2.6.1-2 - updated alsa-lib to 1.2.6.1 and alsa-ucm-conf to 1.2.6.2 * Thu Dec 9 2021 Jaroslav Kysela - 1.2.6-3 From dc95b94f410f463ef5a7aba1e74d5560e11ef6dc Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 17 Dec 2021 17:57:34 +0100 Subject: [PATCH 24/68] updated alsa-ucm-conf to 1.2.6.3 Signed-off-by: Jaroslav Kysela --- alsa-lib.spec | 7 +++++-- sources | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 54e6b2b..6609be4 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -3,13 +3,13 @@ #define postver a %define version_alsa_lib 1.2.6.1 -%define version_alsa_ucm 1.2.6.2 +%define version_alsa_ucm 1.2.6.3 %define version_alsa_tplg 1.2.5 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: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Fri Dec 17 2021 Jaroslav Kysela - 1.2.6.1-3 +- updated alsa-ucm-conf to 1.2.6.3 + * Fri Dec 10 2021 Jaroslav Kysela - 1.2.6.1-2 - updated alsa-lib to 1.2.6.1 and alsa-ucm-conf to 1.2.6.2 diff --git a/sources b/sources index 1544afe..b6ee355 100644 --- a/sources +++ b/sources @@ -1,4 +1,3 @@ SHA512 (alsa-lib-1.2.6.1.tar.bz2) = 70e539cf092b5d43e00e4134d8a3e184f0dc34312823e4b58a574320cbf06cb7369bc3251ecb1858033756a7a8c35d36faa8da48d49f6efe0cec905784adbd45 -SHA512 (alsa-ucm-conf-1.2.6.2.tar.bz2) = d7122279bc36ab16dfe1a5f2e24b9dda57e1b59b7c7aeac3c8755af62b464053ed038aa56ebb52d7707ecae01674cac920ea784bb7493d978276a98cbf78d873 +SHA512 (alsa-ucm-conf-1.2.6.3.tar.bz2) = 14031173dd9b44c506f13172fcf89d1119e4b2d409a749ec8ef4948e75231a5e5091206e826dff9e70f1f803de8cfb9fd94886ef70764c705f65c1c7ebdf649f SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 - From 16a6715ed0d0d87a9c9b3f5e3c04363bac4fb421 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 17 Dec 2021 17:57:34 +0100 Subject: [PATCH 25/68] updated alsa-ucm-conf to 1.2.6.3 Signed-off-by: Jaroslav Kysela --- alsa-lib.spec | 7 +++++-- sources | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 06eaef3..49316cb 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -3,13 +3,13 @@ #define postver a %define version_alsa_lib 1.2.6.1 -%define version_alsa_ucm 1.2.6.2 +%define version_alsa_ucm 1.2.6.3 %define version_alsa_tplg 1.2.5 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: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Fri Dec 17 2021 Jaroslav Kysela - 1.2.6.1-3 +- updated alsa-ucm-conf to 1.2.6.3 + * Fri Dec 10 2021 Jaroslav Kysela - 1.2.6.1-2 - updated alsa-lib to 1.2.6.1 and alsa-ucm-conf to 1.2.6.2 diff --git a/sources b/sources index 1544afe..b6ee355 100644 --- a/sources +++ b/sources @@ -1,4 +1,3 @@ SHA512 (alsa-lib-1.2.6.1.tar.bz2) = 70e539cf092b5d43e00e4134d8a3e184f0dc34312823e4b58a574320cbf06cb7369bc3251ecb1858033756a7a8c35d36faa8da48d49f6efe0cec905784adbd45 -SHA512 (alsa-ucm-conf-1.2.6.2.tar.bz2) = d7122279bc36ab16dfe1a5f2e24b9dda57e1b59b7c7aeac3c8755af62b464053ed038aa56ebb52d7707ecae01674cac920ea784bb7493d978276a98cbf78d873 +SHA512 (alsa-ucm-conf-1.2.6.3.tar.bz2) = 14031173dd9b44c506f13172fcf89d1119e4b2d409a749ec8ef4948e75231a5e5091206e826dff9e70f1f803de8cfb9fd94886ef70764c705f65c1c7ebdf649f SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 - From 390f3b3f7f3f8328f19c6cc09f315bc7e2cc85ce Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 19 Jan 2022 21:09:13 +0000 Subject: [PATCH 26/68] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- alsa-lib.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 6609be4..0fd8903 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 3%{?prever_dot}%{?dist} +Release: 4%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Wed Jan 19 2022 Fedora Release Engineering - 1.2.6.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Fri Dec 17 2021 Jaroslav Kysela - 1.2.6.1-3 - updated alsa-ucm-conf to 1.2.6.3 From dcc23d2d03dcbcf29eebb8e697d9a12a2843e310 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 31 May 2022 17:01:32 +0200 Subject: [PATCH 27/68] update to 1.2.7 Signed-off-by: Jaroslav Kysela --- alsa-lib.spec | 9 ++++++--- sources | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 0fd8903..3945f7d 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,14 +2,14 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.6.1 -%define version_alsa_ucm 1.2.6.3 +%define version_alsa_lib 1.2.7 +%define version_alsa_ucm 1.2.7 %define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 4%{?prever_dot}%{?dist} +Release: 1%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Tue May 31 2022 Jaroslav Kysela - 1.2.7-1 +- update to 1.2.7 + * Wed Jan 19 2022 Fedora Release Engineering - 1.2.6.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild diff --git a/sources b/sources index b6ee355..2ea7d58 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.6.1.tar.bz2) = 70e539cf092b5d43e00e4134d8a3e184f0dc34312823e4b58a574320cbf06cb7369bc3251ecb1858033756a7a8c35d36faa8da48d49f6efe0cec905784adbd45 -SHA512 (alsa-ucm-conf-1.2.6.3.tar.bz2) = 14031173dd9b44c506f13172fcf89d1119e4b2d409a749ec8ef4948e75231a5e5091206e826dff9e70f1f803de8cfb9fd94886ef70764c705f65c1c7ebdf649f +SHA512 (alsa-lib-1.2.7.tar.bz2) = 6bd48b07d659fddad792876326a93b2a549ce94bc191131670365599c31f81f737bfd8e94dec6fe296bc5d86df2e3e381bbb7a694d24fe7e8e501f1c994ed084 +SHA512 (alsa-ucm-conf-1.2.7.tar.bz2) = 3f69343213632ca4196d83f2713302ff9839d9c5fcdf9e0c0be4d358a854844085f9c18acad01dfdf492eda203e2bd5d40939b09074e9c0b57692732bb3136ae SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 From afa3fc0a7e03df871fb7cfcddd3ae2de5e5fba10 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 17 Jun 2022 12:02:36 +0200 Subject: [PATCH 28/68] update to 1.2.7.1 Signed-off-by: Jaroslav Kysela --- alsa-lib.spec | 7 +++++-- sources | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 3945f7d..6e72097 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,8 +2,8 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.7 -%define version_alsa_ucm 1.2.7 +%define version_alsa_lib 1.2.7.1 +%define version_alsa_ucm 1.2.7.1 %define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Fri Jun 17 2022 Jaroslav Kysela - 1.2.7.1-1 +- update to 1.2.7.1 + * Tue May 31 2022 Jaroslav Kysela - 1.2.7-1 - update to 1.2.7 diff --git a/sources b/sources index 2ea7d58..32115d2 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.7.tar.bz2) = 6bd48b07d659fddad792876326a93b2a549ce94bc191131670365599c31f81f737bfd8e94dec6fe296bc5d86df2e3e381bbb7a694d24fe7e8e501f1c994ed084 -SHA512 (alsa-ucm-conf-1.2.7.tar.bz2) = 3f69343213632ca4196d83f2713302ff9839d9c5fcdf9e0c0be4d358a854844085f9c18acad01dfdf492eda203e2bd5d40939b09074e9c0b57692732bb3136ae +SHA512 (alsa-lib-1.2.7.1.tar.bz2) = 2a0b4205e8bf602b56a6f5007ba219799e5443827393058e439adf5b391bb6c4815a48bb994b5d108b9f31a90db0eb43a96a0d7741216e2d710dc63d372de27e +SHA512 (alsa-ucm-conf-1.2.7.1.tar.bz2) = e2ade1b4f4d26cfb77fb423b82b7eea1b51bbb4857b771acb845da3f3f99c846ec28a415eb184c7d79ffbe1edf21f026951778f905e23658d78deaebb1315759 SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 From 218694a669c4a5039bd3cceadd95b8f437ff66e3 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 8 Jul 2022 17:43:32 +0200 Subject: [PATCH 29/68] update to 1.2.7.2 Signed-off-by: Jaroslav Kysela --- alsa-lib.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 6e72097..de479e2 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,8 +2,8 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.7.1 -%define version_alsa_ucm 1.2.7.1 +%define version_alsa_lib 1.2.7.2 +%define version_alsa_ucm 1.2.7.2 %define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Fri Jul 8 2022 Jaroslav Kysela - 1.2.7.1-2 +- update to 1.2.7.2 + * Fri Jun 17 2022 Jaroslav Kysela - 1.2.7.1-1 - update to 1.2.7.1 From c2ac4b6efa1eb3219dc51b76160ac698c6cce687 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 8 Jul 2022 17:48:32 +0200 Subject: [PATCH 30/68] add missing sources --- sources | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources b/sources index 32115d2..9cdca5b 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.7.1.tar.bz2) = 2a0b4205e8bf602b56a6f5007ba219799e5443827393058e439adf5b391bb6c4815a48bb994b5d108b9f31a90db0eb43a96a0d7741216e2d710dc63d372de27e -SHA512 (alsa-ucm-conf-1.2.7.1.tar.bz2) = e2ade1b4f4d26cfb77fb423b82b7eea1b51bbb4857b771acb845da3f3f99c846ec28a415eb184c7d79ffbe1edf21f026951778f905e23658d78deaebb1315759 +SHA512 (alsa-lib-1.2.7.2.tar.bz2) = 79e5920384e570a1acd8ecd1eb8812879333c3cedb1d15780080afc40125b97df893c33f4163d9dd863871b628bc6026265f8ace2c8634fc1af5b52b62ac9cfe +SHA512 (alsa-ucm-conf-1.2.7.2.tar.bz2) = b6866f1ca6a3f4d69d7923bc1107a64b49944a3a8756f129f39034e5390e08db1c295669e54dfe1437ca934cc11abf407f60fc8319f5cba3f021966e8654c2db SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 From 17a5a602622cc190657d5a69e1ba615b66d4804b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 20 Jul 2022 20:40:54 +0000 Subject: [PATCH 31/68] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- alsa-lib.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index de479e2..a8fc106 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Wed Jul 20 2022 Fedora Release Engineering - 1.2.7.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Fri Jul 8 2022 Jaroslav Kysela - 1.2.7.1-2 - update to 1.2.7.2 From 8362c2ece3232f65955e2bbbffbabd353e5995f7 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 24 Oct 2022 10:43:23 +0200 Subject: [PATCH 32/68] update to 1.2.8 Signed-off-by: Jaroslav Kysela --- alsa-lib.spec | 9 ++++++--- sources | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index a8fc106..b665d0f 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,14 +2,14 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.7.2 -%define version_alsa_ucm 1.2.7.2 +%define version_alsa_lib 1.2.8 +%define version_alsa_ucm 1.2.8 %define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 2%{?prever_dot}%{?dist} +Release: 1%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Mon Oct 24 2022 Jaroslav Kysela - 1.2.8-1 +- update to 1.2.8 + * Wed Jul 20 2022 Fedora Release Engineering - 1.2.7.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild diff --git a/sources b/sources index 9cdca5b..81824da 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.7.2.tar.bz2) = 79e5920384e570a1acd8ecd1eb8812879333c3cedb1d15780080afc40125b97df893c33f4163d9dd863871b628bc6026265f8ace2c8634fc1af5b52b62ac9cfe -SHA512 (alsa-ucm-conf-1.2.7.2.tar.bz2) = b6866f1ca6a3f4d69d7923bc1107a64b49944a3a8756f129f39034e5390e08db1c295669e54dfe1437ca934cc11abf407f60fc8319f5cba3f021966e8654c2db +SHA512 (alsa-lib-1.2.8.tar.bz2) = 865ff05a8f589996f8d63d43a91c961f1b64144f3e1d17c7074b7ac16f25b3fd1c371d46ed63a8cc20fa01e63c76b75f1a9802b56889ae1073854dd050d27688 +SHA512 (alsa-ucm-conf-1.2.8.tar.bz2) = a15a9ca52c108ee95a421b91f3fad4329f1e9fb1c004a40d5ff1a57d6701bad19a31d5a296426d26439be9b87d2d543ce51588a98402d24c17f0f92aaf1096ca SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 From f2b55673dfa966c7aec1331d4efe044fcf8b1a3b Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 7 Dec 2022 15:04:08 +0100 Subject: [PATCH 33/68] update alsa-lib and ucm conf to latest git BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2134824 Signed-off-by: Jaroslav Kysela --- alsa-git.patch | 1511 +++++++++++++++++++++++++++++++++++++++++++ alsa-lib.spec | 6 +- alsa-ucm-conf.patch | 1296 +++++++++++++++++++++++++++++++++++++ 3 files changed, 2812 insertions(+), 1 deletion(-) diff --git a/alsa-git.patch b/alsa-git.patch index e69de29..b023625 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -0,0 +1,1511 @@ +From 1b436862ed6253629d79edc2e09826efd4e0f4e3 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Nov 2022 15:01:56 +0100 +Subject: [PATCH 01/18] ucm: fix enhanced ID parsing in + snd_use_case_parse_ctl_elem_id() + +Reported-by: Takashi Iwai +Signed-off-by: Jaroslav Kysela +--- + src/ucm/main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ucm/main.c b/src/ucm/main.c +index 30ab1e41..28c60565 100644 +--- a/src/ucm/main.c ++++ b/src/ucm/main.c +@@ -2793,7 +2793,7 @@ int snd_use_case_parse_ctl_elem_id(snd_ctl_elem_id_t *dst, + strcmp(ucm_id, "CaptureSwitch")) + return -EINVAL; + snd_ctl_elem_id_clear(dst); +- if (strcasestr(ucm_id, "name=")) ++ if (strcasestr(value, "name=")) + return __snd_ctl_ascii_elem_id_parse(dst, value, NULL); + iface = SND_CTL_ELEM_IFACE_MIXER; + if (jack_control) +-- +2.38.1 + + +From aa4f56c3c952269c36464cc0da9db5a1381648fa Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 9 Nov 2022 08:11:42 +0100 +Subject: [PATCH 02/18] pcm: rate - fix the crash in + snd_pcm_rate_may_wait_for_avail_min() + +The pcm argument passed to the conversion function in +snd_pcm_plugin_may_wait_for_avail_min_conv() should be +pcm->fast_op_arg. + +Test command: arecord -Dplughw:x -r12000 -c2 -fS16_LE -M temp.wav + +Fixes: d9dbb57b ("pcm: rate - rewrite the may_wait_for_avail_min callback for the rate plugin") + +BugLink: https://lore.kernel.org/alsa-devel/1667793912-18957-1-git-send-email-shengjiu.wang@nxp.com/ +Fixes: https://github.com/alsa-project/alsa-lib/issues/282 +Reported-by: Shengjiu Wang +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_plugin.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c +index 6bb90b8b..ec64604c 100644 +--- a/src/pcm/pcm_plugin.c ++++ b/src/pcm/pcm_plugin.c +@@ -622,7 +622,7 @@ int snd_pcm_plugin_may_wait_for_avail_min_conv( + * This code is also used by extplug, but extplug does not allow to alter the sampling rate. + */ + if (conv) +- needed_slave_avail_min = conv(pcm, needed_slave_avail_min); ++ needed_slave_avail_min = conv(pcm->fast_op_arg, needed_slave_avail_min); + + if (slave->avail_min != needed_slave_avail_min) { + snd_pcm_sw_params_t *swparams; +-- +2.38.1 + + +From 39060852d810461dc8cd1464cfb2ffe84da42d56 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 9 Nov 2022 09:31:34 +0100 +Subject: [PATCH 03/18] pcm: rate - correct the previous fix for + snd_pcm_rate_may_wait_for_avail_min() + +The previous fix in aa4f56c3 was not correct. The root of the cause is +implementation in snd_pcm_may_wait_for_avail_min() inline function +where the improper pcm argument is passed to the fast_ops function. + +Fixes: aa4f56c3 ("pcm: rate - fix the crash in snd_pcm_rate_may_wait_for_avail_min()") +Fixes: d9dbb57b ("pcm: rate - rewrite the may_wait_for_avail_min callback for the rate plugin") +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm_local.h | 2 +- + src/pcm/pcm_plugin.c | 10 +++++++--- + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/src/pcm/pcm_local.h b/src/pcm/pcm_local.h +index 8d25971f..ae0c44bf 100644 +--- a/src/pcm/pcm_local.h ++++ b/src/pcm/pcm_local.h +@@ -1144,7 +1144,7 @@ static inline int snd_pcm_may_wait_for_avail_min(snd_pcm_t *pcm, snd_pcm_uframes + if (avail >= pcm->avail_min) + return 0; + if (pcm->fast_ops->may_wait_for_avail_min) +- return pcm->fast_ops->may_wait_for_avail_min(pcm, avail); ++ return pcm->fast_ops->may_wait_for_avail_min(pcm->fast_op_arg, avail); + return 1; + } + +diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c +index ec64604c..b3af1fb7 100644 +--- a/src/pcm/pcm_plugin.c ++++ b/src/pcm/pcm_plugin.c +@@ -597,8 +597,12 @@ int snd_pcm_plugin_may_wait_for_avail_min_conv( + * a) the slave can provide contineous hw_ptr between periods + * b) avail_min does not match one slave_period + */ +- snd_pcm_plugin_t *plugin = pcm->private_data; +- snd_pcm_t *slave = plugin->gen.slave; ++ snd_pcm_generic_t *generic = pcm->private_data; ++ /* ++ * do not use snd_pcm_plugin_t pointer here ++ * this code is used from the generic plugins, too ++ */ ++ snd_pcm_t *slave = generic->slave; + snd_pcm_uframes_t needed_slave_avail_min; + snd_pcm_sframes_t available; + +@@ -622,7 +626,7 @@ int snd_pcm_plugin_may_wait_for_avail_min_conv( + * This code is also used by extplug, but extplug does not allow to alter the sampling rate. + */ + if (conv) +- needed_slave_avail_min = conv(pcm->fast_op_arg, needed_slave_avail_min); ++ needed_slave_avail_min = conv(pcm, needed_slave_avail_min); + + if (slave->avail_min != needed_slave_avail_min) { + snd_pcm_sw_params_t *swparams; +-- +2.38.1 + + +From 161f47da5f196c291ac0e11d066fa5ff5f79fa04 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 9 Nov 2022 14:37:45 +0100 +Subject: [PATCH 04/18] include: pcm_old.h - use a macro for the symbol + versioning + +Make the header file more readable and error prone. + +Signed-off-by: Jaroslav Kysela +--- + include/pcm_old.h | 133 ++++++++++++++++++++++++---------------------- + 1 file changed, 68 insertions(+), 65 deletions(-) + +diff --git a/include/pcm_old.h b/include/pcm_old.h +index e6e050fc..a9f5308f 100644 +--- a/include/pcm_old.h ++++ b/include/pcm_old.h +@@ -2,11 +2,14 @@ + * Old ALSA 0.9.x API + */ + ++#define ___symbol_version(name, version) \ ++ __asm__ (".symver " #name "," #name "@" version) ++ + #ifdef ALSA_PCM_OLD_HW_PARAMS_API + +-asm(".symver snd_pcm_hw_params_get_access,snd_pcm_hw_params_get_access@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_access_first,snd_pcm_hw_params_set_access_first@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_access_last,snd_pcm_hw_params_set_access_last@ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_access, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_access_first, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_access_last, "ALSA_0.9"); + + int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params); + int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t val); +@@ -16,9 +19,9 @@ snd_pcm_access_t snd_pcm_hw_params_set_access_last(snd_pcm_t *pcm, snd_pcm_hw_pa + int snd_pcm_hw_params_set_access_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask); + void snd_pcm_hw_params_get_access_mask(snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask); + +-asm(".symver snd_pcm_hw_params_get_format,snd_pcm_hw_params_get_format@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_format_first,snd_pcm_hw_params_set_format_first@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_format_last,snd_pcm_hw_params_set_format_last@ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_format, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_format_first, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_format_last, "ALSA_0.9"); + + int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params); + int snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val); +@@ -28,9 +31,9 @@ snd_pcm_format_t snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_pa + int snd_pcm_hw_params_set_format_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask); + void snd_pcm_hw_params_get_format_mask(snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask); + +-asm(".symver snd_pcm_hw_params_get_subformat,snd_pcm_hw_params_get_subformat@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_subformat_first,snd_pcm_hw_params_set_subformat_first@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_subformat_last,snd_pcm_hw_params_set_subformat_last@ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_subformat, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_subformat_first, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_subformat_last, "ALSA_0.9"); + + int snd_pcm_hw_params_test_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t val); + int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params); +@@ -40,12 +43,12 @@ snd_pcm_subformat_t snd_pcm_hw_params_set_subformat_last(snd_pcm_t *pcm, snd_pcm + int snd_pcm_hw_params_set_subformat_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask); + void snd_pcm_hw_params_get_subformat_mask(snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask); + +-asm(".symver snd_pcm_hw_params_get_channels,snd_pcm_hw_params_get_channels@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_get_channels_min,snd_pcm_hw_params_get_channels_min@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_get_channels_max,snd_pcm_hw_params_get_channels_max@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_channels_near,snd_pcm_hw_params_set_channels_near@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_channels_first,snd_pcm_hw_params_set_channels_first@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_channels_last,snd_pcm_hw_params_set_channels_last@ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_channels, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_channels_min, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_channels_max, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_channels_near, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_channels_first, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_channels_last, "ALSA_0.9"); + + int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params); + unsigned int snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params); +@@ -59,12 +62,12 @@ unsigned int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_para + unsigned int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); + unsigned int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); + +-asm(".symver snd_pcm_hw_params_get_rate,snd_pcm_hw_params_get_rate@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_get_rate_min,snd_pcm_hw_params_get_rate_min@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_get_rate_max,snd_pcm_hw_params_get_rate_max@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_rate_near,snd_pcm_hw_params_set_rate_near@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_rate_first,snd_pcm_hw_params_set_rate_first@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_rate_last,snd_pcm_hw_params_set_rate_last@ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_rate, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_rate_min, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_rate_max, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_rate_near, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_rate_first, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_rate_last, "ALSA_0.9"); + + int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, int *dir); + unsigned int snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, int *dir); +@@ -80,12 +83,12 @@ unsigned int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t + int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val); + int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val); + +-asm(".symver snd_pcm_hw_params_get_period_time,snd_pcm_hw_params_get_period_time@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_get_period_time_min,snd_pcm_hw_params_get_period_time_min@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_get_period_time_max,snd_pcm_hw_params_get_period_time_max@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_period_time_near,snd_pcm_hw_params_set_period_time_near@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_period_time_first,snd_pcm_hw_params_set_period_time_first@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_period_time_last,snd_pcm_hw_params_set_period_time_last@ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_period_time, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_period_time_min, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_period_time_max, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_period_time_near, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_period_time_first, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_period_time_last, "ALSA_0.9"); + + int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, int *dir); + unsigned int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, int *dir); +@@ -99,12 +102,12 @@ unsigned int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_p + unsigned int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); + unsigned int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); + +-asm(".symver snd_pcm_hw_params_get_period_size,snd_pcm_hw_params_get_period_size@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_get_period_size_min,snd_pcm_hw_params_get_period_size_min@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_get_period_size_max,snd_pcm_hw_params_get_period_size_max@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_period_size_near,snd_pcm_hw_params_set_period_size_near@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_period_size_first,snd_pcm_hw_params_set_period_size_first@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_period_size_last,snd_pcm_hw_params_set_period_size_last@ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_period_size, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_period_size_min, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_period_size_max, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_period_size_near, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_period_size_first, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_period_size_last, "ALSA_0.9"); + + snd_pcm_sframes_t snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, int *dir); + snd_pcm_uframes_t snd_pcm_hw_params_get_period_size_min(const snd_pcm_hw_params_t *params, int *dir); +@@ -119,12 +122,12 @@ snd_pcm_uframes_t snd_pcm_hw_params_set_period_size_first(snd_pcm_t *pcm, snd_pc + snd_pcm_uframes_t snd_pcm_hw_params_set_period_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); + int snd_pcm_hw_params_set_period_size_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); + +-asm(".symver snd_pcm_hw_params_get_periods,snd_pcm_hw_params_get_periods@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_get_periods_min,snd_pcm_hw_params_get_periods_min@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_get_periods_max,snd_pcm_hw_params_get_periods_max@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_periods_near,snd_pcm_hw_params_set_periods_near@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_periods_first,snd_pcm_hw_params_set_periods_first@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_periods_last,snd_pcm_hw_params_set_periods_last@ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_periods, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_periods_min, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_periods_max, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_periods_near, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_periods_first, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_periods_last, "ALSA_0.9"); + + int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, int *dir); + unsigned int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, int *dir); +@@ -139,12 +142,12 @@ unsigned int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_para + unsigned int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); + int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); + +-asm(".symver snd_pcm_hw_params_get_buffer_time,snd_pcm_hw_params_get_buffer_time@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_get_buffer_time_min,snd_pcm_hw_params_get_buffer_time_min@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_get_buffer_time_max,snd_pcm_hw_params_get_buffer_time_max@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_buffer_time_near,snd_pcm_hw_params_set_buffer_time_near@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_buffer_time_first,snd_pcm_hw_params_set_buffer_time_first@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_buffer_time_last,snd_pcm_hw_params_set_buffer_time_last@ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_buffer_time, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_buffer_time_min, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_buffer_time_max, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_buffer_time_near, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_buffer_time_first, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_buffer_time_last, "ALSA_0.9"); + + int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, int *dir); + unsigned int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, int *dir); +@@ -158,12 +161,12 @@ unsigned int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_p + unsigned int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); + unsigned int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); + +-asm(".symver snd_pcm_hw_params_get_buffer_size,snd_pcm_hw_params_get_buffer_size@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_get_buffer_size_min,snd_pcm_hw_params_get_buffer_size_min@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_get_buffer_size_max,snd_pcm_hw_params_get_buffer_size_max@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_buffer_size_near,snd_pcm_hw_params_set_buffer_size_near@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_buffer_size_first,snd_pcm_hw_params_set_buffer_size_first@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_buffer_size_last,snd_pcm_hw_params_set_buffer_size_last@ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_buffer_size, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_buffer_size_min, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_buffer_size_max, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_buffer_size_near, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_buffer_size_first, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_buffer_size_last, "ALSA_0.9"); + + snd_pcm_sframes_t snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params); + snd_pcm_uframes_t snd_pcm_hw_params_get_buffer_size_min(const snd_pcm_hw_params_t *params); +@@ -177,12 +180,12 @@ snd_pcm_uframes_t snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm + snd_pcm_uframes_t snd_pcm_hw_params_set_buffer_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); + snd_pcm_uframes_t snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); + +-asm(".symver snd_pcm_hw_params_get_tick_time,snd_pcm_hw_params_get_tick_time@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_get_tick_time_min,snd_pcm_hw_params_get_tick_time_min@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_get_tick_time_max,snd_pcm_hw_params_get_tick_time_max@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_tick_time_near,snd_pcm_hw_params_set_tick_time_near@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_tick_time_first,snd_pcm_hw_params_set_tick_time_first@ALSA_0.9"); +-asm(".symver snd_pcm_hw_params_set_tick_time_last,snd_pcm_hw_params_set_tick_time_last@ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_tick_time, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_tick_time_min, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_get_tick_time_max, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_tick_time_near, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_tick_time_first, "ALSA_0.9"); ++___symbol_version(snd_pcm_hw_params_set_tick_time_last, "ALSA_0.9"); + + int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, int *dir); + unsigned int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, int *dir); +@@ -201,14 +204,14 @@ unsigned int snd_pcm_hw_params_set_tick_time_last(snd_pcm_t *pcm, snd_pcm_hw_par + + #ifdef ALSA_PCM_OLD_SW_PARAMS_API + +-asm(".symver snd_pcm_sw_params_get_tstamp_mode,snd_pcm_sw_params_get_tstamp_mode@ALSA_0.9"); +-asm(".symver snd_pcm_sw_params_get_sleep_min,snd_pcm_sw_params_get_sleep_min@ALSA_0.9"); +-asm(".symver snd_pcm_sw_params_get_avail_min,snd_pcm_sw_params_get_avail_min@ALSA_0.9"); +-asm(".symver snd_pcm_sw_params_get_xfer_align,snd_pcm_sw_params_get_xfer_align@ALSA_0.9"); +-asm(".symver snd_pcm_sw_params_get_start_threshold,snd_pcm_sw_params_get_start_threshold@ALSA_0.9"); +-asm(".symver snd_pcm_sw_params_get_stop_threshold,snd_pcm_sw_params_get_stop_threshold@ALSA_0.9"); +-asm(".symver snd_pcm_sw_params_get_silence_threshold,snd_pcm_sw_params_get_silence_threshold@ALSA_0.9"); +-asm(".symver snd_pcm_sw_params_get_silence_size,snd_pcm_sw_params_get_silence_size@ALSA_0.9"); ++___symbol_version(snd_pcm_sw_params_get_tstamp_mode, "ALSA_0.9"); ++___symbol_version(snd_pcm_sw_params_get_sleep_min, "ALSA_0.9"); ++___symbol_version(snd_pcm_sw_params_get_avail_min, "ALSA_0.9"); ++___symbol_version(snd_pcm_sw_params_get_xfer_align, "ALSA_0.9"); ++___symbol_version(snd_pcm_sw_params_get_start_threshold, "ALSA_0.9"); ++___symbol_version(snd_pcm_sw_params_get_stop_threshold, "ALSA_0.9"); ++___symbol_version(snd_pcm_sw_params_get_silence_threshold, "ALSA_0.9"); ++___symbol_version(snd_pcm_sw_params_get_silence_size, "ALSA_0.9"); + + int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val); + snd_pcm_tstamp_t snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params); +-- +2.38.1 + + +From 152983f01b0bc1178ea0d461ebf66e2d2a8e2e02 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 9 Nov 2022 15:04:06 +0100 +Subject: [PATCH 05/18] include: alsa-symbols.h - use newer gcc symver function + attribute + +Use the symver function attribute for newer gccs (version 11+). +The symver function attribute was introduced probably earlier +(gcc-10). We can fix that on demand later. + +Signed-off-by: Jaroslav Kysela +--- + include/alsa-symbols.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/include/alsa-symbols.h b/include/alsa-symbols.h +index 344f021a..f8c49103 100644 +--- a/include/alsa-symbols.h ++++ b/include/alsa-symbols.h +@@ -29,10 +29,17 @@ + #define INTERNAL_CONCAT2_2(Pre, Post) Pre##Post + #define INTERNAL(Name) INTERNAL_CONCAT2_2(__, Name) + ++#if __GNUC__ > 10 ++#define symbol_version(real, name, version) \ ++ extern __typeof (real) real __attribute__((symver (#name "@" #version))) ++#define default_symbol_version(real, name, version) \ ++ extern __typeof (real) real __attribute__((symver (#name "@@" #version))) ++#else + #define symbol_version(real, name, version) \ + __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@" #version) + #define default_symbol_version(real, name, version) \ + __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@@" #version) ++#endif + + #ifdef __clang__ + #define EXPORT_SYMBOL __attribute__((visibility("default"))) +-- +2.38.1 + + +From 78b20e3caa7bba930095e05f3f8cbe665204fcfd Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 14 Nov 2022 12:36:04 +0100 +Subject: [PATCH 06/18] test: latency - use snd_pcm_format_physical_width() + +We need to allocate frames using the physical size not +the sample bit size. + +Signed-off-by: Jaroslav Kysela +--- + src/topology/ctl.c | 7 ++++++- + test/latency.c | 6 +++--- + 2 files changed, 9 insertions(+), 4 deletions(-) + +diff --git a/src/topology/ctl.c b/src/topology/ctl.c +index dd05424d..2c500ffc 100644 +--- a/src/topology/ctl.c ++++ b/src/topology/ctl.c +@@ -17,9 +17,13 @@ + Liam Girdwood + */ + ++#define ALSA_PCM_OLD_HW_PARAMS_API 1 ++#define ALSA_PCM_OLD_SW_PARAMS_API 1 ++#include "../../include/asoundlib.h" + #include "list.h" + #include "tplg_local.h" + ++ + #define ENUM_VAL_SIZE (SNDRV_CTL_ELEM_ID_NAME_MAXLEN >> 2) + + struct ctl_access_elem { +@@ -71,7 +75,8 @@ static int parse_access_values(snd_config_t *cfg, + } + } + } +- ++ return snd_pcm_hw_params_get_channels(NULL); ++ //return snd_pcm_hw_params_get_access(NULL); + return 0; + } + +diff --git a/test/latency.c b/test/latency.c +index 298bab8a..95b3c0ee 100644 +--- a/test/latency.c ++++ b/test/latency.c +@@ -354,7 +354,7 @@ long readbuf(snd_pcm_t *handle, char *buf, long len, size_t *frames, size_t *max + } + // printf("read = %li\n", r); + } else { +- int frame_bytes = (snd_pcm_format_width(format) / 8) * channels; ++ int frame_bytes = (snd_pcm_format_physical_width(format) / 8) * channels; + do { + r = snd_pcm_readi(handle, buf, len); + if (r > 0) { +@@ -374,7 +374,7 @@ long readbuf(snd_pcm_t *handle, char *buf, long len, size_t *frames, size_t *max + long writebuf(snd_pcm_t *handle, char *buf, long len, size_t *frames) + { + long r; +- int frame_bytes = (snd_pcm_format_width(format) / 8) * channels; ++ int frame_bytes = (snd_pcm_format_physical_width(format) / 8) * channels; + + while (len > 0) { + r = snd_pcm_writei(handle, buf, len); +@@ -579,7 +579,7 @@ int main(int argc, char *argv[]) + + loop_limit = loop_sec * rate; + latency = latency_min - 4; +- buffer = malloc((latency_max * snd_pcm_format_width(format) / 8) * 2); ++ buffer = malloc((latency_max * snd_pcm_format_physical_width(format) / 8) * 2); + + setscheduler(); + +-- +2.38.1 + + +From 425e4d1fbea4965ea0fb7529b1ee6cbb47eb7227 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 14 Nov 2022 14:34:46 +0100 +Subject: [PATCH 07/18] pcm: fix the fast_ops pcm argument for fast_ops + +The fast_ops callback invocation must always pass the fast_op_arg +as the pcm argument. Plugins expect that. + +Signed-off-by: Jaroslav Kysela +--- + src/pcm/pcm.c | 4 ++-- + src/pcm/pcm_direct.c | 2 +- + src/pcm/pcm_hw.c | 2 +- + src/pcm/pcm_multi.c | 5 +++-- + 4 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c +index 927aa055..2b966d44 100644 +--- a/src/pcm/pcm.c ++++ b/src/pcm/pcm.c +@@ -1705,7 +1705,7 @@ int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2) + assert(pcm1); + assert(pcm2); + if (pcm1->fast_ops->link) +- err = pcm1->fast_ops->link(pcm1, pcm2); ++ err = pcm1->fast_ops->link(pcm1->fast_op_arg, pcm2); + else + err = -ENOSYS; + return err; +@@ -1722,7 +1722,7 @@ int snd_pcm_unlink(snd_pcm_t *pcm) + + assert(pcm); + if (pcm->fast_ops->unlink) +- err = pcm->fast_ops->unlink(pcm); ++ err = pcm->fast_ops->unlink(pcm->fast_op_arg); + else + err = -ENOSYS; + return err; +diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c +index 4803b81b..3cc5305f 100644 +--- a/src/pcm/pcm_direct.c ++++ b/src/pcm/pcm_direct.c +@@ -688,7 +688,7 @@ int snd_pcm_direct_check_xrun(snd_pcm_direct_t *direct, snd_pcm_t *pcm) + * so don't increment but just update to actual counter + */ + direct->recoveries = direct->shmptr->s.recoveries; +- pcm->fast_ops->drop(pcm); ++ pcm->fast_ops->drop(pcm->fast_op_arg); + /* trigger_tstamp update is missing in drop callbacks */ + gettimestamp(&direct->trigger_tstamp, pcm->tstamp_type); + /* no timer clear: +diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c +index 5dfe32ee..0588ce5e 100644 +--- a/src/pcm/pcm_hw.c ++++ b/src/pcm/pcm_hw.c +@@ -838,7 +838,7 @@ static int snd_pcm_hw_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2) + { + if (pcm2->type != SND_PCM_TYPE_HW) { + if (pcm2->fast_ops->link_slaves) +- return pcm2->fast_ops->link_slaves(pcm2, pcm1); ++ return pcm2->fast_ops->link_slaves(pcm2->fast_op_arg, pcm1); + return -ENOSYS; + } + return hw_link(pcm1, pcm2); +diff --git a/src/pcm/pcm_multi.c b/src/pcm/pcm_multi.c +index bec6d06f..3e7ce82c 100644 +--- a/src/pcm/pcm_multi.c ++++ b/src/pcm/pcm_multi.c +@@ -759,8 +759,9 @@ static int snd_pcm_multi_link_slaves(snd_pcm_t *pcm, snd_pcm_t *master) + static int snd_pcm_multi_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2) + { + snd_pcm_multi_t *multi = pcm1->private_data; +- if (multi->slaves[0].pcm->fast_ops->link) +- return multi->slaves[0].pcm->fast_ops->link(multi->slaves[0].pcm, pcm2); ++ snd_pcm_t *main_pcm = multi->slaves[0].pcm; ++ if (main_pcm->fast_ops->link) ++ return main_pcm->fast_ops->link(main_pcm->fast_op_arg, pcm2); + return -ENOSYS; + } + +-- +2.38.1 + + +From 3e4aeba25bf4a4808183c4b64270f7321b436c13 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 14 Nov 2022 20:42:10 +0100 +Subject: [PATCH 08/18] test: latency - add more realtime tests + +Add '-x' and '-X' tests and '-U' - I/O update mode based +on the system timing. + +It may be required to check the position updates for the specific hardware. +Print the real time / stream time differences. + +Also include code to make valgrind happy (including the wrong memory +llocation for the stream buffer). + +Signed-off-by: Jaroslav Kysela +--- + test/latency.c | 163 +++++++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 151 insertions(+), 12 deletions(-) + +diff --git a/test/latency.c b/test/latency.c +index 95b3c0ee..91bef1a1 100644 +--- a/test/latency.c ++++ b/test/latency.c +@@ -33,10 +33,13 @@ + #include + #include + #include ++#include + #include "../include/asoundlib.h" + #include + #include + ++typedef struct timespec timestamp_t; ++ + char *pdevice = "hw:0,0"; + char *cdevice = "hw:0,0"; + snd_pcm_format_t format = SND_PCM_FORMAT_S16_LE; +@@ -50,10 +53,40 @@ int loop_sec = 30; /* seconds */ + int block = 0; /* block mode */ + int use_poll = 0; + int resample = 1; ++int sys_latency = 0; /* data I/O: use system timings instead driver wakeups */ ++int pos_dump = 0; /* dump positions */ ++int realtime_check = 0; + unsigned long loop_limit; ++snd_pcm_uframes_t playback_buffer_size; + + snd_output_t *output = NULL; + ++static inline long long frames_to_micro(size_t frames) ++{ ++ return (long long)((frames * 1000000LL) + (rate / 2)) / rate; ++} ++ ++void timestamp_now(timestamp_t *tstamp) ++{ ++ if (clock_gettime(CLOCK_MONOTONIC_RAW, tstamp)) ++ printf("clock_gettime() failed\n"); ++} ++ ++long long timestamp_diff_micro(timestamp_t *tstamp) ++{ ++ timestamp_t now, diff; ++ timestamp_now(&now); ++ if (tstamp->tv_nsec > now.tv_nsec) { ++ diff.tv_sec = now.tv_sec - tstamp->tv_sec - 1; ++ diff.tv_nsec = (now.tv_nsec + 1000000000L) - tstamp->tv_nsec; ++ } else { ++ diff.tv_sec = now.tv_sec - tstamp->tv_sec; ++ diff.tv_nsec = now.tv_nsec - tstamp->tv_nsec; ++ } ++ /* microseconds */ ++ return (diff.tv_sec * 1000000) + ((diff.tv_nsec + 500L) / 1000L); ++} ++ + int setparams_stream(snd_pcm_t *handle, + snd_pcm_hw_params_t *params, + const char *id) +@@ -96,6 +129,14 @@ int setparams_stream(snd_pcm_t *handle, + printf("Rate doesn't match (requested %iHz, get %iHz)\n", rate, err); + return -EINVAL; + } ++ /* we do not want driver wakeups */ ++ if (sys_latency > 0 && snd_pcm_hw_params_can_disable_period_wakeup(params)) { ++ err = snd_pcm_hw_params_set_period_wakeup(handle, params, 0); ++ if (err < 0) { ++ printf("Cannot disable period wakeups for %s\n", id); ++ return err; ++ } ++ } + return 0; + } + +@@ -227,6 +268,7 @@ int setparams(snd_pcm_t *phandle, snd_pcm_t *chandle, int *bufsize) + goto __again; + + snd_pcm_hw_params_get_buffer_size(p_params, &p_size); ++ playback_buffer_size = p_size; + if (p_psize * 2 < p_size) { + snd_pcm_hw_params_get_periods_min(p_params, &val, NULL); + if (val > 2) { +@@ -390,7 +432,7 @@ long writebuf(snd_pcm_t *handle, char *buf, long len, size_t *frames) + } + return 0; + } +- ++ + #define FILTERSWEEP_LFO_CENTER 2000. + #define FILTERSWEEP_LFO_DEPTH 1800. + #define FILTERSWEEP_LFO_FREQ 0.2 +@@ -434,6 +476,19 @@ void applyeffect(char* buffer,int r) + } + } + ++static ssize_t get_avail(snd_pcm_t *pcm) ++{ ++ ssize_t avail; ++ ++ while (1) { ++ avail = snd_pcm_avail(pcm); ++ if (avail == -EAGAIN) ++ continue; ++ break; ++ } ++ return avail; ++} ++ + void help(void) + { + int k; +@@ -444,6 +499,7 @@ void help(void) + "-C,--cdevice capture device\n" + "-m,--min minimum latency in frames\n" + "-M,--max maximum latency in frames\n" ++"-U,--updates I/O updates in milliseconds (0 = off)\n" + "-F,--frames frames to transfer\n" + "-f,--format sample format\n" + "-c,--channels channels\n" +@@ -454,6 +510,8 @@ void help(void) + "-b,--block block mode\n" + "-p,--poll use poll (wait for event - reduces CPU usage)\n" + "-e,--effect apply an effect (bandpass filter sweep)\n" ++"-x,--posdump dump buffer positions\n" ++"-X,--realtime do a realtime check (buffering)\n" + ); + printf("Recognized sample formats are:"); + for (k = 0; k < SND_PCM_FORMAT_LAST; ++k) { +@@ -480,6 +538,7 @@ int main(int argc, char *argv[]) + {"cdevice", 1, NULL, 'C'}, + {"min", 1, NULL, 'm'}, + {"max", 1, NULL, 'M'}, ++ {"updates", 1, NULL, 'U'}, + {"frames", 1, NULL, 'F'}, + {"format", 1, NULL, 'f'}, + {"channels", 1, NULL, 'c'}, +@@ -490,20 +549,23 @@ int main(int argc, char *argv[]) + {"block", 0, NULL, 'b'}, + {"poll", 0, NULL, 'p'}, + {"effect", 0, NULL, 'e'}, ++ {"posdump", 0, NULL, 'x'}, ++ {"realtime", 0, NULL, 'X'}, + {NULL, 0, NULL, 0}, + }; + snd_pcm_t *phandle, *chandle; + char *buffer; + int err, latency, morehelp; +- int ok; ++ int ok, first_avail; + snd_timestamp_t p_tstamp, c_tstamp; +- ssize_t r; ++ ssize_t r, cap_avail, cap_avail_max, pbk_fill, pbk_fill_min; + size_t frames_in, frames_out, in_max; ++ timestamp_t tstamp_start; + int effect = 0; + morehelp = 0; + while (1) { + int c; +- if ((c = getopt_long(argc, argv, "hP:C:m:M:F:f:c:r:B:E:s:bpen", long_option, NULL)) < 0) ++ if ((c = getopt_long(argc, argv, "hP:C:m:M:U:F:f:c:r:B:E:s:bpenxX", long_option, NULL)) < 0) + break; + switch (c) { + case 'h': +@@ -525,6 +587,10 @@ int main(int argc, char *argv[]) + err = atoi(optarg) / 2; + latency_max = latency_min > err ? latency_min : err; + break; ++ case 'U': ++ err = atoi(optarg); ++ sys_latency = err <= 0 ? 0 : err; ++ break; + case 'f': + format = snd_pcm_format_value(optarg); + if (format == SND_PCM_FORMAT_UNKNOWN) { +@@ -564,6 +630,12 @@ int main(int argc, char *argv[]) + case 'n': + resample = 0; + break; ++ case 'x': ++ pos_dump = 1; ++ break; ++ case 'X': ++ realtime_check = 1; ++ break; + } + } + +@@ -579,15 +651,27 @@ int main(int argc, char *argv[]) + + loop_limit = loop_sec * rate; + latency = latency_min - 4; +- buffer = malloc((latency_max * snd_pcm_format_physical_width(format) / 8) * 2); ++ buffer = malloc((latency_max * 2 * snd_pcm_format_physical_width(format) / 8) * channels); ++ ++ /* I/O updates based on a system timer */ ++ if (sys_latency > 0) { ++ block = 0; ++ use_poll = 0; ++ } + + setscheduler(); + + printf("Playback device is %s\n", pdevice); + printf("Capture device is %s\n", cdevice); +- printf("Parameters are %iHz, %s, %i channels, %s mode\n", rate, snd_pcm_format_name(format), channels, block ? "blocking" : "non-blocking"); +- printf("Poll mode: %s\n", use_poll ? "yes" : "no"); +- printf("Loop limit is %lu frames, minimum latency = %i, maximum latency = %i\n", loop_limit, latency_min * 2, latency_max * 2); ++ printf("Parameters are %iHz, %s, %i channels, %s mode, use poll %s\n", ++ rate, snd_pcm_format_name(format), ++ channels, block ? "blocking" : "non-blocking", ++ use_poll ? "yes" : "no"); ++ printf("Loop limit is %lu frames, minimum latency = %i, maximum latency = %i", ++ loop_limit, latency_min * 2, latency_max * 2); ++ if (sys_latency > 0) ++ printf(", I/O updates %ims", sys_latency); ++ printf("\n"); + + if ((err = snd_pcm_open(&phandle, pdevice, SND_PCM_STREAM_PLAYBACK, block ? 0 : SND_PCM_NONBLOCK)) < 0) { + printf("Playback open error: %s\n", snd_strerror(err)); +@@ -613,6 +697,9 @@ int main(int argc, char *argv[]) + y[1] = (float*) malloc(channels*sizeof(float)); + y[2] = (float*) malloc(channels*sizeof(float)); + } ++ ++ cap_avail_max = 0; ++ pbk_fill_min = latency * 2; + + while (1) { + frames_in = frames_out = 0; +@@ -623,7 +710,7 @@ int main(int argc, char *argv[]) + printf("Streams link error: %s\n", snd_strerror(err)); + exit(0); + } +- if (snd_pcm_format_set_silence(format, buffer, latency*channels) < 0) { ++ if (snd_pcm_format_set_silence(format, buffer, latency * channels) < 0) { + fprintf(stderr, "silence error\n"); + break; + } +@@ -640,6 +727,8 @@ int main(int argc, char *argv[]) + printf("Go error: %s\n", snd_strerror(err)); + exit(0); + } ++ if (realtime_check) ++ timestamp_now(&tstamp_start); + gettimestamp(phandle, &p_tstamp); + gettimestamp(chandle, &c_tstamp); + #if 0 +@@ -651,16 +740,54 @@ int main(int argc, char *argv[]) + + ok = 1; + in_max = 0; ++ first_avail = 1; + while (ok && frames_in < loop_limit) { +- if (use_poll) { ++ cap_avail = latency; ++ if (sys_latency > 0) { ++ poll(NULL, 0, sys_latency); ++ cap_avail = get_avail(chandle); ++ if (cap_avail < 0) { ++ printf("Avail failed: %s\n", snd_strerror(cap_avail)); ++ ok = 0; ++ break; ++ } ++ if (first_avail && realtime_check) { ++ long long diff = timestamp_diff_micro(&tstamp_start); ++ long long pos = frames_to_micro(cap_avail); ++ printf("POS FIRST CHECK: c=%zd (rt=%lldus)\n", cap_avail, pos - diff); ++ first_avail = 0; ++ } ++ } else if (use_poll) { + /* use poll to wait for next event */ + snd_pcm_wait(chandle, 1000); + } +- if ((r = readbuf(chandle, buffer, latency, &frames_in, &in_max)) < 0) ++ if (pos_dump || realtime_check) { ++ if (sys_latency <= 0) ++ cap_avail = get_avail(chandle); ++ pbk_fill = get_avail(phandle); ++ if (pbk_fill >= 0) ++ pbk_fill = playback_buffer_size - pbk_fill; ++ if (cap_avail > cap_avail_max) ++ cap_avail_max = cap_avail; ++ if (pbk_fill >= 0 && pbk_fill < pbk_fill_min) ++ pbk_fill_min = pbk_fill; ++ if (realtime_check) { ++ long long diff = timestamp_diff_micro(&tstamp_start); ++ long long cap_pos = frames_to_micro(frames_in + cap_avail); ++ long long pbk_pos = frames_to_micro(frames_out - pbk_fill); ++ printf("POS: p=%zd (min=%zd, rt=%lldus) c=%zd (max=%zd, rt=%lldus)\n", ++ pbk_fill, pbk_fill_min, pbk_pos - diff, ++ cap_avail, cap_avail_max, cap_pos - diff); ++ } else if (pos_dump) { ++ printf("POS: p=%zd (min=%zd), c=%zd (max=%zd)\n", ++ pbk_fill, pbk_fill_min, cap_avail, cap_avail_max); ++ } ++ } ++ if ((r = readbuf(chandle, buffer, cap_avail, &frames_in, &in_max)) < 0) + ok = 0; + else { + if (effect) +- applyeffect(buffer,r); ++ applyeffect(buffer, r); + if (writebuf(phandle, buffer, r, &frames_out) < 0) + ok = 0; + } +@@ -677,6 +804,13 @@ int main(int argc, char *argv[]) + if (p_tstamp.tv_sec == c_tstamp.tv_sec && + p_tstamp.tv_usec == c_tstamp.tv_usec) + printf("Hardware sync\n"); ++ if (realtime_check) { ++ long long diff = timestamp_diff_micro(&tstamp_start); ++ long long mtime = frames_to_micro(frames_in); ++ printf("Elapsed real time: %lldus\n", diff); ++ printf("Elapsed device time: %lldus\n", mtime); ++ printf("Test time diff (device - real): %lldus\n", mtime - diff); ++ } + snd_pcm_drop(chandle); + snd_pcm_nonblock(phandle, 0); + snd_pcm_drain(phandle); +@@ -698,5 +832,10 @@ int main(int argc, char *argv[]) + } + snd_pcm_close(phandle); + snd_pcm_close(chandle); ++ snd_output_close(output); ++ snd_config_update_free_global(); ++ free(buffer); ++ free(pdevice); ++ free(cdevice); + return 0; + } +-- +2.38.1 + + +From a0836e2af1f2c37b66e723d8caf399e80b76825b Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 14 Nov 2022 21:26:39 +0100 +Subject: [PATCH 09/18] latency: add timestamps to the POS lines + +- remove first capture pos line +- measure the snd_pcm_start() call, too + +Signed-off-by: Jaroslav Kysela +--- + test/latency.c | 17 ++++++----------- + 1 file changed, 6 insertions(+), 11 deletions(-) + +diff --git a/test/latency.c b/test/latency.c +index 91bef1a1..3aff37c1 100644 +--- a/test/latency.c ++++ b/test/latency.c +@@ -556,7 +556,7 @@ int main(int argc, char *argv[]) + snd_pcm_t *phandle, *chandle; + char *buffer; + int err, latency, morehelp; +- int ok, first_avail; ++ int ok; + snd_timestamp_t p_tstamp, c_tstamp; + ssize_t r, cap_avail, cap_avail_max, pbk_fill, pbk_fill_min; + size_t frames_in, frames_out, in_max; +@@ -723,12 +723,14 @@ int main(int argc, char *argv[]) + break; + } + ++ if (realtime_check) ++ timestamp_now(&tstamp_start); + if ((err = snd_pcm_start(chandle)) < 0) { + printf("Go error: %s\n", snd_strerror(err)); + exit(0); + } + if (realtime_check) +- timestamp_now(&tstamp_start); ++ printf("[%lldus] Stream start\n", timestamp_diff_micro(&tstamp_start)); + gettimestamp(phandle, &p_tstamp); + gettimestamp(chandle, &c_tstamp); + #if 0 +@@ -740,7 +742,6 @@ int main(int argc, char *argv[]) + + ok = 1; + in_max = 0; +- first_avail = 1; + while (ok && frames_in < loop_limit) { + cap_avail = latency; + if (sys_latency > 0) { +@@ -751,12 +752,6 @@ int main(int argc, char *argv[]) + ok = 0; + break; + } +- if (first_avail && realtime_check) { +- long long diff = timestamp_diff_micro(&tstamp_start); +- long long pos = frames_to_micro(cap_avail); +- printf("POS FIRST CHECK: c=%zd (rt=%lldus)\n", cap_avail, pos - diff); +- first_avail = 0; +- } + } else if (use_poll) { + /* use poll to wait for next event */ + snd_pcm_wait(chandle, 1000); +@@ -775,8 +770,8 @@ int main(int argc, char *argv[]) + long long diff = timestamp_diff_micro(&tstamp_start); + long long cap_pos = frames_to_micro(frames_in + cap_avail); + long long pbk_pos = frames_to_micro(frames_out - pbk_fill); +- printf("POS: p=%zd (min=%zd, rt=%lldus) c=%zd (max=%zd, rt=%lldus)\n", +- pbk_fill, pbk_fill_min, pbk_pos - diff, ++ printf("[%lldus] POS: p=%zd (min=%zd, rt=%lldus) c=%zd (max=%zd, rt=%lldus)\n", ++ diff, pbk_fill, pbk_fill_min, pbk_pos - diff, + cap_avail, cap_avail_max, cap_pos - diff); + } else if (pos_dump) { + printf("POS: p=%zd (min=%zd), c=%zd (max=%zd)\n", +-- +2.38.1 + + +From 8b64f22459b6c55ec54f985f35ff701e18800616 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 15 Nov 2022 17:25:59 +0100 +Subject: [PATCH 10/18] ucm: clarify set_defaults calls + +- do full reset in snd_use_case_mgr_reload + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/main.c | 36 +++++++++++++++++++++++++----------- + 1 file changed, 25 insertions(+), 11 deletions(-) + +diff --git a/src/ucm/main.c b/src/ucm/main.c +index 28c60565..4f36648c 100644 +--- a/src/ucm/main.c ++++ b/src/ucm/main.c +@@ -998,13 +998,14 @@ static int add_auto_values(snd_use_case_mgr_t *uc_mgr) + /** + * \brief execute default commands + * \param uc_mgr Use case manager ++ * \param force Force run + * \return zero on success, otherwise a negative error code + */ +-static int set_defaults(snd_use_case_mgr_t *uc_mgr) ++static int set_defaults(snd_use_case_mgr_t *uc_mgr, bool force) + { + int err; + +- if (uc_mgr->default_list_executed) ++ if (!force && uc_mgr->default_list_executed) + return 0; + err = execute_sequence(uc_mgr, NULL, &uc_mgr->default_list, + &uc_mgr->value_list, NULL, NULL); +@@ -1351,7 +1352,7 @@ static int set_verb(snd_use_case_mgr_t *uc_mgr, + int err; + + if (enable) { +- err = set_defaults(uc_mgr); ++ err = set_defaults(uc_mgr, false); + if (err < 0) + return err; + seq = &verb->enable_list; +@@ -1435,6 +1436,22 @@ static int set_device(snd_use_case_mgr_t *uc_mgr, + return err; + } + ++/** ++ * \brief Do the full reset ++ * \param uc_mgr Use case manager ++ * \return zero on success, otherwise a negative error code ++ */ ++static int do_reset(snd_use_case_mgr_t *uc_mgr) ++{ ++ int err; ++ ++ err = set_defaults(uc_mgr, true); ++ INIT_LIST_HEAD(&uc_mgr->active_modifiers); ++ INIT_LIST_HEAD(&uc_mgr->active_devices); ++ uc_mgr->active_verb = NULL; ++ return err; ++} ++ + /** + * \brief Parse open arguments + * \param uc_mgr Use case manager +@@ -1569,6 +1586,8 @@ int snd_use_case_mgr_reload(snd_use_case_mgr_t *uc_mgr) + + pthread_mutex_lock(&uc_mgr->mutex); + ++ do_reset(uc_mgr); ++ + uc_mgr_free_verb(uc_mgr); + + uc_mgr->default_list_executed = 0; +@@ -1633,8 +1652,7 @@ static int dismantle_use_case(snd_use_case_mgr_t *uc_mgr) + } + uc_mgr->active_verb = NULL; + +- err = execute_sequence(uc_mgr, NULL, &uc_mgr->default_list, +- &uc_mgr->value_list, NULL, NULL); ++ err = set_defaults(uc_mgr, true); + + return err; + } +@@ -1649,11 +1667,7 @@ int snd_use_case_mgr_reset(snd_use_case_mgr_t *uc_mgr) + int err; + + pthread_mutex_lock(&uc_mgr->mutex); +- err = execute_sequence(uc_mgr, NULL, &uc_mgr->default_list, +- &uc_mgr->value_list, NULL, NULL); +- INIT_LIST_HEAD(&uc_mgr->active_modifiers); +- INIT_LIST_HEAD(&uc_mgr->active_devices); +- uc_mgr->active_verb = NULL; ++ err = do_reset(uc_mgr); + pthread_mutex_unlock(&uc_mgr->mutex); + return err; + } +@@ -2512,7 +2526,7 @@ static int set_defaults_user(snd_use_case_mgr_t *uc_mgr, + uc_error("error: wrong value for _defaults (%s)", value); + return -EINVAL; + } +- return set_defaults(uc_mgr); ++ return set_defaults(uc_mgr, false); + } + + static int handle_transition_verb(snd_use_case_mgr_t *uc_mgr, +-- +2.38.1 + + +From 9649b64c6f72984c53f469dad8dd4221d307e06d Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 22 Nov 2022 09:59:04 +0100 +Subject: [PATCH 11/18] ucm: handle empty string also for ${env:} substitution + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/ucm_subs.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/ucm/ucm_subs.c b/src/ucm/ucm_subs.c +index 2261bdc2..e62290ea 100644 +--- a/src/ucm/ucm_subs.c ++++ b/src/ucm/ucm_subs.c +@@ -490,7 +490,13 @@ static char *rval_env(snd_use_case_mgr_t *uc_mgr ATTRIBUTE_UNUSED, const char *i + { + char *e; + +- e = getenv(id); ++ if (*id == '-') { ++ e = getenv(id + 1); ++ if (e == NULL) ++ e = ""; ++ } else { ++ e = getenv(id); ++ } + if (e) + return strdup(e); + return NULL; +-- +2.38.1 + + +From f0f054517c05ff4ef7a1615851a686a3a202b9ff Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 23 Nov 2022 17:56:20 +0100 +Subject: [PATCH 12/18] test: latency - add -y option (I/O usleep) + +Signed-off-by: Jaroslav Kysela +--- + test/latency.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/test/latency.c b/test/latency.c +index 3aff37c1..161d1f68 100644 +--- a/test/latency.c ++++ b/test/latency.c +@@ -52,6 +52,7 @@ int latency_max = 2048; /* in frames / 2 */ + int loop_sec = 30; /* seconds */ + int block = 0; /* block mode */ + int use_poll = 0; ++int usleep_val = 0; + int resample = 1; + int sys_latency = 0; /* data I/O: use system timings instead driver wakeups */ + int pos_dump = 0; /* dump positions */ +@@ -509,6 +510,8 @@ void help(void) + "-s,--seconds duration of test in seconds\n" + "-b,--block block mode\n" + "-p,--poll use poll (wait for event - reduces CPU usage)\n" ++"-y,--usleep sleep for the specified amount of microseconds between\n" ++" stream updates (default 0 - off)\n" + "-e,--effect apply an effect (bandpass filter sweep)\n" + "-x,--posdump dump buffer positions\n" + "-X,--realtime do a realtime check (buffering)\n" +@@ -548,6 +551,7 @@ int main(int argc, char *argv[]) + {"seconds", 1, NULL, 's'}, + {"block", 0, NULL, 'b'}, + {"poll", 0, NULL, 'p'}, ++ {"usleep", 1, NULL, 'y'}, + {"effect", 0, NULL, 'e'}, + {"posdump", 0, NULL, 'x'}, + {"realtime", 0, NULL, 'X'}, +@@ -565,7 +569,7 @@ int main(int argc, char *argv[]) + morehelp = 0; + while (1) { + int c; +- if ((c = getopt_long(argc, argv, "hP:C:m:M:U:F:f:c:r:B:E:s:bpenxX", long_option, NULL)) < 0) ++ if ((c = getopt_long(argc, argv, "hP:C:m:M:U:F:f:c:r:B:E:s:y:bpenxX", long_option, NULL)) < 0) + break; + switch (c) { + case 'h': +@@ -624,6 +628,9 @@ int main(int argc, char *argv[]) + case 'p': + use_poll = 1; + break; ++ case 'y': ++ usleep_val = atoi(optarg); ++ break; + case 'e': + effect = 1; + break; +@@ -671,6 +678,8 @@ int main(int argc, char *argv[]) + loop_limit, latency_min * 2, latency_max * 2); + if (sys_latency > 0) + printf(", I/O updates %ims", sys_latency); ++ else if (!block) ++ printf(", I/O usleep %ius", usleep_val); + printf("\n"); + + if ((err = snd_pcm_open(&phandle, pdevice, SND_PCM_STREAM_PLAYBACK, block ? 0 : SND_PCM_NONBLOCK)) < 0) { +@@ -755,6 +764,8 @@ int main(int argc, char *argv[]) + } else if (use_poll) { + /* use poll to wait for next event */ + snd_pcm_wait(chandle, 1000); ++ } else if (usleep_val > 0) { ++ usleep(usleep_val); + } + if (pos_dump || realtime_check) { + if (sys_latency <= 0) +-- +2.38.1 + + +From 536c93928bc57d941a7cd146dbcbd62df0be2d83 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 23 Nov 2022 19:45:15 +0100 +Subject: [PATCH 13/18] test: latency - usleep should not be used in the block + mode + +Signed-off-by: Jaroslav Kysela +--- + test/latency.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/test/latency.c b/test/latency.c +index 161d1f68..1b4848d6 100644 +--- a/test/latency.c ++++ b/test/latency.c +@@ -678,7 +678,7 @@ int main(int argc, char *argv[]) + loop_limit, latency_min * 2, latency_max * 2); + if (sys_latency > 0) + printf(", I/O updates %ims", sys_latency); +- else if (!block) ++ else if (!block && !use_poll) + printf(", I/O usleep %ius", usleep_val); + printf("\n"); + +@@ -764,7 +764,7 @@ int main(int argc, char *argv[]) + } else if (use_poll) { + /* use poll to wait for next event */ + snd_pcm_wait(chandle, 1000); +- } else if (usleep_val > 0) { ++ } else if (!block && usleep_val > 0) { + usleep(usleep_val); + } + if (pos_dump || realtime_check) { +-- +2.38.1 + + +From ea0850f3f3780652869c2b4550576894bc21684f Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Thu, 24 Nov 2022 08:33:47 +0100 +Subject: [PATCH 14/18] test: latency - add --policy option to allow using + SCHED_FIFO + +Signed-off-by: Jaroslav Kysela +--- + test/latency.c | 22 +++++++++++++++++----- + 1 file changed, 17 insertions(+), 5 deletions(-) + +diff --git a/test/latency.c b/test/latency.c +index 1b4848d6..3b20e1c1 100644 +--- a/test/latency.c ++++ b/test/latency.c +@@ -40,6 +40,7 @@ + + typedef struct timespec timestamp_t; + ++char *sched_policy = "rr"; + char *pdevice = "hw:0,0"; + char *cdevice = "hw:0,0"; + snd_pcm_format_t format = SND_PCM_FORMAT_S16_LE; +@@ -354,18 +355,24 @@ void gettimestamp(snd_pcm_t *handle, snd_timestamp_t *timestamp) + void setscheduler(void) + { + struct sched_param sched_param; ++ int policy = SCHED_RR; ++ const char *spolicy = "Round Robin"; + ++ if (strcasecmp(sched_policy, "fifo") == 0) { ++ policy = SCHED_FIFO; ++ spolicy = "FIFO"; ++ } + if (sched_getparam(0, &sched_param) < 0) { + printf("Scheduler getparam failed...\n"); + return; + } +- sched_param.sched_priority = sched_get_priority_max(SCHED_RR); +- if (!sched_setscheduler(0, SCHED_RR, &sched_param)) { +- printf("Scheduler set to Round Robin with priority %i...\n", sched_param.sched_priority); ++ sched_param.sched_priority = sched_get_priority_max(policy); ++ if (!sched_setscheduler(0, policy, &sched_param)) { ++ printf("Scheduler set to %s with priority %i...\n", spolicy, sched_param.sched_priority); + fflush(stdout); + return; + } +- printf("!!!Scheduler set to Round Robin with priority %i FAILED!!!\n", sched_param.sched_priority); ++ printf("!!!Scheduler set to %s with priority %i FAILED!!!\n", spolicy, sched_param.sched_priority); + } + + long timediff(snd_timestamp_t t1, snd_timestamp_t t2) +@@ -515,6 +522,7 @@ void help(void) + "-e,--effect apply an effect (bandpass filter sweep)\n" + "-x,--posdump dump buffer positions\n" + "-X,--realtime do a realtime check (buffering)\n" ++"-O,--policy set scheduler policy (RR or FIFO)\n" + ); + printf("Recognized sample formats are:"); + for (k = 0; k < SND_PCM_FORMAT_LAST; ++k) { +@@ -555,6 +563,7 @@ int main(int argc, char *argv[]) + {"effect", 0, NULL, 'e'}, + {"posdump", 0, NULL, 'x'}, + {"realtime", 0, NULL, 'X'}, ++ {"policy", 1, NULL, 'O'}, + {NULL, 0, NULL, 0}, + }; + snd_pcm_t *phandle, *chandle; +@@ -569,7 +578,7 @@ int main(int argc, char *argv[]) + morehelp = 0; + while (1) { + int c; +- if ((c = getopt_long(argc, argv, "hP:C:m:M:U:F:f:c:r:B:E:s:y:bpenxX", long_option, NULL)) < 0) ++ if ((c = getopt_long(argc, argv, "hP:C:m:M:U:F:f:c:r:B:E:s:y:O:bpenxX", long_option, NULL)) < 0) + break; + switch (c) { + case 'h': +@@ -643,6 +652,9 @@ int main(int argc, char *argv[]) + case 'X': + realtime_check = 1; + break; ++ case 'O': ++ sched_policy = optarg; ++ break; + } + } + +-- +2.38.1 + + +From 75f8e2e73e03f628a4f2ba55ca8aa3e9f50cdbd9 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Thu, 24 Nov 2022 10:55:32 +0100 +Subject: [PATCH 15/18] test: latency - --policy option - allow using + SCHED_OTHER + +Signed-off-by: Jaroslav Kysela +--- + test/latency.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/test/latency.c b/test/latency.c +index 3b20e1c1..5e67015c 100644 +--- a/test/latency.c ++++ b/test/latency.c +@@ -361,6 +361,9 @@ void setscheduler(void) + if (strcasecmp(sched_policy, "fifo") == 0) { + policy = SCHED_FIFO; + spolicy = "FIFO"; ++ } else if (strcasecmp(sched_policy, "other") == 0) { ++ policy = SCHED_OTHER; ++ spolicy = "OTHER"; + } + if (sched_getparam(0, &sched_param) < 0) { + printf("Scheduler getparam failed...\n"); +@@ -522,7 +525,7 @@ void help(void) + "-e,--effect apply an effect (bandpass filter sweep)\n" + "-x,--posdump dump buffer positions\n" + "-X,--realtime do a realtime check (buffering)\n" +-"-O,--policy set scheduler policy (RR or FIFO)\n" ++"-O,--policy set scheduler policy (RR, FIFO or OTHER)\n" + ); + printf("Recognized sample formats are:"); + for (k = 0; k < SND_PCM_FORMAT_LAST; ++k) { +-- +2.38.1 + + +From d28e8cb29485cc93f741b01dc65893c798359963 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 29 Nov 2022 19:42:13 +0100 +Subject: [PATCH 16/18] topology: ctl - remove the wrong (debug) code + +This code was commited by mistake. It was used for testing +of ALSA_PCM_OLD_HW/SW_PARAMS_API. + +BugLink: https://github.com/thesofproject/sof/issues/6667 +Related-to: 78b20e3c ("test: latency - use snd_pcm_format_physical_width()") +Reported-by: Jaska Uimonen +Signed-off-by: Jaroslav Kysela +--- + src/topology/ctl.c | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/src/topology/ctl.c b/src/topology/ctl.c +index 2c500ffc..dd05424d 100644 +--- a/src/topology/ctl.c ++++ b/src/topology/ctl.c +@@ -17,13 +17,9 @@ + Liam Girdwood + */ + +-#define ALSA_PCM_OLD_HW_PARAMS_API 1 +-#define ALSA_PCM_OLD_SW_PARAMS_API 1 +-#include "../../include/asoundlib.h" + #include "list.h" + #include "tplg_local.h" + +- + #define ENUM_VAL_SIZE (SNDRV_CTL_ELEM_ID_NAME_MAXLEN >> 2) + + struct ctl_access_elem { +@@ -75,8 +71,7 @@ static int parse_access_values(snd_config_t *cfg, + } + } + } +- return snd_pcm_hw_params_get_channels(NULL); +- //return snd_pcm_hw_params_get_access(NULL); ++ + return 0; + } + +-- +2.38.1 + + +From e29413a2205099b2bffe584210d7a2b59f531f90 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 7 Dec 2022 14:49:48 +0100 +Subject: [PATCH 17/18] ucm: execute_sysw - fix possible use-after-free + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/main.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/ucm/main.c b/src/ucm/main.c +index 4f36648c..2ff4d3f3 100644 +--- a/src/ucm/main.c ++++ b/src/ucm/main.c +@@ -572,16 +572,17 @@ static int execute_sysw(const char *sysw) + wlen = write(fd, value, len); + myerrno = errno; + close(fd); +- free(s); + + if (ignore_error) +- return 0; ++ goto __end; + + if (wlen != (ssize_t)len) { + uc_error("unable to write '%s' to '%s': %s", value, path, strerror(myerrno)); + return -EINVAL; + } + ++__end: ++ free(s); + return 0; + } + +-- +2.38.1 + + +From 13e31fb1ecd5f666ffda09e87ef1aa53b4fae022 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 7 Dec 2022 14:54:30 +0100 +Subject: [PATCH 18/18] alsa-lib: conf - fix possible use-after-free in + get_char_skip_comments + +Signed-off-by: Jaroslav Kysela +--- + src/conf.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/conf.c b/src/conf.c +index eb38c344..65f2e1a7 100644 +--- a/src/conf.c ++++ b/src/conf.c +@@ -814,11 +814,12 @@ static int get_char_skip_comments(input_t *input) + closedir(dirp); + + err = add_include_path(input->current, str); +- free(str); + if (err < 0) { + SNDERR("Cannot add search dir %s", str); ++ free(str); + return err; + } ++ free(str); + continue; + } + +-- +2.38.1 + diff --git a/alsa-lib.spec b/alsa-lib.spec index b665d0f..4a2ed9d 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,10 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Wed Dec 7 2022 Jaroslav Kysela - 1.2.8-2 +- update lib code to latest git +- update ucm configs to latest git + * Mon Oct 24 2022 Jaroslav Kysela - 1.2.8-1 - update to 1.2.8 diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index e69de29..1bc6bae 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -0,0 +1,1296 @@ +From 2667378a6b9120d99e44f783ac4d247fb683d83c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= + +Date: Thu, 24 Mar 2022 18:13:45 -0400 +Subject: [PATCH 01/14] ucm2: Add support for MT8192 Asurada Spherion + Chromebook +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add support for the Acer Chromebook 514 CP514-2H, powered by MediaTek +Kompanio 820 (MT8192). This machine uses a MT6359 PMIC, with RT1015P as +speaker codec and RT5682 as headphone codec. + +Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/217 +Signed-off-by: Nícolas F. R. A. Prado +Signed-off-by: Jaroslav Kysela +--- + .../mt8192/mt6359-rt1015p-rt5682/HiFi.conf | 88 +++++++++++++++++++ + .../mt8192/mt6359-rt1015p-rt5682/init.conf | 24 +++++ + .../mt8192_mt6359_rt1015p_rt5682.conf | 11 +++ + .../mt8192_mt6359_rt1015p_rt5682.conf | 1 + + 4 files changed, 124 insertions(+) + create mode 100644 ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/HiFi.conf + create mode 100644 ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/init.conf + create mode 100644 ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/mt8192_mt6359_rt1015p_rt5682.conf + create mode 120000 ucm2/conf.d/mt8192_mt6359/mt8192_mt6359_rt1015p_rt5682.conf + +diff --git a/ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/HiFi.conf b/ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/HiFi.conf +new file mode 100644 +index 0000000..cf0d2c1 +--- /dev/null ++++ b/ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/HiFi.conf +@@ -0,0 +1,88 @@ ++SectionVerb { ++ EnableSequence [ ++ disdevall "" ++ ] ++ ++ Value { ++ TQ "HiFi" ++ } ++} ++ ++SectionDevice."Speaker" { ++ Comment "Speaker" ++ ++ EnableSequence [ ++ cset "name='Speakers Switch' 1" ++ ] ++ ++ DisableSequence [ ++ cset "name='Speakers Switch' 0" ++ ] ++ ++ Value { ++ PlaybackPCM "hw:${CardId},0" ++ PlaybackPriority 100 ++ } ++} ++ ++SectionDevice."Headphones" { ++ Comment "Headphones" ++ ++ EnableSequence [ ++ cset "name='Headphone Jack Switch' 1" ++ ] ++ ++ DisableSequence [ ++ cset "name='Headphone Jack Switch' 0" ++ ] ++ ++ Value { ++ PlaybackPCM "hw:${CardId},3" ++ JackControl "Headphone Jack" ++ PlaybackMixerElem "DAC1" ++ PlaybackPriority 200 ++ } ++} ++ ++SectionDevice."Mic" { ++ Comment "Internal Microphone" ++ ++ EnableSequence [ ++ cset "name='MTKAIF_DMIC Switch' 1" ++ ] ++ ++ DisableSequence [ ++ cset "name='MTKAIF_DMIC Switch' 0" ++ ] ++ ++ Value { ++ CapturePCM "hw:${CardId},10" ++ CapturePriority 100 ++ } ++} ++ ++SectionDevice."Headset" { ++ Comment "Headset Microphone" ++ ++ EnableSequence [ ++ cset "name='Headset Mic Switch' 1" ++ cset "name='STO1 ADC Capture Switch' 1" ++ cset "name='RECMIX1L CBJ Switch' 1" ++ cset "name='Stereo1 ADC MIXL ADC1 Switch' 1" ++ cset "name='Stereo1 ADC MIXR ADC1 Switch' 1" ++ ] ++ ++ DisableSequence [ ++ cset "name='STO1 ADC Capture Switch' 0" ++ cset "name='RECMIX1L CBJ Switch' 0" ++ cset "name='Stereo1 ADC MIXL ADC1 Switch' 0" ++ cset "name='Stereo1 ADC MIXR ADC1 Switch' 0" ++ cset "name='Headset Mic Switch' 0" ++ ] ++ ++ Value { ++ CapturePCM "hw:${CardId},11" ++ JackControl "Headset Mic Jack" ++ CapturePriority 200 ++ } ++} +diff --git a/ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/init.conf b/ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/init.conf +new file mode 100644 +index 0000000..b53178e +--- /dev/null ++++ b/ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/init.conf +@@ -0,0 +1,24 @@ ++BootSequence [ ++ # Speaker ++ cset "name='I2S3_CH1 DL1_CH1' 1" ++ cset "name='I2S3_CH2 DL1_CH2' 1" ++ cset "name='I2S3_HD_Mux' 1" ++ ++ # Headphone ++ cset "name='I2S9_CH1 DL3_CH1' 1" ++ cset "name='I2S9_CH2 DL3_CH2' 1" ++ cset "name='I2S9_HD_Mux' 1" ++ ++ # Internal Mic ++ cset "name='UL1_CH1 ADDA_UL_CH1' 1" ++ cset "name='UL1_CH2 ADDA_UL_CH2' 1" ++ cset "name='UL_SRC_MUX' DMIC" ++ ++ # Headset Mic ++ cset "name='UL2_CH1 I2S8_CH1' 1" ++ cset "name='UL2_CH2 I2S8_CH2' 1" ++ cset "name='I2S8_HD_Mux' 1" ++ cset "name='Stereo1 ADC L1 Mux' 1" ++ cset "name='Stereo1 ADC R1 Mux' 1" ++ cset "name='CBJ Boost Volume' 3" ++] +diff --git a/ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/mt8192_mt6359_rt1015p_rt5682.conf b/ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/mt8192_mt6359_rt1015p_rt5682.conf +new file mode 100644 +index 0000000..b4e124d +--- /dev/null ++++ b/ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/mt8192_mt6359_rt1015p_rt5682.conf +@@ -0,0 +1,11 @@ ++Comment "MT8192 MT6359 RT1015P RT5682 sound card" ++Syntax 4 ++ ++SectionUseCase."HiFi" { ++ File "HiFi.conf" ++ Comment "Default" ++} ++ ++Include.card-init.File "/lib/card-init.conf" ++Include.ctl-remap.File "/lib/ctl-remap.conf" ++Include.init.File "init.conf" +diff --git a/ucm2/conf.d/mt8192_mt6359/mt8192_mt6359_rt1015p_rt5682.conf b/ucm2/conf.d/mt8192_mt6359/mt8192_mt6359_rt1015p_rt5682.conf +new file mode 120000 +index 0000000..4425b19 +--- /dev/null ++++ b/ucm2/conf.d/mt8192_mt6359/mt8192_mt6359_rt1015p_rt5682.conf +@@ -0,0 +1 @@ ++../../MediaTek/mt8192/mt6359-rt1015p-rt5682/mt8192_mt6359_rt1015p_rt5682.conf +\ No newline at end of file +-- +2.38.1 + + +From 6dee56f11fbd48dd412179722a445416fcd779ef Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Sun, 6 Nov 2022 18:08:27 +0100 +Subject: [PATCH 02/14] ucm: USB-Audio - Add support for Focusrite Scarlett 2i2 + gen2 + +BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/234 +Signed-off-by: Jaroslav Kysela +--- + ...2-HiFi.conf => Scarlett-2i-gen2-HiFi.conf} | 45 +++++++++++-------- + .../USB-Audio/Focusrite/Scarlett-2i-gen2.conf | 22 +++++++++ + .../Focusrite/Scarlett-2i4-gen2.conf | 11 ----- + ucm2/USB-Audio/USB-Audio.conf | 10 ++--- + 4 files changed, 53 insertions(+), 35 deletions(-) + rename ucm2/USB-Audio/Focusrite/{Scarlett-2i4-gen2-HiFi.conf => Scarlett-2i-gen2-HiFi.conf} (65%) + create mode 100644 ucm2/USB-Audio/Focusrite/Scarlett-2i-gen2.conf + delete mode 100644 ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2.conf + +diff --git a/ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2-HiFi.conf b/ucm2/USB-Audio/Focusrite/Scarlett-2i-gen2-HiFi.conf +similarity index 65% +rename from ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2-HiFi.conf +rename to ucm2/USB-Audio/Focusrite/Scarlett-2i-gen2-HiFi.conf +index 5ee5076..ab69bc7 100644 +--- a/ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2-HiFi.conf ++++ b/ucm2/USB-Audio/Focusrite/Scarlett-2i-gen2-HiFi.conf +@@ -3,7 +3,7 @@ Include.pcm_split.File "/common/pcm/split.conf" + Macro [ + { + SplitPCM { +- Name "scarlett2i4_stereo_out" ++ Name "scarlett2i_stereo_out" + Direction Playback + Format S32_LE + Channels 2 +@@ -16,7 +16,7 @@ Macro [ + } + { + SplitPCM { +- Name "scarlett2i4_mono_in" ++ Name "scarlett2i_mono_in" + Direction Capture + Format S32_LE + Channels 1 +@@ -33,7 +33,7 @@ SectionDevice."Line1" { + PlaybackPriority 200 + } + Macro.pcm_split.SplitPCMDevice { +- Name "scarlett2i4_stereo_out" ++ Name "scarlett2i_stereo_out" + Direction Playback + HWChannels 4 + Channels 2 +@@ -44,21 +44,28 @@ SectionDevice."Line1" { + } + } + +-SectionDevice."Line2" { +- Comment "Line 3-4" +- +- Value { +- PlaybackPriority 100 ++If.scarlett_2i4 { ++ Condition { ++ Type String ++ String1 "${var:PlaybackChannels}" ++ String2 "4" + } +- Macro.pcm_split.SplitPCMDevice { +- Name "scarlett2i4_stereo_out" +- Direction Playback +- HWChannels 4 +- Channels 2 +- Channel0 2 +- Channel1 3 +- ChannelPos0 FL +- ChannelPos1 FR ++ True.SectionDevice."Line2" { ++ Comment "Line 3-4" ++ ++ Value { ++ PlaybackPriority 100 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "scarlett2i_stereo_out" ++ Direction Playback ++ HWChannels 4 ++ Channels 2 ++ Channel0 2 ++ Channel1 3 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } + } + } + +@@ -69,7 +76,7 @@ SectionDevice."Mic1" { + CapturePriority 200 + } + Macro.pcm_split.SplitPCMDevice { +- Name "scarlett2i4_mono_in" ++ Name "scarlett2i_mono_in" + Direction Capture + HWChannels 2 + Channels 1 +@@ -85,7 +92,7 @@ SectionDevice."Mic2" { + CapturePriority 100 + } + Macro.pcm_split.SplitPCMDevice { +- Name "scarlett2i4_mono_in" ++ Name "scarlett2i_mono_in" + Direction Capture + HWChannels 2 + Channels 1 +diff --git a/ucm2/USB-Audio/Focusrite/Scarlett-2i-gen2.conf b/ucm2/USB-Audio/Focusrite/Scarlett-2i-gen2.conf +new file mode 100644 +index 0000000..ee5b0b5 +--- /dev/null ++++ b/ucm2/USB-Audio/Focusrite/Scarlett-2i-gen2.conf +@@ -0,0 +1,22 @@ ++Define.PlaybackChannels 4 ++ ++If.scarlett_2i4 { ++ Condition { ++ Type String ++ Haystack "${CardComponents}" ++ Needle "USB1235:8202" ++ } ++ True.Define.PlaybackChannels 2 ++} ++ ++Comment "Focusrite Scarlett 2i${var:PlaybackChannels} Gen 2" ++ ++SectionUseCase."HiFi" { ++ Comment "Default" ++ File "/USB-Audio/Focusrite/Scarlett-2i-gen2-HiFi.conf" ++} ++ ++Define.DirectPlaybackChannels "${var:PlaybackChannels}" ++Define.DirectCaptureChannels 2 ++ ++Include.dhw.File "/common/direct.conf" +diff --git a/ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2.conf b/ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2.conf +deleted file mode 100644 +index ffc296d..0000000 +--- a/ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2.conf ++++ /dev/null +@@ -1,11 +0,0 @@ +-Comment "Focusrite Scarlett 2i4 Gen 2" +- +-SectionUseCase."HiFi" { +- Comment "Default" +- File "/USB-Audio/Focusrite/Scarlett-2i4-gen2-HiFi.conf" +-} +- +-Define.DirectPlaybackChannels 4 +-Define.DirectCaptureChannels 2 +- +-Include.dhw.File "/common/direct.conf" +diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf +index 90a88d4..3479ba1 100644 +--- a/ucm2/USB-Audio/USB-Audio.conf ++++ b/ucm2/USB-Audio/USB-Audio.conf +@@ -135,14 +135,14 @@ If.goxlr { + True.Define.ProfileName "GoXLR/GoXLR" + } + +-If.focusrite-scarlett-2i4-gen2 { ++If.focusrite-scarlett-2i-gen2 { + Condition { +- Type String +- Haystack "${CardComponents}" +- Needle "USB1235:8200" ++ Type RegexMatch ++ String "${CardComponents}" ++ Regex "USB1235:820[02]" + } + True.Define { +- ProfileName "Focusrite/Scarlett-2i4-gen2" ++ ProfileName "Focusrite/Scarlett-2i-gen2" + } + } + +-- +2.38.1 + + +From b50a903f488e3f6479001b603c1b42b2a9600882 Mon Sep 17 00:00:00 2001 +From: Manu Linares +Date: Sat, 5 Nov 2022 19:32:27 -0300 +Subject: [PATCH 04/14] ucm2: USB-Audio - Added Digidesign Mbox 3 support + +Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/237 +Signed-off-by: Manu Linares +Signed-off-by: Jaroslav Kysela +--- + .../Digidesign/Digidesign-Mbox-3-HiFi.conf | 126 ++++++++++++++++++ + .../Digidesign/Digidesign-Mbox-3.conf | 11 ++ + ucm2/USB-Audio/USB-Audio.conf | 9 ++ + 3 files changed, 146 insertions(+) + create mode 100644 ucm2/USB-Audio/Digidesign/Digidesign-Mbox-3-HiFi.conf + create mode 100644 ucm2/USB-Audio/Digidesign/Digidesign-Mbox-3.conf + +diff --git a/ucm2/USB-Audio/Digidesign/Digidesign-Mbox-3-HiFi.conf b/ucm2/USB-Audio/Digidesign/Digidesign-Mbox-3-HiFi.conf +new file mode 100644 +index 0000000..7219bea +--- /dev/null ++++ b/ucm2/USB-Audio/Digidesign/Digidesign-Mbox-3-HiFi.conf +@@ -0,0 +1,126 @@ ++Include.pcm_split.File "/common/pcm/split.conf" ++ ++Macro [ ++ { ++ SplitPCM { ++ Name "mbox3_stereo_out" ++ Direction Playback ++ Channels 2 ++ HWChannels 4 ++ HWChannelPos0 FL ++ HWChannelPos1 FR ++ HWChannelPos2 FL ++ HWChannelPos3 FR ++ } ++ } ++ { ++ SplitPCM { ++ Name "mbox3_stereo_in" ++ Direction Capture ++ Channels 2 ++ HWChannels 4 ++ HWChannelPos0 FL ++ HWChannelPos1 FR ++ HWChannelPos2 FL ++ HWChannelPos3 FR ++ } ++ } ++ { ++ SplitPCM { ++ Name "mbox3_mono_in" ++ Direction Capture ++ Channels 1 ++ HWChannels 4 ++ HWChannelPos0 MONO ++ HWChannelPos1 MONO ++ HWChannelPos2 MONO ++ HWChannelPos3 MONO ++ } ++ } ++] ++ ++SectionDevice."Line1" { ++ Comment "Main Output L/R" ++ ++ Value { ++ PlaybackPriority 300 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "mbox3_stereo_out" ++ Direction Playback ++ HWChannels 4 ++ Channels 2 ++ Channel0 0 ++ Channel1 1 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++ ++SectionDevice."line2SPDIF" { ++ Comment "SPDIF Out" ++ Value { ++ PlaybackPriority 100 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "mbox3_stereo_out" ++ Direction Playback ++ HWChannels 4 ++ Channels 2 ++ Channel0 2 ++ Channel1 3 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."mic1" { ++ Comment "Mic/Line 1" ++ ++ Value { ++ CapturePriority 300 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "mbox3_mono_in" ++ Direction Capture ++ HWChannels 4 ++ Channels 1 ++ Channel0 0 ++ ChannelPos0 MONO ++ } ++} ++ ++SectionDevice."mic2" { ++ Comment "Mic/Line 2" ++ ++ Value { ++ CapturePriority 200 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "mbox3_mono_in" ++ Direction Capture ++ HWChannels 4 ++ Channels 1 ++ Channel0 1 ++ ChannelPos0 MONO ++ } ++} ++ ++SectionDevice."mic3SPDIF" { ++ Comment "SPDIF In" ++ ++ Value { ++ CapturePriority 100 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "mbox3_stereo_in" ++ Direction Capture ++ HWChannels 4 ++ Channels 2 ++ Channel0 2 ++ Channel1 3 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} +diff --git a/ucm2/USB-Audio/Digidesign/Digidesign-Mbox-3.conf b/ucm2/USB-Audio/Digidesign/Digidesign-Mbox-3.conf +new file mode 100644 +index 0000000..d6e19f9 +--- /dev/null ++++ b/ucm2/USB-Audio/Digidesign/Digidesign-Mbox-3.conf +@@ -0,0 +1,11 @@ ++Comment "Digidesign Mbox 3" ++ ++SectionUseCase."Mixer" { ++ Comment "Stereo Duplex" ++ File "/USB-Audio/Digidesign/Digidesign-Mbox-3-HiFi.conf" ++} ++ ++Define.DirectPlaybackChannels 4 ++Define.DirectCaptureChannels 4 ++ ++Include.dhw.File "/common/direct.conf" +diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf +index 3479ba1..d1d70d8 100644 +--- a/ucm2/USB-Audio/USB-Audio.conf ++++ b/ucm2/USB-Audio/USB-Audio.conf +@@ -126,6 +126,15 @@ If.dell-desktop-rear { + True.Define.ProfileName "Dell/Desktop-Rear" + } + ++If.mbox3 { ++ Condition { ++ Type String ++ Haystack "${CardComponents}" ++ Needle "USB0dba:5000" ++ } ++ True.Define.ProfileName "Digidesign/Digidesign-Mbox-3" ++} ++ + If.goxlr { + Condition { + Type RegexMatch +-- +2.38.1 + + +From 88f232dffd54e1b9222ea76c7885445efebaa74d Mon Sep 17 00:00:00 2001 +From: "Ben Scholzen (DASPRiD)" +Date: Mon, 31 Oct 2022 17:41:02 +0100 +Subject: [PATCH 05/14] ucm2: Alc4080 - add support for ASUS ROG Strix Z790-E + Gaming Wifi + +Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/235 +Signed-off-by: Ben Scholzen (DASPRiD) +Signed-off-by: Jaroslav Kysela +--- + ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf | 2 +- + ucm2/USB-Audio/USB-Audio.conf | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf b/ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf +index 519f3b0..fa8d445 100644 +--- a/ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf ++++ b/ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf +@@ -68,7 +68,7 @@ If.spdif_dev2 { + Condition { + Type RegexMatch + String "${CardComponents}" +- Regex "USB(0b05:1996|0db0:1feb)" ++ Regex "USB(0b05:1996|0b05:1a52|0db0:1feb)" + } + True.Define.SpdifPCM "hw:${CardId},2" + } +diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf +index d1d70d8..e30dc2b 100644 +--- a/ucm2/USB-Audio/USB-Audio.conf ++++ b/ucm2/USB-Audio/USB-Audio.conf +@@ -41,6 +41,7 @@ If.realtek-alc4080 { + # 0b05:1a16 ASUS ROG Strix B660-F Gaming WiFi + # 0b05:1a20 ASUS ROG STRIX Z690-I Gaming Wifi + # 0b05:1a27 ALC4082 on ASUS ROG Maximus Z690 Hero ++ # 0b05:1a52 ASUS ROG Strix Z790-E Gaming Wifi + # 0db0:005a MSI MPG Z690 CARBON WIFI + # 0db0:151f MSI X570S EDGE MAX WIFI + # 0db0:1feb MSI Edge Wifi Z690 +@@ -50,7 +51,7 @@ If.realtek-alc4080 { + # 0db0:a47c MSI MEG X570S Ace Max + # 0db0:b202 MSI MAG Z690 Tomahawk Wifi + # 0db0:d6e7 MSI MPG X670E Carbon Wifi +- Regex "USB((0414:a00e)|(0b05:(1996|1a(16|2[07])))|(0db0:(005a|151f|1feb|419c|82c7|a073|a47c|b202|d6e7)))" ++ Regex "USB((0414:a00e)|(0b05:(1996|1a(16|2[07]|52)))|(0db0:(005a|151f|1feb|419c|82c7|a073|a47c|b202|d6e7)))" + } + True.Define.ProfileName "Realtek/ALC4080" + } +-- +2.38.1 + + +From b121b63f30c24e89beec506ae1d2bac9ebb3cc61 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 15 Nov 2022 17:49:13 +0100 +Subject: [PATCH 06/14] USB-Audio: ALC4080 - add 0db0:6cc9 MSI MPG Z590 Gaming + Plus device + +BugLink: https://github.com/alsa-project/alsa-ucm-conf/issues/241 +Signed-off-by: Jaroslav Kysela +--- + ucm2/USB-Audio/USB-Audio.conf | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf +index e30dc2b..89482cb 100644 +--- a/ucm2/USB-Audio/USB-Audio.conf ++++ b/ucm2/USB-Audio/USB-Audio.conf +@@ -46,12 +46,13 @@ If.realtek-alc4080 { + # 0db0:151f MSI X570S EDGE MAX WIFI + # 0db0:1feb MSI Edge Wifi Z690 + # 0db0:419c MSI MPG X570S Carbon Max Wifi ++ # 0db0:6cc9 MSI MPG Z590 Gaming Plus + # 0db0:82c7 MSI MEG Z690I Unify + # 0db0:a073 MSI MAG X570S Torpedo Max + # 0db0:a47c MSI MEG X570S Ace Max + # 0db0:b202 MSI MAG Z690 Tomahawk Wifi + # 0db0:d6e7 MSI MPG X670E Carbon Wifi +- Regex "USB((0414:a00e)|(0b05:(1996|1a(16|2[07]|52)))|(0db0:(005a|151f|1feb|419c|82c7|a073|a47c|b202|d6e7)))" ++ Regex "USB((0414:a00e)|(0b05:(1996|1a(16|2[07]|52)))|(0db0:(005a|151f|1feb|419c|6cc9|82c7|a073|a47c|b202|d6e7)))" + } + True.Define.ProfileName "Realtek/ALC4080" + } +-- +2.38.1 + + +From c82c400fb653292bbf0570e278d60e1ba14cc341 Mon Sep 17 00:00:00 2001 +From: Shuming Fan +Date: Wed, 16 Nov 2022 17:36:51 +0800 +Subject: [PATCH 07/14] ucm2: sof-soundwire: add basic settings for RT1318 SDCA + device + +Add support for rt1318 amplifier + +Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/242 +Signed-off-by: Shuming Fan +Signed-off-by: Jaroslav Kysela +--- + ucm2/sof-soundwire/rt1318-1.conf | 20 ++++++++++++++++++++ + ucm2/sof-soundwire/rt1318-2.conf | 25 +++++++++++++++++++++++++ + 2 files changed, 45 insertions(+) + create mode 100644 ucm2/sof-soundwire/rt1318-1.conf + create mode 100644 ucm2/sof-soundwire/rt1318-2.conf + +diff --git a/ucm2/sof-soundwire/rt1318-1.conf b/ucm2/sof-soundwire/rt1318-1.conf +new file mode 100644 +index 0000000..13d77e1 +--- /dev/null ++++ b/ucm2/sof-soundwire/rt1318-1.conf +@@ -0,0 +1,20 @@ ++# Use case Configuration for sof-soundwire card ++ ++SectionDevice."Speaker" { ++ Comment "Speaker" ++ ++ EnableSequence [ ++ cset "name='rt1318-1 DAC Switch' 1" ++ cset "name='Speaker Switch' on" ++ ] ++ ++ DisableSequence [ ++ cset "name='rt1318-1 DAC Switch' 0" ++ cset "name='Speaker Switch' off" ++ ] ++ ++ Value { ++ PlaybackPriority 100 ++ PlaybackPCM "hw:${CardId},2" ++ } ++} +diff --git a/ucm2/sof-soundwire/rt1318-2.conf b/ucm2/sof-soundwire/rt1318-2.conf +new file mode 100644 +index 0000000..5602470 +--- /dev/null ++++ b/ucm2/sof-soundwire/rt1318-2.conf +@@ -0,0 +1,25 @@ ++# Use case Configuration for sof-soundwire card ++ ++SectionDevice."Speaker" { ++ Comment "Speaker" ++ ++ EnableSequence [ ++ cset "name='rt1318-1 RX Channel Select' L,L" ++ cset "name='rt1318-2 RX Channel Select' R,R" ++ ++ cset "name='rt1318-1 DAC Switch' 1" ++ cset "name='rt1318-2 DAC Switch' 1" ++ cset "name='Speaker Switch' on" ++ ] ++ ++ DisableSequence [ ++ cset "name='rt1318-1 DAC Switch' 0" ++ cset "name='rt1318-2 DAC Switch' 0" ++ cset "name='Speaker Switch' off" ++ ] ++ ++ Value { ++ PlaybackPriority 100 ++ PlaybackPCM "hw:${CardId},2" ++ } ++} +-- +2.38.1 + + +From 998849d9510754960d808e20dad4c440adaf87ef Mon Sep 17 00:00:00 2001 +From: Clayton Craft +Date: Wed, 29 Jun 2022 15:23:23 -0700 +Subject: [PATCH 08/14] ucm2: add profile for the Librem 5 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/181 +Tested-by: Guido Günther +Signed-off-by: Jaroslav Kysela +--- + ucm2/NXP/iMX8/Librem_5/HiFi.conf | 151 ++++++++++++++++++++++++++ + ucm2/NXP/iMX8/Librem_5/Librem 5.conf | 25 +++++ + ucm2/conf.d/simple-card/Librem 5.conf | 1 + + 3 files changed, 177 insertions(+) + create mode 100644 ucm2/NXP/iMX8/Librem_5/HiFi.conf + create mode 100644 ucm2/NXP/iMX8/Librem_5/Librem 5.conf + create mode 120000 ucm2/conf.d/simple-card/Librem 5.conf + +diff --git a/ucm2/NXP/iMX8/Librem_5/HiFi.conf b/ucm2/NXP/iMX8/Librem_5/HiFi.conf +new file mode 100644 +index 0000000..55eabe3 +--- /dev/null ++++ b/ucm2/NXP/iMX8/Librem_5/HiFi.conf +@@ -0,0 +1,151 @@ ++SectionVerb { ++ EnableSequence [ ++ disdevall "" ++ ] ++ ++ Value.TQ "HiFi" ++} ++ ++SectionDevice."Handset" { ++ Comment "Handset" ++ ++ ConflictingDevice [ ++ "Headphones" ++ "Speaker" ++ ] ++ ++ EnableSequence [ ++ cset "name='Speaker Switch' off,on" ++ cset "name='DAC L/R Swap Switch' on" ++ cset "name='DAC Monomix Switch' on" ++ cset "name='SPKOUTR PGA' DAC" ++ cset "name='Speaker Boost Volume' 2" ++ ] ++ ++ DisableSequence [ ++ cset "name='Speaker Switch' off,off" ++ cset "name='DAC L/R Swap Switch' off" ++ cset "name='DAC Monomix Switch' off" ++ cset "name='SPKOUTR PGA' Mixer" ++ ] ++ ++ Value { ++ PlaybackPriority "100" ++ PlaybackVolume "name='Speaker Volume'" ++ PlaybackSwitch "name='Speaker Switch'" ++ PlaybackMixerElem "Speaker" ++ PlaybackPCM "hw:${CardId}" ++ } ++} ++ ++SectionDevice."Speaker" { ++ Comment "Speaker" ++ ++ ConflictingDevice [ ++ "Handset" ++ "Headphones" ++ ] ++ ++ EnableSequence [ ++ cset "name='Speaker Switch' on,off" ++ cset "name='DAC Monomix Switch' on" ++ cset "name='SPKOUTL PGA' DAC" ++ cset "name='Speaker Boost Volume' 6" ++ ] ++ ++ DisableSequence [ ++ cset "name='Speaker Switch' off,off" ++ cset "name='DAC Monomix Switch' off" ++ cset "name='SPKOUTL PGA' Mixer" ++ ] ++ ++ Value { ++ PlaybackPriority "500" ++ PlaybackVolume "name='Speaker Volume'" ++ PlaybackSwitch "name='Speaker Switch'" ++ PlaybackMixerElem "Speaker" ++ PlaybackPCM "hw:${CardId}" ++ } ++} ++ ++SectionDevice."Headphones" { ++ Comment "Headphones" ++ ++ ConflictingDevice [ ++ "Handset" ++ "Speaker" ++ ] ++ ++ EnableSequence [ ++ cset "name='Headphone Switch' on,on" ++ cset "name='HPOUTL PGA' 0 unmute" ++ cset "name='HPOUTR PGA' 0 unmute" ++ ] ++ ++ DisableSequence [ ++ cset "name='Headphone Switch' off off" ++ cset "name='HPOUTL PGA' 0 mute" ++ cset "name='HPOUTR PGA' 0 mute" ++ ] ++ ++ Value { ++ PlaybackPriority "1000" ++ PlaybackVolume "name='Headphone Volume'" ++ PlaybackSwitch "name='Headphone Switch'" ++ PlaybackMixerElem "Headphone" ++ PlaybackPCM "hw:${CardId}" ++ JackControl "Headphones Jack" ++ } ++} ++ ++SectionDevice."Mic" { ++ Comment "Internal Microphone" ++ ++ ConflictingDevice [ ++ "Headset" ++ ] ++ ++ EnableSequence [ ++ cset "name='ADC L/R Swap Switch' on" ++ cset "name='Input Mode' Digital" ++ ] ++ ++ DisableSequence [ ++ cset "name='ADC L/R Swap Switch' off" ++ ] ++ ++ Value { ++ CapturePriority "500" ++ CaptureVolume "name='Digital Capture Volume'" ++ CaptureMixerElem "Digital" ++ CapturePCM "hw:${CardId}" ++ } ++} ++ ++SectionDevice."Headset" { ++ Comment "Headset Microphone" ++ ++ ConflictingDevice [ ++ "Mic" ++ ] ++ ++ EnableSequence [ ++ cset "name='Input Mode' Analog" ++ cset "name='MIXINR PGA Switch' on,on" ++ cset "name='Capture Switch' on,on" ++ ] ++ ++ DisableSequence [ ++ cset "name='Capture Switch' off,off" ++ cset "name='MIXINR PGA Switch' off,off" ++ cset "name='Input Mode' Digital" ++ ] ++ ++ Value { ++ CapturePriority "100" ++ CaptureVolume "name='Capture Volume'" ++ CaptureMixerElem "Capture" ++ CapturePCM "hw:${CardId}" ++ JackControl "Headphones Jack" ++ } ++} +diff --git a/ucm2/NXP/iMX8/Librem_5/Librem 5.conf b/ucm2/NXP/iMX8/Librem_5/Librem 5.conf +new file mode 100644 +index 0000000..4d7dbd6 +--- /dev/null ++++ b/ucm2/NXP/iMX8/Librem_5/Librem 5.conf +@@ -0,0 +1,25 @@ ++Syntax 2 ++ ++SectionUseCase."HiFi" { ++ File "HiFi.conf" ++ Comment "Default" ++} ++ ++BootSequence [ ++ cset "name='Digital Playback Volume' 100,100" ++ cset "name='MIXINL IN2L Switch' off" ++ cset "name='MIXINL IN3L Switch' off" ++ cset "name='MIXINR IN2R Switch' off" ++ cset "name='MIXINR IN3R Switch' off" ++ cset "name='INPGAR IN1R Switch' off" ++ cset "name='INPGAR IN2R Switch' off" ++ cset "name='INPGAR IN3R Switch' on" ++ cset "name='INPGAR IN4R Switch' off" ++ cset "name='INPGAL IN1L Switch' off" ++ cset "name='INPGAL IN2L Switch' off" ++ cset "name='INPGAL IN3L Switch' off" ++ cset "name='INPGAL IN4L Switch' off" ++ cset "name='Input Mixer Switch' off,on" ++ cset "name='SPKOUTL PGA' Mixer" ++ cset "name='SPKOUTR PGA' Mixer" ++] +diff --git a/ucm2/conf.d/simple-card/Librem 5.conf b/ucm2/conf.d/simple-card/Librem 5.conf +new file mode 120000 +index 0000000..c687942 +--- /dev/null ++++ b/ucm2/conf.d/simple-card/Librem 5.conf +@@ -0,0 +1 @@ ++../../NXP/iMX8/Librem_5/Librem 5.conf +\ No newline at end of file +-- +2.38.1 + + +From 71ff24cdd2e0fecb71c2fcf8a45a1ae50233c34b Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 21 Nov 2022 09:51:54 +0100 +Subject: [PATCH 09/14] USB-Audio: allow to configure period size for PCM split +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The environment variable UCM_USB_PERIOD_TIME (microseconds / μs) +can define the period size for the PCM channel split over +the default value 10000μs. + +BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/240 +Fixes: https://github.com/alsa-project/alsa-ucm-conf/issues/238 +Signed-off-by: Jaroslav Kysela +--- + ucm2/USB-Audio/USB-Audio.conf | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf +index 89482cb..fdc29ec 100644 +--- a/ucm2/USB-Audio/USB-Audio.conf ++++ b/ucm2/USB-Audio/USB-Audio.conf +@@ -4,6 +4,14 @@ Define.ProfileName "" + Define.MixerRemap "" + Define.SplitPCMPeriodTime 10000 # 10ms + ++If.env1 { ++ Condition { ++ Type String ++ Empty "${env:UCM_USB_PERIOD_TIME}" ++ } ++ False.Define.SplitPCMPeriodTime "${env:UCM_USB_PERIOD_TIME}" ++} ++ + If.linked { + Condition { + Type RegexMatch +-- +2.38.1 + + +From 445c079665979802d50b237fe5a55be82ffd0bd9 Mon Sep 17 00:00:00 2001 +From: Fadwa Chiby +Date: Fri, 22 Jul 2022 09:45:07 +0000 +Subject: [PATCH 10/14] mt8195-demo: fix soundcard initialization + +The previous initialization in Bootsequence set all Switch +to off after boot. + +So remove the setting off of the Switch in the BootSequence +and define Enable/DisableSequence in verb section for +a proper setting. + +Note that the controls enable access to the PCM devices +(controls routes between Front End and Back End in ASoC). + +Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/211 +Signed-off-by: Fadwa Chiby +Signed-off-by: Jaroslav Kysela +--- + ucm2/MediaTek/mt8195_demo/HiFi.conf | 57 ++++++++++++++++++++++ + ucm2/MediaTek/mt8195_demo/mt8195_demo.conf | 36 ++++---------- + 2 files changed, 66 insertions(+), 27 deletions(-) + +diff --git a/ucm2/MediaTek/mt8195_demo/HiFi.conf b/ucm2/MediaTek/mt8195_demo/HiFi.conf +index 95f2b51..660b4ad 100644 +--- a/ucm2/MediaTek/mt8195_demo/HiFi.conf ++++ b/ucm2/MediaTek/mt8195_demo/HiFi.conf +@@ -1,3 +1,60 @@ ++SectionVerb { ++ ++ EnableSequence [ ++ cset "name='HDMI_OUT_MUX' Connect" ++ cset "name='DPTX_OUT_MUX' Connect" ++ cset "name='O176 I070 Switch' on" ++ cset "name='O177 I071 Switch' on" ++ cset "name='O034 I168 Switch' on" ++ cset "name='O035 I169 Switch' on" ++ cset "name='O036 I012 Switch' on" ++ cset "name='O037 I013 Switch' on" ++ cset "name='O072 I022 Switch' on" ++ cset "name='O073 I023 Switch' on" ++ cset "name='O074 I024 Switch' on" ++ cset "name='O075 I025 Switch' on" ++ cset "name='O076 I026 Switch' on" ++ cset "name='O077 I027 Switch' on" ++ cset "name='O078 I028 Switch' on" ++ cset "name='O079 I029 Switch' on" ++ cset "name='O002 I004 Switch' on" ++ cset "name='O003 I005 Switch' on" ++ cset "name='O004 I006 Switch' on" ++ cset "name='O005 I007 Switch' on" ++ cset "name='O006 I008 Switch' on" ++ cset "name='O007 I009 Switch' on" ++ cset "name='O008 I010 Switch' on" ++ cset "name='O009 I011 Switch' on" ++ ] ++ ++ DisableSequence [ ++ cset "name='HDMI_OUT_MUX' Disconnect" ++ cset "name='DPTX_OUT_MUX' Disconnect" ++ cset "name='O176 I070 Switch' off" ++ cset "name='O177 I071 Switch' off" ++ cset "name='O034 I168 Switch' off" ++ cset "name='O035 I169 Switch' off" ++ cset "name='O036 I012 Switch' off" ++ cset "name='O037 I013 Switch' off" ++ cset "name='O072 I022 Switch' off" ++ cset "name='O073 I023 Switch' off" ++ cset "name='O074 I024 Switch' off" ++ cset "name='O075 I025 Switch' off" ++ cset "name='O076 I026 Switch' off" ++ cset "name='O077 I027 Switch' off" ++ cset "name='O078 I028 Switch' off" ++ cset "name='O079 I029 Switch' off" ++ cset "name='O002 I004 Switch' off" ++ cset "name='O003 I005 Switch' off" ++ cset "name='O004 I006 Switch' off" ++ cset "name='O005 I007 Switch' off" ++ cset "name='O006 I008 Switch' off" ++ cset "name='O007 I009 Switch' off" ++ cset "name='O008 I010 Switch' off" ++ cset "name='O009 I011 Switch' off" ++ ] ++} ++ + SectionDevice."HDMI" { + Comment "Hdmi/DP output" + +diff --git a/ucm2/MediaTek/mt8195_demo/mt8195_demo.conf b/ucm2/MediaTek/mt8195_demo/mt8195_demo.conf +index c23dc37..896b6dc 100644 +--- a/ucm2/MediaTek/mt8195_demo/mt8195_demo.conf ++++ b/ucm2/MediaTek/mt8195_demo/mt8195_demo.conf +@@ -1,4 +1,4 @@ +-Syntax 3 ++Syntax 2 + + SectionUseCase."HiFi" { + File "/MediaTek/mt8195_demo/HiFi.conf" +@@ -16,12 +16,12 @@ BootSequence [ + cset "name='PGA_L_Mux' AIN1" + cset "name='HDMI_OUT_MUX' Connect" + cset "name='DPTX_OUT_MUX' Connect" ++ # we need to enable all devices before starting PA. ++ # In our driver we use PCM, which means that we have ++ # to route Front End to a BackEnd and then only we can ++ # open a device. Without linking to BE it will fail. + cset "name='O176 I070 Switch' on" + cset "name='O177 I071 Switch' on" +- cset "name='O034 I168 Switch' on" +- cset "name='O035 I169 Switch' on" +- cset "name='O036 I012 Switch' on" +- cset "name='O037 I013 Switch' on" + cset "name='O072 I022 Switch' on" + cset "name='O073 I023 Switch' on" + cset "name='O074 I024 Switch' on" +@@ -30,6 +30,10 @@ BootSequence [ + cset "name='O077 I027 Switch' on" + cset "name='O078 I028 Switch' on" + cset "name='O079 I029 Switch' on" ++ cset "name='O034 I168 Switch' on" ++ cset "name='O035 I169 Switch' on" ++ cset "name='O036 I012 Switch' on" ++ cset "name='O037 I013 Switch' on" + cset "name='O002 I004 Switch' on" + cset "name='O003 I005 Switch' on" + cset "name='O004 I006 Switch' on" +@@ -38,26 +42,4 @@ BootSequence [ + cset "name='O007 I009 Switch' on" + cset "name='O008 I010 Switch' on" + cset "name='O009 I011 Switch' on" +- cset "name='O176 I070 Switch' off" +- cset "name='O177 I071 Switch' off" +- cset "name='O034 I168 Switch' off" +- cset "name='O035 I169 Switch' off" +- cset "name='O036 I012 Switch' off" +- cset "name='O037 I013 Switch' off" +- cset "name='O072 I022 Switch' off" +- cset "name='O073 I023 Switch' off" +- cset "name='O074 I024 Switch' off" +- cset "name='O075 I025 Switch' off" +- cset "name='O076 I026 Switch' off" +- cset "name='O077 I027 Switch' off" +- cset "name='O078 I028 Switch' off" +- cset "name='O079 I029 Switch' off" +- cset "name='O002 I004 Switch' off" +- cset "name='O003 I005 Switch' off" +- cset "name='O004 I006 Switch' off" +- cset "name='O005 I007 Switch' off" +- cset "name='O006 I008 Switch' off" +- cset "name='O007 I009 Switch' off" +- cset "name='O008 I010 Switch' off" +- cset "name='O009 I011 Switch' off" + ] +-- +2.38.1 + + +From 5c865236e8de9fd75c741892fd3bd2cff62d4f3f Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 22 Nov 2022 09:54:22 +0100 +Subject: [PATCH 11/14] USB-Audio: the environment variable UCM_USB_PERIOD_TIME + may be undefined + +Fixes: 71ff24c ("USB-Audio: allow to configure period size for PCM split") +BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/240 +Signed-off-by: Jaroslav Kysela +--- + ucm2/USB-Audio/USB-Audio.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf +index fdc29ec..1c11da9 100644 +--- a/ucm2/USB-Audio/USB-Audio.conf ++++ b/ucm2/USB-Audio/USB-Audio.conf +@@ -7,7 +7,7 @@ Define.SplitPCMPeriodTime 10000 # 10ms + If.env1 { + Condition { + Type String +- Empty "${env:UCM_USB_PERIOD_TIME}" ++ Empty "$${env:UCM_USB_PERIOD_TIME}" + } + False.Define.SplitPCMPeriodTime "${env:UCM_USB_PERIOD_TIME}" + } +-- +2.38.1 + + +From 01e37f4fb7aab57e3f0051d81f5f6e5b2f15c831 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 21 Nov 2022 10:16:57 +0100 +Subject: [PATCH 12/14] HDA: DualCodecs - handle S/PDIF without analog + connections + +When no analog wires are connected, the S/PDIF output cannot be +selected in pipewire. Handle this for motherboards without Speaker +UCM device. + +Fixes: https://github.com/alsa-project/alsa-ucm-conf/issues/239 +Signed-off-by: Jaroslav Kysela +--- + ucm2/HDA/DualCodecs/HiFi.conf | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +diff --git a/ucm2/HDA/DualCodecs/HiFi.conf b/ucm2/HDA/DualCodecs/HiFi.conf +index 10c9162..8c0f403 100644 +--- a/ucm2/HDA/DualCodecs/HiFi.conf ++++ b/ucm2/HDA/DualCodecs/HiFi.conf +@@ -66,13 +66,20 @@ SectionDevice."Line1" { + } + True.Value.PlaybackMixerElem "Front" + } +- If.1 { ++ # make S/PDIF output working when no analog jacks are connected ++ If.speaker { + Condition { + Type ControlExists +- Control "iface=CARD,name='Line Out Front Jack'" ++ Control "name='Speaker Playback Switch'" ++ } ++ True.If.1 { ++ Condition { ++ Type ControlExists ++ Control "iface=CARD,name='Line Out Front Jack'" ++ } ++ True.Value.JackControl "Line Out Front Jack" ++ False.Value.JackControl "Line Out Jack" + } +- True.Value.JackControl "Line Out Front Jack" +- False.Value.JackControl "Line Out Jack" + } + } + +-- +2.38.1 + + +From 79a8ec44d3dcf097f4a4492c506cbcf338324175 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 7 Dec 2022 10:18:04 +0100 +Subject: [PATCH 13/14] ucm2: sof-hda-dsp: Update Mic LED settings + +Users expect to turn the LED on when only internal mic is off, but +it makes sense to turn this LED when all internal inputs are off. + +This configuration may be changed when the affected applications +are updated. + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2134824 +Signed-off-by: Jaroslav Kysela +--- + ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf b/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf +index e6a8a15..9e85914 100644 +--- a/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf ++++ b/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf +@@ -9,7 +9,17 @@ If.devdmic { + Haystack "${CardComponents}" + Needle "cfg-dmics:" + } +- True.Define.DeviceDmic "Mic1" ++ True { ++ Define.DeviceDmic "Mic1" ++ FixedBootSequence [ ++ # ++ # users expect to turn the LED on when only internal ++ # mic is off, but it makes sense to turn this LED ++ # when all internal inputs are off ++ # ++ sysw "-/class/sound/ctl-led/mic/card${CardNumber}/detach:Capture Switch" ++ ] ++ } + True.Define.DeviceMic "Mic2" + } + +-- +2.38.1 + + +From 9ce9ddb4a84fb467602b716575ea1d8f2bab0c39 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 7 Dec 2022 15:00:35 +0100 +Subject: [PATCH 14/14] ucm2: HDA: Update Mic LED settings for ACP DMIC + +Users expect to turn the LED on when only internal mic is off, but +it makes sense to turn this LED when all internal inputs are off. + +This configuration may be changed when the affected applications +are updated. + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2134824 +Signed-off-by: Jaroslav Kysela +--- + ucm2/HDA/HDA.conf | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/ucm2/HDA/HDA.conf b/ucm2/HDA/HDA.conf +index 64ffe83..47dfc05 100644 +--- a/ucm2/HDA/HDA.conf ++++ b/ucm2/HDA/HDA.conf +@@ -55,6 +55,7 @@ If.use { + cset-new "name='Mic ACP LED Capture Switch' type=bool,count=1 off" + exec "-/sbin/modprobe snd_ctl_led" + sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:Mic ACP LED Capture Switch" ++ sysw "-/class/sound/ctl-led/mic/card${CardNumber}/detach:Capture Switch" + ] + } + } +-- +2.38.1 + From 425def71d7620320e11a8f1f475e030412487d09 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 18 Jan 2023 21:37:36 +0000 Subject: [PATCH 34/68] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- alsa-lib.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 4a2ed9d..9d9250a 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -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: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Wed Jan 18 2023 Fedora Release Engineering - 1.2.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Wed Dec 7 2022 Jaroslav Kysela - 1.2.8-2 - update lib code to latest git - update ucm configs to latest git From d6f38125d0013482b14f48ff7c8575578053ce4f Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 4 May 2023 09:39:34 +0200 Subject: [PATCH 35/68] update to 1.2.9 Signed-off-by: Jaroslav Kysela --- alsa-git.patch | 1511 ------------------------------------------------ alsa-lib.spec | 9 +- sources | 4 +- 3 files changed, 8 insertions(+), 1516 deletions(-) diff --git a/alsa-git.patch b/alsa-git.patch index b023625..e69de29 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -1,1511 +0,0 @@ -From 1b436862ed6253629d79edc2e09826efd4e0f4e3 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 2 Nov 2022 15:01:56 +0100 -Subject: [PATCH 01/18] ucm: fix enhanced ID parsing in - snd_use_case_parse_ctl_elem_id() - -Reported-by: Takashi Iwai -Signed-off-by: Jaroslav Kysela ---- - src/ucm/main.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/ucm/main.c b/src/ucm/main.c -index 30ab1e41..28c60565 100644 ---- a/src/ucm/main.c -+++ b/src/ucm/main.c -@@ -2793,7 +2793,7 @@ int snd_use_case_parse_ctl_elem_id(snd_ctl_elem_id_t *dst, - strcmp(ucm_id, "CaptureSwitch")) - return -EINVAL; - snd_ctl_elem_id_clear(dst); -- if (strcasestr(ucm_id, "name=")) -+ if (strcasestr(value, "name=")) - return __snd_ctl_ascii_elem_id_parse(dst, value, NULL); - iface = SND_CTL_ELEM_IFACE_MIXER; - if (jack_control) --- -2.38.1 - - -From aa4f56c3c952269c36464cc0da9db5a1381648fa Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 9 Nov 2022 08:11:42 +0100 -Subject: [PATCH 02/18] pcm: rate - fix the crash in - snd_pcm_rate_may_wait_for_avail_min() - -The pcm argument passed to the conversion function in -snd_pcm_plugin_may_wait_for_avail_min_conv() should be -pcm->fast_op_arg. - -Test command: arecord -Dplughw:x -r12000 -c2 -fS16_LE -M temp.wav - -Fixes: d9dbb57b ("pcm: rate - rewrite the may_wait_for_avail_min callback for the rate plugin") - -BugLink: https://lore.kernel.org/alsa-devel/1667793912-18957-1-git-send-email-shengjiu.wang@nxp.com/ -Fixes: https://github.com/alsa-project/alsa-lib/issues/282 -Reported-by: Shengjiu Wang -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_plugin.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c -index 6bb90b8b..ec64604c 100644 ---- a/src/pcm/pcm_plugin.c -+++ b/src/pcm/pcm_plugin.c -@@ -622,7 +622,7 @@ int snd_pcm_plugin_may_wait_for_avail_min_conv( - * This code is also used by extplug, but extplug does not allow to alter the sampling rate. - */ - if (conv) -- needed_slave_avail_min = conv(pcm, needed_slave_avail_min); -+ needed_slave_avail_min = conv(pcm->fast_op_arg, needed_slave_avail_min); - - if (slave->avail_min != needed_slave_avail_min) { - snd_pcm_sw_params_t *swparams; --- -2.38.1 - - -From 39060852d810461dc8cd1464cfb2ffe84da42d56 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 9 Nov 2022 09:31:34 +0100 -Subject: [PATCH 03/18] pcm: rate - correct the previous fix for - snd_pcm_rate_may_wait_for_avail_min() - -The previous fix in aa4f56c3 was not correct. The root of the cause is -implementation in snd_pcm_may_wait_for_avail_min() inline function -where the improper pcm argument is passed to the fast_ops function. - -Fixes: aa4f56c3 ("pcm: rate - fix the crash in snd_pcm_rate_may_wait_for_avail_min()") -Fixes: d9dbb57b ("pcm: rate - rewrite the may_wait_for_avail_min callback for the rate plugin") -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm_local.h | 2 +- - src/pcm/pcm_plugin.c | 10 +++++++--- - 2 files changed, 8 insertions(+), 4 deletions(-) - -diff --git a/src/pcm/pcm_local.h b/src/pcm/pcm_local.h -index 8d25971f..ae0c44bf 100644 ---- a/src/pcm/pcm_local.h -+++ b/src/pcm/pcm_local.h -@@ -1144,7 +1144,7 @@ static inline int snd_pcm_may_wait_for_avail_min(snd_pcm_t *pcm, snd_pcm_uframes - if (avail >= pcm->avail_min) - return 0; - if (pcm->fast_ops->may_wait_for_avail_min) -- return pcm->fast_ops->may_wait_for_avail_min(pcm, avail); -+ return pcm->fast_ops->may_wait_for_avail_min(pcm->fast_op_arg, avail); - return 1; - } - -diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c -index ec64604c..b3af1fb7 100644 ---- a/src/pcm/pcm_plugin.c -+++ b/src/pcm/pcm_plugin.c -@@ -597,8 +597,12 @@ int snd_pcm_plugin_may_wait_for_avail_min_conv( - * a) the slave can provide contineous hw_ptr between periods - * b) avail_min does not match one slave_period - */ -- snd_pcm_plugin_t *plugin = pcm->private_data; -- snd_pcm_t *slave = plugin->gen.slave; -+ snd_pcm_generic_t *generic = pcm->private_data; -+ /* -+ * do not use snd_pcm_plugin_t pointer here -+ * this code is used from the generic plugins, too -+ */ -+ snd_pcm_t *slave = generic->slave; - snd_pcm_uframes_t needed_slave_avail_min; - snd_pcm_sframes_t available; - -@@ -622,7 +626,7 @@ int snd_pcm_plugin_may_wait_for_avail_min_conv( - * This code is also used by extplug, but extplug does not allow to alter the sampling rate. - */ - if (conv) -- needed_slave_avail_min = conv(pcm->fast_op_arg, needed_slave_avail_min); -+ needed_slave_avail_min = conv(pcm, needed_slave_avail_min); - - if (slave->avail_min != needed_slave_avail_min) { - snd_pcm_sw_params_t *swparams; --- -2.38.1 - - -From 161f47da5f196c291ac0e11d066fa5ff5f79fa04 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 9 Nov 2022 14:37:45 +0100 -Subject: [PATCH 04/18] include: pcm_old.h - use a macro for the symbol - versioning - -Make the header file more readable and error prone. - -Signed-off-by: Jaroslav Kysela ---- - include/pcm_old.h | 133 ++++++++++++++++++++++++---------------------- - 1 file changed, 68 insertions(+), 65 deletions(-) - -diff --git a/include/pcm_old.h b/include/pcm_old.h -index e6e050fc..a9f5308f 100644 ---- a/include/pcm_old.h -+++ b/include/pcm_old.h -@@ -2,11 +2,14 @@ - * Old ALSA 0.9.x API - */ - -+#define ___symbol_version(name, version) \ -+ __asm__ (".symver " #name "," #name "@" version) -+ - #ifdef ALSA_PCM_OLD_HW_PARAMS_API - --asm(".symver snd_pcm_hw_params_get_access,snd_pcm_hw_params_get_access@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_access_first,snd_pcm_hw_params_set_access_first@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_access_last,snd_pcm_hw_params_set_access_last@ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_access, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_access_first, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_access_last, "ALSA_0.9"); - - int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params); - int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t val); -@@ -16,9 +19,9 @@ snd_pcm_access_t snd_pcm_hw_params_set_access_last(snd_pcm_t *pcm, snd_pcm_hw_pa - int snd_pcm_hw_params_set_access_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask); - void snd_pcm_hw_params_get_access_mask(snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask); - --asm(".symver snd_pcm_hw_params_get_format,snd_pcm_hw_params_get_format@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_format_first,snd_pcm_hw_params_set_format_first@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_format_last,snd_pcm_hw_params_set_format_last@ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_format, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_format_first, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_format_last, "ALSA_0.9"); - - int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params); - int snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val); -@@ -28,9 +31,9 @@ snd_pcm_format_t snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_pa - int snd_pcm_hw_params_set_format_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask); - void snd_pcm_hw_params_get_format_mask(snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask); - --asm(".symver snd_pcm_hw_params_get_subformat,snd_pcm_hw_params_get_subformat@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_subformat_first,snd_pcm_hw_params_set_subformat_first@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_subformat_last,snd_pcm_hw_params_set_subformat_last@ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_subformat, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_subformat_first, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_subformat_last, "ALSA_0.9"); - - int snd_pcm_hw_params_test_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t val); - int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params); -@@ -40,12 +43,12 @@ snd_pcm_subformat_t snd_pcm_hw_params_set_subformat_last(snd_pcm_t *pcm, snd_pcm - int snd_pcm_hw_params_set_subformat_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask); - void snd_pcm_hw_params_get_subformat_mask(snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask); - --asm(".symver snd_pcm_hw_params_get_channels,snd_pcm_hw_params_get_channels@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_get_channels_min,snd_pcm_hw_params_get_channels_min@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_get_channels_max,snd_pcm_hw_params_get_channels_max@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_channels_near,snd_pcm_hw_params_set_channels_near@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_channels_first,snd_pcm_hw_params_set_channels_first@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_channels_last,snd_pcm_hw_params_set_channels_last@ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_channels, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_channels_min, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_channels_max, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_channels_near, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_channels_first, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_channels_last, "ALSA_0.9"); - - int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params); - unsigned int snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params); -@@ -59,12 +62,12 @@ unsigned int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_para - unsigned int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); - unsigned int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); - --asm(".symver snd_pcm_hw_params_get_rate,snd_pcm_hw_params_get_rate@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_get_rate_min,snd_pcm_hw_params_get_rate_min@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_get_rate_max,snd_pcm_hw_params_get_rate_max@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_rate_near,snd_pcm_hw_params_set_rate_near@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_rate_first,snd_pcm_hw_params_set_rate_first@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_rate_last,snd_pcm_hw_params_set_rate_last@ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_rate, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_rate_min, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_rate_max, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_rate_near, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_rate_first, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_rate_last, "ALSA_0.9"); - - int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, int *dir); - unsigned int snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, int *dir); -@@ -80,12 +83,12 @@ unsigned int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t - int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val); - int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val); - --asm(".symver snd_pcm_hw_params_get_period_time,snd_pcm_hw_params_get_period_time@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_get_period_time_min,snd_pcm_hw_params_get_period_time_min@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_get_period_time_max,snd_pcm_hw_params_get_period_time_max@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_period_time_near,snd_pcm_hw_params_set_period_time_near@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_period_time_first,snd_pcm_hw_params_set_period_time_first@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_period_time_last,snd_pcm_hw_params_set_period_time_last@ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_period_time, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_period_time_min, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_period_time_max, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_period_time_near, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_period_time_first, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_period_time_last, "ALSA_0.9"); - - int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, int *dir); - unsigned int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, int *dir); -@@ -99,12 +102,12 @@ unsigned int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_p - unsigned int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); - unsigned int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); - --asm(".symver snd_pcm_hw_params_get_period_size,snd_pcm_hw_params_get_period_size@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_get_period_size_min,snd_pcm_hw_params_get_period_size_min@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_get_period_size_max,snd_pcm_hw_params_get_period_size_max@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_period_size_near,snd_pcm_hw_params_set_period_size_near@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_period_size_first,snd_pcm_hw_params_set_period_size_first@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_period_size_last,snd_pcm_hw_params_set_period_size_last@ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_period_size, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_period_size_min, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_period_size_max, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_period_size_near, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_period_size_first, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_period_size_last, "ALSA_0.9"); - - snd_pcm_sframes_t snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, int *dir); - snd_pcm_uframes_t snd_pcm_hw_params_get_period_size_min(const snd_pcm_hw_params_t *params, int *dir); -@@ -119,12 +122,12 @@ snd_pcm_uframes_t snd_pcm_hw_params_set_period_size_first(snd_pcm_t *pcm, snd_pc - snd_pcm_uframes_t snd_pcm_hw_params_set_period_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); - int snd_pcm_hw_params_set_period_size_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); - --asm(".symver snd_pcm_hw_params_get_periods,snd_pcm_hw_params_get_periods@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_get_periods_min,snd_pcm_hw_params_get_periods_min@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_get_periods_max,snd_pcm_hw_params_get_periods_max@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_periods_near,snd_pcm_hw_params_set_periods_near@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_periods_first,snd_pcm_hw_params_set_periods_first@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_periods_last,snd_pcm_hw_params_set_periods_last@ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_periods, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_periods_min, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_periods_max, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_periods_near, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_periods_first, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_periods_last, "ALSA_0.9"); - - int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, int *dir); - unsigned int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, int *dir); -@@ -139,12 +142,12 @@ unsigned int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_para - unsigned int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); - int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); - --asm(".symver snd_pcm_hw_params_get_buffer_time,snd_pcm_hw_params_get_buffer_time@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_get_buffer_time_min,snd_pcm_hw_params_get_buffer_time_min@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_get_buffer_time_max,snd_pcm_hw_params_get_buffer_time_max@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_buffer_time_near,snd_pcm_hw_params_set_buffer_time_near@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_buffer_time_first,snd_pcm_hw_params_set_buffer_time_first@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_buffer_time_last,snd_pcm_hw_params_set_buffer_time_last@ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_buffer_time, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_buffer_time_min, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_buffer_time_max, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_buffer_time_near, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_buffer_time_first, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_buffer_time_last, "ALSA_0.9"); - - int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, int *dir); - unsigned int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, int *dir); -@@ -158,12 +161,12 @@ unsigned int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_p - unsigned int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); - unsigned int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); - --asm(".symver snd_pcm_hw_params_get_buffer_size,snd_pcm_hw_params_get_buffer_size@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_get_buffer_size_min,snd_pcm_hw_params_get_buffer_size_min@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_get_buffer_size_max,snd_pcm_hw_params_get_buffer_size_max@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_buffer_size_near,snd_pcm_hw_params_set_buffer_size_near@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_buffer_size_first,snd_pcm_hw_params_set_buffer_size_first@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_buffer_size_last,snd_pcm_hw_params_set_buffer_size_last@ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_buffer_size, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_buffer_size_min, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_buffer_size_max, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_buffer_size_near, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_buffer_size_first, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_buffer_size_last, "ALSA_0.9"); - - snd_pcm_sframes_t snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params); - snd_pcm_uframes_t snd_pcm_hw_params_get_buffer_size_min(const snd_pcm_hw_params_t *params); -@@ -177,12 +180,12 @@ snd_pcm_uframes_t snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm - snd_pcm_uframes_t snd_pcm_hw_params_set_buffer_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); - snd_pcm_uframes_t snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); - --asm(".symver snd_pcm_hw_params_get_tick_time,snd_pcm_hw_params_get_tick_time@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_get_tick_time_min,snd_pcm_hw_params_get_tick_time_min@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_get_tick_time_max,snd_pcm_hw_params_get_tick_time_max@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_tick_time_near,snd_pcm_hw_params_set_tick_time_near@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_tick_time_first,snd_pcm_hw_params_set_tick_time_first@ALSA_0.9"); --asm(".symver snd_pcm_hw_params_set_tick_time_last,snd_pcm_hw_params_set_tick_time_last@ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_tick_time, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_tick_time_min, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_get_tick_time_max, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_tick_time_near, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_tick_time_first, "ALSA_0.9"); -+___symbol_version(snd_pcm_hw_params_set_tick_time_last, "ALSA_0.9"); - - int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, int *dir); - unsigned int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, int *dir); -@@ -201,14 +204,14 @@ unsigned int snd_pcm_hw_params_set_tick_time_last(snd_pcm_t *pcm, snd_pcm_hw_par - - #ifdef ALSA_PCM_OLD_SW_PARAMS_API - --asm(".symver snd_pcm_sw_params_get_tstamp_mode,snd_pcm_sw_params_get_tstamp_mode@ALSA_0.9"); --asm(".symver snd_pcm_sw_params_get_sleep_min,snd_pcm_sw_params_get_sleep_min@ALSA_0.9"); --asm(".symver snd_pcm_sw_params_get_avail_min,snd_pcm_sw_params_get_avail_min@ALSA_0.9"); --asm(".symver snd_pcm_sw_params_get_xfer_align,snd_pcm_sw_params_get_xfer_align@ALSA_0.9"); --asm(".symver snd_pcm_sw_params_get_start_threshold,snd_pcm_sw_params_get_start_threshold@ALSA_0.9"); --asm(".symver snd_pcm_sw_params_get_stop_threshold,snd_pcm_sw_params_get_stop_threshold@ALSA_0.9"); --asm(".symver snd_pcm_sw_params_get_silence_threshold,snd_pcm_sw_params_get_silence_threshold@ALSA_0.9"); --asm(".symver snd_pcm_sw_params_get_silence_size,snd_pcm_sw_params_get_silence_size@ALSA_0.9"); -+___symbol_version(snd_pcm_sw_params_get_tstamp_mode, "ALSA_0.9"); -+___symbol_version(snd_pcm_sw_params_get_sleep_min, "ALSA_0.9"); -+___symbol_version(snd_pcm_sw_params_get_avail_min, "ALSA_0.9"); -+___symbol_version(snd_pcm_sw_params_get_xfer_align, "ALSA_0.9"); -+___symbol_version(snd_pcm_sw_params_get_start_threshold, "ALSA_0.9"); -+___symbol_version(snd_pcm_sw_params_get_stop_threshold, "ALSA_0.9"); -+___symbol_version(snd_pcm_sw_params_get_silence_threshold, "ALSA_0.9"); -+___symbol_version(snd_pcm_sw_params_get_silence_size, "ALSA_0.9"); - - int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val); - snd_pcm_tstamp_t snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params); --- -2.38.1 - - -From 152983f01b0bc1178ea0d461ebf66e2d2a8e2e02 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 9 Nov 2022 15:04:06 +0100 -Subject: [PATCH 05/18] include: alsa-symbols.h - use newer gcc symver function - attribute - -Use the symver function attribute for newer gccs (version 11+). -The symver function attribute was introduced probably earlier -(gcc-10). We can fix that on demand later. - -Signed-off-by: Jaroslav Kysela ---- - include/alsa-symbols.h | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/include/alsa-symbols.h b/include/alsa-symbols.h -index 344f021a..f8c49103 100644 ---- a/include/alsa-symbols.h -+++ b/include/alsa-symbols.h -@@ -29,10 +29,17 @@ - #define INTERNAL_CONCAT2_2(Pre, Post) Pre##Post - #define INTERNAL(Name) INTERNAL_CONCAT2_2(__, Name) - -+#if __GNUC__ > 10 -+#define symbol_version(real, name, version) \ -+ extern __typeof (real) real __attribute__((symver (#name "@" #version))) -+#define default_symbol_version(real, name, version) \ -+ extern __typeof (real) real __attribute__((symver (#name "@@" #version))) -+#else - #define symbol_version(real, name, version) \ - __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@" #version) - #define default_symbol_version(real, name, version) \ - __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@@" #version) -+#endif - - #ifdef __clang__ - #define EXPORT_SYMBOL __attribute__((visibility("default"))) --- -2.38.1 - - -From 78b20e3caa7bba930095e05f3f8cbe665204fcfd Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 14 Nov 2022 12:36:04 +0100 -Subject: [PATCH 06/18] test: latency - use snd_pcm_format_physical_width() - -We need to allocate frames using the physical size not -the sample bit size. - -Signed-off-by: Jaroslav Kysela ---- - src/topology/ctl.c | 7 ++++++- - test/latency.c | 6 +++--- - 2 files changed, 9 insertions(+), 4 deletions(-) - -diff --git a/src/topology/ctl.c b/src/topology/ctl.c -index dd05424d..2c500ffc 100644 ---- a/src/topology/ctl.c -+++ b/src/topology/ctl.c -@@ -17,9 +17,13 @@ - Liam Girdwood - */ - -+#define ALSA_PCM_OLD_HW_PARAMS_API 1 -+#define ALSA_PCM_OLD_SW_PARAMS_API 1 -+#include "../../include/asoundlib.h" - #include "list.h" - #include "tplg_local.h" - -+ - #define ENUM_VAL_SIZE (SNDRV_CTL_ELEM_ID_NAME_MAXLEN >> 2) - - struct ctl_access_elem { -@@ -71,7 +75,8 @@ static int parse_access_values(snd_config_t *cfg, - } - } - } -- -+ return snd_pcm_hw_params_get_channels(NULL); -+ //return snd_pcm_hw_params_get_access(NULL); - return 0; - } - -diff --git a/test/latency.c b/test/latency.c -index 298bab8a..95b3c0ee 100644 ---- a/test/latency.c -+++ b/test/latency.c -@@ -354,7 +354,7 @@ long readbuf(snd_pcm_t *handle, char *buf, long len, size_t *frames, size_t *max - } - // printf("read = %li\n", r); - } else { -- int frame_bytes = (snd_pcm_format_width(format) / 8) * channels; -+ int frame_bytes = (snd_pcm_format_physical_width(format) / 8) * channels; - do { - r = snd_pcm_readi(handle, buf, len); - if (r > 0) { -@@ -374,7 +374,7 @@ long readbuf(snd_pcm_t *handle, char *buf, long len, size_t *frames, size_t *max - long writebuf(snd_pcm_t *handle, char *buf, long len, size_t *frames) - { - long r; -- int frame_bytes = (snd_pcm_format_width(format) / 8) * channels; -+ int frame_bytes = (snd_pcm_format_physical_width(format) / 8) * channels; - - while (len > 0) { - r = snd_pcm_writei(handle, buf, len); -@@ -579,7 +579,7 @@ int main(int argc, char *argv[]) - - loop_limit = loop_sec * rate; - latency = latency_min - 4; -- buffer = malloc((latency_max * snd_pcm_format_width(format) / 8) * 2); -+ buffer = malloc((latency_max * snd_pcm_format_physical_width(format) / 8) * 2); - - setscheduler(); - --- -2.38.1 - - -From 425e4d1fbea4965ea0fb7529b1ee6cbb47eb7227 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 14 Nov 2022 14:34:46 +0100 -Subject: [PATCH 07/18] pcm: fix the fast_ops pcm argument for fast_ops - -The fast_ops callback invocation must always pass the fast_op_arg -as the pcm argument. Plugins expect that. - -Signed-off-by: Jaroslav Kysela ---- - src/pcm/pcm.c | 4 ++-- - src/pcm/pcm_direct.c | 2 +- - src/pcm/pcm_hw.c | 2 +- - src/pcm/pcm_multi.c | 5 +++-- - 4 files changed, 7 insertions(+), 6 deletions(-) - -diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c -index 927aa055..2b966d44 100644 ---- a/src/pcm/pcm.c -+++ b/src/pcm/pcm.c -@@ -1705,7 +1705,7 @@ int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2) - assert(pcm1); - assert(pcm2); - if (pcm1->fast_ops->link) -- err = pcm1->fast_ops->link(pcm1, pcm2); -+ err = pcm1->fast_ops->link(pcm1->fast_op_arg, pcm2); - else - err = -ENOSYS; - return err; -@@ -1722,7 +1722,7 @@ int snd_pcm_unlink(snd_pcm_t *pcm) - - assert(pcm); - if (pcm->fast_ops->unlink) -- err = pcm->fast_ops->unlink(pcm); -+ err = pcm->fast_ops->unlink(pcm->fast_op_arg); - else - err = -ENOSYS; - return err; -diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c -index 4803b81b..3cc5305f 100644 ---- a/src/pcm/pcm_direct.c -+++ b/src/pcm/pcm_direct.c -@@ -688,7 +688,7 @@ int snd_pcm_direct_check_xrun(snd_pcm_direct_t *direct, snd_pcm_t *pcm) - * so don't increment but just update to actual counter - */ - direct->recoveries = direct->shmptr->s.recoveries; -- pcm->fast_ops->drop(pcm); -+ pcm->fast_ops->drop(pcm->fast_op_arg); - /* trigger_tstamp update is missing in drop callbacks */ - gettimestamp(&direct->trigger_tstamp, pcm->tstamp_type); - /* no timer clear: -diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c -index 5dfe32ee..0588ce5e 100644 ---- a/src/pcm/pcm_hw.c -+++ b/src/pcm/pcm_hw.c -@@ -838,7 +838,7 @@ static int snd_pcm_hw_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2) - { - if (pcm2->type != SND_PCM_TYPE_HW) { - if (pcm2->fast_ops->link_slaves) -- return pcm2->fast_ops->link_slaves(pcm2, pcm1); -+ return pcm2->fast_ops->link_slaves(pcm2->fast_op_arg, pcm1); - return -ENOSYS; - } - return hw_link(pcm1, pcm2); -diff --git a/src/pcm/pcm_multi.c b/src/pcm/pcm_multi.c -index bec6d06f..3e7ce82c 100644 ---- a/src/pcm/pcm_multi.c -+++ b/src/pcm/pcm_multi.c -@@ -759,8 +759,9 @@ static int snd_pcm_multi_link_slaves(snd_pcm_t *pcm, snd_pcm_t *master) - static int snd_pcm_multi_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2) - { - snd_pcm_multi_t *multi = pcm1->private_data; -- if (multi->slaves[0].pcm->fast_ops->link) -- return multi->slaves[0].pcm->fast_ops->link(multi->slaves[0].pcm, pcm2); -+ snd_pcm_t *main_pcm = multi->slaves[0].pcm; -+ if (main_pcm->fast_ops->link) -+ return main_pcm->fast_ops->link(main_pcm->fast_op_arg, pcm2); - return -ENOSYS; - } - --- -2.38.1 - - -From 3e4aeba25bf4a4808183c4b64270f7321b436c13 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 14 Nov 2022 20:42:10 +0100 -Subject: [PATCH 08/18] test: latency - add more realtime tests - -Add '-x' and '-X' tests and '-U' - I/O update mode based -on the system timing. - -It may be required to check the position updates for the specific hardware. -Print the real time / stream time differences. - -Also include code to make valgrind happy (including the wrong memory -llocation for the stream buffer). - -Signed-off-by: Jaroslav Kysela ---- - test/latency.c | 163 +++++++++++++++++++++++++++++++++++++++++++++---- - 1 file changed, 151 insertions(+), 12 deletions(-) - -diff --git a/test/latency.c b/test/latency.c -index 95b3c0ee..91bef1a1 100644 ---- a/test/latency.c -+++ b/test/latency.c -@@ -33,10 +33,13 @@ - #include - #include - #include -+#include - #include "../include/asoundlib.h" - #include - #include - -+typedef struct timespec timestamp_t; -+ - char *pdevice = "hw:0,0"; - char *cdevice = "hw:0,0"; - snd_pcm_format_t format = SND_PCM_FORMAT_S16_LE; -@@ -50,10 +53,40 @@ int loop_sec = 30; /* seconds */ - int block = 0; /* block mode */ - int use_poll = 0; - int resample = 1; -+int sys_latency = 0; /* data I/O: use system timings instead driver wakeups */ -+int pos_dump = 0; /* dump positions */ -+int realtime_check = 0; - unsigned long loop_limit; -+snd_pcm_uframes_t playback_buffer_size; - - snd_output_t *output = NULL; - -+static inline long long frames_to_micro(size_t frames) -+{ -+ return (long long)((frames * 1000000LL) + (rate / 2)) / rate; -+} -+ -+void timestamp_now(timestamp_t *tstamp) -+{ -+ if (clock_gettime(CLOCK_MONOTONIC_RAW, tstamp)) -+ printf("clock_gettime() failed\n"); -+} -+ -+long long timestamp_diff_micro(timestamp_t *tstamp) -+{ -+ timestamp_t now, diff; -+ timestamp_now(&now); -+ if (tstamp->tv_nsec > now.tv_nsec) { -+ diff.tv_sec = now.tv_sec - tstamp->tv_sec - 1; -+ diff.tv_nsec = (now.tv_nsec + 1000000000L) - tstamp->tv_nsec; -+ } else { -+ diff.tv_sec = now.tv_sec - tstamp->tv_sec; -+ diff.tv_nsec = now.tv_nsec - tstamp->tv_nsec; -+ } -+ /* microseconds */ -+ return (diff.tv_sec * 1000000) + ((diff.tv_nsec + 500L) / 1000L); -+} -+ - int setparams_stream(snd_pcm_t *handle, - snd_pcm_hw_params_t *params, - const char *id) -@@ -96,6 +129,14 @@ int setparams_stream(snd_pcm_t *handle, - printf("Rate doesn't match (requested %iHz, get %iHz)\n", rate, err); - return -EINVAL; - } -+ /* we do not want driver wakeups */ -+ if (sys_latency > 0 && snd_pcm_hw_params_can_disable_period_wakeup(params)) { -+ err = snd_pcm_hw_params_set_period_wakeup(handle, params, 0); -+ if (err < 0) { -+ printf("Cannot disable period wakeups for %s\n", id); -+ return err; -+ } -+ } - return 0; - } - -@@ -227,6 +268,7 @@ int setparams(snd_pcm_t *phandle, snd_pcm_t *chandle, int *bufsize) - goto __again; - - snd_pcm_hw_params_get_buffer_size(p_params, &p_size); -+ playback_buffer_size = p_size; - if (p_psize * 2 < p_size) { - snd_pcm_hw_params_get_periods_min(p_params, &val, NULL); - if (val > 2) { -@@ -390,7 +432,7 @@ long writebuf(snd_pcm_t *handle, char *buf, long len, size_t *frames) - } - return 0; - } -- -+ - #define FILTERSWEEP_LFO_CENTER 2000. - #define FILTERSWEEP_LFO_DEPTH 1800. - #define FILTERSWEEP_LFO_FREQ 0.2 -@@ -434,6 +476,19 @@ void applyeffect(char* buffer,int r) - } - } - -+static ssize_t get_avail(snd_pcm_t *pcm) -+{ -+ ssize_t avail; -+ -+ while (1) { -+ avail = snd_pcm_avail(pcm); -+ if (avail == -EAGAIN) -+ continue; -+ break; -+ } -+ return avail; -+} -+ - void help(void) - { - int k; -@@ -444,6 +499,7 @@ void help(void) - "-C,--cdevice capture device\n" - "-m,--min minimum latency in frames\n" - "-M,--max maximum latency in frames\n" -+"-U,--updates I/O updates in milliseconds (0 = off)\n" - "-F,--frames frames to transfer\n" - "-f,--format sample format\n" - "-c,--channels channels\n" -@@ -454,6 +510,8 @@ void help(void) - "-b,--block block mode\n" - "-p,--poll use poll (wait for event - reduces CPU usage)\n" - "-e,--effect apply an effect (bandpass filter sweep)\n" -+"-x,--posdump dump buffer positions\n" -+"-X,--realtime do a realtime check (buffering)\n" - ); - printf("Recognized sample formats are:"); - for (k = 0; k < SND_PCM_FORMAT_LAST; ++k) { -@@ -480,6 +538,7 @@ int main(int argc, char *argv[]) - {"cdevice", 1, NULL, 'C'}, - {"min", 1, NULL, 'm'}, - {"max", 1, NULL, 'M'}, -+ {"updates", 1, NULL, 'U'}, - {"frames", 1, NULL, 'F'}, - {"format", 1, NULL, 'f'}, - {"channels", 1, NULL, 'c'}, -@@ -490,20 +549,23 @@ int main(int argc, char *argv[]) - {"block", 0, NULL, 'b'}, - {"poll", 0, NULL, 'p'}, - {"effect", 0, NULL, 'e'}, -+ {"posdump", 0, NULL, 'x'}, -+ {"realtime", 0, NULL, 'X'}, - {NULL, 0, NULL, 0}, - }; - snd_pcm_t *phandle, *chandle; - char *buffer; - int err, latency, morehelp; -- int ok; -+ int ok, first_avail; - snd_timestamp_t p_tstamp, c_tstamp; -- ssize_t r; -+ ssize_t r, cap_avail, cap_avail_max, pbk_fill, pbk_fill_min; - size_t frames_in, frames_out, in_max; -+ timestamp_t tstamp_start; - int effect = 0; - morehelp = 0; - while (1) { - int c; -- if ((c = getopt_long(argc, argv, "hP:C:m:M:F:f:c:r:B:E:s:bpen", long_option, NULL)) < 0) -+ if ((c = getopt_long(argc, argv, "hP:C:m:M:U:F:f:c:r:B:E:s:bpenxX", long_option, NULL)) < 0) - break; - switch (c) { - case 'h': -@@ -525,6 +587,10 @@ int main(int argc, char *argv[]) - err = atoi(optarg) / 2; - latency_max = latency_min > err ? latency_min : err; - break; -+ case 'U': -+ err = atoi(optarg); -+ sys_latency = err <= 0 ? 0 : err; -+ break; - case 'f': - format = snd_pcm_format_value(optarg); - if (format == SND_PCM_FORMAT_UNKNOWN) { -@@ -564,6 +630,12 @@ int main(int argc, char *argv[]) - case 'n': - resample = 0; - break; -+ case 'x': -+ pos_dump = 1; -+ break; -+ case 'X': -+ realtime_check = 1; -+ break; - } - } - -@@ -579,15 +651,27 @@ int main(int argc, char *argv[]) - - loop_limit = loop_sec * rate; - latency = latency_min - 4; -- buffer = malloc((latency_max * snd_pcm_format_physical_width(format) / 8) * 2); -+ buffer = malloc((latency_max * 2 * snd_pcm_format_physical_width(format) / 8) * channels); -+ -+ /* I/O updates based on a system timer */ -+ if (sys_latency > 0) { -+ block = 0; -+ use_poll = 0; -+ } - - setscheduler(); - - printf("Playback device is %s\n", pdevice); - printf("Capture device is %s\n", cdevice); -- printf("Parameters are %iHz, %s, %i channels, %s mode\n", rate, snd_pcm_format_name(format), channels, block ? "blocking" : "non-blocking"); -- printf("Poll mode: %s\n", use_poll ? "yes" : "no"); -- printf("Loop limit is %lu frames, minimum latency = %i, maximum latency = %i\n", loop_limit, latency_min * 2, latency_max * 2); -+ printf("Parameters are %iHz, %s, %i channels, %s mode, use poll %s\n", -+ rate, snd_pcm_format_name(format), -+ channels, block ? "blocking" : "non-blocking", -+ use_poll ? "yes" : "no"); -+ printf("Loop limit is %lu frames, minimum latency = %i, maximum latency = %i", -+ loop_limit, latency_min * 2, latency_max * 2); -+ if (sys_latency > 0) -+ printf(", I/O updates %ims", sys_latency); -+ printf("\n"); - - if ((err = snd_pcm_open(&phandle, pdevice, SND_PCM_STREAM_PLAYBACK, block ? 0 : SND_PCM_NONBLOCK)) < 0) { - printf("Playback open error: %s\n", snd_strerror(err)); -@@ -613,6 +697,9 @@ int main(int argc, char *argv[]) - y[1] = (float*) malloc(channels*sizeof(float)); - y[2] = (float*) malloc(channels*sizeof(float)); - } -+ -+ cap_avail_max = 0; -+ pbk_fill_min = latency * 2; - - while (1) { - frames_in = frames_out = 0; -@@ -623,7 +710,7 @@ int main(int argc, char *argv[]) - printf("Streams link error: %s\n", snd_strerror(err)); - exit(0); - } -- if (snd_pcm_format_set_silence(format, buffer, latency*channels) < 0) { -+ if (snd_pcm_format_set_silence(format, buffer, latency * channels) < 0) { - fprintf(stderr, "silence error\n"); - break; - } -@@ -640,6 +727,8 @@ int main(int argc, char *argv[]) - printf("Go error: %s\n", snd_strerror(err)); - exit(0); - } -+ if (realtime_check) -+ timestamp_now(&tstamp_start); - gettimestamp(phandle, &p_tstamp); - gettimestamp(chandle, &c_tstamp); - #if 0 -@@ -651,16 +740,54 @@ int main(int argc, char *argv[]) - - ok = 1; - in_max = 0; -+ first_avail = 1; - while (ok && frames_in < loop_limit) { -- if (use_poll) { -+ cap_avail = latency; -+ if (sys_latency > 0) { -+ poll(NULL, 0, sys_latency); -+ cap_avail = get_avail(chandle); -+ if (cap_avail < 0) { -+ printf("Avail failed: %s\n", snd_strerror(cap_avail)); -+ ok = 0; -+ break; -+ } -+ if (first_avail && realtime_check) { -+ long long diff = timestamp_diff_micro(&tstamp_start); -+ long long pos = frames_to_micro(cap_avail); -+ printf("POS FIRST CHECK: c=%zd (rt=%lldus)\n", cap_avail, pos - diff); -+ first_avail = 0; -+ } -+ } else if (use_poll) { - /* use poll to wait for next event */ - snd_pcm_wait(chandle, 1000); - } -- if ((r = readbuf(chandle, buffer, latency, &frames_in, &in_max)) < 0) -+ if (pos_dump || realtime_check) { -+ if (sys_latency <= 0) -+ cap_avail = get_avail(chandle); -+ pbk_fill = get_avail(phandle); -+ if (pbk_fill >= 0) -+ pbk_fill = playback_buffer_size - pbk_fill; -+ if (cap_avail > cap_avail_max) -+ cap_avail_max = cap_avail; -+ if (pbk_fill >= 0 && pbk_fill < pbk_fill_min) -+ pbk_fill_min = pbk_fill; -+ if (realtime_check) { -+ long long diff = timestamp_diff_micro(&tstamp_start); -+ long long cap_pos = frames_to_micro(frames_in + cap_avail); -+ long long pbk_pos = frames_to_micro(frames_out - pbk_fill); -+ printf("POS: p=%zd (min=%zd, rt=%lldus) c=%zd (max=%zd, rt=%lldus)\n", -+ pbk_fill, pbk_fill_min, pbk_pos - diff, -+ cap_avail, cap_avail_max, cap_pos - diff); -+ } else if (pos_dump) { -+ printf("POS: p=%zd (min=%zd), c=%zd (max=%zd)\n", -+ pbk_fill, pbk_fill_min, cap_avail, cap_avail_max); -+ } -+ } -+ if ((r = readbuf(chandle, buffer, cap_avail, &frames_in, &in_max)) < 0) - ok = 0; - else { - if (effect) -- applyeffect(buffer,r); -+ applyeffect(buffer, r); - if (writebuf(phandle, buffer, r, &frames_out) < 0) - ok = 0; - } -@@ -677,6 +804,13 @@ int main(int argc, char *argv[]) - if (p_tstamp.tv_sec == c_tstamp.tv_sec && - p_tstamp.tv_usec == c_tstamp.tv_usec) - printf("Hardware sync\n"); -+ if (realtime_check) { -+ long long diff = timestamp_diff_micro(&tstamp_start); -+ long long mtime = frames_to_micro(frames_in); -+ printf("Elapsed real time: %lldus\n", diff); -+ printf("Elapsed device time: %lldus\n", mtime); -+ printf("Test time diff (device - real): %lldus\n", mtime - diff); -+ } - snd_pcm_drop(chandle); - snd_pcm_nonblock(phandle, 0); - snd_pcm_drain(phandle); -@@ -698,5 +832,10 @@ int main(int argc, char *argv[]) - } - snd_pcm_close(phandle); - snd_pcm_close(chandle); -+ snd_output_close(output); -+ snd_config_update_free_global(); -+ free(buffer); -+ free(pdevice); -+ free(cdevice); - return 0; - } --- -2.38.1 - - -From a0836e2af1f2c37b66e723d8caf399e80b76825b Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 14 Nov 2022 21:26:39 +0100 -Subject: [PATCH 09/18] latency: add timestamps to the POS lines - -- remove first capture pos line -- measure the snd_pcm_start() call, too - -Signed-off-by: Jaroslav Kysela ---- - test/latency.c | 17 ++++++----------- - 1 file changed, 6 insertions(+), 11 deletions(-) - -diff --git a/test/latency.c b/test/latency.c -index 91bef1a1..3aff37c1 100644 ---- a/test/latency.c -+++ b/test/latency.c -@@ -556,7 +556,7 @@ int main(int argc, char *argv[]) - snd_pcm_t *phandle, *chandle; - char *buffer; - int err, latency, morehelp; -- int ok, first_avail; -+ int ok; - snd_timestamp_t p_tstamp, c_tstamp; - ssize_t r, cap_avail, cap_avail_max, pbk_fill, pbk_fill_min; - size_t frames_in, frames_out, in_max; -@@ -723,12 +723,14 @@ int main(int argc, char *argv[]) - break; - } - -+ if (realtime_check) -+ timestamp_now(&tstamp_start); - if ((err = snd_pcm_start(chandle)) < 0) { - printf("Go error: %s\n", snd_strerror(err)); - exit(0); - } - if (realtime_check) -- timestamp_now(&tstamp_start); -+ printf("[%lldus] Stream start\n", timestamp_diff_micro(&tstamp_start)); - gettimestamp(phandle, &p_tstamp); - gettimestamp(chandle, &c_tstamp); - #if 0 -@@ -740,7 +742,6 @@ int main(int argc, char *argv[]) - - ok = 1; - in_max = 0; -- first_avail = 1; - while (ok && frames_in < loop_limit) { - cap_avail = latency; - if (sys_latency > 0) { -@@ -751,12 +752,6 @@ int main(int argc, char *argv[]) - ok = 0; - break; - } -- if (first_avail && realtime_check) { -- long long diff = timestamp_diff_micro(&tstamp_start); -- long long pos = frames_to_micro(cap_avail); -- printf("POS FIRST CHECK: c=%zd (rt=%lldus)\n", cap_avail, pos - diff); -- first_avail = 0; -- } - } else if (use_poll) { - /* use poll to wait for next event */ - snd_pcm_wait(chandle, 1000); -@@ -775,8 +770,8 @@ int main(int argc, char *argv[]) - long long diff = timestamp_diff_micro(&tstamp_start); - long long cap_pos = frames_to_micro(frames_in + cap_avail); - long long pbk_pos = frames_to_micro(frames_out - pbk_fill); -- printf("POS: p=%zd (min=%zd, rt=%lldus) c=%zd (max=%zd, rt=%lldus)\n", -- pbk_fill, pbk_fill_min, pbk_pos - diff, -+ printf("[%lldus] POS: p=%zd (min=%zd, rt=%lldus) c=%zd (max=%zd, rt=%lldus)\n", -+ diff, pbk_fill, pbk_fill_min, pbk_pos - diff, - cap_avail, cap_avail_max, cap_pos - diff); - } else if (pos_dump) { - printf("POS: p=%zd (min=%zd), c=%zd (max=%zd)\n", --- -2.38.1 - - -From 8b64f22459b6c55ec54f985f35ff701e18800616 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 15 Nov 2022 17:25:59 +0100 -Subject: [PATCH 10/18] ucm: clarify set_defaults calls - -- do full reset in snd_use_case_mgr_reload - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/main.c | 36 +++++++++++++++++++++++++----------- - 1 file changed, 25 insertions(+), 11 deletions(-) - -diff --git a/src/ucm/main.c b/src/ucm/main.c -index 28c60565..4f36648c 100644 ---- a/src/ucm/main.c -+++ b/src/ucm/main.c -@@ -998,13 +998,14 @@ static int add_auto_values(snd_use_case_mgr_t *uc_mgr) - /** - * \brief execute default commands - * \param uc_mgr Use case manager -+ * \param force Force run - * \return zero on success, otherwise a negative error code - */ --static int set_defaults(snd_use_case_mgr_t *uc_mgr) -+static int set_defaults(snd_use_case_mgr_t *uc_mgr, bool force) - { - int err; - -- if (uc_mgr->default_list_executed) -+ if (!force && uc_mgr->default_list_executed) - return 0; - err = execute_sequence(uc_mgr, NULL, &uc_mgr->default_list, - &uc_mgr->value_list, NULL, NULL); -@@ -1351,7 +1352,7 @@ static int set_verb(snd_use_case_mgr_t *uc_mgr, - int err; - - if (enable) { -- err = set_defaults(uc_mgr); -+ err = set_defaults(uc_mgr, false); - if (err < 0) - return err; - seq = &verb->enable_list; -@@ -1435,6 +1436,22 @@ static int set_device(snd_use_case_mgr_t *uc_mgr, - return err; - } - -+/** -+ * \brief Do the full reset -+ * \param uc_mgr Use case manager -+ * \return zero on success, otherwise a negative error code -+ */ -+static int do_reset(snd_use_case_mgr_t *uc_mgr) -+{ -+ int err; -+ -+ err = set_defaults(uc_mgr, true); -+ INIT_LIST_HEAD(&uc_mgr->active_modifiers); -+ INIT_LIST_HEAD(&uc_mgr->active_devices); -+ uc_mgr->active_verb = NULL; -+ return err; -+} -+ - /** - * \brief Parse open arguments - * \param uc_mgr Use case manager -@@ -1569,6 +1586,8 @@ int snd_use_case_mgr_reload(snd_use_case_mgr_t *uc_mgr) - - pthread_mutex_lock(&uc_mgr->mutex); - -+ do_reset(uc_mgr); -+ - uc_mgr_free_verb(uc_mgr); - - uc_mgr->default_list_executed = 0; -@@ -1633,8 +1652,7 @@ static int dismantle_use_case(snd_use_case_mgr_t *uc_mgr) - } - uc_mgr->active_verb = NULL; - -- err = execute_sequence(uc_mgr, NULL, &uc_mgr->default_list, -- &uc_mgr->value_list, NULL, NULL); -+ err = set_defaults(uc_mgr, true); - - return err; - } -@@ -1649,11 +1667,7 @@ int snd_use_case_mgr_reset(snd_use_case_mgr_t *uc_mgr) - int err; - - pthread_mutex_lock(&uc_mgr->mutex); -- err = execute_sequence(uc_mgr, NULL, &uc_mgr->default_list, -- &uc_mgr->value_list, NULL, NULL); -- INIT_LIST_HEAD(&uc_mgr->active_modifiers); -- INIT_LIST_HEAD(&uc_mgr->active_devices); -- uc_mgr->active_verb = NULL; -+ err = do_reset(uc_mgr); - pthread_mutex_unlock(&uc_mgr->mutex); - return err; - } -@@ -2512,7 +2526,7 @@ static int set_defaults_user(snd_use_case_mgr_t *uc_mgr, - uc_error("error: wrong value for _defaults (%s)", value); - return -EINVAL; - } -- return set_defaults(uc_mgr); -+ return set_defaults(uc_mgr, false); - } - - static int handle_transition_verb(snd_use_case_mgr_t *uc_mgr, --- -2.38.1 - - -From 9649b64c6f72984c53f469dad8dd4221d307e06d Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 22 Nov 2022 09:59:04 +0100 -Subject: [PATCH 11/18] ucm: handle empty string also for ${env:} substitution - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/ucm_subs.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/src/ucm/ucm_subs.c b/src/ucm/ucm_subs.c -index 2261bdc2..e62290ea 100644 ---- a/src/ucm/ucm_subs.c -+++ b/src/ucm/ucm_subs.c -@@ -490,7 +490,13 @@ static char *rval_env(snd_use_case_mgr_t *uc_mgr ATTRIBUTE_UNUSED, const char *i - { - char *e; - -- e = getenv(id); -+ if (*id == '-') { -+ e = getenv(id + 1); -+ if (e == NULL) -+ e = ""; -+ } else { -+ e = getenv(id); -+ } - if (e) - return strdup(e); - return NULL; --- -2.38.1 - - -From f0f054517c05ff4ef7a1615851a686a3a202b9ff Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 23 Nov 2022 17:56:20 +0100 -Subject: [PATCH 12/18] test: latency - add -y option (I/O usleep) - -Signed-off-by: Jaroslav Kysela ---- - test/latency.c | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/test/latency.c b/test/latency.c -index 3aff37c1..161d1f68 100644 ---- a/test/latency.c -+++ b/test/latency.c -@@ -52,6 +52,7 @@ int latency_max = 2048; /* in frames / 2 */ - int loop_sec = 30; /* seconds */ - int block = 0; /* block mode */ - int use_poll = 0; -+int usleep_val = 0; - int resample = 1; - int sys_latency = 0; /* data I/O: use system timings instead driver wakeups */ - int pos_dump = 0; /* dump positions */ -@@ -509,6 +510,8 @@ void help(void) - "-s,--seconds duration of test in seconds\n" - "-b,--block block mode\n" - "-p,--poll use poll (wait for event - reduces CPU usage)\n" -+"-y,--usleep sleep for the specified amount of microseconds between\n" -+" stream updates (default 0 - off)\n" - "-e,--effect apply an effect (bandpass filter sweep)\n" - "-x,--posdump dump buffer positions\n" - "-X,--realtime do a realtime check (buffering)\n" -@@ -548,6 +551,7 @@ int main(int argc, char *argv[]) - {"seconds", 1, NULL, 's'}, - {"block", 0, NULL, 'b'}, - {"poll", 0, NULL, 'p'}, -+ {"usleep", 1, NULL, 'y'}, - {"effect", 0, NULL, 'e'}, - {"posdump", 0, NULL, 'x'}, - {"realtime", 0, NULL, 'X'}, -@@ -565,7 +569,7 @@ int main(int argc, char *argv[]) - morehelp = 0; - while (1) { - int c; -- if ((c = getopt_long(argc, argv, "hP:C:m:M:U:F:f:c:r:B:E:s:bpenxX", long_option, NULL)) < 0) -+ if ((c = getopt_long(argc, argv, "hP:C:m:M:U:F:f:c:r:B:E:s:y:bpenxX", long_option, NULL)) < 0) - break; - switch (c) { - case 'h': -@@ -624,6 +628,9 @@ int main(int argc, char *argv[]) - case 'p': - use_poll = 1; - break; -+ case 'y': -+ usleep_val = atoi(optarg); -+ break; - case 'e': - effect = 1; - break; -@@ -671,6 +678,8 @@ int main(int argc, char *argv[]) - loop_limit, latency_min * 2, latency_max * 2); - if (sys_latency > 0) - printf(", I/O updates %ims", sys_latency); -+ else if (!block) -+ printf(", I/O usleep %ius", usleep_val); - printf("\n"); - - if ((err = snd_pcm_open(&phandle, pdevice, SND_PCM_STREAM_PLAYBACK, block ? 0 : SND_PCM_NONBLOCK)) < 0) { -@@ -755,6 +764,8 @@ int main(int argc, char *argv[]) - } else if (use_poll) { - /* use poll to wait for next event */ - snd_pcm_wait(chandle, 1000); -+ } else if (usleep_val > 0) { -+ usleep(usleep_val); - } - if (pos_dump || realtime_check) { - if (sys_latency <= 0) --- -2.38.1 - - -From 536c93928bc57d941a7cd146dbcbd62df0be2d83 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 23 Nov 2022 19:45:15 +0100 -Subject: [PATCH 13/18] test: latency - usleep should not be used in the block - mode - -Signed-off-by: Jaroslav Kysela ---- - test/latency.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/test/latency.c b/test/latency.c -index 161d1f68..1b4848d6 100644 ---- a/test/latency.c -+++ b/test/latency.c -@@ -678,7 +678,7 @@ int main(int argc, char *argv[]) - loop_limit, latency_min * 2, latency_max * 2); - if (sys_latency > 0) - printf(", I/O updates %ims", sys_latency); -- else if (!block) -+ else if (!block && !use_poll) - printf(", I/O usleep %ius", usleep_val); - printf("\n"); - -@@ -764,7 +764,7 @@ int main(int argc, char *argv[]) - } else if (use_poll) { - /* use poll to wait for next event */ - snd_pcm_wait(chandle, 1000); -- } else if (usleep_val > 0) { -+ } else if (!block && usleep_val > 0) { - usleep(usleep_val); - } - if (pos_dump || realtime_check) { --- -2.38.1 - - -From ea0850f3f3780652869c2b4550576894bc21684f Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Thu, 24 Nov 2022 08:33:47 +0100 -Subject: [PATCH 14/18] test: latency - add --policy option to allow using - SCHED_FIFO - -Signed-off-by: Jaroslav Kysela ---- - test/latency.c | 22 +++++++++++++++++----- - 1 file changed, 17 insertions(+), 5 deletions(-) - -diff --git a/test/latency.c b/test/latency.c -index 1b4848d6..3b20e1c1 100644 ---- a/test/latency.c -+++ b/test/latency.c -@@ -40,6 +40,7 @@ - - typedef struct timespec timestamp_t; - -+char *sched_policy = "rr"; - char *pdevice = "hw:0,0"; - char *cdevice = "hw:0,0"; - snd_pcm_format_t format = SND_PCM_FORMAT_S16_LE; -@@ -354,18 +355,24 @@ void gettimestamp(snd_pcm_t *handle, snd_timestamp_t *timestamp) - void setscheduler(void) - { - struct sched_param sched_param; -+ int policy = SCHED_RR; -+ const char *spolicy = "Round Robin"; - -+ if (strcasecmp(sched_policy, "fifo") == 0) { -+ policy = SCHED_FIFO; -+ spolicy = "FIFO"; -+ } - if (sched_getparam(0, &sched_param) < 0) { - printf("Scheduler getparam failed...\n"); - return; - } -- sched_param.sched_priority = sched_get_priority_max(SCHED_RR); -- if (!sched_setscheduler(0, SCHED_RR, &sched_param)) { -- printf("Scheduler set to Round Robin with priority %i...\n", sched_param.sched_priority); -+ sched_param.sched_priority = sched_get_priority_max(policy); -+ if (!sched_setscheduler(0, policy, &sched_param)) { -+ printf("Scheduler set to %s with priority %i...\n", spolicy, sched_param.sched_priority); - fflush(stdout); - return; - } -- printf("!!!Scheduler set to Round Robin with priority %i FAILED!!!\n", sched_param.sched_priority); -+ printf("!!!Scheduler set to %s with priority %i FAILED!!!\n", spolicy, sched_param.sched_priority); - } - - long timediff(snd_timestamp_t t1, snd_timestamp_t t2) -@@ -515,6 +522,7 @@ void help(void) - "-e,--effect apply an effect (bandpass filter sweep)\n" - "-x,--posdump dump buffer positions\n" - "-X,--realtime do a realtime check (buffering)\n" -+"-O,--policy set scheduler policy (RR or FIFO)\n" - ); - printf("Recognized sample formats are:"); - for (k = 0; k < SND_PCM_FORMAT_LAST; ++k) { -@@ -555,6 +563,7 @@ int main(int argc, char *argv[]) - {"effect", 0, NULL, 'e'}, - {"posdump", 0, NULL, 'x'}, - {"realtime", 0, NULL, 'X'}, -+ {"policy", 1, NULL, 'O'}, - {NULL, 0, NULL, 0}, - }; - snd_pcm_t *phandle, *chandle; -@@ -569,7 +578,7 @@ int main(int argc, char *argv[]) - morehelp = 0; - while (1) { - int c; -- if ((c = getopt_long(argc, argv, "hP:C:m:M:U:F:f:c:r:B:E:s:y:bpenxX", long_option, NULL)) < 0) -+ if ((c = getopt_long(argc, argv, "hP:C:m:M:U:F:f:c:r:B:E:s:y:O:bpenxX", long_option, NULL)) < 0) - break; - switch (c) { - case 'h': -@@ -643,6 +652,9 @@ int main(int argc, char *argv[]) - case 'X': - realtime_check = 1; - break; -+ case 'O': -+ sched_policy = optarg; -+ break; - } - } - --- -2.38.1 - - -From 75f8e2e73e03f628a4f2ba55ca8aa3e9f50cdbd9 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Thu, 24 Nov 2022 10:55:32 +0100 -Subject: [PATCH 15/18] test: latency - --policy option - allow using - SCHED_OTHER - -Signed-off-by: Jaroslav Kysela ---- - test/latency.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/test/latency.c b/test/latency.c -index 3b20e1c1..5e67015c 100644 ---- a/test/latency.c -+++ b/test/latency.c -@@ -361,6 +361,9 @@ void setscheduler(void) - if (strcasecmp(sched_policy, "fifo") == 0) { - policy = SCHED_FIFO; - spolicy = "FIFO"; -+ } else if (strcasecmp(sched_policy, "other") == 0) { -+ policy = SCHED_OTHER; -+ spolicy = "OTHER"; - } - if (sched_getparam(0, &sched_param) < 0) { - printf("Scheduler getparam failed...\n"); -@@ -522,7 +525,7 @@ void help(void) - "-e,--effect apply an effect (bandpass filter sweep)\n" - "-x,--posdump dump buffer positions\n" - "-X,--realtime do a realtime check (buffering)\n" --"-O,--policy set scheduler policy (RR or FIFO)\n" -+"-O,--policy set scheduler policy (RR, FIFO or OTHER)\n" - ); - printf("Recognized sample formats are:"); - for (k = 0; k < SND_PCM_FORMAT_LAST; ++k) { --- -2.38.1 - - -From d28e8cb29485cc93f741b01dc65893c798359963 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 29 Nov 2022 19:42:13 +0100 -Subject: [PATCH 16/18] topology: ctl - remove the wrong (debug) code - -This code was commited by mistake. It was used for testing -of ALSA_PCM_OLD_HW/SW_PARAMS_API. - -BugLink: https://github.com/thesofproject/sof/issues/6667 -Related-to: 78b20e3c ("test: latency - use snd_pcm_format_physical_width()") -Reported-by: Jaska Uimonen -Signed-off-by: Jaroslav Kysela ---- - src/topology/ctl.c | 7 +------ - 1 file changed, 1 insertion(+), 6 deletions(-) - -diff --git a/src/topology/ctl.c b/src/topology/ctl.c -index 2c500ffc..dd05424d 100644 ---- a/src/topology/ctl.c -+++ b/src/topology/ctl.c -@@ -17,13 +17,9 @@ - Liam Girdwood - */ - --#define ALSA_PCM_OLD_HW_PARAMS_API 1 --#define ALSA_PCM_OLD_SW_PARAMS_API 1 --#include "../../include/asoundlib.h" - #include "list.h" - #include "tplg_local.h" - -- - #define ENUM_VAL_SIZE (SNDRV_CTL_ELEM_ID_NAME_MAXLEN >> 2) - - struct ctl_access_elem { -@@ -75,8 +71,7 @@ static int parse_access_values(snd_config_t *cfg, - } - } - } -- return snd_pcm_hw_params_get_channels(NULL); -- //return snd_pcm_hw_params_get_access(NULL); -+ - return 0; - } - --- -2.38.1 - - -From e29413a2205099b2bffe584210d7a2b59f531f90 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 7 Dec 2022 14:49:48 +0100 -Subject: [PATCH 17/18] ucm: execute_sysw - fix possible use-after-free - -Signed-off-by: Jaroslav Kysela ---- - src/ucm/main.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/src/ucm/main.c b/src/ucm/main.c -index 4f36648c..2ff4d3f3 100644 ---- a/src/ucm/main.c -+++ b/src/ucm/main.c -@@ -572,16 +572,17 @@ static int execute_sysw(const char *sysw) - wlen = write(fd, value, len); - myerrno = errno; - close(fd); -- free(s); - - if (ignore_error) -- return 0; -+ goto __end; - - if (wlen != (ssize_t)len) { - uc_error("unable to write '%s' to '%s': %s", value, path, strerror(myerrno)); - return -EINVAL; - } - -+__end: -+ free(s); - return 0; - } - --- -2.38.1 - - -From 13e31fb1ecd5f666ffda09e87ef1aa53b4fae022 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 7 Dec 2022 14:54:30 +0100 -Subject: [PATCH 18/18] alsa-lib: conf - fix possible use-after-free in - get_char_skip_comments - -Signed-off-by: Jaroslav Kysela ---- - src/conf.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/conf.c b/src/conf.c -index eb38c344..65f2e1a7 100644 ---- a/src/conf.c -+++ b/src/conf.c -@@ -814,11 +814,12 @@ static int get_char_skip_comments(input_t *input) - closedir(dirp); - - err = add_include_path(input->current, str); -- free(str); - if (err < 0) { - SNDERR("Cannot add search dir %s", str); -+ free(str); - return err; - } -+ free(str); - continue; - } - --- -2.38.1 - diff --git a/alsa-lib.spec b/alsa-lib.spec index 9d9250a..1256eab 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,14 +2,14 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.8 -%define version_alsa_ucm 1.2.8 +%define version_alsa_lib 1.2.9 +%define version_alsa_ucm 1.2.9 %define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 3%{?prever_dot}%{?dist} +Release: 1%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Thu May 4 2023 Jaroslav Kysela - 1.2.9-1 +- update to 1.2.9 + * Wed Jan 18 2023 Fedora Release Engineering - 1.2.8-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild diff --git a/sources b/sources index 81824da..d92c338 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.8.tar.bz2) = 865ff05a8f589996f8d63d43a91c961f1b64144f3e1d17c7074b7ac16f25b3fd1c371d46ed63a8cc20fa01e63c76b75f1a9802b56889ae1073854dd050d27688 -SHA512 (alsa-ucm-conf-1.2.8.tar.bz2) = a15a9ca52c108ee95a421b91f3fad4329f1e9fb1c004a40d5ff1a57d6701bad19a31d5a296426d26439be9b87d2d543ce51588a98402d24c17f0f92aaf1096ca +SHA512 (alsa-lib-1.2.9.tar.bz2) = 8f39c8166c3648d46695a9287d9b9a35e5bfffed11d79e868ff7aba92d0fee792e82784186ebeb2a3e44d6b617c916025c7fce9a802565bb8e0dc8fdcce2311a +SHA512 (alsa-ucm-conf-1.2.9.tar.bz2) = 3aced4d4df76044a5525f1217851e05f7ad177389d2008e3e3dd0fb4d2cf72cd0897b140659a7729cc37d5b737c2d0cf5b607df4f576647044accd560d8cb87b SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 From 645ed004549d591c1f3f5fbfc48b94b037b6618d Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 4 May 2023 09:50:51 +0200 Subject: [PATCH 36/68] fix the 1.2.9 build --- alsa-lib.spec | 6 +- alsa-ucm-conf.patch | 1296 ------------------------------------------- 2 files changed, 3 insertions(+), 1299 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 1256eab..64da136 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -70,9 +70,9 @@ contains alsa-lib configuration of SoC topology %prep %setup -q -n %{name}-%{version}%{?prever}%{?postver} -%patch0 -p1 -b .alsa-git -%patch1 -p1 -b .config -%patch2 -p1 -b .glibc-open +%patch -P0 -p1 -b .alsa-git +%patch -P1 -p1 -b .config +%patch -P2 -p1 -b .glibc-open %build # This package uses top level ASM constructs which are incompatible with LTO. diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index 1bc6bae..e69de29 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -1,1296 +0,0 @@ -From 2667378a6b9120d99e44f783ac4d247fb683d83c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= - -Date: Thu, 24 Mar 2022 18:13:45 -0400 -Subject: [PATCH 01/14] ucm2: Add support for MT8192 Asurada Spherion - Chromebook -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Add support for the Acer Chromebook 514 CP514-2H, powered by MediaTek -Kompanio 820 (MT8192). This machine uses a MT6359 PMIC, with RT1015P as -speaker codec and RT5682 as headphone codec. - -Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/217 -Signed-off-by: Nícolas F. R. A. Prado -Signed-off-by: Jaroslav Kysela ---- - .../mt8192/mt6359-rt1015p-rt5682/HiFi.conf | 88 +++++++++++++++++++ - .../mt8192/mt6359-rt1015p-rt5682/init.conf | 24 +++++ - .../mt8192_mt6359_rt1015p_rt5682.conf | 11 +++ - .../mt8192_mt6359_rt1015p_rt5682.conf | 1 + - 4 files changed, 124 insertions(+) - create mode 100644 ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/HiFi.conf - create mode 100644 ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/init.conf - create mode 100644 ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/mt8192_mt6359_rt1015p_rt5682.conf - create mode 120000 ucm2/conf.d/mt8192_mt6359/mt8192_mt6359_rt1015p_rt5682.conf - -diff --git a/ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/HiFi.conf b/ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/HiFi.conf -new file mode 100644 -index 0000000..cf0d2c1 ---- /dev/null -+++ b/ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/HiFi.conf -@@ -0,0 +1,88 @@ -+SectionVerb { -+ EnableSequence [ -+ disdevall "" -+ ] -+ -+ Value { -+ TQ "HiFi" -+ } -+} -+ -+SectionDevice."Speaker" { -+ Comment "Speaker" -+ -+ EnableSequence [ -+ cset "name='Speakers Switch' 1" -+ ] -+ -+ DisableSequence [ -+ cset "name='Speakers Switch' 0" -+ ] -+ -+ Value { -+ PlaybackPCM "hw:${CardId},0" -+ PlaybackPriority 100 -+ } -+} -+ -+SectionDevice."Headphones" { -+ Comment "Headphones" -+ -+ EnableSequence [ -+ cset "name='Headphone Jack Switch' 1" -+ ] -+ -+ DisableSequence [ -+ cset "name='Headphone Jack Switch' 0" -+ ] -+ -+ Value { -+ PlaybackPCM "hw:${CardId},3" -+ JackControl "Headphone Jack" -+ PlaybackMixerElem "DAC1" -+ PlaybackPriority 200 -+ } -+} -+ -+SectionDevice."Mic" { -+ Comment "Internal Microphone" -+ -+ EnableSequence [ -+ cset "name='MTKAIF_DMIC Switch' 1" -+ ] -+ -+ DisableSequence [ -+ cset "name='MTKAIF_DMIC Switch' 0" -+ ] -+ -+ Value { -+ CapturePCM "hw:${CardId},10" -+ CapturePriority 100 -+ } -+} -+ -+SectionDevice."Headset" { -+ Comment "Headset Microphone" -+ -+ EnableSequence [ -+ cset "name='Headset Mic Switch' 1" -+ cset "name='STO1 ADC Capture Switch' 1" -+ cset "name='RECMIX1L CBJ Switch' 1" -+ cset "name='Stereo1 ADC MIXL ADC1 Switch' 1" -+ cset "name='Stereo1 ADC MIXR ADC1 Switch' 1" -+ ] -+ -+ DisableSequence [ -+ cset "name='STO1 ADC Capture Switch' 0" -+ cset "name='RECMIX1L CBJ Switch' 0" -+ cset "name='Stereo1 ADC MIXL ADC1 Switch' 0" -+ cset "name='Stereo1 ADC MIXR ADC1 Switch' 0" -+ cset "name='Headset Mic Switch' 0" -+ ] -+ -+ Value { -+ CapturePCM "hw:${CardId},11" -+ JackControl "Headset Mic Jack" -+ CapturePriority 200 -+ } -+} -diff --git a/ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/init.conf b/ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/init.conf -new file mode 100644 -index 0000000..b53178e ---- /dev/null -+++ b/ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/init.conf -@@ -0,0 +1,24 @@ -+BootSequence [ -+ # Speaker -+ cset "name='I2S3_CH1 DL1_CH1' 1" -+ cset "name='I2S3_CH2 DL1_CH2' 1" -+ cset "name='I2S3_HD_Mux' 1" -+ -+ # Headphone -+ cset "name='I2S9_CH1 DL3_CH1' 1" -+ cset "name='I2S9_CH2 DL3_CH2' 1" -+ cset "name='I2S9_HD_Mux' 1" -+ -+ # Internal Mic -+ cset "name='UL1_CH1 ADDA_UL_CH1' 1" -+ cset "name='UL1_CH2 ADDA_UL_CH2' 1" -+ cset "name='UL_SRC_MUX' DMIC" -+ -+ # Headset Mic -+ cset "name='UL2_CH1 I2S8_CH1' 1" -+ cset "name='UL2_CH2 I2S8_CH2' 1" -+ cset "name='I2S8_HD_Mux' 1" -+ cset "name='Stereo1 ADC L1 Mux' 1" -+ cset "name='Stereo1 ADC R1 Mux' 1" -+ cset "name='CBJ Boost Volume' 3" -+] -diff --git a/ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/mt8192_mt6359_rt1015p_rt5682.conf b/ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/mt8192_mt6359_rt1015p_rt5682.conf -new file mode 100644 -index 0000000..b4e124d ---- /dev/null -+++ b/ucm2/MediaTek/mt8192/mt6359-rt1015p-rt5682/mt8192_mt6359_rt1015p_rt5682.conf -@@ -0,0 +1,11 @@ -+Comment "MT8192 MT6359 RT1015P RT5682 sound card" -+Syntax 4 -+ -+SectionUseCase."HiFi" { -+ File "HiFi.conf" -+ Comment "Default" -+} -+ -+Include.card-init.File "/lib/card-init.conf" -+Include.ctl-remap.File "/lib/ctl-remap.conf" -+Include.init.File "init.conf" -diff --git a/ucm2/conf.d/mt8192_mt6359/mt8192_mt6359_rt1015p_rt5682.conf b/ucm2/conf.d/mt8192_mt6359/mt8192_mt6359_rt1015p_rt5682.conf -new file mode 120000 -index 0000000..4425b19 ---- /dev/null -+++ b/ucm2/conf.d/mt8192_mt6359/mt8192_mt6359_rt1015p_rt5682.conf -@@ -0,0 +1 @@ -+../../MediaTek/mt8192/mt6359-rt1015p-rt5682/mt8192_mt6359_rt1015p_rt5682.conf -\ No newline at end of file --- -2.38.1 - - -From 6dee56f11fbd48dd412179722a445416fcd779ef Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Sun, 6 Nov 2022 18:08:27 +0100 -Subject: [PATCH 02/14] ucm: USB-Audio - Add support for Focusrite Scarlett 2i2 - gen2 - -BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/234 -Signed-off-by: Jaroslav Kysela ---- - ...2-HiFi.conf => Scarlett-2i-gen2-HiFi.conf} | 45 +++++++++++-------- - .../USB-Audio/Focusrite/Scarlett-2i-gen2.conf | 22 +++++++++ - .../Focusrite/Scarlett-2i4-gen2.conf | 11 ----- - ucm2/USB-Audio/USB-Audio.conf | 10 ++--- - 4 files changed, 53 insertions(+), 35 deletions(-) - rename ucm2/USB-Audio/Focusrite/{Scarlett-2i4-gen2-HiFi.conf => Scarlett-2i-gen2-HiFi.conf} (65%) - create mode 100644 ucm2/USB-Audio/Focusrite/Scarlett-2i-gen2.conf - delete mode 100644 ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2.conf - -diff --git a/ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2-HiFi.conf b/ucm2/USB-Audio/Focusrite/Scarlett-2i-gen2-HiFi.conf -similarity index 65% -rename from ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2-HiFi.conf -rename to ucm2/USB-Audio/Focusrite/Scarlett-2i-gen2-HiFi.conf -index 5ee5076..ab69bc7 100644 ---- a/ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2-HiFi.conf -+++ b/ucm2/USB-Audio/Focusrite/Scarlett-2i-gen2-HiFi.conf -@@ -3,7 +3,7 @@ Include.pcm_split.File "/common/pcm/split.conf" - Macro [ - { - SplitPCM { -- Name "scarlett2i4_stereo_out" -+ Name "scarlett2i_stereo_out" - Direction Playback - Format S32_LE - Channels 2 -@@ -16,7 +16,7 @@ Macro [ - } - { - SplitPCM { -- Name "scarlett2i4_mono_in" -+ Name "scarlett2i_mono_in" - Direction Capture - Format S32_LE - Channels 1 -@@ -33,7 +33,7 @@ SectionDevice."Line1" { - PlaybackPriority 200 - } - Macro.pcm_split.SplitPCMDevice { -- Name "scarlett2i4_stereo_out" -+ Name "scarlett2i_stereo_out" - Direction Playback - HWChannels 4 - Channels 2 -@@ -44,21 +44,28 @@ SectionDevice."Line1" { - } - } - --SectionDevice."Line2" { -- Comment "Line 3-4" -- -- Value { -- PlaybackPriority 100 -+If.scarlett_2i4 { -+ Condition { -+ Type String -+ String1 "${var:PlaybackChannels}" -+ String2 "4" - } -- Macro.pcm_split.SplitPCMDevice { -- Name "scarlett2i4_stereo_out" -- Direction Playback -- HWChannels 4 -- Channels 2 -- Channel0 2 -- Channel1 3 -- ChannelPos0 FL -- ChannelPos1 FR -+ True.SectionDevice."Line2" { -+ Comment "Line 3-4" -+ -+ Value { -+ PlaybackPriority 100 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "scarlett2i_stereo_out" -+ Direction Playback -+ HWChannels 4 -+ Channels 2 -+ Channel0 2 -+ Channel1 3 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } - } - } - -@@ -69,7 +76,7 @@ SectionDevice."Mic1" { - CapturePriority 200 - } - Macro.pcm_split.SplitPCMDevice { -- Name "scarlett2i4_mono_in" -+ Name "scarlett2i_mono_in" - Direction Capture - HWChannels 2 - Channels 1 -@@ -85,7 +92,7 @@ SectionDevice."Mic2" { - CapturePriority 100 - } - Macro.pcm_split.SplitPCMDevice { -- Name "scarlett2i4_mono_in" -+ Name "scarlett2i_mono_in" - Direction Capture - HWChannels 2 - Channels 1 -diff --git a/ucm2/USB-Audio/Focusrite/Scarlett-2i-gen2.conf b/ucm2/USB-Audio/Focusrite/Scarlett-2i-gen2.conf -new file mode 100644 -index 0000000..ee5b0b5 ---- /dev/null -+++ b/ucm2/USB-Audio/Focusrite/Scarlett-2i-gen2.conf -@@ -0,0 +1,22 @@ -+Define.PlaybackChannels 4 -+ -+If.scarlett_2i4 { -+ Condition { -+ Type String -+ Haystack "${CardComponents}" -+ Needle "USB1235:8202" -+ } -+ True.Define.PlaybackChannels 2 -+} -+ -+Comment "Focusrite Scarlett 2i${var:PlaybackChannels} Gen 2" -+ -+SectionUseCase."HiFi" { -+ Comment "Default" -+ File "/USB-Audio/Focusrite/Scarlett-2i-gen2-HiFi.conf" -+} -+ -+Define.DirectPlaybackChannels "${var:PlaybackChannels}" -+Define.DirectCaptureChannels 2 -+ -+Include.dhw.File "/common/direct.conf" -diff --git a/ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2.conf b/ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2.conf -deleted file mode 100644 -index ffc296d..0000000 ---- a/ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2.conf -+++ /dev/null -@@ -1,11 +0,0 @@ --Comment "Focusrite Scarlett 2i4 Gen 2" -- --SectionUseCase."HiFi" { -- Comment "Default" -- File "/USB-Audio/Focusrite/Scarlett-2i4-gen2-HiFi.conf" --} -- --Define.DirectPlaybackChannels 4 --Define.DirectCaptureChannels 2 -- --Include.dhw.File "/common/direct.conf" -diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf -index 90a88d4..3479ba1 100644 ---- a/ucm2/USB-Audio/USB-Audio.conf -+++ b/ucm2/USB-Audio/USB-Audio.conf -@@ -135,14 +135,14 @@ If.goxlr { - True.Define.ProfileName "GoXLR/GoXLR" - } - --If.focusrite-scarlett-2i4-gen2 { -+If.focusrite-scarlett-2i-gen2 { - Condition { -- Type String -- Haystack "${CardComponents}" -- Needle "USB1235:8200" -+ Type RegexMatch -+ String "${CardComponents}" -+ Regex "USB1235:820[02]" - } - True.Define { -- ProfileName "Focusrite/Scarlett-2i4-gen2" -+ ProfileName "Focusrite/Scarlett-2i-gen2" - } - } - --- -2.38.1 - - -From b50a903f488e3f6479001b603c1b42b2a9600882 Mon Sep 17 00:00:00 2001 -From: Manu Linares -Date: Sat, 5 Nov 2022 19:32:27 -0300 -Subject: [PATCH 04/14] ucm2: USB-Audio - Added Digidesign Mbox 3 support - -Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/237 -Signed-off-by: Manu Linares -Signed-off-by: Jaroslav Kysela ---- - .../Digidesign/Digidesign-Mbox-3-HiFi.conf | 126 ++++++++++++++++++ - .../Digidesign/Digidesign-Mbox-3.conf | 11 ++ - ucm2/USB-Audio/USB-Audio.conf | 9 ++ - 3 files changed, 146 insertions(+) - create mode 100644 ucm2/USB-Audio/Digidesign/Digidesign-Mbox-3-HiFi.conf - create mode 100644 ucm2/USB-Audio/Digidesign/Digidesign-Mbox-3.conf - -diff --git a/ucm2/USB-Audio/Digidesign/Digidesign-Mbox-3-HiFi.conf b/ucm2/USB-Audio/Digidesign/Digidesign-Mbox-3-HiFi.conf -new file mode 100644 -index 0000000..7219bea ---- /dev/null -+++ b/ucm2/USB-Audio/Digidesign/Digidesign-Mbox-3-HiFi.conf -@@ -0,0 +1,126 @@ -+Include.pcm_split.File "/common/pcm/split.conf" -+ -+Macro [ -+ { -+ SplitPCM { -+ Name "mbox3_stereo_out" -+ Direction Playback -+ Channels 2 -+ HWChannels 4 -+ HWChannelPos0 FL -+ HWChannelPos1 FR -+ HWChannelPos2 FL -+ HWChannelPos3 FR -+ } -+ } -+ { -+ SplitPCM { -+ Name "mbox3_stereo_in" -+ Direction Capture -+ Channels 2 -+ HWChannels 4 -+ HWChannelPos0 FL -+ HWChannelPos1 FR -+ HWChannelPos2 FL -+ HWChannelPos3 FR -+ } -+ } -+ { -+ SplitPCM { -+ Name "mbox3_mono_in" -+ Direction Capture -+ Channels 1 -+ HWChannels 4 -+ HWChannelPos0 MONO -+ HWChannelPos1 MONO -+ HWChannelPos2 MONO -+ HWChannelPos3 MONO -+ } -+ } -+] -+ -+SectionDevice."Line1" { -+ Comment "Main Output L/R" -+ -+ Value { -+ PlaybackPriority 300 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "mbox3_stereo_out" -+ Direction Playback -+ HWChannels 4 -+ Channels 2 -+ Channel0 0 -+ Channel1 1 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+ -+SectionDevice."line2SPDIF" { -+ Comment "SPDIF Out" -+ Value { -+ PlaybackPriority 100 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "mbox3_stereo_out" -+ Direction Playback -+ HWChannels 4 -+ Channels 2 -+ Channel0 2 -+ Channel1 3 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."mic1" { -+ Comment "Mic/Line 1" -+ -+ Value { -+ CapturePriority 300 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "mbox3_mono_in" -+ Direction Capture -+ HWChannels 4 -+ Channels 1 -+ Channel0 0 -+ ChannelPos0 MONO -+ } -+} -+ -+SectionDevice."mic2" { -+ Comment "Mic/Line 2" -+ -+ Value { -+ CapturePriority 200 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "mbox3_mono_in" -+ Direction Capture -+ HWChannels 4 -+ Channels 1 -+ Channel0 1 -+ ChannelPos0 MONO -+ } -+} -+ -+SectionDevice."mic3SPDIF" { -+ Comment "SPDIF In" -+ -+ Value { -+ CapturePriority 100 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "mbox3_stereo_in" -+ Direction Capture -+ HWChannels 4 -+ Channels 2 -+ Channel0 2 -+ Channel1 3 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -diff --git a/ucm2/USB-Audio/Digidesign/Digidesign-Mbox-3.conf b/ucm2/USB-Audio/Digidesign/Digidesign-Mbox-3.conf -new file mode 100644 -index 0000000..d6e19f9 ---- /dev/null -+++ b/ucm2/USB-Audio/Digidesign/Digidesign-Mbox-3.conf -@@ -0,0 +1,11 @@ -+Comment "Digidesign Mbox 3" -+ -+SectionUseCase."Mixer" { -+ Comment "Stereo Duplex" -+ File "/USB-Audio/Digidesign/Digidesign-Mbox-3-HiFi.conf" -+} -+ -+Define.DirectPlaybackChannels 4 -+Define.DirectCaptureChannels 4 -+ -+Include.dhw.File "/common/direct.conf" -diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf -index 3479ba1..d1d70d8 100644 ---- a/ucm2/USB-Audio/USB-Audio.conf -+++ b/ucm2/USB-Audio/USB-Audio.conf -@@ -126,6 +126,15 @@ If.dell-desktop-rear { - True.Define.ProfileName "Dell/Desktop-Rear" - } - -+If.mbox3 { -+ Condition { -+ Type String -+ Haystack "${CardComponents}" -+ Needle "USB0dba:5000" -+ } -+ True.Define.ProfileName "Digidesign/Digidesign-Mbox-3" -+} -+ - If.goxlr { - Condition { - Type RegexMatch --- -2.38.1 - - -From 88f232dffd54e1b9222ea76c7885445efebaa74d Mon Sep 17 00:00:00 2001 -From: "Ben Scholzen (DASPRiD)" -Date: Mon, 31 Oct 2022 17:41:02 +0100 -Subject: [PATCH 05/14] ucm2: Alc4080 - add support for ASUS ROG Strix Z790-E - Gaming Wifi - -Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/235 -Signed-off-by: Ben Scholzen (DASPRiD) -Signed-off-by: Jaroslav Kysela ---- - ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf | 2 +- - ucm2/USB-Audio/USB-Audio.conf | 3 ++- - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf b/ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf -index 519f3b0..fa8d445 100644 ---- a/ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf -+++ b/ucm2/USB-Audio/Realtek/ALC4080-HiFi.conf -@@ -68,7 +68,7 @@ If.spdif_dev2 { - Condition { - Type RegexMatch - String "${CardComponents}" -- Regex "USB(0b05:1996|0db0:1feb)" -+ Regex "USB(0b05:1996|0b05:1a52|0db0:1feb)" - } - True.Define.SpdifPCM "hw:${CardId},2" - } -diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf -index d1d70d8..e30dc2b 100644 ---- a/ucm2/USB-Audio/USB-Audio.conf -+++ b/ucm2/USB-Audio/USB-Audio.conf -@@ -41,6 +41,7 @@ If.realtek-alc4080 { - # 0b05:1a16 ASUS ROG Strix B660-F Gaming WiFi - # 0b05:1a20 ASUS ROG STRIX Z690-I Gaming Wifi - # 0b05:1a27 ALC4082 on ASUS ROG Maximus Z690 Hero -+ # 0b05:1a52 ASUS ROG Strix Z790-E Gaming Wifi - # 0db0:005a MSI MPG Z690 CARBON WIFI - # 0db0:151f MSI X570S EDGE MAX WIFI - # 0db0:1feb MSI Edge Wifi Z690 -@@ -50,7 +51,7 @@ If.realtek-alc4080 { - # 0db0:a47c MSI MEG X570S Ace Max - # 0db0:b202 MSI MAG Z690 Tomahawk Wifi - # 0db0:d6e7 MSI MPG X670E Carbon Wifi -- Regex "USB((0414:a00e)|(0b05:(1996|1a(16|2[07])))|(0db0:(005a|151f|1feb|419c|82c7|a073|a47c|b202|d6e7)))" -+ Regex "USB((0414:a00e)|(0b05:(1996|1a(16|2[07]|52)))|(0db0:(005a|151f|1feb|419c|82c7|a073|a47c|b202|d6e7)))" - } - True.Define.ProfileName "Realtek/ALC4080" - } --- -2.38.1 - - -From b121b63f30c24e89beec506ae1d2bac9ebb3cc61 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 15 Nov 2022 17:49:13 +0100 -Subject: [PATCH 06/14] USB-Audio: ALC4080 - add 0db0:6cc9 MSI MPG Z590 Gaming - Plus device - -BugLink: https://github.com/alsa-project/alsa-ucm-conf/issues/241 -Signed-off-by: Jaroslav Kysela ---- - ucm2/USB-Audio/USB-Audio.conf | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf -index e30dc2b..89482cb 100644 ---- a/ucm2/USB-Audio/USB-Audio.conf -+++ b/ucm2/USB-Audio/USB-Audio.conf -@@ -46,12 +46,13 @@ If.realtek-alc4080 { - # 0db0:151f MSI X570S EDGE MAX WIFI - # 0db0:1feb MSI Edge Wifi Z690 - # 0db0:419c MSI MPG X570S Carbon Max Wifi -+ # 0db0:6cc9 MSI MPG Z590 Gaming Plus - # 0db0:82c7 MSI MEG Z690I Unify - # 0db0:a073 MSI MAG X570S Torpedo Max - # 0db0:a47c MSI MEG X570S Ace Max - # 0db0:b202 MSI MAG Z690 Tomahawk Wifi - # 0db0:d6e7 MSI MPG X670E Carbon Wifi -- Regex "USB((0414:a00e)|(0b05:(1996|1a(16|2[07]|52)))|(0db0:(005a|151f|1feb|419c|82c7|a073|a47c|b202|d6e7)))" -+ Regex "USB((0414:a00e)|(0b05:(1996|1a(16|2[07]|52)))|(0db0:(005a|151f|1feb|419c|6cc9|82c7|a073|a47c|b202|d6e7)))" - } - True.Define.ProfileName "Realtek/ALC4080" - } --- -2.38.1 - - -From c82c400fb653292bbf0570e278d60e1ba14cc341 Mon Sep 17 00:00:00 2001 -From: Shuming Fan -Date: Wed, 16 Nov 2022 17:36:51 +0800 -Subject: [PATCH 07/14] ucm2: sof-soundwire: add basic settings for RT1318 SDCA - device - -Add support for rt1318 amplifier - -Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/242 -Signed-off-by: Shuming Fan -Signed-off-by: Jaroslav Kysela ---- - ucm2/sof-soundwire/rt1318-1.conf | 20 ++++++++++++++++++++ - ucm2/sof-soundwire/rt1318-2.conf | 25 +++++++++++++++++++++++++ - 2 files changed, 45 insertions(+) - create mode 100644 ucm2/sof-soundwire/rt1318-1.conf - create mode 100644 ucm2/sof-soundwire/rt1318-2.conf - -diff --git a/ucm2/sof-soundwire/rt1318-1.conf b/ucm2/sof-soundwire/rt1318-1.conf -new file mode 100644 -index 0000000..13d77e1 ---- /dev/null -+++ b/ucm2/sof-soundwire/rt1318-1.conf -@@ -0,0 +1,20 @@ -+# Use case Configuration for sof-soundwire card -+ -+SectionDevice."Speaker" { -+ Comment "Speaker" -+ -+ EnableSequence [ -+ cset "name='rt1318-1 DAC Switch' 1" -+ cset "name='Speaker Switch' on" -+ ] -+ -+ DisableSequence [ -+ cset "name='rt1318-1 DAC Switch' 0" -+ cset "name='Speaker Switch' off" -+ ] -+ -+ Value { -+ PlaybackPriority 100 -+ PlaybackPCM "hw:${CardId},2" -+ } -+} -diff --git a/ucm2/sof-soundwire/rt1318-2.conf b/ucm2/sof-soundwire/rt1318-2.conf -new file mode 100644 -index 0000000..5602470 ---- /dev/null -+++ b/ucm2/sof-soundwire/rt1318-2.conf -@@ -0,0 +1,25 @@ -+# Use case Configuration for sof-soundwire card -+ -+SectionDevice."Speaker" { -+ Comment "Speaker" -+ -+ EnableSequence [ -+ cset "name='rt1318-1 RX Channel Select' L,L" -+ cset "name='rt1318-2 RX Channel Select' R,R" -+ -+ cset "name='rt1318-1 DAC Switch' 1" -+ cset "name='rt1318-2 DAC Switch' 1" -+ cset "name='Speaker Switch' on" -+ ] -+ -+ DisableSequence [ -+ cset "name='rt1318-1 DAC Switch' 0" -+ cset "name='rt1318-2 DAC Switch' 0" -+ cset "name='Speaker Switch' off" -+ ] -+ -+ Value { -+ PlaybackPriority 100 -+ PlaybackPCM "hw:${CardId},2" -+ } -+} --- -2.38.1 - - -From 998849d9510754960d808e20dad4c440adaf87ef Mon Sep 17 00:00:00 2001 -From: Clayton Craft -Date: Wed, 29 Jun 2022 15:23:23 -0700 -Subject: [PATCH 08/14] ucm2: add profile for the Librem 5 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/181 -Tested-by: Guido Günther -Signed-off-by: Jaroslav Kysela ---- - ucm2/NXP/iMX8/Librem_5/HiFi.conf | 151 ++++++++++++++++++++++++++ - ucm2/NXP/iMX8/Librem_5/Librem 5.conf | 25 +++++ - ucm2/conf.d/simple-card/Librem 5.conf | 1 + - 3 files changed, 177 insertions(+) - create mode 100644 ucm2/NXP/iMX8/Librem_5/HiFi.conf - create mode 100644 ucm2/NXP/iMX8/Librem_5/Librem 5.conf - create mode 120000 ucm2/conf.d/simple-card/Librem 5.conf - -diff --git a/ucm2/NXP/iMX8/Librem_5/HiFi.conf b/ucm2/NXP/iMX8/Librem_5/HiFi.conf -new file mode 100644 -index 0000000..55eabe3 ---- /dev/null -+++ b/ucm2/NXP/iMX8/Librem_5/HiFi.conf -@@ -0,0 +1,151 @@ -+SectionVerb { -+ EnableSequence [ -+ disdevall "" -+ ] -+ -+ Value.TQ "HiFi" -+} -+ -+SectionDevice."Handset" { -+ Comment "Handset" -+ -+ ConflictingDevice [ -+ "Headphones" -+ "Speaker" -+ ] -+ -+ EnableSequence [ -+ cset "name='Speaker Switch' off,on" -+ cset "name='DAC L/R Swap Switch' on" -+ cset "name='DAC Monomix Switch' on" -+ cset "name='SPKOUTR PGA' DAC" -+ cset "name='Speaker Boost Volume' 2" -+ ] -+ -+ DisableSequence [ -+ cset "name='Speaker Switch' off,off" -+ cset "name='DAC L/R Swap Switch' off" -+ cset "name='DAC Monomix Switch' off" -+ cset "name='SPKOUTR PGA' Mixer" -+ ] -+ -+ Value { -+ PlaybackPriority "100" -+ PlaybackVolume "name='Speaker Volume'" -+ PlaybackSwitch "name='Speaker Switch'" -+ PlaybackMixerElem "Speaker" -+ PlaybackPCM "hw:${CardId}" -+ } -+} -+ -+SectionDevice."Speaker" { -+ Comment "Speaker" -+ -+ ConflictingDevice [ -+ "Handset" -+ "Headphones" -+ ] -+ -+ EnableSequence [ -+ cset "name='Speaker Switch' on,off" -+ cset "name='DAC Monomix Switch' on" -+ cset "name='SPKOUTL PGA' DAC" -+ cset "name='Speaker Boost Volume' 6" -+ ] -+ -+ DisableSequence [ -+ cset "name='Speaker Switch' off,off" -+ cset "name='DAC Monomix Switch' off" -+ cset "name='SPKOUTL PGA' Mixer" -+ ] -+ -+ Value { -+ PlaybackPriority "500" -+ PlaybackVolume "name='Speaker Volume'" -+ PlaybackSwitch "name='Speaker Switch'" -+ PlaybackMixerElem "Speaker" -+ PlaybackPCM "hw:${CardId}" -+ } -+} -+ -+SectionDevice."Headphones" { -+ Comment "Headphones" -+ -+ ConflictingDevice [ -+ "Handset" -+ "Speaker" -+ ] -+ -+ EnableSequence [ -+ cset "name='Headphone Switch' on,on" -+ cset "name='HPOUTL PGA' 0 unmute" -+ cset "name='HPOUTR PGA' 0 unmute" -+ ] -+ -+ DisableSequence [ -+ cset "name='Headphone Switch' off off" -+ cset "name='HPOUTL PGA' 0 mute" -+ cset "name='HPOUTR PGA' 0 mute" -+ ] -+ -+ Value { -+ PlaybackPriority "1000" -+ PlaybackVolume "name='Headphone Volume'" -+ PlaybackSwitch "name='Headphone Switch'" -+ PlaybackMixerElem "Headphone" -+ PlaybackPCM "hw:${CardId}" -+ JackControl "Headphones Jack" -+ } -+} -+ -+SectionDevice."Mic" { -+ Comment "Internal Microphone" -+ -+ ConflictingDevice [ -+ "Headset" -+ ] -+ -+ EnableSequence [ -+ cset "name='ADC L/R Swap Switch' on" -+ cset "name='Input Mode' Digital" -+ ] -+ -+ DisableSequence [ -+ cset "name='ADC L/R Swap Switch' off" -+ ] -+ -+ Value { -+ CapturePriority "500" -+ CaptureVolume "name='Digital Capture Volume'" -+ CaptureMixerElem "Digital" -+ CapturePCM "hw:${CardId}" -+ } -+} -+ -+SectionDevice."Headset" { -+ Comment "Headset Microphone" -+ -+ ConflictingDevice [ -+ "Mic" -+ ] -+ -+ EnableSequence [ -+ cset "name='Input Mode' Analog" -+ cset "name='MIXINR PGA Switch' on,on" -+ cset "name='Capture Switch' on,on" -+ ] -+ -+ DisableSequence [ -+ cset "name='Capture Switch' off,off" -+ cset "name='MIXINR PGA Switch' off,off" -+ cset "name='Input Mode' Digital" -+ ] -+ -+ Value { -+ CapturePriority "100" -+ CaptureVolume "name='Capture Volume'" -+ CaptureMixerElem "Capture" -+ CapturePCM "hw:${CardId}" -+ JackControl "Headphones Jack" -+ } -+} -diff --git a/ucm2/NXP/iMX8/Librem_5/Librem 5.conf b/ucm2/NXP/iMX8/Librem_5/Librem 5.conf -new file mode 100644 -index 0000000..4d7dbd6 ---- /dev/null -+++ b/ucm2/NXP/iMX8/Librem_5/Librem 5.conf -@@ -0,0 +1,25 @@ -+Syntax 2 -+ -+SectionUseCase."HiFi" { -+ File "HiFi.conf" -+ Comment "Default" -+} -+ -+BootSequence [ -+ cset "name='Digital Playback Volume' 100,100" -+ cset "name='MIXINL IN2L Switch' off" -+ cset "name='MIXINL IN3L Switch' off" -+ cset "name='MIXINR IN2R Switch' off" -+ cset "name='MIXINR IN3R Switch' off" -+ cset "name='INPGAR IN1R Switch' off" -+ cset "name='INPGAR IN2R Switch' off" -+ cset "name='INPGAR IN3R Switch' on" -+ cset "name='INPGAR IN4R Switch' off" -+ cset "name='INPGAL IN1L Switch' off" -+ cset "name='INPGAL IN2L Switch' off" -+ cset "name='INPGAL IN3L Switch' off" -+ cset "name='INPGAL IN4L Switch' off" -+ cset "name='Input Mixer Switch' off,on" -+ cset "name='SPKOUTL PGA' Mixer" -+ cset "name='SPKOUTR PGA' Mixer" -+] -diff --git a/ucm2/conf.d/simple-card/Librem 5.conf b/ucm2/conf.d/simple-card/Librem 5.conf -new file mode 120000 -index 0000000..c687942 ---- /dev/null -+++ b/ucm2/conf.d/simple-card/Librem 5.conf -@@ -0,0 +1 @@ -+../../NXP/iMX8/Librem_5/Librem 5.conf -\ No newline at end of file --- -2.38.1 - - -From 71ff24cdd2e0fecb71c2fcf8a45a1ae50233c34b Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 21 Nov 2022 09:51:54 +0100 -Subject: [PATCH 09/14] USB-Audio: allow to configure period size for PCM split -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The environment variable UCM_USB_PERIOD_TIME (microseconds / μs) -can define the period size for the PCM channel split over -the default value 10000μs. - -BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/240 -Fixes: https://github.com/alsa-project/alsa-ucm-conf/issues/238 -Signed-off-by: Jaroslav Kysela ---- - ucm2/USB-Audio/USB-Audio.conf | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf -index 89482cb..fdc29ec 100644 ---- a/ucm2/USB-Audio/USB-Audio.conf -+++ b/ucm2/USB-Audio/USB-Audio.conf -@@ -4,6 +4,14 @@ Define.ProfileName "" - Define.MixerRemap "" - Define.SplitPCMPeriodTime 10000 # 10ms - -+If.env1 { -+ Condition { -+ Type String -+ Empty "${env:UCM_USB_PERIOD_TIME}" -+ } -+ False.Define.SplitPCMPeriodTime "${env:UCM_USB_PERIOD_TIME}" -+} -+ - If.linked { - Condition { - Type RegexMatch --- -2.38.1 - - -From 445c079665979802d50b237fe5a55be82ffd0bd9 Mon Sep 17 00:00:00 2001 -From: Fadwa Chiby -Date: Fri, 22 Jul 2022 09:45:07 +0000 -Subject: [PATCH 10/14] mt8195-demo: fix soundcard initialization - -The previous initialization in Bootsequence set all Switch -to off after boot. - -So remove the setting off of the Switch in the BootSequence -and define Enable/DisableSequence in verb section for -a proper setting. - -Note that the controls enable access to the PCM devices -(controls routes between Front End and Back End in ASoC). - -Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/211 -Signed-off-by: Fadwa Chiby -Signed-off-by: Jaroslav Kysela ---- - ucm2/MediaTek/mt8195_demo/HiFi.conf | 57 ++++++++++++++++++++++ - ucm2/MediaTek/mt8195_demo/mt8195_demo.conf | 36 ++++---------- - 2 files changed, 66 insertions(+), 27 deletions(-) - -diff --git a/ucm2/MediaTek/mt8195_demo/HiFi.conf b/ucm2/MediaTek/mt8195_demo/HiFi.conf -index 95f2b51..660b4ad 100644 ---- a/ucm2/MediaTek/mt8195_demo/HiFi.conf -+++ b/ucm2/MediaTek/mt8195_demo/HiFi.conf -@@ -1,3 +1,60 @@ -+SectionVerb { -+ -+ EnableSequence [ -+ cset "name='HDMI_OUT_MUX' Connect" -+ cset "name='DPTX_OUT_MUX' Connect" -+ cset "name='O176 I070 Switch' on" -+ cset "name='O177 I071 Switch' on" -+ cset "name='O034 I168 Switch' on" -+ cset "name='O035 I169 Switch' on" -+ cset "name='O036 I012 Switch' on" -+ cset "name='O037 I013 Switch' on" -+ cset "name='O072 I022 Switch' on" -+ cset "name='O073 I023 Switch' on" -+ cset "name='O074 I024 Switch' on" -+ cset "name='O075 I025 Switch' on" -+ cset "name='O076 I026 Switch' on" -+ cset "name='O077 I027 Switch' on" -+ cset "name='O078 I028 Switch' on" -+ cset "name='O079 I029 Switch' on" -+ cset "name='O002 I004 Switch' on" -+ cset "name='O003 I005 Switch' on" -+ cset "name='O004 I006 Switch' on" -+ cset "name='O005 I007 Switch' on" -+ cset "name='O006 I008 Switch' on" -+ cset "name='O007 I009 Switch' on" -+ cset "name='O008 I010 Switch' on" -+ cset "name='O009 I011 Switch' on" -+ ] -+ -+ DisableSequence [ -+ cset "name='HDMI_OUT_MUX' Disconnect" -+ cset "name='DPTX_OUT_MUX' Disconnect" -+ cset "name='O176 I070 Switch' off" -+ cset "name='O177 I071 Switch' off" -+ cset "name='O034 I168 Switch' off" -+ cset "name='O035 I169 Switch' off" -+ cset "name='O036 I012 Switch' off" -+ cset "name='O037 I013 Switch' off" -+ cset "name='O072 I022 Switch' off" -+ cset "name='O073 I023 Switch' off" -+ cset "name='O074 I024 Switch' off" -+ cset "name='O075 I025 Switch' off" -+ cset "name='O076 I026 Switch' off" -+ cset "name='O077 I027 Switch' off" -+ cset "name='O078 I028 Switch' off" -+ cset "name='O079 I029 Switch' off" -+ cset "name='O002 I004 Switch' off" -+ cset "name='O003 I005 Switch' off" -+ cset "name='O004 I006 Switch' off" -+ cset "name='O005 I007 Switch' off" -+ cset "name='O006 I008 Switch' off" -+ cset "name='O007 I009 Switch' off" -+ cset "name='O008 I010 Switch' off" -+ cset "name='O009 I011 Switch' off" -+ ] -+} -+ - SectionDevice."HDMI" { - Comment "Hdmi/DP output" - -diff --git a/ucm2/MediaTek/mt8195_demo/mt8195_demo.conf b/ucm2/MediaTek/mt8195_demo/mt8195_demo.conf -index c23dc37..896b6dc 100644 ---- a/ucm2/MediaTek/mt8195_demo/mt8195_demo.conf -+++ b/ucm2/MediaTek/mt8195_demo/mt8195_demo.conf -@@ -1,4 +1,4 @@ --Syntax 3 -+Syntax 2 - - SectionUseCase."HiFi" { - File "/MediaTek/mt8195_demo/HiFi.conf" -@@ -16,12 +16,12 @@ BootSequence [ - cset "name='PGA_L_Mux' AIN1" - cset "name='HDMI_OUT_MUX' Connect" - cset "name='DPTX_OUT_MUX' Connect" -+ # we need to enable all devices before starting PA. -+ # In our driver we use PCM, which means that we have -+ # to route Front End to a BackEnd and then only we can -+ # open a device. Without linking to BE it will fail. - cset "name='O176 I070 Switch' on" - cset "name='O177 I071 Switch' on" -- cset "name='O034 I168 Switch' on" -- cset "name='O035 I169 Switch' on" -- cset "name='O036 I012 Switch' on" -- cset "name='O037 I013 Switch' on" - cset "name='O072 I022 Switch' on" - cset "name='O073 I023 Switch' on" - cset "name='O074 I024 Switch' on" -@@ -30,6 +30,10 @@ BootSequence [ - cset "name='O077 I027 Switch' on" - cset "name='O078 I028 Switch' on" - cset "name='O079 I029 Switch' on" -+ cset "name='O034 I168 Switch' on" -+ cset "name='O035 I169 Switch' on" -+ cset "name='O036 I012 Switch' on" -+ cset "name='O037 I013 Switch' on" - cset "name='O002 I004 Switch' on" - cset "name='O003 I005 Switch' on" - cset "name='O004 I006 Switch' on" -@@ -38,26 +42,4 @@ BootSequence [ - cset "name='O007 I009 Switch' on" - cset "name='O008 I010 Switch' on" - cset "name='O009 I011 Switch' on" -- cset "name='O176 I070 Switch' off" -- cset "name='O177 I071 Switch' off" -- cset "name='O034 I168 Switch' off" -- cset "name='O035 I169 Switch' off" -- cset "name='O036 I012 Switch' off" -- cset "name='O037 I013 Switch' off" -- cset "name='O072 I022 Switch' off" -- cset "name='O073 I023 Switch' off" -- cset "name='O074 I024 Switch' off" -- cset "name='O075 I025 Switch' off" -- cset "name='O076 I026 Switch' off" -- cset "name='O077 I027 Switch' off" -- cset "name='O078 I028 Switch' off" -- cset "name='O079 I029 Switch' off" -- cset "name='O002 I004 Switch' off" -- cset "name='O003 I005 Switch' off" -- cset "name='O004 I006 Switch' off" -- cset "name='O005 I007 Switch' off" -- cset "name='O006 I008 Switch' off" -- cset "name='O007 I009 Switch' off" -- cset "name='O008 I010 Switch' off" -- cset "name='O009 I011 Switch' off" - ] --- -2.38.1 - - -From 5c865236e8de9fd75c741892fd3bd2cff62d4f3f Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 22 Nov 2022 09:54:22 +0100 -Subject: [PATCH 11/14] USB-Audio: the environment variable UCM_USB_PERIOD_TIME - may be undefined - -Fixes: 71ff24c ("USB-Audio: allow to configure period size for PCM split") -BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/240 -Signed-off-by: Jaroslav Kysela ---- - ucm2/USB-Audio/USB-Audio.conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf -index fdc29ec..1c11da9 100644 ---- a/ucm2/USB-Audio/USB-Audio.conf -+++ b/ucm2/USB-Audio/USB-Audio.conf -@@ -7,7 +7,7 @@ Define.SplitPCMPeriodTime 10000 # 10ms - If.env1 { - Condition { - Type String -- Empty "${env:UCM_USB_PERIOD_TIME}" -+ Empty "$${env:UCM_USB_PERIOD_TIME}" - } - False.Define.SplitPCMPeriodTime "${env:UCM_USB_PERIOD_TIME}" - } --- -2.38.1 - - -From 01e37f4fb7aab57e3f0051d81f5f6e5b2f15c831 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 21 Nov 2022 10:16:57 +0100 -Subject: [PATCH 12/14] HDA: DualCodecs - handle S/PDIF without analog - connections - -When no analog wires are connected, the S/PDIF output cannot be -selected in pipewire. Handle this for motherboards without Speaker -UCM device. - -Fixes: https://github.com/alsa-project/alsa-ucm-conf/issues/239 -Signed-off-by: Jaroslav Kysela ---- - ucm2/HDA/DualCodecs/HiFi.conf | 15 +++++++++++---- - 1 file changed, 11 insertions(+), 4 deletions(-) - -diff --git a/ucm2/HDA/DualCodecs/HiFi.conf b/ucm2/HDA/DualCodecs/HiFi.conf -index 10c9162..8c0f403 100644 ---- a/ucm2/HDA/DualCodecs/HiFi.conf -+++ b/ucm2/HDA/DualCodecs/HiFi.conf -@@ -66,13 +66,20 @@ SectionDevice."Line1" { - } - True.Value.PlaybackMixerElem "Front" - } -- If.1 { -+ # make S/PDIF output working when no analog jacks are connected -+ If.speaker { - Condition { - Type ControlExists -- Control "iface=CARD,name='Line Out Front Jack'" -+ Control "name='Speaker Playback Switch'" -+ } -+ True.If.1 { -+ Condition { -+ Type ControlExists -+ Control "iface=CARD,name='Line Out Front Jack'" -+ } -+ True.Value.JackControl "Line Out Front Jack" -+ False.Value.JackControl "Line Out Jack" - } -- True.Value.JackControl "Line Out Front Jack" -- False.Value.JackControl "Line Out Jack" - } - } - --- -2.38.1 - - -From 79a8ec44d3dcf097f4a4492c506cbcf338324175 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 7 Dec 2022 10:18:04 +0100 -Subject: [PATCH 13/14] ucm2: sof-hda-dsp: Update Mic LED settings - -Users expect to turn the LED on when only internal mic is off, but -it makes sense to turn this LED when all internal inputs are off. - -This configuration may be changed when the affected applications -are updated. - -BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2134824 -Signed-off-by: Jaroslav Kysela ---- - ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - -diff --git a/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf b/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf -index e6a8a15..9e85914 100644 ---- a/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf -+++ b/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf -@@ -9,7 +9,17 @@ If.devdmic { - Haystack "${CardComponents}" - Needle "cfg-dmics:" - } -- True.Define.DeviceDmic "Mic1" -+ True { -+ Define.DeviceDmic "Mic1" -+ FixedBootSequence [ -+ # -+ # users expect to turn the LED on when only internal -+ # mic is off, but it makes sense to turn this LED -+ # when all internal inputs are off -+ # -+ sysw "-/class/sound/ctl-led/mic/card${CardNumber}/detach:Capture Switch" -+ ] -+ } - True.Define.DeviceMic "Mic2" - } - --- -2.38.1 - - -From 9ce9ddb4a84fb467602b716575ea1d8f2bab0c39 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 7 Dec 2022 15:00:35 +0100 -Subject: [PATCH 14/14] ucm2: HDA: Update Mic LED settings for ACP DMIC - -Users expect to turn the LED on when only internal mic is off, but -it makes sense to turn this LED when all internal inputs are off. - -This configuration may be changed when the affected applications -are updated. - -BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2134824 -Signed-off-by: Jaroslav Kysela ---- - ucm2/HDA/HDA.conf | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/ucm2/HDA/HDA.conf b/ucm2/HDA/HDA.conf -index 64ffe83..47dfc05 100644 ---- a/ucm2/HDA/HDA.conf -+++ b/ucm2/HDA/HDA.conf -@@ -55,6 +55,7 @@ If.use { - cset-new "name='Mic ACP LED Capture Switch' type=bool,count=1 off" - exec "-/sbin/modprobe snd_ctl_led" - sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:Mic ACP LED Capture Switch" -+ sysw "-/class/sound/ctl-led/mic/card${CardNumber}/detach:Capture Switch" - ] - } - } --- -2.38.1 - From ec4e2ba2d77337378732d059f3a537b07c6e4d6e Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 16 May 2023 17:50:39 +0200 Subject: [PATCH 37/68] update ucm (nhlt-dmic-info) --- alsa-lib.spec | 5 +- alsa-ucm-conf.patch | 179 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 183 insertions(+), 1 deletion(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 64da136..58ffd41 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?prever_dot}%{?dist} License: LGPLv2+ URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Tue May 16 2023 Jaroslav Kysela - 1.2.9-2 +- update ucm (nhlt-dmic-info) + * Thu May 4 2023 Jaroslav Kysela - 1.2.9-1 - update to 1.2.9 diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index e69de29..836a828 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -0,0 +1,179 @@ +From 906f692e4ed84dc136c270c05e1b490a554de99b Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Thu, 4 May 2023 14:36:49 +0200 +Subject: [PATCH 1/3] sof-essx8336: Dmic is not a valid UCM device identifier, + use Mic + +Signed-off-by: Jaroslav Kysela +--- + ucm2/Intel/sof-essx8336/sof-essx8336.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ucm2/Intel/sof-essx8336/sof-essx8336.conf b/ucm2/Intel/sof-essx8336/sof-essx8336.conf +index f74e007..f579a45 100644 +--- a/ucm2/Intel/sof-essx8336/sof-essx8336.conf ++++ b/ucm2/Intel/sof-essx8336/sof-essx8336.conf +@@ -32,7 +32,7 @@ If.devdmic { + Haystack "${CardComponents}" + Needle "cfg-dmics:" + } +- True.Define.DeviceDmic "Dmic" ++ True.Define.DeviceDmic "Mic" + } + + SectionUseCase."HiFi" { +-- +2.39.2 + + +From 9fa70add76388087613d02b821acd656268060c4 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 16 May 2023 16:26:38 +0200 +Subject: [PATCH 2/3] sof-hda-dsp,sof-soundwire: add CaptureMicInfoFile fields + for dmics + +Signed-off-by: Jaroslav Kysela +--- + ucm2/Intel/sof-hda-dsp/HiFi.conf | 1 + + ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf | 3 +++ + ucm2/sof-soundwire/dmic.conf | 1 + + ucm2/sof-soundwire/rt715-sdca.conf | 11 ++++++----- + ucm2/sof-soundwire/rt715.conf | 1 + + ucm2/sof-soundwire/sof-soundwire.conf | 11 +++++++++++ + 6 files changed, 23 insertions(+), 5 deletions(-) + +diff --git a/ucm2/Intel/sof-hda-dsp/HiFi.conf b/ucm2/Intel/sof-hda-dsp/HiFi.conf +index 265949e..2063fc0 100644 +--- a/ucm2/Intel/sof-hda-dsp/HiFi.conf ++++ b/ucm2/Intel/sof-hda-dsp/HiFi.conf +@@ -22,6 +22,7 @@ If.dmic { + Value { + CapturePriority 100 + CapturePCM "hw:${CardId},6" ++ CaptureMicInfoFile "${var:LibDir}/dmics-nhlt.json" + If.chn { + Condition { + Type RegexMatch +diff --git a/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf b/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf +index e430a7b..44acd69 100644 +--- a/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf ++++ b/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf +@@ -12,6 +12,7 @@ If.devdmic { + True { + Define.DeviceDmic "Mic1" + Define.DeviceMic "Mic2" ++ Include.card-init.File "/lib/card-init.conf" + FixedBootSequence [ + # + # users expect to turn the LED on when only internal +@@ -19,6 +20,8 @@ If.devdmic { + # when all internal inputs are off + # + sysw "-/class/sound/ctl-led/mic/card${CardNumber}/detach:Capture Switch" ++ # dmic array info ++ exec "-nhlt-dmic-info -o ${var:LibDir}/dmics-nhlt.json" + ] + } + } +diff --git a/ucm2/sof-soundwire/dmic.conf b/ucm2/sof-soundwire/dmic.conf +index 755840a..c53d381 100644 +--- a/ucm2/sof-soundwire/dmic.conf ++++ b/ucm2/sof-soundwire/dmic.conf +@@ -17,5 +17,6 @@ SectionDevice."Mic" { + CaptureMixerElem "Dmic0" + CaptureVolume "Dmic0 Capture Volume" + CaptureSwitch "Dmic0 Capture Switch" ++ CaptureMicInfoFile "${var:LibDir}/dmics-nhlt.json" + } + } +diff --git a/ucm2/sof-soundwire/rt715-sdca.conf b/ucm2/sof-soundwire/rt715-sdca.conf +index 6e481e1..268a247 100644 +--- a/ucm2/sof-soundwire/rt715-sdca.conf ++++ b/ucm2/sof-soundwire/rt715-sdca.conf +@@ -12,10 +12,11 @@ SectionDevice."Mic" { + ] + + Value { +- CapturePriority 100 +- CapturePCM "hw:${CardId},4" +- CaptureSwitch "rt714 FU02 Capture Switch" +- CaptureVolume "rt714 FU02 Capture Volume" +- CaptureMixerElem "rt714 FU02" ++ CapturePriority 100 ++ CapturePCM "hw:${CardId},4" ++ CaptureSwitch "rt714 FU02 Capture Switch" ++ CaptureVolume "rt714 FU02 Capture Volume" ++ CaptureMixerElem "rt714 FU02" ++ CaptureMicInfoFile "${var:LibDir}/dmics-nhlt.json" + } + } +diff --git a/ucm2/sof-soundwire/rt715.conf b/ucm2/sof-soundwire/rt715.conf +index a733c08..090b663 100644 +--- a/ucm2/sof-soundwire/rt715.conf ++++ b/ucm2/sof-soundwire/rt715.conf +@@ -26,5 +26,6 @@ SectionDevice."Mic" { + CaptureSwitch "${var:rt715ctl} Switch" + CaptureVolume "${var:rt715ctl} Volume" + CaptureMixerElem "${var:rt715ctl}" ++ CaptureMicInfoFile "${var:LibDir}/dmics-nhlt.json" + } + } +diff --git a/ucm2/sof-soundwire/sof-soundwire.conf b/ucm2/sof-soundwire/sof-soundwire.conf +index 786ba63..3368d65 100644 +--- a/ucm2/sof-soundwire/sof-soundwire.conf ++++ b/ucm2/sof-soundwire/sof-soundwire.conf +@@ -92,3 +92,14 @@ If.pga_init_pga5 { + cset "name='PGA5.0 5 Master Capture Switch' 1" + ] + } ++ ++If.mics-array { ++ Condition { ++ Type String ++ Empty "${var:Mics1}" ++ } ++ False.FixedBootSequence { ++ # dmic array info ++ exec "-nhlt-dmic-info -o ${var:LibDir}/dmics-nhlt.json" ++ } ++} +-- +2.39.2 + + +From 5cdbc7e283cd80994f31f2e2a3f4df8af778ccb8 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 16 May 2023 17:39:00 +0200 +Subject: [PATCH 3/3] sof-hda-dsp: move card-init include to top + +... otherwise the rm is called after the nhlt-dmic-info + +Signed-off-by: Jaroslav Kysela +--- + ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf b/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf +index 44acd69..98098e7 100644 +--- a/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf ++++ b/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf +@@ -3,6 +3,8 @@ Syntax 6 + Define.DeviceMic "Mic" + Define.DeviceDmic "" + ++Include.card-init.File "/lib/card-init.conf" ++ + If.devdmic { + Condition { + Type String +@@ -12,7 +14,6 @@ If.devdmic { + True { + Define.DeviceDmic "Mic1" + Define.DeviceMic "Mic2" +- Include.card-init.File "/lib/card-init.conf" + FixedBootSequence [ + # + # users expect to turn the LED on when only internal +-- +2.39.2 + From 2e7fc81a6d585209711f061407fa3f94c77c6e6a Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 6 Jun 2023 20:06:33 +0200 Subject: [PATCH 38/68] update licenses to SPDX format --- alsa-lib.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 58ffd41..7713f4e 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,8 +9,8 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 2%{?prever_dot}%{?dist} -License: LGPLv2+ +Release: 3%{?prever_dot}%{?dist} +License: LGPL-2.1-or-later URL: http://www.alsa-project.org/ Source: ftp://ftp.alsa-project.org/pub/lib/%{name}-%{version}%{?prever}%{?postver}.tar.bz2 @@ -51,7 +51,7 @@ against the ALSA libraries and interfaces. %package -n alsa-ucm Summary: ALSA Use Case Manager configuration BuildArch: noarch -License: BSD +License: BSD-3-Clause Requires: %{name} >= %{version_alsa_lib} %description -n alsa-ucm @@ -61,7 +61,7 @@ contains alsa-lib configuration of Audio input/output names and routing %package -n alsa-topology Summary: ALSA Topology configuration BuildArch: noarch -License: BSD +License: BSD-3-Clause Requires: %{name} >= %{version_alsa_lib} %description -n alsa-topology @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Tue Jun 6 2023 Jaroslav Kysela - 1.2.9-3 +- SPDX licences + * Tue May 16 2023 Jaroslav Kysela - 1.2.9-2 - update ucm (nhlt-dmic-info) From 5281fc6ccad39c844e027f517e7a10a2783a9f09 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 19 Jul 2023 13:09:34 +0000 Subject: [PATCH 39/68] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- alsa-lib.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 7713f4e..2efade0 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 3%{?prever_dot}%{?dist} +Release: 4%{?prever_dot}%{?dist} License: LGPL-2.1-or-later URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Wed Jul 19 2023 Fedora Release Engineering - 1.2.9-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Tue Jun 6 2023 Jaroslav Kysela - 1.2.9-3 - SPDX licences From ace9ef33a642b696bc1837aa7f8dee0ff7df29d3 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 1 Sep 2023 18:21:55 +0200 Subject: [PATCH 40/68] update to 1.2.10 Signed-off-by: Jaroslav Kysela --- alsa-lib.spec | 11 ++- alsa-ucm-conf.patch | 179 -------------------------------------------- sources | 4 +- 3 files changed, 9 insertions(+), 185 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 2efade0..386a27d 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,14 +2,14 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.9 -%define version_alsa_ucm 1.2.9 +%define version_alsa_lib 1.2.10 +%define version_alsa_ucm 1.2.10 %define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 4%{?prever_dot}%{?dist} +Release: 1%{?prever_dot}%{?dist} License: LGPL-2.1-or-later URL: http://www.alsa-project.org/ @@ -22,7 +22,7 @@ Source12: modprobe-dist-oss.conf Source40: alsa-ucm-conf.patch Patch0: alsa-git.patch Patch1: alsa-lib-1.2.3.1-config.patch -Patch2: alsa-lib-1.0.14-glibc-open.patch +Patch2: alsa-lib-1.2.10-glibc-open.patch BuildRequires: doxygen BuildRequires: autoconf automake libtool @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Fri Sep 1 2023 Jaroslav Kysela - 1.2.10-1 +- update to 1.2.10 + * Wed Jul 19 2023 Fedora Release Engineering - 1.2.9-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index 836a828..e69de29 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -1,179 +0,0 @@ -From 906f692e4ed84dc136c270c05e1b490a554de99b Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Thu, 4 May 2023 14:36:49 +0200 -Subject: [PATCH 1/3] sof-essx8336: Dmic is not a valid UCM device identifier, - use Mic - -Signed-off-by: Jaroslav Kysela ---- - ucm2/Intel/sof-essx8336/sof-essx8336.conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ucm2/Intel/sof-essx8336/sof-essx8336.conf b/ucm2/Intel/sof-essx8336/sof-essx8336.conf -index f74e007..f579a45 100644 ---- a/ucm2/Intel/sof-essx8336/sof-essx8336.conf -+++ b/ucm2/Intel/sof-essx8336/sof-essx8336.conf -@@ -32,7 +32,7 @@ If.devdmic { - Haystack "${CardComponents}" - Needle "cfg-dmics:" - } -- True.Define.DeviceDmic "Dmic" -+ True.Define.DeviceDmic "Mic" - } - - SectionUseCase."HiFi" { --- -2.39.2 - - -From 9fa70add76388087613d02b821acd656268060c4 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 16 May 2023 16:26:38 +0200 -Subject: [PATCH 2/3] sof-hda-dsp,sof-soundwire: add CaptureMicInfoFile fields - for dmics - -Signed-off-by: Jaroslav Kysela ---- - ucm2/Intel/sof-hda-dsp/HiFi.conf | 1 + - ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf | 3 +++ - ucm2/sof-soundwire/dmic.conf | 1 + - ucm2/sof-soundwire/rt715-sdca.conf | 11 ++++++----- - ucm2/sof-soundwire/rt715.conf | 1 + - ucm2/sof-soundwire/sof-soundwire.conf | 11 +++++++++++ - 6 files changed, 23 insertions(+), 5 deletions(-) - -diff --git a/ucm2/Intel/sof-hda-dsp/HiFi.conf b/ucm2/Intel/sof-hda-dsp/HiFi.conf -index 265949e..2063fc0 100644 ---- a/ucm2/Intel/sof-hda-dsp/HiFi.conf -+++ b/ucm2/Intel/sof-hda-dsp/HiFi.conf -@@ -22,6 +22,7 @@ If.dmic { - Value { - CapturePriority 100 - CapturePCM "hw:${CardId},6" -+ CaptureMicInfoFile "${var:LibDir}/dmics-nhlt.json" - If.chn { - Condition { - Type RegexMatch -diff --git a/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf b/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf -index e430a7b..44acd69 100644 ---- a/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf -+++ b/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf -@@ -12,6 +12,7 @@ If.devdmic { - True { - Define.DeviceDmic "Mic1" - Define.DeviceMic "Mic2" -+ Include.card-init.File "/lib/card-init.conf" - FixedBootSequence [ - # - # users expect to turn the LED on when only internal -@@ -19,6 +20,8 @@ If.devdmic { - # when all internal inputs are off - # - sysw "-/class/sound/ctl-led/mic/card${CardNumber}/detach:Capture Switch" -+ # dmic array info -+ exec "-nhlt-dmic-info -o ${var:LibDir}/dmics-nhlt.json" - ] - } - } -diff --git a/ucm2/sof-soundwire/dmic.conf b/ucm2/sof-soundwire/dmic.conf -index 755840a..c53d381 100644 ---- a/ucm2/sof-soundwire/dmic.conf -+++ b/ucm2/sof-soundwire/dmic.conf -@@ -17,5 +17,6 @@ SectionDevice."Mic" { - CaptureMixerElem "Dmic0" - CaptureVolume "Dmic0 Capture Volume" - CaptureSwitch "Dmic0 Capture Switch" -+ CaptureMicInfoFile "${var:LibDir}/dmics-nhlt.json" - } - } -diff --git a/ucm2/sof-soundwire/rt715-sdca.conf b/ucm2/sof-soundwire/rt715-sdca.conf -index 6e481e1..268a247 100644 ---- a/ucm2/sof-soundwire/rt715-sdca.conf -+++ b/ucm2/sof-soundwire/rt715-sdca.conf -@@ -12,10 +12,11 @@ SectionDevice."Mic" { - ] - - Value { -- CapturePriority 100 -- CapturePCM "hw:${CardId},4" -- CaptureSwitch "rt714 FU02 Capture Switch" -- CaptureVolume "rt714 FU02 Capture Volume" -- CaptureMixerElem "rt714 FU02" -+ CapturePriority 100 -+ CapturePCM "hw:${CardId},4" -+ CaptureSwitch "rt714 FU02 Capture Switch" -+ CaptureVolume "rt714 FU02 Capture Volume" -+ CaptureMixerElem "rt714 FU02" -+ CaptureMicInfoFile "${var:LibDir}/dmics-nhlt.json" - } - } -diff --git a/ucm2/sof-soundwire/rt715.conf b/ucm2/sof-soundwire/rt715.conf -index a733c08..090b663 100644 ---- a/ucm2/sof-soundwire/rt715.conf -+++ b/ucm2/sof-soundwire/rt715.conf -@@ -26,5 +26,6 @@ SectionDevice."Mic" { - CaptureSwitch "${var:rt715ctl} Switch" - CaptureVolume "${var:rt715ctl} Volume" - CaptureMixerElem "${var:rt715ctl}" -+ CaptureMicInfoFile "${var:LibDir}/dmics-nhlt.json" - } - } -diff --git a/ucm2/sof-soundwire/sof-soundwire.conf b/ucm2/sof-soundwire/sof-soundwire.conf -index 786ba63..3368d65 100644 ---- a/ucm2/sof-soundwire/sof-soundwire.conf -+++ b/ucm2/sof-soundwire/sof-soundwire.conf -@@ -92,3 +92,14 @@ If.pga_init_pga5 { - cset "name='PGA5.0 5 Master Capture Switch' 1" - ] - } -+ -+If.mics-array { -+ Condition { -+ Type String -+ Empty "${var:Mics1}" -+ } -+ False.FixedBootSequence { -+ # dmic array info -+ exec "-nhlt-dmic-info -o ${var:LibDir}/dmics-nhlt.json" -+ } -+} --- -2.39.2 - - -From 5cdbc7e283cd80994f31f2e2a3f4df8af778ccb8 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 16 May 2023 17:39:00 +0200 -Subject: [PATCH 3/3] sof-hda-dsp: move card-init include to top - -... otherwise the rm is called after the nhlt-dmic-info - -Signed-off-by: Jaroslav Kysela ---- - ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf b/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf -index 44acd69..98098e7 100644 ---- a/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf -+++ b/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf -@@ -3,6 +3,8 @@ Syntax 6 - Define.DeviceMic "Mic" - Define.DeviceDmic "" - -+Include.card-init.File "/lib/card-init.conf" -+ - If.devdmic { - Condition { - Type String -@@ -12,7 +14,6 @@ If.devdmic { - True { - Define.DeviceDmic "Mic1" - Define.DeviceMic "Mic2" -- Include.card-init.File "/lib/card-init.conf" - FixedBootSequence [ - # - # users expect to turn the LED on when only internal --- -2.39.2 - diff --git a/sources b/sources index d92c338..98f5c7a 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.9.tar.bz2) = 8f39c8166c3648d46695a9287d9b9a35e5bfffed11d79e868ff7aba92d0fee792e82784186ebeb2a3e44d6b617c916025c7fce9a802565bb8e0dc8fdcce2311a -SHA512 (alsa-ucm-conf-1.2.9.tar.bz2) = 3aced4d4df76044a5525f1217851e05f7ad177389d2008e3e3dd0fb4d2cf72cd0897b140659a7729cc37d5b737c2d0cf5b607df4f576647044accd560d8cb87b +SHA512 (alsa-lib-1.2.10.tar.bz2) = 4ccbd1dc5a612044571c26290923009e4c3f7959b30a5d0bed47daa68bbefaff9059c4f0fa3bc16f22c1eed2d36f079139369f40243da5921ae4de02a4541939 +SHA512 (alsa-ucm-conf-1.2.10.tar.bz2) = 172956a2c127e9afa5be9c6ada43bfa9fda825823f8f6acbe252edef3381afe3adfa3299c1419f04375599be7721a551c6800be99db44b091611aeb824ffcd72 SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 From ed9a35b694134fa8067a6fa414ecf72a82ca5dca Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 1 Sep 2023 18:22:57 +0200 Subject: [PATCH 41/68] add missing alsa-lib-1.2.10-glibc-open.patch Signed-off-by: Jaroslav Kysela --- alsa-lib-1.2.10-glibc-open.patch | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 alsa-lib-1.2.10-glibc-open.patch diff --git a/alsa-lib-1.2.10-glibc-open.patch b/alsa-lib-1.2.10-glibc-open.patch new file mode 100644 index 0000000..2e53a92 --- /dev/null +++ b/alsa-lib-1.2.10-glibc-open.patch @@ -0,0 +1,10 @@ +--- alsa-lib-1.2.10/aserver/aserver.c~ 2023-09-01 17:35:48.000000000 +0200 ++++ alsa-lib-1.2.10/aserver/aserver.c 2023-09-01 18:13:11.339601685 +0200 +@@ -35,6 +35,7 @@ + #include + #include + ++#undef open + + char *command; + From 77501925abf95a09e8df8773be7c55cbb37e9760 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 1 Sep 2023 18:23:43 +0200 Subject: [PATCH 42/68] remove alsa-lib-1.0.14-glibc-open.patch Signed-off-by: Jaroslav Kysela --- alsa-lib-1.0.14-glibc-open.patch | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 alsa-lib-1.0.14-glibc-open.patch diff --git a/alsa-lib-1.0.14-glibc-open.patch b/alsa-lib-1.0.14-glibc-open.patch deleted file mode 100644 index bc625bd..0000000 --- a/alsa-lib-1.0.14-glibc-open.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- alsa-lib-1.0.14/aserver/aserver.c 2007-05-31 10:05:13.000000000 +0200 -+++ alsa-lib-1.0.14.lennart/aserver/aserver.c 2007-08-15 15:53:32.000000000 +0200 -@@ -35,6 +35,8 @@ - - #include "aserver.h" - -+#undef open -+ - char *command; - - #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) From bf0d819031cefc68093f7b7375dd1b6c2c947c1d Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 4 Sep 2023 10:19:43 +0200 Subject: [PATCH 43/68] fix control.h header file (ump) Signed-off-by: Jaroslav Kysela --- alsa-git.patch | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++ alsa-lib.spec | 5 ++- 2 files changed, 86 insertions(+), 1 deletion(-) diff --git a/alsa-git.patch b/alsa-git.patch index e69de29..3ba704a 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -0,0 +1,82 @@ +From 9685505bf438467d9b11919b332b066d3a1c94d0 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 4 Sep 2023 09:37:29 +0200 +Subject: [PATCH 1/2] gitcompile: Add static build + +Signed-off-by: Jaroslav Kysela +--- + gitcompile | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/gitcompile b/gitcompile +index 0fe092ce..c70448f7 100755 +--- a/gitcompile ++++ b/gitcompile +@@ -32,6 +32,10 @@ if [ $# -ne 0 ]; then + lto="-flto -flto-partition=none" + echo "Forced lto build..." + shift ;; ++ static) ++ static=yes ++ echo "Selected static build..." ++ shift ;; + *) + endloop=yes + ;; +@@ -75,6 +79,12 @@ if [ "$python2" = "yes" ]; then + args="$args --enable-python2" + fi + ++if [ "$static" = "yes" ]; then ++ #args="$args --enable-shared=no --enable-static=yes" ++ args="$args --disable-shared" ++fi ++ ++ + touch ltconfig + libtoolize --force --copy --automake + aclocal $ACLOCAL_FLAGS +-- +2.41.0 + + +From fcce13a6726c52882bd8b7131c61c4eba308792c Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 4 Sep 2023 09:38:26 +0200 +Subject: [PATCH 2/2] control.h: Fix ump header file detection +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Apparently, the control.h is used from apps separately (outside +asoundlib.h). Avoid errors like: + +/usr/include/alsa/control.h:417:47: error: ‘snd_ump_endpoint_info_t’ has not been declared + 417 | int snd_ctl_ump_endpoint_info(snd_ctl_t *ctl, snd_ump_endpoint_info_t *info); + | ^~~~~~~~~~~~~~~~~~~~~~~ +/usr/include/alsa/control.h:418:44: error: ‘snd_ump_block_info_t’ has not been declared + 418 | int snd_ctl_ump_block_info(snd_ctl_t *ctl, snd_ump_block_info_t *info); + | ^~~~~~~~~~~~~~~~~~~~ + +Fixes: https://github.com/alsa-project/alsa-lib/issues/348 +Signed-off-by: Jaroslav Kysela +--- + include/control.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/control.h b/include/control.h +index ab482ba4..e7541d56 100644 +--- a/include/control.h ++++ b/include/control.h +@@ -413,6 +413,8 @@ int snd_ctl_pcm_prefer_subdevice(snd_ctl_t *ctl, int subdev); + int snd_ctl_rawmidi_next_device(snd_ctl_t *ctl, int * device); + int snd_ctl_rawmidi_info(snd_ctl_t *ctl, snd_rawmidi_info_t * info); + int snd_ctl_rawmidi_prefer_subdevice(snd_ctl_t *ctl, int subdev); ++#endif ++#ifdef __ALSA_UMP_H + int snd_ctl_ump_next_device(snd_ctl_t *ctl, int *device); + int snd_ctl_ump_endpoint_info(snd_ctl_t *ctl, snd_ump_endpoint_info_t *info); + int snd_ctl_ump_block_info(snd_ctl_t *ctl, snd_ump_block_info_t *info); +-- +2.41.0 + diff --git a/alsa-lib.spec b/alsa-lib.spec index 386a27d..38c30a9 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?prever_dot}%{?dist} License: LGPL-2.1-or-later URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Mon Sep 4 2023 Jaroslav Kysela - 1.2.10-2 +- fix control.h header file (ump) + * Fri Sep 1 2023 Jaroslav Kysela - 1.2.10-1 - update to 1.2.10 From 313e6bd3442251c75a92604db2e6cf8cad193db2 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 4 Sep 2023 17:17:29 +0200 Subject: [PATCH 44/68] fix SplitPCM (alsa-ucm) Signed-off-by: Jaroslav Kysela --- alsa-lib.spec | 5 +++-- alsa-ucm-conf.patch | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 38c30a9..62ca19b 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -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,8 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog -* Mon Sep 4 2023 Jaroslav Kysela - 1.2.10-2 +* Mon Sep 4 2023 Jaroslav Kysela - 1.2.10-3 - fix control.h header file (ump) +- fix SplitPCM (alsa-ucm) * Fri Sep 1 2023 Jaroslav Kysela - 1.2.10-1 - update to 1.2.10 diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index e69de29..bd3790c 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -0,0 +1,28 @@ +From b68aa52acdd2763fedad5eec0f435fbf43e5ccc6 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 4 Sep 2023 16:39:52 +0200 +Subject: [PATCH] SplitPCM: Device argument may not be set + +Link: https://github.com/alsa-project/alsa-ucm-conf/issues/346 +Fixes: 10967ea ("SplitPCM: Fix Device variable in SplitPCMDevice macro") +Signed-off-by: Jaroslav Kysela +--- + ucm2/common/pcm/split.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ucm2/common/pcm/split.conf b/ucm2/common/pcm/split.conf +index 80f23e6..9ed2f95 100644 +--- a/ucm2/common/pcm/split.conf ++++ b/ucm2/common/pcm/split.conf +@@ -326,7 +326,7 @@ DefineMacro.SplitPCMDevice { + If.0 { + Condition { + Type String +- Empty "${var:__Device}" ++ Empty "${var:-__Device}" + } + True.Define.__Device "0" + } +-- +2.41.0 + From e928063161a31a1c55e2d84912ffce40ffd21d80 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 19 Jan 2024 12:44:50 +0000 Subject: [PATCH 45/68] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- alsa-lib.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 62ca19b..3340a62 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 3%{?prever_dot}%{?dist} +Release: 4%{?prever_dot}%{?dist} License: LGPL-2.1-or-later URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Fri Jan 19 2024 Fedora Release Engineering - 1.2.10-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Mon Sep 4 2023 Jaroslav Kysela - 1.2.10-3 - fix control.h header file (ump) - fix SplitPCM (alsa-ucm) From 286a38aadf5877ef44ecb970865d228b58fdbb6b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Mon, 22 Jan 2024 22:56:09 +0000 Subject: [PATCH 46/68] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- alsa-lib.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 3340a62..132f9bc 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 4%{?prever_dot}%{?dist} +Release: 5%{?prever_dot}%{?dist} License: LGPL-2.1-or-later URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Mon Jan 22 2024 Fedora Release Engineering - 1.2.10-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Fri Jan 19 2024 Fedora Release Engineering - 1.2.10-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 92b901cd68ba0f956eb518deb1a946ffccaee659 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 29 Jan 2024 14:22:58 +0100 Subject: [PATCH 47/68] update to 1.2.11 Signed-off-by: Jaroslav Kysela --- alsa-git.patch | 82 --------------------------------------------- alsa-lib.spec | 9 +++-- alsa-ucm-conf.patch | 28 ---------------- sources | 4 +-- 4 files changed, 8 insertions(+), 115 deletions(-) diff --git a/alsa-git.patch b/alsa-git.patch index 3ba704a..e69de29 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -1,82 +0,0 @@ -From 9685505bf438467d9b11919b332b066d3a1c94d0 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 4 Sep 2023 09:37:29 +0200 -Subject: [PATCH 1/2] gitcompile: Add static build - -Signed-off-by: Jaroslav Kysela ---- - gitcompile | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/gitcompile b/gitcompile -index 0fe092ce..c70448f7 100755 ---- a/gitcompile -+++ b/gitcompile -@@ -32,6 +32,10 @@ if [ $# -ne 0 ]; then - lto="-flto -flto-partition=none" - echo "Forced lto build..." - shift ;; -+ static) -+ static=yes -+ echo "Selected static build..." -+ shift ;; - *) - endloop=yes - ;; -@@ -75,6 +79,12 @@ if [ "$python2" = "yes" ]; then - args="$args --enable-python2" - fi - -+if [ "$static" = "yes" ]; then -+ #args="$args --enable-shared=no --enable-static=yes" -+ args="$args --disable-shared" -+fi -+ -+ - touch ltconfig - libtoolize --force --copy --automake - aclocal $ACLOCAL_FLAGS --- -2.41.0 - - -From fcce13a6726c52882bd8b7131c61c4eba308792c Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 4 Sep 2023 09:38:26 +0200 -Subject: [PATCH 2/2] control.h: Fix ump header file detection -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Apparently, the control.h is used from apps separately (outside -asoundlib.h). Avoid errors like: - -/usr/include/alsa/control.h:417:47: error: ‘snd_ump_endpoint_info_t’ has not been declared - 417 | int snd_ctl_ump_endpoint_info(snd_ctl_t *ctl, snd_ump_endpoint_info_t *info); - | ^~~~~~~~~~~~~~~~~~~~~~~ -/usr/include/alsa/control.h:418:44: error: ‘snd_ump_block_info_t’ has not been declared - 418 | int snd_ctl_ump_block_info(snd_ctl_t *ctl, snd_ump_block_info_t *info); - | ^~~~~~~~~~~~~~~~~~~~ - -Fixes: https://github.com/alsa-project/alsa-lib/issues/348 -Signed-off-by: Jaroslav Kysela ---- - include/control.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/include/control.h b/include/control.h -index ab482ba4..e7541d56 100644 ---- a/include/control.h -+++ b/include/control.h -@@ -413,6 +413,8 @@ int snd_ctl_pcm_prefer_subdevice(snd_ctl_t *ctl, int subdev); - int snd_ctl_rawmidi_next_device(snd_ctl_t *ctl, int * device); - int snd_ctl_rawmidi_info(snd_ctl_t *ctl, snd_rawmidi_info_t * info); - int snd_ctl_rawmidi_prefer_subdevice(snd_ctl_t *ctl, int subdev); -+#endif -+#ifdef __ALSA_UMP_H - int snd_ctl_ump_next_device(snd_ctl_t *ctl, int *device); - int snd_ctl_ump_endpoint_info(snd_ctl_t *ctl, snd_ump_endpoint_info_t *info); - int snd_ctl_ump_block_info(snd_ctl_t *ctl, snd_ump_block_info_t *info); --- -2.41.0 - diff --git a/alsa-lib.spec b/alsa-lib.spec index 132f9bc..069fdb6 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,14 +2,14 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.10 -%define version_alsa_ucm 1.2.10 +%define version_alsa_lib 1.2.11 +%define version_alsa_ucm 1.2.11 %define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 5%{?prever_dot}%{?dist} +Release: 1%{?prever_dot}%{?dist} License: LGPL-2.1-or-later URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Mon Jan 29 2024 Jaroslav Kysela - 1.2.11-1 +- update to 1.2.11 + * Mon Jan 22 2024 Fedora Release Engineering - 1.2.10-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index bd3790c..e69de29 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -1,28 +0,0 @@ -From b68aa52acdd2763fedad5eec0f435fbf43e5ccc6 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Mon, 4 Sep 2023 16:39:52 +0200 -Subject: [PATCH] SplitPCM: Device argument may not be set - -Link: https://github.com/alsa-project/alsa-ucm-conf/issues/346 -Fixes: 10967ea ("SplitPCM: Fix Device variable in SplitPCMDevice macro") -Signed-off-by: Jaroslav Kysela ---- - ucm2/common/pcm/split.conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ucm2/common/pcm/split.conf b/ucm2/common/pcm/split.conf -index 80f23e6..9ed2f95 100644 ---- a/ucm2/common/pcm/split.conf -+++ b/ucm2/common/pcm/split.conf -@@ -326,7 +326,7 @@ DefineMacro.SplitPCMDevice { - If.0 { - Condition { - Type String -- Empty "${var:__Device}" -+ Empty "${var:-__Device}" - } - True.Define.__Device "0" - } --- -2.41.0 - diff --git a/sources b/sources index 98f5c7a..3416e13 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.10.tar.bz2) = 4ccbd1dc5a612044571c26290923009e4c3f7959b30a5d0bed47daa68bbefaff9059c4f0fa3bc16f22c1eed2d36f079139369f40243da5921ae4de02a4541939 -SHA512 (alsa-ucm-conf-1.2.10.tar.bz2) = 172956a2c127e9afa5be9c6ada43bfa9fda825823f8f6acbe252edef3381afe3adfa3299c1419f04375599be7721a551c6800be99db44b091611aeb824ffcd72 +SHA512 (alsa-lib-1.2.11.tar.bz2) = 7497329811cf63adb605c75a6d5b75e7871eab9549c9e91f98299ab0d63a78040b4ab47bf2bfc28264b8afe85e7406627277bcddc0720efaf492444bd6ca4da8 +SHA512 (alsa-ucm-conf-1.2.11.tar.bz2) = b202e7410a579789be0005564b4868f70bca0fd8664c02add95fc9ff90ab64faebda978fbd3e83a3274c37242dccf8efbebd03f529e35ca3033daf55f425cb8d SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 From d50c4594a0a6f8b9ef6b86593e11d002b74055d8 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 29 Jan 2024 17:27:31 +0100 Subject: [PATCH 48/68] update 1.2.11 source package --- alsa-lib.spec | 4 ++-- sources | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 069fdb6..b84cb6d 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?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 -* Mon Jan 29 2024 Jaroslav Kysela - 1.2.11-1 +* Mon Jan 29 2024 Jaroslav Kysela - 1.2.11-2 - update to 1.2.11 * Mon Jan 22 2024 Fedora Release Engineering - 1.2.10-5 diff --git a/sources b/sources index 3416e13..0d62672 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.11.tar.bz2) = 7497329811cf63adb605c75a6d5b75e7871eab9549c9e91f98299ab0d63a78040b4ab47bf2bfc28264b8afe85e7406627277bcddc0720efaf492444bd6ca4da8 +SHA512 (alsa-lib-1.2.11.tar.bz2) = 7bf2c541dff5262c0302a1c716ca10cdb5105f4e0ad48f3341c3c7e975b0c3ea835a298a05974c3e216a85912c368d8025ba3cdda3ff04a7683133ce5b2a286d SHA512 (alsa-ucm-conf-1.2.11.tar.bz2) = b202e7410a579789be0005564b4868f70bca0fd8664c02add95fc9ff90ab64faebda978fbd3e83a3274c37242dccf8efbebd03f529e35ca3033daf55f425cb8d SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 From 205206c994296c769db195ea5e3b87abbd017b14 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 10 Jun 2024 14:19:37 +0200 Subject: [PATCH 49/68] update to 1.2.12 Signed-off-by: Jaroslav Kysela --- alsa-lib.spec | 13 ++++++++----- sources | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index b84cb6d..499037f 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,14 +2,14 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.11 -%define version_alsa_ucm 1.2.11 +%define version_alsa_lib 1.2.12 +%define version_alsa_ucm 1.2.12 %define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 2%{?prever_dot}%{?dist} +Release: 1%{?prever_dot}%{?dist} License: LGPL-2.1-or-later URL: http://www.alsa-project.org/ @@ -20,7 +20,7 @@ Source10: asound.conf Source11: modprobe-dist-alsa.conf Source12: modprobe-dist-oss.conf Source40: alsa-ucm-conf.patch -Patch0: alsa-git.patch +#Patch0: alsa-git.patch Patch1: alsa-lib-1.2.3.1-config.patch Patch2: alsa-lib-1.2.10-glibc-open.patch @@ -70,7 +70,7 @@ contains alsa-lib configuration of SoC topology %prep %setup -q -n %{name}-%{version}%{?prever}%{?postver} -%patch -P0 -p1 -b .alsa-git +#patch -P0 -p1 -b .alsa-git %patch -P1 -p1 -b .config %patch -P2 -p1 -b .glibc-open @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Mon Jun 10 2024 Jaroslav Kysela - 1.2.12-1 +- update to 1.2.12 + * Mon Jan 29 2024 Jaroslav Kysela - 1.2.11-2 - update to 1.2.11 diff --git a/sources b/sources index 0d62672..a2a4b9b 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.11.tar.bz2) = 7bf2c541dff5262c0302a1c716ca10cdb5105f4e0ad48f3341c3c7e975b0c3ea835a298a05974c3e216a85912c368d8025ba3cdda3ff04a7683133ce5b2a286d -SHA512 (alsa-ucm-conf-1.2.11.tar.bz2) = b202e7410a579789be0005564b4868f70bca0fd8664c02add95fc9ff90ab64faebda978fbd3e83a3274c37242dccf8efbebd03f529e35ca3033daf55f425cb8d +SHA512 (alsa-lib-1.2.12.tar.bz2) = 053e36e51c0ff28f07028b89c8845b50682a5c14035ab85c2fc8cae2f2f0d05e4cd45ed879602c15c1596fb7fe84bfd50ec0d119dfb55c66589a2d458a9b317d +SHA512 (alsa-ucm-conf-1.2.12.tar.bz2) = 391dde123271172d899c04865d1d6e21b4ad0060ee9b2256dfbc6fc89ad48edcaa43c861893ab0e5c70d972e20d15c528defc19c00308e7465f13f954cce25d7 SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 From 943c8b44cd77286843a25a88f9ab8986130be8a8 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 17 Jul 2024 16:52:40 +0000 Subject: [PATCH 50/68] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- alsa-lib.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 499037f..23e2730 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?prever_dot}%{?dist} License: LGPL-2.1-or-later URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Wed Jul 17 2024 Fedora Release Engineering - 1.2.12-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Mon Jun 10 2024 Jaroslav Kysela - 1.2.12-1 - update to 1.2.12 From 0d731622177e1031766b78a5d675747df9106977 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 12 Nov 2024 13:11:57 +0100 Subject: [PATCH 51/68] update to 1.2.13 Signed-off-by: Jaroslav Kysela --- alsa-lib.spec | 9 ++++++--- sources | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 23e2730..1566e84 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,14 +2,14 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.12 -%define version_alsa_ucm 1.2.12 +%define version_alsa_lib 1.2.13 +%define version_alsa_ucm 1.2.13 %define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 2%{?prever_dot}%{?dist} +Release: 1%{?prever_dot}%{?dist} License: LGPL-2.1-or-later URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Tue Nov 12 2024 Jaroslav Kysela - 1.2.13-1 +- update to 1.2.13 + * Wed Jul 17 2024 Fedora Release Engineering - 1.2.12-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild diff --git a/sources b/sources index a2a4b9b..e7b27b3 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.12.tar.bz2) = 053e36e51c0ff28f07028b89c8845b50682a5c14035ab85c2fc8cae2f2f0d05e4cd45ed879602c15c1596fb7fe84bfd50ec0d119dfb55c66589a2d458a9b317d -SHA512 (alsa-ucm-conf-1.2.12.tar.bz2) = 391dde123271172d899c04865d1d6e21b4ad0060ee9b2256dfbc6fc89ad48edcaa43c861893ab0e5c70d972e20d15c528defc19c00308e7465f13f954cce25d7 +SHA512 (alsa-lib-1.2.13.tar.bz2) = b0c0666e38e881dca985b61386523c045c71072a88be4952c986ffbe2107ec736da528858ebeffdf439de5c290914bf3facc654100a228c6d26fff9429142ef0 +SHA512 (alsa-ucm-conf-1.2.13.tar.bz2) = cad867268851ac178f3a5378a00e292184b0e0ec7955f297ae7ed56073d3dddb06c08666b23b1bf6b0065068a9370ee34608bd687763658c79d34b64059b1c85 SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 From e561588491e96907c4d5523ae0a13d724bf0462f Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 13 Nov 2024 16:26:28 +0100 Subject: [PATCH 52/68] fix SOF HDA UCM configuration Signed-off-by: Jaroslav Kysela --- alsa-lib.spec | 4 +- alsa-ucm-conf.patch | 101 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 2 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 1566e84..adf2731 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?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 -* Tue Nov 12 2024 Jaroslav Kysela - 1.2.13-1 +* Wed Nov 13 2024 Jaroslav Kysela - 1.2.13-2 - update to 1.2.13 * Wed Jul 17 2024 Fedora Release Engineering - 1.2.12-2 diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch index e69de29..ff46a0c 100644 --- a/alsa-ucm-conf.patch +++ b/alsa-ucm-conf.patch @@ -0,0 +1,101 @@ +From 11b028a9a01e47fc9b48e4a566803752011902e2 Mon Sep 17 00:00:00 2001 +From: Seppo Ingalsuo +Date: Wed, 13 Nov 2024 14:48:38 +0200 +Subject: [PATCH 1/2] UCM2: Intel: sof-hda-dsp: Fix handling of empty + sys_vendor + +The mistake in UCM syntax caused in alsaucm start error: + +ALSA lib ucm_cond.c:367:(if_eval) unknown If.Condition.Type + +Fixes: 13022a97711d ("sof-hda-dsp: Fix the case where sysfs dmi + sys_vendor attribute is not set") + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/463 +Signed-off-by: Seppo Ingalsuo +Signed-off-by: Jaroslav Kysela +--- + ucm2/Intel/sof-hda-dsp/HiFi-sof.conf | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf b/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf +index fea8159..c755ba2 100644 +--- a/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf ++++ b/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf +@@ -6,8 +6,8 @@ Define.SOFVendor "$${sys:devices/virtual/dmi/id/sys_vendor}" + + If.SOFVendor { + Condition { +- Type Empty +- String "${var:SOFVendor}" ++ Type String ++ Empty "${var:SOFVendor}" + } + True.Define.SOFVendor "${sys:devices/virtual/dmi/id/board_vendor}" + } +-- +2.47.0 + + +From 6397c663d7086b87ca5cbba323ea3dcd0ecd3200 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 13 Nov 2024 16:19:15 +0100 +Subject: [PATCH 2/2] sof-hda-dsp: Fix the case where sysfs dmi product_name + attribute is not set + + !!DMI Information + !!--------------- + + Manufacturer: + Product Name: + Product Version: + Firmware Version: R6G07 + System SKU: Default string + Board Vendor: Default string + Board Name: Default string + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2292583 +Signed-off-by: Jaroslav Kysela +--- + ucm2/Intel/sof-hda-dsp/HiFi-sof.conf | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf b/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf +index c755ba2..5fd1843 100644 +--- a/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf ++++ b/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf +@@ -3,6 +3,7 @@ + # File paths for controlling SOF processing + + Define.SOFVendor "$${sys:devices/virtual/dmi/id/sys_vendor}" ++Define.SOFProduct "$${sys:devices/virtual/dmi/id/product_name}" + + If.SOFVendor { + Condition { +@@ -12,6 +13,14 @@ If.SOFVendor { + True.Define.SOFVendor "${sys:devices/virtual/dmi/id/board_vendor}" + } + ++If.SOFProduct { ++ Condition { ++ Type String ++ Empty "${var:SOFProduct}" ++ } ++ True.Define.SOFProduct "${sys:devices/virtual/dmi/id/board_name}" ++} ++ + If.SOFIPCVer { + Condition { + Type ControlExists +@@ -43,7 +52,7 @@ If.SOFPath { + HeadphoneIirBlob "${var:BlobPath}/eq_iir/pass.blob" + HeadphoneFirBlob "${var:BlobPath}/eq_fir/pass.blob" + HeadphoneDrcBlob "${var:BlobPath}/drc/passthrough.blob" +- ConfPathFromDMI "${var:SOFVendor}/${sys:devices/virtual/dmi/id/product_name}.conf" ++ ConfPathFromDMI "${var:SOFVendor}/${var:SOFProduct}" + SOFProductConfig "/blobs/sof/product_configs/${var:ConfPathFromDMI}" + SOFConfFullPath "${ConfTopDir}${var:SOFProductConfig}" + SOFUserConfig "/blobs/sof/user_configs/${var:ConfPathFromDMI}" +-- +2.47.0 + From 67fd486ada26ad3b84298565ea8c5e4562fefa90 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 15 Nov 2024 09:34:14 +0100 Subject: [PATCH 53/68] fix snd_seq_has_queue_tempo_base symbol version Signed-off-by: Jaroslav Kysela --- alsa-git.patch | 42 ++++++++++++++++++++++++++++++++++++++++++ alsa-lib.spec | 4 ++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/alsa-git.patch b/alsa-git.patch index e69de29..1f6cb46 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -0,0 +1,42 @@ +From 76edab4e595bd5f3f4c636cccc8d7976d3c519d6 Mon Sep 17 00:00:00 2001 +From: Nicholas Vinson +Date: Thu, 14 Nov 2024 07:49:53 -0500 +Subject: [PATCH] src/Versions.in.in: Update *_tempo_base name + +Change @SYMBOL_PREFIX@snd_has_tempo_base to +@SYMBOL_PREFIX@snd_has_queue_tempo_base. + +Starting with version 1.2.13, alsa-lib fails to link with ld.lld-19 due +to "version script assignment of 'ALSA_1.2.13' to symbol +'snd_seq_has_tempo_base' failed: symbol not defined". + +Per commit 769d1db1b0a213a39c7e59c0d1d724e7f45b1ac3 the correct name for +the symbol is @SYMBOL_PREFIX@snd_has_queue_tempo_base; therefore, update +src/Vesions.in.in to match. + +Fixes bug #420 +Fixes Gentoo bug 943399 (https://bugs.gentoo.org/943399) + +Closes: https://github.com/alsa-project/alsa-lib/pull/421 +Signed-off-by: Nicholas Vinson +Signed-off-by: Jaroslav Kysela +--- + src/Versions.in.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Versions.in.in b/src/Versions.in.in +index 350ec3d8..7ad6a633 100644 +--- a/src/Versions.in.in ++++ b/src/Versions.in.in +@@ -212,7 +212,7 @@ ALSA_1.2.13 { + @SYMBOL_PREFIX@snd_seq_create_ump_block; + @SYMBOL_PREFIX@snd_seq_queue_tempo_get_tempo_base; + @SYMBOL_PREFIX@snd_seq_queue_tempo_set_tempo_base; +- @SYMBOL_PREFIX@snd_seq_has_tempo_base; ++ @SYMBOL_PREFIX@snd_seq_has_queue_tempo_base; + @SYMBOL_PREFIX@snd_seq_port_info_get_ump_is_midi1; + @SYMBOL_PREFIX@snd_seq_port_info_set_ump_is_midi1; + #endif +-- +2.47.0 + diff --git a/alsa-lib.spec b/alsa-lib.spec index adf2731..ff2f85c 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -20,7 +20,7 @@ Source10: asound.conf Source11: modprobe-dist-alsa.conf Source12: modprobe-dist-oss.conf Source40: alsa-ucm-conf.patch -#Patch0: alsa-git.patch +Patch0: alsa-git.patch Patch1: alsa-lib-1.2.3.1-config.patch Patch2: alsa-lib-1.2.10-glibc-open.patch @@ -70,7 +70,7 @@ contains alsa-lib configuration of SoC topology %prep %setup -q -n %{name}-%{version}%{?prever}%{?postver} -#patch -P0 -p1 -b .alsa-git +%patch -P0 -p1 -b .alsa-git %patch -P1 -p1 -b .config %patch -P2 -p1 -b .glibc-open From 220911de7a16ed3d8db3b967552c0aabe6edc96b Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 15 Nov 2024 09:40:05 +0100 Subject: [PATCH 54/68] fix snd_seq_has_queue_tempo_base symbol version #2 Signed-off-by: Jaroslav Kysela --- alsa-lib.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index ff2f85c..b1c8552 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -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 -* Wed Nov 13 2024 Jaroslav Kysela - 1.2.13-2 +* Fri Nov 15 2024 Jaroslav Kysela - 1.2.13-3 - update to 1.2.13 * Wed Jul 17 2024 Fedora Release Engineering - 1.2.12-2 From ce98cbeca1abddcb2bdf9fd33728bc2cf0ea22f9 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 16 Jan 2025 10:54:10 +0000 Subject: [PATCH 55/68] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- alsa-lib.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index b1c8552..963b312 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 3%{?prever_dot}%{?dist} +Release: 4%{?prever_dot}%{?dist} License: LGPL-2.1-or-later URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Thu Jan 16 2025 Fedora Release Engineering - 1.2.13-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Fri Nov 15 2024 Jaroslav Kysela - 1.2.13-3 - update to 1.2.13 From ecc98ea4c403640f7f250ea6366346f8d2beaf2f Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 14 Apr 2025 11:11:13 +0200 Subject: [PATCH 56/68] update to 1.2.14 Signed-off-by: Jaroslav Kysela --- alsa-git.patch | 42 ------------------ alsa-lib.spec | 17 +++++--- alsa-ucm-conf.patch | 101 -------------------------------------------- sources | 4 +- 4 files changed, 12 insertions(+), 152 deletions(-) delete mode 100644 alsa-git.patch delete mode 100644 alsa-ucm-conf.patch diff --git a/alsa-git.patch b/alsa-git.patch deleted file mode 100644 index 1f6cb46..0000000 --- a/alsa-git.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 76edab4e595bd5f3f4c636cccc8d7976d3c519d6 Mon Sep 17 00:00:00 2001 -From: Nicholas Vinson -Date: Thu, 14 Nov 2024 07:49:53 -0500 -Subject: [PATCH] src/Versions.in.in: Update *_tempo_base name - -Change @SYMBOL_PREFIX@snd_has_tempo_base to -@SYMBOL_PREFIX@snd_has_queue_tempo_base. - -Starting with version 1.2.13, alsa-lib fails to link with ld.lld-19 due -to "version script assignment of 'ALSA_1.2.13' to symbol -'snd_seq_has_tempo_base' failed: symbol not defined". - -Per commit 769d1db1b0a213a39c7e59c0d1d724e7f45b1ac3 the correct name for -the symbol is @SYMBOL_PREFIX@snd_has_queue_tempo_base; therefore, update -src/Vesions.in.in to match. - -Fixes bug #420 -Fixes Gentoo bug 943399 (https://bugs.gentoo.org/943399) - -Closes: https://github.com/alsa-project/alsa-lib/pull/421 -Signed-off-by: Nicholas Vinson -Signed-off-by: Jaroslav Kysela ---- - src/Versions.in.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/Versions.in.in b/src/Versions.in.in -index 350ec3d8..7ad6a633 100644 ---- a/src/Versions.in.in -+++ b/src/Versions.in.in -@@ -212,7 +212,7 @@ ALSA_1.2.13 { - @SYMBOL_PREFIX@snd_seq_create_ump_block; - @SYMBOL_PREFIX@snd_seq_queue_tempo_get_tempo_base; - @SYMBOL_PREFIX@snd_seq_queue_tempo_set_tempo_base; -- @SYMBOL_PREFIX@snd_seq_has_tempo_base; -+ @SYMBOL_PREFIX@snd_seq_has_queue_tempo_base; - @SYMBOL_PREFIX@snd_seq_port_info_get_ump_is_midi1; - @SYMBOL_PREFIX@snd_seq_port_info_set_ump_is_midi1; - #endif --- -2.47.0 - diff --git a/alsa-lib.spec b/alsa-lib.spec index 963b312..0fd0ae6 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,14 +2,14 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.13 -%define version_alsa_ucm 1.2.13 +%define version_alsa_lib 1.2.14 +%define version_alsa_ucm 1.2.14 %define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 4%{?prever_dot}%{?dist} +Release: 1%{?prever_dot}%{?dist} License: LGPL-2.1-or-later URL: http://www.alsa-project.org/ @@ -19,8 +19,8 @@ Source2: ftp://ftp.alsa-project.org/pub/lib/alsa-topology-conf-%{version_alsa_t Source10: asound.conf Source11: modprobe-dist-alsa.conf Source12: modprobe-dist-oss.conf -Source40: alsa-ucm-conf.patch -Patch0: alsa-git.patch +#Source40: alsa-ucm-conf.patch +#Patch0: alsa-git.patch Patch1: alsa-lib-1.2.3.1-config.patch Patch2: alsa-lib-1.2.10-glibc-open.patch @@ -70,7 +70,7 @@ contains alsa-lib configuration of SoC topology %prep %setup -q -n %{name}-%{version}%{?prever}%{?postver} -%patch -P0 -p1 -b .alsa-git +#patch -P0 -p1 -b .alsa-git %patch -P1 -p1 -b .config %patch -P2 -p1 -b .glibc-open @@ -116,7 +116,7 @@ mkdir -p %{buildroot}/%{_datadir}/alsa/ucm2 # Unpack UCMs tar xvjf %{SOURCE1} -C %{buildroot}/%{_datadir}/alsa --strip-components=1 "*/ucm" "*/ucm2" -patch -d %{buildroot}/%{_datadir}/alsa -p1 < %{SOURCE40} +#patch -d %{buildroot}/%{_datadir}/alsa -p1 < %{SOURCE40} # Create topology directory mkdir -p %{buildroot}/%{_datadir}/alsa/topology @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Mon Apr 14 2025 Jaroslav Kysela - 1.2.14-1 +- update to 1.2.14 + * Thu Jan 16 2025 Fedora Release Engineering - 1.2.13-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch deleted file mode 100644 index ff46a0c..0000000 --- a/alsa-ucm-conf.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 11b028a9a01e47fc9b48e4a566803752011902e2 Mon Sep 17 00:00:00 2001 -From: Seppo Ingalsuo -Date: Wed, 13 Nov 2024 14:48:38 +0200 -Subject: [PATCH 1/2] UCM2: Intel: sof-hda-dsp: Fix handling of empty - sys_vendor - -The mistake in UCM syntax caused in alsaucm start error: - -ALSA lib ucm_cond.c:367:(if_eval) unknown If.Condition.Type - -Fixes: 13022a97711d ("sof-hda-dsp: Fix the case where sysfs dmi - sys_vendor attribute is not set") - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/463 -Signed-off-by: Seppo Ingalsuo -Signed-off-by: Jaroslav Kysela ---- - ucm2/Intel/sof-hda-dsp/HiFi-sof.conf | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf b/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf -index fea8159..c755ba2 100644 ---- a/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf -+++ b/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf -@@ -6,8 +6,8 @@ Define.SOFVendor "$${sys:devices/virtual/dmi/id/sys_vendor}" - - If.SOFVendor { - Condition { -- Type Empty -- String "${var:SOFVendor}" -+ Type String -+ Empty "${var:SOFVendor}" - } - True.Define.SOFVendor "${sys:devices/virtual/dmi/id/board_vendor}" - } --- -2.47.0 - - -From 6397c663d7086b87ca5cbba323ea3dcd0ecd3200 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 13 Nov 2024 16:19:15 +0100 -Subject: [PATCH 2/2] sof-hda-dsp: Fix the case where sysfs dmi product_name - attribute is not set - - !!DMI Information - !!--------------- - - Manufacturer: - Product Name: - Product Version: - Firmware Version: R6G07 - System SKU: Default string - Board Vendor: Default string - Board Name: Default string - -BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2292583 -Signed-off-by: Jaroslav Kysela ---- - ucm2/Intel/sof-hda-dsp/HiFi-sof.conf | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) - -diff --git a/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf b/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf -index c755ba2..5fd1843 100644 ---- a/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf -+++ b/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf -@@ -3,6 +3,7 @@ - # File paths for controlling SOF processing - - Define.SOFVendor "$${sys:devices/virtual/dmi/id/sys_vendor}" -+Define.SOFProduct "$${sys:devices/virtual/dmi/id/product_name}" - - If.SOFVendor { - Condition { -@@ -12,6 +13,14 @@ If.SOFVendor { - True.Define.SOFVendor "${sys:devices/virtual/dmi/id/board_vendor}" - } - -+If.SOFProduct { -+ Condition { -+ Type String -+ Empty "${var:SOFProduct}" -+ } -+ True.Define.SOFProduct "${sys:devices/virtual/dmi/id/board_name}" -+} -+ - If.SOFIPCVer { - Condition { - Type ControlExists -@@ -43,7 +52,7 @@ If.SOFPath { - HeadphoneIirBlob "${var:BlobPath}/eq_iir/pass.blob" - HeadphoneFirBlob "${var:BlobPath}/eq_fir/pass.blob" - HeadphoneDrcBlob "${var:BlobPath}/drc/passthrough.blob" -- ConfPathFromDMI "${var:SOFVendor}/${sys:devices/virtual/dmi/id/product_name}.conf" -+ ConfPathFromDMI "${var:SOFVendor}/${var:SOFProduct}" - SOFProductConfig "/blobs/sof/product_configs/${var:ConfPathFromDMI}" - SOFConfFullPath "${ConfTopDir}${var:SOFProductConfig}" - SOFUserConfig "/blobs/sof/user_configs/${var:ConfPathFromDMI}" --- -2.47.0 - diff --git a/sources b/sources index e7b27b3..9e16b4d 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.13.tar.bz2) = b0c0666e38e881dca985b61386523c045c71072a88be4952c986ffbe2107ec736da528858ebeffdf439de5c290914bf3facc654100a228c6d26fff9429142ef0 -SHA512 (alsa-ucm-conf-1.2.13.tar.bz2) = cad867268851ac178f3a5378a00e292184b0e0ec7955f297ae7ed56073d3dddb06c08666b23b1bf6b0065068a9370ee34608bd687763658c79d34b64059b1c85 +SHA512 (alsa-lib-1.2.14.tar.bz2) = af7c405f8e0dbe3b4420c3e414c6ab1b0abf7802d0b8b986ae2762ed11e1c8259eb7aa9101fadc4258da5997d94da2f6f7baeb254435c554c2e33fc1c9bb0eb7 +SHA512 (alsa-ucm-conf-1.2.14.tar.bz2) = a224e890919306bdcd606dfb873b089950c9fa89f24c02947692ee8ab1a05c419f2a8dc174440d17c8a9575cab293806630f2cb43d74677f7ef0d956b7883dc5 SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 From ab1b5f63036d1bf38932aa87757c680e50855686 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 14 Apr 2025 18:52:51 +0200 Subject: [PATCH 57/68] use updated tar ball Signed-off-by: Jaroslav Kysela --- alsa-lib.spec | 4 ++-- sources | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 0fd0ae6..6b8b1a4 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?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 -* Mon Apr 14 2025 Jaroslav Kysela - 1.2.14-1 +* Mon Apr 14 2025 Jaroslav Kysela - 1.2.14-2 - update to 1.2.14 * Thu Jan 16 2025 Fedora Release Engineering - 1.2.13-4 diff --git a/sources b/sources index 9e16b4d..99910eb 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.14.tar.bz2) = af7c405f8e0dbe3b4420c3e414c6ab1b0abf7802d0b8b986ae2762ed11e1c8259eb7aa9101fadc4258da5997d94da2f6f7baeb254435c554c2e33fc1c9bb0eb7 +SHA512 (alsa-lib-1.2.14.tar.bz2) = 2716cc3a2299da4a1a170d734af082d78dc452b253179d0f1a9ec190140734aecf002b6924eec4ff2699ce88ce1ae5c56821c267f36384910984db726d1f9626 SHA512 (alsa-ucm-conf-1.2.14.tar.bz2) = a224e890919306bdcd606dfb873b089950c9fa89f24c02947692ee8ab1a05c419f2a8dc174440d17c8a9575cab293806630f2cb43d74677f7ef0d956b7883dc5 SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 From 9535a12c2cc5597418baa3baa4b3f8ca888734a5 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 24 Jun 2025 15:24:30 +0200 Subject: [PATCH 58/68] update alsa-ucm-conf files to latest Signed-off-by: Jaroslav Kysela --- alsa-git.patch | 31 + alsa-lib.spec | 13 +- alsa-ucm-conf.patch | 2374 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 2413 insertions(+), 5 deletions(-) create mode 100644 alsa-git.patch create mode 100644 alsa-ucm-conf.patch diff --git a/alsa-git.patch b/alsa-git.patch new file mode 100644 index 0000000..ded7dfb --- /dev/null +++ b/alsa-git.patch @@ -0,0 +1,31 @@ +From 07ec2ad34c42dba8656d3f543164f360f481c52e Mon Sep 17 00:00:00 2001 +From: Daniel Dadap +Date: Thu, 15 May 2025 08:32:35 -0500 +Subject: [PATCH] conf: aliases: add hda-acpi -> HDA-Intel alias + +The new snd_hda_acpi driver in Linux exposes the existing Azalia +interface to non-PCI devices advertised over ACPI. Add an alias +to the existing HDA-Intel configuration file so that devices using +this driver can be discovered properly. + +Signed-off-by: Daniel Dadap +Signed-off-by: Takashi Iwai +--- + src/conf/cards/aliases.conf | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/conf/cards/aliases.conf b/src/conf/cards/aliases.conf +index a54824ae..e2d59aa7 100644 +--- a/src/conf/cards/aliases.conf ++++ b/src/conf/cards/aliases.conf +@@ -57,6 +57,7 @@ CMI8786 cards.CMI8788 + CMI8787 cards.CMI8788 + pistachio cards.pistachio-card + VC4-HDMI cards.vc4-hdmi ++hda-acpi cards.HDA-Intel + + + +-- +2.49.0 + diff --git a/alsa-lib.spec b/alsa-lib.spec index 6b8b1a4..2e492b4 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -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/ @@ -19,8 +19,8 @@ Source2: ftp://ftp.alsa-project.org/pub/lib/alsa-topology-conf-%{version_alsa_t Source10: asound.conf Source11: modprobe-dist-alsa.conf Source12: modprobe-dist-oss.conf -#Source40: alsa-ucm-conf.patch -#Patch0: alsa-git.patch +Source40: alsa-ucm-conf.patch +Patch0: alsa-git.patch Patch1: alsa-lib-1.2.3.1-config.patch Patch2: alsa-lib-1.2.10-glibc-open.patch @@ -70,7 +70,7 @@ contains alsa-lib configuration of SoC topology %prep %setup -q -n %{name}-%{version}%{?prever}%{?postver} -#patch -P0 -p1 -b .alsa-git +%patch -P0 -p1 -b .alsa-git %patch -P1 -p1 -b .config %patch -P2 -p1 -b .glibc-open @@ -116,7 +116,7 @@ mkdir -p %{buildroot}/%{_datadir}/alsa/ucm2 # Unpack UCMs tar xvjf %{SOURCE1} -C %{buildroot}/%{_datadir}/alsa --strip-components=1 "*/ucm" "*/ucm2" -#patch -d %{buildroot}/%{_datadir}/alsa -p1 < %{SOURCE40} +patch -d %{buildroot}/%{_datadir}/alsa -p1 < %{SOURCE40} # Create topology directory mkdir -p %{buildroot}/%{_datadir}/alsa/topology @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Tue Jan 24 2025 Jaroslav Kysela - 1.2.14-3 +- update to latest alsa-ucm-conf files + * Mon Apr 14 2025 Jaroslav Kysela - 1.2.14-2 - update to 1.2.14 diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch new file mode 100644 index 0000000..917177c --- /dev/null +++ b/alsa-ucm-conf.patch @@ -0,0 +1,2374 @@ +From 25f519f66c3e496b21ca1ad83ebc6114dfaa9fc3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Maja=20K=C4=85dzio=C5=82ka?= +Date: Tue, 22 Apr 2025 07:46:21 +0200 +Subject: [PATCH 01/24] acp3x-alc5682-max98357: Fix path of HiFi.conf +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/551 +Closes: https://github.com/alsa-project/alsa-ucm-conf/issues/550 +Fixes: 1048796e7fa9 ("Rename ucm2/AMD/acp3xalc5682m98 to ucm2/AMD/acp3x-alc5682-max98357") +Signed-off-by: Maja Kądziołka +Signed-off-by: Jaroslav Kysela +--- + ucm2/AMD/acp3x-alc5682-max98357/acp3x-alc5682-max98357.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ucm2/AMD/acp3x-alc5682-max98357/acp3x-alc5682-max98357.conf b/ucm2/AMD/acp3x-alc5682-max98357/acp3x-alc5682-max98357.conf +index e1f1c9e..5b3f24a 100644 +--- a/ucm2/AMD/acp3x-alc5682-max98357/acp3x-alc5682-max98357.conf ++++ b/ucm2/AMD/acp3x-alc5682-max98357/acp3x-alc5682-max98357.conf +@@ -66,7 +66,7 @@ If.found { + Empty "${var:Found}" + } + False.SectionUseCase."HiFi" { +- File "/AMD/acp3xalc5682m98/HiFi.conf" ++ File "HiFi.conf" + Comment "Default" + } + } +-- +2.49.0 + + +From ac64586ab4ad3a0f162af3ec8a196bfd3799c5c0 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Fri, 25 Apr 2025 11:47:20 +0200 +Subject: [PATCH 02/24] USB-Audio: Remove useless sections for Solid State Labs + SSL 2+ + +Signed-off-by: Jaroslav Kysela +--- + ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf b/ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf +index d07e499..94e040f 100644 +--- a/ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf ++++ b/ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf +@@ -28,14 +28,6 @@ Macro [ + SectionDevice."Line1" { + Comment "Line Outputs 1/L + 2/R" + +- EnableSequence [ +- cdev "hw:${CardId}" +- ] +- +- DisableSequence [ +- cdev "hw:${CardId}" +- ] +- + Value { + PlaybackPriority 200 + } +-- +2.49.0 + + +From fc17ed4f991836bb92f288b8714ad7efe6c05926 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Fri, 25 Apr 2025 11:53:11 +0200 +Subject: [PATCH 03/24] USB-Audio: Solid State Labs SSL 2+ - fix capture + channels + +It seems that there are 4 capture channels per report in issue #552: + + Capture: + Status: Stop + Interface 2 + Altset 1 + Format: S32_LE + Channels: 4 + Endpoint: 0x81 (1 IN) (ASYNC) + Rates: 44100, 48000, 88200, 96000, 176400, 192000 + Data packet interval: 125 us + Bits: 24 + Channel map: FL FR FC LFE + +Closes: https://github.com/alsa-project/alsa-ucm-conf/issues/552 +Signed-off-by: Jaroslav Kysela +--- + ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf | 6 +++--- + ucm2/USB-Audio/SolidStateLabs/SSL2Plus.conf | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf b/ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf +index 94e040f..30160d3 100644 +--- a/ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf ++++ b/ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf +@@ -18,7 +18,7 @@ Macro [ + Name "ssl2plus_mono_in" + Direction Capture + Channels 1 +- HWChannels 2 ++ HWChannels 4 + HWChannelPos0 MONO + HWChannelPos1 MONO + } +@@ -70,7 +70,7 @@ SectionDevice."Mic1" { + Macro.pcm_split.SplitPCMDevice { + Name "ssl2plus_mono_in" + Direction Capture +- HWChannels 2 ++ HWChannels 4 + Channels 1 + Channel0 0 + ChannelPos0 MONO +@@ -86,7 +86,7 @@ SectionDevice."Mic2" { + Macro.pcm_split.SplitPCMDevice { + Name "ssl2plus_mono_in" + Direction Capture +- HWChannels 2 ++ HWChannels 4 + Channels 1 + Channel0 1 + ChannelPos0 MONO +diff --git a/ucm2/USB-Audio/SolidStateLabs/SSL2Plus.conf b/ucm2/USB-Audio/SolidStateLabs/SSL2Plus.conf +index 2ffe4c4..c886593 100644 +--- a/ucm2/USB-Audio/SolidStateLabs/SSL2Plus.conf ++++ b/ucm2/USB-Audio/SolidStateLabs/SSL2Plus.conf +@@ -6,6 +6,6 @@ SectionUseCase."HiFi" { + } + + Define.DirectPlaybackChannels 4 +-Define.DirectCaptureChannels 2 ++Define.DirectCaptureChannels 4 + + Include.dhw.File "/common/direct.conf" +-- +2.49.0 + + +From 6c2177e856ffa884929ba84de2ba379b80e054a3 Mon Sep 17 00:00:00 2001 +From: Konrad Dybcio +Date: Mon, 14 Apr 2025 20:47:38 +0200 +Subject: [PATCH 04/24] ucm2: Qualcomm: x1e80100: Also match DMI board name + +The Surface Laptop 7 only says "Microsoft Corporation" and "Surface" +in the board_vendor and product_family fields respectively. Add another +field to match on. + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/546 +Signed-off-by: Konrad Dybcio +Signed-off-by: Jaroslav Kysela +--- + ucm2/Qualcomm/x1e80100/x1e80100.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ucm2/Qualcomm/x1e80100/x1e80100.conf b/ucm2/Qualcomm/x1e80100/x1e80100.conf +index 3f89986..3eef4d4 100644 +--- a/ucm2/Qualcomm/x1e80100/x1e80100.conf ++++ b/ucm2/Qualcomm/x1e80100/x1e80100.conf +@@ -1,6 +1,6 @@ + Syntax 4 + +-Define.DMI_info "${sys:devices/virtual/dmi/id/board_vendor}-${sys:devices/virtual/dmi/id/product_family}" ++Define.DMI_info "${sys:devices/virtual/dmi/id/board_vendor}-${sys:devices/virtual/dmi/id/product_family}-${sys:devices/virtual/dmi/id/board_name}" + + If.LENOVOT14s { + Condition { +-- +2.49.0 + + +From c93b7c8cc3137180cf1e91af2dd212bbf604b66f Mon Sep 17 00:00:00 2001 +From: Konrad Dybcio +Date: Mon, 14 Apr 2025 20:47:38 +0200 +Subject: [PATCH 05/24] ucm2: Qualcomm: Add Surface Laptop 7 + +2 speakers, 2 dmics, combo jack, just like the T14s - reuse its +configuration + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/546 +Signed-off-by: Konrad Dybcio +Signed-off-by: Jaroslav Kysela +--- + ucm2/Qualcomm/x1e80100/x1e80100.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ucm2/Qualcomm/x1e80100/x1e80100.conf b/ucm2/Qualcomm/x1e80100/x1e80100.conf +index 3eef4d4..10faf5f 100644 +--- a/ucm2/Qualcomm/x1e80100/x1e80100.conf ++++ b/ucm2/Qualcomm/x1e80100/x1e80100.conf +@@ -6,7 +6,7 @@ If.LENOVOT14s { + Condition { + Type RegexMatch + String "${var:DMI_info}" +- Regex "LENOVO.*Think((Pad T14s Gen 6.*)|(Book 16 G7 QOY))|(HP.*Omnibook X.*)|(ASUSTeK COMPUTER.*ASUS Zenbook A14)" ++ Regex "LENOVO.*Think((Pad T14s Gen 6.*)|(Book 16 G7 QOY))|(HP.*Omnibook X.*)|(ASUSTeK COMPUTER.*ASUS Zenbook A14)|(Microsoft Corporation.*Surface.*Microsoft Surface Laptop, 7th Edition)" + } + True.Include.t14s.File "/Qualcomm/x1e80100/LENOVO-T14s.conf" + } +-- +2.49.0 + + +From 9105573b6cb71c4821d88e6eef0c4b2cfbb4ea61 Mon Sep 17 00:00:00 2001 +From: Svyatoslav Ryhel +Date: Sun, 27 Apr 2025 13:02:19 +0300 +Subject: [PATCH 06/24] tegra: max98089: fix cset names + +Adjust configs to match Linux kernel MAX98089 codec driver change. + +Fixes: 725570f9 ("ASoC: max98088: Remove duplicate DACs") + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/556 +Signed-off-by: Svyatoslav Ryhel +Signed-off-by: Jaroslav Kysela +--- + ucm2/Tegra/max98089/lge-x3-HiFi.conf | 24 +++++---------- + ucm2/Tegra/max98089/lge-x3-VoiceCall.conf | 36 ++++++++--------------- + ucm2/Tegra/max98089/lge-x3.conf | 6 ++-- + 3 files changed, 22 insertions(+), 44 deletions(-) + +diff --git a/ucm2/Tegra/max98089/lge-x3-HiFi.conf b/ucm2/Tegra/max98089/lge-x3-HiFi.conf +index 3738d72..d074b9f 100644 +--- a/ucm2/Tegra/max98089/lge-x3-HiFi.conf ++++ b/ucm2/Tegra/max98089/lge-x3-HiFi.conf +@@ -11,20 +11,16 @@ SectionDevice."Speaker" { + cset "name='Speaker Switch' on" + cset "name='Int Spk Switch' on" + +- cset "name='Left SPK Mixer Left DAC1 Switch' on" +- cset "name='Left SPK Mixer Left DAC2 Switch' on" +- cset "name='Left SPK Mixer Right DAC1 Switch' on" +- cset "name='Left SPK Mixer Right DAC2 Switch' on" ++ cset "name='Left SPK Mixer Left DAC Switch' on" ++ cset "name='Left SPK Mixer Right DAC Switch' on" + ] + + DisableSequence [ + cset "name='Speaker Switch' off" + cset "name='Int Spk Switch' off" + +- cset "name='Left SPK Mixer Left DAC1 Switch' off" +- cset "name='Left SPK Mixer Left DAC2 Switch' off" +- cset "name='Left SPK Mixer Right DAC1 Switch' off" +- cset "name='Left SPK Mixer Right DAC2 Switch' off" ++ cset "name='Left SPK Mixer Left DAC Switch' off" ++ cset "name='Left SPK Mixer Right DAC Switch' off" + ] + + Value { +@@ -46,19 +42,15 @@ SectionDevice."Headphones" { + EnableSequence [ + cset "name='Headphone Switch' on" + +- cset "name='Left HP Mixer Left DAC1 Switch' on" +- cset "name='Left HP Mixer Left DAC2 Switch' on" +- cset "name='Right HP Mixer Right DAC1 Switch' on" +- cset "name='Right HP Mixer Right DAC2 Switch' on" ++ cset "name='Left HP Mixer Left DAC Switch' on" ++ cset "name='Right HP Mixer Right DAC Switch' on" + ] + + DisableSequence [ + cset "name='Headphone Switch' off" + +- cset "name='Left HP Mixer Left DAC1 Switch' off" +- cset "name='Left HP Mixer Left DAC2 Switch' off" +- cset "name='Right HP Mixer Right DAC1 Switch' off" +- cset "name='Right HP Mixer Right DAC2 Switch' off" ++ cset "name='Left HP Mixer Left DAC Switch' off" ++ cset "name='Right HP Mixer Right DAC Switch' off" + ] + + Value { +diff --git a/ucm2/Tegra/max98089/lge-x3-VoiceCall.conf b/ucm2/Tegra/max98089/lge-x3-VoiceCall.conf +index 1634c7b..8e3a389 100644 +--- a/ucm2/Tegra/max98089/lge-x3-VoiceCall.conf ++++ b/ucm2/Tegra/max98089/lge-x3-VoiceCall.conf +@@ -11,20 +11,16 @@ SectionDevice."Speaker" { + cset "name='Speaker Switch' on" + cset "name='Int Spk Switch' on" + +- cset "name='Left SPK Mixer Left DAC1 Switch' on" +- cset "name='Left SPK Mixer Left DAC2 Switch' on" +- cset "name='Left SPK Mixer Right DAC1 Switch' on" +- cset "name='Left SPK Mixer Right DAC2 Switch' on" ++ cset "name='Left SPK Mixer Left DAC Switch' on" ++ cset "name='Left SPK Mixer Right DAC Switch' on" + ] + + DisableSequence [ + cset "name='Speaker Switch' off" + cset "name='Int Spk Switch' off" + +- cset "name='Left SPK Mixer Left DAC1 Switch' off" +- cset "name='Left SPK Mixer Left DAC2 Switch' off" +- cset "name='Left SPK Mixer Right DAC1 Switch' off" +- cset "name='Left SPK Mixer Right DAC2 Switch' off" ++ cset "name='Left SPK Mixer Left DAC Switch' off" ++ cset "name='Left SPK Mixer Right DAC Switch' off" + ] + + Value { +@@ -47,30 +43,22 @@ SectionDevice."Earpiece" { + cset "name='Receiver Switch' on" + cset "name='Earpiece Switch' on" + +- cset "name='Left REC Mixer Left DAC1 Switch' on" +- cset "name='Left REC Mixer Left DAC2 Switch' on" +- cset "name='Left REC Mixer Right DAC1 Switch' on" +- cset "name='Left REC Mixer Right DAC2 Switch' on" ++ cset "name='Left REC Mixer Left DAC Switch' on" ++ cset "name='Left REC Mixer Right DAC Switch' on" + +- cset "name='Right REC Mixer Left DAC1 Switch' on" +- cset "name='Right REC Mixer Left DAC2 Switch' on" +- cset "name='Right REC Mixer Right DAC1 Switch' on" +- cset "name='Right REC Mixer Right DAC2 Switch' on" ++ cset "name='Right REC Mixer Left DAC Switch' on" ++ cset "name='Right REC Mixer Right DAC Switch' on" + ] + + DisableSequence [ + cset "name='Receiver Switch' off" + cset "name='Earpiece Switch' off" + +- cset "name='Left REC Mixer Left DAC1 Switch' off" +- cset "name='Left REC Mixer Left DAC2 Switch' off" +- cset "name='Left REC Mixer Right DAC1 Switch' off" +- cset "name='Left REC Mixer Right DAC2 Switch' off" ++ cset "name='Left REC Mixer Left DAC Switch' off" ++ cset "name='Left REC Mixer Right DAC Switch' off" + +- cset "name='Right REC Mixer Left DAC1 Switch' off" +- cset "name='Right REC Mixer Left DAC2 Switch' off" +- cset "name='Right REC Mixer Right DAC1 Switch' off" +- cset "name='Right REC Mixer Right DAC2 Switch' off" ++ cset "name='Right REC Mixer Left DAC Switch' off" ++ cset "name='Right REC Mixer Right DAC Switch' off" + ] + + Value { +diff --git a/ucm2/Tegra/max98089/lge-x3.conf b/ucm2/Tegra/max98089/lge-x3.conf +index 9bea0cc..c90c4a1 100644 +--- a/ucm2/Tegra/max98089/lge-x3.conf ++++ b/ucm2/Tegra/max98089/lge-x3.conf +@@ -30,10 +30,8 @@ BootSequence [ + cset "name='Internal Mic 2 Switch' off" + cset "name='Mic Jack Switch' off" + +- cset "name='Right SPK Mixer Left DAC1 Switch' on" +- cset "name='Right SPK Mixer Left DAC2 Switch' on" +- cset "name='Right SPK Mixer Right DAC1 Switch' on" +- cset "name='Right SPK Mixer Right DAC2 Switch' on" ++ cset "name='Right SPK Mixer Left DAC Switch' on" ++ cset "name='Right SPK Mixer Right DAC Switch' on" + ] + + SectionUseCase."HiFi" { +-- +2.49.0 + + +From a1edaee761d301f7d010124599fd9f82c34fc7db Mon Sep 17 00:00:00 2001 +From: Markus Parviainen +Date: Sun, 27 Apr 2025 20:20:42 +0300 +Subject: [PATCH 07/24] Fix Presonus Revelator IO44 HWChannels count + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/557 +Signed-off-by: Markus Parviainen +Signed-off-by: Jaroslav Kysela +--- + ucm2/USB-Audio/Presonus/Revelator-IO-44-HiFi.conf | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/ucm2/USB-Audio/Presonus/Revelator-IO-44-HiFi.conf b/ucm2/USB-Audio/Presonus/Revelator-IO-44-HiFi.conf +index f223e08..6439613 100644 +--- a/ucm2/USB-Audio/Presonus/Revelator-IO-44-HiFi.conf ++++ b/ucm2/USB-Audio/Presonus/Revelator-IO-44-HiFi.conf +@@ -59,7 +59,7 @@ SectionDevice."Line1" { + Macro.pcm_split.SplitPCMDevice { + Name "revelator_stereo_out" + Direction Playback +- HWChannels 2 ++ HWChannels 6 + Channels 2 + Channel0 0 + Channel1 1 +@@ -78,7 +78,7 @@ SectionDevice."Line2" { + Macro.pcm_split.SplitPCMDevice { + Name "revelator_stereo_out" + Direction Playback +- HWChannels 2 ++ HWChannels 6 + Channels 2 + Channel0 2 + Channel1 3 +@@ -97,7 +97,7 @@ SectionDevice."Line3" { + Macro.pcm_split.SplitPCMDevice { + Name "revelator_stereo_out" + Direction Playback +- HWChannels 2 ++ HWChannels 6 + Channels 2 + Channel0 4 + Channel1 5 +-- +2.49.0 + + +From aa25928dd03299afc9bff994f06c37fc700bb8c0 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Thu, 15 May 2025 15:06:56 +0200 +Subject: [PATCH 08/24] ucm2: Qualcomm: sc8280xp: fix internal microphones + device + +A recent change renamed the internal microphones device from "DMic01" to +"Mic", but the latter name is already used by the headset microphone so +this breaks the internal microphones on the Lenovo ThinkPad X13s. + +Rename the headset microphone device so that the names are unique and +fix up the jack hw mute property which is still using the old name. + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/563 +Fixes: ea7a065a7b50 ("ucm: fix SectionDevice identifiers") +Signed-off-by: Johan Hovold +Signed-off-by: Jaroslav Kysela +--- + ucm2/Qualcomm/sc8280xp/HiFi.conf | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/ucm2/Qualcomm/sc8280xp/HiFi.conf b/ucm2/Qualcomm/sc8280xp/HiFi.conf +index e20aa9c..916f1ee 100644 +--- a/ucm2/Qualcomm/sc8280xp/HiFi.conf ++++ b/ucm2/Qualcomm/sc8280xp/HiFi.conf +@@ -50,8 +50,8 @@ SectionDevice."Headphones" { + } + } + +-SectionDevice."Mic" { +- Comment "Mic" ++SectionDevice."Headset" { ++ Comment "Headset microphone" + + Include.wcdmice.File "/codecs/wcd938x/HeadphoneMicEnableSeq.conf" + Include.wcdmicd.File "/codecs/wcd938x/HeadphoneMicDisableSeq.conf" +@@ -63,12 +63,12 @@ SectionDevice."Mic" { + CapturePCM "hw:${CardId},2" + CaptureMixerElem "ADC2" + JackControl "Mic Jack" +- JackHWMute "DMic01" ++ JackHWMute "Mic" + } + } + + SectionDevice."Mic" { +- Comment "Microphone" ++ Comment "Internal microphones" + + Include.vadm0e.File "/codecs/qcom-lpass/va-macro/DMIC0EnableSeq.conf" + Include.vadm0d.File "/codecs/qcom-lpass/va-macro/DMIC0DisableSeq.conf" +-- +2.49.0 + + +From 88e1cd78633ea0ad46115ffe8779140fa91fd2f5 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Thu, 15 May 2025 15:14:53 +0200 +Subject: [PATCH 09/24] ucm2: Qualcomm: sm8650: QRD: fix headset jack hw mute + +A recent change renamed the internal microphone devices but failed to +update the headset jack hw mute properties that are still using the old +names. + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/563 +Fixes: ea7a065a7b50 ("ucm: fix SectionDevice identifiers") +Signed-off-by: Johan Hovold +Signed-off-by: Jaroslav Kysela +--- + ucm2/Qualcomm/sm8650/QRD/HiFi.conf | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/ucm2/Qualcomm/sm8650/QRD/HiFi.conf b/ucm2/Qualcomm/sm8650/QRD/HiFi.conf +index 4336525..ca40c29 100644 +--- a/ucm2/Qualcomm/sm8650/QRD/HiFi.conf ++++ b/ucm2/Qualcomm/sm8650/QRD/HiFi.conf +@@ -77,8 +77,8 @@ SectionDevice."Headset" { + CapturePCM "hw:${CardId},2" + CaptureMixerElem "ADC2" + JackControl "Mic Jack" +- JackHWMute "Bottom" +- JackHWMute "Back" ++ JackHWMute "Mic1" ++ JackHWMute "Mic2" + } + } + +-- +2.49.0 + + +From bab88e0c31cee1c2603428c2ce6444aea343b646 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Thu, 15 May 2025 15:17:02 +0200 +Subject: [PATCH 10/24] ucm2: tegra: max98090: fix headphones conflicting + device + +A recent change renames the speaker device but failed to update the +headphones conflicting device list. + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/563 +Fixes: ea7a065a7b50 ("ucm: fix SectionDevice identifiers") +Signed-off-by: Johan Hovold +Signed-off-by: Jaroslav Kysela +--- + ucm2/Tegra/max98090/HiFi.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ucm2/Tegra/max98090/HiFi.conf b/ucm2/Tegra/max98090/HiFi.conf +index d6e4e9d..5d4ef71 100644 +--- a/ucm2/Tegra/max98090/HiFi.conf ++++ b/ucm2/Tegra/max98090/HiFi.conf +@@ -33,7 +33,7 @@ SectionDevice."Headphones" { + Comment = "Headphones" + + ConflictingDevice [ +- "Speakers" ++ "Speaker" + ] + + EnableSequence [ +-- +2.49.0 + + +From 24d62b54d5ad6c7e6f9cff4cedcc334b1c98602f Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Thu, 15 May 2025 15:19:01 +0200 +Subject: [PATCH 11/24] ucm2: USB-Audio: Behringer: Flow8: fix conflicting + devices + +A recent change renamed the Line-56 and Line-78 devices but failed to +update the conflicting device lists. + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/563 +Fixes: ea7a065a7b50 ("ucm: fix SectionDevice identifiers") +Signed-off-by: Johan Hovold +Signed-off-by: Jaroslav Kysela +--- + ucm2/USB-Audio/Behringer/Flow8-Recording-Hifi.conf | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/ucm2/USB-Audio/Behringer/Flow8-Recording-Hifi.conf b/ucm2/USB-Audio/Behringer/Flow8-Recording-Hifi.conf +index 5dce19c..8ce7590 100644 +--- a/ucm2/USB-Audio/Behringer/Flow8-Recording-Hifi.conf ++++ b/ucm2/USB-Audio/Behringer/Flow8-Recording-Hifi.conf +@@ -157,7 +157,7 @@ SectionDevice."Line5" { + Comment "Line/Inst 5 (L)" + + ConflictingDevice [ +- "Line56" ++ "Line9" + ] + + Value { +@@ -177,7 +177,7 @@ SectionDevice."Line6" { + Comment "Line/Inst(HiZ) 6 (R)" + + ConflictingDevice [ +- "Line56" ++ "Line9" + ] + + Value { +@@ -197,7 +197,7 @@ SectionDevice."Line7" { + Comment "Line/Inst 7 (L)" + + ConflictingDevice [ +- "Line78" ++ "Line10" + ] + + Value { +@@ -217,7 +217,7 @@ SectionDevice."Line8" { + Comment "Line/Inst(HiZ) 8 (R)" + + ConflictingDevice [ +- "Line78" ++ "Line10" + ] + + Value { +-- +2.49.0 + + +From 1f816194a9feb2ce0c973ccc2a93551a6f641d77 Mon Sep 17 00:00:00 2001 +From: Hiago De Franco +Date: Mon, 12 May 2025 13:57:32 -0300 +Subject: [PATCH 12/24] ucm2: IO-Boards: Toradex: smarc: add support + +Add support for Toradex SMARC Development board, using the WM8904 audio +codec. + +This is a carrier board for the Toradex SMARC family, where any SMARC +SoM can be connected to it, therefore this is being added to the +IO-Boards instead of a specific hardware vendor. + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/562 +Signed-off-by: Hiago De Franco +Signed-off-by: Jaroslav Kysela +--- + ucm2/IO-Boards/Toradex/smarc/dev-HiFi.conf | 39 +++++++++++++++++++ + ucm2/IO-Boards/Toradex/smarc/dev.conf | 17 ++++++++ + ucm2/conf.d/simple-card/tdx-smarc-wm8904.conf | 1 + + 3 files changed, 57 insertions(+) + create mode 100644 ucm2/IO-Boards/Toradex/smarc/dev-HiFi.conf + create mode 100644 ucm2/IO-Boards/Toradex/smarc/dev.conf + create mode 120000 ucm2/conf.d/simple-card/tdx-smarc-wm8904.conf + +diff --git a/ucm2/IO-Boards/Toradex/smarc/dev-HiFi.conf b/ucm2/IO-Boards/Toradex/smarc/dev-HiFi.conf +new file mode 100644 +index 0000000..7d2dffc +--- /dev/null ++++ b/ucm2/IO-Boards/Toradex/smarc/dev-HiFi.conf +@@ -0,0 +1,39 @@ ++# Use case configuration for Toradex SMARC Development Carrier Board ++# This is a carrier board for the Toradex SMARC family, where any Toradex SMARC ++# SoM (with different SoCs as iMX8MP, iMX95...) can be connected to it. ++ ++SectionDevice."Headphones" { ++ Comment "Headphones" ++ ++ EnableSequence [ ++ cset "name='Headphone Switch' on" ++ ] ++ ++ DisableSequence [ ++ cset "name='Headphone Switch' off" ++ ] ++ ++ Value { ++ PlaybackPCM "hw:${CardId}" ++ PlaybackVolume "Headphone Volume" ++ PlaybackSwitch "Headphone Switch" ++ } ++} ++ ++SectionDevice."Mic" { ++ Comment "Microphone" ++ ++ EnableSequence [ ++ cset "name='Capture Switch' on" ++ ] ++ ++ DisableSequence [ ++ cset "name='Capture Switch' off" ++ ] ++ ++ Value { ++ CapturePCM "hw:${CardId}" ++ CaptureVolume "Capture Volume" ++ CaptureSwitch "Capture Switch" ++ } ++} +diff --git a/ucm2/IO-Boards/Toradex/smarc/dev.conf b/ucm2/IO-Boards/Toradex/smarc/dev.conf +new file mode 100644 +index 0000000..e795068 +--- /dev/null ++++ b/ucm2/IO-Boards/Toradex/smarc/dev.conf +@@ -0,0 +1,17 @@ ++# Use case configuration for Toradex SMARC Development Carrier Board ++# This is a carrier board for the Toradex SMARC family, where any Toradex SMARC ++# SoM (with different SoCs as iMX8MP, iMX95...) can be connected to it. ++ ++Syntax 4 ++ ++SectionUseCase."HiFi" { ++ File "/IO-Boards/Toradex/smarc/dev-HiFi.conf" ++ Comment "Default" ++} ++ ++BootSequence [ ++ cset "name='Headphone Volume' 50%" ++ cset "name='Left Capture Inverting Mux' 'IN1L'" ++ cset "name='Right Capture Inverting Mux' 'IN1R'" ++ cset "name='Capture Volume' 31" ++] +diff --git a/ucm2/conf.d/simple-card/tdx-smarc-wm8904.conf b/ucm2/conf.d/simple-card/tdx-smarc-wm8904.conf +new file mode 120000 +index 0000000..096f833 +--- /dev/null ++++ b/ucm2/conf.d/simple-card/tdx-smarc-wm8904.conf +@@ -0,0 +1 @@ ++../../IO-Boards/Toradex/smarc/dev.conf +\ No newline at end of file +-- +2.49.0 + + +From ac918f9b606f6bfe102c449997a1bcab01934db0 Mon Sep 17 00:00:00 2001 +From: Flo +Date: Sat, 24 May 2025 11:52:12 +0200 +Subject: [PATCH 13/24] USB-Audio: Solid State Labs SSL 2 - fix capture + channels + +Same fix as for SSL+, commit fc17ed4. +Capture configuration is the same, with 4 channels. + + Capture: + Status: Stop + Interface 2 + Altset 1 + Format: S32_LE + Channels: 4 + Endpoint: 0x81 (1 IN) (ASYNC) + Rates: 44100, 48000, 88200, 96000, 176400, 192000 + Data packet interval: 125 us + Bits: 24 + Channel map: FL FR FC LFE + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/566 +Signed-off-by: Flo +Signed-off-by: Jaroslav Kysela +--- + ucm2/USB-Audio/SolidStateLabs/SSL2-HiFi.conf | 6 +++--- + ucm2/USB-Audio/SolidStateLabs/SSL2.conf | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/ucm2/USB-Audio/SolidStateLabs/SSL2-HiFi.conf b/ucm2/USB-Audio/SolidStateLabs/SSL2-HiFi.conf +index 46b2e26..8663384 100644 +--- a/ucm2/USB-Audio/SolidStateLabs/SSL2-HiFi.conf ++++ b/ucm2/USB-Audio/SolidStateLabs/SSL2-HiFi.conf +@@ -6,7 +6,7 @@ Macro [ + Name "ssl2_mono_in" + Direction Capture + Channels 1 +- HWChannels 2 ++ HWChannels 4 + HWChannelPos0 MONO + HWChannelPos1 MONO + } +@@ -31,7 +31,7 @@ SectionDevice."Mic1" { + Macro.pcm_split.SplitPCMDevice { + Name "ssl2_mono_in" + Direction Capture +- HWChannels 2 ++ HWChannels 4 + Channels 1 + Channel0 0 + ChannelPos0 MONO +@@ -47,7 +47,7 @@ SectionDevice."Mic2" { + Macro.pcm_split.SplitPCMDevice { + Name "ssl2_mono_in" + Direction Capture +- HWChannels 2 ++ HWChannels 4 + Channels 1 + Channel0 1 + ChannelPos0 MONO +diff --git a/ucm2/USB-Audio/SolidStateLabs/SSL2.conf b/ucm2/USB-Audio/SolidStateLabs/SSL2.conf +index 5531834..3cdb60b 100644 +--- a/ucm2/USB-Audio/SolidStateLabs/SSL2.conf ++++ b/ucm2/USB-Audio/SolidStateLabs/SSL2.conf +@@ -6,6 +6,6 @@ SectionUseCase."HiFi" { + } + + Define.DirectPlaybackChannels 2 +-Define.DirectCaptureChannels 2 ++Define.DirectCaptureChannels 4 + + Include.dhw.File "/common/direct.conf" +-- +2.49.0 + + +From 421e37bae75efc1fc134fbc84bc301f041aaff3b Mon Sep 17 00:00:00 2001 +From: Craig McLure +Date: Tue, 6 May 2025 18:40:47 +0100 +Subject: [PATCH 14/24] USB-Audio: Added Beacn Mic and Studio Support + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/558 +Signed-off-by: Craig McLure +Signed-off-by: Jaroslav Kysela +--- + ucm2/USB-Audio/Beacn/Beacn-Mic-HiFi.conf | 63 ++++++ + ucm2/USB-Audio/Beacn/Beacn-Mic.conf | 11 ++ + .../Beacn/Beacn-Studio-USB1-Channels.conf | 41 ++++ + .../Beacn/Beacn-Studio-USB1-HiFi.conf | 35 ++++ + .../Beacn/Beacn-Studio-USB1-Link-HiFi.conf | 179 ++++++++++++++++++ + .../Beacn/Beacn-Studio-USB2-HiFi.conf | 175 +++++++++++++++++ + ucm2/USB-Audio/Beacn/Beacn-Studio.conf | 42 ++++ + ucm2/USB-Audio/USB-Audio.conf | 16 ++ + 8 files changed, 562 insertions(+) + create mode 100644 ucm2/USB-Audio/Beacn/Beacn-Mic-HiFi.conf + create mode 100644 ucm2/USB-Audio/Beacn/Beacn-Mic.conf + create mode 100644 ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-Channels.conf + create mode 100644 ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-HiFi.conf + create mode 100644 ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-Link-HiFi.conf + create mode 100644 ucm2/USB-Audio/Beacn/Beacn-Studio-USB2-HiFi.conf + create mode 100644 ucm2/USB-Audio/Beacn/Beacn-Studio.conf + +diff --git a/ucm2/USB-Audio/Beacn/Beacn-Mic-HiFi.conf b/ucm2/USB-Audio/Beacn/Beacn-Mic-HiFi.conf +new file mode 100644 +index 0000000..2445531 +--- /dev/null ++++ b/ucm2/USB-Audio/Beacn/Beacn-Mic-HiFi.conf +@@ -0,0 +1,63 @@ ++Include.pcm_split.File "/common/pcm/split.conf" ++ ++Macro [ ++ { ++ SplitPCM { ++ Name "beacn_mic_stereo_out" ++ Direction Playback ++ Channels 2 ++ HWChannels 3 ++ HWChannelPos0 FL ++ HWChannelPos1 FR ++ HWChannelPos2 MONO ++ } ++ } ++ { ++ SplitPCM { ++ Name "beacn_mic_stereo_in" ++ Direction Capture ++ Channels 2 ++ HWChannels 4 ++ HWChannelPos0 FL ++ HWChannelPos1 FR ++ HWChannelPos2 MONO # Dry Mic ++ HWChannelPos3 MONO # Dry + Expander ++ } ++ } ++] ++ ++SectionDevice."Headphones" { ++ Comment "Headphones" ++ ++ Value { ++ PlaybackPriority 200 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_mic_stereo_out" ++ Direction Playback ++ HWChannels 3 ++ Channels 2 ++ Channel0 0 ++ Channel1 1 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."Mic" { ++ Comment "Microphone" ++ ++ Value { ++ CapturePriority 200 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_mic_stereo_in" ++ Direction Capture ++ HWChannels 4 ++ Channels 2 ++ Channel0 0 ++ Channel1 1 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} +diff --git a/ucm2/USB-Audio/Beacn/Beacn-Mic.conf b/ucm2/USB-Audio/Beacn/Beacn-Mic.conf +new file mode 100644 +index 0000000..95c6f81 +--- /dev/null ++++ b/ucm2/USB-Audio/Beacn/Beacn-Mic.conf +@@ -0,0 +1,11 @@ ++Comment "Beacn Mic USB" ++ ++SectionUseCase."HiFi" { ++ Comment "Default Alsa Profile" ++ File "/USB-Audio/Beacn/Beacn-Mic-HiFi.conf" ++} ++ ++Define.DirectPlaybackChannels 3 ++Define.DirectCaptureChannels 4 ++ ++Include.dhw.File "/common/direct.conf" +diff --git a/ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-Channels.conf b/ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-Channels.conf +new file mode 100644 +index 0000000..b9886f4 +--- /dev/null ++++ b/ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-Channels.conf +@@ -0,0 +1,41 @@ ++Include.pcm_split.File "/common/pcm/split.conf" ++ ++Macro.playback.SplitPCM { ++ Name "beacn_studio_stereo_out" ++ Direction Playback ++ Channels 2 ++ HWChannels 11 ++ HWChannelPos0 FL # Headphone Left ++ HWChannelPos1 FR # Headphone Right ++ HWChannelPos2 MONO # Unused Channel ++ HWChannelPos3 FL # Link 1 Out Left ++ HWChannelPos4 FR # Link 1 Out Right ++ HWChannelPos5 FL # Link 2 Out Left ++ HWChannelPos6 FR # Link 2 Out Right ++ HWChannelPos7 FL # Link 3 Out Left ++ HWChannelPos8 FR # Link 3 Out Right ++ HWChannelPos9 FL # Link 4 Out Left ++ HWChannelPos10 FR # Link 4 Out Right ++} ++ ++Macro.capture.SplitPCM { ++ Name "beacn_studio_stereo_in" ++ Direction Capture ++ Channels 2 ++ HWChannels 12 ++ ++ HWChannelPos0 FL # Microphone Left ++ HWChannelPos1 FR # Microphone Right ++ ++ HWChannelPos2 MONO # UNKNOWN (Possible Dry Mic) ++ HWChannelPos3 MONO # UNKNOWN (Possible Dry + Expander) ++ ++ HWChannelPos4 FL # Link 1 In Left ++ HWChannelPos5 FR # Link 1 In Right ++ HWChannelPos6 FL # Link 2 In Left ++ HWChannelPos7 FR # Link 2 In Right ++ HWChannelPos8 FL # Link 3 In Left ++ HWChannelPos9 FR # Link 3 In Right ++ HWChannelPos10 FL # Link 4 In Left ++ HWChannelPos11 FR # Link 4 In Right ++} +diff --git a/ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-HiFi.conf b/ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-HiFi.conf +new file mode 100644 +index 0000000..8c90d5b +--- /dev/null ++++ b/ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-HiFi.conf +@@ -0,0 +1,35 @@ ++SectionDevice."Headphones" { ++ Comment "Headphones" ++ ++ Value { ++ PlaybackPriority 100 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_out" ++ Direction Playback ++ HWChannels 11 ++ Channels 2 ++ Channel0 0 ++ Channel1 1 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."Mic" { ++ Comment "Microphone" ++ ++ Value { ++ CapturePriority 100 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_in" ++ Direction Capture ++ HWChannels 12 ++ Channels 2 ++ Channel0 0 ++ Channel1 1 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} +diff --git a/ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-Link-HiFi.conf b/ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-Link-HiFi.conf +new file mode 100644 +index 0000000..74ff142 +--- /dev/null ++++ b/ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-Link-HiFi.conf +@@ -0,0 +1,179 @@ ++SectionDevice."Line1" { ++ Comment "Link 4" ++ ++ Value { ++ PlaybackPriority 400 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_out" ++ Direction Playback ++ HWChannels 11 ++ Channels 2 ++ Channel0 9 ++ Channel1 10 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."Line2" { ++ Comment "Link 3" ++ ++ Value { ++ PlaybackPriority 400 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_out" ++ Direction Playback ++ HWChannels 11 ++ Channels 2 ++ Channel0 7 ++ Channel1 8 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."Line3" { ++ Comment "Link 2" ++ ++ Value { ++ PlaybackPriority 400 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_out" ++ Direction Playback ++ HWChannels 11 ++ Channels 2 ++ Channel0 5 ++ Channel1 6 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."Line4" { ++ Comment "Link 1" ++ ++ Value { ++ PlaybackPriority 400 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_out" ++ Direction Playback ++ HWChannels 11 ++ Channels 2 ++ Channel0 3 ++ Channel1 4 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."Headphones" { ++ Comment "Headphones" ++ ++ Value { ++ PlaybackPriority 100 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_out" ++ Direction Playback ++ HWChannels 11 ++ Channels 2 ++ Channel0 0 ++ Channel1 1 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."Line5" { ++ Comment "Link 4" ++ ++ Value { ++ PlaybackPriority 400 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_in" ++ Direction Capture ++ HWChannels 12 ++ Channels 2 ++ Channel0 10 ++ Channel1 11 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."Line6" { ++ Comment "Link 3" ++ ++ Value { ++ PlaybackPriority 400 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_in" ++ Direction Capture ++ HWChannels 12 ++ Channels 2 ++ Channel0 8 ++ Channel1 9 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."Line7" { ++ Comment "Link 2" ++ ++ Value { ++ PlaybackPriority 400 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_in" ++ Direction Capture ++ HWChannels 12 ++ Channels 2 ++ Channel0 6 ++ Channel1 7 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."Line8" { ++ Comment "Link 1" ++ ++ Value { ++ PlaybackPriority 400 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_in" ++ Direction Capture ++ HWChannels 12 ++ Channels 2 ++ Channel0 4 ++ Channel1 5 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."Mic" { ++ Comment "Microphone" ++ ++ Value { ++ CapturePriority 100 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_in" ++ Direction Capture ++ HWChannels 12 ++ Channels 2 ++ Channel0 0 ++ Channel1 1 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} +diff --git a/ucm2/USB-Audio/Beacn/Beacn-Studio-USB2-HiFi.conf b/ucm2/USB-Audio/Beacn/Beacn-Studio-USB2-HiFi.conf +new file mode 100644 +index 0000000..5988d41 +--- /dev/null ++++ b/ucm2/USB-Audio/Beacn/Beacn-Studio-USB2-HiFi.conf +@@ -0,0 +1,175 @@ ++Include.pcm_split.File "/common/pcm/split.conf" ++ ++Macro.playback.SplitPCM { ++ Name "beacn_studio_stereo_out" ++ Direction Playback ++ Channels 2 ++ HWChannels 8 ++ HWChannelPos0 FL ++ HWChannelPos1 FR ++ HWChannelPos2 FL ++ HWChannelPos3 FR ++ HWChannelPos4 FL ++ HWChannelPos5 FR ++ HWChannelPos6 FL ++ HWChannelPos7 FR ++} ++ ++Macro.capture.SplitPCM { ++ Name "beacn_studio_stereo_in" ++ Direction Capture ++ Channels 2 ++ HWChannels 8 ++ HWChannelPos0 FL ++ HWChannelPos1 FR ++ HWChannelPos2 FL ++ HWChannelPos3 FR ++ HWChannelPos4 FL ++ HWChannelPos5 FR ++ HWChannelPos6 FL ++ HWChannelPos7 FR ++} ++ ++SectionDevice."Line1" { ++ Comment "Link 4" ++ ++ Value { ++ PlaybackPriority 400 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_out" ++ Direction Playback ++ HWChannels 8 ++ Channels 2 ++ Channel0 6 ++ Channel1 7 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."Line2" { ++ Comment "Link 3" ++ ++ Value { ++ PlaybackPriority 400 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_out" ++ Direction Playback ++ HWChannels 8 ++ Channels 2 ++ Channel0 4 ++ Channel1 5 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."Line3" { ++ Comment "Link 2" ++ ++ Value { ++ PlaybackPriority 400 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_out" ++ Direction Playback ++ HWChannels 8 ++ Channels 2 ++ Channel0 2 ++ Channel1 3 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."Line4" { ++ Comment "Link 1" ++ ++ Value { ++ PlaybackPriority 400 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_out" ++ Direction Playback ++ HWChannels 8 ++ Channels 2 ++ Channel0 0 ++ Channel1 1 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."Line5" { ++ Comment "Link 4" ++ ++ Value { ++ PlaybackPriority 400 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_in" ++ Direction Capture ++ HWChannels 8 ++ Channels 2 ++ Channel0 6 ++ Channel1 7 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."Line6" { ++ Comment "Link 3" ++ ++ Value { ++ PlaybackPriority 400 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_in" ++ Direction Capture ++ HWChannels 8 ++ Channels 2 ++ Channel0 4 ++ Channel1 5 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."Line7" { ++ Comment "Link 2" ++ ++ Value { ++ PlaybackPriority 400 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_in" ++ Direction Capture ++ HWChannels 8 ++ Channels 2 ++ Channel0 2 ++ Channel1 3 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} ++ ++SectionDevice."Line8" { ++ Comment "Link 1" ++ ++ Value { ++ PlaybackPriority 400 ++ } ++ Macro.pcm_split.SplitPCMDevice { ++ Name "beacn_studio_stereo_in" ++ Direction Capture ++ HWChannels 8 ++ Channels 2 ++ Channel0 0 ++ Channel1 1 ++ ChannelPos0 FL ++ ChannelPos1 FR ++ } ++} +diff --git a/ucm2/USB-Audio/Beacn/Beacn-Studio.conf b/ucm2/USB-Audio/Beacn/Beacn-Studio.conf +new file mode 100644 +index 0000000..1b3adc0 +--- /dev/null ++++ b/ucm2/USB-Audio/Beacn/Beacn-Studio.conf +@@ -0,0 +1,42 @@ ++# The Beacn Studio has two USB ports which both present different PIDs, so we do ++# individual checks, and load the appropriate configs for the port connected. ++ ++Comment "Beacn Studio USB" ++If.usb1 { ++ Condition { ++ Type String ++ Haystack "${CardComponents}" ++ Needle "USB33ae:0003" ++ } ++ True { ++ # Channel configuration is common between all the profiles, so we'll include it here ++ Include.pcm_split.File "/USB-Audio/Beacn/Beacn-Studio-USB1-Channels.conf" ++ ++ # If the user isn't using the 'Dual PC' feature of the Beacn Studio, there isn't really ++ # much point presenting them with an additional 4 unusable inputs and outputs, so we'll ++ # offer two profile options so those channels can be hidden. ++ SectionUseCase."Basic" { ++ Comment "Beacn Studio" ++ File "/USB-Audio/Beacn/Beacn-Studio-USB1-HiFi.conf" ++ } ++ ++ SectionUseCase."Link" { ++ Comment "Beacn Studio with Link" ++ File "/USB-Audio/Beacn/Beacn-Studio-USB1-Link-HiFi.conf" ++ } ++ } ++} ++ ++If.usb2 { ++ Condition { ++ Type String ++ Haystack "${CardComponents}" ++ Needle "USB33ae:4003" ++ } ++ True { ++ SectionUseCase."Link" { ++ Comment "Beacn Studio Link" ++ File "/USB-Audio/Beacn/Beacn-Studio-USB2-HiFi.conf" ++ } ++ } ++} +diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf +index fe2cd46..d90db39 100644 +--- a/ucm2/USB-Audio/USB-Audio.conf ++++ b/ucm2/USB-Audio/USB-Audio.conf +@@ -541,7 +541,23 @@ If.ssl2plus { + ProfileName "SolidStateLabs/SSL2Plus" + } + } ++If.beacn-mic { ++ Condition { ++ Type String ++ Haystack "${CardComponents}" ++ Needle "USB33ae:0001" ++ } ++ True.Define.ProfileName "Beacn/Beacn-Mic" ++} + ++If.beacn-studio { ++ Condition { ++ Type RegexMatch ++ String "${CardComponents}" ++ Regex "USB33ae:[04]003" ++ } ++ True.Define.ProfileName "Beacn/Beacn-Studio" ++} + If.mixremap { + Condition { + Type String +-- +2.49.0 + + +From e055d16bdf971e26c3d92d998bccb2ca4e4f3c1a Mon Sep 17 00:00:00 2001 +From: binarycraft007 +Date: Mon, 2 Jun 2025 13:41:38 +0800 +Subject: [PATCH 15/24] ucm2: Qualcomm: add ASUS Vivobook S 15 support + +S15 supports: + - 2 speakers. + - 2 dmics + - headset with mic. + +This patch adds support to all these, however only speakers, dmic and +headset playback is tested. + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/570 +Signed-off-by: binarycraft007 +Signed-off-by: Jaroslav Kysela +--- + ucm2/Qualcomm/x1e80100/x1e80100.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ucm2/Qualcomm/x1e80100/x1e80100.conf b/ucm2/Qualcomm/x1e80100/x1e80100.conf +index 10faf5f..ecbb13d 100644 +--- a/ucm2/Qualcomm/x1e80100/x1e80100.conf ++++ b/ucm2/Qualcomm/x1e80100/x1e80100.conf +@@ -6,7 +6,7 @@ If.LENOVOT14s { + Condition { + Type RegexMatch + String "${var:DMI_info}" +- Regex "LENOVO.*Think((Pad T14s Gen 6.*)|(Book 16 G7 QOY))|(HP.*Omnibook X.*)|(ASUSTeK COMPUTER.*ASUS Zenbook A14)|(Microsoft Corporation.*Surface.*Microsoft Surface Laptop, 7th Edition)" ++ Regex "LENOVO.*Think((Pad T14s Gen 6.*)|(Book 16 G7 QOY))|(HP.*Omnibook X.*)|ASUSTeK COMPUTER.*ASUS (Zenbook A14|Vivobook S 15)|(Microsoft Corporation.*Surface.*Microsoft Surface Laptop, 7th Edition)" + } + True.Include.t14s.File "/Qualcomm/x1e80100/LENOVO-T14s.conf" + } +-- +2.49.0 + + +From 59d53fd9cac27e9a05623251aefa6d06da94260c Mon Sep 17 00:00:00 2001 +From: Craig McLure +Date: Wed, 4 Jun 2025 23:25:51 +0100 +Subject: [PATCH 16/24] Changed 'Stream Mix' channel names to match the latest + Window release + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/572 +Signed-off-by: Craig McLure +Signed-off-by: Jaroslav Kysela +--- + ucm2/USB-Audio/GoXLR/GoXLR-HiFi.conf | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/ucm2/USB-Audio/GoXLR/GoXLR-HiFi.conf b/ucm2/USB-Audio/GoXLR/GoXLR-HiFi.conf +index 6614b00..17c6580 100644 +--- a/ucm2/USB-Audio/GoXLR/GoXLR-HiFi.conf ++++ b/ucm2/USB-Audio/GoXLR/GoXLR-HiFi.conf +@@ -140,7 +140,7 @@ SectionDevice."Line3" { + } + + SectionDevice."Line4" { +- Comment "Broadcast Stream Mix" ++ Comment "Stream Mix 1" + + Value { + CapturePriority 200 +@@ -200,7 +200,7 @@ If.mix2 { + String2 "25" + } + True.SectionDevice."Line6" { +- Comment "Broadcast Stream Mix 2" ++ Comment "Stream Mix 2" + + Value { + CapturePriority 200 +-- +2.49.0 + + +From bd5cf3839f902b67a355669fdf1bd3231e0cb4c1 Mon Sep 17 00:00:00 2001 +From: Mohammad Rafi Shaik +Date: Mon, 9 Jun 2025 20:52:42 +0530 +Subject: [PATCH 17/24] Qualcomm: Add QCS9075-IQ-EVK HiFi config + +Add UCM2 configs for the Qualcomm QCS9075-IQ-EVK Board to handle: + - I2S Speaker Amplifier + - I2S Mic + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/576 +Signed-off-by: Mohammad Rafi Shaik +Signed-off-by: Jaroslav Kysela +--- + .../qcs9075/qcs9075-iq-evk-snd-card/HiFi.conf | 29 +++++++++++++++++++ + .../qcs9075-iq-evk-snd-card.conf | 6 ++++ + .../qcs9075/qcs9075-iq-evk-snd-card.conf | 6 ++++ + 3 files changed, 41 insertions(+) + create mode 100644 ucm2/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/HiFi.conf + create mode 100644 ucm2/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/qcs9075-iq-evk-snd-card.conf + create mode 100644 ucm2/conf.d/qcs9075/qcs9075-iq-evk-snd-card.conf + +diff --git a/ucm2/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/HiFi.conf b/ucm2/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/HiFi.conf +new file mode 100644 +index 0000000..6673324 +--- /dev/null ++++ b/ucm2/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/HiFi.conf +@@ -0,0 +1,29 @@ ++SectionVerb { ++ Value { ++ TQ "HiFi" ++ } ++ EnableSequence [ ++ cset "name='PRIMARY_SDR_MI2S_RX Audio Mixer MULTIMEDIA0' 1" ++ cset "name='MULTIMEDIA1 Audio Mixer TERTIARY_SDR_MI2S_TX' 1" ++ ] ++} ++ ++SectionDevice."Speaker" { ++ Comment "Speaker playback" ++ ++ Value { ++ PlaybackPriority 100 ++ PlaybackPCM "hw:${CardId},0" ++ PlaybackMixer "default:${CardId}" ++ PlaybackMixerElem "Speakers" ++ } ++} ++ ++SectionDevice."Mic" { ++ Comment "Mic" ++ ++ Value { ++ CapturePriority 100 ++ CapturePCM "hw:${CardId},1" ++ } ++} +diff --git a/ucm2/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/qcs9075-iq-evk-snd-card.conf b/ucm2/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/qcs9075-iq-evk-snd-card.conf +new file mode 100644 +index 0000000..669ba6b +--- /dev/null ++++ b/ucm2/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/qcs9075-iq-evk-snd-card.conf +@@ -0,0 +1,6 @@ ++Syntax 4 ++ ++SectionUseCase."HiFi" { ++ File "/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/HiFi.conf" ++ Comment "HiFi quality Music" ++} +diff --git a/ucm2/conf.d/qcs9075/qcs9075-iq-evk-snd-card.conf b/ucm2/conf.d/qcs9075/qcs9075-iq-evk-snd-card.conf +new file mode 100644 +index 0000000..1e49d38 +--- /dev/null ++++ b/ucm2/conf.d/qcs9075/qcs9075-iq-evk-snd-card.conf +@@ -0,0 +1,6 @@ ++Syntax 4 ++ ++SectionUseCase."HiFi" { ++ File "/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/HiFi.conf" ++ Comment "HiFi quality Music." ++} +-- +2.49.0 + + +From e7ec0f1ac3eebfa04e18a944d511bbb5fa57239d Mon Sep 17 00:00:00 2001 +From: Mohammad Rafi Shaik +Date: Tue, 10 Jun 2025 16:46:59 +0530 +Subject: [PATCH 18/24] ucm2: Qualcomm: Update the QCM6490 and QCS6490 hifi + conf files + +Rename the HiFi conf files for QCM6490-IDP and QCS6490-RB3Gen2 boards +to match with soundcard name. + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/577 +Signed-off-by: Mohammad Rafi Shaik +Signed-off-by: Jaroslav Kysela +--- + .../QCM6490-IDP/{QCM6490-IDP.conf => qcm6490-idp-snd-card.conf} | 0 + .../{QCS6490-RB3Gen2.conf => qcs6490-rb3gen2-snd-card.conf} | 0 + .../qcm6490/{QCM6490-IDP.conf => qcm6490-idp-snd-card.conf} | 0 + .../{QCS6490-RB3Gen2.conf => qcs6490-rb3gen2-snd-card.conf} | 0 + 4 files changed, 0 insertions(+), 0 deletions(-) + rename ucm2/Qualcomm/qcm6490/QCM6490-IDP/{QCM6490-IDP.conf => qcm6490-idp-snd-card.conf} (100%) + rename ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/{QCS6490-RB3Gen2.conf => qcs6490-rb3gen2-snd-card.conf} (100%) + rename ucm2/conf.d/qcm6490/{QCM6490-IDP.conf => qcm6490-idp-snd-card.conf} (100%) + rename ucm2/conf.d/qcs6490/{QCS6490-RB3Gen2.conf => qcs6490-rb3gen2-snd-card.conf} (100%) + +diff --git a/ucm2/Qualcomm/qcm6490/QCM6490-IDP/QCM6490-IDP.conf b/ucm2/Qualcomm/qcm6490/QCM6490-IDP/qcm6490-idp-snd-card.conf +similarity index 100% +rename from ucm2/Qualcomm/qcm6490/QCM6490-IDP/QCM6490-IDP.conf +rename to ucm2/Qualcomm/qcm6490/QCM6490-IDP/qcm6490-idp-snd-card.conf +diff --git a/ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/QCS6490-RB3Gen2.conf b/ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/qcs6490-rb3gen2-snd-card.conf +similarity index 100% +rename from ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/QCS6490-RB3Gen2.conf +rename to ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/qcs6490-rb3gen2-snd-card.conf +diff --git a/ucm2/conf.d/qcm6490/QCM6490-IDP.conf b/ucm2/conf.d/qcm6490/qcm6490-idp-snd-card.conf +similarity index 100% +rename from ucm2/conf.d/qcm6490/QCM6490-IDP.conf +rename to ucm2/conf.d/qcm6490/qcm6490-idp-snd-card.conf +diff --git a/ucm2/conf.d/qcs6490/QCS6490-RB3Gen2.conf b/ucm2/conf.d/qcs6490/qcs6490-rb3gen2-snd-card.conf +similarity index 100% +rename from ucm2/conf.d/qcs6490/QCS6490-RB3Gen2.conf +rename to ucm2/conf.d/qcs6490/qcs6490-rb3gen2-snd-card.conf +-- +2.49.0 + + +From a98b12220989e2187a47b0e06ac9145c92232a8e Mon Sep 17 00:00:00 2001 +From: Mohammad Rafi Shaik +Date: Wed, 18 Jun 2025 16:46:18 +0530 +Subject: [PATCH 19/24] ucm2: Qualcomm: Update the HIFI enable mixer commands + for qcm6490-idp and qcs6490-rb3gen2 + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/577 +Signed-off-by: Mohammad Rafi Shaik +Signed-off-by: Jaroslav Kysela +--- + ucm2/Qualcomm/qcm6490/QCM6490-IDP/HiFi.conf | 8 ++++---- + ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/HiFi.conf | 4 ++-- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/ucm2/Qualcomm/qcm6490/QCM6490-IDP/HiFi.conf b/ucm2/Qualcomm/qcm6490/QCM6490-IDP/HiFi.conf +index 0d6497e..0a0d331 100644 +--- a/ucm2/Qualcomm/qcm6490/QCM6490-IDP/HiFi.conf ++++ b/ucm2/Qualcomm/qcm6490/QCM6490-IDP/HiFi.conf +@@ -3,10 +3,10 @@ SectionVerb { + TQ "HiFi" + } + EnableSequence [ +- cset "name='WSA_CODEC_DMA_RX_0 Audio Mixer MULTIMEDIA0' 1" +- cset "name='MULTIMEDIA1 Audio Mixer VA_CODEC_DMA_TX_0' 1" +- cset "name='RX_CODEC_DMA_RX_0 Audio Mixer MULTIMEDIA2' 1" +- cset "name='MULTIMEDIA3 Audio Mixer TX_CODEC_DMA_TX_3' 1" ++ cset "name='WSA_CODEC_DMA_RX_0 Audio Mixer MultiMedia1' 1" ++ cset "name='MultiMedia2 Mixer VA_CODEC_DMA_TX_0' 1" ++ cset "name='RX_CODEC_DMA_RX_0 Audio Mixer MultiMedia3' 1" ++ cset "name='MultiMedia4 Mixer TX_CODEC_DMA_TX_3' 1" + ] + + Include.wsae.File "/codecs/wsa883x/DefaultEnableSeq.conf" +diff --git a/ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/HiFi.conf b/ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/HiFi.conf +index 954dbfa..2488523 100644 +--- a/ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/HiFi.conf ++++ b/ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/HiFi.conf +@@ -3,8 +3,8 @@ SectionVerb { + TQ "HiFi" + } + EnableSequence [ +- cset "name='WSA_CODEC_DMA_RX_0 Audio Mixer MULTIMEDIA0' 1" +- cset "name='MULTIMEDIA1 Audio Mixer VA_CODEC_DMA_TX_0' 1" ++ cset "name='WSA_CODEC_DMA_RX_0 Audio Mixer MultiMedia1' 1" ++ cset "name='MultiMedia2 Mixer VA_CODEC_DMA_TX_0' 1" + ] + + Include.wsae.File "/codecs/wsa883x/DefaultEnableSeq.conf" +-- +2.49.0 + + +From 56cbdfd04339cf9598cd9d57f5c1a382504ae902 Mon Sep 17 00:00:00 2001 +From: Peter Ujfalusi +Date: Thu, 12 Jun 2025 16:33:01 +0300 +Subject: [PATCH 20/24] UCM2: Intel: sof-hda-dsp: HiFi: Fix handling of mono + DMICs + +When a single DMIC is present in the system we need to set the +CaptureChannels to 1 since the PCM device only supports mono, PA/PW will +reject the profile since it cannot open the DMIC PCM device. + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/579 +Signed-off-by: Peter Ujfalusi +Signed-off-by: Jaroslav Kysela +--- + ucm2/Intel/sof-hda-dsp/HiFi.conf | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/ucm2/Intel/sof-hda-dsp/HiFi.conf b/ucm2/Intel/sof-hda-dsp/HiFi.conf +index 9689b56..e452f83 100644 +--- a/ucm2/Intel/sof-hda-dsp/HiFi.conf ++++ b/ucm2/Intel/sof-hda-dsp/HiFi.conf +@@ -34,6 +34,16 @@ If.dmic { + True { + CaptureChannels 4 + } ++ False.If.mono { ++ Condition { ++ Type RegexMatch ++ Regex "cfg-dmics:[1]" ++ String "${CardComponents}" ++ } ++ True { ++ CaptureChannels 1 ++ } ++ } + } + If.vol { + Condition { +-- +2.49.0 + + +From e4791900954c3951d15038822a55a3031aac49d2 Mon Sep 17 00:00:00 2001 +From: Shuming Fan +Date: Fri, 6 Jun 2025 12:47:08 +0800 +Subject: [PATCH 21/24] ucm2: sof-soundwire: add rt712-vb device + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/573 +Signed-off-by: Shuming Fan +Signed-off-by: Jaroslav Kysela +--- + ucm2/codecs/rt712/init.conf | 34 ++++++++++++++++++++++++++++------ + ucm2/sof-soundwire/rt712.conf | 29 +++++++++++++++++++++++++++++ + 2 files changed, 57 insertions(+), 6 deletions(-) + +diff --git a/ucm2/codecs/rt712/init.conf b/ucm2/codecs/rt712/init.conf +index e09bf7f..1e45380 100644 +--- a/ucm2/codecs/rt712/init.conf ++++ b/ucm2/codecs/rt712/init.conf +@@ -1,8 +1,30 @@ + # RT712 specific volume control settings + +-BootSequence [ +- cset "name='rt712 FU05 Playback Volume' 87" +- cset "name='rt712 ADC 23 Mux' 'MIC2'" +- cset "name='rt712 FU0F Capture Volume' 57" +- cset "name='rt712 FU0F Capture Switch' 1" +-] ++If.rt712_init { ++ Condition { ++ Type RegexMatch ++ Regex "(rt712(-sdca)?)" ++ String "${var:MultiMicShadow}" ++ } ++ True { ++ # RT712-VB integrated with DMIC ++ BootSequence [ ++ cset "name='rt712 FU05 Playback Volume' 87" ++ cset "name='rt712 ADC 23 Mux' 'MIC2'" ++ cset "name='rt712 FU0F Capture Volume' 57" ++ cset "name='rt712 FU0F Capture Switch' 1" ++ cset "name='rt712 FU1E Capture Switch' 1" ++ cset "name='rt712 FU1E Capture Volume' 47" ++ cset "name='rt712 ADC 0A Mux' 'DMIC1'" ++ cset "name='rt712 ADC 0B Mux' 'DMIC2'" ++ ] ++ } ++ False { ++ BootSequence [ ++ cset "name='rt712 FU05 Playback Volume' 87" ++ cset "name='rt712 ADC 23 Mux' 'MIC2'" ++ cset "name='rt712 FU0F Capture Volume' 57" ++ cset "name='rt712 FU0F Capture Switch' 1" ++ ] ++ } ++} +diff --git a/ucm2/sof-soundwire/rt712.conf b/ucm2/sof-soundwire/rt712.conf +index 409bef9..346cff1 100644 +--- a/ucm2/sof-soundwire/rt712.conf ++++ b/ucm2/sof-soundwire/rt712.conf +@@ -85,3 +85,32 @@ SectionDevice."Headset" { + JackControl "Headset Mic Jack" + } + } ++ ++If.codecmic { ++ Condition { ++ Type RegexMatch ++ Regex "(rt712(-sdca)?)" ++ String "${var:MultiMicShadow}" ++ } ++ True { ++ SectionDevice."Mic" { ++ Comment "SoundWire Microphones" ++ ++ EnableSequence [ ++ cset "name='rt712 FU1E Capture Switch' 1" ++ ] ++ ++ DisableSequence [ ++ cset "name='rt712 FU1E Capture Switch' 0" ++ ] ++ ++ Value { ++ CapturePriority 100 ++ CapturePCM "hw:${CardId},4" ++ CaptureSwitch "rt712 FU1E Capture Switch" ++ CaptureVolume "rt712 FU1E Capture Volume" ++ CaptureMixerElem "rt712 FU1E" ++ } ++ } ++ } ++} +-- +2.49.0 + + +From 436fbad2a02b91435645e039664af469595ab500 Mon Sep 17 00:00:00 2001 +From: DanielDecker <90106468+DanielDecker@users.noreply.github.com> +Date: Mon, 16 Jun 2025 18:27:21 +0200 +Subject: [PATCH 22/24] add MSI MAG B850M Mortar Wifi to USB-Audio.conf + +add MSI MAG B850M Mortar Wifi USB-ID for Realtek/ALC4080 to USB-Audio.conf + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/581 +Signed-off-by: DanielDecker <90106468+DanielDecker@users.noreply.github.com> +Signed-off-by: Jaroslav Kysela +--- + ucm2/USB-Audio/USB-Audio.conf | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf +index d90db39..ef88ded 100644 +--- a/ucm2/USB-Audio/USB-Audio.conf ++++ b/ucm2/USB-Audio/USB-Audio.conf +@@ -89,6 +89,7 @@ If.realtek-alc4080 { + # 0db0:a47c MSI MEG X570S Ace Max + # 0db0:a74b MSI MPG Z790 Edge Wifi + # 0db0:b202 MSI MAG Z690 Tomahawk Wifi ++ # 0db0:cc78 MSI MAG B850M Mortar Wifi + # 0db0:cd0e MSI X870 Tomahawk + # 0db0:d1d7 MSI PRO Z790-A WIFI + # 0db0:d6e7 MSI MPG X670E Carbon Wifi +@@ -96,7 +97,7 @@ If.realtek-alc4080 { + # 26ce:0a06 ASRock X670E/Z790 Taichi + # 26ce:0a08 ASRock Z790 PG-ITX/TB4, X870 Steel Legend + # 26ce:0a0b ASRock X870E Taichi +- Regex "USB((0414:a0(0e|1[0124]))|(0b05:(19(84|9[69])|1a(16|2[07]|5[23c]|97|f1)|1b(7c|9b|e1)))|(0db0:(005a|0b58|124b|151f|1feb|3130|36e7|4(19c|22d|240|88c)|543d|62a4|6c[0c]9|70d3|7696|82c7|8af7|961e|9e6d|a(073|228|47c|74b)|b202|cd0e|d1d7|d6e7|e1f8))|(26ce:0a0[68b]))" ++ Regex "USB((0414:a0(0e|1[0124]))|(0b05:(19(84|9[69])|1a(16|2[07]|5[23c]|97|f1)|1b(7c|9b|e1)))|(0db0:(005a|0b58|124b|151f|1feb|3130|36e7|4(19c|22d|240|88c)|543d|62a4|6c[0c]9|70d3|7696|82c7|8af7|961e|9e6d|a(073|228|47c|74b)|b202|c(c78|d0e)|d1d7|d6e7|e1f8))|(26ce:0a0[68b]))" + } + True.Define.ProfileName "Realtek/ALC4080" + } +-- +2.49.0 + + +From b4896cf413e618f4b20c570544a4e668aaa72f64 Mon Sep 17 00:00:00 2001 +From: Harald Sitter +Date: Sat, 21 Jun 2025 17:10:20 +0200 +Subject: [PATCH 23/24] ucm2: USB-Audio: Add Teufel CAGE PRO + +two stereo outputs: one for "game" and one for "chat". +one mono input + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/582 +Signed-off-by: Harald Sitter +Signed-off-by: Jaroslav Kysela +--- + ucm2/USB-Audio/Teufel/CAGE-PRO-HiFi.conf | 21 +++++++++++++++++++++ + ucm2/USB-Audio/Teufel/CAGE-PRO.conf | 9 +++++++++ + ucm2/USB-Audio/USB-Audio.conf | 10 ++++++++++ + 3 files changed, 40 insertions(+) + create mode 100644 ucm2/USB-Audio/Teufel/CAGE-PRO-HiFi.conf + create mode 100644 ucm2/USB-Audio/Teufel/CAGE-PRO.conf + +diff --git a/ucm2/USB-Audio/Teufel/CAGE-PRO-HiFi.conf b/ucm2/USB-Audio/Teufel/CAGE-PRO-HiFi.conf +new file mode 100644 +index 0000000..c0fbe7b +--- /dev/null ++++ b/ucm2/USB-Audio/Teufel/CAGE-PRO-HiFi.conf +@@ -0,0 +1,21 @@ ++# SPDX-License-Identifier: MIT ++# SPDX-FileCopyrightText: 2025 Harald Sitter ++ ++SectionDevice."Headset" { ++ Comment "Chat" ++ Value { ++ PlaybackPCM "hw:${CardId},0" ++ PlaybackMixerElem "PCM" ++ CapturePCM "hw:${CardId},0" ++ CaptureMixerElem "Mic" ++ CaptureChannels 1 ++ } ++} ++ ++SectionDevice."Headphones" { ++ Comment "Game" ++ Value { ++ PlaybackPCM "hw:${CardId},1" ++ PlaybackMixerElem "PCM,1" ++ } ++} +diff --git a/ucm2/USB-Audio/Teufel/CAGE-PRO.conf b/ucm2/USB-Audio/Teufel/CAGE-PRO.conf +new file mode 100644 +index 0000000..bf75033 +--- /dev/null ++++ b/ucm2/USB-Audio/Teufel/CAGE-PRO.conf +@@ -0,0 +1,9 @@ ++# SPDX-License-Identifier: MIT ++# SPDX-FileCopyrightText: 2025 Harald Sitter ++ ++Comment "Lautsprecher Teufel GmbH CAGE PRO" ++ ++SectionUseCase."HiFi" { ++ Comment "Default" ++ File "/USB-Audio/Teufel/CAGE-PRO-HiFi.conf" ++} +diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf +index ef88ded..7a6a0ac 100644 +--- a/ucm2/USB-Audio/USB-Audio.conf ++++ b/ucm2/USB-Audio/USB-Audio.conf +@@ -521,6 +521,15 @@ If.ua-volt2 { + } + } + ++If.teufel-cage-pro { ++ Condition { ++ Type String ++ Haystack "${CardComponents}" ++ Needle "USB2cc2:0033" ++ } ++ True.Define.ProfileName "Teufel/CAGE-PRO" ++} ++ + If.ssl2 { + Condition { + Type String +@@ -559,6 +568,7 @@ If.beacn-studio { + } + True.Define.ProfileName "Beacn/Beacn-Studio" + } ++ + If.mixremap { + Condition { + Type String +-- +2.49.0 + + +From 63f161cb8d65ed828a1ce49b506f4e1b9a7c58e4 Mon Sep 17 00:00:00 2001 +From: Zoran Zhan +Date: Wed, 7 May 2025 14:41:14 +0800 +Subject: [PATCH 24/24] ucm2: MediaTek: mt8365-evk: Add SOF support + +Add support for MT8365 EVK with SOF enabled. When SOF is +disabled, the "HiFi" use case is used; when SOF is enabled, +the "SOF" use case is used. + +The main difference compared to the UCM with SOF disabled is +the device number for playback and capture, which now uses the +PCMs for SOF instead. + +Define these parameters as variables for each case (with and +without SOF), and move the common initialization to init.conf, +so the UCM can be shared by both configurations. + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/583 +Signed-off-by: Zoran Zhan +Signed-off-by: Jaroslav Kysela +--- + ucm2/MediaTek/mt8365-evk/HiFi.conf | 126 ++++++------------ + ucm2/MediaTek/mt8365-evk/init.conf | 31 +++++ + ucm2/MediaTek/mt8365-evk/mt8365-evk.conf | 40 +----- + ucm2/MediaTek/mt8365-evk/sof/SOF.conf | 87 ++++++++++++ + .../mt8365-evk/sof/sof-mt8365-evk.conf | 9 ++ + .../conf.d/sof-mt8365-evk/sof-mt8365-evk.conf | 1 + + 6 files changed, 174 insertions(+), 120 deletions(-) + create mode 100644 ucm2/MediaTek/mt8365-evk/init.conf + create mode 100644 ucm2/MediaTek/mt8365-evk/sof/SOF.conf + create mode 100644 ucm2/MediaTek/mt8365-evk/sof/sof-mt8365-evk.conf + create mode 120000 ucm2/conf.d/sof-mt8365-evk/sof-mt8365-evk.conf + +diff --git a/ucm2/MediaTek/mt8365-evk/HiFi.conf b/ucm2/MediaTek/mt8365-evk/HiFi.conf +index 81f563f..83514c7 100644 +--- a/ucm2/MediaTek/mt8365-evk/HiFi.conf ++++ b/ucm2/MediaTek/mt8365-evk/HiFi.conf +@@ -1,141 +1,97 @@ + SectionDevice."HDMI" { +- Comment "Hdmi output" ++ Comment "HDMI output" + + Value { +- PlaybackPriority 250 ++ PlaybackPriority 100 + PlaybackChannels 2 + PlaybackPCM "hw:${CardId},1" + } +- +- EnableSequence [ +- cset "name='O00 I07 Switch' on" +- cset "name='O01 I08 Switch' on" +- ] +- +- DisableSequence [ +- cset "name='O00 I07 Switch' off" +- cset "name='O01 I08 Switch' off" +- ] + } + + SectionDevice."Speaker" { +- Comment "Line-out Jack " ++ Comment "Lineout speaker" + + ConflictingDevice [ + "Headphones" + ] + +- Value { +- PlaybackPriority 300 +- PlaybackChannels 2 +- PlaybackPCM "hw:${CardId},0" +- PlaybackVolume "name='Lineout_PGAL_GAIN'" +- } +- + EnableSequence [ +- cset "name='Audio_Amp_L_Switch' Off" +- cset "name='Audio_Amp_R_Switch' Off" +- cset "name='Lineout_PGAL_GAIN' 0" +- cset "name='Speaker_Amp_Switch' On" ++ cset "name='Headphone Left Source' Open" ++ cset "name='Headphone Right Source' Open" ++ cset "name='Line Out Source' Playback" + ] + +- DisableSequence [ +- cset "name='Audio_Amp_L_Switch' On" +- cset "name='Audio_Amp_R_Switch' On" +- cset "name='Speaker_Amp_Switch' Off" +- ] ++ Value { ++ PlaybackPriority 200 ++ PlaybackChannels 2 ++ PlaybackPCM "hw:${CardId},${var:PlayDevN}" ++ } + } + + SectionDevice."Headphones" { +- Comment "Headset speakers" ++ Comment "Earphone speaker" + + ConflictingDevice [ + "Speaker" + ] + ++ EnableSequence [ ++ cset "name='Headphone Left Source' DAC" ++ cset "name='Headphone Right Source' DAC" ++ cset "name='Line Out Source' Open" ++ ] ++ + Value { + PlaybackPriority 300 + PlaybackChannels 2 +- PlaybackPCM "hw:${CardId},0" +- PlaybackVolume "name='Headset_PGAL_GAIN'" ++ PlaybackPCM "hw:${CardId},${var:PlayDevN}" + } +- +- EnableSequence [ +- cset "name='Audio_Amp_L_Switch' On" +- cset "name='Audio_Amp_R_Switch' On" +- cset "name='Headset_PGAL_GAIN' 1" +- cset "name='Speaker_Amp_Switch' Off" +- ] +- +- DisableSequence [ +- cset "name='Audio_Amp_L_Switch' Off" +- cset "name='Audio_Amp_R_Switch' Off" +- cset "name='Speaker_Amp_Switch' On" +- ] + } + +-SectionDevice."Mic1" { +- Comment "Amic" ++SectionDevice."Headset" { ++ Comment "Earphone microphone" + + ConflictingDevice [ +- "Mic2" ++ "Mic1" + ] + +- Value { +- CapturePriority 300 +- CaptureChannels 1 +- CapturePCM "hw:${CardId},2" +- } +- + EnableSequence [ +- cset "name='Audio_MicSource1_Setting' ADC1" +- cset "name='Audio_MICBIAS0_Switch' Off" ++ cset "name='PGA L Mux' AIN1" ++ cset "name='PGA R Mux' AIN1" + ] + +- DisableSequence [ +- cset "name='Audio_MicSource1_Setting' ADC2" +- cset "name='Audio_MICBIAS0_Switch' On" +- ] ++ Value { ++ CapturePriority 300 ++ CaptureChannels "${var:CapChanN}" ++ CapturePCM "hw:${CardId},${var:CapDevN}" ++ } + } + +-SectionDevice."Mic2" { +- Comment "Headset microphone" ++SectionDevice."Mic1" { ++ Comment "Analog microphone" + + ConflictingDevice [ +- "Mic1" ++ "Headset" + ] + +- Value { +- CapturePriority 350 +- CaptureChannels 1 +- CapturePCM "hw:${CardId},2" +- } +- + EnableSequence [ +- cset "name='Audio_MicSource1_Setting' ADC2" +- cset "name='Audio_MICBIAS0_Switch' On" ++ cset "name='PGA L Mux' AIN0" ++ cset "name='PGA R Mux' AIN0" + ] + +- DisableSequence [ +- cset "name='Audio_MicSource1_Setting' ADC1" +- cset "name='Audio_MICBIAS0_Switch' Off" +- ] ++ Value { ++ CapturePriority 200 ++ CaptureChannels "${var:CapChanN}" ++ CapturePCM "hw:${CardId},${var:CapDevN}" ++ } + } + +-SectionDevice."Mic3" { +- Comment "PDM microphones" ++SectionDevice."Mic2" { ++ Comment "Digital microphone" + + Value { + CapturePriority 100 + CaptureChannels 2 + CapturePCM "hw:${CardId},3" + } +- +- EnableSequence [ +- cset "name='Audio_MICBIAS0_Switch' On" +- ] +- +- DisableSequence [ +- cset "name='Audio_MICBIAS0_Switch' Off" +- ] + } +diff --git a/ucm2/MediaTek/mt8365-evk/init.conf b/ucm2/MediaTek/mt8365-evk/init.conf +new file mode 100644 +index 0000000..269530a +--- /dev/null ++++ b/ucm2/MediaTek/mt8365-evk/init.conf +@@ -0,0 +1,31 @@ ++Syntax 4 ++ ++SectionUseCase."HiFi" { ++ File "/MediaTek/mt8365-evk/HiFi.conf" ++ Comment "Default" ++} ++ ++SectionUseCase."SOF" { ++ File "/MediaTek/mt8365-evk/sof/SOF.conf" ++ Comment "Enable SOF" ++} ++ ++BootSequence [ ++ cset "name='Headphone Left Source' DAC" ++ cset "name='Headphone Right Source' DAC" ++ cset "name='Line Out Source' Open" ++ cset "name='PGA L Mux' AIN1" ++ cset "name='PGA R Mux' AIN1" ++ cset "name='Mic Type Mux' DCC" ++ cset "name='INT ADDA O03_O04 Switch' on" ++ cset "name='Headphone Volume' 10" ++ cset "name='Lineout Volume' 10" ++ cset "name='O00 I07 Switch' on" ++ cset "name='O01 I08 Switch' on" ++ cset "name='O03 I05 Switch' on" ++ cset "name='O04 I06 Switch' on" ++ cset "name='O05 I03 Switch' on" ++ cset "name='O06 I04 Switch' on" ++ cset "name='O09 I14 Switch' on" ++ cset "name='O10 I15 Switch' on" ++] +diff --git a/ucm2/MediaTek/mt8365-evk/mt8365-evk.conf b/ucm2/MediaTek/mt8365-evk/mt8365-evk.conf +index e396f8c..9df5644 100644 +--- a/ucm2/MediaTek/mt8365-evk/mt8365-evk.conf ++++ b/ucm2/MediaTek/mt8365-evk/mt8365-evk.conf +@@ -1,39 +1,9 @@ + Syntax 4 + +-SectionUseCase."HiFi" { +- File "/MediaTek/mt8365-evk/HiFi.conf" +- Comment "Play high quality music" ++Define { ++ PlayDevN "0" ++ CapDevN "2" ++ CapChanN "1" + } + +-BootSequence [ +- #Audio volume +- cset "name='Headset_PGAL_GAIN' 0" +- cset "name='Lineout_PGAL_GAIN' 0" +- +- #Audio amp +- cset "name='Audio_Amp_R_Switch' On" +- cset "name='Audio_Amp_L_Switch' On" +- +- #Headset out +- cset "name='Speaker_Amp_Switch' Off" +- +- #Dmic +- cset "name='Audio_MICBIAS0_Switch' On" +- +- #HDMI audio (I2S3 Out) +- cset "name='O00 I07 Switch' on" +- cset "name='O01 I08 Switch' on" +- +- #jack_mic Headset In +- cset "name='Audio_MicSource1_Setting' ADC2" +- +- cset "name='O03 I05 Switch' on" +- cset "name='O04 I06 Switch' on" +- cset "name='O05 I03 Switch' on" +- cset "name='O06 I04 Switch' on" +- cset "name='O09 I14 Switch' on" +- cset "name='O10 I15 Switch' on" +- cset "name='AUD_CLK_BUF_Switch' On" +- cset "name='Audio_ADC_1_Switch' On" +- cset "name='INT ADDA O03_O04 Switch' on" +-] ++Include.init.File "/MediaTek/mt8365-evk/init.conf" +diff --git a/ucm2/MediaTek/mt8365-evk/sof/SOF.conf b/ucm2/MediaTek/mt8365-evk/sof/SOF.conf +new file mode 100644 +index 0000000..af44feb +--- /dev/null ++++ b/ucm2/MediaTek/mt8365-evk/sof/SOF.conf +@@ -0,0 +1,87 @@ ++SectionDevice."Speaker" { ++ Comment "SOF Lineout speaker" ++ ++ ConflictingDevice [ ++ "Headphones" ++ ] ++ ++ EnableSequence [ ++ cset "name='Headphone Left Source' Open" ++ cset "name='Headphone Right Source' Open" ++ cset "name='Line Out Source' Playback" ++ ] ++ ++ Value { ++ PlaybackPriority 100 ++ PlaybackChannels 2 ++ PlaybackPCM "hw:${CardId},${var:PlayDevN}" ++ } ++} ++ ++SectionDevice."Headphones" { ++ Comment "SOF Earphone speaker" ++ ++ ConflictingDevice [ ++ "Speaker" ++ ] ++ ++ EnableSequence [ ++ cset "name='Headphone Left Source' DAC" ++ cset "name='Headphone Right Source' DAC" ++ cset "name='Line Out Source' Open" ++ ] ++ ++ Value { ++ PlaybackPriority 200 ++ PlaybackChannels 2 ++ PlaybackPCM "hw:${CardId},${var:PlayDevN}" ++ } ++} ++ ++SectionDevice."Headset" { ++ Comment "SOF Earphone microphone" ++ ++ ConflictingDevice [ ++ "Mic1" ++ ] ++ ++ EnableSequence [ ++ cset "name='PGA L Mux' AIN1" ++ cset "name='PGA R Mux' AIN1" ++ ] ++ ++ Value { ++ CapturePriority 300 ++ CaptureChannels "${var:CapChanN}" ++ CapturePCM "hw:${CardId},${var:CapDevN}" ++ } ++} ++ ++SectionDevice."Mic1" { ++ Comment "SOF Analog microphone" ++ ++ ConflictingDevice [ ++ "Headset" ++ ] ++ ++ EnableSequence [ ++ cset "name='PGA L Mux' AIN0" ++ cset "name='PGA R Mux' AIN0" ++ ] ++ ++ Value { ++ CapturePriority 200 ++ CaptureChannels "${var:CapChanN}" ++ CapturePCM "hw:${CardId},${var:CapDevN}" ++ } ++} ++ ++SectionDevice."Mic2" { ++ Comment "SOF Digital microphone" ++ ++ Value { ++ CapturePriority 100 ++ CaptureChannels 2 ++ CapturePCM "hw:${CardId},19" ++ } ++} +diff --git a/ucm2/MediaTek/mt8365-evk/sof/sof-mt8365-evk.conf b/ucm2/MediaTek/mt8365-evk/sof/sof-mt8365-evk.conf +new file mode 100644 +index 0000000..6369aac +--- /dev/null ++++ b/ucm2/MediaTek/mt8365-evk/sof/sof-mt8365-evk.conf +@@ -0,0 +1,9 @@ ++Syntax 4 ++ ++Define { ++ PlayDevN "16" ++ CapDevN "18" ++ CapChanN "2" ++} ++ ++Include.init.File "/MediaTek/mt8365-evk/init.conf" +diff --git a/ucm2/conf.d/sof-mt8365-evk/sof-mt8365-evk.conf b/ucm2/conf.d/sof-mt8365-evk/sof-mt8365-evk.conf +new file mode 120000 +index 0000000..527f25f +--- /dev/null ++++ b/ucm2/conf.d/sof-mt8365-evk/sof-mt8365-evk.conf +@@ -0,0 +1 @@ ++../../MediaTek/mt8365-evk/sof/sof-mt8365-evk.conf +\ No newline at end of file +-- +2.49.0 + From e8691ba09c3da1af3b60d64979f9debfd3ff5e50 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 23 Jul 2025 16:55:03 +0000 Subject: [PATCH 59/68] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- alsa-lib.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 2e492b4..e6abd87 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 3%{?prever_dot}%{?dist} +Release: 4%{?prever_dot}%{?dist} License: LGPL-2.1-or-later URL: http://www.alsa-project.org/ @@ -167,6 +167,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Wed Jul 23 2025 Fedora Release Engineering - 1.2.14-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Tue Jan 24 2025 Jaroslav Kysela - 1.2.14-3 - update to latest alsa-ucm-conf files From e97c40908c67c532094483c8e85b7205cc0c807a Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Sun, 7 Dec 2025 22:28:17 +0100 Subject: [PATCH 60/68] update to 1.2.15 Signed-off-by: Jaroslav Kysela --- alsa-git.patch | 31 - alsa-lib.spec | 19 +- alsa-ucm-conf.patch | 2374 ------------------------------------------- 3 files changed, 11 insertions(+), 2413 deletions(-) delete mode 100644 alsa-git.patch delete mode 100644 alsa-ucm-conf.patch diff --git a/alsa-git.patch b/alsa-git.patch deleted file mode 100644 index ded7dfb..0000000 --- a/alsa-git.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 07ec2ad34c42dba8656d3f543164f360f481c52e Mon Sep 17 00:00:00 2001 -From: Daniel Dadap -Date: Thu, 15 May 2025 08:32:35 -0500 -Subject: [PATCH] conf: aliases: add hda-acpi -> HDA-Intel alias - -The new snd_hda_acpi driver in Linux exposes the existing Azalia -interface to non-PCI devices advertised over ACPI. Add an alias -to the existing HDA-Intel configuration file so that devices using -this driver can be discovered properly. - -Signed-off-by: Daniel Dadap -Signed-off-by: Takashi Iwai ---- - src/conf/cards/aliases.conf | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/conf/cards/aliases.conf b/src/conf/cards/aliases.conf -index a54824ae..e2d59aa7 100644 ---- a/src/conf/cards/aliases.conf -+++ b/src/conf/cards/aliases.conf -@@ -57,6 +57,7 @@ CMI8786 cards.CMI8788 - CMI8787 cards.CMI8788 - pistachio cards.pistachio-card - VC4-HDMI cards.vc4-hdmi -+hda-acpi cards.HDA-Intel - - - --- -2.49.0 - diff --git a/alsa-lib.spec b/alsa-lib.spec index e6abd87..7c2e8fa 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,14 +2,14 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.14 -%define version_alsa_ucm 1.2.14 +%define version_alsa_lib 1.2.15 +%define version_alsa_ucm 1.2.15 %define version_alsa_tplg 1.2.5 Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 4%{?prever_dot}%{?dist} +Release: 1%{?prever_dot}%{?dist} License: LGPL-2.1-or-later URL: http://www.alsa-project.org/ @@ -19,8 +19,8 @@ Source2: ftp://ftp.alsa-project.org/pub/lib/alsa-topology-conf-%{version_alsa_t Source10: asound.conf Source11: modprobe-dist-alsa.conf Source12: modprobe-dist-oss.conf -Source40: alsa-ucm-conf.patch -Patch0: alsa-git.patch +#Source40: alsa-ucm-conf.patch +#Patch0: alsa-git.patch Patch1: alsa-lib-1.2.3.1-config.patch Patch2: alsa-lib-1.2.10-glibc-open.patch @@ -70,7 +70,7 @@ contains alsa-lib configuration of SoC topology %prep %setup -q -n %{name}-%{version}%{?prever}%{?postver} -%patch -P0 -p1 -b .alsa-git +#patch -P0 -p1 -b .alsa-git %patch -P1 -p1 -b .config %patch -P2 -p1 -b .glibc-open @@ -116,7 +116,7 @@ mkdir -p %{buildroot}/%{_datadir}/alsa/ucm2 # Unpack UCMs tar xvjf %{SOURCE1} -C %{buildroot}/%{_datadir}/alsa --strip-components=1 "*/ucm" "*/ucm2" -patch -d %{buildroot}/%{_datadir}/alsa -p1 < %{SOURCE40} +#patch -d %{buildroot}/%{_datadir}/alsa -p1 < %{SOURCE40} # Create topology directory mkdir -p %{buildroot}/%{_datadir}/alsa/topology @@ -167,10 +167,13 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Sun Dec 7 2025 Jaroslav Kysela - 1.2.15-1 +- update to 1.2.15 + * Wed Jul 23 2025 Fedora Release Engineering - 1.2.14-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild -* Tue Jan 24 2025 Jaroslav Kysela - 1.2.14-3 +* Tue Jun 24 2025 Jaroslav Kysela - 1.2.14-3 - update to latest alsa-ucm-conf files * Mon Apr 14 2025 Jaroslav Kysela - 1.2.14-2 diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch deleted file mode 100644 index 917177c..0000000 --- a/alsa-ucm-conf.patch +++ /dev/null @@ -1,2374 +0,0 @@ -From 25f519f66c3e496b21ca1ad83ebc6114dfaa9fc3 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Maja=20K=C4=85dzio=C5=82ka?= -Date: Tue, 22 Apr 2025 07:46:21 +0200 -Subject: [PATCH 01/24] acp3x-alc5682-max98357: Fix path of HiFi.conf -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/551 -Closes: https://github.com/alsa-project/alsa-ucm-conf/issues/550 -Fixes: 1048796e7fa9 ("Rename ucm2/AMD/acp3xalc5682m98 to ucm2/AMD/acp3x-alc5682-max98357") -Signed-off-by: Maja Kądziołka -Signed-off-by: Jaroslav Kysela ---- - ucm2/AMD/acp3x-alc5682-max98357/acp3x-alc5682-max98357.conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ucm2/AMD/acp3x-alc5682-max98357/acp3x-alc5682-max98357.conf b/ucm2/AMD/acp3x-alc5682-max98357/acp3x-alc5682-max98357.conf -index e1f1c9e..5b3f24a 100644 ---- a/ucm2/AMD/acp3x-alc5682-max98357/acp3x-alc5682-max98357.conf -+++ b/ucm2/AMD/acp3x-alc5682-max98357/acp3x-alc5682-max98357.conf -@@ -66,7 +66,7 @@ If.found { - Empty "${var:Found}" - } - False.SectionUseCase."HiFi" { -- File "/AMD/acp3xalc5682m98/HiFi.conf" -+ File "HiFi.conf" - Comment "Default" - } - } --- -2.49.0 - - -From ac64586ab4ad3a0f162af3ec8a196bfd3799c5c0 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Fri, 25 Apr 2025 11:47:20 +0200 -Subject: [PATCH 02/24] USB-Audio: Remove useless sections for Solid State Labs - SSL 2+ - -Signed-off-by: Jaroslav Kysela ---- - ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf | 8 -------- - 1 file changed, 8 deletions(-) - -diff --git a/ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf b/ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf -index d07e499..94e040f 100644 ---- a/ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf -+++ b/ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf -@@ -28,14 +28,6 @@ Macro [ - SectionDevice."Line1" { - Comment "Line Outputs 1/L + 2/R" - -- EnableSequence [ -- cdev "hw:${CardId}" -- ] -- -- DisableSequence [ -- cdev "hw:${CardId}" -- ] -- - Value { - PlaybackPriority 200 - } --- -2.49.0 - - -From fc17ed4f991836bb92f288b8714ad7efe6c05926 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Fri, 25 Apr 2025 11:53:11 +0200 -Subject: [PATCH 03/24] USB-Audio: Solid State Labs SSL 2+ - fix capture - channels - -It seems that there are 4 capture channels per report in issue #552: - - Capture: - Status: Stop - Interface 2 - Altset 1 - Format: S32_LE - Channels: 4 - Endpoint: 0x81 (1 IN) (ASYNC) - Rates: 44100, 48000, 88200, 96000, 176400, 192000 - Data packet interval: 125 us - Bits: 24 - Channel map: FL FR FC LFE - -Closes: https://github.com/alsa-project/alsa-ucm-conf/issues/552 -Signed-off-by: Jaroslav Kysela ---- - ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf | 6 +++--- - ucm2/USB-Audio/SolidStateLabs/SSL2Plus.conf | 2 +- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf b/ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf -index 94e040f..30160d3 100644 ---- a/ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf -+++ b/ucm2/USB-Audio/SolidStateLabs/SSL2Plus-HiFi.conf -@@ -18,7 +18,7 @@ Macro [ - Name "ssl2plus_mono_in" - Direction Capture - Channels 1 -- HWChannels 2 -+ HWChannels 4 - HWChannelPos0 MONO - HWChannelPos1 MONO - } -@@ -70,7 +70,7 @@ SectionDevice."Mic1" { - Macro.pcm_split.SplitPCMDevice { - Name "ssl2plus_mono_in" - Direction Capture -- HWChannels 2 -+ HWChannels 4 - Channels 1 - Channel0 0 - ChannelPos0 MONO -@@ -86,7 +86,7 @@ SectionDevice."Mic2" { - Macro.pcm_split.SplitPCMDevice { - Name "ssl2plus_mono_in" - Direction Capture -- HWChannels 2 -+ HWChannels 4 - Channels 1 - Channel0 1 - ChannelPos0 MONO -diff --git a/ucm2/USB-Audio/SolidStateLabs/SSL2Plus.conf b/ucm2/USB-Audio/SolidStateLabs/SSL2Plus.conf -index 2ffe4c4..c886593 100644 ---- a/ucm2/USB-Audio/SolidStateLabs/SSL2Plus.conf -+++ b/ucm2/USB-Audio/SolidStateLabs/SSL2Plus.conf -@@ -6,6 +6,6 @@ SectionUseCase."HiFi" { - } - - Define.DirectPlaybackChannels 4 --Define.DirectCaptureChannels 2 -+Define.DirectCaptureChannels 4 - - Include.dhw.File "/common/direct.conf" --- -2.49.0 - - -From 6c2177e856ffa884929ba84de2ba379b80e054a3 Mon Sep 17 00:00:00 2001 -From: Konrad Dybcio -Date: Mon, 14 Apr 2025 20:47:38 +0200 -Subject: [PATCH 04/24] ucm2: Qualcomm: x1e80100: Also match DMI board name - -The Surface Laptop 7 only says "Microsoft Corporation" and "Surface" -in the board_vendor and product_family fields respectively. Add another -field to match on. - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/546 -Signed-off-by: Konrad Dybcio -Signed-off-by: Jaroslav Kysela ---- - ucm2/Qualcomm/x1e80100/x1e80100.conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ucm2/Qualcomm/x1e80100/x1e80100.conf b/ucm2/Qualcomm/x1e80100/x1e80100.conf -index 3f89986..3eef4d4 100644 ---- a/ucm2/Qualcomm/x1e80100/x1e80100.conf -+++ b/ucm2/Qualcomm/x1e80100/x1e80100.conf -@@ -1,6 +1,6 @@ - Syntax 4 - --Define.DMI_info "${sys:devices/virtual/dmi/id/board_vendor}-${sys:devices/virtual/dmi/id/product_family}" -+Define.DMI_info "${sys:devices/virtual/dmi/id/board_vendor}-${sys:devices/virtual/dmi/id/product_family}-${sys:devices/virtual/dmi/id/board_name}" - - If.LENOVOT14s { - Condition { --- -2.49.0 - - -From c93b7c8cc3137180cf1e91af2dd212bbf604b66f Mon Sep 17 00:00:00 2001 -From: Konrad Dybcio -Date: Mon, 14 Apr 2025 20:47:38 +0200 -Subject: [PATCH 05/24] ucm2: Qualcomm: Add Surface Laptop 7 - -2 speakers, 2 dmics, combo jack, just like the T14s - reuse its -configuration - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/546 -Signed-off-by: Konrad Dybcio -Signed-off-by: Jaroslav Kysela ---- - ucm2/Qualcomm/x1e80100/x1e80100.conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ucm2/Qualcomm/x1e80100/x1e80100.conf b/ucm2/Qualcomm/x1e80100/x1e80100.conf -index 3eef4d4..10faf5f 100644 ---- a/ucm2/Qualcomm/x1e80100/x1e80100.conf -+++ b/ucm2/Qualcomm/x1e80100/x1e80100.conf -@@ -6,7 +6,7 @@ If.LENOVOT14s { - Condition { - Type RegexMatch - String "${var:DMI_info}" -- Regex "LENOVO.*Think((Pad T14s Gen 6.*)|(Book 16 G7 QOY))|(HP.*Omnibook X.*)|(ASUSTeK COMPUTER.*ASUS Zenbook A14)" -+ Regex "LENOVO.*Think((Pad T14s Gen 6.*)|(Book 16 G7 QOY))|(HP.*Omnibook X.*)|(ASUSTeK COMPUTER.*ASUS Zenbook A14)|(Microsoft Corporation.*Surface.*Microsoft Surface Laptop, 7th Edition)" - } - True.Include.t14s.File "/Qualcomm/x1e80100/LENOVO-T14s.conf" - } --- -2.49.0 - - -From 9105573b6cb71c4821d88e6eef0c4b2cfbb4ea61 Mon Sep 17 00:00:00 2001 -From: Svyatoslav Ryhel -Date: Sun, 27 Apr 2025 13:02:19 +0300 -Subject: [PATCH 06/24] tegra: max98089: fix cset names - -Adjust configs to match Linux kernel MAX98089 codec driver change. - -Fixes: 725570f9 ("ASoC: max98088: Remove duplicate DACs") - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/556 -Signed-off-by: Svyatoslav Ryhel -Signed-off-by: Jaroslav Kysela ---- - ucm2/Tegra/max98089/lge-x3-HiFi.conf | 24 +++++---------- - ucm2/Tegra/max98089/lge-x3-VoiceCall.conf | 36 ++++++++--------------- - ucm2/Tegra/max98089/lge-x3.conf | 6 ++-- - 3 files changed, 22 insertions(+), 44 deletions(-) - -diff --git a/ucm2/Tegra/max98089/lge-x3-HiFi.conf b/ucm2/Tegra/max98089/lge-x3-HiFi.conf -index 3738d72..d074b9f 100644 ---- a/ucm2/Tegra/max98089/lge-x3-HiFi.conf -+++ b/ucm2/Tegra/max98089/lge-x3-HiFi.conf -@@ -11,20 +11,16 @@ SectionDevice."Speaker" { - cset "name='Speaker Switch' on" - cset "name='Int Spk Switch' on" - -- cset "name='Left SPK Mixer Left DAC1 Switch' on" -- cset "name='Left SPK Mixer Left DAC2 Switch' on" -- cset "name='Left SPK Mixer Right DAC1 Switch' on" -- cset "name='Left SPK Mixer Right DAC2 Switch' on" -+ cset "name='Left SPK Mixer Left DAC Switch' on" -+ cset "name='Left SPK Mixer Right DAC Switch' on" - ] - - DisableSequence [ - cset "name='Speaker Switch' off" - cset "name='Int Spk Switch' off" - -- cset "name='Left SPK Mixer Left DAC1 Switch' off" -- cset "name='Left SPK Mixer Left DAC2 Switch' off" -- cset "name='Left SPK Mixer Right DAC1 Switch' off" -- cset "name='Left SPK Mixer Right DAC2 Switch' off" -+ cset "name='Left SPK Mixer Left DAC Switch' off" -+ cset "name='Left SPK Mixer Right DAC Switch' off" - ] - - Value { -@@ -46,19 +42,15 @@ SectionDevice."Headphones" { - EnableSequence [ - cset "name='Headphone Switch' on" - -- cset "name='Left HP Mixer Left DAC1 Switch' on" -- cset "name='Left HP Mixer Left DAC2 Switch' on" -- cset "name='Right HP Mixer Right DAC1 Switch' on" -- cset "name='Right HP Mixer Right DAC2 Switch' on" -+ cset "name='Left HP Mixer Left DAC Switch' on" -+ cset "name='Right HP Mixer Right DAC Switch' on" - ] - - DisableSequence [ - cset "name='Headphone Switch' off" - -- cset "name='Left HP Mixer Left DAC1 Switch' off" -- cset "name='Left HP Mixer Left DAC2 Switch' off" -- cset "name='Right HP Mixer Right DAC1 Switch' off" -- cset "name='Right HP Mixer Right DAC2 Switch' off" -+ cset "name='Left HP Mixer Left DAC Switch' off" -+ cset "name='Right HP Mixer Right DAC Switch' off" - ] - - Value { -diff --git a/ucm2/Tegra/max98089/lge-x3-VoiceCall.conf b/ucm2/Tegra/max98089/lge-x3-VoiceCall.conf -index 1634c7b..8e3a389 100644 ---- a/ucm2/Tegra/max98089/lge-x3-VoiceCall.conf -+++ b/ucm2/Tegra/max98089/lge-x3-VoiceCall.conf -@@ -11,20 +11,16 @@ SectionDevice."Speaker" { - cset "name='Speaker Switch' on" - cset "name='Int Spk Switch' on" - -- cset "name='Left SPK Mixer Left DAC1 Switch' on" -- cset "name='Left SPK Mixer Left DAC2 Switch' on" -- cset "name='Left SPK Mixer Right DAC1 Switch' on" -- cset "name='Left SPK Mixer Right DAC2 Switch' on" -+ cset "name='Left SPK Mixer Left DAC Switch' on" -+ cset "name='Left SPK Mixer Right DAC Switch' on" - ] - - DisableSequence [ - cset "name='Speaker Switch' off" - cset "name='Int Spk Switch' off" - -- cset "name='Left SPK Mixer Left DAC1 Switch' off" -- cset "name='Left SPK Mixer Left DAC2 Switch' off" -- cset "name='Left SPK Mixer Right DAC1 Switch' off" -- cset "name='Left SPK Mixer Right DAC2 Switch' off" -+ cset "name='Left SPK Mixer Left DAC Switch' off" -+ cset "name='Left SPK Mixer Right DAC Switch' off" - ] - - Value { -@@ -47,30 +43,22 @@ SectionDevice."Earpiece" { - cset "name='Receiver Switch' on" - cset "name='Earpiece Switch' on" - -- cset "name='Left REC Mixer Left DAC1 Switch' on" -- cset "name='Left REC Mixer Left DAC2 Switch' on" -- cset "name='Left REC Mixer Right DAC1 Switch' on" -- cset "name='Left REC Mixer Right DAC2 Switch' on" -+ cset "name='Left REC Mixer Left DAC Switch' on" -+ cset "name='Left REC Mixer Right DAC Switch' on" - -- cset "name='Right REC Mixer Left DAC1 Switch' on" -- cset "name='Right REC Mixer Left DAC2 Switch' on" -- cset "name='Right REC Mixer Right DAC1 Switch' on" -- cset "name='Right REC Mixer Right DAC2 Switch' on" -+ cset "name='Right REC Mixer Left DAC Switch' on" -+ cset "name='Right REC Mixer Right DAC Switch' on" - ] - - DisableSequence [ - cset "name='Receiver Switch' off" - cset "name='Earpiece Switch' off" - -- cset "name='Left REC Mixer Left DAC1 Switch' off" -- cset "name='Left REC Mixer Left DAC2 Switch' off" -- cset "name='Left REC Mixer Right DAC1 Switch' off" -- cset "name='Left REC Mixer Right DAC2 Switch' off" -+ cset "name='Left REC Mixer Left DAC Switch' off" -+ cset "name='Left REC Mixer Right DAC Switch' off" - -- cset "name='Right REC Mixer Left DAC1 Switch' off" -- cset "name='Right REC Mixer Left DAC2 Switch' off" -- cset "name='Right REC Mixer Right DAC1 Switch' off" -- cset "name='Right REC Mixer Right DAC2 Switch' off" -+ cset "name='Right REC Mixer Left DAC Switch' off" -+ cset "name='Right REC Mixer Right DAC Switch' off" - ] - - Value { -diff --git a/ucm2/Tegra/max98089/lge-x3.conf b/ucm2/Tegra/max98089/lge-x3.conf -index 9bea0cc..c90c4a1 100644 ---- a/ucm2/Tegra/max98089/lge-x3.conf -+++ b/ucm2/Tegra/max98089/lge-x3.conf -@@ -30,10 +30,8 @@ BootSequence [ - cset "name='Internal Mic 2 Switch' off" - cset "name='Mic Jack Switch' off" - -- cset "name='Right SPK Mixer Left DAC1 Switch' on" -- cset "name='Right SPK Mixer Left DAC2 Switch' on" -- cset "name='Right SPK Mixer Right DAC1 Switch' on" -- cset "name='Right SPK Mixer Right DAC2 Switch' on" -+ cset "name='Right SPK Mixer Left DAC Switch' on" -+ cset "name='Right SPK Mixer Right DAC Switch' on" - ] - - SectionUseCase."HiFi" { --- -2.49.0 - - -From a1edaee761d301f7d010124599fd9f82c34fc7db Mon Sep 17 00:00:00 2001 -From: Markus Parviainen -Date: Sun, 27 Apr 2025 20:20:42 +0300 -Subject: [PATCH 07/24] Fix Presonus Revelator IO44 HWChannels count - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/557 -Signed-off-by: Markus Parviainen -Signed-off-by: Jaroslav Kysela ---- - ucm2/USB-Audio/Presonus/Revelator-IO-44-HiFi.conf | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/ucm2/USB-Audio/Presonus/Revelator-IO-44-HiFi.conf b/ucm2/USB-Audio/Presonus/Revelator-IO-44-HiFi.conf -index f223e08..6439613 100644 ---- a/ucm2/USB-Audio/Presonus/Revelator-IO-44-HiFi.conf -+++ b/ucm2/USB-Audio/Presonus/Revelator-IO-44-HiFi.conf -@@ -59,7 +59,7 @@ SectionDevice."Line1" { - Macro.pcm_split.SplitPCMDevice { - Name "revelator_stereo_out" - Direction Playback -- HWChannels 2 -+ HWChannels 6 - Channels 2 - Channel0 0 - Channel1 1 -@@ -78,7 +78,7 @@ SectionDevice."Line2" { - Macro.pcm_split.SplitPCMDevice { - Name "revelator_stereo_out" - Direction Playback -- HWChannels 2 -+ HWChannels 6 - Channels 2 - Channel0 2 - Channel1 3 -@@ -97,7 +97,7 @@ SectionDevice."Line3" { - Macro.pcm_split.SplitPCMDevice { - Name "revelator_stereo_out" - Direction Playback -- HWChannels 2 -+ HWChannels 6 - Channels 2 - Channel0 4 - Channel1 5 --- -2.49.0 - - -From aa25928dd03299afc9bff994f06c37fc700bb8c0 Mon Sep 17 00:00:00 2001 -From: Johan Hovold -Date: Thu, 15 May 2025 15:06:56 +0200 -Subject: [PATCH 08/24] ucm2: Qualcomm: sc8280xp: fix internal microphones - device - -A recent change renamed the internal microphones device from "DMic01" to -"Mic", but the latter name is already used by the headset microphone so -this breaks the internal microphones on the Lenovo ThinkPad X13s. - -Rename the headset microphone device so that the names are unique and -fix up the jack hw mute property which is still using the old name. - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/563 -Fixes: ea7a065a7b50 ("ucm: fix SectionDevice identifiers") -Signed-off-by: Johan Hovold -Signed-off-by: Jaroslav Kysela ---- - ucm2/Qualcomm/sc8280xp/HiFi.conf | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/ucm2/Qualcomm/sc8280xp/HiFi.conf b/ucm2/Qualcomm/sc8280xp/HiFi.conf -index e20aa9c..916f1ee 100644 ---- a/ucm2/Qualcomm/sc8280xp/HiFi.conf -+++ b/ucm2/Qualcomm/sc8280xp/HiFi.conf -@@ -50,8 +50,8 @@ SectionDevice."Headphones" { - } - } - --SectionDevice."Mic" { -- Comment "Mic" -+SectionDevice."Headset" { -+ Comment "Headset microphone" - - Include.wcdmice.File "/codecs/wcd938x/HeadphoneMicEnableSeq.conf" - Include.wcdmicd.File "/codecs/wcd938x/HeadphoneMicDisableSeq.conf" -@@ -63,12 +63,12 @@ SectionDevice."Mic" { - CapturePCM "hw:${CardId},2" - CaptureMixerElem "ADC2" - JackControl "Mic Jack" -- JackHWMute "DMic01" -+ JackHWMute "Mic" - } - } - - SectionDevice."Mic" { -- Comment "Microphone" -+ Comment "Internal microphones" - - Include.vadm0e.File "/codecs/qcom-lpass/va-macro/DMIC0EnableSeq.conf" - Include.vadm0d.File "/codecs/qcom-lpass/va-macro/DMIC0DisableSeq.conf" --- -2.49.0 - - -From 88e1cd78633ea0ad46115ffe8779140fa91fd2f5 Mon Sep 17 00:00:00 2001 -From: Johan Hovold -Date: Thu, 15 May 2025 15:14:53 +0200 -Subject: [PATCH 09/24] ucm2: Qualcomm: sm8650: QRD: fix headset jack hw mute - -A recent change renamed the internal microphone devices but failed to -update the headset jack hw mute properties that are still using the old -names. - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/563 -Fixes: ea7a065a7b50 ("ucm: fix SectionDevice identifiers") -Signed-off-by: Johan Hovold -Signed-off-by: Jaroslav Kysela ---- - ucm2/Qualcomm/sm8650/QRD/HiFi.conf | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/ucm2/Qualcomm/sm8650/QRD/HiFi.conf b/ucm2/Qualcomm/sm8650/QRD/HiFi.conf -index 4336525..ca40c29 100644 ---- a/ucm2/Qualcomm/sm8650/QRD/HiFi.conf -+++ b/ucm2/Qualcomm/sm8650/QRD/HiFi.conf -@@ -77,8 +77,8 @@ SectionDevice."Headset" { - CapturePCM "hw:${CardId},2" - CaptureMixerElem "ADC2" - JackControl "Mic Jack" -- JackHWMute "Bottom" -- JackHWMute "Back" -+ JackHWMute "Mic1" -+ JackHWMute "Mic2" - } - } - --- -2.49.0 - - -From bab88e0c31cee1c2603428c2ce6444aea343b646 Mon Sep 17 00:00:00 2001 -From: Johan Hovold -Date: Thu, 15 May 2025 15:17:02 +0200 -Subject: [PATCH 10/24] ucm2: tegra: max98090: fix headphones conflicting - device - -A recent change renames the speaker device but failed to update the -headphones conflicting device list. - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/563 -Fixes: ea7a065a7b50 ("ucm: fix SectionDevice identifiers") -Signed-off-by: Johan Hovold -Signed-off-by: Jaroslav Kysela ---- - ucm2/Tegra/max98090/HiFi.conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ucm2/Tegra/max98090/HiFi.conf b/ucm2/Tegra/max98090/HiFi.conf -index d6e4e9d..5d4ef71 100644 ---- a/ucm2/Tegra/max98090/HiFi.conf -+++ b/ucm2/Tegra/max98090/HiFi.conf -@@ -33,7 +33,7 @@ SectionDevice."Headphones" { - Comment = "Headphones" - - ConflictingDevice [ -- "Speakers" -+ "Speaker" - ] - - EnableSequence [ --- -2.49.0 - - -From 24d62b54d5ad6c7e6f9cff4cedcc334b1c98602f Mon Sep 17 00:00:00 2001 -From: Johan Hovold -Date: Thu, 15 May 2025 15:19:01 +0200 -Subject: [PATCH 11/24] ucm2: USB-Audio: Behringer: Flow8: fix conflicting - devices - -A recent change renamed the Line-56 and Line-78 devices but failed to -update the conflicting device lists. - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/563 -Fixes: ea7a065a7b50 ("ucm: fix SectionDevice identifiers") -Signed-off-by: Johan Hovold -Signed-off-by: Jaroslav Kysela ---- - ucm2/USB-Audio/Behringer/Flow8-Recording-Hifi.conf | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/ucm2/USB-Audio/Behringer/Flow8-Recording-Hifi.conf b/ucm2/USB-Audio/Behringer/Flow8-Recording-Hifi.conf -index 5dce19c..8ce7590 100644 ---- a/ucm2/USB-Audio/Behringer/Flow8-Recording-Hifi.conf -+++ b/ucm2/USB-Audio/Behringer/Flow8-Recording-Hifi.conf -@@ -157,7 +157,7 @@ SectionDevice."Line5" { - Comment "Line/Inst 5 (L)" - - ConflictingDevice [ -- "Line56" -+ "Line9" - ] - - Value { -@@ -177,7 +177,7 @@ SectionDevice."Line6" { - Comment "Line/Inst(HiZ) 6 (R)" - - ConflictingDevice [ -- "Line56" -+ "Line9" - ] - - Value { -@@ -197,7 +197,7 @@ SectionDevice."Line7" { - Comment "Line/Inst 7 (L)" - - ConflictingDevice [ -- "Line78" -+ "Line10" - ] - - Value { -@@ -217,7 +217,7 @@ SectionDevice."Line8" { - Comment "Line/Inst(HiZ) 8 (R)" - - ConflictingDevice [ -- "Line78" -+ "Line10" - ] - - Value { --- -2.49.0 - - -From 1f816194a9feb2ce0c973ccc2a93551a6f641d77 Mon Sep 17 00:00:00 2001 -From: Hiago De Franco -Date: Mon, 12 May 2025 13:57:32 -0300 -Subject: [PATCH 12/24] ucm2: IO-Boards: Toradex: smarc: add support - -Add support for Toradex SMARC Development board, using the WM8904 audio -codec. - -This is a carrier board for the Toradex SMARC family, where any SMARC -SoM can be connected to it, therefore this is being added to the -IO-Boards instead of a specific hardware vendor. - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/562 -Signed-off-by: Hiago De Franco -Signed-off-by: Jaroslav Kysela ---- - ucm2/IO-Boards/Toradex/smarc/dev-HiFi.conf | 39 +++++++++++++++++++ - ucm2/IO-Boards/Toradex/smarc/dev.conf | 17 ++++++++ - ucm2/conf.d/simple-card/tdx-smarc-wm8904.conf | 1 + - 3 files changed, 57 insertions(+) - create mode 100644 ucm2/IO-Boards/Toradex/smarc/dev-HiFi.conf - create mode 100644 ucm2/IO-Boards/Toradex/smarc/dev.conf - create mode 120000 ucm2/conf.d/simple-card/tdx-smarc-wm8904.conf - -diff --git a/ucm2/IO-Boards/Toradex/smarc/dev-HiFi.conf b/ucm2/IO-Boards/Toradex/smarc/dev-HiFi.conf -new file mode 100644 -index 0000000..7d2dffc ---- /dev/null -+++ b/ucm2/IO-Boards/Toradex/smarc/dev-HiFi.conf -@@ -0,0 +1,39 @@ -+# Use case configuration for Toradex SMARC Development Carrier Board -+# This is a carrier board for the Toradex SMARC family, where any Toradex SMARC -+# SoM (with different SoCs as iMX8MP, iMX95...) can be connected to it. -+ -+SectionDevice."Headphones" { -+ Comment "Headphones" -+ -+ EnableSequence [ -+ cset "name='Headphone Switch' on" -+ ] -+ -+ DisableSequence [ -+ cset "name='Headphone Switch' off" -+ ] -+ -+ Value { -+ PlaybackPCM "hw:${CardId}" -+ PlaybackVolume "Headphone Volume" -+ PlaybackSwitch "Headphone Switch" -+ } -+} -+ -+SectionDevice."Mic" { -+ Comment "Microphone" -+ -+ EnableSequence [ -+ cset "name='Capture Switch' on" -+ ] -+ -+ DisableSequence [ -+ cset "name='Capture Switch' off" -+ ] -+ -+ Value { -+ CapturePCM "hw:${CardId}" -+ CaptureVolume "Capture Volume" -+ CaptureSwitch "Capture Switch" -+ } -+} -diff --git a/ucm2/IO-Boards/Toradex/smarc/dev.conf b/ucm2/IO-Boards/Toradex/smarc/dev.conf -new file mode 100644 -index 0000000..e795068 ---- /dev/null -+++ b/ucm2/IO-Boards/Toradex/smarc/dev.conf -@@ -0,0 +1,17 @@ -+# Use case configuration for Toradex SMARC Development Carrier Board -+# This is a carrier board for the Toradex SMARC family, where any Toradex SMARC -+# SoM (with different SoCs as iMX8MP, iMX95...) can be connected to it. -+ -+Syntax 4 -+ -+SectionUseCase."HiFi" { -+ File "/IO-Boards/Toradex/smarc/dev-HiFi.conf" -+ Comment "Default" -+} -+ -+BootSequence [ -+ cset "name='Headphone Volume' 50%" -+ cset "name='Left Capture Inverting Mux' 'IN1L'" -+ cset "name='Right Capture Inverting Mux' 'IN1R'" -+ cset "name='Capture Volume' 31" -+] -diff --git a/ucm2/conf.d/simple-card/tdx-smarc-wm8904.conf b/ucm2/conf.d/simple-card/tdx-smarc-wm8904.conf -new file mode 120000 -index 0000000..096f833 ---- /dev/null -+++ b/ucm2/conf.d/simple-card/tdx-smarc-wm8904.conf -@@ -0,0 +1 @@ -+../../IO-Boards/Toradex/smarc/dev.conf -\ No newline at end of file --- -2.49.0 - - -From ac918f9b606f6bfe102c449997a1bcab01934db0 Mon Sep 17 00:00:00 2001 -From: Flo -Date: Sat, 24 May 2025 11:52:12 +0200 -Subject: [PATCH 13/24] USB-Audio: Solid State Labs SSL 2 - fix capture - channels - -Same fix as for SSL+, commit fc17ed4. -Capture configuration is the same, with 4 channels. - - Capture: - Status: Stop - Interface 2 - Altset 1 - Format: S32_LE - Channels: 4 - Endpoint: 0x81 (1 IN) (ASYNC) - Rates: 44100, 48000, 88200, 96000, 176400, 192000 - Data packet interval: 125 us - Bits: 24 - Channel map: FL FR FC LFE - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/566 -Signed-off-by: Flo -Signed-off-by: Jaroslav Kysela ---- - ucm2/USB-Audio/SolidStateLabs/SSL2-HiFi.conf | 6 +++--- - ucm2/USB-Audio/SolidStateLabs/SSL2.conf | 2 +- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/ucm2/USB-Audio/SolidStateLabs/SSL2-HiFi.conf b/ucm2/USB-Audio/SolidStateLabs/SSL2-HiFi.conf -index 46b2e26..8663384 100644 ---- a/ucm2/USB-Audio/SolidStateLabs/SSL2-HiFi.conf -+++ b/ucm2/USB-Audio/SolidStateLabs/SSL2-HiFi.conf -@@ -6,7 +6,7 @@ Macro [ - Name "ssl2_mono_in" - Direction Capture - Channels 1 -- HWChannels 2 -+ HWChannels 4 - HWChannelPos0 MONO - HWChannelPos1 MONO - } -@@ -31,7 +31,7 @@ SectionDevice."Mic1" { - Macro.pcm_split.SplitPCMDevice { - Name "ssl2_mono_in" - Direction Capture -- HWChannels 2 -+ HWChannels 4 - Channels 1 - Channel0 0 - ChannelPos0 MONO -@@ -47,7 +47,7 @@ SectionDevice."Mic2" { - Macro.pcm_split.SplitPCMDevice { - Name "ssl2_mono_in" - Direction Capture -- HWChannels 2 -+ HWChannels 4 - Channels 1 - Channel0 1 - ChannelPos0 MONO -diff --git a/ucm2/USB-Audio/SolidStateLabs/SSL2.conf b/ucm2/USB-Audio/SolidStateLabs/SSL2.conf -index 5531834..3cdb60b 100644 ---- a/ucm2/USB-Audio/SolidStateLabs/SSL2.conf -+++ b/ucm2/USB-Audio/SolidStateLabs/SSL2.conf -@@ -6,6 +6,6 @@ SectionUseCase."HiFi" { - } - - Define.DirectPlaybackChannels 2 --Define.DirectCaptureChannels 2 -+Define.DirectCaptureChannels 4 - - Include.dhw.File "/common/direct.conf" --- -2.49.0 - - -From 421e37bae75efc1fc134fbc84bc301f041aaff3b Mon Sep 17 00:00:00 2001 -From: Craig McLure -Date: Tue, 6 May 2025 18:40:47 +0100 -Subject: [PATCH 14/24] USB-Audio: Added Beacn Mic and Studio Support - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/558 -Signed-off-by: Craig McLure -Signed-off-by: Jaroslav Kysela ---- - ucm2/USB-Audio/Beacn/Beacn-Mic-HiFi.conf | 63 ++++++ - ucm2/USB-Audio/Beacn/Beacn-Mic.conf | 11 ++ - .../Beacn/Beacn-Studio-USB1-Channels.conf | 41 ++++ - .../Beacn/Beacn-Studio-USB1-HiFi.conf | 35 ++++ - .../Beacn/Beacn-Studio-USB1-Link-HiFi.conf | 179 ++++++++++++++++++ - .../Beacn/Beacn-Studio-USB2-HiFi.conf | 175 +++++++++++++++++ - ucm2/USB-Audio/Beacn/Beacn-Studio.conf | 42 ++++ - ucm2/USB-Audio/USB-Audio.conf | 16 ++ - 8 files changed, 562 insertions(+) - create mode 100644 ucm2/USB-Audio/Beacn/Beacn-Mic-HiFi.conf - create mode 100644 ucm2/USB-Audio/Beacn/Beacn-Mic.conf - create mode 100644 ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-Channels.conf - create mode 100644 ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-HiFi.conf - create mode 100644 ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-Link-HiFi.conf - create mode 100644 ucm2/USB-Audio/Beacn/Beacn-Studio-USB2-HiFi.conf - create mode 100644 ucm2/USB-Audio/Beacn/Beacn-Studio.conf - -diff --git a/ucm2/USB-Audio/Beacn/Beacn-Mic-HiFi.conf b/ucm2/USB-Audio/Beacn/Beacn-Mic-HiFi.conf -new file mode 100644 -index 0000000..2445531 ---- /dev/null -+++ b/ucm2/USB-Audio/Beacn/Beacn-Mic-HiFi.conf -@@ -0,0 +1,63 @@ -+Include.pcm_split.File "/common/pcm/split.conf" -+ -+Macro [ -+ { -+ SplitPCM { -+ Name "beacn_mic_stereo_out" -+ Direction Playback -+ Channels 2 -+ HWChannels 3 -+ HWChannelPos0 FL -+ HWChannelPos1 FR -+ HWChannelPos2 MONO -+ } -+ } -+ { -+ SplitPCM { -+ Name "beacn_mic_stereo_in" -+ Direction Capture -+ Channels 2 -+ HWChannels 4 -+ HWChannelPos0 FL -+ HWChannelPos1 FR -+ HWChannelPos2 MONO # Dry Mic -+ HWChannelPos3 MONO # Dry + Expander -+ } -+ } -+] -+ -+SectionDevice."Headphones" { -+ Comment "Headphones" -+ -+ Value { -+ PlaybackPriority 200 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_mic_stereo_out" -+ Direction Playback -+ HWChannels 3 -+ Channels 2 -+ Channel0 0 -+ Channel1 1 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."Mic" { -+ Comment "Microphone" -+ -+ Value { -+ CapturePriority 200 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_mic_stereo_in" -+ Direction Capture -+ HWChannels 4 -+ Channels 2 -+ Channel0 0 -+ Channel1 1 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -diff --git a/ucm2/USB-Audio/Beacn/Beacn-Mic.conf b/ucm2/USB-Audio/Beacn/Beacn-Mic.conf -new file mode 100644 -index 0000000..95c6f81 ---- /dev/null -+++ b/ucm2/USB-Audio/Beacn/Beacn-Mic.conf -@@ -0,0 +1,11 @@ -+Comment "Beacn Mic USB" -+ -+SectionUseCase."HiFi" { -+ Comment "Default Alsa Profile" -+ File "/USB-Audio/Beacn/Beacn-Mic-HiFi.conf" -+} -+ -+Define.DirectPlaybackChannels 3 -+Define.DirectCaptureChannels 4 -+ -+Include.dhw.File "/common/direct.conf" -diff --git a/ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-Channels.conf b/ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-Channels.conf -new file mode 100644 -index 0000000..b9886f4 ---- /dev/null -+++ b/ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-Channels.conf -@@ -0,0 +1,41 @@ -+Include.pcm_split.File "/common/pcm/split.conf" -+ -+Macro.playback.SplitPCM { -+ Name "beacn_studio_stereo_out" -+ Direction Playback -+ Channels 2 -+ HWChannels 11 -+ HWChannelPos0 FL # Headphone Left -+ HWChannelPos1 FR # Headphone Right -+ HWChannelPos2 MONO # Unused Channel -+ HWChannelPos3 FL # Link 1 Out Left -+ HWChannelPos4 FR # Link 1 Out Right -+ HWChannelPos5 FL # Link 2 Out Left -+ HWChannelPos6 FR # Link 2 Out Right -+ HWChannelPos7 FL # Link 3 Out Left -+ HWChannelPos8 FR # Link 3 Out Right -+ HWChannelPos9 FL # Link 4 Out Left -+ HWChannelPos10 FR # Link 4 Out Right -+} -+ -+Macro.capture.SplitPCM { -+ Name "beacn_studio_stereo_in" -+ Direction Capture -+ Channels 2 -+ HWChannels 12 -+ -+ HWChannelPos0 FL # Microphone Left -+ HWChannelPos1 FR # Microphone Right -+ -+ HWChannelPos2 MONO # UNKNOWN (Possible Dry Mic) -+ HWChannelPos3 MONO # UNKNOWN (Possible Dry + Expander) -+ -+ HWChannelPos4 FL # Link 1 In Left -+ HWChannelPos5 FR # Link 1 In Right -+ HWChannelPos6 FL # Link 2 In Left -+ HWChannelPos7 FR # Link 2 In Right -+ HWChannelPos8 FL # Link 3 In Left -+ HWChannelPos9 FR # Link 3 In Right -+ HWChannelPos10 FL # Link 4 In Left -+ HWChannelPos11 FR # Link 4 In Right -+} -diff --git a/ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-HiFi.conf b/ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-HiFi.conf -new file mode 100644 -index 0000000..8c90d5b ---- /dev/null -+++ b/ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-HiFi.conf -@@ -0,0 +1,35 @@ -+SectionDevice."Headphones" { -+ Comment "Headphones" -+ -+ Value { -+ PlaybackPriority 100 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_out" -+ Direction Playback -+ HWChannels 11 -+ Channels 2 -+ Channel0 0 -+ Channel1 1 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."Mic" { -+ Comment "Microphone" -+ -+ Value { -+ CapturePriority 100 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_in" -+ Direction Capture -+ HWChannels 12 -+ Channels 2 -+ Channel0 0 -+ Channel1 1 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -diff --git a/ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-Link-HiFi.conf b/ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-Link-HiFi.conf -new file mode 100644 -index 0000000..74ff142 ---- /dev/null -+++ b/ucm2/USB-Audio/Beacn/Beacn-Studio-USB1-Link-HiFi.conf -@@ -0,0 +1,179 @@ -+SectionDevice."Line1" { -+ Comment "Link 4" -+ -+ Value { -+ PlaybackPriority 400 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_out" -+ Direction Playback -+ HWChannels 11 -+ Channels 2 -+ Channel0 9 -+ Channel1 10 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."Line2" { -+ Comment "Link 3" -+ -+ Value { -+ PlaybackPriority 400 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_out" -+ Direction Playback -+ HWChannels 11 -+ Channels 2 -+ Channel0 7 -+ Channel1 8 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."Line3" { -+ Comment "Link 2" -+ -+ Value { -+ PlaybackPriority 400 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_out" -+ Direction Playback -+ HWChannels 11 -+ Channels 2 -+ Channel0 5 -+ Channel1 6 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."Line4" { -+ Comment "Link 1" -+ -+ Value { -+ PlaybackPriority 400 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_out" -+ Direction Playback -+ HWChannels 11 -+ Channels 2 -+ Channel0 3 -+ Channel1 4 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."Headphones" { -+ Comment "Headphones" -+ -+ Value { -+ PlaybackPriority 100 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_out" -+ Direction Playback -+ HWChannels 11 -+ Channels 2 -+ Channel0 0 -+ Channel1 1 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."Line5" { -+ Comment "Link 4" -+ -+ Value { -+ PlaybackPriority 400 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_in" -+ Direction Capture -+ HWChannels 12 -+ Channels 2 -+ Channel0 10 -+ Channel1 11 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."Line6" { -+ Comment "Link 3" -+ -+ Value { -+ PlaybackPriority 400 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_in" -+ Direction Capture -+ HWChannels 12 -+ Channels 2 -+ Channel0 8 -+ Channel1 9 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."Line7" { -+ Comment "Link 2" -+ -+ Value { -+ PlaybackPriority 400 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_in" -+ Direction Capture -+ HWChannels 12 -+ Channels 2 -+ Channel0 6 -+ Channel1 7 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."Line8" { -+ Comment "Link 1" -+ -+ Value { -+ PlaybackPriority 400 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_in" -+ Direction Capture -+ HWChannels 12 -+ Channels 2 -+ Channel0 4 -+ Channel1 5 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."Mic" { -+ Comment "Microphone" -+ -+ Value { -+ CapturePriority 100 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_in" -+ Direction Capture -+ HWChannels 12 -+ Channels 2 -+ Channel0 0 -+ Channel1 1 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -diff --git a/ucm2/USB-Audio/Beacn/Beacn-Studio-USB2-HiFi.conf b/ucm2/USB-Audio/Beacn/Beacn-Studio-USB2-HiFi.conf -new file mode 100644 -index 0000000..5988d41 ---- /dev/null -+++ b/ucm2/USB-Audio/Beacn/Beacn-Studio-USB2-HiFi.conf -@@ -0,0 +1,175 @@ -+Include.pcm_split.File "/common/pcm/split.conf" -+ -+Macro.playback.SplitPCM { -+ Name "beacn_studio_stereo_out" -+ Direction Playback -+ Channels 2 -+ HWChannels 8 -+ HWChannelPos0 FL -+ HWChannelPos1 FR -+ HWChannelPos2 FL -+ HWChannelPos3 FR -+ HWChannelPos4 FL -+ HWChannelPos5 FR -+ HWChannelPos6 FL -+ HWChannelPos7 FR -+} -+ -+Macro.capture.SplitPCM { -+ Name "beacn_studio_stereo_in" -+ Direction Capture -+ Channels 2 -+ HWChannels 8 -+ HWChannelPos0 FL -+ HWChannelPos1 FR -+ HWChannelPos2 FL -+ HWChannelPos3 FR -+ HWChannelPos4 FL -+ HWChannelPos5 FR -+ HWChannelPos6 FL -+ HWChannelPos7 FR -+} -+ -+SectionDevice."Line1" { -+ Comment "Link 4" -+ -+ Value { -+ PlaybackPriority 400 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_out" -+ Direction Playback -+ HWChannels 8 -+ Channels 2 -+ Channel0 6 -+ Channel1 7 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."Line2" { -+ Comment "Link 3" -+ -+ Value { -+ PlaybackPriority 400 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_out" -+ Direction Playback -+ HWChannels 8 -+ Channels 2 -+ Channel0 4 -+ Channel1 5 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."Line3" { -+ Comment "Link 2" -+ -+ Value { -+ PlaybackPriority 400 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_out" -+ Direction Playback -+ HWChannels 8 -+ Channels 2 -+ Channel0 2 -+ Channel1 3 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."Line4" { -+ Comment "Link 1" -+ -+ Value { -+ PlaybackPriority 400 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_out" -+ Direction Playback -+ HWChannels 8 -+ Channels 2 -+ Channel0 0 -+ Channel1 1 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."Line5" { -+ Comment "Link 4" -+ -+ Value { -+ PlaybackPriority 400 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_in" -+ Direction Capture -+ HWChannels 8 -+ Channels 2 -+ Channel0 6 -+ Channel1 7 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."Line6" { -+ Comment "Link 3" -+ -+ Value { -+ PlaybackPriority 400 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_in" -+ Direction Capture -+ HWChannels 8 -+ Channels 2 -+ Channel0 4 -+ Channel1 5 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."Line7" { -+ Comment "Link 2" -+ -+ Value { -+ PlaybackPriority 400 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_in" -+ Direction Capture -+ HWChannels 8 -+ Channels 2 -+ Channel0 2 -+ Channel1 3 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -+ -+SectionDevice."Line8" { -+ Comment "Link 1" -+ -+ Value { -+ PlaybackPriority 400 -+ } -+ Macro.pcm_split.SplitPCMDevice { -+ Name "beacn_studio_stereo_in" -+ Direction Capture -+ HWChannels 8 -+ Channels 2 -+ Channel0 0 -+ Channel1 1 -+ ChannelPos0 FL -+ ChannelPos1 FR -+ } -+} -diff --git a/ucm2/USB-Audio/Beacn/Beacn-Studio.conf b/ucm2/USB-Audio/Beacn/Beacn-Studio.conf -new file mode 100644 -index 0000000..1b3adc0 ---- /dev/null -+++ b/ucm2/USB-Audio/Beacn/Beacn-Studio.conf -@@ -0,0 +1,42 @@ -+# The Beacn Studio has two USB ports which both present different PIDs, so we do -+# individual checks, and load the appropriate configs for the port connected. -+ -+Comment "Beacn Studio USB" -+If.usb1 { -+ Condition { -+ Type String -+ Haystack "${CardComponents}" -+ Needle "USB33ae:0003" -+ } -+ True { -+ # Channel configuration is common between all the profiles, so we'll include it here -+ Include.pcm_split.File "/USB-Audio/Beacn/Beacn-Studio-USB1-Channels.conf" -+ -+ # If the user isn't using the 'Dual PC' feature of the Beacn Studio, there isn't really -+ # much point presenting them with an additional 4 unusable inputs and outputs, so we'll -+ # offer two profile options so those channels can be hidden. -+ SectionUseCase."Basic" { -+ Comment "Beacn Studio" -+ File "/USB-Audio/Beacn/Beacn-Studio-USB1-HiFi.conf" -+ } -+ -+ SectionUseCase."Link" { -+ Comment "Beacn Studio with Link" -+ File "/USB-Audio/Beacn/Beacn-Studio-USB1-Link-HiFi.conf" -+ } -+ } -+} -+ -+If.usb2 { -+ Condition { -+ Type String -+ Haystack "${CardComponents}" -+ Needle "USB33ae:4003" -+ } -+ True { -+ SectionUseCase."Link" { -+ Comment "Beacn Studio Link" -+ File "/USB-Audio/Beacn/Beacn-Studio-USB2-HiFi.conf" -+ } -+ } -+} -diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf -index fe2cd46..d90db39 100644 ---- a/ucm2/USB-Audio/USB-Audio.conf -+++ b/ucm2/USB-Audio/USB-Audio.conf -@@ -541,7 +541,23 @@ If.ssl2plus { - ProfileName "SolidStateLabs/SSL2Plus" - } - } -+If.beacn-mic { -+ Condition { -+ Type String -+ Haystack "${CardComponents}" -+ Needle "USB33ae:0001" -+ } -+ True.Define.ProfileName "Beacn/Beacn-Mic" -+} - -+If.beacn-studio { -+ Condition { -+ Type RegexMatch -+ String "${CardComponents}" -+ Regex "USB33ae:[04]003" -+ } -+ True.Define.ProfileName "Beacn/Beacn-Studio" -+} - If.mixremap { - Condition { - Type String --- -2.49.0 - - -From e055d16bdf971e26c3d92d998bccb2ca4e4f3c1a Mon Sep 17 00:00:00 2001 -From: binarycraft007 -Date: Mon, 2 Jun 2025 13:41:38 +0800 -Subject: [PATCH 15/24] ucm2: Qualcomm: add ASUS Vivobook S 15 support - -S15 supports: - - 2 speakers. - - 2 dmics - - headset with mic. - -This patch adds support to all these, however only speakers, dmic and -headset playback is tested. - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/570 -Signed-off-by: binarycraft007 -Signed-off-by: Jaroslav Kysela ---- - ucm2/Qualcomm/x1e80100/x1e80100.conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ucm2/Qualcomm/x1e80100/x1e80100.conf b/ucm2/Qualcomm/x1e80100/x1e80100.conf -index 10faf5f..ecbb13d 100644 ---- a/ucm2/Qualcomm/x1e80100/x1e80100.conf -+++ b/ucm2/Qualcomm/x1e80100/x1e80100.conf -@@ -6,7 +6,7 @@ If.LENOVOT14s { - Condition { - Type RegexMatch - String "${var:DMI_info}" -- Regex "LENOVO.*Think((Pad T14s Gen 6.*)|(Book 16 G7 QOY))|(HP.*Omnibook X.*)|(ASUSTeK COMPUTER.*ASUS Zenbook A14)|(Microsoft Corporation.*Surface.*Microsoft Surface Laptop, 7th Edition)" -+ Regex "LENOVO.*Think((Pad T14s Gen 6.*)|(Book 16 G7 QOY))|(HP.*Omnibook X.*)|ASUSTeK COMPUTER.*ASUS (Zenbook A14|Vivobook S 15)|(Microsoft Corporation.*Surface.*Microsoft Surface Laptop, 7th Edition)" - } - True.Include.t14s.File "/Qualcomm/x1e80100/LENOVO-T14s.conf" - } --- -2.49.0 - - -From 59d53fd9cac27e9a05623251aefa6d06da94260c Mon Sep 17 00:00:00 2001 -From: Craig McLure -Date: Wed, 4 Jun 2025 23:25:51 +0100 -Subject: [PATCH 16/24] Changed 'Stream Mix' channel names to match the latest - Window release - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/572 -Signed-off-by: Craig McLure -Signed-off-by: Jaroslav Kysela ---- - ucm2/USB-Audio/GoXLR/GoXLR-HiFi.conf | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/ucm2/USB-Audio/GoXLR/GoXLR-HiFi.conf b/ucm2/USB-Audio/GoXLR/GoXLR-HiFi.conf -index 6614b00..17c6580 100644 ---- a/ucm2/USB-Audio/GoXLR/GoXLR-HiFi.conf -+++ b/ucm2/USB-Audio/GoXLR/GoXLR-HiFi.conf -@@ -140,7 +140,7 @@ SectionDevice."Line3" { - } - - SectionDevice."Line4" { -- Comment "Broadcast Stream Mix" -+ Comment "Stream Mix 1" - - Value { - CapturePriority 200 -@@ -200,7 +200,7 @@ If.mix2 { - String2 "25" - } - True.SectionDevice."Line6" { -- Comment "Broadcast Stream Mix 2" -+ Comment "Stream Mix 2" - - Value { - CapturePriority 200 --- -2.49.0 - - -From bd5cf3839f902b67a355669fdf1bd3231e0cb4c1 Mon Sep 17 00:00:00 2001 -From: Mohammad Rafi Shaik -Date: Mon, 9 Jun 2025 20:52:42 +0530 -Subject: [PATCH 17/24] Qualcomm: Add QCS9075-IQ-EVK HiFi config - -Add UCM2 configs for the Qualcomm QCS9075-IQ-EVK Board to handle: - - I2S Speaker Amplifier - - I2S Mic - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/576 -Signed-off-by: Mohammad Rafi Shaik -Signed-off-by: Jaroslav Kysela ---- - .../qcs9075/qcs9075-iq-evk-snd-card/HiFi.conf | 29 +++++++++++++++++++ - .../qcs9075-iq-evk-snd-card.conf | 6 ++++ - .../qcs9075/qcs9075-iq-evk-snd-card.conf | 6 ++++ - 3 files changed, 41 insertions(+) - create mode 100644 ucm2/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/HiFi.conf - create mode 100644 ucm2/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/qcs9075-iq-evk-snd-card.conf - create mode 100644 ucm2/conf.d/qcs9075/qcs9075-iq-evk-snd-card.conf - -diff --git a/ucm2/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/HiFi.conf b/ucm2/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/HiFi.conf -new file mode 100644 -index 0000000..6673324 ---- /dev/null -+++ b/ucm2/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/HiFi.conf -@@ -0,0 +1,29 @@ -+SectionVerb { -+ Value { -+ TQ "HiFi" -+ } -+ EnableSequence [ -+ cset "name='PRIMARY_SDR_MI2S_RX Audio Mixer MULTIMEDIA0' 1" -+ cset "name='MULTIMEDIA1 Audio Mixer TERTIARY_SDR_MI2S_TX' 1" -+ ] -+} -+ -+SectionDevice."Speaker" { -+ Comment "Speaker playback" -+ -+ Value { -+ PlaybackPriority 100 -+ PlaybackPCM "hw:${CardId},0" -+ PlaybackMixer "default:${CardId}" -+ PlaybackMixerElem "Speakers" -+ } -+} -+ -+SectionDevice."Mic" { -+ Comment "Mic" -+ -+ Value { -+ CapturePriority 100 -+ CapturePCM "hw:${CardId},1" -+ } -+} -diff --git a/ucm2/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/qcs9075-iq-evk-snd-card.conf b/ucm2/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/qcs9075-iq-evk-snd-card.conf -new file mode 100644 -index 0000000..669ba6b ---- /dev/null -+++ b/ucm2/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/qcs9075-iq-evk-snd-card.conf -@@ -0,0 +1,6 @@ -+Syntax 4 -+ -+SectionUseCase."HiFi" { -+ File "/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/HiFi.conf" -+ Comment "HiFi quality Music" -+} -diff --git a/ucm2/conf.d/qcs9075/qcs9075-iq-evk-snd-card.conf b/ucm2/conf.d/qcs9075/qcs9075-iq-evk-snd-card.conf -new file mode 100644 -index 0000000..1e49d38 ---- /dev/null -+++ b/ucm2/conf.d/qcs9075/qcs9075-iq-evk-snd-card.conf -@@ -0,0 +1,6 @@ -+Syntax 4 -+ -+SectionUseCase."HiFi" { -+ File "/Qualcomm/qcs9075/qcs9075-iq-evk-snd-card/HiFi.conf" -+ Comment "HiFi quality Music." -+} --- -2.49.0 - - -From e7ec0f1ac3eebfa04e18a944d511bbb5fa57239d Mon Sep 17 00:00:00 2001 -From: Mohammad Rafi Shaik -Date: Tue, 10 Jun 2025 16:46:59 +0530 -Subject: [PATCH 18/24] ucm2: Qualcomm: Update the QCM6490 and QCS6490 hifi - conf files - -Rename the HiFi conf files for QCM6490-IDP and QCS6490-RB3Gen2 boards -to match with soundcard name. - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/577 -Signed-off-by: Mohammad Rafi Shaik -Signed-off-by: Jaroslav Kysela ---- - .../QCM6490-IDP/{QCM6490-IDP.conf => qcm6490-idp-snd-card.conf} | 0 - .../{QCS6490-RB3Gen2.conf => qcs6490-rb3gen2-snd-card.conf} | 0 - .../qcm6490/{QCM6490-IDP.conf => qcm6490-idp-snd-card.conf} | 0 - .../{QCS6490-RB3Gen2.conf => qcs6490-rb3gen2-snd-card.conf} | 0 - 4 files changed, 0 insertions(+), 0 deletions(-) - rename ucm2/Qualcomm/qcm6490/QCM6490-IDP/{QCM6490-IDP.conf => qcm6490-idp-snd-card.conf} (100%) - rename ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/{QCS6490-RB3Gen2.conf => qcs6490-rb3gen2-snd-card.conf} (100%) - rename ucm2/conf.d/qcm6490/{QCM6490-IDP.conf => qcm6490-idp-snd-card.conf} (100%) - rename ucm2/conf.d/qcs6490/{QCS6490-RB3Gen2.conf => qcs6490-rb3gen2-snd-card.conf} (100%) - -diff --git a/ucm2/Qualcomm/qcm6490/QCM6490-IDP/QCM6490-IDP.conf b/ucm2/Qualcomm/qcm6490/QCM6490-IDP/qcm6490-idp-snd-card.conf -similarity index 100% -rename from ucm2/Qualcomm/qcm6490/QCM6490-IDP/QCM6490-IDP.conf -rename to ucm2/Qualcomm/qcm6490/QCM6490-IDP/qcm6490-idp-snd-card.conf -diff --git a/ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/QCS6490-RB3Gen2.conf b/ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/qcs6490-rb3gen2-snd-card.conf -similarity index 100% -rename from ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/QCS6490-RB3Gen2.conf -rename to ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/qcs6490-rb3gen2-snd-card.conf -diff --git a/ucm2/conf.d/qcm6490/QCM6490-IDP.conf b/ucm2/conf.d/qcm6490/qcm6490-idp-snd-card.conf -similarity index 100% -rename from ucm2/conf.d/qcm6490/QCM6490-IDP.conf -rename to ucm2/conf.d/qcm6490/qcm6490-idp-snd-card.conf -diff --git a/ucm2/conf.d/qcs6490/QCS6490-RB3Gen2.conf b/ucm2/conf.d/qcs6490/qcs6490-rb3gen2-snd-card.conf -similarity index 100% -rename from ucm2/conf.d/qcs6490/QCS6490-RB3Gen2.conf -rename to ucm2/conf.d/qcs6490/qcs6490-rb3gen2-snd-card.conf --- -2.49.0 - - -From a98b12220989e2187a47b0e06ac9145c92232a8e Mon Sep 17 00:00:00 2001 -From: Mohammad Rafi Shaik -Date: Wed, 18 Jun 2025 16:46:18 +0530 -Subject: [PATCH 19/24] ucm2: Qualcomm: Update the HIFI enable mixer commands - for qcm6490-idp and qcs6490-rb3gen2 - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/577 -Signed-off-by: Mohammad Rafi Shaik -Signed-off-by: Jaroslav Kysela ---- - ucm2/Qualcomm/qcm6490/QCM6490-IDP/HiFi.conf | 8 ++++---- - ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/HiFi.conf | 4 ++-- - 2 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/ucm2/Qualcomm/qcm6490/QCM6490-IDP/HiFi.conf b/ucm2/Qualcomm/qcm6490/QCM6490-IDP/HiFi.conf -index 0d6497e..0a0d331 100644 ---- a/ucm2/Qualcomm/qcm6490/QCM6490-IDP/HiFi.conf -+++ b/ucm2/Qualcomm/qcm6490/QCM6490-IDP/HiFi.conf -@@ -3,10 +3,10 @@ SectionVerb { - TQ "HiFi" - } - EnableSequence [ -- cset "name='WSA_CODEC_DMA_RX_0 Audio Mixer MULTIMEDIA0' 1" -- cset "name='MULTIMEDIA1 Audio Mixer VA_CODEC_DMA_TX_0' 1" -- cset "name='RX_CODEC_DMA_RX_0 Audio Mixer MULTIMEDIA2' 1" -- cset "name='MULTIMEDIA3 Audio Mixer TX_CODEC_DMA_TX_3' 1" -+ cset "name='WSA_CODEC_DMA_RX_0 Audio Mixer MultiMedia1' 1" -+ cset "name='MultiMedia2 Mixer VA_CODEC_DMA_TX_0' 1" -+ cset "name='RX_CODEC_DMA_RX_0 Audio Mixer MultiMedia3' 1" -+ cset "name='MultiMedia4 Mixer TX_CODEC_DMA_TX_3' 1" - ] - - Include.wsae.File "/codecs/wsa883x/DefaultEnableSeq.conf" -diff --git a/ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/HiFi.conf b/ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/HiFi.conf -index 954dbfa..2488523 100644 ---- a/ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/HiFi.conf -+++ b/ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/HiFi.conf -@@ -3,8 +3,8 @@ SectionVerb { - TQ "HiFi" - } - EnableSequence [ -- cset "name='WSA_CODEC_DMA_RX_0 Audio Mixer MULTIMEDIA0' 1" -- cset "name='MULTIMEDIA1 Audio Mixer VA_CODEC_DMA_TX_0' 1" -+ cset "name='WSA_CODEC_DMA_RX_0 Audio Mixer MultiMedia1' 1" -+ cset "name='MultiMedia2 Mixer VA_CODEC_DMA_TX_0' 1" - ] - - Include.wsae.File "/codecs/wsa883x/DefaultEnableSeq.conf" --- -2.49.0 - - -From 56cbdfd04339cf9598cd9d57f5c1a382504ae902 Mon Sep 17 00:00:00 2001 -From: Peter Ujfalusi -Date: Thu, 12 Jun 2025 16:33:01 +0300 -Subject: [PATCH 20/24] UCM2: Intel: sof-hda-dsp: HiFi: Fix handling of mono - DMICs - -When a single DMIC is present in the system we need to set the -CaptureChannels to 1 since the PCM device only supports mono, PA/PW will -reject the profile since it cannot open the DMIC PCM device. - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/579 -Signed-off-by: Peter Ujfalusi -Signed-off-by: Jaroslav Kysela ---- - ucm2/Intel/sof-hda-dsp/HiFi.conf | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/ucm2/Intel/sof-hda-dsp/HiFi.conf b/ucm2/Intel/sof-hda-dsp/HiFi.conf -index 9689b56..e452f83 100644 ---- a/ucm2/Intel/sof-hda-dsp/HiFi.conf -+++ b/ucm2/Intel/sof-hda-dsp/HiFi.conf -@@ -34,6 +34,16 @@ If.dmic { - True { - CaptureChannels 4 - } -+ False.If.mono { -+ Condition { -+ Type RegexMatch -+ Regex "cfg-dmics:[1]" -+ String "${CardComponents}" -+ } -+ True { -+ CaptureChannels 1 -+ } -+ } - } - If.vol { - Condition { --- -2.49.0 - - -From e4791900954c3951d15038822a55a3031aac49d2 Mon Sep 17 00:00:00 2001 -From: Shuming Fan -Date: Fri, 6 Jun 2025 12:47:08 +0800 -Subject: [PATCH 21/24] ucm2: sof-soundwire: add rt712-vb device - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/573 -Signed-off-by: Shuming Fan -Signed-off-by: Jaroslav Kysela ---- - ucm2/codecs/rt712/init.conf | 34 ++++++++++++++++++++++++++++------ - ucm2/sof-soundwire/rt712.conf | 29 +++++++++++++++++++++++++++++ - 2 files changed, 57 insertions(+), 6 deletions(-) - -diff --git a/ucm2/codecs/rt712/init.conf b/ucm2/codecs/rt712/init.conf -index e09bf7f..1e45380 100644 ---- a/ucm2/codecs/rt712/init.conf -+++ b/ucm2/codecs/rt712/init.conf -@@ -1,8 +1,30 @@ - # RT712 specific volume control settings - --BootSequence [ -- cset "name='rt712 FU05 Playback Volume' 87" -- cset "name='rt712 ADC 23 Mux' 'MIC2'" -- cset "name='rt712 FU0F Capture Volume' 57" -- cset "name='rt712 FU0F Capture Switch' 1" --] -+If.rt712_init { -+ Condition { -+ Type RegexMatch -+ Regex "(rt712(-sdca)?)" -+ String "${var:MultiMicShadow}" -+ } -+ True { -+ # RT712-VB integrated with DMIC -+ BootSequence [ -+ cset "name='rt712 FU05 Playback Volume' 87" -+ cset "name='rt712 ADC 23 Mux' 'MIC2'" -+ cset "name='rt712 FU0F Capture Volume' 57" -+ cset "name='rt712 FU0F Capture Switch' 1" -+ cset "name='rt712 FU1E Capture Switch' 1" -+ cset "name='rt712 FU1E Capture Volume' 47" -+ cset "name='rt712 ADC 0A Mux' 'DMIC1'" -+ cset "name='rt712 ADC 0B Mux' 'DMIC2'" -+ ] -+ } -+ False { -+ BootSequence [ -+ cset "name='rt712 FU05 Playback Volume' 87" -+ cset "name='rt712 ADC 23 Mux' 'MIC2'" -+ cset "name='rt712 FU0F Capture Volume' 57" -+ cset "name='rt712 FU0F Capture Switch' 1" -+ ] -+ } -+} -diff --git a/ucm2/sof-soundwire/rt712.conf b/ucm2/sof-soundwire/rt712.conf -index 409bef9..346cff1 100644 ---- a/ucm2/sof-soundwire/rt712.conf -+++ b/ucm2/sof-soundwire/rt712.conf -@@ -85,3 +85,32 @@ SectionDevice."Headset" { - JackControl "Headset Mic Jack" - } - } -+ -+If.codecmic { -+ Condition { -+ Type RegexMatch -+ Regex "(rt712(-sdca)?)" -+ String "${var:MultiMicShadow}" -+ } -+ True { -+ SectionDevice."Mic" { -+ Comment "SoundWire Microphones" -+ -+ EnableSequence [ -+ cset "name='rt712 FU1E Capture Switch' 1" -+ ] -+ -+ DisableSequence [ -+ cset "name='rt712 FU1E Capture Switch' 0" -+ ] -+ -+ Value { -+ CapturePriority 100 -+ CapturePCM "hw:${CardId},4" -+ CaptureSwitch "rt712 FU1E Capture Switch" -+ CaptureVolume "rt712 FU1E Capture Volume" -+ CaptureMixerElem "rt712 FU1E" -+ } -+ } -+ } -+} --- -2.49.0 - - -From 436fbad2a02b91435645e039664af469595ab500 Mon Sep 17 00:00:00 2001 -From: DanielDecker <90106468+DanielDecker@users.noreply.github.com> -Date: Mon, 16 Jun 2025 18:27:21 +0200 -Subject: [PATCH 22/24] add MSI MAG B850M Mortar Wifi to USB-Audio.conf - -add MSI MAG B850M Mortar Wifi USB-ID for Realtek/ALC4080 to USB-Audio.conf - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/581 -Signed-off-by: DanielDecker <90106468+DanielDecker@users.noreply.github.com> -Signed-off-by: Jaroslav Kysela ---- - ucm2/USB-Audio/USB-Audio.conf | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf -index d90db39..ef88ded 100644 ---- a/ucm2/USB-Audio/USB-Audio.conf -+++ b/ucm2/USB-Audio/USB-Audio.conf -@@ -89,6 +89,7 @@ If.realtek-alc4080 { - # 0db0:a47c MSI MEG X570S Ace Max - # 0db0:a74b MSI MPG Z790 Edge Wifi - # 0db0:b202 MSI MAG Z690 Tomahawk Wifi -+ # 0db0:cc78 MSI MAG B850M Mortar Wifi - # 0db0:cd0e MSI X870 Tomahawk - # 0db0:d1d7 MSI PRO Z790-A WIFI - # 0db0:d6e7 MSI MPG X670E Carbon Wifi -@@ -96,7 +97,7 @@ If.realtek-alc4080 { - # 26ce:0a06 ASRock X670E/Z790 Taichi - # 26ce:0a08 ASRock Z790 PG-ITX/TB4, X870 Steel Legend - # 26ce:0a0b ASRock X870E Taichi -- Regex "USB((0414:a0(0e|1[0124]))|(0b05:(19(84|9[69])|1a(16|2[07]|5[23c]|97|f1)|1b(7c|9b|e1)))|(0db0:(005a|0b58|124b|151f|1feb|3130|36e7|4(19c|22d|240|88c)|543d|62a4|6c[0c]9|70d3|7696|82c7|8af7|961e|9e6d|a(073|228|47c|74b)|b202|cd0e|d1d7|d6e7|e1f8))|(26ce:0a0[68b]))" -+ Regex "USB((0414:a0(0e|1[0124]))|(0b05:(19(84|9[69])|1a(16|2[07]|5[23c]|97|f1)|1b(7c|9b|e1)))|(0db0:(005a|0b58|124b|151f|1feb|3130|36e7|4(19c|22d|240|88c)|543d|62a4|6c[0c]9|70d3|7696|82c7|8af7|961e|9e6d|a(073|228|47c|74b)|b202|c(c78|d0e)|d1d7|d6e7|e1f8))|(26ce:0a0[68b]))" - } - True.Define.ProfileName "Realtek/ALC4080" - } --- -2.49.0 - - -From b4896cf413e618f4b20c570544a4e668aaa72f64 Mon Sep 17 00:00:00 2001 -From: Harald Sitter -Date: Sat, 21 Jun 2025 17:10:20 +0200 -Subject: [PATCH 23/24] ucm2: USB-Audio: Add Teufel CAGE PRO - -two stereo outputs: one for "game" and one for "chat". -one mono input - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/582 -Signed-off-by: Harald Sitter -Signed-off-by: Jaroslav Kysela ---- - ucm2/USB-Audio/Teufel/CAGE-PRO-HiFi.conf | 21 +++++++++++++++++++++ - ucm2/USB-Audio/Teufel/CAGE-PRO.conf | 9 +++++++++ - ucm2/USB-Audio/USB-Audio.conf | 10 ++++++++++ - 3 files changed, 40 insertions(+) - create mode 100644 ucm2/USB-Audio/Teufel/CAGE-PRO-HiFi.conf - create mode 100644 ucm2/USB-Audio/Teufel/CAGE-PRO.conf - -diff --git a/ucm2/USB-Audio/Teufel/CAGE-PRO-HiFi.conf b/ucm2/USB-Audio/Teufel/CAGE-PRO-HiFi.conf -new file mode 100644 -index 0000000..c0fbe7b ---- /dev/null -+++ b/ucm2/USB-Audio/Teufel/CAGE-PRO-HiFi.conf -@@ -0,0 +1,21 @@ -+# SPDX-License-Identifier: MIT -+# SPDX-FileCopyrightText: 2025 Harald Sitter -+ -+SectionDevice."Headset" { -+ Comment "Chat" -+ Value { -+ PlaybackPCM "hw:${CardId},0" -+ PlaybackMixerElem "PCM" -+ CapturePCM "hw:${CardId},0" -+ CaptureMixerElem "Mic" -+ CaptureChannels 1 -+ } -+} -+ -+SectionDevice."Headphones" { -+ Comment "Game" -+ Value { -+ PlaybackPCM "hw:${CardId},1" -+ PlaybackMixerElem "PCM,1" -+ } -+} -diff --git a/ucm2/USB-Audio/Teufel/CAGE-PRO.conf b/ucm2/USB-Audio/Teufel/CAGE-PRO.conf -new file mode 100644 -index 0000000..bf75033 ---- /dev/null -+++ b/ucm2/USB-Audio/Teufel/CAGE-PRO.conf -@@ -0,0 +1,9 @@ -+# SPDX-License-Identifier: MIT -+# SPDX-FileCopyrightText: 2025 Harald Sitter -+ -+Comment "Lautsprecher Teufel GmbH CAGE PRO" -+ -+SectionUseCase."HiFi" { -+ Comment "Default" -+ File "/USB-Audio/Teufel/CAGE-PRO-HiFi.conf" -+} -diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf -index ef88ded..7a6a0ac 100644 ---- a/ucm2/USB-Audio/USB-Audio.conf -+++ b/ucm2/USB-Audio/USB-Audio.conf -@@ -521,6 +521,15 @@ If.ua-volt2 { - } - } - -+If.teufel-cage-pro { -+ Condition { -+ Type String -+ Haystack "${CardComponents}" -+ Needle "USB2cc2:0033" -+ } -+ True.Define.ProfileName "Teufel/CAGE-PRO" -+} -+ - If.ssl2 { - Condition { - Type String -@@ -559,6 +568,7 @@ If.beacn-studio { - } - True.Define.ProfileName "Beacn/Beacn-Studio" - } -+ - If.mixremap { - Condition { - Type String --- -2.49.0 - - -From 63f161cb8d65ed828a1ce49b506f4e1b9a7c58e4 Mon Sep 17 00:00:00 2001 -From: Zoran Zhan -Date: Wed, 7 May 2025 14:41:14 +0800 -Subject: [PATCH 24/24] ucm2: MediaTek: mt8365-evk: Add SOF support - -Add support for MT8365 EVK with SOF enabled. When SOF is -disabled, the "HiFi" use case is used; when SOF is enabled, -the "SOF" use case is used. - -The main difference compared to the UCM with SOF disabled is -the device number for playback and capture, which now uses the -PCMs for SOF instead. - -Define these parameters as variables for each case (with and -without SOF), and move the common initialization to init.conf, -so the UCM can be shared by both configurations. - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/583 -Signed-off-by: Zoran Zhan -Signed-off-by: Jaroslav Kysela ---- - ucm2/MediaTek/mt8365-evk/HiFi.conf | 126 ++++++------------ - ucm2/MediaTek/mt8365-evk/init.conf | 31 +++++ - ucm2/MediaTek/mt8365-evk/mt8365-evk.conf | 40 +----- - ucm2/MediaTek/mt8365-evk/sof/SOF.conf | 87 ++++++++++++ - .../mt8365-evk/sof/sof-mt8365-evk.conf | 9 ++ - .../conf.d/sof-mt8365-evk/sof-mt8365-evk.conf | 1 + - 6 files changed, 174 insertions(+), 120 deletions(-) - create mode 100644 ucm2/MediaTek/mt8365-evk/init.conf - create mode 100644 ucm2/MediaTek/mt8365-evk/sof/SOF.conf - create mode 100644 ucm2/MediaTek/mt8365-evk/sof/sof-mt8365-evk.conf - create mode 120000 ucm2/conf.d/sof-mt8365-evk/sof-mt8365-evk.conf - -diff --git a/ucm2/MediaTek/mt8365-evk/HiFi.conf b/ucm2/MediaTek/mt8365-evk/HiFi.conf -index 81f563f..83514c7 100644 ---- a/ucm2/MediaTek/mt8365-evk/HiFi.conf -+++ b/ucm2/MediaTek/mt8365-evk/HiFi.conf -@@ -1,141 +1,97 @@ - SectionDevice."HDMI" { -- Comment "Hdmi output" -+ Comment "HDMI output" - - Value { -- PlaybackPriority 250 -+ PlaybackPriority 100 - PlaybackChannels 2 - PlaybackPCM "hw:${CardId},1" - } -- -- EnableSequence [ -- cset "name='O00 I07 Switch' on" -- cset "name='O01 I08 Switch' on" -- ] -- -- DisableSequence [ -- cset "name='O00 I07 Switch' off" -- cset "name='O01 I08 Switch' off" -- ] - } - - SectionDevice."Speaker" { -- Comment "Line-out Jack " -+ Comment "Lineout speaker" - - ConflictingDevice [ - "Headphones" - ] - -- Value { -- PlaybackPriority 300 -- PlaybackChannels 2 -- PlaybackPCM "hw:${CardId},0" -- PlaybackVolume "name='Lineout_PGAL_GAIN'" -- } -- - EnableSequence [ -- cset "name='Audio_Amp_L_Switch' Off" -- cset "name='Audio_Amp_R_Switch' Off" -- cset "name='Lineout_PGAL_GAIN' 0" -- cset "name='Speaker_Amp_Switch' On" -+ cset "name='Headphone Left Source' Open" -+ cset "name='Headphone Right Source' Open" -+ cset "name='Line Out Source' Playback" - ] - -- DisableSequence [ -- cset "name='Audio_Amp_L_Switch' On" -- cset "name='Audio_Amp_R_Switch' On" -- cset "name='Speaker_Amp_Switch' Off" -- ] -+ Value { -+ PlaybackPriority 200 -+ PlaybackChannels 2 -+ PlaybackPCM "hw:${CardId},${var:PlayDevN}" -+ } - } - - SectionDevice."Headphones" { -- Comment "Headset speakers" -+ Comment "Earphone speaker" - - ConflictingDevice [ - "Speaker" - ] - -+ EnableSequence [ -+ cset "name='Headphone Left Source' DAC" -+ cset "name='Headphone Right Source' DAC" -+ cset "name='Line Out Source' Open" -+ ] -+ - Value { - PlaybackPriority 300 - PlaybackChannels 2 -- PlaybackPCM "hw:${CardId},0" -- PlaybackVolume "name='Headset_PGAL_GAIN'" -+ PlaybackPCM "hw:${CardId},${var:PlayDevN}" - } -- -- EnableSequence [ -- cset "name='Audio_Amp_L_Switch' On" -- cset "name='Audio_Amp_R_Switch' On" -- cset "name='Headset_PGAL_GAIN' 1" -- cset "name='Speaker_Amp_Switch' Off" -- ] -- -- DisableSequence [ -- cset "name='Audio_Amp_L_Switch' Off" -- cset "name='Audio_Amp_R_Switch' Off" -- cset "name='Speaker_Amp_Switch' On" -- ] - } - --SectionDevice."Mic1" { -- Comment "Amic" -+SectionDevice."Headset" { -+ Comment "Earphone microphone" - - ConflictingDevice [ -- "Mic2" -+ "Mic1" - ] - -- Value { -- CapturePriority 300 -- CaptureChannels 1 -- CapturePCM "hw:${CardId},2" -- } -- - EnableSequence [ -- cset "name='Audio_MicSource1_Setting' ADC1" -- cset "name='Audio_MICBIAS0_Switch' Off" -+ cset "name='PGA L Mux' AIN1" -+ cset "name='PGA R Mux' AIN1" - ] - -- DisableSequence [ -- cset "name='Audio_MicSource1_Setting' ADC2" -- cset "name='Audio_MICBIAS0_Switch' On" -- ] -+ Value { -+ CapturePriority 300 -+ CaptureChannels "${var:CapChanN}" -+ CapturePCM "hw:${CardId},${var:CapDevN}" -+ } - } - --SectionDevice."Mic2" { -- Comment "Headset microphone" -+SectionDevice."Mic1" { -+ Comment "Analog microphone" - - ConflictingDevice [ -- "Mic1" -+ "Headset" - ] - -- Value { -- CapturePriority 350 -- CaptureChannels 1 -- CapturePCM "hw:${CardId},2" -- } -- - EnableSequence [ -- cset "name='Audio_MicSource1_Setting' ADC2" -- cset "name='Audio_MICBIAS0_Switch' On" -+ cset "name='PGA L Mux' AIN0" -+ cset "name='PGA R Mux' AIN0" - ] - -- DisableSequence [ -- cset "name='Audio_MicSource1_Setting' ADC1" -- cset "name='Audio_MICBIAS0_Switch' Off" -- ] -+ Value { -+ CapturePriority 200 -+ CaptureChannels "${var:CapChanN}" -+ CapturePCM "hw:${CardId},${var:CapDevN}" -+ } - } - --SectionDevice."Mic3" { -- Comment "PDM microphones" -+SectionDevice."Mic2" { -+ Comment "Digital microphone" - - Value { - CapturePriority 100 - CaptureChannels 2 - CapturePCM "hw:${CardId},3" - } -- -- EnableSequence [ -- cset "name='Audio_MICBIAS0_Switch' On" -- ] -- -- DisableSequence [ -- cset "name='Audio_MICBIAS0_Switch' Off" -- ] - } -diff --git a/ucm2/MediaTek/mt8365-evk/init.conf b/ucm2/MediaTek/mt8365-evk/init.conf -new file mode 100644 -index 0000000..269530a ---- /dev/null -+++ b/ucm2/MediaTek/mt8365-evk/init.conf -@@ -0,0 +1,31 @@ -+Syntax 4 -+ -+SectionUseCase."HiFi" { -+ File "/MediaTek/mt8365-evk/HiFi.conf" -+ Comment "Default" -+} -+ -+SectionUseCase."SOF" { -+ File "/MediaTek/mt8365-evk/sof/SOF.conf" -+ Comment "Enable SOF" -+} -+ -+BootSequence [ -+ cset "name='Headphone Left Source' DAC" -+ cset "name='Headphone Right Source' DAC" -+ cset "name='Line Out Source' Open" -+ cset "name='PGA L Mux' AIN1" -+ cset "name='PGA R Mux' AIN1" -+ cset "name='Mic Type Mux' DCC" -+ cset "name='INT ADDA O03_O04 Switch' on" -+ cset "name='Headphone Volume' 10" -+ cset "name='Lineout Volume' 10" -+ cset "name='O00 I07 Switch' on" -+ cset "name='O01 I08 Switch' on" -+ cset "name='O03 I05 Switch' on" -+ cset "name='O04 I06 Switch' on" -+ cset "name='O05 I03 Switch' on" -+ cset "name='O06 I04 Switch' on" -+ cset "name='O09 I14 Switch' on" -+ cset "name='O10 I15 Switch' on" -+] -diff --git a/ucm2/MediaTek/mt8365-evk/mt8365-evk.conf b/ucm2/MediaTek/mt8365-evk/mt8365-evk.conf -index e396f8c..9df5644 100644 ---- a/ucm2/MediaTek/mt8365-evk/mt8365-evk.conf -+++ b/ucm2/MediaTek/mt8365-evk/mt8365-evk.conf -@@ -1,39 +1,9 @@ - Syntax 4 - --SectionUseCase."HiFi" { -- File "/MediaTek/mt8365-evk/HiFi.conf" -- Comment "Play high quality music" -+Define { -+ PlayDevN "0" -+ CapDevN "2" -+ CapChanN "1" - } - --BootSequence [ -- #Audio volume -- cset "name='Headset_PGAL_GAIN' 0" -- cset "name='Lineout_PGAL_GAIN' 0" -- -- #Audio amp -- cset "name='Audio_Amp_R_Switch' On" -- cset "name='Audio_Amp_L_Switch' On" -- -- #Headset out -- cset "name='Speaker_Amp_Switch' Off" -- -- #Dmic -- cset "name='Audio_MICBIAS0_Switch' On" -- -- #HDMI audio (I2S3 Out) -- cset "name='O00 I07 Switch' on" -- cset "name='O01 I08 Switch' on" -- -- #jack_mic Headset In -- cset "name='Audio_MicSource1_Setting' ADC2" -- -- cset "name='O03 I05 Switch' on" -- cset "name='O04 I06 Switch' on" -- cset "name='O05 I03 Switch' on" -- cset "name='O06 I04 Switch' on" -- cset "name='O09 I14 Switch' on" -- cset "name='O10 I15 Switch' on" -- cset "name='AUD_CLK_BUF_Switch' On" -- cset "name='Audio_ADC_1_Switch' On" -- cset "name='INT ADDA O03_O04 Switch' on" --] -+Include.init.File "/MediaTek/mt8365-evk/init.conf" -diff --git a/ucm2/MediaTek/mt8365-evk/sof/SOF.conf b/ucm2/MediaTek/mt8365-evk/sof/SOF.conf -new file mode 100644 -index 0000000..af44feb ---- /dev/null -+++ b/ucm2/MediaTek/mt8365-evk/sof/SOF.conf -@@ -0,0 +1,87 @@ -+SectionDevice."Speaker" { -+ Comment "SOF Lineout speaker" -+ -+ ConflictingDevice [ -+ "Headphones" -+ ] -+ -+ EnableSequence [ -+ cset "name='Headphone Left Source' Open" -+ cset "name='Headphone Right Source' Open" -+ cset "name='Line Out Source' Playback" -+ ] -+ -+ Value { -+ PlaybackPriority 100 -+ PlaybackChannels 2 -+ PlaybackPCM "hw:${CardId},${var:PlayDevN}" -+ } -+} -+ -+SectionDevice."Headphones" { -+ Comment "SOF Earphone speaker" -+ -+ ConflictingDevice [ -+ "Speaker" -+ ] -+ -+ EnableSequence [ -+ cset "name='Headphone Left Source' DAC" -+ cset "name='Headphone Right Source' DAC" -+ cset "name='Line Out Source' Open" -+ ] -+ -+ Value { -+ PlaybackPriority 200 -+ PlaybackChannels 2 -+ PlaybackPCM "hw:${CardId},${var:PlayDevN}" -+ } -+} -+ -+SectionDevice."Headset" { -+ Comment "SOF Earphone microphone" -+ -+ ConflictingDevice [ -+ "Mic1" -+ ] -+ -+ EnableSequence [ -+ cset "name='PGA L Mux' AIN1" -+ cset "name='PGA R Mux' AIN1" -+ ] -+ -+ Value { -+ CapturePriority 300 -+ CaptureChannels "${var:CapChanN}" -+ CapturePCM "hw:${CardId},${var:CapDevN}" -+ } -+} -+ -+SectionDevice."Mic1" { -+ Comment "SOF Analog microphone" -+ -+ ConflictingDevice [ -+ "Headset" -+ ] -+ -+ EnableSequence [ -+ cset "name='PGA L Mux' AIN0" -+ cset "name='PGA R Mux' AIN0" -+ ] -+ -+ Value { -+ CapturePriority 200 -+ CaptureChannels "${var:CapChanN}" -+ CapturePCM "hw:${CardId},${var:CapDevN}" -+ } -+} -+ -+SectionDevice."Mic2" { -+ Comment "SOF Digital microphone" -+ -+ Value { -+ CapturePriority 100 -+ CaptureChannels 2 -+ CapturePCM "hw:${CardId},19" -+ } -+} -diff --git a/ucm2/MediaTek/mt8365-evk/sof/sof-mt8365-evk.conf b/ucm2/MediaTek/mt8365-evk/sof/sof-mt8365-evk.conf -new file mode 100644 -index 0000000..6369aac ---- /dev/null -+++ b/ucm2/MediaTek/mt8365-evk/sof/sof-mt8365-evk.conf -@@ -0,0 +1,9 @@ -+Syntax 4 -+ -+Define { -+ PlayDevN "16" -+ CapDevN "18" -+ CapChanN "2" -+} -+ -+Include.init.File "/MediaTek/mt8365-evk/init.conf" -diff --git a/ucm2/conf.d/sof-mt8365-evk/sof-mt8365-evk.conf b/ucm2/conf.d/sof-mt8365-evk/sof-mt8365-evk.conf -new file mode 120000 -index 0000000..527f25f ---- /dev/null -+++ b/ucm2/conf.d/sof-mt8365-evk/sof-mt8365-evk.conf -@@ -0,0 +1 @@ -+../../MediaTek/mt8365-evk/sof/sof-mt8365-evk.conf -\ No newline at end of file --- -2.49.0 - From 0ed21ea73d17f2faa5dbd870fa5f7ae60abe3fa3 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Sun, 7 Dec 2025 22:38:53 +0100 Subject: [PATCH 61/68] update sources for 1.2.15 Signed-off-by: Jaroslav Kysela --- sources | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources b/sources index 99910eb..9ce5bdb 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.14.tar.bz2) = 2716cc3a2299da4a1a170d734af082d78dc452b253179d0f1a9ec190140734aecf002b6924eec4ff2699ce88ce1ae5c56821c267f36384910984db726d1f9626 -SHA512 (alsa-ucm-conf-1.2.14.tar.bz2) = a224e890919306bdcd606dfb873b089950c9fa89f24c02947692ee8ab1a05c419f2a8dc174440d17c8a9575cab293806630f2cb43d74677f7ef0d956b7883dc5 +SHA512 (alsa-lib-1.2.15.tar.bz2) = 6cea9059265ef353a07f1b442004506f0f13883692ea35f03090282ca80db88055f470d2dca5bb54394fef0012711f0e9502d2d0f7fb66b27aa334bffb811559 +SHA512 (alsa-ucm-conf-1.2.15.tar.bz2) = 61dcbfe32ad912b793bf70d6f9e0e462353431b9589623ce8a7ec18b5dba48c230f5ba509e47384764625ae82f132babfbf62a8e5f4bb951377476ba147939e2 SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 From 91324e7b927e4a5d27e8060eb28ff3056b0904a5 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 9 Dec 2025 18:16:30 +0100 Subject: [PATCH 62/68] apply upstream 1.2.15 fixes #1 Signed-off-by: Jaroslav Kysela --- alsa-git.patch | 150 +++++++++++++++++++++++++ alsa-lib.spec | 10 +- alsa-ucm-conf.patch | 264 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 419 insertions(+), 5 deletions(-) create mode 100644 alsa-git.patch create mode 100644 alsa-ucm-conf.patch diff --git a/alsa-git.patch b/alsa-git.patch new file mode 100644 index 0000000..486803f --- /dev/null +++ b/alsa-git.patch @@ -0,0 +1,150 @@ +From a068cf08ad67447893b707cddfce31c9cafee643 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert +Date: Mon, 8 Dec 2025 23:46:17 -0500 +Subject: [PATCH 1/3] 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. + +Also check for the function properly instead of assuming it is available +with _GNU_SOURCE defined. + +Closes: https://github.com/alsa-project/alsa-lib/pull/486 +Fixes: https://github.com/alsa-project/alsa-lib/issues/485 +Signed-off-by: Mike Gilbert +Signed-off-by: Jaroslav Kysela +--- + configure.ac | 1 + + src/ucm/ucm_exec.c | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 8f4bd0de..f4862f64 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -52,6 +52,7 @@ dnl Checks for library functions. + AC_PROG_GCC_TRADITIONAL + AC_CHECK_FUNCS([uselocale]) + AC_CHECK_FUNCS([eaccess]) ++AC_CHECK_DECLS([closefrom]) + + dnl Enable largefile support + AC_SYS_LARGEFILE +diff --git a/src/ucm/ucm_exec.c b/src/ucm/ucm_exec.c +index b5a22023..713039b4 100644 +--- a/src/ucm/ucm_exec.c ++++ b/src/ucm/ucm_exec.c +@@ -259,8 +259,8 @@ int uc_mgr_exec(const char *prog) + + close(f); + +-#if defined(_GNU_SOURCE) +- close_range(3, maxfd, 0); ++#if HAVE_DECL_CLOSEFROM ++ closefrom(3); + #else + for (f = 3; f < maxfd; f++) + close(f); +-- +2.51.1 + + +From 813ffe34ff6c720dcc56e4549338bf9e9184af1f Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 9 Dec 2025 17:48:34 +0100 +Subject: [PATCH 2/3] ucm: exec - fix maxfd used warning + +Fixes: a068cf08 ("ucm: use closefrom instead of close_range") +Signed-off-by: Jaroslav Kysela +--- + src/ucm/ucm_exec.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/src/ucm/ucm_exec.c b/src/ucm/ucm_exec.c +index 713039b4..c16a4cfd 100644 +--- a/src/ucm/ucm_exec.c ++++ b/src/ucm/ucm_exec.c +@@ -183,7 +183,7 @@ static int parse_args(char ***argv, int argc, const char *cmd) + */ + int uc_mgr_exec(const char *prog) + { +- pid_t p, f, maxfd; ++ pid_t p, f; + int err = 0, status; + char bin[PATH_MAX]; + struct sigaction sa; +@@ -212,8 +212,6 @@ int uc_mgr_exec(const char *prog) + prog = bin; + } + +- maxfd = sysconf(_SC_OPEN_MAX); +- + /* + * block SIGCHLD signal + * ignore SIGINT and SIGQUIT in parent +@@ -262,8 +260,11 @@ int uc_mgr_exec(const char *prog) + #if HAVE_DECL_CLOSEFROM + closefrom(3); + #else +- for (f = 3; f < maxfd; f++) +- close(f); ++ { ++ pid_t maxfd = sysconf(_SC_OPEN_MAX); ++ for (f = 3; f < maxfd; f++) ++ close(f); ++ } + #endif + + /* install default handlers for the forked process */ +-- +2.51.1 + + +From a6238053c4fa518b214f99d91a01b96c5ef6e3ca Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 9 Dec 2025 18:04:07 +0100 +Subject: [PATCH 3/3] conf: merge card specific contents per file (whole) after + parsing + +Unfortunately, mentioned fix caused a regression for items stored in one file. +Merge the file contents after parsing not inside parsing process. + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2420645 +Fixes: eda76146 ("conf: fix load_for_all_cards() - do not merge the card specific contents") +Signed-off-by: Jaroslav Kysela +--- + src/conf.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/src/conf.c b/src/conf.c +index 49499ecd..b1ec9b38 100644 +--- a/src/conf.c ++++ b/src/conf.c +@@ -4119,14 +4119,21 @@ static int config_filename_filter(const struct dirent64 *dirent) + static int config_file_open(snd_config_t *root, const char *filename, int merge) + { + snd_input_t *in; ++ snd_config_t *top; + int err; + + err = snd_input_stdio_open(&in, filename, "r"); + if (err >= 0) { +- if (merge) ++ if (merge) { + err = snd_config_load(root, in); +- else +- err = snd_config_load_override(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); ++ } ++ } + snd_input_close(in); + if (err < 0) + snd_error(CORE, "%s may be old or corrupted: consider to remove or fix it", filename); +-- +2.51.1 + diff --git a/alsa-lib.spec b/alsa-lib.spec index 7c2e8fa..d91c95d 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?prever_dot}%{?dist} License: LGPL-2.1-or-later URL: http://www.alsa-project.org/ @@ -19,8 +19,8 @@ Source2: ftp://ftp.alsa-project.org/pub/lib/alsa-topology-conf-%{version_alsa_t Source10: asound.conf Source11: modprobe-dist-alsa.conf Source12: modprobe-dist-oss.conf -#Source40: alsa-ucm-conf.patch -#Patch0: alsa-git.patch +Source40: alsa-ucm-conf.patch +Patch0: alsa-git.patch Patch1: alsa-lib-1.2.3.1-config.patch Patch2: alsa-lib-1.2.10-glibc-open.patch @@ -70,7 +70,7 @@ contains alsa-lib configuration of SoC topology %prep %setup -q -n %{name}-%{version}%{?prever}%{?postver} -#patch -P0 -p1 -b .alsa-git +%patch -P0 -p1 -b .alsa-git %patch -P1 -p1 -b .config %patch -P2 -p1 -b .glibc-open @@ -116,7 +116,7 @@ mkdir -p %{buildroot}/%{_datadir}/alsa/ucm2 # Unpack UCMs tar xvjf %{SOURCE1} -C %{buildroot}/%{_datadir}/alsa --strip-components=1 "*/ucm" "*/ucm2" -#patch -d %{buildroot}/%{_datadir}/alsa -p1 < %{SOURCE40} +patch -d %{buildroot}/%{_datadir}/alsa -p1 < %{SOURCE40} # Create topology directory mkdir -p %{buildroot}/%{_datadir}/alsa/topology diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch new file mode 100644 index 0000000..0447c61 --- /dev/null +++ b/alsa-ucm-conf.patch @@ -0,0 +1,264 @@ +From d57d800c6a5a77e6c475719b0297bebb098f7533 Mon Sep 17 00:00:00 2001 +From: Maciej Strozek +Date: Tue, 9 Dec 2025 13:00:44 +0000 +Subject: [PATCH 1/3] sof-soundwire: third fix for multi-codec + +Ensure MultiCodec-based actions are only done when MultiCodec1 is not empty + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/658 +Signed-off-by: Maciej Strozek +Signed-off-by: Jaroslav Kysela +--- + ucm2/sof-soundwire/sof-soundwire.conf | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/ucm2/sof-soundwire/sof-soundwire.conf b/ucm2/sof-soundwire/sof-soundwire.conf +index 7f9c7dc..895f479 100644 +--- a/ucm2/sof-soundwire/sof-soundwire.conf ++++ b/ucm2/sof-soundwire/sof-soundwire.conf +@@ -72,8 +72,9 @@ If.multi_init { + If.multi_speaker { + Condition { + Type RegexMatch +- Regex "(${var:MultiCodec1}(-sdca)?)" +- String "${var:SpeakerCodec1}" ++ # guard with "=" to avoid empty string matching ++ Regex "=(${var:MultiCodec1}(-sdca)?)=" ++ String "=${var:SpeakerCodec1}=" + } + True { + Define.SpeakerCodec1 "" +@@ -83,8 +84,9 @@ If.multi_speaker { + If.multi_mic { + Condition { + Type RegexMatch +- Regex "(${var:MultiCodec1}(-sdca)?)" +- String "${var:MicCodec1}" ++ # guard with "=" to avoid empty string matching ++ Regex "=(${var:MultiCodec1}(-sdca)?)=" ++ String "=${var:MicCodec1}=" + } + True { + Define.MicCodec1 "" +@@ -94,8 +96,9 @@ If.multi_mic { + If.multi_headset { + Condition { + Type RegexMatch +- Regex "(${var:MultiCodec1}(-sdca)?)" +- String "${var:HeadsetCodec1}" ++ # guard with "=" to avoid empty string matching ++ Regex "=(${var:MultiCodec1}(-sdca)?)=" ++ String "=${var:HeadsetCodec1}=" + } + True { + Define.HeadsetCodec1 "" +-- +2.51.1 + + +From 51bada5f0c1b634b5db92de428f33c0188e68e82 Mon Sep 17 00:00:00 2001 +From: Maciej Strozek +Date: Fri, 28 Nov 2025 16:08:23 +0000 +Subject: [PATCH 2/3] ucm2: sof-soundwire: Simplify cs42l45 configs + +Simplify cs42l45 configs following machine driver changes [1] +which bring normal switches instead of mute switches. + +[1] https://lore.kernel.org/all/20251127163426.2500633-2-ckeepax@opensource.cirrus.com/ + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/655 +Signed-off-by: Maciej Strozek +Signed-off-by: Jaroslav Kysela +--- + ucm2/codecs/cs42l45-dmic/init.conf | 17 +++++++++++++++-- + ucm2/codecs/cs42l45/init.conf | 24 ++++++++++++++++++++++++ + ucm2/sof-soundwire/cs42l45-dmic.conf | 8 ++------ + ucm2/sof-soundwire/cs42l45.conf | 18 +++--------------- + ucm2/sof-soundwire/sof-soundwire.conf | 2 +- + 5 files changed, 45 insertions(+), 24 deletions(-) + create mode 100644 ucm2/codecs/cs42l45/init.conf + +diff --git a/ucm2/codecs/cs42l45-dmic/init.conf b/ucm2/codecs/cs42l45-dmic/init.conf +index 6dd19bb..deefb3d 100644 +--- a/ucm2/codecs/cs42l45-dmic/init.conf ++++ b/ucm2/codecs/cs42l45-dmic/init.conf +@@ -1,9 +1,22 @@ + # cs42l45 specific control settings + ++LibraryConfig.remap.Config { ++ ctl.default.map { ++ "name='cs42l45 Microphone Capture Switch'" { ++ "name='cs42l45 FU 113 Channel Switch'".vindex.0 0 ++ "name='cs42l45 FU 113 Channel Switch'".vindex.1 1 ++ } ++ "name='cs42l45 Microphone Capture Volume'" { ++ "name='cs42l45 FU 113 Channel Volume'".vindex.0 0 ++ "name='cs42l45 FU 113 Channel Volume'".vindex.1 1 ++ } ++ } ++} ++ + BootSequence [ +- cset "name='cs42l45 FU 113 Mute Switch' 0" ++ cset "name='cs42l45 FU 113 Channel Switch' 0" + ] + + Macro [ +- { SetLED { LED="mic" Action="attach" CtlId="cs42l45 FU 113 Mute Switch" Mode="follow-route"} } ++ { SetLED { LED="mic" Action="attach" CtlId="cs42l45 FU 113 Channel Switch"} } + ] +diff --git a/ucm2/codecs/cs42l45/init.conf b/ucm2/codecs/cs42l45/init.conf +new file mode 100644 +index 0000000..f4aee4a +--- /dev/null ++++ b/ucm2/codecs/cs42l45/init.conf +@@ -0,0 +1,24 @@ ++# cs42l45 specific control settings ++ ++LibraryConfig.remap.Config { ++ ctl.default.map { ++ "name='cs42l45 Jack Microphone Capture Switch'" { ++ "name='cs42l45 FU 36 Channel Switch'".vindex.0 0 ++ "name='cs42l45 FU 36 Channel Switch'".vindex.1 1 ++ } ++ "name='cs42l45 Jack Microphone Capture Volume'" { ++ "name='cs42l45 FU 36 Channel Volume'".vindex.0 0 ++ "name='cs42l45 FU 36 Channel Volume'".vindex.1 1 ++ } ++ } ++ ctl.default.map { ++ "name='cs42l45 Headphone Playback Switch'" { ++ "name='cs42l45 FU 41 Channel Switch'".vindex.0 0 ++ "name='cs42l45 FU 41 Channel Switch'".vindex.1 1 ++ } ++ "name='cs42l45 Headphone Playback Volume'" { ++ "name='cs42l45 FU 41 Channel Volume'".vindex.0 0 ++ "name='cs42l45 FU 41 Channel Volume'".vindex.1 1 ++ } ++ } ++} +\ No newline at end of file +diff --git a/ucm2/sof-soundwire/cs42l45-dmic.conf b/ucm2/sof-soundwire/cs42l45-dmic.conf +index 9477cba..d46808e 100644 +--- a/ucm2/sof-soundwire/cs42l45-dmic.conf ++++ b/ucm2/sof-soundwire/cs42l45-dmic.conf +@@ -7,18 +7,14 @@ SectionDevice."Mic" { + "Headset" + ] + +- EnableSequence [ +- cset "name='cs42l45 FU 113 Mute Switch' 0" +- ] +- + DisableSequence [ +- cset "name='cs42l45 FU 113 Mute Switch' 1" ++ cset "name='cs42l45 FU 113 Channel Switch' 0" + ] + + Value { + CapturePriority 100 + CapturePCM "hw:${CardId},4" + CaptureMixer "default:${CardId}" +- CaptureVolume "cs42l45 FU 113 Channel Volume" ++ CaptureMixerElem "cs42l45 Microphone" + } + } +diff --git a/ucm2/sof-soundwire/cs42l45.conf b/ucm2/sof-soundwire/cs42l45.conf +index ba61048..c88562a 100644 +--- a/ucm2/sof-soundwire/cs42l45.conf ++++ b/ucm2/sof-soundwire/cs42l45.conf +@@ -3,19 +3,11 @@ + SectionDevice."Headphones" { + Comment "Headphones" + +- EnableSequence [ +- cset "name='cs42l45 FU 41 Mute Switch' 0" +- ] +- +- DisableSequence [ +- cset "name='cs42l45 FU 41 Mute Switch' 1" +- ] +- + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId},0" + PlaybackMixer "default:${CardId}" +- PlaybackVolume "cs42l45 FU 41 Channel Volume" ++ PlaybackMixerElem "cs42l45 Headphone" + JackControl "cs42l45 OT 43 Headphone Jack" + } + } +@@ -23,19 +15,15 @@ SectionDevice."Headphones" { + SectionDevice."Headset" { + Comment "Jack Microphone" + +- EnableSequence [ +- cset "name='cs42l45 FU 36 Mute Switch' 0" +- ] +- + DisableSequence [ +- cset "name='cs42l45 FU 36 Mute Switch' 1" ++ cset "name='cs42l45 FU 36 Channel Switch' 0" + ] + + Value { + CapturePriority 200 + CapturePCM "hw:${CardId},1" + CaptureMixer "default:${CardId}" +- CaptureVolume "cs42l45 FU 36 Channel Volume" ++ CaptureMixerElem "cs42l45 Jack Microphone" + JackControl "cs42l45 IT 31 Microphone Jack" + } + } +diff --git a/ucm2/sof-soundwire/sof-soundwire.conf b/ucm2/sof-soundwire/sof-soundwire.conf +index 895f479..7a00209 100644 +--- a/ucm2/sof-soundwire/sof-soundwire.conf ++++ b/ucm2/sof-soundwire/sof-soundwire.conf +@@ -117,7 +117,7 @@ If.spk_init { + If.hs_init { + Condition { + Type RegexMatch +- Regex "(cs42l43|rt5682|rt700|rt711|rt713(-sdca)?)" ++ Regex "(cs42l43|cs42l45|rt5682|rt700|rt711|rt713(-sdca)?)" + String "${var:HeadsetCodec1}" + } + True.Include.hs_init.File "/codecs/${var:HeadsetCodec1}/init.conf" +-- +2.51.1 + + +From 5d0d2bd660b4378f802c94be3eadd8375c4c7a3a Mon Sep 17 00:00:00 2001 +From: Shuming Fan +Date: Tue, 9 Dec 2025 15:40:49 +0800 +Subject: [PATCH 3/3] ucm2: codecs: rt722: add condition to SetLED for mic + +Some SKUs don't have the internal mic, so the patch adds the condition to check +whether the SKU has the internal mic or not. + +Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/657 +Signed-off-by: Shuming Fan +Signed-off-by: Jaroslav Kysela +--- + ucm2/codecs/rt722/init.conf | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/ucm2/codecs/rt722/init.conf b/ucm2/codecs/rt722/init.conf +index c820e55..40f2458 100644 +--- a/ucm2/codecs/rt722/init.conf ++++ b/ucm2/codecs/rt722/init.conf +@@ -10,4 +10,11 @@ BootSequence [ + cset "name='rt722 FU0F Capture Volume' 63" + ] + +-Macro [{ SetLED { LED="mic" Action="attach" CtlId="rt722 FU1E Capture Switch" } }] ++If.mic_init_rt722 { ++ Condition { ++ Type String ++ Needle "rt722" ++ Haystack "${var:MicCodec1}" ++ } ++ True.Macro [{ SetLED { LED="mic" Action="attach" CtlId="rt722 FU1E Capture Switch" } }] ++} +-- +2.51.1 + From 0c2415ae0bff58ebcd85fac9993c5d7be7f60a30 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 10 Dec 2025 12:17:42 +0100 Subject: [PATCH 63/68] apply upstream 1.2.15 fixes #2 Signed-off-by: Jaroslav Kysela --- alsa-git.patch | 518 ++++++++++++++++++++++++++++++++++++++++++++++++- alsa-lib.spec | 4 +- 2 files changed, 517 insertions(+), 5 deletions(-) diff --git a/alsa-git.patch b/alsa-git.patch index 486803f..f0124a0 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -1,7 +1,7 @@ From a068cf08ad67447893b707cddfce31c9cafee643 Mon Sep 17 00:00:00 2001 From: Mike Gilbert 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 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 @@ -103,7 +103,7 @@ index 713039b4..c16a4cfd 100644 From a6238053c4fa518b214f99d91a01b96c5ef6e3ca Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela 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 +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 +--- + 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 +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 +--- + 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 +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 +--- + 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 { + + + +-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 { + + + +-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 { + + + +-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 { + + + +-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 { + + + +-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 +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 +--- + 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 @@ + + + +-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 + + + +-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 { + + + +-HDA-Intel.pcm.modem.0 { ++HDA-Intel.pcm.modem.!0 { + @args [ CARD ] + @args.CARD { + type string +-- +2.51.1 + diff --git a/alsa-lib.spec b/alsa-lib.spec index d91c95d..e11c07f 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -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 - 1.2.15-1 +* Sun Dec 10 2025 Jaroslav Kysela - 1.2.15-3 - update to 1.2.15 * Wed Jul 23 2025 Fedora Release Engineering - 1.2.14-4 From 3a48b2356c7243239d307f25c91e42d711cff471 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 10 Dec 2025 16:41:01 +0100 Subject: [PATCH 64/68] apply upstream 1.2.15 fixes #3 Signed-off-by: Jaroslav Kysela --- alsa-git.patch | 4346 +++++++++++++++++++++++++++++++++++++++++++++++- alsa-lib.spec | 4 +- 2 files changed, 4337 insertions(+), 13 deletions(-) diff --git a/alsa-git.patch b/alsa-git.patch index f0124a0..b0fcde8 100644 --- a/alsa-git.patch +++ b/alsa-git.patch @@ -1,7 +1,7 @@ From a068cf08ad67447893b707cddfce31c9cafee643 Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Mon, 8 Dec 2025 23:46:17 -0500 -Subject: [PATCH 1/7] ucm: use closefrom instead of close_range +Subject: [PATCH 01/43] 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 Date: Tue, 9 Dec 2025 17:48:34 +0100 -Subject: [PATCH 2/7] ucm: exec - fix maxfd used warning +Subject: [PATCH 02/43] ucm: exec - fix maxfd used warning Fixes: a068cf08 ("ucm: use closefrom instead of close_range") Signed-off-by: Jaroslav Kysela @@ -103,8 +103,8 @@ index 713039b4..c16a4cfd 100644 From a6238053c4fa518b214f99d91a01b96c5ef6e3ca Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 9 Dec 2025 18:04:07 +0100 -Subject: [PATCH 3/7] conf: merge card specific contents per file (whole) after - parsing +Subject: [PATCH 03/43] conf: merge card specific contents per file (whole) + after parsing Unfortunately, mentioned fix caused a regression for items stored in one file. Merge the file contents after parsing not inside parsing process. @@ -152,7 +152,7 @@ index 49499ecd..b1ec9b38 100644 From 2f59398c83b8065fb9ff58939df3a9187746068e Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 9 Dec 2025 18:39:52 +0100 -Subject: [PATCH 4/7] conf: fix possible memory leak in config_file_open() - +Subject: [PATCH 04/43] conf: fix possible memory leak in config_file_open() - error path Fixes: a6238053 ("conf: merge card specific contents per file (whole) after parsing") @@ -185,8 +185,8 @@ index b1ec9b38..d90f6dc3 100644 From 2ef8952b46a46b97a6df2f29bcd182f895ebf9e4 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela 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" +Subject: [PATCH 05/43] Revert "conf: fix load_for_all_cards() - do not merge + the card specific contents" This reverts commit eda76146c5653ff1d5bc4b4c53f7a2d5ccc17da2. @@ -342,8 +342,8 @@ index d90f6dc3..fb9f0658 100644 From 16ab43db6ed6f71424d5ad78e62f85baaeae5051 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 10 Dec 2025 12:12:47 +0100 -Subject: [PATCH 6/7] conf: USB-Audio: define pcm configuration block only one - time +Subject: [PATCH 06/43] 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. @@ -498,8 +498,8 @@ index 2f6d2ee0..1fc540e2 100644 From 010b699c92a9a6ffdca1874cd2e3c6c054d212e0 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 10 Dec 2025 12:12:47 +0100 -Subject: [PATCH 7/7] conf: HDA-Intel: define pcm configuration block only one - time +Subject: [PATCH 07/43] 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. @@ -660,3 +660,4327 @@ index 5451606f..76775b97 100644 -- 2.51.1 + +From d83af363f1fc17e2b3e7cf2a0f848722f6643a9a Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 12:12:47 +0100 +Subject: [PATCH 08/43] conf: vc4-hdmi: define pcm configuration block only one + time + +There may be multiple vc4-hdmi soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +BugLink: https://github.com/alsa-project/alsa-lib/issues/488 +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/vc4-hdmi.conf | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/conf/cards/vc4-hdmi.conf b/src/conf/cards/vc4-hdmi.conf +index 0f313d82..7041d185 100644 +--- a/src/conf/cards/vc4-hdmi.conf ++++ b/src/conf/cards/vc4-hdmi.conf +@@ -3,7 +3,7 @@ + # subframe conversion + # + +-vc4-hdmi.pcm.hdmi.0 { ++vc4-hdmi.pcm.hdmi.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +@@ -50,7 +50,7 @@ vc4-hdmi.pcm.hdmi.0 { + } + + # default with plug and softvol +-vc4-hdmi.pcm.default { ++vc4-hdmi.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +-- +2.51.1 + + +From 3969e458124f6933e2f440c2b0b39b29de791a78 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 12:12:47 +0100 +Subject: [PATCH 09/43] conf: AACI,ATIIXP: define pcm configuration block only + one time + +There may be multiple AACI,ATIIXP soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/AACI.conf | 4 ++-- + src/conf/cards/ATIIXP-MODEM.conf | 2 +- + src/conf/cards/ATIIXP-SPDMA.conf | 10 +++++----- + src/conf/cards/ATIIXP.conf | 10 +++++----- + 4 files changed, 13 insertions(+), 13 deletions(-) + +diff --git a/src/conf/cards/AACI.conf b/src/conf/cards/AACI.conf +index 748586a0..ff4778b4 100644 +--- a/src/conf/cards/AACI.conf ++++ b/src/conf/cards/AACI.conf +@@ -4,7 +4,7 @@ + + + +-AACI.pcm.front.0 { ++AACI.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -19,7 +19,7 @@ AACI.pcm.surround40.0 "cards.AACI.pcm.front.0" + + + +-AACI.pcm.surround51.0 { ++AACI.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +diff --git a/src/conf/cards/ATIIXP-MODEM.conf b/src/conf/cards/ATIIXP-MODEM.conf +index 6e52af05..1f69b735 100644 +--- a/src/conf/cards/ATIIXP-MODEM.conf ++++ b/src/conf/cards/ATIIXP-MODEM.conf +@@ -4,7 +4,7 @@ + + + +-ATIIXP-MODEM.pcm.modem.0 { ++ATIIXP-MODEM.pcm.modem.!0 { + @args [ CARD ] + @args.CARD { + type string +diff --git a/src/conf/cards/ATIIXP-SPDMA.conf b/src/conf/cards/ATIIXP-SPDMA.conf +index 42540d68..12c40efc 100644 +--- a/src/conf/cards/ATIIXP-SPDMA.conf ++++ b/src/conf/cards/ATIIXP-SPDMA.conf +@@ -4,7 +4,7 @@ + + + +-ATIIXP-SPDMA.pcm.front.0 { ++ATIIXP-SPDMA.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -14,7 +14,7 @@ ATIIXP-SPDMA.pcm.front.0 { + } + + # default with dmix/dsnoop +-ATIIXP.pcm.default { ++ATIIXP.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -38,7 +38,7 @@ ATIIXP.pcm.default { + + + +-ATIIXP-SPDMA.pcm.surround40.0 { ++ATIIXP-SPDMA.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -82,7 +82,7 @@ ATIIXP-SPDMA.pcm.surround40.0 { + + + +-ATIIXP-SPDMA.pcm.surround51.0 { ++ATIIXP-SPDMA.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -136,7 +136,7 @@ ATIIXP-SPDMA.pcm.surround51.0 { + + + +-ATIIXP-SPDMA.pcm.iec958.0 { ++ATIIXP-SPDMA.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +diff --git a/src/conf/cards/ATIIXP.conf b/src/conf/cards/ATIIXP.conf +index c4d33ef3..13e01c48 100644 +--- a/src/conf/cards/ATIIXP.conf ++++ b/src/conf/cards/ATIIXP.conf +@@ -4,7 +4,7 @@ + + + +-ATIIXP.pcm.front.0 { ++ATIIXP.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -14,7 +14,7 @@ ATIIXP.pcm.front.0 { + } + + # default with dmix/dsnoop +-ATIIXP.pcm.default { ++ATIIXP.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -38,7 +38,7 @@ ATIIXP.pcm.default { + + + +-ATIIXP.pcm.surround40.0 { ++ATIIXP.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -82,7 +82,7 @@ ATIIXP.pcm.surround40.0 { + + + +-ATIIXP.pcm.surround51.0 { ++ATIIXP.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -136,7 +136,7 @@ ATIIXP.pcm.surround51.0 { + + + +-ATIIXP.pcm.iec958.0 { ++ATIIXP.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From e5dbefdff1254fb66ffa82983c6fed08ba8e37df Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 12:12:47 +0100 +Subject: [PATCH 10/43] conf: Audigy: define pcm configuration block only one + time + +There may be multiple Audigy soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/Audigy.conf | 12 ++++++------ + src/conf/cards/Audigy2.conf | 16 ++++++++-------- + 2 files changed, 14 insertions(+), 14 deletions(-) + +diff --git a/src/conf/cards/Audigy.conf b/src/conf/cards/Audigy.conf +index 42692cfd..a353c624 100644 +--- a/src/conf/cards/Audigy.conf ++++ b/src/conf/cards/Audigy.conf +@@ -4,7 +4,7 @@ + + + +-Audigy.pcm.front.0 { ++Audigy.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -40,7 +40,7 @@ Audigy.pcm.front.0 { + + + +-Audigy.pcm.rear.0 { ++Audigy.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -68,7 +68,7 @@ Audigy.pcm.rear.0 { + + + +-Audigy.pcm.center_lfe.0 { ++Audigy.pcm.center_lfe.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -107,7 +107,7 @@ Audigy.pcm.center_lfe.0 { + + + +-Audigy.pcm.surround40.0 { ++Audigy.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -143,7 +143,7 @@ Audigy.pcm.surround40.0 { + + + +-Audigy.pcm.surround51.0 { ++Audigy.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -190,7 +190,7 @@ Audigy.pcm.surround51.0 { + + + +-Audigy.pcm.iec958.0 { ++Audigy.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +diff --git a/src/conf/cards/Audigy2.conf b/src/conf/cards/Audigy2.conf +index 35126d23..3c15fd1d 100644 +--- a/src/conf/cards/Audigy2.conf ++++ b/src/conf/cards/Audigy2.conf +@@ -4,7 +4,7 @@ + + + +-Audigy2.pcm.front.0 { ++Audigy2.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -41,7 +41,7 @@ Audigy2.pcm.front.0 { + + + +-Audigy2.pcm.rear.0 { ++Audigy2.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -69,7 +69,7 @@ Audigy2.pcm.rear.0 { + + + +-Audigy2.pcm.center_lfe.0 { ++Audigy2.pcm.center_lfe.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -105,7 +105,7 @@ Audigy2.pcm.center_lfe.0 { + + + +-Audigy2.pcm.side.0 { ++Audigy2.pcm.side.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -144,7 +144,7 @@ Audigy2.pcm.side.0 { + + + +-Audigy2.pcm.surround40.0 { ++Audigy2.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -180,7 +180,7 @@ Audigy2.pcm.surround40.0 { + + + +-Audigy2.pcm.surround51.0 { ++Audigy2.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -227,7 +227,7 @@ Audigy2.pcm.surround51.0 { + + + +-Audigy2.pcm.surround71.0 { ++Audigy2.pcm.surround71.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -285,7 +285,7 @@ Audigy2.pcm.surround71.0 { + + + +-Audigy2.pcm.iec958.0 { ++Audigy2.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From 7079887cd21077fe9569a0d910b11e40f7e5153d Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 12:12:47 +0100 +Subject: [PATCH 11/43] conf: Aureon: define pcm configuration block only one + time + +There may be multiple Aureon soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/Aureon51.conf | 14 +++++++------- + src/conf/cards/Aureon71.conf | 18 +++++++++--------- + 2 files changed, 16 insertions(+), 16 deletions(-) + +diff --git a/src/conf/cards/Aureon51.conf b/src/conf/cards/Aureon51.conf +index 07be4a77..9bf34661 100644 +--- a/src/conf/cards/Aureon51.conf ++++ b/src/conf/cards/Aureon51.conf +@@ -3,7 +3,7 @@ + # + + # default with dmix & dsnoop +-Aureon51.pcm.default { ++Aureon51.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -27,7 +27,7 @@ Aureon51.pcm.default { + + + +-Aureon51.pcm.front.0 { ++Aureon51.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -38,7 +38,7 @@ Aureon51.pcm.front.0 { + + + +-Aureon51.pcm.rear.0 { ++Aureon51.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -51,7 +51,7 @@ Aureon51.pcm.rear.0 { + + + +-Aureon51.pcm.center_lfe.0 { ++Aureon51.pcm.center_lfe.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -63,7 +63,7 @@ Aureon51.pcm.center_lfe.0 { + + + +-Aureon51.pcm.side.0 { ++Aureon51.pcm.side.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -91,7 +91,7 @@ Aureon51.pcm.surround40.0 { + + + +-Aureon51.pcm.surround51.0 { ++Aureon51.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -103,7 +103,7 @@ Aureon51.pcm.surround51.0 { + + + +-Aureon51.pcm.iec958.0 { ++Aureon51.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +diff --git a/src/conf/cards/Aureon71.conf b/src/conf/cards/Aureon71.conf +index a43ce2ce..f29bc297 100644 +--- a/src/conf/cards/Aureon71.conf ++++ b/src/conf/cards/Aureon71.conf +@@ -3,7 +3,7 @@ + # + + # default with dmix & dsnoop +-Aureon71.pcm.default { ++Aureon71.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -27,7 +27,7 @@ Aureon71.pcm.default { + + + +-Aureon71.pcm.front.0 { ++Aureon71.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -38,7 +38,7 @@ Aureon71.pcm.front.0 { + + + +-Aureon71.pcm.rear.0 { ++Aureon71.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -50,7 +50,7 @@ Aureon71.pcm.rear.0 { + + + +-Aureon71.pcm.center_lfe.0 { ++Aureon71.pcm.center_lfe.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -63,7 +63,7 @@ Aureon71.pcm.center_lfe.0 { + + + +-Aureon71.pcm.side.0 { ++Aureon71.pcm.side.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -76,7 +76,7 @@ Aureon71.pcm.side.0 { + + + +-Aureon71.pcm.surround40.0 { ++Aureon71.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -91,7 +91,7 @@ Aureon71.pcm.surround40.0 { + + + +-Aureon71.pcm.surround51.0 { ++Aureon71.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -103,7 +103,7 @@ Aureon71.pcm.surround51.0 { + + + +-Aureon71.pcm.surround71.0 { ++Aureon71.pcm.surround71.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -114,7 +114,7 @@ Aureon71.pcm.surround71.0 { + + + +-Aureon71.pcm.iec958.0 { ++Aureon71.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From ea984c3a7d6fbc3613c72614f5fce18ad2c7f9b1 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 12:12:47 +0100 +Subject: [PATCH 12/43] conf: AU88[123]0: define pcm configuration block only + one time + +There may be multiple AU88[123]0 soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/AU8810.conf | 4 ++-- + src/conf/cards/AU8820.conf | 2 +- + src/conf/cards/AU8830.conf | 4 ++-- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/conf/cards/AU8810.conf b/src/conf/cards/AU8810.conf +index 24d46c34..6b596b68 100644 +--- a/src/conf/cards/AU8810.conf ++++ b/src/conf/cards/AU8810.conf +@@ -4,7 +4,7 @@ + + + +-AU8810.pcm.front.0 { ++AU8810.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -15,7 +15,7 @@ AU8810.pcm.front.0 { + + + +-AU8810.pcm.iec958.0 { ++AU8810.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +diff --git a/src/conf/cards/AU8820.conf b/src/conf/cards/AU8820.conf +index 07890254..fe2cbc11 100644 +--- a/src/conf/cards/AU8820.conf ++++ b/src/conf/cards/AU8820.conf +@@ -4,7 +4,7 @@ + + + +-AU8820.pcm.front.0 { ++AU8820.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +diff --git a/src/conf/cards/AU8830.conf b/src/conf/cards/AU8830.conf +index 39e66d50..9cd78b3e 100644 +--- a/src/conf/cards/AU8830.conf ++++ b/src/conf/cards/AU8830.conf +@@ -4,7 +4,7 @@ + + + +-AU8830.pcm.front.0 { ++AU8830.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -19,7 +19,7 @@ AU8830.pcm.surround40.0 "cards.AU8830.pcm.front.0" + + + +-AU8830.pcm.iec958.0 { ++AU8830.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From 68b8b435416ea734dda55c39f59bea90ea4b0dd6 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 12:12:47 +0100 +Subject: [PATCH 13/43] conf: CA0106: define pcm configuration block only one + time + +There may be multiple CA0106 soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/CA0106.conf | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/src/conf/cards/CA0106.conf b/src/conf/cards/CA0106.conf +index 2f0eaf0a..1fea79f5 100644 +--- a/src/conf/cards/CA0106.conf ++++ b/src/conf/cards/CA0106.conf +@@ -3,7 +3,7 @@ + # + + # default with dmix & dsnoop +-CA0106.pcm.default { ++CA0106.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -27,7 +27,7 @@ CA0106.pcm.default { + + + +-CA0106.pcm.front.0 { ++CA0106.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -38,7 +38,7 @@ CA0106.pcm.front.0 { + + + +-CA0106.pcm.rear.0 { ++CA0106.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -50,7 +50,7 @@ CA0106.pcm.rear.0 { + + + +-CA0106.pcm.center_lfe.0 { ++CA0106.pcm.center_lfe.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -62,7 +62,7 @@ CA0106.pcm.center_lfe.0 { + + + +-CA0106.pcm.side.0 { ++CA0106.pcm.side.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -74,7 +74,7 @@ CA0106.pcm.side.0 { + + + +-CA0106.pcm.surround40.0 { ++CA0106.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -114,7 +114,7 @@ CA0106.pcm.surround40.0 { + + + +-CA0106.pcm.surround51.0 { ++CA0106.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -159,7 +159,7 @@ CA0106.pcm.surround51.0 { + ] + } + +-CA0106.pcm.surround71.0 { ++CA0106.pcm.surround71.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -220,7 +220,7 @@ CA0106.pcm.surround71.0 { + + + +-CA0106.pcm.iec958.0 { ++CA0106.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From 041299ea39a7a8d2cb55cb8c2cb5a2e985d38fc3 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 12:12:47 +0100 +Subject: [PATCH 14/43] conf: CMI8xxx: define pcm configuration block only one + time + +There may be multiple CMI8xxx soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/CMI8338-SWIEC.conf | 10 +++++----- + src/conf/cards/CMI8338.conf | 10 +++++----- + src/conf/cards/CMI8738-MC6.conf | 12 ++++++------ + src/conf/cards/CMI8738-MC8.conf | 14 +++++++------- + src/conf/cards/CMI8788.conf | 12 ++++++------ + 5 files changed, 29 insertions(+), 29 deletions(-) + +diff --git a/src/conf/cards/CMI8338-SWIEC.conf b/src/conf/cards/CMI8338-SWIEC.conf +index af3a579f..ca86c466 100644 +--- a/src/conf/cards/CMI8338-SWIEC.conf ++++ b/src/conf/cards/CMI8338-SWIEC.conf +@@ -5,7 +5,7 @@ + + + +-CMI8338-SWIEC.pcm.front.0 { ++CMI8338-SWIEC.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -15,7 +15,7 @@ CMI8338-SWIEC.pcm.front.0 { + } + + # default with dmix/dsnoop +-CMI8338-SWIEC.pcm.default { ++CMI8338-SWIEC.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -41,7 +41,7 @@ CMI8338-SWIEC.pcm.default { + + # 2nd DAC + # FIXME: we need a volume attenuator for rear channel. +-CMI8338-SWIEC.pcm.rear.0 { ++CMI8338-SWIEC.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -54,7 +54,7 @@ CMI8338-SWIEC.pcm.rear.0 { + + + # for the old CM8738 with 2nd DAC for rear +-CMI8338-SWIEC.pcm.surround40.0 { ++CMI8338-SWIEC.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -91,7 +91,7 @@ CMI8338-SWIEC.pcm.surround40.0 { + + + +-CMI8338-SWIEC.pcm.iec958.0 { ++CMI8338-SWIEC.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +diff --git a/src/conf/cards/CMI8338.conf b/src/conf/cards/CMI8338.conf +index 144fc9b0..0f92ad0b 100644 +--- a/src/conf/cards/CMI8338.conf ++++ b/src/conf/cards/CMI8338.conf +@@ -4,7 +4,7 @@ + + + +-CMI8338.pcm.front.0 { ++CMI8338.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -14,7 +14,7 @@ CMI8338.pcm.front.0 { + } + + # default with dmix/dsnoop +-CMI8338.pcm.default { ++CMI8338.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -40,7 +40,7 @@ CMI8338.pcm.default { + + # 2nd DAC + # FIXME: we need a volume attenuator for rear channel. +-CMI8338.pcm.rear.0 { ++CMI8338.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -53,7 +53,7 @@ CMI8338.pcm.rear.0 { + + + # for the old CM8738 with 2nd DAC for rear +-CMI8338.pcm.surround40.0 { ++CMI8338.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -90,7 +90,7 @@ CMI8338.pcm.surround40.0 { + + + +-CMI8338.pcm.iec958.0 { ++CMI8338.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +diff --git a/src/conf/cards/CMI8738-MC6.conf b/src/conf/cards/CMI8738-MC6.conf +index edc67d44..2b1c7d05 100644 +--- a/src/conf/cards/CMI8738-MC6.conf ++++ b/src/conf/cards/CMI8738-MC6.conf +@@ -4,7 +4,7 @@ + + + +-CMI8738-MC6.pcm.front.0 { ++CMI8738-MC6.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -14,7 +14,7 @@ CMI8738-MC6.pcm.front.0 { + } + + # default with dmix/dsnoop +-CMI8738-MC6.pcm.default { ++CMI8738-MC6.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -40,7 +40,7 @@ CMI8738-MC6.pcm.default { + + # 2nd DAC + # FIXME: we need a volume attenuator for rear channel. +-CMI8738-MC6.pcm.rear.0 { ++CMI8738-MC6.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -52,7 +52,7 @@ CMI8738-MC6.pcm.rear.0 { + + + +-CMI8738-MC6.pcm.surround40.0 { ++CMI8738-MC6.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -82,7 +82,7 @@ CMI8738-MC6.pcm.surround40.0 { + + + +-CMI8738-MC6.pcm.surround51.0 { ++CMI8738-MC6.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -109,7 +109,7 @@ CMI8738-MC6.pcm.surround51.0 { + + + +-CMI8738-MC6.pcm.iec958.0 { ++CMI8738-MC6.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +diff --git a/src/conf/cards/CMI8738-MC8.conf b/src/conf/cards/CMI8738-MC8.conf +index ddff7530..96cb3f10 100644 +--- a/src/conf/cards/CMI8738-MC8.conf ++++ b/src/conf/cards/CMI8738-MC8.conf +@@ -4,7 +4,7 @@ + + + +-CMI8738-MC8.pcm.front.0 { ++CMI8738-MC8.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -21,7 +21,7 @@ CMI8738-MC8.pcm.front.0 { + } + + # default with dmix+softvol & dsnoop +-CMI8738-MC8.pcm.default { ++CMI8738-MC8.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -53,7 +53,7 @@ CMI8738-MC8.pcm.default { + + + # 2nd DAC +-CMI8738-MC8.pcm.rear.0 { ++CMI8738-MC8.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -72,7 +72,7 @@ CMI8738-MC8.pcm.rear.0 { + + + +-CMI8738-MC8.pcm.surround40.0 { ++CMI8738-MC8.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -110,7 +110,7 @@ CMI8738-MC8.pcm.surround40.0 { + + + +-CMI8738-MC8.pcm.surround51.0 { ++CMI8738-MC8.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -144,7 +144,7 @@ CMI8738-MC8.pcm.surround51.0 { + + + +-CMI8738-MC8.pcm.surround71.0 { ++CMI8738-MC8.pcm.surround71.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -178,7 +178,7 @@ CMI8738-MC8.pcm.surround71.0 { + + + +-CMI8738-MC8.pcm.iec958.0 { ++CMI8738-MC8.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +diff --git a/src/conf/cards/CMI8788.conf b/src/conf/cards/CMI8788.conf +index edcb0c9c..c4ad9f48 100644 +--- a/src/conf/cards/CMI8788.conf ++++ b/src/conf/cards/CMI8788.conf +@@ -4,7 +4,7 @@ + + + +-CMI8788.pcm.front.0 { ++CMI8788.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -14,7 +14,7 @@ CMI8788.pcm.front.0 { + } + + # default with dmix & dsnoop +-CMI8788.pcm.default { ++CMI8788.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -38,7 +38,7 @@ CMI8788.pcm.default { + + + +-CMI8788.pcm.surround40.0 { ++CMI8788.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -53,7 +53,7 @@ CMI8788.pcm.surround40.0 { + + + +-CMI8788.pcm.surround51.0 { ++CMI8788.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -65,7 +65,7 @@ CMI8788.pcm.surround51.0 { + + + +-CMI8788.pcm.surround71.0 { ++CMI8788.pcm.surround71.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -77,7 +77,7 @@ CMI8788.pcm.surround71.0 { + + + +-CMI8788.pcm.iec958.0 { ++CMI8788.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From 1e29ff18400e9b219159f9d0cb9aaf4be3b82efa Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 12:12:47 +0100 +Subject: [PATCH 15/43] conf: CS46xx: define pcm configuration block only one + time + +There may be multiple CS46xx soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/CS46xx.conf | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/src/conf/cards/CS46xx.conf b/src/conf/cards/CS46xx.conf +index b71c30aa..478cbf3e 100644 +--- a/src/conf/cards/CS46xx.conf ++++ b/src/conf/cards/CS46xx.conf +@@ -4,7 +4,7 @@ + + + +-CS46xx.pcm.front.0 { ++CS46xx.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -15,7 +15,7 @@ CS46xx.pcm.front.0 { + + # default with plughw + # CS46xx supports multi-playback +-CS46xx.pcm.default { ++CS46xx.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -39,7 +39,7 @@ CS46xx.pcm.default { + + + +-CS46xx.pcm.rear.0 { ++CS46xx.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -66,7 +66,7 @@ CS46xx.pcm.rear.0 { + + + +-CS46xx.pcm.center_lfe.0 { ++CS46xx.pcm.center_lfe.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -78,7 +78,7 @@ CS46xx.pcm.center_lfe.0 { + + + +-CS46xx.pcm.surround40.0 { ++CS46xx.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -117,7 +117,7 @@ CS46xx.pcm.surround40.0 { + + + +-CS46xx.pcm.surround51.0 { ++CS46xx.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -164,7 +164,7 @@ CS46xx.pcm.surround51.0 { + + + +-CS46xx.pcm.iec958.0 { ++CS46xx.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From 0ba7c2716567875d207b71b61e1205b855c7fd9c Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 12:12:47 +0100 +Subject: [PATCH 16/43] conf: Echo3G: define pcm configuration block only one + time + +There may be multiple Echo3G soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/Echo_Echo3G.conf | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/src/conf/cards/Echo_Echo3G.conf b/src/conf/cards/Echo_Echo3G.conf +index 766f13f7..fb2a7b67 100644 +--- a/src/conf/cards/Echo_Echo3G.conf ++++ b/src/conf/cards/Echo_Echo3G.conf +@@ -3,7 +3,7 @@ + # + + +-Echo_Echo3G.pcm.front.0 { ++Echo_Echo3G.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -15,7 +15,7 @@ Echo_Echo3G.pcm.front.0 { + } + + +-Echo_Echo3G.pcm.rear.0 { ++Echo_Echo3G.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -27,7 +27,7 @@ Echo_Echo3G.pcm.rear.0 { + } + + +-Echo_Echo3G.pcm.center_lfe.0 { ++Echo_Echo3G.pcm.center_lfe.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -39,7 +39,7 @@ Echo_Echo3G.pcm.center_lfe.0 { + } + + +-Echo_Echo3G.pcm.side.0 { ++Echo_Echo3G.pcm.side.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -51,7 +51,7 @@ Echo_Echo3G.pcm.side.0 { + } + + +-Echo_Echo3G.pcm.surround40.0 { ++Echo_Echo3G.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -86,7 +86,7 @@ Echo_Echo3G.pcm.surround40.0 { + } + + +-Echo_Echo3G.pcm.surround41.0 { ++Echo_Echo3G.pcm.surround41.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -131,7 +131,7 @@ Echo_Echo3G.pcm.surround41.0 { + } + + +-Echo_Echo3G.pcm.surround50.0 { ++Echo_Echo3G.pcm.surround50.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -176,7 +176,7 @@ Echo_Echo3G.pcm.surround50.0 { + } + + +-Echo_Echo3G.pcm.surround51.0 { ++Echo_Echo3G.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -222,7 +222,7 @@ Echo_Echo3G.pcm.surround51.0 { + } + + +-Echo_Echo3G.pcm.surround71.0 { ++Echo_Echo3G.pcm.surround71.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -279,7 +279,7 @@ Echo_Echo3G.pcm.surround71.0 { + } + + +-Echo_Echo3G.pcm.iec958.0 { ++Echo_Echo3G.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From 8c1005624495b61919080959088dc744d6d213ea Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:08:42 +0100 +Subject: [PATCH 17/43] conf: Aureon51: define pcm configuration block only one + time + +There may be multiple Aureon51 soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/Aureon51.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/conf/cards/Aureon51.conf b/src/conf/cards/Aureon51.conf +index 9bf34661..db907f82 100644 +--- a/src/conf/cards/Aureon51.conf ++++ b/src/conf/cards/Aureon51.conf +@@ -76,7 +76,7 @@ Aureon51.pcm.side.!0 { + + + +-Aureon51.pcm.surround40.0 { ++Aureon51.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +-- +2.51.1 + + +From ed4884cbe179f42a10771584ebe9fff844b90d4f Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:08:42 +0100 +Subject: [PATCH 18/43] conf: EMU10K1: define pcm configuration block only one + time + +There may be multiple EMU10K1 soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/EMU10K1.conf | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/conf/cards/EMU10K1.conf b/src/conf/cards/EMU10K1.conf +index 430926c7..5ef12c03 100644 +--- a/src/conf/cards/EMU10K1.conf ++++ b/src/conf/cards/EMU10K1.conf +@@ -4,7 +4,7 @@ + + + +-EMU10K1.pcm.front.0 { ++EMU10K1.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -47,7 +47,7 @@ EMU10K1.pcm.front.0 { + + + +-EMU10K1.pcm.rear.0 { ++EMU10K1.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -78,7 +78,7 @@ EMU10K1.pcm.rear.0 { + + + +-EMU10K1.pcm.center_lfe.0 { ++EMU10K1.pcm.center_lfe.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -143,7 +143,7 @@ EMU10K1.pcm.center_lfe.0 { + + + +-EMU10K1.pcm.surround40.0 { ++EMU10K1.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -182,7 +182,7 @@ EMU10K1.pcm.surround40.0 { + + + +-EMU10K1.pcm.surround51.0 { ++EMU10K1.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -229,7 +229,7 @@ EMU10K1.pcm.surround51.0 { + + + +-EMU10K1.pcm.iec958.0 { ++EMU10K1.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From dba724706a6eec70e52e31595b3ff1ec055bf50c Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:17:45 +0100 +Subject: [PATCH 19/43] conf: EMU10K1X: define pcm configuration block only one + time + +There may be multiple EMU10K1X soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/EMU10K1X.conf | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/src/conf/cards/EMU10K1X.conf b/src/conf/cards/EMU10K1X.conf +index f7428636..334f897d 100644 +--- a/src/conf/cards/EMU10K1X.conf ++++ b/src/conf/cards/EMU10K1X.conf +@@ -3,7 +3,7 @@ + # + + # default with dmix & dsnoop +-EMU10K1X.pcm.default { ++EMU10K1X.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -27,7 +27,7 @@ EMU10K1X.pcm.default { + + + +-EMU10K1X.pcm.front.0 { ++EMU10K1X.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -38,7 +38,7 @@ EMU10K1X.pcm.front.0 { + + + +-EMU10K1X.pcm.rear.0 { ++EMU10K1X.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -50,7 +50,7 @@ EMU10K1X.pcm.rear.0 { + + + +-EMU10K1X.pcm.center_lfe.0 { ++EMU10K1X.pcm.center_lfe.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -62,7 +62,7 @@ EMU10K1X.pcm.center_lfe.0 { + + + +-EMU10K1X.pcm.surround40.0 { ++EMU10K1X.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -101,7 +101,7 @@ EMU10K1X.pcm.surround40.0 { + + + +-EMU10K1X.pcm.surround51.0 { ++EMU10K1X.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -148,7 +148,7 @@ EMU10K1X.pcm.surround51.0 { + + + +-EMU10K1X.pcm.iec958.0 { ++EMU10K1X.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From 7cf26f603823cccd3e89eb57f459642c890b79af Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:17:45 +0100 +Subject: [PATCH 20/43] conf: ENS137[01]: define pcm configuration block only + one time + +There may be multiple ENS137[01] soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/ENS1370.conf | 8 ++++---- + src/conf/cards/ENS1371.conf | 10 +++++----- + 2 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/src/conf/cards/ENS1370.conf b/src/conf/cards/ENS1370.conf +index 32e4782e..c65e224f 100644 +--- a/src/conf/cards/ENS1370.conf ++++ b/src/conf/cards/ENS1370.conf +@@ -4,7 +4,7 @@ + + + +-ENS1370.pcm.front.0 { ++ENS1370.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -15,7 +15,7 @@ ENS1370.pcm.front.0 { + } + + # default with dmix/dsnoop +-ENS1370.pcm.default { ++ENS1370.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -39,7 +39,7 @@ ENS1370.pcm.default { + + + +-ENS1370.pcm.rear.0 { ++ENS1370.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -71,7 +71,7 @@ ENS1370.pcm.rear.0 { + + + +-ENS1370.pcm.surround40.0 { ++ENS1370.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +diff --git a/src/conf/cards/ENS1371.conf b/src/conf/cards/ENS1371.conf +index a6df4251..560fda9f 100644 +--- a/src/conf/cards/ENS1371.conf ++++ b/src/conf/cards/ENS1371.conf +@@ -4,7 +4,7 @@ + + + +-ENS1371.pcm.front.0 { ++ENS1371.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -14,7 +14,7 @@ ENS1371.pcm.front.0 { + } + + # default with dmix/dsnoop +-ENS1371.pcm.default { ++ENS1371.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -38,7 +38,7 @@ ENS1371.pcm.default { + + + +-ENS1371.pcm.rear.0 { ++ENS1371.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -65,7 +65,7 @@ ENS1371.pcm.rear.0 { + + + +-ENS1371.pcm.surround40.0 { ++ENS1371.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -97,7 +97,7 @@ ENS1371.pcm.surround40.0 { + + + +-ENS1371.pcm.iec958.0 { ++ENS1371.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From 001a2f3809865d071b53e802d4fbc89bb37a2fe1 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:17:45 +0100 +Subject: [PATCH 21/43] conf: ES1968: define pcm configuration block only one + time + +There may be multiple ES1968 soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/ES1968.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/conf/cards/ES1968.conf b/src/conf/cards/ES1968.conf +index a6ee1192..296baa13 100644 +--- a/src/conf/cards/ES1968.conf ++++ b/src/conf/cards/ES1968.conf +@@ -2,7 +2,7 @@ + + + +-ES1968.pcm.front.0 { ++ES1968.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +-- +2.51.1 + + +From 2d5aa02738faf79895fa7457182810bee2ce7b90 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:17:46 +0100 +Subject: [PATCH 22/43] conf: FireWave: define pcm configuration block only one + time + +There may be multiple FireWave soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/FireWave.conf | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/conf/cards/FireWave.conf b/src/conf/cards/FireWave.conf +index fcfc83cc..786169f2 100644 +--- a/src/conf/cards/FireWave.conf ++++ b/src/conf/cards/FireWave.conf +@@ -2,7 +2,7 @@ + # Configuration for the Griffin FireWave Surround + # + +-FireWave.pcm.default { ++FireWave.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -16,7 +16,7 @@ FireWave.pcm.default { + + + +-FireWave.pcm.front.0 { ++FireWave.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -30,7 +30,7 @@ FireWave.pcm.front.0 { + + + +-FireWave.pcm.surround51.0 { ++FireWave.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +-- +2.51.1 + + +From 9f46e1a5a48f863e38794aa5b7c350d291078924 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:17:46 +0100 +Subject: [PATCH 23/43] conf: FM801: define pcm configuration block only one + time + +There may be multiple FM801 soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/FM801.conf | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/conf/cards/FM801.conf b/src/conf/cards/FM801.conf +index 0ddf799c..14cfdbe8 100644 +--- a/src/conf/cards/FM801.conf ++++ b/src/conf/cards/FM801.conf +@@ -4,7 +4,7 @@ + + + +-FM801.pcm.front.0 { ++FM801.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -14,7 +14,7 @@ FM801.pcm.front.0 { + } + + # default with dmix/dsnoop +-FM801.pcm.default { ++FM801.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -49,7 +49,7 @@ FM801.pcm.surround51.0 "cards.FM801.pcm.front.0" + + + +-FM801.pcm.iec958.0 { ++FM801.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From ea939799299ff88c254344c7a89e86ffa159e5a7 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:17:46 +0100 +Subject: [PATCH 24/43] conf: FWSpeakers: define pcm configuration block only + one time + +There may be multiple FWSpeakers soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/FWSpeakers.conf | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/conf/cards/FWSpeakers.conf b/src/conf/cards/FWSpeakers.conf +index cd6fa605..96ab5cb9 100644 +--- a/src/conf/cards/FWSpeakers.conf ++++ b/src/conf/cards/FWSpeakers.conf +@@ -2,7 +2,7 @@ + # Configuration for the LaCie Firewire speakers + # + +-FWSpeakers.pcm.default { ++FWSpeakers.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -16,7 +16,7 @@ FWSpeakers.pcm.default { + + + +-FWSpeakers.pcm.front.0 { ++FWSpeakers.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +-- +2.51.1 + + +From a87570df7247d979eb5106ca549fa776e4c51ab3 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:17:47 +0100 +Subject: [PATCH 25/43] conf: GUS: define pcm configuration block only one time + +There may be multiple GUS soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/GUS.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/conf/cards/GUS.conf b/src/conf/cards/GUS.conf +index d744c548..a1ccd0e9 100644 +--- a/src/conf/cards/GUS.conf ++++ b/src/conf/cards/GUS.conf +@@ -4,7 +4,7 @@ + + + +-GUS.pcm.front.0 { ++GUS.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +-- +2.51.1 + + +From dded72a687e8e8210b276ab13f4e26b63bfa782b Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:17:47 +0100 +Subject: [PATCH 26/43] conf: HdmiLpeAudio: define pcm configuration block only + one time + +There may be multiple HdmiLpeAudio soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/HdmiLpeAudio.conf | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/conf/cards/HdmiLpeAudio.conf b/src/conf/cards/HdmiLpeAudio.conf +index a9104f43..799946a2 100644 +--- a/src/conf/cards/HdmiLpeAudio.conf ++++ b/src/conf/cards/HdmiLpeAudio.conf +@@ -2,7 +2,7 @@ + # Configuration for the Intel HDMI/DP LPE audio + # + +-HdmiLpeAudio.pcm.hdmi.0 { ++HdmiLpeAudio.pcm.hdmi.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +@@ -39,7 +39,7 @@ HdmiLpeAudio.pcm.hdmi.0 { + } + } + +-HdmiLpeAudio.pcm.hdmi.1 { ++HdmiLpeAudio.pcm.hdmi.!1 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +@@ -77,7 +77,7 @@ HdmiLpeAudio.pcm.hdmi.1 { + } + } + +-HdmiLpeAudio.pcm.hdmi.2 { ++HdmiLpeAudio.pcm.hdmi.!2 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From 1f52b57ff8f023b396b459407e60d8498c69f6e7 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:17:57 +0100 +Subject: [PATCH 27/43] conf: ICE17[12][24]: define pcm configuration block + only one time + +There may be multiple ICE17[12][24] soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/ICE1712.conf | 12 ++++++------ + src/conf/cards/ICE1724.conf | 18 +++++++++--------- + 2 files changed, 15 insertions(+), 15 deletions(-) + +diff --git a/src/conf/cards/ICE1712.conf b/src/conf/cards/ICE1712.conf +index db62684e..190d2c59 100644 +--- a/src/conf/cards/ICE1712.conf ++++ b/src/conf/cards/ICE1712.conf +@@ -3,7 +3,7 @@ + # + + # default with dmix & dsnoop +-ICE1712.pcm.default { ++ICE1712.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -27,7 +27,7 @@ ICE1712.pcm.default { + + + +-ICE1712.pcm.front.0 { ++ICE1712.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -57,7 +57,7 @@ ICE1712.pcm.front.0 { + + + +-ICE1712.pcm.surround40.0 { ++ICE1712.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -80,7 +80,7 @@ ICE1712.pcm.surround40.0 { + + + +-ICE1712.pcm.surround51.0 { ++ICE1712.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -99,7 +99,7 @@ ICE1712.pcm.surround51.0 { + slave.channels 10 + } + +-ICE1712.pcm.surround71.0 { ++ICE1712.pcm.surround71.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -122,7 +122,7 @@ ICE1712.pcm.surround71.0 { + + + +-ICE1712.pcm.iec958.0 { ++ICE1712.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +diff --git a/src/conf/cards/ICE1724.conf b/src/conf/cards/ICE1724.conf +index 61cac013..16045dc4 100644 +--- a/src/conf/cards/ICE1724.conf ++++ b/src/conf/cards/ICE1724.conf +@@ -3,7 +3,7 @@ + # + + # default with dmix & dsnoop +-ICE1724.pcm.default { ++ICE1724.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -27,7 +27,7 @@ ICE1724.pcm.default { + + + +-ICE1724.pcm.front.0 { ++ICE1724.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -38,7 +38,7 @@ ICE1724.pcm.front.0 { + + + +-ICE1724.pcm.rear.0 { ++ICE1724.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -51,7 +51,7 @@ ICE1724.pcm.rear.0 { + + + +-ICE1724.pcm.center_lfe.0 { ++ICE1724.pcm.center_lfe.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -63,7 +63,7 @@ ICE1724.pcm.center_lfe.0 { + + + +-ICE1724.pcm.side.0 { ++ICE1724.pcm.side.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -76,7 +76,7 @@ ICE1724.pcm.side.0 { + + + +-ICE1724.pcm.surround40.0 { ++ICE1724.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -100,7 +100,7 @@ ICE1724.pcm.surround40.0 { + + + +-ICE1724.pcm.surround51.0 { ++ICE1724.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -123,7 +123,7 @@ ICE1724.pcm.surround51.0 { + + + +-ICE1724.pcm.surround71.0 { ++ICE1724.pcm.surround71.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -148,7 +148,7 @@ ICE1724.pcm.surround71.0 { + + + +-ICE1724.pcm.iec958.0 { ++ICE1724.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From 99f1987a1e864523a7a423f1840ca6a76045d619 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:17:57 +0100 +Subject: [PATCH 28/43] conf: ICH,ICH4,ICH-MODEM: define pcm configuration + block only one time + +There may be multiple ICH soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/ICH-MODEM.conf | 2 +- + src/conf/cards/ICH.conf | 10 +++++----- + src/conf/cards/ICH4.conf | 10 +++++----- + 3 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/src/conf/cards/ICH-MODEM.conf b/src/conf/cards/ICH-MODEM.conf +index b96b5aaf..855f3a96 100644 +--- a/src/conf/cards/ICH-MODEM.conf ++++ b/src/conf/cards/ICH-MODEM.conf +@@ -4,7 +4,7 @@ + + + +-ICH-MODEM.pcm.modem.0 { ++ICH-MODEM.pcm.modem.!0 { + @args [ CARD ] + @args.CARD { + type string +diff --git a/src/conf/cards/ICH.conf b/src/conf/cards/ICH.conf +index 6fc9a5a2..c35c8d02 100644 +--- a/src/conf/cards/ICH.conf ++++ b/src/conf/cards/ICH.conf +@@ -4,7 +4,7 @@ + + + +-ICH.pcm.front.0 { ++ICH.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -21,7 +21,7 @@ ICH.pcm.front.0 { + } + + # default with dmix+softvol & dsnoop +-ICH.pcm.default { ++ICH.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -52,7 +52,7 @@ ICH.pcm.default { + + + +-ICH.pcm.surround40.0 { ++ICH.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -103,7 +103,7 @@ ICH.pcm.surround40.0 { + + + +-ICH.pcm.surround51.0 { ++ICH.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -174,7 +174,7 @@ ICH.pcm.surround51.0 { + + + +-ICH.pcm.iec958.0 { ++ICH.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +diff --git a/src/conf/cards/ICH4.conf b/src/conf/cards/ICH4.conf +index 64ec883d..11c85a6e 100644 +--- a/src/conf/cards/ICH4.conf ++++ b/src/conf/cards/ICH4.conf +@@ -4,7 +4,7 @@ + + + +-ICH4.pcm.front.0 { ++ICH4.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -21,7 +21,7 @@ ICH4.pcm.front.0 { + } + + # default with dmix+softvol & dsnoop +-ICH4.pcm.default { ++ICH4.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -52,7 +52,7 @@ ICH4.pcm.default { + + + +-ICH4.pcm.surround40.0 { ++ICH4.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -103,7 +103,7 @@ ICH4.pcm.surround40.0 { + + + +-ICH4.pcm.surround51.0 { ++ICH4.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -164,7 +164,7 @@ ICH4.pcm.surround51.0 { + + + +-ICH4.pcm.iec958.0 { ++ICH4.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From ff4fb7f8c98157010c44f7335a32a09e9fc085d6 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:17:57 +0100 +Subject: [PATCH 29/43] conf: Loopback: define pcm configuration block only one + time + +There may be multiple Loopback soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/Loopback.conf | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/conf/cards/Loopback.conf b/src/conf/cards/Loopback.conf +index 1ae6d453..21c8429c 100644 +--- a/src/conf/cards/Loopback.conf ++++ b/src/conf/cards/Loopback.conf +@@ -4,7 +4,7 @@ + + + +-Loopback.pcm.front.0 { ++Loopback.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -21,7 +21,7 @@ Loopback.pcm.front.0 { + } + + # default with dmix+softvol & dsnoop +-Loopback.pcm.default { ++Loopback.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +-- +2.51.1 + + +From de72d657281c043c8d48d23cb8da9b1c4c5f31de Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:17:57 +0100 +Subject: [PATCH 30/43] conf: Maestro3: define pcm configuration block only one + time + +There may be multiple Maestro3 soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/Maestro3.conf | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/conf/cards/Maestro3.conf b/src/conf/cards/Maestro3.conf +index 94323227..a8d89a48 100644 +--- a/src/conf/cards/Maestro3.conf ++++ b/src/conf/cards/Maestro3.conf +@@ -2,7 +2,7 @@ + + + +-Maestro3.pcm.front.0 { ++Maestro3.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -12,7 +12,7 @@ Maestro3.pcm.front.0 { + } + + # default with dmix/dsnoop +-Maestro3.pcm.default { ++Maestro3.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +-- +2.51.1 + + +From ebb5ab7d846e2702640a7d754127083412b15816 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:18:06 +0100 +Subject: [PATCH 31/43] conf: NFORCE: define pcm configuration block only one + time + +There may be multiple NFORCE soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/NFORCE.conf | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/conf/cards/NFORCE.conf b/src/conf/cards/NFORCE.conf +index 64d15479..088cd8ce 100644 +--- a/src/conf/cards/NFORCE.conf ++++ b/src/conf/cards/NFORCE.conf +@@ -4,7 +4,7 @@ + + + +-NFORCE.pcm.front.0 { ++NFORCE.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -21,7 +21,7 @@ NFORCE.pcm.front.0 { + } + + # default with dmix+softvol & dsnoop +-NFORCE.pcm.default { ++NFORCE.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -52,7 +52,7 @@ NFORCE.pcm.default { + + + +-NFORCE.pcm.surround40.0 { ++NFORCE.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -103,7 +103,7 @@ NFORCE.pcm.surround40.0 { + + + +-NFORCE.pcm.surround51.0 { ++NFORCE.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -174,7 +174,7 @@ NFORCE.pcm.surround51.0 { + + + +-NFORCE.pcm.surround71.0 { ++NFORCE.pcm.surround71.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -247,7 +247,7 @@ NFORCE.pcm.surround71.0 { + + + +-NFORCE.pcm.iec958.0 { ++NFORCE.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From 3d636ff5309e3672c0acc784c9539af4396d2dfb Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:18:06 +0100 +Subject: [PATCH 32/43] conf: PC-Speaker: define pcm configuration block only + one time + +There may be multiple PC-Speaker soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/PC-Speaker.conf | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/conf/cards/PC-Speaker.conf b/src/conf/cards/PC-Speaker.conf +index c82654d8..8a40a139 100644 +--- a/src/conf/cards/PC-Speaker.conf ++++ b/src/conf/cards/PC-Speaker.conf +@@ -4,7 +4,7 @@ + + + +-PC-Speaker.pcm.front.0 { ++PC-Speaker.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -23,7 +23,7 @@ PC-Speaker.pcm.front.0 { + } + + # default with dmix & null +-PC-Speaker.pcm.default { ++PC-Speaker.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +-- +2.51.1 + + +From a3028a492a641d5077640294d1fb655c4b4aa84a Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:18:06 +0100 +Subject: [PATCH 33/43] conf: PMac,PMacToonie: define pcm configuration block + only one time + +There may be multiple PMac soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/PMac.conf | 4 ++-- + src/conf/cards/PMacToonie.conf | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/conf/cards/PMac.conf b/src/conf/cards/PMac.conf +index d1fdb17b..00f3bc89 100644 +--- a/src/conf/cards/PMac.conf ++++ b/src/conf/cards/PMac.conf +@@ -4,7 +4,7 @@ + + + +-PMac.pcm.front.0 { ++PMac.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -14,7 +14,7 @@ PMac.pcm.front.0 { + } + + # default with dmix/dsnoop +-PMac.pcm.default { ++PMac.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +diff --git a/src/conf/cards/PMacToonie.conf b/src/conf/cards/PMacToonie.conf +index 1e0eb59c..aff1ea65 100644 +--- a/src/conf/cards/PMacToonie.conf ++++ b/src/conf/cards/PMacToonie.conf +@@ -4,7 +4,7 @@ + + + +-PMacToonie.pcm.front.0 { ++PMacToonie.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -21,7 +21,7 @@ PMacToonie.pcm.front.0 { + } + + # default with dmix+softvol & dsnoop +-PMacToonie.pcm.default { ++PMacToonie.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +-- +2.51.1 + + +From 8340b3c6b31a4e4c02f69bf36f3958d390c724b9 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:18:06 +0100 +Subject: [PATCH 34/43] conf: PS3: define pcm configuration block only one time + +There may be multiple PS3 soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/PS3.conf | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/conf/cards/PS3.conf b/src/conf/cards/PS3.conf +index b642f0dc..486d790c 100644 +--- a/src/conf/cards/PS3.conf ++++ b/src/conf/cards/PS3.conf +@@ -4,7 +4,7 @@ + + + +-PS3.pcm.front.0 { ++PS3.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -22,7 +22,7 @@ PS3.pcm.front.0 { + } + + # default with dmix+softvol +-PS3.pcm.default { ++PS3.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -47,7 +47,7 @@ PS3.pcm.default { + + + +-PS3.pcm.iec958.0 { ++PS3.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From f03528daf2ee177d2003b4d40824506f3a3558f4 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:18:15 +0100 +Subject: [PATCH 35/43] conf: RME96[35][26]: define pcm configuration block + only one time + +There may be multiple RME96[35][26] soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/RME9636.conf | 4 ++-- + src/conf/cards/RME9652.conf | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/conf/cards/RME9636.conf b/src/conf/cards/RME9636.conf +index e8dc5fad..17b3a1ab 100644 +--- a/src/conf/cards/RME9636.conf ++++ b/src/conf/cards/RME9636.conf +@@ -4,7 +4,7 @@ + + + +-RME9636.pcm.front.0 { ++RME9636.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -17,7 +17,7 @@ RME9636.pcm.front.0 { + + + +-RME9636.pcm.iec958.0 { ++RME9636.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +diff --git a/src/conf/cards/RME9652.conf b/src/conf/cards/RME9652.conf +index 1147d810..a11e42b2 100644 +--- a/src/conf/cards/RME9652.conf ++++ b/src/conf/cards/RME9652.conf +@@ -4,7 +4,7 @@ + + + +-RME9652.pcm.front.0 { ++RME9652.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -17,7 +17,7 @@ RME9652.pcm.front.0 { + + + +-RME9652.pcm.iec958.0 { ++RME9652.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From 1cd87775c5d9d46e418dc67a4d9c93fe5104ee3f Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:18:15 +0100 +Subject: [PATCH 36/43] conf: SB-XFi: define pcm configuration block only one + time + +There may be multiple SB-XFi soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/SB-XFi.conf | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/conf/cards/SB-XFi.conf b/src/conf/cards/SB-XFi.conf +index eb2218bf..9ce9c8ac 100644 +--- a/src/conf/cards/SB-XFi.conf ++++ b/src/conf/cards/SB-XFi.conf +@@ -4,7 +4,7 @@ + + + +-SB-XFi.pcm.front.0 { ++SB-XFi.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -16,7 +16,7 @@ SB-XFi.pcm.front.0 { + + + +-SB-XFi.pcm.rear.0 { ++SB-XFi.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -29,7 +29,7 @@ SB-XFi.pcm.rear.0 { + + + +-SB-XFi.pcm.center_lfe.0 { ++SB-XFi.pcm.center_lfe.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -42,7 +42,7 @@ SB-XFi.pcm.center_lfe.0 { + + + +-SB-XFi.pcm.side.0 { ++SB-XFi.pcm.side.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -66,7 +66,7 @@ SB-XFi.pcm.surround71.0 cards.SB-XFi.pcm.front.0 + + + +-SB-XFi.pcm.iec958.0 { ++SB-XFi.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From 51d75e5f072698d6ec03957cf87b735117f05ab4 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:18:15 +0100 +Subject: [PATCH 37/43] conf: SI7018: define pcm configuration block only one + time + +There may be multiple SI7018 soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/SI7018.conf | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/conf/cards/SI7018.conf b/src/conf/cards/SI7018.conf +index 02b8fc87..33d19085 100644 +--- a/src/conf/cards/SI7018.conf ++++ b/src/conf/cards/SI7018.conf +@@ -6,7 +6,7 @@ + + + +-SI7018.pcm.front.0 { ++SI7018.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -18,7 +18,7 @@ SI7018.pcm.front.0 { + + + +-SI7018.pcm.rear.0 { ++SI7018.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -44,7 +44,7 @@ SI7018.pcm.rear.0 { + + + +-SI7018.pcm.surround40.0 { ++SI7018.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -83,7 +83,7 @@ SI7018.pcm.surround40.0 { + + + +-SI7018.pcm.surround51.0 { ++SI7018.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -130,7 +130,7 @@ SI7018.pcm.surround51.0 { + + + +-SI7018.pcm.iec958.0 { ++SI7018.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From 4c74f3a568583744dddab01e4cce5a2e8f207067 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:18:15 +0100 +Subject: [PATCH 38/43] conf: TRID4DWAVENX: define pcm configuration block only + one time + +There may be multiple TRID4DWAVENX soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/TRID4DWAVENX.conf | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/conf/cards/TRID4DWAVENX.conf b/src/conf/cards/TRID4DWAVENX.conf +index 717b1408..5001297e 100644 +--- a/src/conf/cards/TRID4DWAVENX.conf ++++ b/src/conf/cards/TRID4DWAVENX.conf +@@ -4,7 +4,7 @@ + + + +-TRID4DWAVENX.pcm.front.0 { ++TRID4DWAVENX.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -16,7 +16,7 @@ TRID4DWAVENX.pcm.front.0 { + + + +-TRID4DWAVENX.pcm.rear.0 { ++TRID4DWAVENX.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -56,7 +56,7 @@ TRID4DWAVENX.pcm.rear.0 { + + + +-TRID4DWAVENX.pcm.surround40.0 { ++TRID4DWAVENX.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -92,7 +92,7 @@ TRID4DWAVENX.pcm.surround40.0 { + + + +-TRID4DWAVENX.pcm.iec958.0 { ++TRID4DWAVENX.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From d6b9d7e0bef5ca8a019881b06de7183528ec5bd5 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:18:22 +0100 +Subject: [PATCH 39/43] conf: VIA686A,VIA82xx: define pcm configuration block + only one time + +There may be multiple VIA soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/VIA686A.conf | 6 +++--- + src/conf/cards/VIA8233.conf | 10 +++++----- + src/conf/cards/VIA8233A.conf | 10 +++++----- + src/conf/cards/VIA8237.conf | 10 +++++----- + 4 files changed, 18 insertions(+), 18 deletions(-) + +diff --git a/src/conf/cards/VIA686A.conf b/src/conf/cards/VIA686A.conf +index e4a06f23..c53dd71b 100644 +--- a/src/conf/cards/VIA686A.conf ++++ b/src/conf/cards/VIA686A.conf +@@ -7,7 +7,7 @@ + + + +-VIA686A.pcm.front.0 { ++VIA686A.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -17,7 +17,7 @@ VIA686A.pcm.front.0 { + } + + # default with dmix/dsnoop +-VIA686A.pcm.default { ++VIA686A.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -41,7 +41,7 @@ VIA686A.pcm.default { + + + +-VIA686A.pcm.iec958.0 { ++VIA686A.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +diff --git a/src/conf/cards/VIA8233.conf b/src/conf/cards/VIA8233.conf +index 9ad321f7..3c25a11b 100644 +--- a/src/conf/cards/VIA8233.conf ++++ b/src/conf/cards/VIA8233.conf +@@ -4,7 +4,7 @@ + + + +-VIA8233.pcm.front.0 { ++VIA8233.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -15,7 +15,7 @@ VIA8233.pcm.front.0 { + + # default with softvol/dsnoop + # VIA8233 supports multi-playback +-VIA8233.pcm.default { ++VIA8233.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -46,7 +46,7 @@ VIA8233.pcm.default { + + + +-VIA8233.pcm.surround40.0 { ++VIA8233.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -91,7 +91,7 @@ VIA8233.pcm.surround40.0 { + + + +-VIA8233.pcm.surround51.0 { ++VIA8233.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -146,7 +146,7 @@ VIA8233.pcm.surround51.0 { + + + +-VIA8233.pcm.iec958.0 { ++VIA8233.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +diff --git a/src/conf/cards/VIA8233A.conf b/src/conf/cards/VIA8233A.conf +index 679fccf3..c9e56e20 100644 +--- a/src/conf/cards/VIA8233A.conf ++++ b/src/conf/cards/VIA8233A.conf +@@ -4,7 +4,7 @@ + + + +-VIA8233A.pcm.front.0 { ++VIA8233A.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -14,7 +14,7 @@ VIA8233A.pcm.front.0 { + } + + # default with dmix/dsnoop +-VIA8233A.pcm.default { ++VIA8233A.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -38,7 +38,7 @@ VIA8233A.pcm.default { + + + +-VIA8233A.pcm.surround40.0 { ++VIA8233A.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -89,7 +89,7 @@ VIA8233A.pcm.surround40.0 { + + + +-VIA8233A.pcm.surround51.0 { ++VIA8233A.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -150,7 +150,7 @@ VIA8233A.pcm.surround51.0 { + + + +-VIA8233A.pcm.iec958.0 { ++VIA8233A.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +diff --git a/src/conf/cards/VIA8237.conf b/src/conf/cards/VIA8237.conf +index 29d8e00f..49fd6f2c 100644 +--- a/src/conf/cards/VIA8237.conf ++++ b/src/conf/cards/VIA8237.conf +@@ -4,7 +4,7 @@ + + + +-VIA8237.pcm.front.0 { ++VIA8237.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -15,7 +15,7 @@ VIA8237.pcm.front.0 { + + # default with softvol/dsnoop + # VIA8237 supports multi-playback +-VIA8237.pcm.default { ++VIA8237.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +@@ -46,7 +46,7 @@ VIA8237.pcm.default { + + + +-VIA8237.pcm.surround40.0 { ++VIA8237.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -84,7 +84,7 @@ VIA8237.pcm.surround40.0 { + + + +-VIA8237.pcm.surround51.0 { ++VIA8237.pcm.surround51.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -136,7 +136,7 @@ VIA8237.pcm.surround51.0 { + + + +-VIA8237.pcm.iec958.0 { ++VIA8237.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From 4bcd33ef9dc6d8439cc6573575907ecf89271fe2 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:18:22 +0100 +Subject: [PATCH 40/43] conf: VX222,VXPocket: define pcm configuration block + only one time + +There may be multiple VX soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/VX222.conf | 4 ++-- + src/conf/cards/VXPocket.conf | 4 ++-- + src/conf/cards/VXPocket440.conf | 8 ++++---- + 3 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/conf/cards/VX222.conf b/src/conf/cards/VX222.conf +index 3385f25b..2c6e2297 100644 +--- a/src/conf/cards/VX222.conf ++++ b/src/conf/cards/VX222.conf +@@ -4,7 +4,7 @@ + + + +-VX222.pcm.front.0 { ++VX222.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -15,7 +15,7 @@ VX222.pcm.front.0 { + + + +-VX222.pcm.iec958.0 { ++VX222.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +diff --git a/src/conf/cards/VXPocket.conf b/src/conf/cards/VXPocket.conf +index fe44ff53..90b13347 100644 +--- a/src/conf/cards/VXPocket.conf ++++ b/src/conf/cards/VXPocket.conf +@@ -4,7 +4,7 @@ + + + +-VXPocket.pcm.front.0 { ++VXPocket.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -15,7 +15,7 @@ VXPocket.pcm.front.0 { + + + +-VXPocket.pcm.iec958.0 { ++VXPocket.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +diff --git a/src/conf/cards/VXPocket440.conf b/src/conf/cards/VXPocket440.conf +index 197c2d6c..87a0855a 100644 +--- a/src/conf/cards/VXPocket440.conf ++++ b/src/conf/cards/VXPocket440.conf +@@ -4,7 +4,7 @@ + + + +-VXPocket440.pcm.front.0 { ++VXPocket440.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -15,7 +15,7 @@ VXPocket440.pcm.front.0 { + + + +-VXPocket440.pcm.rear.0 { ++VXPocket440.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -27,7 +27,7 @@ VXPocket440.pcm.rear.0 { + + + +-VXPocket440.pcm.surround40.0 { ++VXPocket440.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -64,7 +64,7 @@ VXPocket440.pcm.surround40.0 { + + + +-VXPocket440.pcm.iec958.0 { ++VXPocket440.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From 29fa26b4b5e0d3b7ab539b38d6604d83430bf70b Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:18:22 +0100 +Subject: [PATCH 41/43] conf: YMF744: define pcm configuration block only one + time + +There may be multiple YMF744 soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/YMF744.conf | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/conf/cards/YMF744.conf b/src/conf/cards/YMF744.conf +index 84dbcbec..ad1f2132 100644 +--- a/src/conf/cards/YMF744.conf ++++ b/src/conf/cards/YMF744.conf +@@ -4,7 +4,7 @@ + + + +-YMF744.pcm.front.0 { ++YMF744.pcm.front.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -15,7 +15,7 @@ YMF744.pcm.front.0 { + + + +-YMF744.pcm.rear.0 { ++YMF744.pcm.rear.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -27,7 +27,7 @@ YMF744.pcm.rear.0 { + + + +-YMF744.pcm.surround40.0 { ++YMF744.pcm.surround40.!0 { + @args [ CARD ] + @args.CARD { + type string +@@ -63,7 +63,7 @@ YMF744.pcm.surround40.0 { + + + +-YMF744.pcm.iec958.0 { ++YMF744.pcm.iec958.!0 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { + type string +-- +2.51.1 + + +From 17ffe17f0356f333f8bf8734a02ab419bd19cd99 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:25:34 +0100 +Subject: [PATCH 42/43] conf: pistachio-card: define pcm configuration block + only one time + +There may be multiple pistachio-card soundcards in the system. Overwrite +the PCM configurations when loaded multiple times. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/pistachio-card.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/conf/cards/pistachio-card.conf b/src/conf/cards/pistachio-card.conf +index f68865eb..15cfd60b 100644 +--- a/src/conf/cards/pistachio-card.conf ++++ b/src/conf/cards/pistachio-card.conf +@@ -29,7 +29,7 @@ https://docs.creatordev.io/ci40/guides/hardwaredocs/MIPS_Creator_cXT200_Technica + # Subdevice #0: subdevice #0 + # + +-pistachio-card.pcm.default{ ++pistachio-card.pcm.!default { + @args [ CARD ] + @args.CARD { + type string +-- +2.51.1 + + +From f30c355278cf9c86420b49ab9efc7eee890b658c Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 10 Dec 2025 16:44:12 +0100 +Subject: [PATCH 43/43] conf: cards: unify whitespace - use tabs and remove + trailing spaces + +Convert leading spaces to tabs for consistent indentation, +remove trailing whitespace from all lines, and normalize +file endings across all card configuration files. + +Signed-off-by: Jaroslav Kysela +--- + src/conf/cards/AACI.conf | 2 +- + src/conf/cards/ATIIXP-SPDMA.conf | 2 +- + src/conf/cards/ATIIXP.conf | 2 +- + src/conf/cards/AU8810.conf | 2 +- + src/conf/cards/AU8820.conf | 2 +- + src/conf/cards/AU8830.conf | 2 +- + src/conf/cards/Audigy.conf | 6 +- + src/conf/cards/Audigy2.conf | 4 +- + src/conf/cards/Aureon51.conf | 8 +- + src/conf/cards/Aureon71.conf | 8 +- + src/conf/cards/CA0106.conf | 8 +- + src/conf/cards/CMI8338-SWIEC.conf | 2 +- + src/conf/cards/CMI8338.conf | 2 +- + src/conf/cards/CMI8738-MC6.conf | 6 +- + src/conf/cards/CMI8738-MC8.conf | 8 +- + src/conf/cards/CMI8788.conf | 8 +- + src/conf/cards/CS46xx.conf | 6 +- + src/conf/cards/EMU10K1.conf | 6 +- + src/conf/cards/EMU10K1X.conf | 6 +- + src/conf/cards/ENS1370.conf | 4 +- + src/conf/cards/ENS1371.conf | 10 +-- + src/conf/cards/ES1968.conf | 2 +- + src/conf/cards/FM801.conf | 2 +- + src/conf/cards/GUS.conf | 2 +- + src/conf/cards/HDA-Intel.conf | 2 +- + src/conf/cards/ICE1712.conf | 4 +- + src/conf/cards/ICE1724.conf | 10 +-- + src/conf/cards/ICH.conf | 2 +- + src/conf/cards/ICH4.conf | 2 +- + src/conf/cards/Loopback.conf | 2 +- + src/conf/cards/Maestro3.conf | 3 +- + src/conf/cards/NFORCE.conf | 138 ++++++++++++++--------------- + src/conf/cards/PC-Speaker.conf | 3 +- + src/conf/cards/PMac.conf | 2 +- + src/conf/cards/PMacToonie.conf | 2 +- + src/conf/cards/PS3.conf | 6 +- + src/conf/cards/RME9636.conf | 2 +- + src/conf/cards/RME9652.conf | 2 +- + src/conf/cards/SB-XFi.conf | 8 +- + src/conf/cards/SI7018.conf | 6 +- + src/conf/cards/TRID4DWAVENX.conf | 4 +- + src/conf/cards/USB-Audio.conf | 2 +- + src/conf/cards/VIA686A.conf | 2 +- + src/conf/cards/VIA8233.conf | 2 +- + src/conf/cards/VIA8233A.conf | 2 +- + src/conf/cards/VIA8237.conf | 2 +- + src/conf/cards/VX222.conf | 2 +- + src/conf/cards/VXPocket.conf | 2 +- + src/conf/cards/VXPocket440.conf | 2 +- + src/conf/cards/YMF744.conf | 4 +- + src/conf/cards/pistachio-card.conf | 54 +++++------ + 51 files changed, 190 insertions(+), 192 deletions(-) + +diff --git a/src/conf/cards/AACI.conf b/src/conf/cards/AACI.conf +index ff4778b4..2f036dd6 100644 +--- a/src/conf/cards/AACI.conf ++++ b/src/conf/cards/AACI.conf +@@ -11,7 +11,7 @@ AACI.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + + +diff --git a/src/conf/cards/ATIIXP-SPDMA.conf b/src/conf/cards/ATIIXP-SPDMA.conf +index 12c40efc..6d7344e8 100644 +--- a/src/conf/cards/ATIIXP-SPDMA.conf ++++ b/src/conf/cards/ATIIXP-SPDMA.conf +@@ -11,7 +11,7 @@ ATIIXP-SPDMA.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + # default with dmix/dsnoop + ATIIXP.pcm.!default { +diff --git a/src/conf/cards/ATIIXP.conf b/src/conf/cards/ATIIXP.conf +index 13e01c48..d2736c3c 100644 +--- a/src/conf/cards/ATIIXP.conf ++++ b/src/conf/cards/ATIIXP.conf +@@ -11,7 +11,7 @@ ATIIXP.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + # default with dmix/dsnoop + ATIIXP.pcm.!default { +diff --git a/src/conf/cards/AU8810.conf b/src/conf/cards/AU8810.conf +index 6b596b68..46de6dbc 100644 +--- a/src/conf/cards/AU8810.conf ++++ b/src/conf/cards/AU8810.conf +@@ -11,7 +11,7 @@ AU8810.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + + +diff --git a/src/conf/cards/AU8820.conf b/src/conf/cards/AU8820.conf +index fe2cbc11..8e262a6f 100644 +--- a/src/conf/cards/AU8820.conf ++++ b/src/conf/cards/AU8820.conf +@@ -11,4 +11,4 @@ AU8820.pcm.front.!0 { + } + type hw + card $CARD +-} ++} +diff --git a/src/conf/cards/AU8830.conf b/src/conf/cards/AU8830.conf +index 9cd78b3e..a31d8a57 100644 +--- a/src/conf/cards/AU8830.conf ++++ b/src/conf/cards/AU8830.conf +@@ -11,7 +11,7 @@ AU8830.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + + +diff --git a/src/conf/cards/Audigy.conf b/src/conf/cards/Audigy.conf +index a353c624..d2b54d3b 100644 +--- a/src/conf/cards/Audigy.conf ++++ b/src/conf/cards/Audigy.conf +@@ -36,7 +36,7 @@ Audigy.pcm.front.!0 { + } + ] + } +-} ++} + + + +@@ -64,7 +64,7 @@ Audigy.pcm.rear.!0 { + } + ] + } +-} ++} + + + +@@ -100,7 +100,7 @@ Audigy.pcm.center_lfe.!0 { + } + ] + } +-} ++} + + + +diff --git a/src/conf/cards/Audigy2.conf b/src/conf/cards/Audigy2.conf +index 3c15fd1d..47d75680 100644 +--- a/src/conf/cards/Audigy2.conf ++++ b/src/conf/cards/Audigy2.conf +@@ -37,7 +37,7 @@ Audigy2.pcm.front.!0 { + + ] + } +-} ++} + + + +@@ -65,7 +65,7 @@ Audigy2.pcm.rear.!0 { + } + ] + } +-} ++} + + + +diff --git a/src/conf/cards/Aureon51.conf b/src/conf/cards/Aureon51.conf +index db907f82..da7e26dc 100644 +--- a/src/conf/cards/Aureon51.conf ++++ b/src/conf/cards/Aureon51.conf +@@ -34,7 +34,7 @@ Aureon51.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + + +@@ -47,7 +47,7 @@ Aureon51.pcm.rear.!0 { + card $CARD + device 2 + subdevice 1 +-} ++} + + + +@@ -59,7 +59,7 @@ Aureon51.pcm.center_lfe.!0 { + type hw + card $CARD + device 2 +-} ++} + + + +@@ -84,7 +84,7 @@ Aureon51.pcm.surround40.!0 { + type hw + card $CARD + channels 4 +-} ++} + + + +diff --git a/src/conf/cards/Aureon71.conf b/src/conf/cards/Aureon71.conf +index f29bc297..98e65ab0 100644 +--- a/src/conf/cards/Aureon71.conf ++++ b/src/conf/cards/Aureon71.conf +@@ -34,7 +34,7 @@ Aureon71.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + + +@@ -46,7 +46,7 @@ Aureon71.pcm.rear.!0 { + type hw + card $CARD + device 2 +-} ++} + + + +@@ -59,7 +59,7 @@ Aureon71.pcm.center_lfe.!0 { + card $CARD + device 2 + subdevice 1 +-} ++} + + + +@@ -84,7 +84,7 @@ Aureon71.pcm.surround40.!0 { + type hw + card $CARD + channels 4 +-} ++} + + + +diff --git a/src/conf/cards/CA0106.conf b/src/conf/cards/CA0106.conf +index 1fea79f5..bf90c3c6 100644 +--- a/src/conf/cards/CA0106.conf ++++ b/src/conf/cards/CA0106.conf +@@ -34,7 +34,7 @@ CA0106.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + + +@@ -46,7 +46,7 @@ CA0106.pcm.rear.!0 { + type hw + card $CARD + device 1 +-} ++} + + + +@@ -58,7 +58,7 @@ CA0106.pcm.center_lfe.!0 { + type hw + card $CARD + device 2 +-} ++} + + + +@@ -70,7 +70,7 @@ CA0106.pcm.side.!0 { + type hw + card $CARD + device 3 +-} ++} + + + +diff --git a/src/conf/cards/CMI8338-SWIEC.conf b/src/conf/cards/CMI8338-SWIEC.conf +index ca86c466..2a9b777c 100644 +--- a/src/conf/cards/CMI8338-SWIEC.conf ++++ b/src/conf/cards/CMI8338-SWIEC.conf +@@ -12,7 +12,7 @@ CMI8338-SWIEC.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + # default with dmix/dsnoop + CMI8338-SWIEC.pcm.!default { +diff --git a/src/conf/cards/CMI8338.conf b/src/conf/cards/CMI8338.conf +index 0f92ad0b..8bd1159d 100644 +--- a/src/conf/cards/CMI8338.conf ++++ b/src/conf/cards/CMI8338.conf +@@ -11,7 +11,7 @@ CMI8338.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + # default with dmix/dsnoop + CMI8338.pcm.!default { +diff --git a/src/conf/cards/CMI8738-MC6.conf b/src/conf/cards/CMI8738-MC6.conf +index 2b1c7d05..6bb17712 100644 +--- a/src/conf/cards/CMI8738-MC6.conf ++++ b/src/conf/cards/CMI8738-MC6.conf +@@ -11,7 +11,7 @@ CMI8738-MC6.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + # default with dmix/dsnoop + CMI8738-MC6.pcm.!default { +@@ -75,7 +75,7 @@ CMI8738-MC6.pcm.surround40.!0 { + } + ] + } +-} ++} + + + +@@ -105,7 +105,7 @@ CMI8738-MC6.pcm.surround51.!0 { + } + ] + } +-} ++} + + + +diff --git a/src/conf/cards/CMI8738-MC8.conf b/src/conf/cards/CMI8738-MC8.conf +index 96cb3f10..239014d4 100644 +--- a/src/conf/cards/CMI8738-MC8.conf ++++ b/src/conf/cards/CMI8738-MC8.conf +@@ -18,7 +18,7 @@ CMI8738-MC8.pcm.front.!0 { + name "PCM Playback Volume" + card $CARD + } +-} ++} + + # default with dmix+softvol & dsnoop + CMI8738-MC8.pcm.!default { +@@ -102,7 +102,7 @@ CMI8738-MC8.pcm.surround40.!0 { + name "PCM Playback Volume" + card $CARD + } +-} ++} + + + +@@ -140,7 +140,7 @@ CMI8738-MC8.pcm.surround51.!0 { + name "PCM Playback Volume" + card $CARD + } +-} ++} + + + +@@ -174,7 +174,7 @@ CMI8738-MC8.pcm.surround71.!0 { + name "PCM Playback Volume" + card $CARD + } +-} ++} + + + +diff --git a/src/conf/cards/CMI8788.conf b/src/conf/cards/CMI8788.conf +index c4ad9f48..32ab8fb4 100644 +--- a/src/conf/cards/CMI8788.conf ++++ b/src/conf/cards/CMI8788.conf +@@ -11,7 +11,7 @@ CMI8788.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + # default with dmix & dsnoop + CMI8788.pcm.!default { +@@ -46,7 +46,7 @@ CMI8788.pcm.surround40.!0 { + type hw + card $CARD + channels 4 +-} ++} + + + +@@ -61,7 +61,7 @@ CMI8788.pcm.surround51.!0 { + type hw + card $CARD + channels 6 +-} ++} + + + +@@ -73,7 +73,7 @@ CMI8788.pcm.surround71.!0 { + type hw + card $CARD + channels 8 +-} ++} + + + +diff --git a/src/conf/cards/CS46xx.conf b/src/conf/cards/CS46xx.conf +index 478cbf3e..ad6a2218 100644 +--- a/src/conf/cards/CS46xx.conf ++++ b/src/conf/cards/CS46xx.conf +@@ -11,7 +11,7 @@ CS46xx.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + # default with plughw + # CS46xx supports multi-playback +@@ -62,7 +62,7 @@ CS46xx.pcm.rear.!0 { + } + ] + } +-} ++} + + + +@@ -74,7 +74,7 @@ CS46xx.pcm.center_lfe.!0 { + type hw + card $CARD + device 3 +-} ++} + + + +diff --git a/src/conf/cards/EMU10K1.conf b/src/conf/cards/EMU10K1.conf +index 5ef12c03..c2dc7590 100644 +--- a/src/conf/cards/EMU10K1.conf ++++ b/src/conf/cards/EMU10K1.conf +@@ -43,7 +43,7 @@ EMU10K1.pcm.front.!0 { + type hw + card $CARD + } +-} ++} + + + +@@ -74,7 +74,7 @@ EMU10K1.pcm.rear.!0 { + ] + } + } +-} ++} + + + +@@ -139,7 +139,7 @@ EMU10K1.pcm.center_lfe.!0 { + ] + } + } +-} ++} + + + +diff --git a/src/conf/cards/EMU10K1X.conf b/src/conf/cards/EMU10K1X.conf +index 334f897d..7d73ba44 100644 +--- a/src/conf/cards/EMU10K1X.conf ++++ b/src/conf/cards/EMU10K1X.conf +@@ -34,7 +34,7 @@ EMU10K1X.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + + +@@ -46,7 +46,7 @@ EMU10K1X.pcm.rear.!0 { + type hw + card $CARD + device 1 +-} ++} + + + +@@ -58,7 +58,7 @@ EMU10K1X.pcm.center_lfe.!0 { + type hw + card $CARD + device 2 +-} ++} + + + +diff --git a/src/conf/cards/ENS1370.conf b/src/conf/cards/ENS1370.conf +index c65e224f..446c2f7d 100644 +--- a/src/conf/cards/ENS1370.conf ++++ b/src/conf/cards/ENS1370.conf +@@ -12,7 +12,7 @@ ENS1370.pcm.front.!0 { + type hw + card $CARD + device 1 +-} ++} + + # default with dmix/dsnoop + ENS1370.pcm.!default { +@@ -67,7 +67,7 @@ ENS1370.pcm.rear.!0 { + } + ] + } +-} ++} + + + +diff --git a/src/conf/cards/ENS1371.conf b/src/conf/cards/ENS1371.conf +index 560fda9f..549fd7c9 100644 +--- a/src/conf/cards/ENS1371.conf ++++ b/src/conf/cards/ENS1371.conf +@@ -11,7 +11,7 @@ ENS1371.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + # default with dmix/dsnoop + ENS1371.pcm.!default { +@@ -61,7 +61,7 @@ ENS1371.pcm.rear.!0 { + } + ] + } +-} ++} + + + +@@ -78,11 +78,11 @@ ENS1371.pcm.surround40.!0 { + strings [ "cards.ENS1371.pcm.front.0:CARD=" $CARD ] + } + channels 2 +- } ++ } + { + pcm { + @func concat +- strings [ "cards.ENS1371.pcm.rear.0:CARD=" $CARD ] ++ strings [ "cards.ENS1371.pcm.rear.0:CARD=" $CARD ] + } + channels 2 + } +@@ -94,7 +94,7 @@ ENS1371.pcm.surround40.!0 { + { slave 1 channel 1 } + ] + } +- ++ + + + ENS1371.pcm.iec958.!0 { +diff --git a/src/conf/cards/ES1968.conf b/src/conf/cards/ES1968.conf +index 296baa13..83dcf93b 100644 +--- a/src/conf/cards/ES1968.conf ++++ b/src/conf/cards/ES1968.conf +@@ -9,4 +9,4 @@ ES1968.pcm.front.!0 { + } + type hw + card $CARD +-} ++} +diff --git a/src/conf/cards/FM801.conf b/src/conf/cards/FM801.conf +index 14cfdbe8..b8bed781 100644 +--- a/src/conf/cards/FM801.conf ++++ b/src/conf/cards/FM801.conf +@@ -11,7 +11,7 @@ FM801.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + # default with dmix/dsnoop + FM801.pcm.!default { +diff --git a/src/conf/cards/GUS.conf b/src/conf/cards/GUS.conf +index a1ccd0e9..42a612a6 100644 +--- a/src/conf/cards/GUS.conf ++++ b/src/conf/cards/GUS.conf +@@ -16,4 +16,4 @@ GUS.pcm.front.!0 { + type hw + card $CARD + } +-} ++} +diff --git a/src/conf/cards/HDA-Intel.conf b/src/conf/cards/HDA-Intel.conf +index 76775b97..cacd2815 100644 +--- a/src/conf/cards/HDA-Intel.conf ++++ b/src/conf/cards/HDA-Intel.conf +@@ -26,7 +26,7 @@ HDA-Intel.pcm.front.!0 { + type hw + card $CARD + } +-} ++} + + # default with dmix+softvol & dsnoop + HDA-Intel.pcm.!default { +diff --git a/src/conf/cards/ICE1712.conf b/src/conf/cards/ICE1712.conf +index 190d2c59..08b84f30 100644 +--- a/src/conf/cards/ICE1712.conf ++++ b/src/conf/cards/ICE1712.conf +@@ -53,7 +53,7 @@ ICE1712.pcm.front.!0 { + } + slave.channels 12 + } +-} ++} + + + +@@ -72,7 +72,7 @@ ICE1712.pcm.surround40.!0 { + card $CARD + } + slave.channels 10 +-} ++} + + + +diff --git a/src/conf/cards/ICE1724.conf b/src/conf/cards/ICE1724.conf +index 16045dc4..678df41d 100644 +--- a/src/conf/cards/ICE1724.conf ++++ b/src/conf/cards/ICE1724.conf +@@ -34,7 +34,7 @@ ICE1724.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + + +@@ -47,7 +47,7 @@ ICE1724.pcm.rear.!0 { + card $CARD + device 2 + subdevice 1 +-} ++} + + + +@@ -59,7 +59,7 @@ ICE1724.pcm.center_lfe.!0 { + type hw + card $CARD + device 2 +-} ++} + + + +@@ -93,7 +93,7 @@ ICE1724.pcm.surround40.!0 { + card $CARD + } + } +-} ++} + + + +@@ -114,7 +114,7 @@ ICE1724.pcm.surround51.!0 { + ttable.5.3 1 + slave { + channels 6 +- pcm { ++ pcm { + type hw + card $CARD + } +diff --git a/src/conf/cards/ICH.conf b/src/conf/cards/ICH.conf +index c35c8d02..573b9e26 100644 +--- a/src/conf/cards/ICH.conf ++++ b/src/conf/cards/ICH.conf +@@ -18,7 +18,7 @@ ICH.pcm.front.!0 { + name "PCM Playback Volume" + card $CARD + } +-} ++} + + # default with dmix+softvol & dsnoop + ICH.pcm.!default { +diff --git a/src/conf/cards/ICH4.conf b/src/conf/cards/ICH4.conf +index 11c85a6e..5641c9c4 100644 +--- a/src/conf/cards/ICH4.conf ++++ b/src/conf/cards/ICH4.conf +@@ -18,7 +18,7 @@ ICH4.pcm.front.!0 { + name "PCM Playback Volume" + card $CARD + } +-} ++} + + # default with dmix+softvol & dsnoop + ICH4.pcm.!default { +diff --git a/src/conf/cards/Loopback.conf b/src/conf/cards/Loopback.conf +index 21c8429c..3911aed5 100644 +--- a/src/conf/cards/Loopback.conf ++++ b/src/conf/cards/Loopback.conf +@@ -18,7 +18,7 @@ Loopback.pcm.front.!0 { + name "PCM Playback Volume" + card $CARD + } +-} ++} + + # default with dmix+softvol & dsnoop + Loopback.pcm.!default { +diff --git a/src/conf/cards/Maestro3.conf b/src/conf/cards/Maestro3.conf +index a8d89a48..c0e3da31 100644 +--- a/src/conf/cards/Maestro3.conf ++++ b/src/conf/cards/Maestro3.conf +@@ -9,7 +9,7 @@ Maestro3.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + # default with dmix/dsnoop + Maestro3.pcm.!default { +@@ -35,4 +35,3 @@ Maestro3.pcm.!default { + } + } + } +- +diff --git a/src/conf/cards/NFORCE.conf b/src/conf/cards/NFORCE.conf +index 088cd8ce..aeef6b40 100644 +--- a/src/conf/cards/NFORCE.conf ++++ b/src/conf/cards/NFORCE.conf +@@ -18,7 +18,7 @@ NFORCE.pcm.front.!0 { + name "PCM Playback Volume" + card $CARD + } +-} ++} + + # default with dmix+softvol & dsnoop + NFORCE.pcm.!default { +@@ -175,74 +175,74 @@ NFORCE.pcm.surround51.!0 { + + + NFORCE.pcm.surround71.!0 { +- @args [ CARD ] +- @args.CARD { +- type string +- } +- type softvol +- slave.pcm { +- type route +- ttable.0.0 1 +- ttable.1.1 1 +- ttable.2.4 1 +- ttable.3.5 1 +- ttable.4.2 1 +- ttable.5.3 1 +- ttable.6.6 1 +- ttable.7.7 1 +- slave.pcm { +- type hooks +- slave.pcm { +- type hw +- card $CARD +- device 0 +- } +- hooks.0 { +- type ctl_elems +- hook_args [ +- { +- name "Channel Mode" +- preserve true +- value "8ch" +- lock true +- optional true +- } +- # for old drivers +- { +- name "Line-In As Surround" +- preserve true +- value true +- optional true +- } +- { +- name "Mic As Center/LFE" +- preserve true +- value true +- optional true +- } +- { +- name "Surround Down Mix" +- preserve true +- value off +- lock true +- optional true +- } +- { +- name "Center/LFE Down Mix" +- preserve true +- value off +- lock true +- optional true +- } +- ] +- } +- } +- slave.channels 8 +- } +- control { +- name "PCM Playback Volume" +- card $CARD +- } ++ @args [ CARD ] ++ @args.CARD { ++ type string ++ } ++ type softvol ++ slave.pcm { ++ type route ++ ttable.0.0 1 ++ ttable.1.1 1 ++ ttable.2.4 1 ++ ttable.3.5 1 ++ ttable.4.2 1 ++ ttable.5.3 1 ++ ttable.6.6 1 ++ ttable.7.7 1 ++ slave.pcm { ++ type hooks ++ slave.pcm { ++ type hw ++ card $CARD ++ device 0 ++ } ++ hooks.0 { ++ type ctl_elems ++ hook_args [ ++ { ++ name "Channel Mode" ++ preserve true ++ value "8ch" ++ lock true ++ optional true ++ } ++ # for old drivers ++ { ++ name "Line-In As Surround" ++ preserve true ++ value true ++ optional true ++ } ++ { ++ name "Mic As Center/LFE" ++ preserve true ++ value true ++ optional true ++ } ++ { ++ name "Surround Down Mix" ++ preserve true ++ value off ++ lock true ++ optional true ++ } ++ { ++ name "Center/LFE Down Mix" ++ preserve true ++ value off ++ lock true ++ optional true ++ } ++ ] ++ } ++ } ++ slave.channels 8 ++ } ++ control { ++ name "PCM Playback Volume" ++ card $CARD ++ } + } + + +diff --git a/src/conf/cards/PC-Speaker.conf b/src/conf/cards/PC-Speaker.conf +index 8a40a139..97cb0d5d 100644 +--- a/src/conf/cards/PC-Speaker.conf ++++ b/src/conf/cards/PC-Speaker.conf +@@ -20,7 +20,7 @@ PC-Speaker.pcm.front.!0 { + } + min_dB -10.0 + max_dB 20.0 +-} ++} + + # default with dmix & null + PC-Speaker.pcm.!default { +@@ -49,4 +49,3 @@ PC-Speaker.pcm.!default { + type null + } + } +- +diff --git a/src/conf/cards/PMac.conf b/src/conf/cards/PMac.conf +index 00f3bc89..67dfabc6 100644 +--- a/src/conf/cards/PMac.conf ++++ b/src/conf/cards/PMac.conf +@@ -11,7 +11,7 @@ PMac.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + # default with dmix/dsnoop + PMac.pcm.!default { +diff --git a/src/conf/cards/PMacToonie.conf b/src/conf/cards/PMacToonie.conf +index aff1ea65..c45cf12b 100644 +--- a/src/conf/cards/PMacToonie.conf ++++ b/src/conf/cards/PMacToonie.conf +@@ -18,7 +18,7 @@ PMacToonie.pcm.front.!0 { + name "PCM Playback Volume" + card $CARD + } +-} ++} + + # default with dmix+softvol & dsnoop + PMacToonie.pcm.!default { +diff --git a/src/conf/cards/PS3.conf b/src/conf/cards/PS3.conf +index 486d790c..8a165fc3 100644 +--- a/src/conf/cards/PS3.conf ++++ b/src/conf/cards/PS3.conf +@@ -19,7 +19,7 @@ PS3.pcm.front.!0 { + name "PCM Playback Volume" + card $CARD + } +-} ++} + + # default with dmix+softvol + PS3.pcm.!default { +@@ -34,8 +34,8 @@ PS3.pcm.!default { + type softvol + slave.pcm { + @func concat +- #strings [ "dmix:CARD=" $CARD ] +- strings [ "dmix:CARD=" $CARD ",FORMAT=S16" ] ++ #strings [ "dmix:CARD=" $CARD ] ++ strings [ "dmix:CARD=" $CARD ",FORMAT=S16" ] + } + control { + name "PCM Playback Volume" +diff --git a/src/conf/cards/RME9636.conf b/src/conf/cards/RME9636.conf +index 17b3a1ab..c5c74ee9 100644 +--- a/src/conf/cards/RME9636.conf ++++ b/src/conf/cards/RME9636.conf +@@ -11,7 +11,7 @@ RME9636.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + # FIXME: This configuration is not valid for double-speed rates. + +diff --git a/src/conf/cards/RME9652.conf b/src/conf/cards/RME9652.conf +index a11e42b2..34ef91bb 100644 +--- a/src/conf/cards/RME9652.conf ++++ b/src/conf/cards/RME9652.conf +@@ -11,7 +11,7 @@ RME9652.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + # FIXME: This configuration is not valid for double-speed rates. + +diff --git a/src/conf/cards/SB-XFi.conf b/src/conf/cards/SB-XFi.conf +index 9ce9c8ac..64e3d082 100644 +--- a/src/conf/cards/SB-XFi.conf ++++ b/src/conf/cards/SB-XFi.conf +@@ -12,7 +12,7 @@ SB-XFi.pcm.front.!0 { + type hw + card $CARD + device 0 +-} ++} + + + +@@ -25,7 +25,7 @@ SB-XFi.pcm.rear.!0 { + card $CARD + device 1 + hint.device 1 +-} ++} + + + +@@ -38,7 +38,7 @@ SB-XFi.pcm.center_lfe.!0 { + card $CARD + device 2 + hint.device 2 +-} ++} + + + +@@ -51,7 +51,7 @@ SB-XFi.pcm.side.!0 { + card $CARD + device 3 + hint.device 3 +-} ++} + + + +diff --git a/src/conf/cards/SI7018.conf b/src/conf/cards/SI7018.conf +index 33d19085..3a22107c 100644 +--- a/src/conf/cards/SI7018.conf ++++ b/src/conf/cards/SI7018.conf +@@ -14,7 +14,7 @@ SI7018.pcm.front.!0 { + type hw + card $CARD + chmap [ "UNKNOWN" "FL,FR" ] +-} ++} + + + +@@ -23,7 +23,7 @@ SI7018.pcm.rear.!0 { + @args.CARD { + type string + } +- type hooks ++ type hooks + slave.pcm { + type hw + card $CARD +@@ -40,7 +40,7 @@ SI7018.pcm.rear.!0 { + } + ] + } +-} ++} + + + +diff --git a/src/conf/cards/TRID4DWAVENX.conf b/src/conf/cards/TRID4DWAVENX.conf +index 5001297e..3c25515e 100644 +--- a/src/conf/cards/TRID4DWAVENX.conf ++++ b/src/conf/cards/TRID4DWAVENX.conf +@@ -12,7 +12,7 @@ TRID4DWAVENX.pcm.front.!0 { + type hw + card $CARD + chmap [ "UNKNOWN" "FL,FR" ] +-} ++} + + + +@@ -52,7 +52,7 @@ TRID4DWAVENX.pcm.rear.!0 { + } + ] + } +-} ++} + + + +diff --git a/src/conf/cards/USB-Audio.conf b/src/conf/cards/USB-Audio.conf +index 1fc540e2..33d856f2 100644 +--- a/src/conf/cards/USB-Audio.conf ++++ b/src/conf/cards/USB-Audio.conf +@@ -47,7 +47,7 @@ USB-Audio.pcm.iec958_device { + "XONAR U5" 1 + "XONAR SOUND CARD" 1 + "Xonar SoundCard" 2 +- ++ + # The below don't have digital in/out, so prevent them from being opened. + "Andrea PureAudio USB-SA Headset" 999 + "Blue Snowball" 999 +diff --git a/src/conf/cards/VIA686A.conf b/src/conf/cards/VIA686A.conf +index c53dd71b..40c2f89e 100644 +--- a/src/conf/cards/VIA686A.conf ++++ b/src/conf/cards/VIA686A.conf +@@ -14,7 +14,7 @@ VIA686A.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + # default with dmix/dsnoop + VIA686A.pcm.!default { +diff --git a/src/conf/cards/VIA8233.conf b/src/conf/cards/VIA8233.conf +index 3c25a11b..ccc7fe2f 100644 +--- a/src/conf/cards/VIA8233.conf ++++ b/src/conf/cards/VIA8233.conf +@@ -11,7 +11,7 @@ VIA8233.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + # default with softvol/dsnoop + # VIA8233 supports multi-playback +diff --git a/src/conf/cards/VIA8233A.conf b/src/conf/cards/VIA8233A.conf +index c9e56e20..e566edeb 100644 +--- a/src/conf/cards/VIA8233A.conf ++++ b/src/conf/cards/VIA8233A.conf +@@ -11,7 +11,7 @@ VIA8233A.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + # default with dmix/dsnoop + VIA8233A.pcm.!default { +diff --git a/src/conf/cards/VIA8237.conf b/src/conf/cards/VIA8237.conf +index 49fd6f2c..074e342c 100644 +--- a/src/conf/cards/VIA8237.conf ++++ b/src/conf/cards/VIA8237.conf +@@ -11,7 +11,7 @@ VIA8237.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + # default with softvol/dsnoop + # VIA8237 supports multi-playback +diff --git a/src/conf/cards/VX222.conf b/src/conf/cards/VX222.conf +index 2c6e2297..96ea32f6 100644 +--- a/src/conf/cards/VX222.conf ++++ b/src/conf/cards/VX222.conf +@@ -11,7 +11,7 @@ VX222.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + + +diff --git a/src/conf/cards/VXPocket.conf b/src/conf/cards/VXPocket.conf +index 90b13347..81260a7d 100644 +--- a/src/conf/cards/VXPocket.conf ++++ b/src/conf/cards/VXPocket.conf +@@ -11,7 +11,7 @@ VXPocket.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + + +diff --git a/src/conf/cards/VXPocket440.conf b/src/conf/cards/VXPocket440.conf +index 87a0855a..6b3aea40 100644 +--- a/src/conf/cards/VXPocket440.conf ++++ b/src/conf/cards/VXPocket440.conf +@@ -11,7 +11,7 @@ VXPocket440.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + + +diff --git a/src/conf/cards/YMF744.conf b/src/conf/cards/YMF744.conf +index ad1f2132..974bf791 100644 +--- a/src/conf/cards/YMF744.conf ++++ b/src/conf/cards/YMF744.conf +@@ -11,7 +11,7 @@ YMF744.pcm.front.!0 { + } + type hw + card $CARD +-} ++} + + + +@@ -23,7 +23,7 @@ YMF744.pcm.rear.!0 { + type hw + card $CARD + device 2 +-} ++} + + + +diff --git a/src/conf/cards/pistachio-card.conf b/src/conf/cards/pistachio-card.conf +index 15cfd60b..d92c019a 100644 +--- a/src/conf/cards/pistachio-card.conf ++++ b/src/conf/cards/pistachio-card.conf +@@ -1,10 +1,10 @@ + # + # Configuration for the pistachio chip. + # +-# The data sheet of the chip and technical reference manual can be +-found at ++# The data sheet of the chip and technical reference manual can be ++found at + https://docs.creatordev.io/ci40/guides/hardwaredocs/cXT200_datasheet2.p +-df # and ++df # and + https://docs.creatordev.io/ci40/guides/hardwaredocs/MIPS_Creator_cXT200_Technical_Reference_Manual_1.0.112.pdf. + # + # The list of hardware devices is as per below: +@@ -30,30 +30,30 @@ https://docs.creatordev.io/ci40/guides/hardwaredocs/MIPS_Creator_cXT200_Technica + # + + pistachio-card.pcm.!default { +- @args [ CARD ] +- @args.CARD { +- type string +- default "pistachio" +- } +- @args.DEVICE { +- type integer +- default 2 +- } ++ @args [ CARD ] ++ @args.CARD { ++ type string ++ default "pistachio" ++ } ++ @args.DEVICE { ++ type integer ++ default 2 ++ } + +- type asym +- capture.pcm { +- type multi +- slaves.a.pcm "hw:0,4" +- slaves.a.channels 12 +- bindings.0.slave a +- bindings.0.channel 4 +- bindings.1.slave a +- bindings.1.channel 5 +- } ++ type asym ++ capture.pcm { ++ type multi ++ slaves.a.pcm "hw:0,4" ++ slaves.a.channels 12 ++ bindings.0.slave a ++ bindings.0.channel 4 ++ bindings.1.slave a ++ bindings.1.channel 5 ++ } + +- playback.pcm { +- type hw +- card $CARD +- device $DEVICE +- } ++ playback.pcm { ++ type hw ++ card $CARD ++ device $DEVICE ++ } + } +-- +2.51.1 + diff --git a/alsa-lib.spec b/alsa-lib.spec index e11c07f..f64c71c 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -9,7 +9,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 3%{?prever_dot}%{?dist} +Release: 4%{?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 10 2025 Jaroslav Kysela - 1.2.15-3 +* Wed Dec 10 2025 Jaroslav Kysela - 1.2.15-4 - update to 1.2.15 * Wed Jul 23 2025 Fedora Release Engineering - 1.2.14-4 From f26eb0d2f984346d2e5ecf1ed5ad2f26ba171308 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 19 Dec 2025 12:01:03 +0100 Subject: [PATCH 65/68] update to 1.2.15.1 Signed-off-by: Jaroslav Kysela --- alsa-git.patch | 4986 ------------------------------------------- alsa-lib.spec | 20 +- alsa-ucm-conf.patch | 264 --- sources | 4 +- 4 files changed, 19 insertions(+), 5255 deletions(-) delete mode 100644 alsa-git.patch delete mode 100644 alsa-ucm-conf.patch diff --git a/alsa-git.patch b/alsa-git.patch deleted file mode 100644 index b0fcde8..0000000 --- a/alsa-git.patch +++ /dev/null @@ -1,4986 +0,0 @@ -From a068cf08ad67447893b707cddfce31c9cafee643 Mon Sep 17 00:00:00 2001 -From: Mike Gilbert -Date: Mon, 8 Dec 2025 23:46:17 -0500 -Subject: [PATCH 01/43] 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. - -Also check for the function properly instead of assuming it is available -with _GNU_SOURCE defined. - -Closes: https://github.com/alsa-project/alsa-lib/pull/486 -Fixes: https://github.com/alsa-project/alsa-lib/issues/485 -Signed-off-by: Mike Gilbert -Signed-off-by: Jaroslav Kysela ---- - configure.ac | 1 + - src/ucm/ucm_exec.c | 4 ++-- - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 8f4bd0de..f4862f64 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -52,6 +52,7 @@ dnl Checks for library functions. - AC_PROG_GCC_TRADITIONAL - AC_CHECK_FUNCS([uselocale]) - AC_CHECK_FUNCS([eaccess]) -+AC_CHECK_DECLS([closefrom]) - - dnl Enable largefile support - AC_SYS_LARGEFILE -diff --git a/src/ucm/ucm_exec.c b/src/ucm/ucm_exec.c -index b5a22023..713039b4 100644 ---- a/src/ucm/ucm_exec.c -+++ b/src/ucm/ucm_exec.c -@@ -259,8 +259,8 @@ int uc_mgr_exec(const char *prog) - - close(f); - --#if defined(_GNU_SOURCE) -- close_range(3, maxfd, 0); -+#if HAVE_DECL_CLOSEFROM -+ closefrom(3); - #else - for (f = 3; f < maxfd; f++) - close(f); --- -2.51.1 - - -From 813ffe34ff6c720dcc56e4549338bf9e9184af1f Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 9 Dec 2025 17:48:34 +0100 -Subject: [PATCH 02/43] ucm: exec - fix maxfd used warning - -Fixes: a068cf08 ("ucm: use closefrom instead of close_range") -Signed-off-by: Jaroslav Kysela ---- - src/ucm/ucm_exec.c | 11 ++++++----- - 1 file changed, 6 insertions(+), 5 deletions(-) - -diff --git a/src/ucm/ucm_exec.c b/src/ucm/ucm_exec.c -index 713039b4..c16a4cfd 100644 ---- a/src/ucm/ucm_exec.c -+++ b/src/ucm/ucm_exec.c -@@ -183,7 +183,7 @@ static int parse_args(char ***argv, int argc, const char *cmd) - */ - int uc_mgr_exec(const char *prog) - { -- pid_t p, f, maxfd; -+ pid_t p, f; - int err = 0, status; - char bin[PATH_MAX]; - struct sigaction sa; -@@ -212,8 +212,6 @@ int uc_mgr_exec(const char *prog) - prog = bin; - } - -- maxfd = sysconf(_SC_OPEN_MAX); -- - /* - * block SIGCHLD signal - * ignore SIGINT and SIGQUIT in parent -@@ -262,8 +260,11 @@ int uc_mgr_exec(const char *prog) - #if HAVE_DECL_CLOSEFROM - closefrom(3); - #else -- for (f = 3; f < maxfd; f++) -- close(f); -+ { -+ pid_t maxfd = sysconf(_SC_OPEN_MAX); -+ for (f = 3; f < maxfd; f++) -+ close(f); -+ } - #endif - - /* install default handlers for the forked process */ --- -2.51.1 - - -From a6238053c4fa518b214f99d91a01b96c5ef6e3ca Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 9 Dec 2025 18:04:07 +0100 -Subject: [PATCH 03/43] conf: merge card specific contents per file (whole) - after parsing - -Unfortunately, mentioned fix caused a regression for items stored in one file. -Merge the file contents after parsing not inside parsing process. - -BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2420645 -Fixes: eda76146 ("conf: fix load_for_all_cards() - do not merge the card specific contents") -Signed-off-by: Jaroslav Kysela ---- - src/conf.c | 13 ++++++++++--- - 1 file changed, 10 insertions(+), 3 deletions(-) - -diff --git a/src/conf.c b/src/conf.c -index 49499ecd..b1ec9b38 100644 ---- a/src/conf.c -+++ b/src/conf.c -@@ -4119,14 +4119,21 @@ static int config_filename_filter(const struct dirent64 *dirent) - static int config_file_open(snd_config_t *root, const char *filename, int merge) - { - snd_input_t *in; -+ snd_config_t *top; - int err; - - err = snd_input_stdio_open(&in, filename, "r"); - if (err >= 0) { -- if (merge) -+ if (merge) { - err = snd_config_load(root, in); -- else -- err = snd_config_load_override(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); -+ } -+ } - snd_input_close(in); - if (err < 0) - snd_error(CORE, "%s may be old or corrupted: consider to remove or fix it", filename); --- -2.51.1 - - -From 2f59398c83b8065fb9ff58939df3a9187746068e Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Tue, 9 Dec 2025 18:39:52 +0100 -Subject: [PATCH 04/43] 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 ---- - 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 -Date: Wed, 10 Dec 2025 12:03:29 +0100 -Subject: [PATCH 05/43] 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 ---- - 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 -Date: Wed, 10 Dec 2025 12:12:47 +0100 -Subject: [PATCH 06/43] 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 ---- - 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 { - - - --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 { - - - --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 { - - - --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 { - - - --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 { - - - --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 -Date: Wed, 10 Dec 2025 12:12:47 +0100 -Subject: [PATCH 07/43] 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 ---- - 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 @@ - - - --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 - - - --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 { - - - --HDA-Intel.pcm.modem.0 { -+HDA-Intel.pcm.modem.!0 { - @args [ CARD ] - @args.CARD { - type string --- -2.51.1 - - -From d83af363f1fc17e2b3e7cf2a0f848722f6643a9a Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 12:12:47 +0100 -Subject: [PATCH 08/43] conf: vc4-hdmi: define pcm configuration block only one - time - -There may be multiple vc4-hdmi soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -BugLink: https://github.com/alsa-project/alsa-lib/issues/488 -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/vc4-hdmi.conf | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/conf/cards/vc4-hdmi.conf b/src/conf/cards/vc4-hdmi.conf -index 0f313d82..7041d185 100644 ---- a/src/conf/cards/vc4-hdmi.conf -+++ b/src/conf/cards/vc4-hdmi.conf -@@ -3,7 +3,7 @@ - # subframe conversion - # - --vc4-hdmi.pcm.hdmi.0 { -+vc4-hdmi.pcm.hdmi.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -@@ -50,7 +50,7 @@ vc4-hdmi.pcm.hdmi.0 { - } - - # default with plug and softvol --vc4-hdmi.pcm.default { -+vc4-hdmi.pcm.!default { - @args [ CARD ] - @args.CARD { - type string --- -2.51.1 - - -From 3969e458124f6933e2f440c2b0b39b29de791a78 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 12:12:47 +0100 -Subject: [PATCH 09/43] conf: AACI,ATIIXP: define pcm configuration block only - one time - -There may be multiple AACI,ATIIXP soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/AACI.conf | 4 ++-- - src/conf/cards/ATIIXP-MODEM.conf | 2 +- - src/conf/cards/ATIIXP-SPDMA.conf | 10 +++++----- - src/conf/cards/ATIIXP.conf | 10 +++++----- - 4 files changed, 13 insertions(+), 13 deletions(-) - -diff --git a/src/conf/cards/AACI.conf b/src/conf/cards/AACI.conf -index 748586a0..ff4778b4 100644 ---- a/src/conf/cards/AACI.conf -+++ b/src/conf/cards/AACI.conf -@@ -4,7 +4,7 @@ - - - --AACI.pcm.front.0 { -+AACI.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -19,7 +19,7 @@ AACI.pcm.surround40.0 "cards.AACI.pcm.front.0" - - - --AACI.pcm.surround51.0 { -+AACI.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -diff --git a/src/conf/cards/ATIIXP-MODEM.conf b/src/conf/cards/ATIIXP-MODEM.conf -index 6e52af05..1f69b735 100644 ---- a/src/conf/cards/ATIIXP-MODEM.conf -+++ b/src/conf/cards/ATIIXP-MODEM.conf -@@ -4,7 +4,7 @@ - - - --ATIIXP-MODEM.pcm.modem.0 { -+ATIIXP-MODEM.pcm.modem.!0 { - @args [ CARD ] - @args.CARD { - type string -diff --git a/src/conf/cards/ATIIXP-SPDMA.conf b/src/conf/cards/ATIIXP-SPDMA.conf -index 42540d68..12c40efc 100644 ---- a/src/conf/cards/ATIIXP-SPDMA.conf -+++ b/src/conf/cards/ATIIXP-SPDMA.conf -@@ -4,7 +4,7 @@ - - - --ATIIXP-SPDMA.pcm.front.0 { -+ATIIXP-SPDMA.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -14,7 +14,7 @@ ATIIXP-SPDMA.pcm.front.0 { - } - - # default with dmix/dsnoop --ATIIXP.pcm.default { -+ATIIXP.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -38,7 +38,7 @@ ATIIXP.pcm.default { - - - --ATIIXP-SPDMA.pcm.surround40.0 { -+ATIIXP-SPDMA.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -82,7 +82,7 @@ ATIIXP-SPDMA.pcm.surround40.0 { - - - --ATIIXP-SPDMA.pcm.surround51.0 { -+ATIIXP-SPDMA.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -136,7 +136,7 @@ ATIIXP-SPDMA.pcm.surround51.0 { - - - --ATIIXP-SPDMA.pcm.iec958.0 { -+ATIIXP-SPDMA.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -diff --git a/src/conf/cards/ATIIXP.conf b/src/conf/cards/ATIIXP.conf -index c4d33ef3..13e01c48 100644 ---- a/src/conf/cards/ATIIXP.conf -+++ b/src/conf/cards/ATIIXP.conf -@@ -4,7 +4,7 @@ - - - --ATIIXP.pcm.front.0 { -+ATIIXP.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -14,7 +14,7 @@ ATIIXP.pcm.front.0 { - } - - # default with dmix/dsnoop --ATIIXP.pcm.default { -+ATIIXP.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -38,7 +38,7 @@ ATIIXP.pcm.default { - - - --ATIIXP.pcm.surround40.0 { -+ATIIXP.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -82,7 +82,7 @@ ATIIXP.pcm.surround40.0 { - - - --ATIIXP.pcm.surround51.0 { -+ATIIXP.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -136,7 +136,7 @@ ATIIXP.pcm.surround51.0 { - - - --ATIIXP.pcm.iec958.0 { -+ATIIXP.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From e5dbefdff1254fb66ffa82983c6fed08ba8e37df Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 12:12:47 +0100 -Subject: [PATCH 10/43] conf: Audigy: define pcm configuration block only one - time - -There may be multiple Audigy soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/Audigy.conf | 12 ++++++------ - src/conf/cards/Audigy2.conf | 16 ++++++++-------- - 2 files changed, 14 insertions(+), 14 deletions(-) - -diff --git a/src/conf/cards/Audigy.conf b/src/conf/cards/Audigy.conf -index 42692cfd..a353c624 100644 ---- a/src/conf/cards/Audigy.conf -+++ b/src/conf/cards/Audigy.conf -@@ -4,7 +4,7 @@ - - - --Audigy.pcm.front.0 { -+Audigy.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -40,7 +40,7 @@ Audigy.pcm.front.0 { - - - --Audigy.pcm.rear.0 { -+Audigy.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -68,7 +68,7 @@ Audigy.pcm.rear.0 { - - - --Audigy.pcm.center_lfe.0 { -+Audigy.pcm.center_lfe.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -107,7 +107,7 @@ Audigy.pcm.center_lfe.0 { - - - --Audigy.pcm.surround40.0 { -+Audigy.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -143,7 +143,7 @@ Audigy.pcm.surround40.0 { - - - --Audigy.pcm.surround51.0 { -+Audigy.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -190,7 +190,7 @@ Audigy.pcm.surround51.0 { - - - --Audigy.pcm.iec958.0 { -+Audigy.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -diff --git a/src/conf/cards/Audigy2.conf b/src/conf/cards/Audigy2.conf -index 35126d23..3c15fd1d 100644 ---- a/src/conf/cards/Audigy2.conf -+++ b/src/conf/cards/Audigy2.conf -@@ -4,7 +4,7 @@ - - - --Audigy2.pcm.front.0 { -+Audigy2.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -41,7 +41,7 @@ Audigy2.pcm.front.0 { - - - --Audigy2.pcm.rear.0 { -+Audigy2.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -69,7 +69,7 @@ Audigy2.pcm.rear.0 { - - - --Audigy2.pcm.center_lfe.0 { -+Audigy2.pcm.center_lfe.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -105,7 +105,7 @@ Audigy2.pcm.center_lfe.0 { - - - --Audigy2.pcm.side.0 { -+Audigy2.pcm.side.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -144,7 +144,7 @@ Audigy2.pcm.side.0 { - - - --Audigy2.pcm.surround40.0 { -+Audigy2.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -180,7 +180,7 @@ Audigy2.pcm.surround40.0 { - - - --Audigy2.pcm.surround51.0 { -+Audigy2.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -227,7 +227,7 @@ Audigy2.pcm.surround51.0 { - - - --Audigy2.pcm.surround71.0 { -+Audigy2.pcm.surround71.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -285,7 +285,7 @@ Audigy2.pcm.surround71.0 { - - - --Audigy2.pcm.iec958.0 { -+Audigy2.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From 7079887cd21077fe9569a0d910b11e40f7e5153d Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 12:12:47 +0100 -Subject: [PATCH 11/43] conf: Aureon: define pcm configuration block only one - time - -There may be multiple Aureon soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/Aureon51.conf | 14 +++++++------- - src/conf/cards/Aureon71.conf | 18 +++++++++--------- - 2 files changed, 16 insertions(+), 16 deletions(-) - -diff --git a/src/conf/cards/Aureon51.conf b/src/conf/cards/Aureon51.conf -index 07be4a77..9bf34661 100644 ---- a/src/conf/cards/Aureon51.conf -+++ b/src/conf/cards/Aureon51.conf -@@ -3,7 +3,7 @@ - # - - # default with dmix & dsnoop --Aureon51.pcm.default { -+Aureon51.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -27,7 +27,7 @@ Aureon51.pcm.default { - - - --Aureon51.pcm.front.0 { -+Aureon51.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -38,7 +38,7 @@ Aureon51.pcm.front.0 { - - - --Aureon51.pcm.rear.0 { -+Aureon51.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -51,7 +51,7 @@ Aureon51.pcm.rear.0 { - - - --Aureon51.pcm.center_lfe.0 { -+Aureon51.pcm.center_lfe.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -63,7 +63,7 @@ Aureon51.pcm.center_lfe.0 { - - - --Aureon51.pcm.side.0 { -+Aureon51.pcm.side.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -91,7 +91,7 @@ Aureon51.pcm.surround40.0 { - - - --Aureon51.pcm.surround51.0 { -+Aureon51.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -103,7 +103,7 @@ Aureon51.pcm.surround51.0 { - - - --Aureon51.pcm.iec958.0 { -+Aureon51.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -diff --git a/src/conf/cards/Aureon71.conf b/src/conf/cards/Aureon71.conf -index a43ce2ce..f29bc297 100644 ---- a/src/conf/cards/Aureon71.conf -+++ b/src/conf/cards/Aureon71.conf -@@ -3,7 +3,7 @@ - # - - # default with dmix & dsnoop --Aureon71.pcm.default { -+Aureon71.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -27,7 +27,7 @@ Aureon71.pcm.default { - - - --Aureon71.pcm.front.0 { -+Aureon71.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -38,7 +38,7 @@ Aureon71.pcm.front.0 { - - - --Aureon71.pcm.rear.0 { -+Aureon71.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -50,7 +50,7 @@ Aureon71.pcm.rear.0 { - - - --Aureon71.pcm.center_lfe.0 { -+Aureon71.pcm.center_lfe.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -63,7 +63,7 @@ Aureon71.pcm.center_lfe.0 { - - - --Aureon71.pcm.side.0 { -+Aureon71.pcm.side.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -76,7 +76,7 @@ Aureon71.pcm.side.0 { - - - --Aureon71.pcm.surround40.0 { -+Aureon71.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -91,7 +91,7 @@ Aureon71.pcm.surround40.0 { - - - --Aureon71.pcm.surround51.0 { -+Aureon71.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -103,7 +103,7 @@ Aureon71.pcm.surround51.0 { - - - --Aureon71.pcm.surround71.0 { -+Aureon71.pcm.surround71.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -114,7 +114,7 @@ Aureon71.pcm.surround71.0 { - - - --Aureon71.pcm.iec958.0 { -+Aureon71.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From ea984c3a7d6fbc3613c72614f5fce18ad2c7f9b1 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 12:12:47 +0100 -Subject: [PATCH 12/43] conf: AU88[123]0: define pcm configuration block only - one time - -There may be multiple AU88[123]0 soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/AU8810.conf | 4 ++-- - src/conf/cards/AU8820.conf | 2 +- - src/conf/cards/AU8830.conf | 4 ++-- - 3 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/conf/cards/AU8810.conf b/src/conf/cards/AU8810.conf -index 24d46c34..6b596b68 100644 ---- a/src/conf/cards/AU8810.conf -+++ b/src/conf/cards/AU8810.conf -@@ -4,7 +4,7 @@ - - - --AU8810.pcm.front.0 { -+AU8810.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -15,7 +15,7 @@ AU8810.pcm.front.0 { - - - --AU8810.pcm.iec958.0 { -+AU8810.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -diff --git a/src/conf/cards/AU8820.conf b/src/conf/cards/AU8820.conf -index 07890254..fe2cbc11 100644 ---- a/src/conf/cards/AU8820.conf -+++ b/src/conf/cards/AU8820.conf -@@ -4,7 +4,7 @@ - - - --AU8820.pcm.front.0 { -+AU8820.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -diff --git a/src/conf/cards/AU8830.conf b/src/conf/cards/AU8830.conf -index 39e66d50..9cd78b3e 100644 ---- a/src/conf/cards/AU8830.conf -+++ b/src/conf/cards/AU8830.conf -@@ -4,7 +4,7 @@ - - - --AU8830.pcm.front.0 { -+AU8830.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -19,7 +19,7 @@ AU8830.pcm.surround40.0 "cards.AU8830.pcm.front.0" - - - --AU8830.pcm.iec958.0 { -+AU8830.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From 68b8b435416ea734dda55c39f59bea90ea4b0dd6 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 12:12:47 +0100 -Subject: [PATCH 13/43] conf: CA0106: define pcm configuration block only one - time - -There may be multiple CA0106 soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/CA0106.conf | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) - -diff --git a/src/conf/cards/CA0106.conf b/src/conf/cards/CA0106.conf -index 2f0eaf0a..1fea79f5 100644 ---- a/src/conf/cards/CA0106.conf -+++ b/src/conf/cards/CA0106.conf -@@ -3,7 +3,7 @@ - # - - # default with dmix & dsnoop --CA0106.pcm.default { -+CA0106.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -27,7 +27,7 @@ CA0106.pcm.default { - - - --CA0106.pcm.front.0 { -+CA0106.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -38,7 +38,7 @@ CA0106.pcm.front.0 { - - - --CA0106.pcm.rear.0 { -+CA0106.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -50,7 +50,7 @@ CA0106.pcm.rear.0 { - - - --CA0106.pcm.center_lfe.0 { -+CA0106.pcm.center_lfe.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -62,7 +62,7 @@ CA0106.pcm.center_lfe.0 { - - - --CA0106.pcm.side.0 { -+CA0106.pcm.side.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -74,7 +74,7 @@ CA0106.pcm.side.0 { - - - --CA0106.pcm.surround40.0 { -+CA0106.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -114,7 +114,7 @@ CA0106.pcm.surround40.0 { - - - --CA0106.pcm.surround51.0 { -+CA0106.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -159,7 +159,7 @@ CA0106.pcm.surround51.0 { - ] - } - --CA0106.pcm.surround71.0 { -+CA0106.pcm.surround71.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -220,7 +220,7 @@ CA0106.pcm.surround71.0 { - - - --CA0106.pcm.iec958.0 { -+CA0106.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From 041299ea39a7a8d2cb55cb8c2cb5a2e985d38fc3 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 12:12:47 +0100 -Subject: [PATCH 14/43] conf: CMI8xxx: define pcm configuration block only one - time - -There may be multiple CMI8xxx soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/CMI8338-SWIEC.conf | 10 +++++----- - src/conf/cards/CMI8338.conf | 10 +++++----- - src/conf/cards/CMI8738-MC6.conf | 12 ++++++------ - src/conf/cards/CMI8738-MC8.conf | 14 +++++++------- - src/conf/cards/CMI8788.conf | 12 ++++++------ - 5 files changed, 29 insertions(+), 29 deletions(-) - -diff --git a/src/conf/cards/CMI8338-SWIEC.conf b/src/conf/cards/CMI8338-SWIEC.conf -index af3a579f..ca86c466 100644 ---- a/src/conf/cards/CMI8338-SWIEC.conf -+++ b/src/conf/cards/CMI8338-SWIEC.conf -@@ -5,7 +5,7 @@ - - - --CMI8338-SWIEC.pcm.front.0 { -+CMI8338-SWIEC.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -15,7 +15,7 @@ CMI8338-SWIEC.pcm.front.0 { - } - - # default with dmix/dsnoop --CMI8338-SWIEC.pcm.default { -+CMI8338-SWIEC.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -41,7 +41,7 @@ CMI8338-SWIEC.pcm.default { - - # 2nd DAC - # FIXME: we need a volume attenuator for rear channel. --CMI8338-SWIEC.pcm.rear.0 { -+CMI8338-SWIEC.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -54,7 +54,7 @@ CMI8338-SWIEC.pcm.rear.0 { - - - # for the old CM8738 with 2nd DAC for rear --CMI8338-SWIEC.pcm.surround40.0 { -+CMI8338-SWIEC.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -91,7 +91,7 @@ CMI8338-SWIEC.pcm.surround40.0 { - - - --CMI8338-SWIEC.pcm.iec958.0 { -+CMI8338-SWIEC.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -diff --git a/src/conf/cards/CMI8338.conf b/src/conf/cards/CMI8338.conf -index 144fc9b0..0f92ad0b 100644 ---- a/src/conf/cards/CMI8338.conf -+++ b/src/conf/cards/CMI8338.conf -@@ -4,7 +4,7 @@ - - - --CMI8338.pcm.front.0 { -+CMI8338.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -14,7 +14,7 @@ CMI8338.pcm.front.0 { - } - - # default with dmix/dsnoop --CMI8338.pcm.default { -+CMI8338.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -40,7 +40,7 @@ CMI8338.pcm.default { - - # 2nd DAC - # FIXME: we need a volume attenuator for rear channel. --CMI8338.pcm.rear.0 { -+CMI8338.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -53,7 +53,7 @@ CMI8338.pcm.rear.0 { - - - # for the old CM8738 with 2nd DAC for rear --CMI8338.pcm.surround40.0 { -+CMI8338.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -90,7 +90,7 @@ CMI8338.pcm.surround40.0 { - - - --CMI8338.pcm.iec958.0 { -+CMI8338.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -diff --git a/src/conf/cards/CMI8738-MC6.conf b/src/conf/cards/CMI8738-MC6.conf -index edc67d44..2b1c7d05 100644 ---- a/src/conf/cards/CMI8738-MC6.conf -+++ b/src/conf/cards/CMI8738-MC6.conf -@@ -4,7 +4,7 @@ - - - --CMI8738-MC6.pcm.front.0 { -+CMI8738-MC6.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -14,7 +14,7 @@ CMI8738-MC6.pcm.front.0 { - } - - # default with dmix/dsnoop --CMI8738-MC6.pcm.default { -+CMI8738-MC6.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -40,7 +40,7 @@ CMI8738-MC6.pcm.default { - - # 2nd DAC - # FIXME: we need a volume attenuator for rear channel. --CMI8738-MC6.pcm.rear.0 { -+CMI8738-MC6.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -52,7 +52,7 @@ CMI8738-MC6.pcm.rear.0 { - - - --CMI8738-MC6.pcm.surround40.0 { -+CMI8738-MC6.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -82,7 +82,7 @@ CMI8738-MC6.pcm.surround40.0 { - - - --CMI8738-MC6.pcm.surround51.0 { -+CMI8738-MC6.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -109,7 +109,7 @@ CMI8738-MC6.pcm.surround51.0 { - - - --CMI8738-MC6.pcm.iec958.0 { -+CMI8738-MC6.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -diff --git a/src/conf/cards/CMI8738-MC8.conf b/src/conf/cards/CMI8738-MC8.conf -index ddff7530..96cb3f10 100644 ---- a/src/conf/cards/CMI8738-MC8.conf -+++ b/src/conf/cards/CMI8738-MC8.conf -@@ -4,7 +4,7 @@ - - - --CMI8738-MC8.pcm.front.0 { -+CMI8738-MC8.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -21,7 +21,7 @@ CMI8738-MC8.pcm.front.0 { - } - - # default with dmix+softvol & dsnoop --CMI8738-MC8.pcm.default { -+CMI8738-MC8.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -53,7 +53,7 @@ CMI8738-MC8.pcm.default { - - - # 2nd DAC --CMI8738-MC8.pcm.rear.0 { -+CMI8738-MC8.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -72,7 +72,7 @@ CMI8738-MC8.pcm.rear.0 { - - - --CMI8738-MC8.pcm.surround40.0 { -+CMI8738-MC8.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -110,7 +110,7 @@ CMI8738-MC8.pcm.surround40.0 { - - - --CMI8738-MC8.pcm.surround51.0 { -+CMI8738-MC8.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -144,7 +144,7 @@ CMI8738-MC8.pcm.surround51.0 { - - - --CMI8738-MC8.pcm.surround71.0 { -+CMI8738-MC8.pcm.surround71.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -178,7 +178,7 @@ CMI8738-MC8.pcm.surround71.0 { - - - --CMI8738-MC8.pcm.iec958.0 { -+CMI8738-MC8.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -diff --git a/src/conf/cards/CMI8788.conf b/src/conf/cards/CMI8788.conf -index edcb0c9c..c4ad9f48 100644 ---- a/src/conf/cards/CMI8788.conf -+++ b/src/conf/cards/CMI8788.conf -@@ -4,7 +4,7 @@ - - - --CMI8788.pcm.front.0 { -+CMI8788.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -14,7 +14,7 @@ CMI8788.pcm.front.0 { - } - - # default with dmix & dsnoop --CMI8788.pcm.default { -+CMI8788.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -38,7 +38,7 @@ CMI8788.pcm.default { - - - --CMI8788.pcm.surround40.0 { -+CMI8788.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -53,7 +53,7 @@ CMI8788.pcm.surround40.0 { - - - --CMI8788.pcm.surround51.0 { -+CMI8788.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -65,7 +65,7 @@ CMI8788.pcm.surround51.0 { - - - --CMI8788.pcm.surround71.0 { -+CMI8788.pcm.surround71.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -77,7 +77,7 @@ CMI8788.pcm.surround71.0 { - - - --CMI8788.pcm.iec958.0 { -+CMI8788.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From 1e29ff18400e9b219159f9d0cb9aaf4be3b82efa Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 12:12:47 +0100 -Subject: [PATCH 15/43] conf: CS46xx: define pcm configuration block only one - time - -There may be multiple CS46xx soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/CS46xx.conf | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/src/conf/cards/CS46xx.conf b/src/conf/cards/CS46xx.conf -index b71c30aa..478cbf3e 100644 ---- a/src/conf/cards/CS46xx.conf -+++ b/src/conf/cards/CS46xx.conf -@@ -4,7 +4,7 @@ - - - --CS46xx.pcm.front.0 { -+CS46xx.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -15,7 +15,7 @@ CS46xx.pcm.front.0 { - - # default with plughw - # CS46xx supports multi-playback --CS46xx.pcm.default { -+CS46xx.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -39,7 +39,7 @@ CS46xx.pcm.default { - - - --CS46xx.pcm.rear.0 { -+CS46xx.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -66,7 +66,7 @@ CS46xx.pcm.rear.0 { - - - --CS46xx.pcm.center_lfe.0 { -+CS46xx.pcm.center_lfe.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -78,7 +78,7 @@ CS46xx.pcm.center_lfe.0 { - - - --CS46xx.pcm.surround40.0 { -+CS46xx.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -117,7 +117,7 @@ CS46xx.pcm.surround40.0 { - - - --CS46xx.pcm.surround51.0 { -+CS46xx.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -164,7 +164,7 @@ CS46xx.pcm.surround51.0 { - - - --CS46xx.pcm.iec958.0 { -+CS46xx.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From 0ba7c2716567875d207b71b61e1205b855c7fd9c Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 12:12:47 +0100 -Subject: [PATCH 16/43] conf: Echo3G: define pcm configuration block only one - time - -There may be multiple Echo3G soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/Echo_Echo3G.conf | 20 ++++++++++---------- - 1 file changed, 10 insertions(+), 10 deletions(-) - -diff --git a/src/conf/cards/Echo_Echo3G.conf b/src/conf/cards/Echo_Echo3G.conf -index 766f13f7..fb2a7b67 100644 ---- a/src/conf/cards/Echo_Echo3G.conf -+++ b/src/conf/cards/Echo_Echo3G.conf -@@ -3,7 +3,7 @@ - # - - --Echo_Echo3G.pcm.front.0 { -+Echo_Echo3G.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -15,7 +15,7 @@ Echo_Echo3G.pcm.front.0 { - } - - --Echo_Echo3G.pcm.rear.0 { -+Echo_Echo3G.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -27,7 +27,7 @@ Echo_Echo3G.pcm.rear.0 { - } - - --Echo_Echo3G.pcm.center_lfe.0 { -+Echo_Echo3G.pcm.center_lfe.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -39,7 +39,7 @@ Echo_Echo3G.pcm.center_lfe.0 { - } - - --Echo_Echo3G.pcm.side.0 { -+Echo_Echo3G.pcm.side.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -51,7 +51,7 @@ Echo_Echo3G.pcm.side.0 { - } - - --Echo_Echo3G.pcm.surround40.0 { -+Echo_Echo3G.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -86,7 +86,7 @@ Echo_Echo3G.pcm.surround40.0 { - } - - --Echo_Echo3G.pcm.surround41.0 { -+Echo_Echo3G.pcm.surround41.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -131,7 +131,7 @@ Echo_Echo3G.pcm.surround41.0 { - } - - --Echo_Echo3G.pcm.surround50.0 { -+Echo_Echo3G.pcm.surround50.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -176,7 +176,7 @@ Echo_Echo3G.pcm.surround50.0 { - } - - --Echo_Echo3G.pcm.surround51.0 { -+Echo_Echo3G.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -222,7 +222,7 @@ Echo_Echo3G.pcm.surround51.0 { - } - - --Echo_Echo3G.pcm.surround71.0 { -+Echo_Echo3G.pcm.surround71.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -279,7 +279,7 @@ Echo_Echo3G.pcm.surround71.0 { - } - - --Echo_Echo3G.pcm.iec958.0 { -+Echo_Echo3G.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From 8c1005624495b61919080959088dc744d6d213ea Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:08:42 +0100 -Subject: [PATCH 17/43] conf: Aureon51: define pcm configuration block only one - time - -There may be multiple Aureon51 soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/Aureon51.conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/conf/cards/Aureon51.conf b/src/conf/cards/Aureon51.conf -index 9bf34661..db907f82 100644 ---- a/src/conf/cards/Aureon51.conf -+++ b/src/conf/cards/Aureon51.conf -@@ -76,7 +76,7 @@ Aureon51.pcm.side.!0 { - - - --Aureon51.pcm.surround40.0 { -+Aureon51.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string --- -2.51.1 - - -From ed4884cbe179f42a10771584ebe9fff844b90d4f Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:08:42 +0100 -Subject: [PATCH 18/43] conf: EMU10K1: define pcm configuration block only one - time - -There may be multiple EMU10K1 soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/EMU10K1.conf | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/src/conf/cards/EMU10K1.conf b/src/conf/cards/EMU10K1.conf -index 430926c7..5ef12c03 100644 ---- a/src/conf/cards/EMU10K1.conf -+++ b/src/conf/cards/EMU10K1.conf -@@ -4,7 +4,7 @@ - - - --EMU10K1.pcm.front.0 { -+EMU10K1.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -47,7 +47,7 @@ EMU10K1.pcm.front.0 { - - - --EMU10K1.pcm.rear.0 { -+EMU10K1.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -78,7 +78,7 @@ EMU10K1.pcm.rear.0 { - - - --EMU10K1.pcm.center_lfe.0 { -+EMU10K1.pcm.center_lfe.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -143,7 +143,7 @@ EMU10K1.pcm.center_lfe.0 { - - - --EMU10K1.pcm.surround40.0 { -+EMU10K1.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -182,7 +182,7 @@ EMU10K1.pcm.surround40.0 { - - - --EMU10K1.pcm.surround51.0 { -+EMU10K1.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -229,7 +229,7 @@ EMU10K1.pcm.surround51.0 { - - - --EMU10K1.pcm.iec958.0 { -+EMU10K1.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From dba724706a6eec70e52e31595b3ff1ec055bf50c Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:17:45 +0100 -Subject: [PATCH 19/43] conf: EMU10K1X: define pcm configuration block only one - time - -There may be multiple EMU10K1X soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/EMU10K1X.conf | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/src/conf/cards/EMU10K1X.conf b/src/conf/cards/EMU10K1X.conf -index f7428636..334f897d 100644 ---- a/src/conf/cards/EMU10K1X.conf -+++ b/src/conf/cards/EMU10K1X.conf -@@ -3,7 +3,7 @@ - # - - # default with dmix & dsnoop --EMU10K1X.pcm.default { -+EMU10K1X.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -27,7 +27,7 @@ EMU10K1X.pcm.default { - - - --EMU10K1X.pcm.front.0 { -+EMU10K1X.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -38,7 +38,7 @@ EMU10K1X.pcm.front.0 { - - - --EMU10K1X.pcm.rear.0 { -+EMU10K1X.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -50,7 +50,7 @@ EMU10K1X.pcm.rear.0 { - - - --EMU10K1X.pcm.center_lfe.0 { -+EMU10K1X.pcm.center_lfe.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -62,7 +62,7 @@ EMU10K1X.pcm.center_lfe.0 { - - - --EMU10K1X.pcm.surround40.0 { -+EMU10K1X.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -101,7 +101,7 @@ EMU10K1X.pcm.surround40.0 { - - - --EMU10K1X.pcm.surround51.0 { -+EMU10K1X.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -148,7 +148,7 @@ EMU10K1X.pcm.surround51.0 { - - - --EMU10K1X.pcm.iec958.0 { -+EMU10K1X.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From 7cf26f603823cccd3e89eb57f459642c890b79af Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:17:45 +0100 -Subject: [PATCH 20/43] conf: ENS137[01]: define pcm configuration block only - one time - -There may be multiple ENS137[01] soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/ENS1370.conf | 8 ++++---- - src/conf/cards/ENS1371.conf | 10 +++++----- - 2 files changed, 9 insertions(+), 9 deletions(-) - -diff --git a/src/conf/cards/ENS1370.conf b/src/conf/cards/ENS1370.conf -index 32e4782e..c65e224f 100644 ---- a/src/conf/cards/ENS1370.conf -+++ b/src/conf/cards/ENS1370.conf -@@ -4,7 +4,7 @@ - - - --ENS1370.pcm.front.0 { -+ENS1370.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -15,7 +15,7 @@ ENS1370.pcm.front.0 { - } - - # default with dmix/dsnoop --ENS1370.pcm.default { -+ENS1370.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -39,7 +39,7 @@ ENS1370.pcm.default { - - - --ENS1370.pcm.rear.0 { -+ENS1370.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -71,7 +71,7 @@ ENS1370.pcm.rear.0 { - - - --ENS1370.pcm.surround40.0 { -+ENS1370.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -diff --git a/src/conf/cards/ENS1371.conf b/src/conf/cards/ENS1371.conf -index a6df4251..560fda9f 100644 ---- a/src/conf/cards/ENS1371.conf -+++ b/src/conf/cards/ENS1371.conf -@@ -4,7 +4,7 @@ - - - --ENS1371.pcm.front.0 { -+ENS1371.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -14,7 +14,7 @@ ENS1371.pcm.front.0 { - } - - # default with dmix/dsnoop --ENS1371.pcm.default { -+ENS1371.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -38,7 +38,7 @@ ENS1371.pcm.default { - - - --ENS1371.pcm.rear.0 { -+ENS1371.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -65,7 +65,7 @@ ENS1371.pcm.rear.0 { - - - --ENS1371.pcm.surround40.0 { -+ENS1371.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -97,7 +97,7 @@ ENS1371.pcm.surround40.0 { - - - --ENS1371.pcm.iec958.0 { -+ENS1371.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From 001a2f3809865d071b53e802d4fbc89bb37a2fe1 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:17:45 +0100 -Subject: [PATCH 21/43] conf: ES1968: define pcm configuration block only one - time - -There may be multiple ES1968 soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/ES1968.conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/conf/cards/ES1968.conf b/src/conf/cards/ES1968.conf -index a6ee1192..296baa13 100644 ---- a/src/conf/cards/ES1968.conf -+++ b/src/conf/cards/ES1968.conf -@@ -2,7 +2,7 @@ - - - --ES1968.pcm.front.0 { -+ES1968.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string --- -2.51.1 - - -From 2d5aa02738faf79895fa7457182810bee2ce7b90 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:17:46 +0100 -Subject: [PATCH 22/43] conf: FireWave: define pcm configuration block only one - time - -There may be multiple FireWave soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/FireWave.conf | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/conf/cards/FireWave.conf b/src/conf/cards/FireWave.conf -index fcfc83cc..786169f2 100644 ---- a/src/conf/cards/FireWave.conf -+++ b/src/conf/cards/FireWave.conf -@@ -2,7 +2,7 @@ - # Configuration for the Griffin FireWave Surround - # - --FireWave.pcm.default { -+FireWave.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -16,7 +16,7 @@ FireWave.pcm.default { - - - --FireWave.pcm.front.0 { -+FireWave.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -30,7 +30,7 @@ FireWave.pcm.front.0 { - - - --FireWave.pcm.surround51.0 { -+FireWave.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string --- -2.51.1 - - -From 9f46e1a5a48f863e38794aa5b7c350d291078924 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:17:46 +0100 -Subject: [PATCH 23/43] conf: FM801: define pcm configuration block only one - time - -There may be multiple FM801 soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/FM801.conf | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/conf/cards/FM801.conf b/src/conf/cards/FM801.conf -index 0ddf799c..14cfdbe8 100644 ---- a/src/conf/cards/FM801.conf -+++ b/src/conf/cards/FM801.conf -@@ -4,7 +4,7 @@ - - - --FM801.pcm.front.0 { -+FM801.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -14,7 +14,7 @@ FM801.pcm.front.0 { - } - - # default with dmix/dsnoop --FM801.pcm.default { -+FM801.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -49,7 +49,7 @@ FM801.pcm.surround51.0 "cards.FM801.pcm.front.0" - - - --FM801.pcm.iec958.0 { -+FM801.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From ea939799299ff88c254344c7a89e86ffa159e5a7 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:17:46 +0100 -Subject: [PATCH 24/43] conf: FWSpeakers: define pcm configuration block only - one time - -There may be multiple FWSpeakers soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/FWSpeakers.conf | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/conf/cards/FWSpeakers.conf b/src/conf/cards/FWSpeakers.conf -index cd6fa605..96ab5cb9 100644 ---- a/src/conf/cards/FWSpeakers.conf -+++ b/src/conf/cards/FWSpeakers.conf -@@ -2,7 +2,7 @@ - # Configuration for the LaCie Firewire speakers - # - --FWSpeakers.pcm.default { -+FWSpeakers.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -16,7 +16,7 @@ FWSpeakers.pcm.default { - - - --FWSpeakers.pcm.front.0 { -+FWSpeakers.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string --- -2.51.1 - - -From a87570df7247d979eb5106ca549fa776e4c51ab3 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:17:47 +0100 -Subject: [PATCH 25/43] conf: GUS: define pcm configuration block only one time - -There may be multiple GUS soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/GUS.conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/conf/cards/GUS.conf b/src/conf/cards/GUS.conf -index d744c548..a1ccd0e9 100644 ---- a/src/conf/cards/GUS.conf -+++ b/src/conf/cards/GUS.conf -@@ -4,7 +4,7 @@ - - - --GUS.pcm.front.0 { -+GUS.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string --- -2.51.1 - - -From dded72a687e8e8210b276ab13f4e26b63bfa782b Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:17:47 +0100 -Subject: [PATCH 26/43] conf: HdmiLpeAudio: define pcm configuration block only - one time - -There may be multiple HdmiLpeAudio soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/HdmiLpeAudio.conf | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/conf/cards/HdmiLpeAudio.conf b/src/conf/cards/HdmiLpeAudio.conf -index a9104f43..799946a2 100644 ---- a/src/conf/cards/HdmiLpeAudio.conf -+++ b/src/conf/cards/HdmiLpeAudio.conf -@@ -2,7 +2,7 @@ - # Configuration for the Intel HDMI/DP LPE audio - # - --HdmiLpeAudio.pcm.hdmi.0 { -+HdmiLpeAudio.pcm.hdmi.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -@@ -39,7 +39,7 @@ HdmiLpeAudio.pcm.hdmi.0 { - } - } - --HdmiLpeAudio.pcm.hdmi.1 { -+HdmiLpeAudio.pcm.hdmi.!1 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -@@ -77,7 +77,7 @@ HdmiLpeAudio.pcm.hdmi.1 { - } - } - --HdmiLpeAudio.pcm.hdmi.2 { -+HdmiLpeAudio.pcm.hdmi.!2 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From 1f52b57ff8f023b396b459407e60d8498c69f6e7 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:17:57 +0100 -Subject: [PATCH 27/43] conf: ICE17[12][24]: define pcm configuration block - only one time - -There may be multiple ICE17[12][24] soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/ICE1712.conf | 12 ++++++------ - src/conf/cards/ICE1724.conf | 18 +++++++++--------- - 2 files changed, 15 insertions(+), 15 deletions(-) - -diff --git a/src/conf/cards/ICE1712.conf b/src/conf/cards/ICE1712.conf -index db62684e..190d2c59 100644 ---- a/src/conf/cards/ICE1712.conf -+++ b/src/conf/cards/ICE1712.conf -@@ -3,7 +3,7 @@ - # - - # default with dmix & dsnoop --ICE1712.pcm.default { -+ICE1712.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -27,7 +27,7 @@ ICE1712.pcm.default { - - - --ICE1712.pcm.front.0 { -+ICE1712.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -57,7 +57,7 @@ ICE1712.pcm.front.0 { - - - --ICE1712.pcm.surround40.0 { -+ICE1712.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -80,7 +80,7 @@ ICE1712.pcm.surround40.0 { - - - --ICE1712.pcm.surround51.0 { -+ICE1712.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -99,7 +99,7 @@ ICE1712.pcm.surround51.0 { - slave.channels 10 - } - --ICE1712.pcm.surround71.0 { -+ICE1712.pcm.surround71.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -122,7 +122,7 @@ ICE1712.pcm.surround71.0 { - - - --ICE1712.pcm.iec958.0 { -+ICE1712.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -diff --git a/src/conf/cards/ICE1724.conf b/src/conf/cards/ICE1724.conf -index 61cac013..16045dc4 100644 ---- a/src/conf/cards/ICE1724.conf -+++ b/src/conf/cards/ICE1724.conf -@@ -3,7 +3,7 @@ - # - - # default with dmix & dsnoop --ICE1724.pcm.default { -+ICE1724.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -27,7 +27,7 @@ ICE1724.pcm.default { - - - --ICE1724.pcm.front.0 { -+ICE1724.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -38,7 +38,7 @@ ICE1724.pcm.front.0 { - - - --ICE1724.pcm.rear.0 { -+ICE1724.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -51,7 +51,7 @@ ICE1724.pcm.rear.0 { - - - --ICE1724.pcm.center_lfe.0 { -+ICE1724.pcm.center_lfe.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -63,7 +63,7 @@ ICE1724.pcm.center_lfe.0 { - - - --ICE1724.pcm.side.0 { -+ICE1724.pcm.side.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -76,7 +76,7 @@ ICE1724.pcm.side.0 { - - - --ICE1724.pcm.surround40.0 { -+ICE1724.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -100,7 +100,7 @@ ICE1724.pcm.surround40.0 { - - - --ICE1724.pcm.surround51.0 { -+ICE1724.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -123,7 +123,7 @@ ICE1724.pcm.surround51.0 { - - - --ICE1724.pcm.surround71.0 { -+ICE1724.pcm.surround71.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -148,7 +148,7 @@ ICE1724.pcm.surround71.0 { - - - --ICE1724.pcm.iec958.0 { -+ICE1724.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From 99f1987a1e864523a7a423f1840ca6a76045d619 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:17:57 +0100 -Subject: [PATCH 28/43] conf: ICH,ICH4,ICH-MODEM: define pcm configuration - block only one time - -There may be multiple ICH soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/ICH-MODEM.conf | 2 +- - src/conf/cards/ICH.conf | 10 +++++----- - src/conf/cards/ICH4.conf | 10 +++++----- - 3 files changed, 11 insertions(+), 11 deletions(-) - -diff --git a/src/conf/cards/ICH-MODEM.conf b/src/conf/cards/ICH-MODEM.conf -index b96b5aaf..855f3a96 100644 ---- a/src/conf/cards/ICH-MODEM.conf -+++ b/src/conf/cards/ICH-MODEM.conf -@@ -4,7 +4,7 @@ - - - --ICH-MODEM.pcm.modem.0 { -+ICH-MODEM.pcm.modem.!0 { - @args [ CARD ] - @args.CARD { - type string -diff --git a/src/conf/cards/ICH.conf b/src/conf/cards/ICH.conf -index 6fc9a5a2..c35c8d02 100644 ---- a/src/conf/cards/ICH.conf -+++ b/src/conf/cards/ICH.conf -@@ -4,7 +4,7 @@ - - - --ICH.pcm.front.0 { -+ICH.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -21,7 +21,7 @@ ICH.pcm.front.0 { - } - - # default with dmix+softvol & dsnoop --ICH.pcm.default { -+ICH.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -52,7 +52,7 @@ ICH.pcm.default { - - - --ICH.pcm.surround40.0 { -+ICH.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -103,7 +103,7 @@ ICH.pcm.surround40.0 { - - - --ICH.pcm.surround51.0 { -+ICH.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -174,7 +174,7 @@ ICH.pcm.surround51.0 { - - - --ICH.pcm.iec958.0 { -+ICH.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -diff --git a/src/conf/cards/ICH4.conf b/src/conf/cards/ICH4.conf -index 64ec883d..11c85a6e 100644 ---- a/src/conf/cards/ICH4.conf -+++ b/src/conf/cards/ICH4.conf -@@ -4,7 +4,7 @@ - - - --ICH4.pcm.front.0 { -+ICH4.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -21,7 +21,7 @@ ICH4.pcm.front.0 { - } - - # default with dmix+softvol & dsnoop --ICH4.pcm.default { -+ICH4.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -52,7 +52,7 @@ ICH4.pcm.default { - - - --ICH4.pcm.surround40.0 { -+ICH4.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -103,7 +103,7 @@ ICH4.pcm.surround40.0 { - - - --ICH4.pcm.surround51.0 { -+ICH4.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -164,7 +164,7 @@ ICH4.pcm.surround51.0 { - - - --ICH4.pcm.iec958.0 { -+ICH4.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From ff4fb7f8c98157010c44f7335a32a09e9fc085d6 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:17:57 +0100 -Subject: [PATCH 29/43] conf: Loopback: define pcm configuration block only one - time - -There may be multiple Loopback soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/Loopback.conf | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/conf/cards/Loopback.conf b/src/conf/cards/Loopback.conf -index 1ae6d453..21c8429c 100644 ---- a/src/conf/cards/Loopback.conf -+++ b/src/conf/cards/Loopback.conf -@@ -4,7 +4,7 @@ - - - --Loopback.pcm.front.0 { -+Loopback.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -21,7 +21,7 @@ Loopback.pcm.front.0 { - } - - # default with dmix+softvol & dsnoop --Loopback.pcm.default { -+Loopback.pcm.!default { - @args [ CARD ] - @args.CARD { - type string --- -2.51.1 - - -From de72d657281c043c8d48d23cb8da9b1c4c5f31de Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:17:57 +0100 -Subject: [PATCH 30/43] conf: Maestro3: define pcm configuration block only one - time - -There may be multiple Maestro3 soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/Maestro3.conf | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/conf/cards/Maestro3.conf b/src/conf/cards/Maestro3.conf -index 94323227..a8d89a48 100644 ---- a/src/conf/cards/Maestro3.conf -+++ b/src/conf/cards/Maestro3.conf -@@ -2,7 +2,7 @@ - - - --Maestro3.pcm.front.0 { -+Maestro3.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -12,7 +12,7 @@ Maestro3.pcm.front.0 { - } - - # default with dmix/dsnoop --Maestro3.pcm.default { -+Maestro3.pcm.!default { - @args [ CARD ] - @args.CARD { - type string --- -2.51.1 - - -From ebb5ab7d846e2702640a7d754127083412b15816 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:18:06 +0100 -Subject: [PATCH 31/43] conf: NFORCE: define pcm configuration block only one - time - -There may be multiple NFORCE soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/NFORCE.conf | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/src/conf/cards/NFORCE.conf b/src/conf/cards/NFORCE.conf -index 64d15479..088cd8ce 100644 ---- a/src/conf/cards/NFORCE.conf -+++ b/src/conf/cards/NFORCE.conf -@@ -4,7 +4,7 @@ - - - --NFORCE.pcm.front.0 { -+NFORCE.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -21,7 +21,7 @@ NFORCE.pcm.front.0 { - } - - # default with dmix+softvol & dsnoop --NFORCE.pcm.default { -+NFORCE.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -52,7 +52,7 @@ NFORCE.pcm.default { - - - --NFORCE.pcm.surround40.0 { -+NFORCE.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -103,7 +103,7 @@ NFORCE.pcm.surround40.0 { - - - --NFORCE.pcm.surround51.0 { -+NFORCE.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -174,7 +174,7 @@ NFORCE.pcm.surround51.0 { - - - --NFORCE.pcm.surround71.0 { -+NFORCE.pcm.surround71.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -247,7 +247,7 @@ NFORCE.pcm.surround71.0 { - - - --NFORCE.pcm.iec958.0 { -+NFORCE.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From 3d636ff5309e3672c0acc784c9539af4396d2dfb Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:18:06 +0100 -Subject: [PATCH 32/43] conf: PC-Speaker: define pcm configuration block only - one time - -There may be multiple PC-Speaker soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/PC-Speaker.conf | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/conf/cards/PC-Speaker.conf b/src/conf/cards/PC-Speaker.conf -index c82654d8..8a40a139 100644 ---- a/src/conf/cards/PC-Speaker.conf -+++ b/src/conf/cards/PC-Speaker.conf -@@ -4,7 +4,7 @@ - - - --PC-Speaker.pcm.front.0 { -+PC-Speaker.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -23,7 +23,7 @@ PC-Speaker.pcm.front.0 { - } - - # default with dmix & null --PC-Speaker.pcm.default { -+PC-Speaker.pcm.!default { - @args [ CARD ] - @args.CARD { - type string --- -2.51.1 - - -From a3028a492a641d5077640294d1fb655c4b4aa84a Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:18:06 +0100 -Subject: [PATCH 33/43] conf: PMac,PMacToonie: define pcm configuration block - only one time - -There may be multiple PMac soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/PMac.conf | 4 ++-- - src/conf/cards/PMacToonie.conf | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/conf/cards/PMac.conf b/src/conf/cards/PMac.conf -index d1fdb17b..00f3bc89 100644 ---- a/src/conf/cards/PMac.conf -+++ b/src/conf/cards/PMac.conf -@@ -4,7 +4,7 @@ - - - --PMac.pcm.front.0 { -+PMac.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -14,7 +14,7 @@ PMac.pcm.front.0 { - } - - # default with dmix/dsnoop --PMac.pcm.default { -+PMac.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -diff --git a/src/conf/cards/PMacToonie.conf b/src/conf/cards/PMacToonie.conf -index 1e0eb59c..aff1ea65 100644 ---- a/src/conf/cards/PMacToonie.conf -+++ b/src/conf/cards/PMacToonie.conf -@@ -4,7 +4,7 @@ - - - --PMacToonie.pcm.front.0 { -+PMacToonie.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -21,7 +21,7 @@ PMacToonie.pcm.front.0 { - } - - # default with dmix+softvol & dsnoop --PMacToonie.pcm.default { -+PMacToonie.pcm.!default { - @args [ CARD ] - @args.CARD { - type string --- -2.51.1 - - -From 8340b3c6b31a4e4c02f69bf36f3958d390c724b9 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:18:06 +0100 -Subject: [PATCH 34/43] conf: PS3: define pcm configuration block only one time - -There may be multiple PS3 soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/PS3.conf | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/conf/cards/PS3.conf b/src/conf/cards/PS3.conf -index b642f0dc..486d790c 100644 ---- a/src/conf/cards/PS3.conf -+++ b/src/conf/cards/PS3.conf -@@ -4,7 +4,7 @@ - - - --PS3.pcm.front.0 { -+PS3.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -22,7 +22,7 @@ PS3.pcm.front.0 { - } - - # default with dmix+softvol --PS3.pcm.default { -+PS3.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -47,7 +47,7 @@ PS3.pcm.default { - - - --PS3.pcm.iec958.0 { -+PS3.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From f03528daf2ee177d2003b4d40824506f3a3558f4 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:18:15 +0100 -Subject: [PATCH 35/43] conf: RME96[35][26]: define pcm configuration block - only one time - -There may be multiple RME96[35][26] soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/RME9636.conf | 4 ++-- - src/conf/cards/RME9652.conf | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/conf/cards/RME9636.conf b/src/conf/cards/RME9636.conf -index e8dc5fad..17b3a1ab 100644 ---- a/src/conf/cards/RME9636.conf -+++ b/src/conf/cards/RME9636.conf -@@ -4,7 +4,7 @@ - - - --RME9636.pcm.front.0 { -+RME9636.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -17,7 +17,7 @@ RME9636.pcm.front.0 { - - - --RME9636.pcm.iec958.0 { -+RME9636.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -diff --git a/src/conf/cards/RME9652.conf b/src/conf/cards/RME9652.conf -index 1147d810..a11e42b2 100644 ---- a/src/conf/cards/RME9652.conf -+++ b/src/conf/cards/RME9652.conf -@@ -4,7 +4,7 @@ - - - --RME9652.pcm.front.0 { -+RME9652.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -17,7 +17,7 @@ RME9652.pcm.front.0 { - - - --RME9652.pcm.iec958.0 { -+RME9652.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From 1cd87775c5d9d46e418dc67a4d9c93fe5104ee3f Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:18:15 +0100 -Subject: [PATCH 36/43] conf: SB-XFi: define pcm configuration block only one - time - -There may be multiple SB-XFi soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/SB-XFi.conf | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/conf/cards/SB-XFi.conf b/src/conf/cards/SB-XFi.conf -index eb2218bf..9ce9c8ac 100644 ---- a/src/conf/cards/SB-XFi.conf -+++ b/src/conf/cards/SB-XFi.conf -@@ -4,7 +4,7 @@ - - - --SB-XFi.pcm.front.0 { -+SB-XFi.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -16,7 +16,7 @@ SB-XFi.pcm.front.0 { - - - --SB-XFi.pcm.rear.0 { -+SB-XFi.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -29,7 +29,7 @@ SB-XFi.pcm.rear.0 { - - - --SB-XFi.pcm.center_lfe.0 { -+SB-XFi.pcm.center_lfe.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -42,7 +42,7 @@ SB-XFi.pcm.center_lfe.0 { - - - --SB-XFi.pcm.side.0 { -+SB-XFi.pcm.side.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -66,7 +66,7 @@ SB-XFi.pcm.surround71.0 cards.SB-XFi.pcm.front.0 - - - --SB-XFi.pcm.iec958.0 { -+SB-XFi.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From 51d75e5f072698d6ec03957cf87b735117f05ab4 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:18:15 +0100 -Subject: [PATCH 37/43] conf: SI7018: define pcm configuration block only one - time - -There may be multiple SI7018 soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/SI7018.conf | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/conf/cards/SI7018.conf b/src/conf/cards/SI7018.conf -index 02b8fc87..33d19085 100644 ---- a/src/conf/cards/SI7018.conf -+++ b/src/conf/cards/SI7018.conf -@@ -6,7 +6,7 @@ - - - --SI7018.pcm.front.0 { -+SI7018.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -18,7 +18,7 @@ SI7018.pcm.front.0 { - - - --SI7018.pcm.rear.0 { -+SI7018.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -44,7 +44,7 @@ SI7018.pcm.rear.0 { - - - --SI7018.pcm.surround40.0 { -+SI7018.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -83,7 +83,7 @@ SI7018.pcm.surround40.0 { - - - --SI7018.pcm.surround51.0 { -+SI7018.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -130,7 +130,7 @@ SI7018.pcm.surround51.0 { - - - --SI7018.pcm.iec958.0 { -+SI7018.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From 4c74f3a568583744dddab01e4cce5a2e8f207067 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:18:15 +0100 -Subject: [PATCH 38/43] conf: TRID4DWAVENX: define pcm configuration block only - one time - -There may be multiple TRID4DWAVENX soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/TRID4DWAVENX.conf | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/conf/cards/TRID4DWAVENX.conf b/src/conf/cards/TRID4DWAVENX.conf -index 717b1408..5001297e 100644 ---- a/src/conf/cards/TRID4DWAVENX.conf -+++ b/src/conf/cards/TRID4DWAVENX.conf -@@ -4,7 +4,7 @@ - - - --TRID4DWAVENX.pcm.front.0 { -+TRID4DWAVENX.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -16,7 +16,7 @@ TRID4DWAVENX.pcm.front.0 { - - - --TRID4DWAVENX.pcm.rear.0 { -+TRID4DWAVENX.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -56,7 +56,7 @@ TRID4DWAVENX.pcm.rear.0 { - - - --TRID4DWAVENX.pcm.surround40.0 { -+TRID4DWAVENX.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -92,7 +92,7 @@ TRID4DWAVENX.pcm.surround40.0 { - - - --TRID4DWAVENX.pcm.iec958.0 { -+TRID4DWAVENX.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From d6b9d7e0bef5ca8a019881b06de7183528ec5bd5 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:18:22 +0100 -Subject: [PATCH 39/43] conf: VIA686A,VIA82xx: define pcm configuration block - only one time - -There may be multiple VIA soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/VIA686A.conf | 6 +++--- - src/conf/cards/VIA8233.conf | 10 +++++----- - src/conf/cards/VIA8233A.conf | 10 +++++----- - src/conf/cards/VIA8237.conf | 10 +++++----- - 4 files changed, 18 insertions(+), 18 deletions(-) - -diff --git a/src/conf/cards/VIA686A.conf b/src/conf/cards/VIA686A.conf -index e4a06f23..c53dd71b 100644 ---- a/src/conf/cards/VIA686A.conf -+++ b/src/conf/cards/VIA686A.conf -@@ -7,7 +7,7 @@ - - - --VIA686A.pcm.front.0 { -+VIA686A.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -17,7 +17,7 @@ VIA686A.pcm.front.0 { - } - - # default with dmix/dsnoop --VIA686A.pcm.default { -+VIA686A.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -41,7 +41,7 @@ VIA686A.pcm.default { - - - --VIA686A.pcm.iec958.0 { -+VIA686A.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -diff --git a/src/conf/cards/VIA8233.conf b/src/conf/cards/VIA8233.conf -index 9ad321f7..3c25a11b 100644 ---- a/src/conf/cards/VIA8233.conf -+++ b/src/conf/cards/VIA8233.conf -@@ -4,7 +4,7 @@ - - - --VIA8233.pcm.front.0 { -+VIA8233.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -15,7 +15,7 @@ VIA8233.pcm.front.0 { - - # default with softvol/dsnoop - # VIA8233 supports multi-playback --VIA8233.pcm.default { -+VIA8233.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -46,7 +46,7 @@ VIA8233.pcm.default { - - - --VIA8233.pcm.surround40.0 { -+VIA8233.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -91,7 +91,7 @@ VIA8233.pcm.surround40.0 { - - - --VIA8233.pcm.surround51.0 { -+VIA8233.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -146,7 +146,7 @@ VIA8233.pcm.surround51.0 { - - - --VIA8233.pcm.iec958.0 { -+VIA8233.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -diff --git a/src/conf/cards/VIA8233A.conf b/src/conf/cards/VIA8233A.conf -index 679fccf3..c9e56e20 100644 ---- a/src/conf/cards/VIA8233A.conf -+++ b/src/conf/cards/VIA8233A.conf -@@ -4,7 +4,7 @@ - - - --VIA8233A.pcm.front.0 { -+VIA8233A.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -14,7 +14,7 @@ VIA8233A.pcm.front.0 { - } - - # default with dmix/dsnoop --VIA8233A.pcm.default { -+VIA8233A.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -38,7 +38,7 @@ VIA8233A.pcm.default { - - - --VIA8233A.pcm.surround40.0 { -+VIA8233A.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -89,7 +89,7 @@ VIA8233A.pcm.surround40.0 { - - - --VIA8233A.pcm.surround51.0 { -+VIA8233A.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -150,7 +150,7 @@ VIA8233A.pcm.surround51.0 { - - - --VIA8233A.pcm.iec958.0 { -+VIA8233A.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -diff --git a/src/conf/cards/VIA8237.conf b/src/conf/cards/VIA8237.conf -index 29d8e00f..49fd6f2c 100644 ---- a/src/conf/cards/VIA8237.conf -+++ b/src/conf/cards/VIA8237.conf -@@ -4,7 +4,7 @@ - - - --VIA8237.pcm.front.0 { -+VIA8237.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -15,7 +15,7 @@ VIA8237.pcm.front.0 { - - # default with softvol/dsnoop - # VIA8237 supports multi-playback --VIA8237.pcm.default { -+VIA8237.pcm.!default { - @args [ CARD ] - @args.CARD { - type string -@@ -46,7 +46,7 @@ VIA8237.pcm.default { - - - --VIA8237.pcm.surround40.0 { -+VIA8237.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -84,7 +84,7 @@ VIA8237.pcm.surround40.0 { - - - --VIA8237.pcm.surround51.0 { -+VIA8237.pcm.surround51.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -136,7 +136,7 @@ VIA8237.pcm.surround51.0 { - - - --VIA8237.pcm.iec958.0 { -+VIA8237.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From 4bcd33ef9dc6d8439cc6573575907ecf89271fe2 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:18:22 +0100 -Subject: [PATCH 40/43] conf: VX222,VXPocket: define pcm configuration block - only one time - -There may be multiple VX soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/VX222.conf | 4 ++-- - src/conf/cards/VXPocket.conf | 4 ++-- - src/conf/cards/VXPocket440.conf | 8 ++++---- - 3 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/src/conf/cards/VX222.conf b/src/conf/cards/VX222.conf -index 3385f25b..2c6e2297 100644 ---- a/src/conf/cards/VX222.conf -+++ b/src/conf/cards/VX222.conf -@@ -4,7 +4,7 @@ - - - --VX222.pcm.front.0 { -+VX222.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -15,7 +15,7 @@ VX222.pcm.front.0 { - - - --VX222.pcm.iec958.0 { -+VX222.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -diff --git a/src/conf/cards/VXPocket.conf b/src/conf/cards/VXPocket.conf -index fe44ff53..90b13347 100644 ---- a/src/conf/cards/VXPocket.conf -+++ b/src/conf/cards/VXPocket.conf -@@ -4,7 +4,7 @@ - - - --VXPocket.pcm.front.0 { -+VXPocket.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -15,7 +15,7 @@ VXPocket.pcm.front.0 { - - - --VXPocket.pcm.iec958.0 { -+VXPocket.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string -diff --git a/src/conf/cards/VXPocket440.conf b/src/conf/cards/VXPocket440.conf -index 197c2d6c..87a0855a 100644 ---- a/src/conf/cards/VXPocket440.conf -+++ b/src/conf/cards/VXPocket440.conf -@@ -4,7 +4,7 @@ - - - --VXPocket440.pcm.front.0 { -+VXPocket440.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -15,7 +15,7 @@ VXPocket440.pcm.front.0 { - - - --VXPocket440.pcm.rear.0 { -+VXPocket440.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -27,7 +27,7 @@ VXPocket440.pcm.rear.0 { - - - --VXPocket440.pcm.surround40.0 { -+VXPocket440.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -64,7 +64,7 @@ VXPocket440.pcm.surround40.0 { - - - --VXPocket440.pcm.iec958.0 { -+VXPocket440.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From 29fa26b4b5e0d3b7ab539b38d6604d83430bf70b Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:18:22 +0100 -Subject: [PATCH 41/43] conf: YMF744: define pcm configuration block only one - time - -There may be multiple YMF744 soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/YMF744.conf | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/conf/cards/YMF744.conf b/src/conf/cards/YMF744.conf -index 84dbcbec..ad1f2132 100644 ---- a/src/conf/cards/YMF744.conf -+++ b/src/conf/cards/YMF744.conf -@@ -4,7 +4,7 @@ - - - --YMF744.pcm.front.0 { -+YMF744.pcm.front.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -15,7 +15,7 @@ YMF744.pcm.front.0 { - - - --YMF744.pcm.rear.0 { -+YMF744.pcm.rear.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -27,7 +27,7 @@ YMF744.pcm.rear.0 { - - - --YMF744.pcm.surround40.0 { -+YMF744.pcm.surround40.!0 { - @args [ CARD ] - @args.CARD { - type string -@@ -63,7 +63,7 @@ YMF744.pcm.surround40.0 { - - - --YMF744.pcm.iec958.0 { -+YMF744.pcm.iec958.!0 { - @args [ CARD AES0 AES1 AES2 AES3 ] - @args.CARD { - type string --- -2.51.1 - - -From 17ffe17f0356f333f8bf8734a02ab419bd19cd99 Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:25:34 +0100 -Subject: [PATCH 42/43] conf: pistachio-card: define pcm configuration block - only one time - -There may be multiple pistachio-card soundcards in the system. Overwrite -the PCM configurations when loaded multiple times. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/pistachio-card.conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/conf/cards/pistachio-card.conf b/src/conf/cards/pistachio-card.conf -index f68865eb..15cfd60b 100644 ---- a/src/conf/cards/pistachio-card.conf -+++ b/src/conf/cards/pistachio-card.conf -@@ -29,7 +29,7 @@ https://docs.creatordev.io/ci40/guides/hardwaredocs/MIPS_Creator_cXT200_Technica - # Subdevice #0: subdevice #0 - # - --pistachio-card.pcm.default{ -+pistachio-card.pcm.!default { - @args [ CARD ] - @args.CARD { - type string --- -2.51.1 - - -From f30c355278cf9c86420b49ab9efc7eee890b658c Mon Sep 17 00:00:00 2001 -From: Jaroslav Kysela -Date: Wed, 10 Dec 2025 16:44:12 +0100 -Subject: [PATCH 43/43] conf: cards: unify whitespace - use tabs and remove - trailing spaces - -Convert leading spaces to tabs for consistent indentation, -remove trailing whitespace from all lines, and normalize -file endings across all card configuration files. - -Signed-off-by: Jaroslav Kysela ---- - src/conf/cards/AACI.conf | 2 +- - src/conf/cards/ATIIXP-SPDMA.conf | 2 +- - src/conf/cards/ATIIXP.conf | 2 +- - src/conf/cards/AU8810.conf | 2 +- - src/conf/cards/AU8820.conf | 2 +- - src/conf/cards/AU8830.conf | 2 +- - src/conf/cards/Audigy.conf | 6 +- - src/conf/cards/Audigy2.conf | 4 +- - src/conf/cards/Aureon51.conf | 8 +- - src/conf/cards/Aureon71.conf | 8 +- - src/conf/cards/CA0106.conf | 8 +- - src/conf/cards/CMI8338-SWIEC.conf | 2 +- - src/conf/cards/CMI8338.conf | 2 +- - src/conf/cards/CMI8738-MC6.conf | 6 +- - src/conf/cards/CMI8738-MC8.conf | 8 +- - src/conf/cards/CMI8788.conf | 8 +- - src/conf/cards/CS46xx.conf | 6 +- - src/conf/cards/EMU10K1.conf | 6 +- - src/conf/cards/EMU10K1X.conf | 6 +- - src/conf/cards/ENS1370.conf | 4 +- - src/conf/cards/ENS1371.conf | 10 +-- - src/conf/cards/ES1968.conf | 2 +- - src/conf/cards/FM801.conf | 2 +- - src/conf/cards/GUS.conf | 2 +- - src/conf/cards/HDA-Intel.conf | 2 +- - src/conf/cards/ICE1712.conf | 4 +- - src/conf/cards/ICE1724.conf | 10 +-- - src/conf/cards/ICH.conf | 2 +- - src/conf/cards/ICH4.conf | 2 +- - src/conf/cards/Loopback.conf | 2 +- - src/conf/cards/Maestro3.conf | 3 +- - src/conf/cards/NFORCE.conf | 138 ++++++++++++++--------------- - src/conf/cards/PC-Speaker.conf | 3 +- - src/conf/cards/PMac.conf | 2 +- - src/conf/cards/PMacToonie.conf | 2 +- - src/conf/cards/PS3.conf | 6 +- - src/conf/cards/RME9636.conf | 2 +- - src/conf/cards/RME9652.conf | 2 +- - src/conf/cards/SB-XFi.conf | 8 +- - src/conf/cards/SI7018.conf | 6 +- - src/conf/cards/TRID4DWAVENX.conf | 4 +- - src/conf/cards/USB-Audio.conf | 2 +- - src/conf/cards/VIA686A.conf | 2 +- - src/conf/cards/VIA8233.conf | 2 +- - src/conf/cards/VIA8233A.conf | 2 +- - src/conf/cards/VIA8237.conf | 2 +- - src/conf/cards/VX222.conf | 2 +- - src/conf/cards/VXPocket.conf | 2 +- - src/conf/cards/VXPocket440.conf | 2 +- - src/conf/cards/YMF744.conf | 4 +- - src/conf/cards/pistachio-card.conf | 54 +++++------ - 51 files changed, 190 insertions(+), 192 deletions(-) - -diff --git a/src/conf/cards/AACI.conf b/src/conf/cards/AACI.conf -index ff4778b4..2f036dd6 100644 ---- a/src/conf/cards/AACI.conf -+++ b/src/conf/cards/AACI.conf -@@ -11,7 +11,7 @@ AACI.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - - -diff --git a/src/conf/cards/ATIIXP-SPDMA.conf b/src/conf/cards/ATIIXP-SPDMA.conf -index 12c40efc..6d7344e8 100644 ---- a/src/conf/cards/ATIIXP-SPDMA.conf -+++ b/src/conf/cards/ATIIXP-SPDMA.conf -@@ -11,7 +11,7 @@ ATIIXP-SPDMA.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - # default with dmix/dsnoop - ATIIXP.pcm.!default { -diff --git a/src/conf/cards/ATIIXP.conf b/src/conf/cards/ATIIXP.conf -index 13e01c48..d2736c3c 100644 ---- a/src/conf/cards/ATIIXP.conf -+++ b/src/conf/cards/ATIIXP.conf -@@ -11,7 +11,7 @@ ATIIXP.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - # default with dmix/dsnoop - ATIIXP.pcm.!default { -diff --git a/src/conf/cards/AU8810.conf b/src/conf/cards/AU8810.conf -index 6b596b68..46de6dbc 100644 ---- a/src/conf/cards/AU8810.conf -+++ b/src/conf/cards/AU8810.conf -@@ -11,7 +11,7 @@ AU8810.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - - -diff --git a/src/conf/cards/AU8820.conf b/src/conf/cards/AU8820.conf -index fe2cbc11..8e262a6f 100644 ---- a/src/conf/cards/AU8820.conf -+++ b/src/conf/cards/AU8820.conf -@@ -11,4 +11,4 @@ AU8820.pcm.front.!0 { - } - type hw - card $CARD --} -+} -diff --git a/src/conf/cards/AU8830.conf b/src/conf/cards/AU8830.conf -index 9cd78b3e..a31d8a57 100644 ---- a/src/conf/cards/AU8830.conf -+++ b/src/conf/cards/AU8830.conf -@@ -11,7 +11,7 @@ AU8830.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - - -diff --git a/src/conf/cards/Audigy.conf b/src/conf/cards/Audigy.conf -index a353c624..d2b54d3b 100644 ---- a/src/conf/cards/Audigy.conf -+++ b/src/conf/cards/Audigy.conf -@@ -36,7 +36,7 @@ Audigy.pcm.front.!0 { - } - ] - } --} -+} - - - -@@ -64,7 +64,7 @@ Audigy.pcm.rear.!0 { - } - ] - } --} -+} - - - -@@ -100,7 +100,7 @@ Audigy.pcm.center_lfe.!0 { - } - ] - } --} -+} - - - -diff --git a/src/conf/cards/Audigy2.conf b/src/conf/cards/Audigy2.conf -index 3c15fd1d..47d75680 100644 ---- a/src/conf/cards/Audigy2.conf -+++ b/src/conf/cards/Audigy2.conf -@@ -37,7 +37,7 @@ Audigy2.pcm.front.!0 { - - ] - } --} -+} - - - -@@ -65,7 +65,7 @@ Audigy2.pcm.rear.!0 { - } - ] - } --} -+} - - - -diff --git a/src/conf/cards/Aureon51.conf b/src/conf/cards/Aureon51.conf -index db907f82..da7e26dc 100644 ---- a/src/conf/cards/Aureon51.conf -+++ b/src/conf/cards/Aureon51.conf -@@ -34,7 +34,7 @@ Aureon51.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - - -@@ -47,7 +47,7 @@ Aureon51.pcm.rear.!0 { - card $CARD - device 2 - subdevice 1 --} -+} - - - -@@ -59,7 +59,7 @@ Aureon51.pcm.center_lfe.!0 { - type hw - card $CARD - device 2 --} -+} - - - -@@ -84,7 +84,7 @@ Aureon51.pcm.surround40.!0 { - type hw - card $CARD - channels 4 --} -+} - - - -diff --git a/src/conf/cards/Aureon71.conf b/src/conf/cards/Aureon71.conf -index f29bc297..98e65ab0 100644 ---- a/src/conf/cards/Aureon71.conf -+++ b/src/conf/cards/Aureon71.conf -@@ -34,7 +34,7 @@ Aureon71.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - - -@@ -46,7 +46,7 @@ Aureon71.pcm.rear.!0 { - type hw - card $CARD - device 2 --} -+} - - - -@@ -59,7 +59,7 @@ Aureon71.pcm.center_lfe.!0 { - card $CARD - device 2 - subdevice 1 --} -+} - - - -@@ -84,7 +84,7 @@ Aureon71.pcm.surround40.!0 { - type hw - card $CARD - channels 4 --} -+} - - - -diff --git a/src/conf/cards/CA0106.conf b/src/conf/cards/CA0106.conf -index 1fea79f5..bf90c3c6 100644 ---- a/src/conf/cards/CA0106.conf -+++ b/src/conf/cards/CA0106.conf -@@ -34,7 +34,7 @@ CA0106.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - - -@@ -46,7 +46,7 @@ CA0106.pcm.rear.!0 { - type hw - card $CARD - device 1 --} -+} - - - -@@ -58,7 +58,7 @@ CA0106.pcm.center_lfe.!0 { - type hw - card $CARD - device 2 --} -+} - - - -@@ -70,7 +70,7 @@ CA0106.pcm.side.!0 { - type hw - card $CARD - device 3 --} -+} - - - -diff --git a/src/conf/cards/CMI8338-SWIEC.conf b/src/conf/cards/CMI8338-SWIEC.conf -index ca86c466..2a9b777c 100644 ---- a/src/conf/cards/CMI8338-SWIEC.conf -+++ b/src/conf/cards/CMI8338-SWIEC.conf -@@ -12,7 +12,7 @@ CMI8338-SWIEC.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - # default with dmix/dsnoop - CMI8338-SWIEC.pcm.!default { -diff --git a/src/conf/cards/CMI8338.conf b/src/conf/cards/CMI8338.conf -index 0f92ad0b..8bd1159d 100644 ---- a/src/conf/cards/CMI8338.conf -+++ b/src/conf/cards/CMI8338.conf -@@ -11,7 +11,7 @@ CMI8338.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - # default with dmix/dsnoop - CMI8338.pcm.!default { -diff --git a/src/conf/cards/CMI8738-MC6.conf b/src/conf/cards/CMI8738-MC6.conf -index 2b1c7d05..6bb17712 100644 ---- a/src/conf/cards/CMI8738-MC6.conf -+++ b/src/conf/cards/CMI8738-MC6.conf -@@ -11,7 +11,7 @@ CMI8738-MC6.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - # default with dmix/dsnoop - CMI8738-MC6.pcm.!default { -@@ -75,7 +75,7 @@ CMI8738-MC6.pcm.surround40.!0 { - } - ] - } --} -+} - - - -@@ -105,7 +105,7 @@ CMI8738-MC6.pcm.surround51.!0 { - } - ] - } --} -+} - - - -diff --git a/src/conf/cards/CMI8738-MC8.conf b/src/conf/cards/CMI8738-MC8.conf -index 96cb3f10..239014d4 100644 ---- a/src/conf/cards/CMI8738-MC8.conf -+++ b/src/conf/cards/CMI8738-MC8.conf -@@ -18,7 +18,7 @@ CMI8738-MC8.pcm.front.!0 { - name "PCM Playback Volume" - card $CARD - } --} -+} - - # default with dmix+softvol & dsnoop - CMI8738-MC8.pcm.!default { -@@ -102,7 +102,7 @@ CMI8738-MC8.pcm.surround40.!0 { - name "PCM Playback Volume" - card $CARD - } --} -+} - - - -@@ -140,7 +140,7 @@ CMI8738-MC8.pcm.surround51.!0 { - name "PCM Playback Volume" - card $CARD - } --} -+} - - - -@@ -174,7 +174,7 @@ CMI8738-MC8.pcm.surround71.!0 { - name "PCM Playback Volume" - card $CARD - } --} -+} - - - -diff --git a/src/conf/cards/CMI8788.conf b/src/conf/cards/CMI8788.conf -index c4ad9f48..32ab8fb4 100644 ---- a/src/conf/cards/CMI8788.conf -+++ b/src/conf/cards/CMI8788.conf -@@ -11,7 +11,7 @@ CMI8788.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - # default with dmix & dsnoop - CMI8788.pcm.!default { -@@ -46,7 +46,7 @@ CMI8788.pcm.surround40.!0 { - type hw - card $CARD - channels 4 --} -+} - - - -@@ -61,7 +61,7 @@ CMI8788.pcm.surround51.!0 { - type hw - card $CARD - channels 6 --} -+} - - - -@@ -73,7 +73,7 @@ CMI8788.pcm.surround71.!0 { - type hw - card $CARD - channels 8 --} -+} - - - -diff --git a/src/conf/cards/CS46xx.conf b/src/conf/cards/CS46xx.conf -index 478cbf3e..ad6a2218 100644 ---- a/src/conf/cards/CS46xx.conf -+++ b/src/conf/cards/CS46xx.conf -@@ -11,7 +11,7 @@ CS46xx.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - # default with plughw - # CS46xx supports multi-playback -@@ -62,7 +62,7 @@ CS46xx.pcm.rear.!0 { - } - ] - } --} -+} - - - -@@ -74,7 +74,7 @@ CS46xx.pcm.center_lfe.!0 { - type hw - card $CARD - device 3 --} -+} - - - -diff --git a/src/conf/cards/EMU10K1.conf b/src/conf/cards/EMU10K1.conf -index 5ef12c03..c2dc7590 100644 ---- a/src/conf/cards/EMU10K1.conf -+++ b/src/conf/cards/EMU10K1.conf -@@ -43,7 +43,7 @@ EMU10K1.pcm.front.!0 { - type hw - card $CARD - } --} -+} - - - -@@ -74,7 +74,7 @@ EMU10K1.pcm.rear.!0 { - ] - } - } --} -+} - - - -@@ -139,7 +139,7 @@ EMU10K1.pcm.center_lfe.!0 { - ] - } - } --} -+} - - - -diff --git a/src/conf/cards/EMU10K1X.conf b/src/conf/cards/EMU10K1X.conf -index 334f897d..7d73ba44 100644 ---- a/src/conf/cards/EMU10K1X.conf -+++ b/src/conf/cards/EMU10K1X.conf -@@ -34,7 +34,7 @@ EMU10K1X.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - - -@@ -46,7 +46,7 @@ EMU10K1X.pcm.rear.!0 { - type hw - card $CARD - device 1 --} -+} - - - -@@ -58,7 +58,7 @@ EMU10K1X.pcm.center_lfe.!0 { - type hw - card $CARD - device 2 --} -+} - - - -diff --git a/src/conf/cards/ENS1370.conf b/src/conf/cards/ENS1370.conf -index c65e224f..446c2f7d 100644 ---- a/src/conf/cards/ENS1370.conf -+++ b/src/conf/cards/ENS1370.conf -@@ -12,7 +12,7 @@ ENS1370.pcm.front.!0 { - type hw - card $CARD - device 1 --} -+} - - # default with dmix/dsnoop - ENS1370.pcm.!default { -@@ -67,7 +67,7 @@ ENS1370.pcm.rear.!0 { - } - ] - } --} -+} - - - -diff --git a/src/conf/cards/ENS1371.conf b/src/conf/cards/ENS1371.conf -index 560fda9f..549fd7c9 100644 ---- a/src/conf/cards/ENS1371.conf -+++ b/src/conf/cards/ENS1371.conf -@@ -11,7 +11,7 @@ ENS1371.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - # default with dmix/dsnoop - ENS1371.pcm.!default { -@@ -61,7 +61,7 @@ ENS1371.pcm.rear.!0 { - } - ] - } --} -+} - - - -@@ -78,11 +78,11 @@ ENS1371.pcm.surround40.!0 { - strings [ "cards.ENS1371.pcm.front.0:CARD=" $CARD ] - } - channels 2 -- } -+ } - { - pcm { - @func concat -- strings [ "cards.ENS1371.pcm.rear.0:CARD=" $CARD ] -+ strings [ "cards.ENS1371.pcm.rear.0:CARD=" $CARD ] - } - channels 2 - } -@@ -94,7 +94,7 @@ ENS1371.pcm.surround40.!0 { - { slave 1 channel 1 } - ] - } -- -+ - - - ENS1371.pcm.iec958.!0 { -diff --git a/src/conf/cards/ES1968.conf b/src/conf/cards/ES1968.conf -index 296baa13..83dcf93b 100644 ---- a/src/conf/cards/ES1968.conf -+++ b/src/conf/cards/ES1968.conf -@@ -9,4 +9,4 @@ ES1968.pcm.front.!0 { - } - type hw - card $CARD --} -+} -diff --git a/src/conf/cards/FM801.conf b/src/conf/cards/FM801.conf -index 14cfdbe8..b8bed781 100644 ---- a/src/conf/cards/FM801.conf -+++ b/src/conf/cards/FM801.conf -@@ -11,7 +11,7 @@ FM801.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - # default with dmix/dsnoop - FM801.pcm.!default { -diff --git a/src/conf/cards/GUS.conf b/src/conf/cards/GUS.conf -index a1ccd0e9..42a612a6 100644 ---- a/src/conf/cards/GUS.conf -+++ b/src/conf/cards/GUS.conf -@@ -16,4 +16,4 @@ GUS.pcm.front.!0 { - type hw - card $CARD - } --} -+} -diff --git a/src/conf/cards/HDA-Intel.conf b/src/conf/cards/HDA-Intel.conf -index 76775b97..cacd2815 100644 ---- a/src/conf/cards/HDA-Intel.conf -+++ b/src/conf/cards/HDA-Intel.conf -@@ -26,7 +26,7 @@ HDA-Intel.pcm.front.!0 { - type hw - card $CARD - } --} -+} - - # default with dmix+softvol & dsnoop - HDA-Intel.pcm.!default { -diff --git a/src/conf/cards/ICE1712.conf b/src/conf/cards/ICE1712.conf -index 190d2c59..08b84f30 100644 ---- a/src/conf/cards/ICE1712.conf -+++ b/src/conf/cards/ICE1712.conf -@@ -53,7 +53,7 @@ ICE1712.pcm.front.!0 { - } - slave.channels 12 - } --} -+} - - - -@@ -72,7 +72,7 @@ ICE1712.pcm.surround40.!0 { - card $CARD - } - slave.channels 10 --} -+} - - - -diff --git a/src/conf/cards/ICE1724.conf b/src/conf/cards/ICE1724.conf -index 16045dc4..678df41d 100644 ---- a/src/conf/cards/ICE1724.conf -+++ b/src/conf/cards/ICE1724.conf -@@ -34,7 +34,7 @@ ICE1724.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - - -@@ -47,7 +47,7 @@ ICE1724.pcm.rear.!0 { - card $CARD - device 2 - subdevice 1 --} -+} - - - -@@ -59,7 +59,7 @@ ICE1724.pcm.center_lfe.!0 { - type hw - card $CARD - device 2 --} -+} - - - -@@ -93,7 +93,7 @@ ICE1724.pcm.surround40.!0 { - card $CARD - } - } --} -+} - - - -@@ -114,7 +114,7 @@ ICE1724.pcm.surround51.!0 { - ttable.5.3 1 - slave { - channels 6 -- pcm { -+ pcm { - type hw - card $CARD - } -diff --git a/src/conf/cards/ICH.conf b/src/conf/cards/ICH.conf -index c35c8d02..573b9e26 100644 ---- a/src/conf/cards/ICH.conf -+++ b/src/conf/cards/ICH.conf -@@ -18,7 +18,7 @@ ICH.pcm.front.!0 { - name "PCM Playback Volume" - card $CARD - } --} -+} - - # default with dmix+softvol & dsnoop - ICH.pcm.!default { -diff --git a/src/conf/cards/ICH4.conf b/src/conf/cards/ICH4.conf -index 11c85a6e..5641c9c4 100644 ---- a/src/conf/cards/ICH4.conf -+++ b/src/conf/cards/ICH4.conf -@@ -18,7 +18,7 @@ ICH4.pcm.front.!0 { - name "PCM Playback Volume" - card $CARD - } --} -+} - - # default with dmix+softvol & dsnoop - ICH4.pcm.!default { -diff --git a/src/conf/cards/Loopback.conf b/src/conf/cards/Loopback.conf -index 21c8429c..3911aed5 100644 ---- a/src/conf/cards/Loopback.conf -+++ b/src/conf/cards/Loopback.conf -@@ -18,7 +18,7 @@ Loopback.pcm.front.!0 { - name "PCM Playback Volume" - card $CARD - } --} -+} - - # default with dmix+softvol & dsnoop - Loopback.pcm.!default { -diff --git a/src/conf/cards/Maestro3.conf b/src/conf/cards/Maestro3.conf -index a8d89a48..c0e3da31 100644 ---- a/src/conf/cards/Maestro3.conf -+++ b/src/conf/cards/Maestro3.conf -@@ -9,7 +9,7 @@ Maestro3.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - # default with dmix/dsnoop - Maestro3.pcm.!default { -@@ -35,4 +35,3 @@ Maestro3.pcm.!default { - } - } - } -- -diff --git a/src/conf/cards/NFORCE.conf b/src/conf/cards/NFORCE.conf -index 088cd8ce..aeef6b40 100644 ---- a/src/conf/cards/NFORCE.conf -+++ b/src/conf/cards/NFORCE.conf -@@ -18,7 +18,7 @@ NFORCE.pcm.front.!0 { - name "PCM Playback Volume" - card $CARD - } --} -+} - - # default with dmix+softvol & dsnoop - NFORCE.pcm.!default { -@@ -175,74 +175,74 @@ NFORCE.pcm.surround51.!0 { - - - NFORCE.pcm.surround71.!0 { -- @args [ CARD ] -- @args.CARD { -- type string -- } -- type softvol -- slave.pcm { -- type route -- ttable.0.0 1 -- ttable.1.1 1 -- ttable.2.4 1 -- ttable.3.5 1 -- ttable.4.2 1 -- ttable.5.3 1 -- ttable.6.6 1 -- ttable.7.7 1 -- slave.pcm { -- type hooks -- slave.pcm { -- type hw -- card $CARD -- device 0 -- } -- hooks.0 { -- type ctl_elems -- hook_args [ -- { -- name "Channel Mode" -- preserve true -- value "8ch" -- lock true -- optional true -- } -- # for old drivers -- { -- name "Line-In As Surround" -- preserve true -- value true -- optional true -- } -- { -- name "Mic As Center/LFE" -- preserve true -- value true -- optional true -- } -- { -- name "Surround Down Mix" -- preserve true -- value off -- lock true -- optional true -- } -- { -- name "Center/LFE Down Mix" -- preserve true -- value off -- lock true -- optional true -- } -- ] -- } -- } -- slave.channels 8 -- } -- control { -- name "PCM Playback Volume" -- card $CARD -- } -+ @args [ CARD ] -+ @args.CARD { -+ type string -+ } -+ type softvol -+ slave.pcm { -+ type route -+ ttable.0.0 1 -+ ttable.1.1 1 -+ ttable.2.4 1 -+ ttable.3.5 1 -+ ttable.4.2 1 -+ ttable.5.3 1 -+ ttable.6.6 1 -+ ttable.7.7 1 -+ slave.pcm { -+ type hooks -+ slave.pcm { -+ type hw -+ card $CARD -+ device 0 -+ } -+ hooks.0 { -+ type ctl_elems -+ hook_args [ -+ { -+ name "Channel Mode" -+ preserve true -+ value "8ch" -+ lock true -+ optional true -+ } -+ # for old drivers -+ { -+ name "Line-In As Surround" -+ preserve true -+ value true -+ optional true -+ } -+ { -+ name "Mic As Center/LFE" -+ preserve true -+ value true -+ optional true -+ } -+ { -+ name "Surround Down Mix" -+ preserve true -+ value off -+ lock true -+ optional true -+ } -+ { -+ name "Center/LFE Down Mix" -+ preserve true -+ value off -+ lock true -+ optional true -+ } -+ ] -+ } -+ } -+ slave.channels 8 -+ } -+ control { -+ name "PCM Playback Volume" -+ card $CARD -+ } - } - - -diff --git a/src/conf/cards/PC-Speaker.conf b/src/conf/cards/PC-Speaker.conf -index 8a40a139..97cb0d5d 100644 ---- a/src/conf/cards/PC-Speaker.conf -+++ b/src/conf/cards/PC-Speaker.conf -@@ -20,7 +20,7 @@ PC-Speaker.pcm.front.!0 { - } - min_dB -10.0 - max_dB 20.0 --} -+} - - # default with dmix & null - PC-Speaker.pcm.!default { -@@ -49,4 +49,3 @@ PC-Speaker.pcm.!default { - type null - } - } -- -diff --git a/src/conf/cards/PMac.conf b/src/conf/cards/PMac.conf -index 00f3bc89..67dfabc6 100644 ---- a/src/conf/cards/PMac.conf -+++ b/src/conf/cards/PMac.conf -@@ -11,7 +11,7 @@ PMac.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - # default with dmix/dsnoop - PMac.pcm.!default { -diff --git a/src/conf/cards/PMacToonie.conf b/src/conf/cards/PMacToonie.conf -index aff1ea65..c45cf12b 100644 ---- a/src/conf/cards/PMacToonie.conf -+++ b/src/conf/cards/PMacToonie.conf -@@ -18,7 +18,7 @@ PMacToonie.pcm.front.!0 { - name "PCM Playback Volume" - card $CARD - } --} -+} - - # default with dmix+softvol & dsnoop - PMacToonie.pcm.!default { -diff --git a/src/conf/cards/PS3.conf b/src/conf/cards/PS3.conf -index 486d790c..8a165fc3 100644 ---- a/src/conf/cards/PS3.conf -+++ b/src/conf/cards/PS3.conf -@@ -19,7 +19,7 @@ PS3.pcm.front.!0 { - name "PCM Playback Volume" - card $CARD - } --} -+} - - # default with dmix+softvol - PS3.pcm.!default { -@@ -34,8 +34,8 @@ PS3.pcm.!default { - type softvol - slave.pcm { - @func concat -- #strings [ "dmix:CARD=" $CARD ] -- strings [ "dmix:CARD=" $CARD ",FORMAT=S16" ] -+ #strings [ "dmix:CARD=" $CARD ] -+ strings [ "dmix:CARD=" $CARD ",FORMAT=S16" ] - } - control { - name "PCM Playback Volume" -diff --git a/src/conf/cards/RME9636.conf b/src/conf/cards/RME9636.conf -index 17b3a1ab..c5c74ee9 100644 ---- a/src/conf/cards/RME9636.conf -+++ b/src/conf/cards/RME9636.conf -@@ -11,7 +11,7 @@ RME9636.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - # FIXME: This configuration is not valid for double-speed rates. - -diff --git a/src/conf/cards/RME9652.conf b/src/conf/cards/RME9652.conf -index a11e42b2..34ef91bb 100644 ---- a/src/conf/cards/RME9652.conf -+++ b/src/conf/cards/RME9652.conf -@@ -11,7 +11,7 @@ RME9652.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - # FIXME: This configuration is not valid for double-speed rates. - -diff --git a/src/conf/cards/SB-XFi.conf b/src/conf/cards/SB-XFi.conf -index 9ce9c8ac..64e3d082 100644 ---- a/src/conf/cards/SB-XFi.conf -+++ b/src/conf/cards/SB-XFi.conf -@@ -12,7 +12,7 @@ SB-XFi.pcm.front.!0 { - type hw - card $CARD - device 0 --} -+} - - - -@@ -25,7 +25,7 @@ SB-XFi.pcm.rear.!0 { - card $CARD - device 1 - hint.device 1 --} -+} - - - -@@ -38,7 +38,7 @@ SB-XFi.pcm.center_lfe.!0 { - card $CARD - device 2 - hint.device 2 --} -+} - - - -@@ -51,7 +51,7 @@ SB-XFi.pcm.side.!0 { - card $CARD - device 3 - hint.device 3 --} -+} - - - -diff --git a/src/conf/cards/SI7018.conf b/src/conf/cards/SI7018.conf -index 33d19085..3a22107c 100644 ---- a/src/conf/cards/SI7018.conf -+++ b/src/conf/cards/SI7018.conf -@@ -14,7 +14,7 @@ SI7018.pcm.front.!0 { - type hw - card $CARD - chmap [ "UNKNOWN" "FL,FR" ] --} -+} - - - -@@ -23,7 +23,7 @@ SI7018.pcm.rear.!0 { - @args.CARD { - type string - } -- type hooks -+ type hooks - slave.pcm { - type hw - card $CARD -@@ -40,7 +40,7 @@ SI7018.pcm.rear.!0 { - } - ] - } --} -+} - - - -diff --git a/src/conf/cards/TRID4DWAVENX.conf b/src/conf/cards/TRID4DWAVENX.conf -index 5001297e..3c25515e 100644 ---- a/src/conf/cards/TRID4DWAVENX.conf -+++ b/src/conf/cards/TRID4DWAVENX.conf -@@ -12,7 +12,7 @@ TRID4DWAVENX.pcm.front.!0 { - type hw - card $CARD - chmap [ "UNKNOWN" "FL,FR" ] --} -+} - - - -@@ -52,7 +52,7 @@ TRID4DWAVENX.pcm.rear.!0 { - } - ] - } --} -+} - - - -diff --git a/src/conf/cards/USB-Audio.conf b/src/conf/cards/USB-Audio.conf -index 1fc540e2..33d856f2 100644 ---- a/src/conf/cards/USB-Audio.conf -+++ b/src/conf/cards/USB-Audio.conf -@@ -47,7 +47,7 @@ USB-Audio.pcm.iec958_device { - "XONAR U5" 1 - "XONAR SOUND CARD" 1 - "Xonar SoundCard" 2 -- -+ - # The below don't have digital in/out, so prevent them from being opened. - "Andrea PureAudio USB-SA Headset" 999 - "Blue Snowball" 999 -diff --git a/src/conf/cards/VIA686A.conf b/src/conf/cards/VIA686A.conf -index c53dd71b..40c2f89e 100644 ---- a/src/conf/cards/VIA686A.conf -+++ b/src/conf/cards/VIA686A.conf -@@ -14,7 +14,7 @@ VIA686A.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - # default with dmix/dsnoop - VIA686A.pcm.!default { -diff --git a/src/conf/cards/VIA8233.conf b/src/conf/cards/VIA8233.conf -index 3c25a11b..ccc7fe2f 100644 ---- a/src/conf/cards/VIA8233.conf -+++ b/src/conf/cards/VIA8233.conf -@@ -11,7 +11,7 @@ VIA8233.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - # default with softvol/dsnoop - # VIA8233 supports multi-playback -diff --git a/src/conf/cards/VIA8233A.conf b/src/conf/cards/VIA8233A.conf -index c9e56e20..e566edeb 100644 ---- a/src/conf/cards/VIA8233A.conf -+++ b/src/conf/cards/VIA8233A.conf -@@ -11,7 +11,7 @@ VIA8233A.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - # default with dmix/dsnoop - VIA8233A.pcm.!default { -diff --git a/src/conf/cards/VIA8237.conf b/src/conf/cards/VIA8237.conf -index 49fd6f2c..074e342c 100644 ---- a/src/conf/cards/VIA8237.conf -+++ b/src/conf/cards/VIA8237.conf -@@ -11,7 +11,7 @@ VIA8237.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - # default with softvol/dsnoop - # VIA8237 supports multi-playback -diff --git a/src/conf/cards/VX222.conf b/src/conf/cards/VX222.conf -index 2c6e2297..96ea32f6 100644 ---- a/src/conf/cards/VX222.conf -+++ b/src/conf/cards/VX222.conf -@@ -11,7 +11,7 @@ VX222.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - - -diff --git a/src/conf/cards/VXPocket.conf b/src/conf/cards/VXPocket.conf -index 90b13347..81260a7d 100644 ---- a/src/conf/cards/VXPocket.conf -+++ b/src/conf/cards/VXPocket.conf -@@ -11,7 +11,7 @@ VXPocket.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - - -diff --git a/src/conf/cards/VXPocket440.conf b/src/conf/cards/VXPocket440.conf -index 87a0855a..6b3aea40 100644 ---- a/src/conf/cards/VXPocket440.conf -+++ b/src/conf/cards/VXPocket440.conf -@@ -11,7 +11,7 @@ VXPocket440.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - - -diff --git a/src/conf/cards/YMF744.conf b/src/conf/cards/YMF744.conf -index ad1f2132..974bf791 100644 ---- a/src/conf/cards/YMF744.conf -+++ b/src/conf/cards/YMF744.conf -@@ -11,7 +11,7 @@ YMF744.pcm.front.!0 { - } - type hw - card $CARD --} -+} - - - -@@ -23,7 +23,7 @@ YMF744.pcm.rear.!0 { - type hw - card $CARD - device 2 --} -+} - - - -diff --git a/src/conf/cards/pistachio-card.conf b/src/conf/cards/pistachio-card.conf -index 15cfd60b..d92c019a 100644 ---- a/src/conf/cards/pistachio-card.conf -+++ b/src/conf/cards/pistachio-card.conf -@@ -1,10 +1,10 @@ - # - # Configuration for the pistachio chip. - # --# The data sheet of the chip and technical reference manual can be --found at -+# The data sheet of the chip and technical reference manual can be -+found at - https://docs.creatordev.io/ci40/guides/hardwaredocs/cXT200_datasheet2.p --df # and -+df # and - https://docs.creatordev.io/ci40/guides/hardwaredocs/MIPS_Creator_cXT200_Technical_Reference_Manual_1.0.112.pdf. - # - # The list of hardware devices is as per below: -@@ -30,30 +30,30 @@ https://docs.creatordev.io/ci40/guides/hardwaredocs/MIPS_Creator_cXT200_Technica - # - - pistachio-card.pcm.!default { -- @args [ CARD ] -- @args.CARD { -- type string -- default "pistachio" -- } -- @args.DEVICE { -- type integer -- default 2 -- } -+ @args [ CARD ] -+ @args.CARD { -+ type string -+ default "pistachio" -+ } -+ @args.DEVICE { -+ type integer -+ default 2 -+ } - -- type asym -- capture.pcm { -- type multi -- slaves.a.pcm "hw:0,4" -- slaves.a.channels 12 -- bindings.0.slave a -- bindings.0.channel 4 -- bindings.1.slave a -- bindings.1.channel 5 -- } -+ type asym -+ capture.pcm { -+ type multi -+ slaves.a.pcm "hw:0,4" -+ slaves.a.channels 12 -+ bindings.0.slave a -+ bindings.0.channel 4 -+ bindings.1.slave a -+ bindings.1.channel 5 -+ } - -- playback.pcm { -- type hw -- card $CARD -- device $DEVICE -- } -+ playback.pcm { -+ type hw -+ card $CARD -+ device $DEVICE -+ } - } --- -2.51.1 - diff --git a/alsa-lib.spec b/alsa-lib.spec index f64c71c..c7f5e16 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,14 +2,17 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.15 -%define version_alsa_ucm 1.2.15 +%define version_alsa_lib 1.2.15.1 +%define version_alsa_ucm 1.2.15.1 %define version_alsa_tplg 1.2.5 +%global lib_patch 0 +%global ucm_patch 0 + Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 4%{?prever_dot}%{?dist} +Release: 1%{?prever_dot}%{?dist} License: LGPL-2.1-or-later URL: http://www.alsa-project.org/ @@ -19,8 +22,12 @@ Source2: ftp://ftp.alsa-project.org/pub/lib/alsa-topology-conf-%{version_alsa_t Source10: asound.conf Source11: modprobe-dist-alsa.conf Source12: modprobe-dist-oss.conf +%if %{ucm_patch} Source40: alsa-ucm-conf.patch +%endif +%if %{lib_patch} Patch0: alsa-git.patch +%endif Patch1: alsa-lib-1.2.3.1-config.patch Patch2: alsa-lib-1.2.10-glibc-open.patch @@ -70,7 +77,9 @@ contains alsa-lib configuration of SoC topology %prep %setup -q -n %{name}-%{version}%{?prever}%{?postver} +%if %{lib_patch} %patch -P0 -p1 -b .alsa-git +%endif %patch -P1 -p1 -b .config %patch -P2 -p1 -b .glibc-open @@ -116,7 +125,9 @@ mkdir -p %{buildroot}/%{_datadir}/alsa/ucm2 # Unpack UCMs tar xvjf %{SOURCE1} -C %{buildroot}/%{_datadir}/alsa --strip-components=1 "*/ucm" "*/ucm2" +%if %{ucm_patch} patch -d %{buildroot}/%{_datadir}/alsa -p1 < %{SOURCE40} +%endif # Create topology directory mkdir -p %{buildroot}/%{_datadir}/alsa/topology @@ -167,6 +178,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Fri Dec 19 2025 Jaroslav Kysela - 1.2.15.1-1 +- update to 1.2.15.1 + * Wed Dec 10 2025 Jaroslav Kysela - 1.2.15-4 - update to 1.2.15 diff --git a/alsa-ucm-conf.patch b/alsa-ucm-conf.patch deleted file mode 100644 index 0447c61..0000000 --- a/alsa-ucm-conf.patch +++ /dev/null @@ -1,264 +0,0 @@ -From d57d800c6a5a77e6c475719b0297bebb098f7533 Mon Sep 17 00:00:00 2001 -From: Maciej Strozek -Date: Tue, 9 Dec 2025 13:00:44 +0000 -Subject: [PATCH 1/3] sof-soundwire: third fix for multi-codec - -Ensure MultiCodec-based actions are only done when MultiCodec1 is not empty - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/658 -Signed-off-by: Maciej Strozek -Signed-off-by: Jaroslav Kysela ---- - ucm2/sof-soundwire/sof-soundwire.conf | 15 +++++++++------ - 1 file changed, 9 insertions(+), 6 deletions(-) - -diff --git a/ucm2/sof-soundwire/sof-soundwire.conf b/ucm2/sof-soundwire/sof-soundwire.conf -index 7f9c7dc..895f479 100644 ---- a/ucm2/sof-soundwire/sof-soundwire.conf -+++ b/ucm2/sof-soundwire/sof-soundwire.conf -@@ -72,8 +72,9 @@ If.multi_init { - If.multi_speaker { - Condition { - Type RegexMatch -- Regex "(${var:MultiCodec1}(-sdca)?)" -- String "${var:SpeakerCodec1}" -+ # guard with "=" to avoid empty string matching -+ Regex "=(${var:MultiCodec1}(-sdca)?)=" -+ String "=${var:SpeakerCodec1}=" - } - True { - Define.SpeakerCodec1 "" -@@ -83,8 +84,9 @@ If.multi_speaker { - If.multi_mic { - Condition { - Type RegexMatch -- Regex "(${var:MultiCodec1}(-sdca)?)" -- String "${var:MicCodec1}" -+ # guard with "=" to avoid empty string matching -+ Regex "=(${var:MultiCodec1}(-sdca)?)=" -+ String "=${var:MicCodec1}=" - } - True { - Define.MicCodec1 "" -@@ -94,8 +96,9 @@ If.multi_mic { - If.multi_headset { - Condition { - Type RegexMatch -- Regex "(${var:MultiCodec1}(-sdca)?)" -- String "${var:HeadsetCodec1}" -+ # guard with "=" to avoid empty string matching -+ Regex "=(${var:MultiCodec1}(-sdca)?)=" -+ String "=${var:HeadsetCodec1}=" - } - True { - Define.HeadsetCodec1 "" --- -2.51.1 - - -From 51bada5f0c1b634b5db92de428f33c0188e68e82 Mon Sep 17 00:00:00 2001 -From: Maciej Strozek -Date: Fri, 28 Nov 2025 16:08:23 +0000 -Subject: [PATCH 2/3] ucm2: sof-soundwire: Simplify cs42l45 configs - -Simplify cs42l45 configs following machine driver changes [1] -which bring normal switches instead of mute switches. - -[1] https://lore.kernel.org/all/20251127163426.2500633-2-ckeepax@opensource.cirrus.com/ - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/655 -Signed-off-by: Maciej Strozek -Signed-off-by: Jaroslav Kysela ---- - ucm2/codecs/cs42l45-dmic/init.conf | 17 +++++++++++++++-- - ucm2/codecs/cs42l45/init.conf | 24 ++++++++++++++++++++++++ - ucm2/sof-soundwire/cs42l45-dmic.conf | 8 ++------ - ucm2/sof-soundwire/cs42l45.conf | 18 +++--------------- - ucm2/sof-soundwire/sof-soundwire.conf | 2 +- - 5 files changed, 45 insertions(+), 24 deletions(-) - create mode 100644 ucm2/codecs/cs42l45/init.conf - -diff --git a/ucm2/codecs/cs42l45-dmic/init.conf b/ucm2/codecs/cs42l45-dmic/init.conf -index 6dd19bb..deefb3d 100644 ---- a/ucm2/codecs/cs42l45-dmic/init.conf -+++ b/ucm2/codecs/cs42l45-dmic/init.conf -@@ -1,9 +1,22 @@ - # cs42l45 specific control settings - -+LibraryConfig.remap.Config { -+ ctl.default.map { -+ "name='cs42l45 Microphone Capture Switch'" { -+ "name='cs42l45 FU 113 Channel Switch'".vindex.0 0 -+ "name='cs42l45 FU 113 Channel Switch'".vindex.1 1 -+ } -+ "name='cs42l45 Microphone Capture Volume'" { -+ "name='cs42l45 FU 113 Channel Volume'".vindex.0 0 -+ "name='cs42l45 FU 113 Channel Volume'".vindex.1 1 -+ } -+ } -+} -+ - BootSequence [ -- cset "name='cs42l45 FU 113 Mute Switch' 0" -+ cset "name='cs42l45 FU 113 Channel Switch' 0" - ] - - Macro [ -- { SetLED { LED="mic" Action="attach" CtlId="cs42l45 FU 113 Mute Switch" Mode="follow-route"} } -+ { SetLED { LED="mic" Action="attach" CtlId="cs42l45 FU 113 Channel Switch"} } - ] -diff --git a/ucm2/codecs/cs42l45/init.conf b/ucm2/codecs/cs42l45/init.conf -new file mode 100644 -index 0000000..f4aee4a ---- /dev/null -+++ b/ucm2/codecs/cs42l45/init.conf -@@ -0,0 +1,24 @@ -+# cs42l45 specific control settings -+ -+LibraryConfig.remap.Config { -+ ctl.default.map { -+ "name='cs42l45 Jack Microphone Capture Switch'" { -+ "name='cs42l45 FU 36 Channel Switch'".vindex.0 0 -+ "name='cs42l45 FU 36 Channel Switch'".vindex.1 1 -+ } -+ "name='cs42l45 Jack Microphone Capture Volume'" { -+ "name='cs42l45 FU 36 Channel Volume'".vindex.0 0 -+ "name='cs42l45 FU 36 Channel Volume'".vindex.1 1 -+ } -+ } -+ ctl.default.map { -+ "name='cs42l45 Headphone Playback Switch'" { -+ "name='cs42l45 FU 41 Channel Switch'".vindex.0 0 -+ "name='cs42l45 FU 41 Channel Switch'".vindex.1 1 -+ } -+ "name='cs42l45 Headphone Playback Volume'" { -+ "name='cs42l45 FU 41 Channel Volume'".vindex.0 0 -+ "name='cs42l45 FU 41 Channel Volume'".vindex.1 1 -+ } -+ } -+} -\ No newline at end of file -diff --git a/ucm2/sof-soundwire/cs42l45-dmic.conf b/ucm2/sof-soundwire/cs42l45-dmic.conf -index 9477cba..d46808e 100644 ---- a/ucm2/sof-soundwire/cs42l45-dmic.conf -+++ b/ucm2/sof-soundwire/cs42l45-dmic.conf -@@ -7,18 +7,14 @@ SectionDevice."Mic" { - "Headset" - ] - -- EnableSequence [ -- cset "name='cs42l45 FU 113 Mute Switch' 0" -- ] -- - DisableSequence [ -- cset "name='cs42l45 FU 113 Mute Switch' 1" -+ cset "name='cs42l45 FU 113 Channel Switch' 0" - ] - - Value { - CapturePriority 100 - CapturePCM "hw:${CardId},4" - CaptureMixer "default:${CardId}" -- CaptureVolume "cs42l45 FU 113 Channel Volume" -+ CaptureMixerElem "cs42l45 Microphone" - } - } -diff --git a/ucm2/sof-soundwire/cs42l45.conf b/ucm2/sof-soundwire/cs42l45.conf -index ba61048..c88562a 100644 ---- a/ucm2/sof-soundwire/cs42l45.conf -+++ b/ucm2/sof-soundwire/cs42l45.conf -@@ -3,19 +3,11 @@ - SectionDevice."Headphones" { - Comment "Headphones" - -- EnableSequence [ -- cset "name='cs42l45 FU 41 Mute Switch' 0" -- ] -- -- DisableSequence [ -- cset "name='cs42l45 FU 41 Mute Switch' 1" -- ] -- - Value { - PlaybackPriority 200 - PlaybackPCM "hw:${CardId},0" - PlaybackMixer "default:${CardId}" -- PlaybackVolume "cs42l45 FU 41 Channel Volume" -+ PlaybackMixerElem "cs42l45 Headphone" - JackControl "cs42l45 OT 43 Headphone Jack" - } - } -@@ -23,19 +15,15 @@ SectionDevice."Headphones" { - SectionDevice."Headset" { - Comment "Jack Microphone" - -- EnableSequence [ -- cset "name='cs42l45 FU 36 Mute Switch' 0" -- ] -- - DisableSequence [ -- cset "name='cs42l45 FU 36 Mute Switch' 1" -+ cset "name='cs42l45 FU 36 Channel Switch' 0" - ] - - Value { - CapturePriority 200 - CapturePCM "hw:${CardId},1" - CaptureMixer "default:${CardId}" -- CaptureVolume "cs42l45 FU 36 Channel Volume" -+ CaptureMixerElem "cs42l45 Jack Microphone" - JackControl "cs42l45 IT 31 Microphone Jack" - } - } -diff --git a/ucm2/sof-soundwire/sof-soundwire.conf b/ucm2/sof-soundwire/sof-soundwire.conf -index 895f479..7a00209 100644 ---- a/ucm2/sof-soundwire/sof-soundwire.conf -+++ b/ucm2/sof-soundwire/sof-soundwire.conf -@@ -117,7 +117,7 @@ If.spk_init { - If.hs_init { - Condition { - Type RegexMatch -- Regex "(cs42l43|rt5682|rt700|rt711|rt713(-sdca)?)" -+ Regex "(cs42l43|cs42l45|rt5682|rt700|rt711|rt713(-sdca)?)" - String "${var:HeadsetCodec1}" - } - True.Include.hs_init.File "/codecs/${var:HeadsetCodec1}/init.conf" --- -2.51.1 - - -From 5d0d2bd660b4378f802c94be3eadd8375c4c7a3a Mon Sep 17 00:00:00 2001 -From: Shuming Fan -Date: Tue, 9 Dec 2025 15:40:49 +0800 -Subject: [PATCH 3/3] ucm2: codecs: rt722: add condition to SetLED for mic - -Some SKUs don't have the internal mic, so the patch adds the condition to check -whether the SKU has the internal mic or not. - -Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/657 -Signed-off-by: Shuming Fan -Signed-off-by: Jaroslav Kysela ---- - ucm2/codecs/rt722/init.conf | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/ucm2/codecs/rt722/init.conf b/ucm2/codecs/rt722/init.conf -index c820e55..40f2458 100644 ---- a/ucm2/codecs/rt722/init.conf -+++ b/ucm2/codecs/rt722/init.conf -@@ -10,4 +10,11 @@ BootSequence [ - cset "name='rt722 FU0F Capture Volume' 63" - ] - --Macro [{ SetLED { LED="mic" Action="attach" CtlId="rt722 FU1E Capture Switch" } }] -+If.mic_init_rt722 { -+ Condition { -+ Type String -+ Needle "rt722" -+ Haystack "${var:MicCodec1}" -+ } -+ True.Macro [{ SetLED { LED="mic" Action="attach" CtlId="rt722 FU1E Capture Switch" } }] -+} --- -2.51.1 - diff --git a/sources b/sources index 9ce5bdb..db04fd8 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.15.tar.bz2) = 6cea9059265ef353a07f1b442004506f0f13883692ea35f03090282ca80db88055f470d2dca5bb54394fef0012711f0e9502d2d0f7fb66b27aa334bffb811559 -SHA512 (alsa-ucm-conf-1.2.15.tar.bz2) = 61dcbfe32ad912b793bf70d6f9e0e462353431b9589623ce8a7ec18b5dba48c230f5ba509e47384764625ae82f132babfbf62a8e5f4bb951377476ba147939e2 +SHA512 (alsa-lib-1.2.15.1.tar.bz2) = 36d79055537cf516dd435db56559ee59f3efbbea72ae0dbe5244191cfba4e181ed13100d908eb51bfd3a3be70aa87081df9b56921e7d24c3b3728e4374507236 +SHA512 (alsa-ucm-conf-1.2.15.1.tar.bz2) = 1c506cd6ed18ecf3f549dce9d945684594cbc3ca315b2c9d399dc5b8d6617209400053509dfb76ba5dd48a215803e5c0bbc654a40498bb8097ea6fa1baa90f9e SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 From 2bb0b91c53b6610b3990f51f09ad34152f39e37a Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 8 Jan 2026 15:48:16 +0100 Subject: [PATCH 66/68] update to 1.2.15.2 Signed-off-by: Jaroslav Kysela --- alsa-lib.spec | 7 +++++-- sources | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index c7f5e16..769a956 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,8 +2,8 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.15.1 -%define version_alsa_ucm 1.2.15.1 +%define version_alsa_lib 1.2.15.2 +%define version_alsa_ucm 1.2.15.2 %define version_alsa_tplg 1.2.5 %global lib_patch 0 @@ -178,6 +178,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Thu Jan 8 2026 Jaroslav Kysela - 1.2.15.2-1 +- update to 1.2.15.2 + * Fri Dec 19 2025 Jaroslav Kysela - 1.2.15.1-1 - update to 1.2.15.1 diff --git a/sources b/sources index db04fd8..23cfc23 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.15.1.tar.bz2) = 36d79055537cf516dd435db56559ee59f3efbbea72ae0dbe5244191cfba4e181ed13100d908eb51bfd3a3be70aa87081df9b56921e7d24c3b3728e4374507236 -SHA512 (alsa-ucm-conf-1.2.15.1.tar.bz2) = 1c506cd6ed18ecf3f549dce9d945684594cbc3ca315b2c9d399dc5b8d6617209400053509dfb76ba5dd48a215803e5c0bbc654a40498bb8097ea6fa1baa90f9e +SHA512 (alsa-lib-1.2.15.2.tar.bz2) = e9a13aafa9693be2ce501059db0ff9f83a0044d07019bd6b420617da44cc4e7df6f444da9eccf37577893ed81426dce44ecdb9a652d1db047e24a3b803da4a8a +SHA512 (alsa-ucm-conf-1.2.15.2.tar.bz2) = 32781f28814b360c1ddabafa23ab989be18b284990dbc013cb712a9c6c12d5236e493b1fb33582e5edfd73f282a6f2db82adf0754356a8337e1fa4bd2a656dac SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 From 454530bd653b061f3f453da187b4a89372b52d27 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 13 Jan 2026 08:29:06 +0100 Subject: [PATCH 67/68] update to 1.2.15.3 Signed-off-by: Jaroslav Kysela --- alsa-lib.spec | 7 +++++-- sources | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index 769a956..ee7b134 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -2,8 +2,8 @@ #define prever_dot .rc3 #define postver a -%define version_alsa_lib 1.2.15.2 -%define version_alsa_ucm 1.2.15.2 +%define version_alsa_lib 1.2.15.3 +%define version_alsa_ucm 1.2.15.3 %define version_alsa_tplg 1.2.5 %global lib_patch 0 @@ -178,6 +178,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Tue Jan 13 2026 Jaroslav Kysela - 1.2.15.3-1 +- update to 1.2.15.3 + * Thu Jan 8 2026 Jaroslav Kysela - 1.2.15.2-1 - update to 1.2.15.2 diff --git a/sources b/sources index 23cfc23..8a1161f 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (alsa-lib-1.2.15.2.tar.bz2) = e9a13aafa9693be2ce501059db0ff9f83a0044d07019bd6b420617da44cc4e7df6f444da9eccf37577893ed81426dce44ecdb9a652d1db047e24a3b803da4a8a -SHA512 (alsa-ucm-conf-1.2.15.2.tar.bz2) = 32781f28814b360c1ddabafa23ab989be18b284990dbc013cb712a9c6c12d5236e493b1fb33582e5edfd73f282a6f2db82adf0754356a8337e1fa4bd2a656dac +SHA512 (alsa-lib-1.2.15.3.tar.bz2) = 7fc0fa8a5ae02d3404d2c262c6a14fcbb8b08e25993eac86b9e89b8419ed4d293b422da77b3eb7a1930f26c316b638e5aa7bdba78b0ada9908b0362d132a0cc0 +SHA512 (alsa-ucm-conf-1.2.15.3.tar.bz2) = 079aeb45bc3f98448f6e48a1267db5d3f46a51d7060eb8275d0a084574e23eec34f07108610538e898c397fa24941ccf1bb7722c6b4bb0fa9c48904addc03973 SHA512 (alsa-topology-conf-1.2.5.tar.bz2) = 2eb4d8baf2dcbf0b631dd11dbf15bffc51694d9cc6931619e51787f3ba58d1a091d266e6721a3b737c040ec74a28270b93f39fb97f30a3227cf340dd646e5d51 From 44510615c1fb478490de273b6e24336dccbcae1c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 16 Jan 2026 03:36:37 +0000 Subject: [PATCH 68/68] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild --- alsa-lib.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/alsa-lib.spec b/alsa-lib.spec index ee7b134..df66e75 100644 --- a/alsa-lib.spec +++ b/alsa-lib.spec @@ -12,7 +12,7 @@ Summary: The Advanced Linux Sound Architecture (ALSA) library Name: alsa-lib Version: %{version_alsa_lib} -Release: 1%{?prever_dot}%{?dist} +Release: 2%{?prever_dot}%{?dist} License: LGPL-2.1-or-later URL: http://www.alsa-project.org/ @@ -178,6 +178,9 @@ rm %{buildroot}/%{_includedir}/asoundlib.h %{_datadir}/alsa/topology %changelog +* Fri Jan 16 2026 Fedora Release Engineering - 1.2.15.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + * Tue Jan 13 2026 Jaroslav Kysela - 1.2.15.3-1 - update to 1.2.15.3